← All tools

Netcat

Tool manual · Kali & common usage

Network · Beginner · Network lane

BeginnerNetwork Utility
Authorized usage only. Capture and inspect traffic only on systems and networks you own or have written permission to analyze.

What is Netcat?

Netcat (nc) reads and writes raw TCP/UDP. It is a Swiss-army knife for connectivity tests, simple listeners, and data transfer in labs.

Check if a port accepts connections, stand up a quick listener, or move text between shells — authorized use only.

Official website: Netcat · Documentation

When do you use it?

  • Test whether host:port is reachable through a firewall.
  • Simple chat/listener demo on localhost.
  • Banner grab on authorized services.

When not to use it

  • Not a full C2 framework — do not use for unauthorized access.
  • For HTTP APIs prefer curl; for scans prefer nmap.

Who uses it?

  • Network engineers
  • SOC analysts
  • Penetration testers

How do you use it? (typical flow)

  1. Install Netcat using the steps below (prefer Kali package or official installer).
  2. Confirm you have authorization for the target (lab VM, own system, or written scope).
  3. Run --help / man (or the Help section) to see current flags for your version.
  4. Start with a safe example from Basic commands against localhost or an authorized lab target.
  5. Record what you ran, what you observed, and any follow-up (filter, report, remediation).

Help & manual (like man / --help)

Every serious tool has a built-in way to look up flags. Learn these first so you are not stuck memorizing every option.

  1. 1. Help

    nc -h

    Flags differ slightly by netcat flavor.

  2. 2. Man page

    man nc

    OpenBSD nc man page on many Kali installs.

Kali Linux

Preinstalled on Kali as nc (openbsd-netcat or traditional). Check: nc -h

1. Installation

OSInstallation
Kali LinuxPreinstalled on Kali as nc (openbsd-netcat or traditional). Check: nc -h
Debian/Ubuntusudo apt install netcat-openbsd
macOSPreinstalled (nc)

2. Basic commands

  1. 1. Listen

    nc -lvnp 9000

    Listen on 9000 (flags vary by build).

  2. 2. Connect

    nc 127.0.0.1 9000

    Connect to your listener.

  3. 3. Port check

    nc -zv 127.0.0.1 22

    Zero-I/O probe if supported.

Options / flags

OptionPurpose
-lListen mode
-vVerbose
-zScan without sending data
-uUDP mode

5. Useful features

  • Listening vs connecting
  • Banner grabbing
  • Port connectivity tests

6. Practical examples

  1. Example 1: Listen

    nc -lvnp 9000

    Listen on 9000 (flags vary by build).

  2. Example 2: Connect

    nc 127.0.0.1 9000

    Connect to your listener.

  3. Example 3: Port check

    nc -zv 127.0.0.1 22

    Zero-I/O probe if supported.

7. Important notes

  • Admins use it to test whether a port is reachable through a firewall.
  • Authorized targets only — labs, systems you own, or written permission.
  • Prefer reading --help / man / official docs for your installed version; flags change over time.

Related course: networking fundamentals · network security · Commands: /commands#networking