Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the batch host service scanning tool netcat for common network tools in Linux

Shulou Source: shulou.com Published: 2022-06-01 08:13:55 09月22日 Update

This article mainly explains the "Linux common network tools how to use batch host service scanning tool netcat", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Linux common network tools how to use batch host service scanning tool netcat" bar!

Netcat, also known as Swiss Army knife, is a network tool commonly used by hackers and system administrators. At first, it was developed for file transfer, but later developed many powerful functions, such as the ability to scan batch host services.

Earlier, I introduced another more commonly used bulk host service scanning tool: nmap.

The installation of netcat is also very simple, direct yum installation:

The code is as follows:

Yum install nc

Generally speaking, it is not recommended to install nc in the production environment, because nc can not only scan the host service in batches, but also support port agents and file transfer, which can easily cause security risks.

Batch host service scanning of netcat

Parameters commonly used by netcat when scanning:

-w set the timeout

-z input / output mode

-v displays the execution of the command

Common commands:

TCP protocol

The code is as follows:

Nc-v-z-w2 192.168.2.224 1-50

UDP protocol

The code is as follows:

Nc-v-z-W2-u 192.168.2.224 1-50

File transfer of netcat

Netcat can specify a local port number to enable listening mode, and the client can use the same port opened by the netcat connection to send messages, which will be displayed on the server.

Turn on monitoring

The code is as follows:

Nc-l 2389

Establish a connection

The code is as follows:

Nc localhost 2389

If the server output is redirected to a file, it can be used for file transfer:

The code is as follows:

Nc-l 2389 > test

Transfer file

The code is as follows:

Cat testfile | nc localhost 2389

If you are testing on a server, you can use & to switch nc to a background task while running client commands.

Thank you for your reading, the above is the content of "Linux common network tools how to use batch host service scanning tool netcat". After the study of this article, I believe you have a deeper understanding of how to use batch host service scanning tool netcat of Linux common network tools, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Services tools hosts host services commonly used code files scanning tools networks network tools transmissions commands learning information content customers modes ports end monitoring Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno MySQL Xiaomi Shulou Tech Info