- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
python最简洁易懂的扫描端口代码.运行绝对会很有惊奇感
from threading import Thread, activeCount import socket import os def test_port(dst,port): os.system('title '+str(port)) cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: indicator = cli_sock.connect_ex((dst, port)) if indicator == 0: print(port) cli_sock.close() except: pass if __name__=='__main__': dst = '192.168.0.22' i = 0 while i < 65536: if activeCount() <= 200: Thread(target = test_port, args = (dst, i)).start() i = i + 1 while True: if activeCount() == 2: break input('Finished scanning.')
售前咨询
售后咨询
备案咨询
二维码
TOP