What is Netcat?

Netcat is a networking utility with the help of TCP/IP protocol which reads and writes data across network connections. Netcat is built as a secure back-end tool and can be used to send files from a client to a server and back directly with other programmes and scripts.

At the same time, it's a network debugging and exploration platform rich in features that can define network parameters while also creating a tunnel connection to a remote host.

Although Netcat can do many things, its primary objective and most desirable features are as follows −

  • To build a connection from the server to the client, create an initial socket.

  • If linked, a second socket will be created automatically by Netcat to transmit files from the server to the client and vice versa.

Let us take two computer terminals, the first terminal acts as the server and the second terminal as the client.

Using Netcat, the PC can be converted into a server. Now if we want to begin as a server that listens at port 2399 −

$ nc -l 2399

Also we can use the server to connect to the recently opened port (2399) from the client side −

$ nc localhost 2399

When the connection established, we can now write to the server from the client −

$ nc localhost 2399 Hai Server

Some of the Host that GNU Netcat should compile and work without changes are as follows −

  • Linux (test host − alphaev67-unknown-linux-gnu)

  • FreeBSD (test host − i386-unknown-freebsd4.9)

  • NetBSD (test host − i386-unknown-netbsdelf1.6.1)

  • SunOS/Solaris (test host − sparc-sun-solaris2.9)

  • MacOS X (test host − powerpc-apple-darwin6.8)

The remaining operating systems can be supported with minor source modifications.


The capabilities of Netcat are as follows −

  • Capability of using any local source port

  • Port-scanning capabilities

  • Having Slow send mode

  • Outbound or inbound and TCP or UDP connections from any port or to any port

  • Full DNS forward and reverse checking

  • Loose source routing