modifying sent and received packets on my machine using scapy

24 views Asked by At

I want to get do a inspect and check http/https requests and responses sent a certain website sent from my machine (running windows). I want to sniff packets sent and coming from this website, process the content of the http/https requests for instance, and then decide to either modify and send the request packet or block sending the request.

  • I've tried scapy's sniff(prn=process_packet,...) to modify the packet but the original packet is still being sent.
  • I've tried using the firewall to add a rule for blocking the website domain before starting sniff(prn=process_packet,...) and then delete the blocking rule inside process_packet(), send the packet and then added the blocking rule again, but then the firewall blocked the packets before reaching the network interface and I couldn't see any sniffed packets.
  • I am trying using C:\Windows\System32\drivers\etc\hosts to redirect requests to the website to localhost and then sniff these packets and send the modified packets but I am still trying to get it to work.

Any idea if I can combine the use of scapy along an other tool to automate modifying or blocking ?

0

There are 0 answers