
Despite this conclusion, Netcat is still a great networking tool with additional features, which will be deeply explained in future articles at LinuxHint. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Nmap also returns results faster than Netcat and keeps adding features like new scripts for Nmap Scripting Engine. The nc (or netcat utility is used for just about anything under the sun involving TCP, UDP, or UNIX sockets. Netcat doesn’t support multiple target scans despite it can be integrated into a script to achieve this goal, the tool itself has very few options for port scanning.Įven if not Nmap, alternatives like Zmap, Angry IP Scanner, Masscan, all of them explained at Nmap Alternatives, have a wide list of advantages over Netcat, including more versatility, option to scan multiple targets or even the whole internet, option to use the wildcard, packet fragmentation or the possibility to edit packet headers, to add custom scripts and a lot more. There is no reason to replace Nmap or any other port scanner for Netcat to scan ports.

Be cautious here because opening a port and let anyone connected execute arbitrary command on your site is DANGEROUS.

There is no -c or -e option in this netcat, but you still can execute a command after connection being established by redirecting file descriptors. Netcat is a real relic it is a great network tool but very limited for port scanning. The connection may be terminated using an EOF ('D').

If you are interested in this technique, you can read more on banner grabbing here. Nmap -sV -script=banner -p 21 198.54.116.246Īs you can see, the output is the same as with Netcat.
