scan.py 文件源码

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

项目:kickthemout 作者: k4m4 项目源码 文件源码
def scanNetwork(network):
    # Function for performing a network scan with nmap with the help of the python-nmap module
    returnlist = []
    import nmap
    nm = nmap.PortScanner()
    a = nm.scan(hosts=network, arguments='-sP')

    for k, v in a['scan'].iteritems():
        if str(v['status']['state']) == 'up':
            try:
                returnlist.append([str(v['addresses']['ipv4']), str(v['addresses']['mac'])])
            except:
                pass

    # returnlist = hostsList array
    return returnlist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号