Introduction
PacketManipulator on Windows? Are you crazy!? Indeed you are.
Windows installation
Most of the instructions contained in this text are taken from [http://www.secdev.org/projects/scapy/doc/installation.html#windows Scapy Documentation] so please checkout that page for further reference.
What do I need?
This is a list of dependeces you need to install before playing with PacketManipulator. The order of installation matters so please be careful in respecting it.
- Tortoise SVN
- Python 2.6.6
- Latest version of Automated MinGW Installer - mingw-get-inst (in addition to default option choose C++ Compiler, MSYS Basic System and MinGW Developer Toolkit)
- PyGtk all-in-one installer
The following packages are dependences for scapy installation. Remember to run as administrator the installer for pcap and dnet.
Installation of scapy
Regarding the scapy installation, just extract the zip file somewhere and simply use:
python setup.py install
Patching Scapy
Keep in mind that if you want to use audit plugins like smb-sniffer and dnsspoof you need to patch scapy source code with the patches included in the deps/scapy-patches directory (ppp-datalink, dns and smb).
Version used while writing this note
- TortoiseSVN 1.6.15
- Python 2.6.6
- MingW 20110316
- PyGtk all-in-one 2.24.0
- pywin32 Build 216
- WinPcap 4.1.2
- pcap-1.1-scapy-20090720
- dnet-1.12
- pyreadline 1.5
- scapy revision 113ef25f9583
Checking out PM sources
This guide and also some scripts present in the trunk of PM assumes that your source copy is located under C:\PacketManipulator
To respect this assumption, we open explorer pointing to C: and we execute a SVN checkout of the sources, as follows:
- Right click on the explorer window and then select SVN Checkout...
- In the text field responsible for URL of repository put http://svn.umitproject.org/svnroot/umit/packet-manipulator/trunk
- In the text field responsible for Checkout directory put C:\PacketManipulator
- Press OK
Running PacketManipulator
After having followed all the steps presented so far you should be able to run PacketManipulator without further effort. Just be sure that your shell points to C:\PacketManipulator. Then issue the following command and enjoy:
python PacketManipulator
Building PyGtkHex
If you want to take advantage of using a real hexadecimal widget which supports inline modification, you can take in consideration to build the extra widget presents under deps/pygtkhex.
To do it you have first to apply the patch deps/pygtkhex-setup-win.patch. Then you have just to use setup.py file in order first to build and then to install pygtkhex:
python setup.py build -cmingw32 python setup.py install
Preparing environment variables
To simplify the overall procedure is better to setup various environment variables. So simply add to the PATH var:
C:\Python26;C:\MingW\bin
How to create an installer
This part of this note deals with the creation of an installer. Keep in mind that the script used to generate the installer assumes that you have your PacketManipulator source code copy under C:\PacketManipulator\. Eventually during the generation phase another directory will be created under the path C:\PMTemp\. The script responsible for the entire generation phase is generate-installer.bat under scripts\windows directory.
Dependences
Documentation
If you need to include the documentation in the installer you are going to generate you also need sphinx to be installed:
Then to install sphinx just execute:
cd C:\Python26\Scripts easy_install sphinx
Build it
The build is entirely automated. What you have to do is to just execute:
scripts\windows\genereate-installer.bat
After that the installer will be created under `C:\PMTemp\
Packet - No such file or directory
If during the generation of the installer your build is interrupted by the following error error: packet: No such file or directory this ugly workaround can help you. This seems to silent down the error throwed by py2exe while generating the bundle (python setup.py py2exe).
C:\> cd c:\Windows\system32\ C:\> copy Packet.dll Packet
