What is socat?
It allows to create pipe sockets between two independent network channels without needing SSH tunneling.
Socat Reverse Shell
Let’s try spawning a reverse shell from Windows Machine which is two hops away from attakcker machine. Attacker → Ubuntu → Windows
Let’s start socat listener on Ubuntu machine(PivotHost):
Socat will listen locally on port 8080 and forward all the traffic to port 80 on attacker machine (10.10.14.18).
After creating reverse shell with msfvenom, we will transfer it to Windows target:
Now, start msfconsole and spin up multi-handler:
Multi-handler is set up to listen on port 80.
Once we run the exploit on Windows target, we will get a reverse shell.