Netcat, also known as the Swiss Army Knife, is a common network tool for hackers and system administrators, originally developed for file transfer and later developed many powerful features, such as the ability to perform bulk host service scans.
Previously, another more common scanning tool for bulk host services was introduced: Nmap.
The installation of the Netcat is also very simple, with the direct Yum installation:
Yum Install NC
In general, it is not recommended to install NC in production environment, because NC can not only scan the bulk host service, but also support port agent, file transfer, which is easy to cause security hidden trouble.
Netcat Batch Host service scan
Netcat parameters that are commonly used when scanning:
-W set timeout time-Z input output mode-V show command execution procedure
Common commands:
TCP protocol Nc-v-z-w2 192.168.2.224 1-50UDP protocol nc-v-z-w2-u 192.168.2.224 1-50
Netcat File Transfer
Netcat can specify a local port number to turn on listening mode, the client can use the same Netcat connection to open the port to send information, the information will be displayed on the server.
Open Monitor Nc-l 2389 establish connection NC localhost 2389
If the output from the server is redirected to a file, it can be used for file transfer:
Nc-l 2389 > Test transfer file Cat Testfile | NC localhost 2389
If you are testing on a single server, you can use & to switch the NC to the background task in the command that runs the client.
Record, for the better of myself!
Linux Common Network tool: Netcat of batch host service scan