Skip to content

netcat cheatsheet


Listen on TCP port

nc -nl 1234

Specify on which IP address to listen on

nc -nl 1234

Sending files

Send a file to the remote host


nc -nlv PORT > /path/to/file


nc -nv IP PORT < /path/to/file

Host and download file from the server

Bind nc with content of the file on local port

nc -lp PORT < /path/to/file

Then grab a file from other host

nc HOST PORT > output.file