python-pcap模块解析mac地址

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

import pcap  
import binascii  
  
  
a = pcap.pcap()  
a.setfilter('arp')  
  
for i,j in a:  
    if binascii.hexlify(j[21])=="02":  
        print 'Mac Reply!'  
        for index in range(len(j)):  
            if index>=22 and index<=27:  
                   print binascii.hexlify(j[index])+":"  
        print "Over"  
        break