3 ms·
Honest question: What do people use Socks for? Personally I haven’t used it since Firesheep...
by cpach 7y ago
Honest question: What do people use Socks for? Personally I haven’t used it since Firesheep...
- znpy 7y agoit's a no-conf-required vpn: ssh -D 8000 -q -C -N user@sshhost point firefox to use localhost:8000 as socksproxy, and all your internet traffic appears to have originate from sshhost.
- Joker_vD 7y agoChain three of them together, and you have a TOR-like circuit. Of course, since SSH doesn't work as a SOCKS5 client (last time I checked, at least), you'd have to forward some local ports to remote 22's and point SSH clients at localhost (forcing them to check the specific host key is also a fun challenge). Sadly, SSH doesn't support using port 0 for chosing a random local port. ssh -L 60001:host2:22 -N user1@host1 & ssh -L 60002:host3:22 -p 60001 -N user2@localhost & ssh -D 8000 -p 60002 -N user3@localhost &
- wahern 7y ago> SSH doesn't work as a SOCKS5 client 1) That's what the ProxyCommand config option is for. Most systems will have netcat or nc installed which do provide SOCKS client support 2) Or just use the -J option argument, which IIRC was originally implemented as a transformation to -oProxyCommand='ssh ... [netcat/nc]' but now is a simple transformation to the newer -W option argument, which doesn't depend on netcat/nc being installed on the intermediate host.
- Joker_vD 7y agoWhen I was looking into this problem neither -J nor -W options existed (that was a really long time ago).
- joflicu 7y agoWhat if I have a bash script that needs to contact sshhost - how do I point that script to localhost:8000?
- znpy 7y agoI'm sorry but I didn't understand your question -- could you elaborate on that a bit more?
- emmelaich 7y agoExcept for DNS? And anything else that doesn't use the proxy. You can apparently set the firefox flag "network.proxy.socks_remote_dns" Never tried it myself! Now, perhaps firefox does not need to do a lookup; it sends the hostname to the remote end. But best be safe?
- detaro 7y agouse it with SSH forwarding.
- fock 7y agoI use it for network-isolating my bubblewrap-containers (in lieu of sane documentation on securing user-dbus-sessions...). Just socat the socks-socket into a filesystems socket, pass that into the mount-namespace, run the reverse-socat-operation, pass the port to proxychains → internet in the container!