python局域网ip扫描示例分享
2014-04-03 00:00
816 查看
#!/usr/bin/python # -*- coding: utf-8 -*- from scapy.all import * from time import ctime,sleep import threading TIMEOUT = 4 conf.verb=0 def pro(cc,handle): dst = "192.168.1." + str(cc) packet = IP(dst=dst, ttl=20)/ICMP() reply = sr1(packet, timeout=TIMEOUT) if not (reply is None): handle.write(reply.src+" is online"+"\n") #print reply.src, "is online" def main(): threads=[] f=open('ip.log','a') for i in range(2,254): t=threading.Thread(target=pro,args=(i,f)) threads.append(t) print "main Thread begins at ",ctime() for t in threads : t.start() for t in threads : t.join() print "main Thread ends at ",ctime() if __name__=="__main__" : main();
相关文章推荐
- python局域网ip扫描示例分享
- 谁那有j2EE的 在局域网内IP扫描得到在线机器的相关信息源代码 麻烦分享一下 谢谢了。
- Python实现扫描局域网活动ip(扫描在线电脑)
- Python实现局域网IP端口扫描
- python多线程实现局域网活跃IP扫描
- Python -- 扫描局域网活跃IP
- wifi智能插座 一键扫描局域网内插座Ip及其它信息 Python源代码API
- python读文件逐行处理的示例代码分享
- python获取局域网占带宽最大3个ip的方法
- 分享一个查IP归属地的python脚本
- Android扫描局域网内IP并建立Socket连接,和PC服务端收发数据
- 解决同一个局域网两个DHCP冲突问题--涉及到局域网IP扫描,主机操作系统扫描,mac地址查询
- Python设计模式编程中解释器模式的简单程序示例分享
- python求素数示例分享
- python使用IP代理示例及出错解决方法
- .Net中扫描局域网IP列表的几种方法
- python实现局域网ip地址扫描
- python定时器使用示例分享