113 points · by ivanilves · 9y ago · 26 comments
https://github.com/apenwarr/sshuttle
Edit: xiringuito uses the SSH tun/tap feature, which does TCP-over-TCP tunneling (which performs badly[1]). sshuttle instead multiplexes the TCP streams over a single connection by capturing them and opening a new TCP session at the remote end. This means it does not need root permissions on the remote side, since it does not need any raw sockets or even create tap devices.
The SOCKS proxy and the port forwards (-L, -R etc) work similarly, it's just the tunnel feature which should be avoided since it forwards whole packets.
1) xiringuito is great for UDP. I had issues with RTP streams (UDP, random ports) running over sshuttle , though they run perfectly over SSH tun/tap.
2) I can run low-level non-TCP, non-UDP, IP protocols like OSPF over tunnels I create with tun/tap.
3) xiringuito does not require python. Not everybody loves python.
Overally I am a fan of sshuttle, but the way it's made prevented me from using it in a few cases, so I created xiringuito ;)
The following command is for cygwin on Windows.Can be customised for Mac OS or Linux
ssh -o StrictHostKeyChecking=no -C -f -q -D 7070 username@servername sleep 10 ; "/cygdrive/c/PortableApps/GoogleChromePortable/GoogleChromePortable.exe" --proxy-server="socks5://localhost:7070" &
Edit: typo
[1]: https://www.chromium.org/developers/design-documents/network...
ssh -D [bind_address:]port <server>There are some applications out there (e.g., tsocks) that hook the relevant system calls, but I find them quite annoying to use. (You need still something to trigger them, to say "this connection should be proxied") I've also had issues with proxy applications whose system call hooks fail to implement the system call. (E.g., one would return from connect immediately with success, every time, prior to the connection actually being established. When the connection failed to establish, the send/recv call would fail. The application would immediately loop back to re-establishing the connection. This caused an infinite loop, since the first DNS entry it was encountering was never going to work; it would have skipped it when the connect() call failed, but then, the connect call wasn't failing.)
OpenVPN is pretty much the ultimate VPN that can do anything and handle any situation. It is indistinguishable from regular web SSL traffic and can run on any port via TCP or UDP. It can even run in routed (TUN) or promiscuous (TAP) mode!
Once you've got OpenVPN setup there's no need to tunnel with ssh since OpenVPN is your tunnel.
I used to run an OpenVPN ISP named VPNOut many years ago. I had CTOs from large organizations begging me to tell them all the IPs I used so they could block it because apparently employees were using my service to access things that were normally blocked inside their corporate networks. Even to this day that problem exists: If you configure iptables to forward all ports to an OpenVPN daemon on both TCP and UDP you can get around basically any form of blocking that isn't IP-based. You can even do some tricks to make it look like regular web traffic for the initial SSL preamble to get around "intelligent" firewalls!
OpenVPN is the best!
`sshuttle` & `xiringuito` differences well explained (I hope).