반응형

These instructions are for Windows XP => Windows 7 using Python 2.7 (though other versions should work too)

Thanks to louppen for the great starting point!

  1. Download and install MinGW Compilier v20101030
    • Make sure to use pre-packaged repo catalogs and the old version! PyDasm barfs when compiling because MinGW32 removed support for -mno-cygwin! Bug Report
    • On the "Select Components" dialog check C++ Compiler and ObjC Compiler in addition to selected by default set
  2. Download and install Python 2.7 (x64)
  3. Download and install Git for windows
    • Make sure it adds git to your path variable!
  4. Update $PATH to include C:\Python27 and C:\MinGW\bin KB article
  5. Checkout pydbg

    C:\sulley_build>git clone https://Fitblip@github.com/Fitblip/pydbg.git
    Cloning into 'pydbg'...
    remote: Counting objects: 17, done.
    remote: Compressing objects: 100% (12/12), done.
    remote: Total 17 (delta 4), reused 17 (delta 4)
    Unpacking objects: 100% (17/17), done.
    
  6. Build pydbg

    C:\sulley_build\pydbg>python setup.py install
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\pydbg
    ...snip...
    running install_egg_info
    Removing C:\python27\Lib\site-packages\pydbg-0.0.0-py2.7.egg-info
    Writing C:\python27\Lib\site-packages\pydbg-0.0.0-py2.7.egg-info
    
  7. Download and extract libdasm

  8. Build the extention and install it (beware of gcc version 4.7.x removed support for -mno-cygwin, seehttp://stackoverflow.com/q/6034390/333353 and https://gist.github.com/4466320 for a fix)

    C:\sulley_build\libdisasm\pydasm>python setup.py build_ext -c mingw32
    running build_ext
    building 'pydasm' extension
    ...snip...
    C:\sulley_build\libdisasm\pydasm>python setup.py install
    running install
    running build
    running build_ext
    running install_lib
    copying build\lib.win32-2.7\pydasm.pyd -> C:\python27\Lib\site-packages
    running install_egg_info
    Writing C:\python27\Lib\site-packages\pydasm-1.5-py2.7.egg-info
    
  9. Checkout Sulley

    C:\sulley_build>git clone https://github.com/OpenRCE/sulley.git
    Cloning into 'sulley'...
    remote: Counting objects: 148, done.
    remote: Compressing objects: 100% (91/91), done.
    remote: Total 148 (delta 53), reused 146 (delta 51)
    Receiving objects: 100% (148/148), 267.03 KiB, done.
    Resolving deltas: 100% (53/53), done.
    
  10. Make sure process_monitor.py works (no import errors)

     C:\sulley_build\sulley>python process_monitor.py
     ERR> USAGE: process_monitor.py
         <-c|--crash_bin FILENAME> filename to serialize crash bin class to
         [-p|--proc_name NAME]     process name to search for and attach to
         [-i|--ignore_pid PID]     ignore this PID when searching for the target process
         [-l|--log_level LEVEL]    log level (default 1), increase for more verbosity
         [--port PORT]             TCP port to bind this agent to
    
  11. Download and extract PCapy

  12. Download and extract WinPcap Dev Kit (I put mine in C:\sulley_build\WpdPack)

  13. Build PCapy (pointing to WinPcap's include and lib directories) and install it

    C:\sulley_build\pcapy-0.10.5>python setup.py build_ext -c mingw32 -I "C:\sulley_build\WpdPack\Include" -L "C:\sulley_build\WpdPack\Lib"
    running build_ext
    building 'pcapy' extension
    creating build
    creating build\temp.win32-2.7
    creating build\temp.win32-2.7\Release
    creating build\temp.win32-2.7\Release\win32
    ...snip...
    C:\sulley_build\pcapy-0.10.5>python setup.py install
    running install
    running build
    running build_ext
    running install_lib
    copying build\lib.win32-2.7\pcapy.pyd -> C:\python27\Lib\site-packages
    running install_data
    creating C:\python27\share
    creating C:\python27\share\doc
    creating C:\python27\share\doc\pcapy
    copying README -> C:\python27\share\doc\pcapy
    copying LICENSE -> C:\python27\share\doc\pcapy
    copying pcapy.html -> C:\python27\share\doc\pcapy
    running install_egg_info
    Writing C:\python27\Lib\site-packages\pcapy-0.10.5-py2.7.egg-info
    
  14. Download and install WinPcap

  15. Download and extract Impacket

  16. Install Impacket

    C:\sulley_build\Impacket-0.9.6.0>python setup.py install
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\impacket
    copying impacket\ImpactDecoder.py -> build\lib\impacket
    copying impacket\ImpactPacket.py -> build\lib\impacket
    copying impacket\nmb.py -> build\lib\impacket
    copying impacket\ntlm.py -> build\lib\impacket
    copying impacket\smb.py -> build\lib\impacket
    copying impacket\structure.py -> build\lib\impacket
    copying impacket\uuid.py -> build\lib\impacket
    copying impacket\__init__.py -> build\lib\impacket
    creating build\lib\impacket\dcerpc
    ...snip...
    
  17. Check to make sure network_monitor.py works

    C:\sulley_build\sulley>python network_monitor.py
    ERR> USAGE: network_monitor.py
        <-d|--device DEVICE #>    device to sniff on (see list below)
        [-f|--filter PCAP FILTER] BPF filter string
        [-P|--log_path PATH]      log directory to store pcaps to
        [-l|--log_level LEVEL]    log level (default 1), increase for more verbosity
    
        [--port PORT]             TCP port to bind this agent to
    
    Network Device List:
        [0] \Device\NPF_GenericDialupAdapter
        [1] {CF0B388B-8DF5-4BC4-8ECF-404F2A1B489C}  10.0.2.64


반응형

+ Recent posts