Scapy is a network packet manipulation tool for use with Python.
What is Scapy?

Scapy is a network packet manipulation program for use with Python. It is able to:
- forge or decode packets of a wide number of protocols
- send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery. (it can replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tethereal, p0f, etc.)
What makes scapy different from most other networking tools?
You can build whatever packets you want, stack ARP on top of 802.11, use double 802.1q encapsulation or send an ICMP packet with padding, and send them over the wire.
Scapy does not interpret answers: unlike most tools, it won't say “this port is open” instead of “I received a SYN-ACK”. You are free to interpret the packets as you want
It reports everything: you see the padding, the reserved fields... Nothing is dismissed
Useful links:
- Website: Scapy Project
- Documentation: Read Scapy's documentation on ReadTheDocs
- Issue Tracker: Scapy on Github
- Scapy Chat: Scapy on Gitter