Friday, June 26, 2009
The tale of a Malformed UDP Packet
Spent some 6 hours yesterday, and finally came up with a perl script that generates RAW udp data. Yeah I mean you can create a BAD udp packet as well. The best thing is that I did it without usi ng the Net Packet module. Though I read some of their functions, and how they are doing it. Especially the pack function's manual helped a lot. Plus I was looking at a C program from insecure.org which was in fact a DOS exploit for udp services. That helped a great deal in crafting the packet. One more thing besides looking at the udp and IP header formats was that the IP checksum is calculated by the kernel automatically. You need not to calculate it explicitly. Another challenge was the pack function, if you dont craft the fields properly the packet wont contain right values at right places. The way I could figure out this is by sending it across and capturing it through tcpdump. If Tcpdump reports errors then it means you messed something in your packet. Also you can save the capture in a file, and view it through wireshark, getting a nicer highlighted view of the fields.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment