nc Command Examples

Redirect I/O into a network stream through this versatile tool. More information: https://manned.org/nc.

nc -l -p {{port}} < {{filename}}

nc {{host}} {{port}} > {{received_filename}}

nc -v -z -w {{timeout_in_seconds}} {{host}} {{start_port}}-{{end_port}}

nc -l -p {{port}} -e {{shell_executable}}

nc {{host}} {{port}} -e {{shell_executable}}

nc -l -p {{local_port}} | nc {{host}} {{remote_port}}

echo -e "GET / HTTP/1.1\nHost: {{host}}\n\n" | nc {{host}} 80