import os,threading
ip=input('请输入要检测的ip:').strip().split('.')[0:3]
ip='.'.join(ip)
def detect(i):
address=ip+'.%s'%i
res=os.popen('ping -n 2 %s '%address)
res=''.join(res)
if res.find('TTL=') != -1:
print(address)
for i in range(1,255):
threading.Thread(target=detect,args=(i,)).start()
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/288870.html