Netcat Cheatsheet

Basic Syntax

nc [options] <host> <ports>

Listen as a simple TCP server

  • Single Connection
nc -l <port>
  • Listening to Multiple Connections
while true; do nc -l <port>; done

loops to accept sequential connections.