import nmap
import socket#这个是网络基本协议的模块
if __name__=='__main__':
nm = nmap.PortScanner()
addr=socket.gethostbyname(input('网站名:'))
print(addr)
ports=nm.scan(addr,'1-65535')#
print(ports)
#ports=nm[addr].tcp(80)
try:
for port,value in ports['scan'][addr]['tcp'].items():
print(port,'\t',value)
except:
print(ports)
python-nmap
最新推荐文章于 2024-07-13 17:52:48 发布