Bypassing Firewall with Forward Relays
Lab Setup
Block port for incoming TCP packet on Victim Machine
Allow TCP packet on another port on Victim Machine
Check netcat communication between Attacker and Client
On Victim Machine
On the Kali Machine
Use Netcat Realy Backpipe to Access SSH Service
The First command makes a special type of file called a FIFO or named pipe. We call it backpipe because it is going to carry our responses back through the relay.
Now the second command makes a netcat listener that is allowed through the firewall. This Netcat listener will connect its standard input (0<) to the backpipe. We then forward the standard output of this Netcat listener to Netcat client, which connects to our localhost (127.0.0.1) on TCP port 22 where sshd listens. We then use the forward pipe (1>) to send data and receive responses simultaneously. We need a back and forward pipe because Netcat provides two-way communication.
For this you need to have access to the victim machine.
Victim Machine
p: Tells the mknod to create a FIFO
-l: Listener
-p: Port
Attacker Machine
Access SSH Through Netcat Relay
-p : To specify Port
REFERENCES
Last updated