使用python实现扫描端口示例
2014-03-29 00:00
495 查看
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.')
相关文章推荐
- 使用python实现扫描端口示例
- python实现的多线程端口扫描功能示例
- Python实现的端口扫描功能示例
- python实现socket端口重定向示例
- 使用Python的twisted和socket模块实现端口的负载分发
- Python使用PyCrypto实现AES加密功能示例
- 使用python实现递归版汉诺塔示例(汉诺塔递归算法)
- Python实现在tkinter中使用matplotlib绘制图形的方法示例
- Python实现局域网IP端口扫描
- Python使用sort和class实现的多级排序功能示例
- Python 第三方模块pythonnmap来实现高效的端口扫描
- Python使用PyCrypto实现AES加密功能示例
- Python使用pylab库实现绘制直方图功能示例
- Python小练习-实现简单端口扫描~
- 使用python实现strcmp函数功能示例
- 使用Python实现Hive的UDF示例
- Python之——实现高效的端口扫描
- Python使用matplotlib实现基础绘图功能示例
- Python简单实现的代理服务器端口映射功能示例
- Python使用Selenium模块实现模拟浏览器抓取淘宝商品美食信息功能示例