虐死周丽焕 发表于 2016-12-20 13:06

scapy+Python写局域网扫描器

代码:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from scapy.all import srp,Ether,ARP,conf
ipscan='192.168.1.1/24'
print 'scaning…………'
try:
    ans,unans = srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),timeout=2,verbose=False)
except Exception,e:
    print str(e)
else:
    for snd,rcv in ans:
      list_mac=rcv.sprintf("%Ether.src% - %ARP.psrc%")
      print list_mac截图:
http://odiyqfo1k.bkt.clouddn.com/o_1b4d91roi13btdj2k89lmjnb3a.jpg
原帖地址:http://www.bluexiang.com/?post=7
页: [1]
查看完整版本: scapy+Python写局域网扫描器