The program runs fine when I am not trying to filter http links but it shows almost nothing when I use the code, I don't see any problem in the code and I have already used pip install scapy_http
.
import scapy.all as scapy
from scapy.layers import http
def sniff(interface):
scapy.sniff(iface=interface, store=False , prn= process_sniffed_packet)
def process_sniffed_packet(packet):
if packet.haslayer(http.HTTPRequest):
print(packet)
sniff('eth0')
Blank screen until i press ctrl+c
. It shows some weird links after around 20 seconds but I am not on those pages.
I think your code works fine :)
packet.show()
instead of print packet
- it will be easier to investigate what you see
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.