nmap_scan.py 文件源码

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

项目:my_code 作者: seeicb 项目源码 文件源码
def nm_scan(ip):
    nm = nmap.PortScanner()
    nm.scan(ip, '0-65535')
    for host in nm.all_hosts():
        print('----------------------------------------------------')
        print('Host : %s (%s)' % (host, nm[host].hostname()), 'State : %s' % nm[host].state())
        for proto in nm[host].all_protocols():
            lport = sorted(nm[host][proto].keys())
            for port in lport:
                print('port : %s\tservice : %s' % (port, nm[host][proto][port]['product']))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号