Altering packets on the fly with scapy as a MITM
Assuming I managed to be in the middle of the communication between a client and a server (let's say that I open up a hotspot and cause the client to connect to the server only through my machine). How can I alter packets that my client sends and receives without interrupting my own communication with other services? There must be a way to route all of the packets the client both sends and is about to receive (before forwarding them to him) through my script. I think that the correct direction of going about accomplishing this is with iptables but not sure exactly what arguments would fit to