How to use tor

Some countries block tor,So this is a guide for that situation.

step 1

install proxychains-ng(https://github.com/rofl0r/proxychains-ng) need install from source code

install tor

sudo pacman -Sy tor

copy obfs4proxy from tor-browser to /usr/bin/obfs4proxy

sudo chmod +x /usr/bin/obfs4proxy

install tor-runit,start tor when host startup

sudo pacman -Sy tor-runit
sudo ln -s /etc/runit/sv/tor/ /run/runit/service/
sudo sv start tor

step 2

modify configuration files

----/etc/proxychains.conf----------
strict_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
socks5 127.0.0.1 9050

----/etc/tor/torrc----------------
SocksPort 127.0.0.1:9050
ExcludeExitNodes {cn},{hk},{ru}
ExcludeNodes {cn},{hk},{ru}
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy managed
Bridge obfs4 15.178.23.168:52384 783A7F4428AE519B892152EDA963477D85EE672A cert=xghcVpPhAAktOvVpYY6LDsE5iVayo9ADztSEwj0YcqGERxr3+v+RqScaOCC1O/uxeZinWA iat-mode=0
UseBridges 1
NewCircuitPeriod 900

step 3

run any program with proxychains,it will forward to tor automatically some program has inner proxy setting option,you can direct modify to "socks5 127.0.0.1:9050"

proxychains4 -q [program_name]

windows platform example

--file:torb.bat--
@echo off
"D:/Tor Browser/Browser/TorBrowser/Tor/tor.exe" -f torrc

--file:torrc--
SocksPort 127.0.0.1:9050
ExcludeExitNodes {cn},{hk},{ru}
ExcludeNodes {cn},{hk},{ru}
ClientTransportPlugin obfs4 exec D:\Tor Browser\Browser\TorBrowser\Tor\PluggableTransports\obfs4proxy managed
Bridge obfs4 15.178.23.168:52384 783A7F4428AE519B892152EDA963477D85EE672A cert=xghcVpPhAAktOvVpYY6LDsE5iVayo9ADztSEwj0YcqGERxr3+v+RqScaOCC1O/uxeZinWA iat-mode=0
UseBridges 1
NewCircuitPeriod 900

another method with normal http proxy or socks proxy

#--file--# /etc/tor/torcc (tor configuration file)
SocksPort 127.0.0.1:9050
ExcludeExitNodes {cn},{hk},{ru}
ExcludeNodes {cn},{hk},{ru}
#HttpsProxy 129.33.81.231:3128
#Socsk4Proxy 127.0.0.1:7890
#Socks5Proxy 127.0.0.1:7891
NewCircuitPeriod 900

how to establish to vpn through tor

openvpn --persist-remote-ip --persist-local-ip --persist-key --socks-proxy 127.0.0.1 9050 --config tcp-example.ovpn
openvpn --persist-remote-ip --persist-local-ip --persist-key --http-proxy [ip] [port] --config tcp-example.ovpn

udp type server,don't need proxy,direct to connect

openvpn --persist-remote-ip --persist-local-ip --persist-key --config udp-example.ovpn