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 :)

  • Squid is an HTTP proxy - so you can modify the data at the datagram layer (yes it's using a TCP protocol - but uses request/reply with no OOB messaging) - you can't play with packets using it. – symcbean Nov 7 '11 at 9:09

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

use scapy to sniff and alter packets

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.