Installing Scapy on Windows

Scapy is primarily being developed for Unix-like systems and works best on those platforms. But a special port (Scapy-win) exists that allows you to use nearly all of Scapy's features on your Windows machine as well.

Screenshot: p.show() and sniff()

Download

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 I have given direct links to the versions I used (for Python 2.5). 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. Or use the (somewhat older) Scapy version that Andrew Evans has compiled: His zip file includes the basic packages that you will need to run Scapy on Python 2.4.

After all packages are installed, open a command prompt (cmd.exe), change to the directory containing scapy.py and run Scapy with "python scapy.py" (or just "scapy.py"). For usage information see the interactive demo and the other documents on Scapy's homepage.

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: Scapy is already included in grml and BackTrack for example. While using the Live CD you can easily upgrade to the lastest Scapy version (for Unix) by typing "cd /tmp && wget scapy.net".

Optional packages

For some special features you have to install more software.

Plotting (plot)

Example:

>>> p=sniff(count=50)
>>> p.plot(lambda x:len(x))

2D Graphics (psdump, pdfdump)

  • Pyx: PyX-0.10.tar.gz. Extract to temp dir, open command prompt, change to tempdir and type "python setup.py install"
  • MikTex: basic-miktex-2.6.2742.exe (52MB). Pyx needs a LaTeX installation. Choose an installation directory WITHOUT spaces (e.g. C:\!MikTex2.6) and add (INSTALLDIR)\miktex\bin subdirectory to your PATH.

Example:

>>> p=IP()/ICMP()
>>> p.pdfdump("test.pdf") 

Graphs (conversations)

Example:

>>> p=readpcap("myfile.pcap")
>>> p.conversations(type="jpg", target="> test.jpg")

3D Graphics (trace3d)

Example:

>>> a,u=traceroute(["www.python.org", "google.com","slashdot.org"])
>>> a.trace3D()

WEP decryption

Example: (using this Weplap test file)

>>> enc=rdpcap("weplab-64bit-AA-managed.pcap")
>>> enc.show()
>>> enc[0]
>>> conf.wepkey="AA\x00\x00\x00"
>>> dec=Dot11PacketList(enc).toEthernet()
>>> dec.show()
>>> dec[0]

Fingerprinting

  • Nmap. nmap-4.20-setup.exe. If you use the default installation directory, Scapy-win 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
>>> nmap_fp("192.168.0.1")
Begin emission:
Finished to send 8 packets.

Received 19 packets, got 4 answers, remaining 4 packets
(0.88749999999999996, ['Draytek Vigor 2000 ISDN router'])

Screenshots

Screenshot: srloop()

Known bugs

  • You may not be able to capture WLAN traffic. 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.

Credits

Many thanks to Zack Payton, Andrew Evans and all other Scapy-win hackers for making the Windows port of Scapy possible.

First version of this guide by Dirk Loss, 2007-07-29

Attachments