Tonight I decided to send ARP flood over the wireless link to find who is using it. This is a strange thing .. ok but it works pretty fine and quickly ..
First step is to build the custom packet.. I tested several suffs and i decided to keep the dpkt package. It support a large subset of packets and is easy to use. (Nobody for a MSN parser ?:)
The next step is to send and wait for answers. This has been a bit harder, meanly because I spent a long time looking how to send Ethernet Frames (not IP packets).
In other words, how RAW sockets works in python.
Here a small answer.
soc = socket.socket(socket.PF_PACKET, socket.SOCK_RAW) #create the raw-socket soc.bind(("ath0",0x0806)) # ether type for ARP soc.send(handly_crafted_packet) data = soc.receive(1024) ...
If you want a full example, checkout the arp-flood script I wrote.