Skip to content

netcat

Usage

Test TCP connections

nc -v -z -w 3 [host] [port]

Options: * -v: verbose * -z: just check if the port is open and exit (without sending any data) * -w 3: 3 seconds timeout

If it exists with return code 0, it means that the connection succeeded.

Listen to a port

netcat -l [port]

Scan port range

nc -zvnw 1 [ip] 1-1000

  • -z Port scanning mode.
  • -v Verbose.
  • -n Do not resolve the host name.
  • -w 1 1s timeout.

cybercity

Connect through TOR

nc -v -X5 -x localhost:9050 [server] [port]

Reference

Basic usage