Sample Header Ad - 728x90

SOCAT (only) reverse tunnel

0 votes
1 answer
2885 views
I have a situation where we are trying to get data from one network to another - specifically access to a private maven repo on a different network. Network 1 contains a maven repo. And network is protected by a couple SSH hops where port forwarding is disabled on sshd. - [Laptop], running a Docker Container with VPN into other network laptop - Docker Container vpn - [Jumpbox] jumpbox.vpn.network.org - [Server] server.vpn.network.org We have successfully run vscode-server on **server** and connect via:
socat tcp-listen:8080,fork EXEC:"ssh server.vpn.network.org nc localhost 8081"
This lets laptop hit localhost:8080 and it tunnels traffic into our server.vpn which then goes into netcat and sends the traffic into vscode server I figure it should be possible to do the opposite I'm just getting stuck. The goal would be to run a Socks5 proxy on laptop via something like
ssh -f -N -D 54321 localhost
And then make a socat call into server.vpn.network.org and then using the socks env vars I could run maven and have it proxy back through the connection etc. The approach I took was trying this:
socat -v TCP:localhost:54321 EXEC:"ssh server.vpn.network.org nc -lkv localhost 54321"
It was "sort" of working but kept dropping connection. I then tried a combo of fork and reuseaddr and they didn't seem to solve the issue. My next approach was to consider unix sockets or something funky - but I'm wondering if somebody knows how to make this work. Thanks.
Asked by Jeef (157 rep)
Jan 11, 2022, 08:51 PM
Last activity: Dec 23, 2024, 01:00 AM