现在还有企业做网站的吗,免费浏览的网站,廊坊网站seo排名,2015年做啥网站致富转载自#xff1a;http://blog.sina.com.cn/s/blog_4b5039210100gn6k.html 未测试#xff0c;回头研究研究。 用pythonscapy写的#xff0c;只要双击.py文件即可#xff0c;扫描当地局域网的主机MAC地址#xff0c;并把结果写入文档保存。 代码如下#xff1a;用到注册表…转载自http://blog.sina.com.cn/s/blog_4b5039210100gn6k.html 未测试回头研究研究。 用pythonscapy写的只要双击.py文件即可扫描当地局域网的主机MAC地址并把结果写入文档保存。 代码如下用到注册表。运行前保证scapy安装成功 #!/usr/bin/env python#codingutf-8 import sysimport timeimport _winregfrom scapy import srp,Ether,ARP,conf key _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, rSYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{0E184877-D910-4877-B4C2-04F487B6DBB7})value,type _winreg.QueryValueEx(key,DhcpDefaultGateway) ffile(MAC_list.txt,a)scan_timetime.strftime(%Y-%m-%d %H:%M:%S, time.localtime())f.write(\nscan_time\n)f.write(\nThe Default Gateway of your host is :value[0]\n\n)ipscanvalue[0].encode(gbk)/24 conf.verb 0ans,unans srp(Ether(dstFF:FF:FF:FF:FF:FF)/ARP(pdstipscan),timeout 2)f.write(------ MAC ------ ----IP-----\n\n)num0for snd,rcv in ans: list_macrcv.sprintf(%Ether.src% %ARP.psrc%) f.write(list_mac\n) num 1 f.write(\ntotal : str(num) computers\n)f.close() 结果类似于 转载于:https://www.cnblogs.com/tk091/p/3412999.html