Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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