netcat commands

10 commands, each with a one-line explanation. Click a command to copy it, or its title for details.

Commands 10 shown

  • nc -lvp 4444

    Start a netcat listener on port 4444

    nc · network · listen

  • nc 192.168.1.1 80

    Open a TCP connection to host on port 80

    nc · network · connect

  • nc -zv 192.168.1.1 20-80

    Scan ports 20-80 on a host (zero I/O mode)

    nc · network · scan

  • nc -lvp 4444 < file.tar.gz

    Send file to a remote listener

    nc · transfer · file

  • nc 192.168.1.1 4444 > file.tar.gz

    Receive a file from a netcat sender

    nc · transfer · file

  • nc -u 192.168.1.1 5005

    Connect using UDP instead of TCP

    nc · network · udp

  • echo -e "GET / HTTP/1.0 " | nc example.com 80

    Send a raw HTTP GET request with netcat

    nc · http · debug

  • nc -lvp 4444

    Wait for an incoming reverse shell connection

    nc · shell · debug

  • nc -v 192.168.1.1 22

    Connect to port and read service banner

    nc · network · banner

  • nc -w 3 192.168.1.1 80

    Set connection timeout to 3 seconds

    nc · network · timeout