application.py 文件源码

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

项目:bayip 作者: recall704 项目源码 文件源码
def get(self):
        nm = nmap.PortScanner()
        all_ip = nm.scan(hosts=hosts, arguments='-sL')
        all_scan = all_ip.get("scan", {})
        all_ip_list = all_scan.keys()

        online = nm.scan(hosts=hosts, arguments="-sP")
        online_scan = online.get("scan", {})
        online_ip_list = online_scan.keys()

        offline_ip_list =  list(set(all_ip_list).difference(set(online_ip_list)))

        d = {
            "code": "200",
            "response": offline_ip_list,
            "success": True,
        }
        self.write(d)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号