Sunday, May 25, 2014
Building your own tools with Scapy & Python - DNS Spoofing
In a discussion about learning packet crafting tools, a colleague stated that he was learning HPing. I said to him, if you were going to learn to craft packets, you should dedicate your time to Scapy. Now before I go forward, I must say, in no way am I a HPing, Scapy or Python expert. My knowledge of these tools is enough to get my task done. I recommended Scapy because of my personal preference and bias.
The Construction Phase
I stated that with Scapy you can easily build your own tools. So I thought, if I say it, I need to show it. Demonstrating by examples, is the best way for any one to learn. Therefore, in this post, we will build a DNS Spoofing tool. Don't get worried by the number of lines. This tool can be built with under 20 lines However, because of the comments and building from a teaching perspective, I've used more lines than I should. So read on and have fun.
How do we know that this works? Glad you ask. This will be the subject of the next post!
Download dnsSpoof.py Script