- Install Python 3.x.
- Download and install Scapy.
- (For non-Linux platforms): Install libpcap and libdnet and their Python wrappers.
- (Optional): Install additional software for special features.
- Run Scapy with root priviledges.
Each of these steps can be done in a different way dependent on your platform and on the version of Scapy you want to use.
This document is for scapy3k. It requires python 3.x. See original scapy homepage <http://www.secdev.org/projects/scapy/> for Scapy v2.x or earlier.
Note
In scapy3k and Scapy v2.x use from scapy.all import * instead of from scapy import *.
The following steps describe how to install (or update) Scapy itself. Dependent on your platform, some additional libraries might have to be installed to make it actually work. So please also have a look at the platform specific chapters on how to install those requirements.
Note
The following steps apply to Unix-like operating systems (Linux, BSD, Mac OS X). Windows, currently is under development.
Make sure you have Python installed before you go on. Depending on your system you may have to use python3 and pip3 or python and pip for python version 3.x.
Easiest way to install latest scapy3k package is using pip.
$ pip3 install scapy-python3
Clone GitHub repository to a temporary directory and install it in the standard distutils way:
$ cd /tmp
$ git clone https://github.com/phaethon/scapy
$ cd scapy
$ sudo python3 setup.py install
If you always want the latest version with all new features and bugfixes, use Scapy’s GitHub repository:
Install git version control system. For example, on Debian/Ubuntu use:
$ sudo apt-get install git
Check out a clone of Scapy’s repository:
$ git clone https://github.com/phaethon/scapy
Install Scapy in the standard distutils way:
$ cd scapy
$ sudo python3 setup.py install
Then you can always update to the latest version:
$ git pull
$ sudo python3 setup.py install
WEP decryption. unwep() needs PyCrypto. Example using a Weplap test file:
>>> enc=rdpcap("weplab-64bit-AA-managed.pcap")
>>> enc.show()
>>> enc[0]
>>> conf.wepkey=b"AA\x00\x00\x00"
>>> dec=Dot11PacketList(enc).toEthernet()
>>> dec.show()
>>> dec[0]
ipython. For interactive sessions using ipython can be great advantage. Install using pip3
Scapy can run natively on Linux, without libdnet and libpcap.
Just use the standard packages:
$ sudo apt-get install tcpdump python3-crypto ipython3
This section needs updating. In general installing python3, pip for python3, libpcap, libdnet, scapy3k using pip package scapy-python3 should do the job. Corrections are welcome...
Scapy is primarily being developed for Unix-like systems and works best on those platforms. scapy3k has not yet been ported to Windows. Use at your own risk.