首先需要安装scapy包,点击下载

 

 1 from scapy.all import *
 2 
 3 def pack_callback(packet):
 4     print packet.show() 
 5     if packet['Ether'].payload:
 6         print packet['Ether'].src
 7         print packet['Ether'].dst
 8         print packet['Ether'].type
 9 
10     if packet['ARP'].payload:
11         print packet['ARP'].psrc
12         print packet['ARP'].pdst
13         print packet['ARP'].hwsrc
14         print packet['ARP'].hwdst
15 
16 filterstr="arp" 
17 
18 sniff(filter=filterstr,prn=pack_callback, iface='enp7s0f1', count=0) 

 

相关文章:

  • 2022-12-23
  • 2021-05-25
  • 2021-11-14
  • 2021-11-21
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2021-08-31
猜你喜欢
  • 2021-07-30
  • 2021-10-25
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
相关资源
相似解决方案