Net_Zapper_1.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:NetZapper 作者: NetZapper 项目源码 文件源码
def OS_Detection():
    targetip=str(raw_input( Fore.CYAN +"\nEnter Target IP: " +Fore.RESET))
    print ''
    if targetip == '' or targetip is None:
        print Fore.RED+"Enter correct input...!!!"+Fore.RESET
    if targetip==self_ip:
        print Fore.GREEN+EX+"%s belongs to Linux family..." % targetip + Fore.RESET
        return
    ans,unans=arping(targetip,timeout=2,verbose=False)
    ip=IP()
    ip.dst=targetip
    icmp=ICMP()
    icmp.type=8
    icmp.code=0
    z=sr1(ip/icmp,timeout=10,verbose=False)
    if z is None and len(ans)==1:
        print Fore.YELLOW+"Host is up...but seems to be filtered..." + Fore.RESET       
    elif z is None and len(ans)==0:
        print Fore.RED+"Host is unreachable..."+Fore.RESET
    else:
        if z.ttl==128:
            print Fore.GREEN+"%s belongs to Windows family..." % targetip + Fore.RESET
        elif z.ttl==64:
            print Fore.GREEN+"%s belongs to Linux family..." % targetip + Fore.RESET
        elif z.ttl==56:
            print Fore.GREEN+"%s belongs to Mac family..."% targetip + Fore.RESET
        else:
            print Fore.GREEN+"Unknown OS..." + Fore.RESET
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号