

The above command means : Netcat listen to TCP port 1234. To open a simple socket server type in the following command. The output from has been received and echoed on the terminal. $ nc -v 80Ĭonnection to 80 port succeeded! For this type "GET index.html HTTP/1.1" and hit the Enter key twice. Now netcat is connected to on port 80 and its time to send some message. The very first thing netcat can be used as is a telnet program. In the following tutorial we are going to use all of them in different examples in different ways. To use netcat-traditional implementation use "nc.traditional" command To use netcat-openbsd implementation use "nc" command. Install on Ubuntu $ sudo apt-get install netcat-traditional netcat-openbsd nmap Nmap also comes with a netcat implementation called ncat. Ubuntu syntaptic package has netcat-openbsd and netcat-traditional packages available. Install Ncat on Ubuntu / Linux Mint / Linux Simply download and extract the files somewhere suitable. Windows version of netcat can be downloaded from Ncat has been developed by the nmap team is the best of all netcats available and most importantly its cross platform and works very well on windows.

On Ubuntu there are 3 packages called netcat-openbsd, netcat-traditional and ncat. Means it is available from multiple vendors.īut most of them have similar functionality.

So the first thing to do would be to setup netcat on your machine. This can be understood only by using and playing with it. Such a definition sounds too generic and make it difficult to understand what exactly this tool does and what is it useful for. More technically speaking, netcat can act as a socket server or client and interact with other programs at the same time sending and receiving data through the network. So basically netcat is a tool to do some bidirectional network communication over the TCP/UDP protocols. At the same time, it is a feature-rich network debugging and investigation tool, since it can produce almost any kind of correlation you would need and has a number of built-in capabilities. Netcat is designed to be a dependable "back-end" device that can be used directly or easily driven by other programs and scripts. The netcat manual defines netcat as Netcat is a computer networking service for reading from and writing network connections using TCP or UDP. Therefore its called the "Swiss-army knife for TCP/IP". So it is a small tool that is packed with lots of features. Its a "power version" of the traditional telnet program.Īpart from basic telnet functions it can do various other things like creating socket servers to listen for incoming connections on ports, transfer files from the terminal etc.
