First, Introduction
NetCat, a "Swiss Army Knife" in Web tools, has a version of Windows and Linux. Because it is short and short (the 1.84 version is 25k, the old version or the reduced version is even smaller), functional, is designed as a simple, reliable network tool, can transmit read and write data through TCP or UDP protocol. At the same time, it is a network application debug parser, because it can create a variety of different types of network connections as needed.
Second, the grammar
NC [-hlnruz][-g< Gateway ...>][-g< number of points >][-i< delay seconds >][-o< output file >][-p< communication port >][-s< Source address >][ -V ...] [-W< timeout of seconds;] [Host name] [Communication port ...]
-g< Gateway >-g< number of points >-H -i< delay seconds >-l -N -o< output file >-p< Communication port >-R -s< Source Address >- U -v Verbose output--with two--w< timeout seconds >-Z uses 0 in/out mode, only used when scanning communication ports.
Iii. Examples of application
Example 1: Port scan
Nc-v-w2192.168. 2.34 -
Example 2: File copy (from 192.168.2.33 copy files to 192.168.2.34)
In the 192. 168.2 1234 > test.txt in 192. 168.2 192.168. 2.34 < Test.txt
Example 3: Simple Chat
In the 192. 168.2 1234 in 192. 168.2 192.168. 2.34 1234 in this way, the two sides can communicate with each other. Use CTRL+c (or D) to exit.
Example 4: Remote execution (connect to host and execute)
Echo " get/http/1.0 "r"n"r"n"
Example 5: Remote connection (establish 80-port connection from local 1234 port to host.example.com, 5-second timeout)
1234 -w5
Linux NC Commands