What is Netcat?
Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.
It is designed to be a reliable “back-end” tool that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.
It provides access to the following main features:
* Outbound and inbound connections, TCP or UDP, to or from any ports.
* Featured tunneling mode which allows also special tunneling such as UDP to TCP, with the possibility of specifying all network parameters (source port/interface, listening port/interface, and the remote host allowed to connect to the tunnel.
* Built-in port-scanning capabilities, with randomizer.
* Advanced usage options, such as buffered send-mode (one line every N seconds), and hexdump (to stderr or to a specified file) of trasmitted and received data.
* Optional RFC854 telnet codes parser and responder.
在RHEL服务器里面NC是标配，无需用户自己安装，手册也很全 man nc就好了。
$ echo -n "GET / HTTP/1.0\r\n\r\n" | nc host.example.com 80 $ nc [-C] localhost 25 << EOF HELO host.example.com MAIL FROM: <firstname.lastname@example.org> RCPT TO: <email@example.com> DATA Body of email. . QUIT EOF
#模拟服务端 $ nc -l 1234 hello #模拟客户端 $ nc 127.0.0.1 1234 hello
Post Footer automatically generated by wp-posturl plugin for wordpress.