I like to use Scapy with Python v2.7 under Windows 7.
The particular Python distribution I am using is Enthought Python distribution 7.02.
Windows. 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.
Scapy supports Python 2.7 and Python 3 (3.4 to 3.8).
Scapy is a library made in Python, with its own command line interpreter (CLI), which allows to create, modify, send and capture network packets. It can be used interactively through the command line interface or as a library by importing it into Python programs. It can also run on Linux, Mac OS X and Windows systems.
PIP is automatically installed with Python 2.7.9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments.
Intrusive update: please note that this answer is outdated, with recent versions (>=2.4.0) scapy will ONLY require Npcap (or Winpcap) to work, and IPython for the console. Have a look at the official windows page
In case someone needs Scapy for 64-bit + Python 2.7, I've uploaded the binaries here:
In addition, you probably need to install WinPcap from the official site
Compiling it yourself required a few fixes - I'll commit them upstream soon.
Q: how can i install required module pypcap
Using Scapy with Windows 7 is possible, but it does not exactly work out of the box. An install guide can be found here:
http://www.secdev.org/projects/scapy/doc/installation.html#windows
I strongly recommend to switch to python 2.6, as this will make your live much easier.
When you insist on 2.7 you will have to compile some of the require modules yourself. Also, some key modules like pypcap have to be patched before they can be compiled with python 2.7 (see pycap patch).
Here you will find some guidance on how to build the modules.
Q: will it be possible to make python scripts depending on scapy into standalone windows applications
Yes and no. While you can use py2exe to build a an EXE from your python code. Scapy uses WinPcap which you have to install in addition to your application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With