In simple words Netcat is a Unix utility which reads and writes data across network connections, using TCP or UDP protocol. That’s it. But because its such a reliable back end tool which offers rich features for network debugging and exploration it would stupid not learn about it.
It is used from the command terminal with
nc <host's IP> <port number>
This command creates a TCP connection to the given port on the given target host. Now you can use different switches for different ends. Calling a netcat help switch reveals all the switches.
Netcat can also function as a server, by listening for inbound connections on arbitrary ports and then doing the same reading and writing.
Now one might ask why not use telnet to connect to arbitrary ports? Its because telnet has the “standard input EOF” problem, so one must introduce calculated delays in driving scripts to allow network output to finish. whereas netcat stays running until the *network* side closes.
Below is a cheat sheet from SANS for netcat usage.