def Host_Discovery():
live_hosts=[]
a=str(raw_input(Fore.CYAN +"\nEnter network octects (net id) of ip e.g 192.168.10.*: "+Fore.RESET))
if a=='' or a is None or a.isalpha():
print Fore.RED+"Enter correct input...!!!"+Fore.RESET
return
else:
print Fore.GREEN + "\n\t\tLive Hosts are....."+Fore.RESET
ans,unans=arping(a,verbose=False)
print Fore.GREEN+"\n IP ADDRESS\t\t MAC ADDRESS\n"+Fore.RESET
for i in ans:
print Fore.GREEN+i[0].pdst +'\t\t'+ i[1].src + Fore.RESET
if i[0].pdst not in live_hosts:
live_hosts.append(i[0].pdst)
print Fore.GREEN + "\n%s hosts up..." %len(live_hosts)+Fore.RESET
评论列表
文章目录