I am not sure if such tool exists, but I want to dynamically modify certain packets sent using my wireless network. More specifically, I want to modify packets sent from multiple machines (including phones), and possibly inject additional packets. The first thing came to my mind is some kind of proxy. I searched the net for viable options, and the only thing that came up was Squid proxy. However, I could not any documentation on how to do this with Squid. Any helps would be appreciated :)
To some extent scapy can do it. For e.g. you can modify src dst port or ips, force checksum recomputation etc. I actually did this partially with the intention of modifying http packets. In my case modification meant inserting additional data (headers) which also invalidates tcp sequence numbers. However, the earlier mentioned changes can be done.
Some python code that i used with scapy
Note that upon sniffing scapy generates a copy of the original packet that you modify and send while you have to use some thing like ip tables to block the original packet.
If code is something you are not interested, scapy command line interface does the same