netcat — quick reference

Xavier Briand
My journey into Cybersecurity
1 min readMar 28, 2019

Arbitrary TCP and UDP connections and listens

Scan for listening daemon, without sending data

BSD
> nc -z example.com 20-30
GNU
> nc -zv example.com 20-30

Client/Server

BSD
> nc -l 1234 # server
> nc example.com 1234 # client> nc -l 1234 > out.txt # server> nc example.com 1234 < in.txt # clientGNU
> nc -lp 1234
BSD man page

--

--

Xavier Briand
My journey into Cybersecurity

Design & manage software, services, roles, organisations, cultures, games, and my garden.