python爬虫

时间:2021-12-12 03:46:17
【文件属性】:

文件名称:python爬虫

文件大小:478B

文件格式:PY

更新时间:2021-12-12 03:46:17

Python

from socket import * tgtHost = input('') tgtPort = input('') c_sock = socket(AF_INET,SOCK_STREAM) tgtPorts = range(1,65535) setdefaulttimeout(3) for tgtPort in tgtPorts: try: c_sock.connect((tgtHost,tgtPort)) c_sock.send('123'.encode()) res = c_sock.recv(100) print('[+]Port :',tgtPort) print('[+]Propo ',res.decode()) except: print('[-]Port :',tgtPort) continue


网友评论