Advertisement
new_it_level

Untitled

Mar 10th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import scapy.all as scapy
  3. from scapy.layers import http
  4.  
  5.  
  6. def sniff(interface):
  7. scapy.sniff(iface=interface, store=False, prn=p_s_p)
  8.  
  9.  
  10. def p_s_p(packet):
  11. if packet.haslayer(http.HTTPRequest):
  12. print(packet.show())
  13. if packet.haslayer(scapy.Raw):
  14. print(packet[scapy.Raw].load)
  15.  
  16.  
  17. sniff('eth0')
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement