Common Linux Network Tools: netcat for batch host service scanning and netcat for host service
Netcat, also known as Swiss Army knife, is a common network tool used by hackers and system administrators. It was initially developed to transfer files and subsequently developed many powerful functions, such as batch host service scanning.
We have introduced another more common batch host service scanning tool: nmap.
Netcat installation is also very simple. Install netcat directly using yum:
yum install nc
Generally, it is not recommended to install nc in the production environment. In addition to batch host service scanning, nc also supports port proxy and file transmission, which may cause security risks.
Netcat-Batch host service Scanning
Common netcat parameters used during scanning:
-W: Set the timeout value-z input/output mode-v: display the Command Execution Process
Common commands:
TCP nc-v-z-w2 192.168.2.20.1-50udp nc-v-z-w2-u 192.168.2.20.1-50
Netcat File Transfer
Netcat can specify a local port number to enable the listening mode. The client can use the same netcat connection to enable the port sending information, which will be displayed on the server.
Enable nc-l 2389 to establish a connection to nc localhost 2389
If you redirect the server output to a file, it can be used for file transfer:
Nc-l 2389> test transfer file cat testfile | nc localhost 2389
If the test is performed on a server, you can use & switch nc to the background task and run the client command.
Record, for better yourself!