Netcat command on Linux (Swiss network knife)
It can be useful for serving as a simple TCP proxy, writing simple client and server HTTP scripts, testing network server processes (daemons), and many other functions.
Here are some examples of using Netcat:
To connect to any host:port using netcat, you must provide the host address and port. It’s useful to see if a particular server is responding:
HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 1419
Date: Tue, 14 Apr 2015 02:11:11 GMT
Server: GFE/2.0
To use netcat as a process that listens on a certain port and sends the result to a file. It is useful to know what a client application is sending to a particular server:
Netcat can even be used to listen to a certain port and play the result on the terminal:
Netcat can be used to find out which ports are open on a given host. It is useful for verifying whether or not a particular service should be listening on the network:
This tool can either behave as a server or client application, in order to test the services offered by a particular server or client.