Connect to a host

Open a TCP connection to the host on port 80

nc 192.168.1.1 80

tool
netcat10 commands
tags
netcatncnetworkconnect

More netcat commands

  • nc -zv 192.168.1.1 20-80

    Check ports 20-80 on a host without sending data (-z)

  • nc -lvp 4444 < file.tar.gz

    Serve a file on port 4444 and wait until the receiver connects

  • nc 192.168.1.1 4444 > file.tar.gz

    Connect to the netcat sender and save the file

  • nc -u 192.168.1.1 5005

    Connect over UDP instead of TCP

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

    Send a raw HTTP GET request with netcat

all 10 netcat commands