Skip to content

Instantly share code, notes, and snippets.

@torsionion
Last active May 17, 2023 03:46
Show Gist options
  • Save torsionion/af87b06f394a74db910153340435f529 to your computer and use it in GitHub Desktop.
Save torsionion/af87b06f394a74db910153340435f529 to your computer and use it in GitHub Desktop.
Tor on iSH app

For running Tor from iSH app and proxying SSH/HTTP connections.

  1. apk add netcat-openbsd screen
  2. (Optional) edit /etc/tor/torrc
# This _needs_ no settings at all, just run `tor` (e.g., `screen -S tor`, then `tor`).

# For HTTP, configure proxy under wifi connection on iOS
# https://www.howtogeek.com/293676/how-to-configure-a-proxy-server-on-an-iphone-or-ipad/
# May also need to change DNS servers in Wi-Fi settings (e.g., 1.1.1.1 and 9.9.9.9)
HTTPTunnelPort 8118 # Use this port in Wi-Fi settings (any port should work)

# For ssh'ing to IPv6 hosts (also still works with IPv4). Use any Port number (default:9050) 
SocksPort [::1]:9150 IPv6Traffic
  1. Edit .ssh/config

https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts#Tunneling_the_SSH_Client_Over_Tor_with_Netcat

Host anon_*
  CheckHostIP no
  VerifyHostKeyDNS no # Also use netcat-openbsd package (see Step 1)
  Compression yes
  Protocol 2
  # This works for HTTP without the change for the SocksPort in `/etc/tor/torrc` noted above
  #ProxyCommand /usr/bin/nc -x localhost:9050 -X %h %p
  # For SSH to IPv6 and IPv4 hosts
  ProxyCommand /usr/bin/nc -X 5 -x localhost:9150 %h %p

Host anon_something
  Host some.ip.add.ress
  User root
  Port 22 # only needed for custom ports

or use torsocks...

For building obfs4proxy (untested)

https://gitlab.com/yawning/obfs4

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