The specific difference between netcat and telnet is:
- nc has the ability to act as a server (listen for connections),
- most nc variants have an option that links the socket to another program's input/output.
Both are quite legitimate features, but combined together they're also commonly used by malware as a convenient tool to bring up shell access without any authentication. That is, as soon as someone figures out a hole that lets them run one command e.g. through your website, they'll almost always use it to run nc -e
to get a fully featured interactive shell.
So the issue is not about security holes within netcat (indeed, netcat doesn't even perform any processing on the data it receives, whereas Telnet clients do); it's more about making it slightly more difficult to abuse security holes elsewhere.
(Note: There are several netcat tools that have similar names and options but come from different sources. The original netcat, GNU netcat, Nmap ncat all have the -e
option, meanwhile openbsd-netcat does not.)
I think the restriction is somewhat silly, but imposing it without any explanation, with just a rude error message, is even more so.