netcat is a computer networking utility for reading from and writing to network connections using TCP or UDP.
Netcat is a tool that reads and writes data across network connections, using TCP or UDP protocol. Netcat has been referred to as the TCP/IP / networking swiss army knife. In this article we’ll look at different applications of netcat and how it can be useful in day to day activities of a pentester, security professional, sysadmin etc… If you would like to test out these commands in a lab environment without the need to install them on your own machine have a look at my scenario on CYBERRANGES using the link below.
There are several variants of netcat but most of the core functionality and command line options are very similar. Netcat having being initially written to be used on linux the variants are linux based but you can still have netcat on windows.
Netcat traditional is the original implementation and was written by a guy known as Hobbit. This does not typically come preinstalled unless you are using a distro like kali linux. It is no longer maintained and is on version 1.10. By running apt search netcat on an ubuntu/debian based machine, it appears as netcat or netcat-traditional.
GNU Netcat is a rewrite of the original netcat to make it more portable with new features and fully GNU compliant. This means it can be easily installed on almost all linux distros. This version is not available via package manager. It seems to also be no longer maintained as it’s latest version is 0.7.1 from 2004.
To get it you can download the source files from the project website http://netcat.sourceforge.net then compile it. You need gcc and make to install successfully. The binary will be installed to /usr/local/bin/netcat. Below are the commands to use.