主頁(yè) > 知識(shí)庫(kù) > linux下批量并行telnet對(duì)端端口的實(shí)現(xiàn)方法

linux下批量并行telnet對(duì)端端口的實(shí)現(xiàn)方法

熱門(mén)標(biāo)簽:曲阜地圖標(biāo)注app 開(kāi)封400電話(huà)辦理價(jià)格 地圖標(biāo)注小區(qū)項(xiàng)目入駐 哪個(gè)地圖標(biāo)注更清晰 漳州外呼系統(tǒng)怎么樣 凱立德劇院地圖標(biāo)注 4s店如何在百度地圖標(biāo)注 內(nèi)蒙古電信外呼系統(tǒng) 天津人工電銷(xiāo)機(jī)器人費(fèi)用
以下是以telnet對(duì)端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_22EOF>>telnet_result.txt ) >/dev/null 2>1
#加讓其并行執(zhí)行,>>telnet_result.txt記錄telnet過(guò)程中的日志
quit
EOF
done
cat telnet_result.txt | grep -B 1 \] | grep [1-9] | awk '{print $3}' | cut -d '.' -f 1,2,3,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.$i">>ip.list;done #使用for循環(huán)得到需要telnet主機(jī)的ip
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 //從本機(jī)telnet對(duì)端22端口能telnet通的只有192.168.14.91
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
station91:~/shell/telnet_port # cat telnet_result.txt //記錄的日志格式
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...

標(biāo)簽:南京 黔南 陽(yáng)泉 莆田 開(kāi)封 南陽(yáng) 武漢 綿陽(yáng)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《linux下批量并行telnet對(duì)端端口的實(shí)現(xiàn)方法》,本文關(guān)鍵詞  linux,下,批量,并行,telnet,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《linux下批量并行telnet對(duì)端端口的實(shí)現(xiàn)方法》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于linux下批量并行telnet對(duì)端端口的實(shí)現(xiàn)方法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章