Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to batch parallel telnet peer ports under linux

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to batch parallel telnet opposite port under linux". In daily operation, I believe that many people have doubts about how to batch parallel telnet opposite port under linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the question of "how to batch parallel telnet opposite port under linux". Next, please follow the editor to study!

The following is an example of telnet peer port 22

Station91:~/shell/telnet_port # pwd

/ root/shell/telnet_port

Station91:~/shell/telnet_port # cat telnet_port.sh

#! / bin/bash

Rm telnet_result.txt > / dev/null 2 > & 1

PORT_22=22

For i in $(cat ip.list)

Do (telnet $I $PORT_22telnet_result.txt &) > / dev/null 2 > & 1

# add & let it be executed in parallel. > > telnet_result.txt records the log during telnet.

Quit

EOF

Done

Cat telnet_result.txt | grep-B 1\] | grep [1-9] | awk'{print $3}'| cut-d'.'- f 1Jing 2jue 3jue 4 > telnet_alive.txt

Cat ip.list telnet_alive.txt | sort | uniq-u > telnet_die.txt

Station91:~/shell/telnet_port # for i in {88... 93}; do echo "192.168.14.Secreti" > > ip.list;done # use the for loop to get the ip that requires the telnet host

Station91:~/shell/telnet_port # cat ip.list

192.168.14.88

192.168.14.89

192.168.14.90

192.168.14.91

192.168.14.92

192.168.14.93

Station91:~/shell/telnet_port # ls

Ip.list telnet_port.sh

Station91:~/shell/telnet_port #. / telnet_port.sh &

[1] 16848

Station91:~/shell/telnet_port # ls

Ip.list telnet_alive.txt telnet_die.txt telnet_port.sh telnet_result.txt

[1] + Done. / telnet_port.sh

Station91:~/shell/telnet_port # cat telnet_alive.txt / / only 192.168.14.91 can telnet from the native telnet peer port 22

192.168.14.91

Station91:~/shell/telnet_port # cat telnet_die.txt

192.168.14.88

192.168.14.89

192.168.14.90

192.168.14.92

192.168.14.93

Log format of station91:~/shell/telnet_port # cat telnet_result.txt / / record

Trying 192.168.14.91...

Connected to 192.168.14.91.

Escape character is'^]'.

Trying 192.168.14.88...

Trying 192.168.14.89...

Trying 192.168.14.90...

Trying 192.168.14.92...

Trying 192.168.14.93...

At this point, the study of "how to batch parallel telnet peer-to-peer ports under linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report