Skip to content

Instantly share code, notes, and snippets.

@morteza-mori
Last active May 23, 2018 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morteza-mori/e879bce95aa906fb15042a84fa8f2c0a to your computer and use it in GitHub Desktop.
Save morteza-mori/e879bce95aa906fb15042a84fa8f2c0a to your computer and use it in GitHub Desktop.
privoxy + tor
.config file
###############################
tor privoxy docker setting
apt-get install tor
apt-get install privoxy
nano /etc/privoxy/config
# forward-socks4 / socks-gw.example.com:1080 .
forward-socks4 / 127.0.0.1:9150 .
forward-socks5 / 127.0.0.1:9150 .
# forward-socks5t / 127.0.0.1:9050 .
# forwarded-connect-retries is mainly interesting for socks4a
# 6.8. socket-timeout
# Number of seconds after which a socket times out if no data is
# socket-timeout 300
socket-timeout 300
nano /etc/tor/torrc
SOCKSPort 9150 # Default: Bind to localhost:9050 for local connections.
service tor restart
service privoxy restart
apt-get install jq curl
echo $(curl -s http://ip-api.com/json | jq -r ".country,.city")
nano .bashrc
alias whereiam='echo $(curl -s http://ip-api.com/json | jq -r ".country,.city")'
alias x="export http_proxy='127.0.0.1:8118'"
alias dx="export http_proxy=''"
mkdir /etc/systemd/system/docker.service.d
/etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=127.0.0.1:8118"
systemctl reload docker.service
mv /etc/systemd/system/docker.service.d/http-proxy /etc/systemd/system/docker.service.d/http-proxy.conf
systemctl show docker --property Environment
docker restarrt
whereiam
@morteza-mori
Copy link
Author

morteza-mori commented Jul 5, 2017

apt install openvpn
apt install screen
screen
openvpn --config /root/parspooyesh2.ovpn --route-nopull
ip route add 4.2.2.4 dev tun0
apt install mtr
mtr 4.2.2.4
######################################################
My traceroute [v0.87]
dev-docker (0.0.0.0) Wed Jul 5 15:49:25 2017
Resolver: Received error response 2. (server failure)er of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev

  1. 10.10.10.1 0.0% 2 124.5 124.6 124.5 124.7 0.0
  2. 46.101.128.254 0.0% 2 143.4 138.0 132.6 143.4 7.6
  3. 138.197.250.148 0.0% 2 124.7 124.7 124.7 124.7 0.0
  4. ix-ae-45-0.tcore1.fr0-frankfurt.as6453.net 0.0% 1 137.0 137.0 137.0 137.0 0.0
  5. ???
  6. ae-1-3107.edge5.frankfurt1.level3.net 0.0% 1 125.1 125.1 125.1 125.1 0.0
  7. d.resolvers.level3.net 0.0% 1 126.6 126.6 126.6 126.6 0.0
    ##################################################################################

#roting to tun0
tcpdump -nti any port53
add ip route for 53 resolve ip
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.10.10.26 netmask 255.255.255.255 destination 10.10.10.25
inet6 fe80::29a6:1abb:c121:9ccf prefixlen 64 scopeid 0x20
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3 bytes 144 (144.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment