Implementations #
The most popular implementations of netcat are:
- nmap implements
ncat
- GNU netcat
- OpenBSD netcat is simply called
nc
While all serve the same purpose, they differ in feature richness.
netcat #
Has a feature, that allows it to be used to execute a command with post data from STDIN. That makes netcat a good standalone server and more versatile than nc.
nc #
port scan with nc #
nc -z host.example.com 20-30
send a mail with nc #
As copied from its man page:
nc localhost 25 << EOF
HELO host.example.com
MAIL FROM:<user@host.example.com>
RCPT TO:<user2@host.example.com>
DATA
Body of email.
.
QUIT
EOF