provocativo_
back to the arsenal
// arsenal·Linux & ShellBeginnerFOSS

Netcat/nc/

The 'TCP/IP Swiss Army knife' — read/write to arbitrary TCP/UDP sockets.

Linux & Shell

$ netcat --help

Netcat

// what it is

Description

Ancient (1995!) and indispensable. Speaks raw TCP/UDP — used for port scanning, file transfer, banner grabbing, and the canonical reverse/bind shell setups. Several implementations exist (Hobbit's original, OpenBSD nc, ncat from the Nmap project).

// use cases

What people use it for

  • Reverse / bind shell listener
  • Port banner grab
  • Ad-hoc file transfer

// commands

The commands you'll type

Listen on 4444

$ nc -lvnp 4444

Banner grab

$ nc target.tld 80 <<< 'GET / HTTP/1.0\r
\r
'

File transfer

$ nc -lvnp 9001 > out.bin   # receiver
nc target.tld 9001 < in.bin   # sender

// facts

category
Linux & Shell
platforms
LIN · WIN · MAC
license
FOSS
difficulty
Beginner

// related in Linux & Shell