Download and Installation


  1. Install Python 2.5.
  2. Download and install Scapy.
  3. (For non-Linux platforms): Install libpcap and libdnet and their Python wrappers.
  4. (Optional): Install additional software for special features.
  5. 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.

At the moment, there are two different versions of Scapy:

  • Scapy v1.x. It consists of only one file and works on Python 2.4, so it might be easier to install. Moreover, your OS may already have a specially prepared packages or ports for it. Last version is v1.2.2.
  • Scapy v2.x. The current development version adds several features (e.g. IPv6). It consists of several files packaged in the standard distutils way. Scapy v2 needs Python 2.5.


In Scapy v2 use from scapy.all import * instead of from scapy import *.

Installing Scapy v2.x

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.


The following steps apply to Unix-like operating systems (Linux, BSD, Mac OS X). For Windows, see the special chapter below.

Make sure you have Python installed before you go on.

Latest release

Download the latest version to a temporary directory and install it in the standard distutils way:

$ cd /tmp
$ wget
$ unzip
$ cd scapy-2.*
$ sudo python install

Alternatively, you can execute the zip file:

$ chmod +x
$ sudo ./


$ sudo sh


$ mv /usr/local/bin/scapy
$ sudo scapy


To make a zip executable, some bytes have been added before the zip header. Most zip programs handle this, but not all. If your zip program complains about the zip file to be corrupted, either change it, or download a non-executable zip at

Current development version

If you always want the latest version with all new features and bugfixes, use Scapy’s Mercurial repository:

  1. Install the Mercurial version control system. For example, on Debian/Ubuntu use:

    $ sudo apt-get install mercurial

    or on OpenBSD:

    $ pkg_add mercurial
  2. Check out a clone of Scapy’s repository:

    $ hg clone
  3. Install Scapy in the standard distutils way:

    $ cd scapy
    $ sudo python install

Then you can always update to the latest version:

$ hg pull
$ hg update
$ sudo python install

For more information about Mercurial, have a look at the Mercurial book.

Installing Scapy v1.2

As Scapy v1 consists only of one single Python file, installation is easy: Just download the last version and run it with your Python interpreter:

$ wget
$ sudo python

On BSD systems, you can also try the latest version of Scapy-bpf (development repository). It doesn’t need libpcap or libdnet.

Optional software for special features

For some special features you have to install more software. Platform-specific instructions on how to install those packages can be found in the next chapter. Here are the topics involved and some examples that you can use to try if your installation was successful.

  • Plotting. plot() needs Gnuplot-py which needs GnuPlot and NumPy.

    >>> p=sniff(count=50)
    >>> p.plot(lambda x:len(x))
  • 2D graphics. psdump() and pdfdump() need PyX which in turn needs a LaTeX distribution. For viewing the PDF and PS files interactively, you also need Adobe Reader (acroread) and gv (gv).

    >>> p=IP()/ICMP()
    >>> p.pdfdump("test.pdf")
  • Graphs. conversations() needs Grapviz and ImageMagick.

    >>> p=readpcap("myfile.pcap")
    >>> p.conversations(type="jpg", target="> test.jpg")
  • 3D graphics. trace3D() needs VPython.

    >>> a,u=traceroute(["", "",""])
    >>> a.trace3D()
  • WEP decryption. unwep() needs PyCrypto. Example using a Weplap test file:

    >>> enc=rdpcap("weplab-64bit-AA-managed.pcap")
    >>> enc[0]
     >>> conf.wepkey="AA\x00\x00\x00"
     >>> dec=Dot11PacketList(enc).toEthernet()
     >>> dec[0]
  • Fingerprinting. nmap_fp() needs Nmap. You need an old version (before v4.23) that still supports first generation fingerprinting.

    >>> load_module("nmap")
    >>> nmap_fp("")
    Begin emission:
    Finished to send 8 packets.
    Received 19 packets, got 4 answers, remaining 4 packets
    (0.88749999999999996, ['Draytek Vigor 2000 ISDN router'])
  • VOIP. voip_play() needs SoX.

Platform-specific instructions

Linux native

Scapy can run natively on Linux, without libdnet and libpcap.

  • Install Python 2.5.
  • Install tcpdump and make sure it is in the $PATH. (It’s only used to compile BPF filters (-ddd option))
  • Make sure your kernel has Packet sockets selected (CONFIG_PACKET)
  • If your kernel is < 2.6, make sure that Socket filtering is selected CONFIG_FILTER)


Just use the standard packages:

$ sudo apt-get install tcpdump graphviz imagemagick python-gnuplot python-crypto python-pyx


Here’s how to install Scapy on Fedora 9:

# yum install mercurial python-devel
# cd /tmp
# hg clone
# cd scapy
# python install

Some optional packages:

# yum install graphviz python-crypto sox PyX gnuplot numpy
# cd /tmp
# wget
# tar xvfz gnuplot-py-1.8.tar.gz
# cd gnuplot-py-1.8
# python install

Mac OS X

Here’s how to install Scapy on Mac OS 10.4 (Tiger) or 10.5 (Leopard).

Set up a development environment

  1. Install X11. On the Mac OS X DVD, it is located in the “Optional Installs.mpkg” package.
  2. Install SDK. On the Mac OS X DVD, it is located in the “Xcode Tools/Packages” directory.
  3. Install Python 2.5 from Using Apple’s Python version will lead to some problems. Get it from

Install using MacPorts

  1. Install MacPorts Download the dmg from and install it.

  2. Update MacPorts:

    $ sudo port -d selfupdate
  3. Install Scapy:

    $ sudo port install scapy

You can then update to the latest version as shown in the generic installation above.

Install from original sources

Install libdnet and its Python wrapper:

$ wget
$ tar xfz libdnet-1.12.tgz
$ ./configure
$ make
$ sudo make install
$ cd python
$ python2.5 install

Install libpcap and its Python wrapper:

$ wget
$ tar xfz pylibpcap-0.6.2.tar.gz
$ cd pylibpcap-0.6.2
$ python2.5 install

Optionally: Install readline:

$ python `python -c "import pimp; print pimp.__file__"` -i readline


Here’s how to install Scapy on OpenBSD 4.3.

# export PKG_PATH=
# pkg_add py-libpcap py-libdnet mercurial
# ln -sf /usr/local/bin/python2.5 /usr/local/bin/python
# cd /tmp
# hg clone
# cd scapy
# python install

Optional packages


# pkg_add py-crypto

gnuplot and its Python binding:

# pkg_add gnuplot py-gnuplot

Graphviz (large download, will install several GNOME libraries)

# pkg_add graphviz

ImageMagick (takes long to compile)

# cd /tmp
# ftp
# cd /usr
# tar xvfz /tmp/ports.tar.gz
# cd /usr/ports/graphics/ImageMagick/
# make install

PyX (very large download, will install texlive etc.)

# pkg_add py-pyx


# wget -O /etc/ethertypes

python-bz2 (for UTscapy)

# pkg_add python-bz2


Scapy is primarily being developed for Unix-like systems and works best on those platforms. But the latest version of Scapy supports Windows out-of-the-box. So you can use nearly all of Scapy’s features on your Windows machine as well.


If you update from Scapy-win v1.2.0.2 to Scapy v2 remember to use from scapy.all import * instead of from scapy import *.


You need the following software packages in order to install Scapy on Windows:

Just download the files and run the setup program. Choosing the default installation options should be safe.

For your convenience direct links are given to the versions I used (for Python 2.5 and Python 2.6). If these links do not work or if you are using a different Python version, just visit the homepage of the respective package and look for a Windows binary. As a last resort, search the web for the filename.

After all packages are installed, open a command prompt (cmd.exe) and run Scapy by typing scapy. If you have set the PATH correctly, this will find a little batch file in your C:\Python26\Scripts directory and instruct the Python interpreter to load Scapy.

If really nothing seems to work, consider skipping the Windows version and using Scapy from a Linux Live CD – either in a virtual machine on your Windows host or by booting from CDROM: An older version of Scapy is already included in grml and BackTrack for example. While using the Live CD you can easily upgrade to the lastest Scapy version by typing cd /tmp && wget

Optional packages

Plotting (plot)

2D Graphics (psdump, pdfdump)

  • PyX: PyX-0.10.tar.gz. Extract to temp dir, open command prompt, change to tempdir and type python install
  • MikTeX: Basic MiKTeX 2.8 Installer. PyX needs a LaTeX installation. Choose an installation directory WITHOUT spaces (e.g. C:\MikTex2.8 and add the (INSTALLDIR)\miktex\bin subdirectory to your PATH.

Graphs (conversations)

3D Graphics (trace3d)

WEP decryption


  • Nmap. nmap-4.20-setup.exe. If you use the default installation directory, Scapy should automatically find the fingerprints file.
  • Queso: queso-980922.tar.gz. Extract the tar.gz file (e.g. using 7-Zip) and put queso.conf into your Scapy directory



Known bugs

  • You may not be able to capture WLAN traffic on Windows. Reasons are explained on the Wireshark wiki and in the WinPcap FAQ. Try switching off promiscuous mode with conf.sniff_promisc=False.
  • Packets cannot be sent to localhost (or local IP addresses on your own host).
  • The voip_play() functions do not work because they output the sound via /dev/dsp which is not available on Windows.