资源简介
python多线程批量端口扫描,代码里自己可设定端口范围。
代码片段和文件信息
# coding: utf-8
‘‘‘ 多线程 Socket TCP 端口扫描器 by: EvilCLAY‘‘‘
import socket
from datetime import datetime
from threading import Thread
class scan_port(Thread):
def __init__ (selfipa):
Thread.__init__(self)
self.ipa = ipa
def run(self):
try:
s = socket.socket(21)
res = s.connect_ex((self.ipa80))
s.settimeout(10)
print ipa
with open(‘ip.txt‘ ‘a‘) as fp:
if res == 0: # 如果端口开启 发送 hello 获取banner
fp.writ
评论
共有 条评论