def get(self):
nm = nmap.PortScanner()
result = nm.scan(hosts=hosts, arguments="-sP")
scan = result.get("scan", {})
ip_list = scan.keys()
d = {
"code": "200",
"response": ip_list,
"success": True,
}
self.write(d)
文章目录