Scapy - The Python-Based Interactive Package Manipulation Programme & Library


Scapy is a powerful Python-based interactive parcel manipulation plan in addition to library.
It is able to forge or decode packets of a broad reveal of protocols, post them on the wire, capture them, shop or read them using pcap files, tally requests in addition to replies, in addition to much more. It is designed to let fast parcel prototyping yesteryear using default values that work.
It tin easily handgrip around classical tasks similar scanning, tracerouting, probing, unit of measurement tests, attacks or network discovery (it tin supplant hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, wireshark, p0f, etc.). It also performs really good at a lot of other specific tasks that around other tools can't handle, similar sending invalid frames, injecting your ain 802.11 frames, combining techniques (VLAN hopping+ARP cache poisoning, VoIP decoding on WEP protected channel, ...), etc.
Scapy supports Python 2.7 in addition to Python three (3.4 to 3.7). It's intended to travel cross platform, in addition to runs on many dissimilar platforms (Linux, OSX, *BSD, in addition to Windows).



Getting started
Scapy is usable either every bit a shell or every bit a library. For farther details, delight caput over to Getting started amongst Scapy, which is purpose of the documentation.

Scapy tin easily travel used every bit an interactive rhythm out to interact amongst the network. The next illustration shows how to post an ICMP Echo Request message to github.com, in addition to hence display the reply source IP address:
sudo ./run_scapy Welcome to Scapy >>> p = IP(dst="github.com")/ICMP() >>> r = sr1(p) Begin emission: .Finished to post 1 packets. * Received 2 packets, got 1 answers, remaining 0 packets >>> r[IP].src '192.30.253.113'

Resources
The documentation contains to a greater extent than advanced work cases, in addition to examples.
Other useful resources:

Installation
Scapy industrial plant without whatever external Python modules on Linux in addition to BSD similar operating systems. On Windows, you lot demand to install simply about mandatory dependencies every bit described inwards the documentation.
On around systems, using Scapy is every bit elementary every bit running the next commands:
git clone https://github.com/secdev/scapy cd scapy ./run_scapy
To produce goodness from all Scapy features, such every bit plotting, you lot mightiness desire to install Python modules, such every bit matplotlib or cryptography. See the documentation in addition to follow the instructions to install them.

Contributing
Want to contribute? Great! Please accept a few minutes to read this!