作者:gnuhpc
出处:http://www.cnblogs.com/gnuhpc/

__author__ = 'gnuhpc'

import telnetlib,socket

IP={}

def parseTel(line):
    parseArray = line.split()
    IP[parseArray[0]]=parseArray[1]

with open("tel.lst") as f:
    for line in f:
        parseTel(line)

for (ip,port) in  IP.items():
    try:
        tn = telnetlib.Telnet(ip,port,1)
        tn.close()
    except socket.error, why:
        print ip,port,why

相关文章:

  • 2022-03-01
  • 2022-12-23
  • 2021-12-05
  • 2021-11-27
  • 2022-12-23
  • 2021-11-30
  • 2021-06-28
  • 2021-04-04
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案