python写外网收集信息器

简单化,知道IP去扫描ip

import socket
from socket import *
a=input('请输入域名:')
try:
ip=gethostbyname(a)
print('[+]'+ip) print('开放的端口有:')
def postscanner(host,port):
try:
s=socket(AF_INET,SOCK_STREAM)
s.connect((host,port))
print('[+]%d open'%port)
s.close()
except:
pass def main():
setdefaulttimeout(1)
for p in range(1,1024):
postscanner('14.215.177.38',p) except Exception as e:
print(e) if __name__ == '__main__':
main()

python写外网收集信息器

上一篇:杭电OJ——1198 Farm Irrigation (并查集)


下一篇:unsafe clr sql 部署向导