标签:ges name imp 分享 can pre pos 扫描 time
简单化,知道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()
标签:ges name imp 分享 can pre pos 扫描 time
原文地址:http://www.cnblogs.com/haq5201314/p/7857032.html