def postAS(hostslist):
hosts = [host for host, x in hostslist.items()]
macs = [mac for x, mac in hostslist.items()]
try:
nm = nmap.PortScanner()
except Exception, ex:
try:
print "["+Fore.RED+"-"+Style.RESET_ALL+"] Exception('%s') occured\n\t%s-> Errno : %d\n\t-> Error : %s"%(type(ex).__name__,Style.DIM,ex.args[0],ex.args[1])
except:
print "["+Fore.RED+"-"+Style.RESET_ALL+"] %s"%(str(ex))
sys.exit(0)
try:
FiFlag, isDHCP = False, False
isDHCPlst = []
try:
isDHCPlst=DHCPDiscover()
except:
pass
for host, mac in hostslist.items():
if host in isDHCPlst:
isDHCP = True
else:
isDHCP = False
nm.scan(str(host), arguments="-O")
FiFlag = prettyPrint(host,mac, nm, isDHCP)
if not(FiFlag):
print "["+Fore.YELLOW+"*"+Style.RESET_ALL+"] Warning : couldn't detect to OS"
except Exception, ex:
print "["+Fore.RED+"-"+Style.RESET_ALL+"] Error in OS fingerprinting, continuing..."
评论列表
文章目录