|
1 | | -python-pentest-tools |
2 | | -==================== |
3 | | - |
4 | 1 | Python tools for penetration testers |
| 2 | +==================================== |
| 3 | + |
| 4 | +If you are involved in vulnerability research, reverse engineering or |
| 5 | +penetration testing, I suggest to try out the |
| 6 | +[Python](http://www.python.org) programming language. It has a rich set |
| 7 | +of useful libraries and programs. This page lists some of them. |
| 8 | + |
| 9 | +Most of the listed tools are written in Python, others are just Python |
| 10 | +bindings for existing C libraries, i.e. they make those libraries easily |
| 11 | +usable from Python programs. |
| 12 | + |
| 13 | +Some of the more aggressive tools (pentest frameworks, bluetooth |
| 14 | +smashers, web application vulnerability scanners, war-dialers, etc.) are |
| 15 | +left out, because the legal situation of these tools is still a bit |
| 16 | +unclear in Germany -- even after the [decision of the highest |
| 17 | +court](http://www.bundesverfassungsgericht.de/entscheidungen/rk20090518_2bvr223307.html). |
| 18 | +This list is clearly meant to help whitehats, and for now I prefer to |
| 19 | +err on the safe side. |
| 20 | + |
| 21 | +### Network |
| 22 | + |
| 23 | +- [Scapy](http://secdev.org/projects/scapy): send, sniff and dissect |
| 24 | + and forge network packets. Usable interactively or as a library |
| 25 | +- [pypcap](http://code.google.com/p/pypcap/), |
| 26 | + [Pcapy](http://oss.coresecurity.com/projects/pcapy.html) and |
| 27 | + [pylibpcap](http://pylibpcap.sourceforge.net/): several different |
| 28 | + Python bindings for libpcap |
| 29 | +- [libdnet](http://code.google.com/p/libdnet/): low-level networking |
| 30 | + routines, including interface lookup and Ethernet frame transmission |
| 31 | +- [dpkt](http://code.google.com/p/dpkt/): fast, simple packet |
| 32 | + creation/parsing, with definitions for the basic TCP/IP protocols |
| 33 | +- [Impacket](http://oss.coresecurity.com/projects/impacket.html): |
| 34 | + craft and decode network packets. Includes support for higher-level |
| 35 | + protocols such as NMB and SMB |
| 36 | +- [pynids](http://jon.oberheide.org/pynids/): libnids wrapper offering |
| 37 | + sniffing, IP defragmentation, TCP stream reassembly and port scan |
| 38 | + detection |
| 39 | +- [Dirtbags py-pcap](http://dirtbags.net/py-pcap.html): read pcap |
| 40 | + files without libpcap |
| 41 | +- [flowgrep](http://monkey.org/~jose/software/flowgrep/): grep through |
| 42 | + packet payloads using regular expressions |
| 43 | +- [Knock Subdomain Scan](http://code.google.com/p/knock/), enumerate |
| 44 | + subdomains on a target domain through a wordlist |
| 45 | +- [Mallory](https://bitbucket.org/IntrepidusGroup/mallory), extensible |
| 46 | + TCP/UDP man-in-the-middle proxy, supports modifying non-standard |
| 47 | + protocols on the fly |
| 48 | +- [Pytbull](http://pytbull.sourceforge.net/): flexible IDS/IPS testing |
| 49 | + framework (shipped with more than 300 tests) |
| 50 | + |
| 51 | +### Debugging and reverse engineering |
| 52 | + |
| 53 | +- [Paimei](https://github.com/OpenRCE/paimei): reverse engineering |
| 54 | + framework, includes [PyDBG](https://github.com/OpenRCE/pydbg), PIDA, |
| 55 | + pGRAPH |
| 56 | +- [Immunity |
| 57 | + Debugger](http://www.immunityinc.com/products-immdbg.shtml): |
| 58 | + scriptable GUI and command line debugger |
| 59 | +- [mona.py](https://www.corelan.be/index.php/2011/07/14/mona-py-the-manual/): |
| 60 | + PyCommand for Immunity Debugger that replaces and improves on |
| 61 | + pvefindaddr |
| 62 | +- [IDAPython](http://d-dome.net/idapython/): IDA Pro plugin that |
| 63 | + integrates the Python programming language, allowing scripts to run |
| 64 | + in IDA Pro |
| 65 | +- [PyEMU](http://code.google.com/p/pyemu/): fully scriptable IA-32 |
| 66 | + emulator, useful for malware analysis |
| 67 | +- [pefile](http://code.google.com/p/pefile/): read and work with |
| 68 | + Portable Executable (aka PE) files |
| 69 | +- [pydasm](http://code.google.com/p/libdasm/source/browse/trunk/pydasm/pydasm.c): |
| 70 | + Python interface to the [libdasm](http://code.google.com/p/libdasm/) |
| 71 | + x86 disassembling library |
| 72 | +- [PyDbgEng](http://pydbgeng.sourceforge.net/): Python wrapper for the |
| 73 | + Microsoft Windows Debugging Engine |
| 74 | +- [uhooker](http://oss.coresecurity.com/projects/uhooker.htm): |
| 75 | + intercept calls to API calls inside DLLs, and also arbitrary |
| 76 | + addresses within the executable file in memory |
| 77 | +- [diStorm](http://www.ragestorm.net/distorm/): disassembler library |
| 78 | + for AMD64, licensed under the BSD license |
| 79 | +- [python-ptrace](http://bitbucket.org/haypo/python-ptrace/wiki/Home): |
| 80 | + debugger using ptrace (Linux, BSD and Darwin system call to trace |
| 81 | + processes) written in Python |
| 82 | +- [vdb / vtrace](http://code.google.com/p/vdebug/): vtrace is a |
| 83 | + cross-platform process debugging API implemented in python, and vdb |
| 84 | + is a debugger which uses it |
| 85 | +- [Androguard](http://code.google.com/p/androguard/): reverse |
| 86 | + engineering and analysis of Android applications |
| 87 | +- [Capstone](http://www.capstone-engine.org/): lightweight |
| 88 | + multi-platform, multi-architecture disassembly framework with Python |
| 89 | + bindings |
| 90 | +- [PyBFD](https://github.com/Groundworkstech/pybfd/): Python interface |
| 91 | + to the GNU Binary File Descriptor (BFD) library |
| 92 | + |
| 93 | +### Fuzzing |
| 94 | + |
| 95 | +- [Sulley](https://github.com/OpenRCE/sulley): fuzzer development and |
| 96 | + fuzz testing framework consisting of multiple extensible components |
| 97 | +- [Peach Fuzzing Platform](http://peachfuzz.sourceforge.net/): |
| 98 | + extensible fuzzing framework for generation and mutation based |
| 99 | + fuzzing (v2 was written in Python) |
| 100 | +- [antiparser](http://antiparser.sourceforge.net/): fuzz testing and |
| 101 | + fault injection API |
| 102 | +- [TAOF](http://sourceforge.net/projects/taof/), (The Art of Fuzzing) |
| 103 | + including ProxyFuzz, a man-in-the-middle non-deterministic network |
| 104 | + fuzzer |
| 105 | +- [untidy](http://untidy.sourceforge.net/): general purpose XML fuzzer |
| 106 | +- [Powerfuzzer](http://www.powerfuzzer.com/): highly automated and |
| 107 | + fully customizable web fuzzer (HTTP protocol based application |
| 108 | + fuzzer) |
| 109 | +- [SMUDGE](http://www.fuzzing.org/wp-content/SMUDGE.zip) |
| 110 | +- [Mistress](http://www.packetstormsecurity.org/fuzzer/mistress.rar): |
| 111 | + probe file formats on the fly and protocols with malformed data, |
| 112 | + based on pre-defined patterns |
| 113 | +- [Fuzzbox](https://isecpartners.com/tools/application-security/fuzzbox.aspx): |
| 114 | + multi-codec media fuzzer |
| 115 | +- [Forensic Fuzzing |
| 116 | + Tools](https://isecpartners.com/tools/application-security/forensic-fuzzing-tools.aspx): |
| 117 | + generate fuzzed files, fuzzed file systems, and file systems |
| 118 | + containing fuzzed files in order to test the robustness of forensics |
| 119 | + tools and examination systems |
| 120 | +- [Windows IPC Fuzzing |
| 121 | + Tools](https://isecpartners.com/tools/application-security/windows-ipc-fuzzing-tools.aspx): |
| 122 | + tools used to fuzz applications that use Windows Interprocess |
| 123 | + Communication mechanisms |
| 124 | +- [WSBang](https://www.isecpartners.com/tools/application-security/wsbang.aspx): |
| 125 | + perform automated security testing of SOAP based web services |
| 126 | +- [Construct](http://construct.wikispaces.com/): library for parsing |
| 127 | + and building of data structures (binary or textual). Define your |
| 128 | + data structures in a declarative manner |
| 129 | +- [fuzzer.py |
| 130 | + (feliam)](http://sites.google.com/site/felipeandresmanzano/fuzzer.py?attredirects=0): |
| 131 | + simple fuzzer by Felipe Andres Manzano |
| 132 | +- [Fusil](https://bitbucket.org/haypo/fusil/wiki/Home): Python library |
| 133 | + used to write fuzzing programs |
| 134 | + |
| 135 | +### Web |
| 136 | + |
| 137 | +- [Requests](http://python-requests.org/): elegant and simple HTTP |
| 138 | + library, built for human beings |
| 139 | +- [HTTPie](http://httpie.org): human-friendly cURL-like command line |
| 140 | + HTTP client |
| 141 | +- [ProxMon](https://www.isecpartners.com/tools/application-security/proxmon.aspx): |
| 142 | + processes proxy logs and reports discovered issues |
| 143 | +- [WSMap](https://www.isecpartners.com/tools/application-security/wsmap.aspx): |
| 144 | + find web service endpoints and discovery files |
| 145 | +- [Twill](http://twill.idyll.org/): browse the Web from a command-line |
| 146 | + interface. Supports automated Web testing |
| 147 | +- [Ghost.py](http://jeanphix.me/Ghost.py/): webkit web client written |
| 148 | + in Python |
| 149 | +- [Windmill](http://www.getwindmill.com/): web testing tool designed |
| 150 | + to let you painlessly automate and debug your web application |
| 151 | +- [FunkLoad](http://funkload.nuxeo.org/): functional and load web |
| 152 | + tester |
| 153 | +- [spynner](http://code.google.com/p/spynner/): Programmatic web |
| 154 | + browsing module for Python with Javascript/AJAX support |
| 155 | +- [python-spidermonkey](http://code.google.com/p/python-spidermonkey/): |
| 156 | + bridge to the Mozilla SpiderMonkey JavaScript engine; allows for the |
| 157 | + evaluation and calling of Javascript scripts and functions |
| 158 | +- [mitmproxy](http://mitmproxy.org/): SSL-capable, intercepting HTTP |
| 159 | + proxy. Console interface allows traffic flows to be inspected and |
| 160 | + edited on the fly |
| 161 | +- [pathod / pathoc](http://pathod.net/): pathological daemon/client |
| 162 | + for tormenting HTTP clients and servers |
| 163 | + |
| 164 | +### Forensics |
| 165 | + |
| 166 | +- [Volatility](https://www.volatilesystems.com/default/volatility/): |
| 167 | + extract digital artifacts from volatile memory (RAM) samples |
| 168 | +- [LibForensics](http://code.google.com/p/libforensics/): library for |
| 169 | + developing digital forensics applications |
| 170 | +- [TrIDLib](http://mark0.net/code-tridlib-e.html), identify file types |
| 171 | + from their binary signatures. Now includes Python binding |
| 172 | +- [aft](http://code.google.com/p/aft/): Android forensic toolkit |
| 173 | + |
| 174 | +### Malware analysis |
| 175 | + |
| 176 | +- [pyew](http://code.google.com/p/pyew/): command line hexadecimal |
| 177 | + editor and disassembler, mainly to analyze malware |
| 178 | +- [Exefilter](http://www.decalage.info/exefilter): filter file formats |
| 179 | + in e-mails, web pages or files. Detects many common file formats and |
| 180 | + can remove active content |
| 181 | +- [pyClamAV](http://xael.org/norman/python/pyclamav/index.html): add |
| 182 | + virus detection capabilities to your Python software |
| 183 | +- [jsunpack-n](https://code.google.com/p/jsunpack-n/), generic |
| 184 | + JavaScript unpacker: emulates browser functionality to detect |
| 185 | + exploits that target browser and browser plug-in vulnerabilities |
| 186 | +- [yara-python](http://code.google.com/p/yara-project/source/browse/trunk/yara-python/README): |
| 187 | + identify and classify malware samples |
| 188 | +- [phoneyc](http://code.google.com/p/phoneyc/): pure Python |
| 189 | + honeyclient implementation |
| 190 | + |
| 191 | +### PDF |
| 192 | + |
| 193 | +- [Didier Stevens' PDF |
| 194 | + tools](http://blog.didierstevens.com/programs/pdf-tools): analyse, |
| 195 | + identify and create PDF files (includes |
| 196 | + [PDFiD](http://blog.didierstevens.com/programs/pdf-tools/#pdfid), |
| 197 | + [pdf-parser](http://blog.didierstevens.com/programs/pdf-tools/#pdf-parser) |
| 198 | + and |
| 199 | + [make-pdf](http://blog.didierstevens.com/programs/pdf-tools/#make-pdf) |
| 200 | + and mPDF) |
| 201 | +- [Opaf](http://code.google.com/p/opaf/): Open PDF Analysis Framework. |
| 202 | + Converts PDF to an XML tree that can be analyzed and modified. |
| 203 | +- [Origapy](http://www.decalage.info/python/origapy): Python wrapper |
| 204 | + for the Origami Ruby module which sanitizes PDF files |
| 205 | +- [pyPDF](http://pybrary.net/pyPdf/): pure Python PDF toolkit: extract |
| 206 | + info, spilt, merge, crop, encrypt, decrypt... |
| 207 | +- [PDFMiner](http://www.unixuser.org/~euske/python/pdfminer/index.html): |
| 208 | + extract text from PDF files |
| 209 | +- [python-poppler-qt4](http://code.google.com/p/python-poppler-qt4/): |
| 210 | + Python binding for the Poppler PDF library, including Qt4 support |
| 211 | + |
| 212 | +### Misc |
| 213 | + |
| 214 | +- [InlineEgg](http://oss.coresecurity.com/projects/inlineegg.html): |
| 215 | + toolbox of classes for writing small assembly programs in Python |
| 216 | +- [Exomind](http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=tool&name=Exomind): |
| 217 | + framework for building decorated graphs and developing open-source |
| 218 | + intelligence modules and ideas, centered on social network services, |
| 219 | + search engines and instant messaging |
| 220 | +- [RevHosts](http://www.securityfocus.com/tools/3851): enumerate |
| 221 | + virtual hosts for a given IP address |
| 222 | +- [simplejson](https://github.com/simplejson/simplejson/): JSON |
| 223 | + encoder/decoder, e.g. to use [Google's AJAX |
| 224 | + API](http://dcortesi.com/2008/05/28/google-ajax-search-api-example-python-code/) |
| 225 | +- [PyMangle](http://code.google.com/p/pymangle/): command line tool |
| 226 | + and a python library used to create word lists for use with other |
| 227 | + penetration testing tools |
| 228 | +- [Hachoir](https://bitbucket.org/haypo/hachoir/wiki/Home): view and |
| 229 | + edit a binary stream field by field |
| 230 | +- [py-mangle](http://code.google.com/p/pymangle/): command line tool |
| 231 | + and a python library used to create word lists for use with other |
| 232 | + penetration testing tools |
| 233 | + |
| 234 | +### Other useful libraries and tools |
| 235 | + |
| 236 | +- [IPython](http://ipython.scipy.org/): enhanced interactive Python |
| 237 | + shell with many features for object introspection, system shell |
| 238 | + access, and its own special command system |
| 239 | +- [Beautiful Soup](http://www.crummy.com/software/BeautifulSoup/): |
| 240 | + HTML parser optimized for screen-scraping |
| 241 | +- [matplotlib](http://matplotlib.sourceforge.net/): make 2D plots of |
| 242 | + arrays |
| 243 | +- [Mayavi](http://code.enthought.com/projects/mayavi/): 3D scientific |
| 244 | + data visualization and plotting |
| 245 | +- [RTGraph3D](http://www.secdev.org/projects/rtgraph3d/): create |
| 246 | + dynamic graphs in 3D |
| 247 | +- [Twisted](http://twistedmatrix.com/): event-driven networking engine |
| 248 | +- [Suds](https://fedorahosted.org/suds/): lightweight SOAP client for |
| 249 | + consuming Web Services |
| 250 | +- [M2Crypto](http://chandlerproject.org/bin/view/Projects/MeTooCrypto): |
| 251 | + most complete OpenSSL wrapper |
| 252 | +- [NetworkX](http://networkx.lanl.gov/): graph library (edges, nodes) |
| 253 | +- [Pandas](http://pandas.pydata.org/): library providing |
| 254 | + high-performance, easy-to-use data structures and data analysis |
| 255 | + tools |
| 256 | +- [pyparsing](http://pyparsing.wikispaces.com/): general parsing |
| 257 | + module |
| 258 | +- [lxml](http://lxml.de/): most feature-rich and easy-to-use library |
| 259 | + for working with XML and HTML in the Python language |
| 260 | +- [Whoosh](https://bitbucket.org/mchaput/whoosh/): fast, featureful |
| 261 | + full-text indexing and searching library implemented in pure Python |
| 262 | +- [Pexpect](http://www.noah.org/wiki/Pexpect): control and automate |
| 263 | + other programs, similar to Don Libes \`Expect\` system |
| 264 | +- [Sikuli](http://groups.csail.mit.edu/uid/sikuli/), visual technology |
| 265 | + to search and automate GUIs using screenshots. Scriptable in |
| 266 | + [Jython](http://www.jython.org/) |
| 267 | +- [PyQt](http://www.riverbankcomputing.co.uk/software/pyqt) and |
| 268 | + [PySide](http://www.pyside.org/): Python bindings for the Qt |
| 269 | + application framework and GUI library |
| 270 | + |
| 271 | +The [Python Arsenal for Reverse |
| 272 | +Engineering](http://pythonarsenal.erpscan.com/) is a large collection of |
| 273 | +tools related to reverse engineering. |
| 274 | + |
| 275 | +There is a SANS paper about Python libraries helpful for forensic |
| 276 | +analysis |
| 277 | +[(PDF)](http://www.sans.org/reading_room/whitepapers/incident/grow-forensic-tools-taxonomy-python-libraries-helpful-forensic-analysis_33453). |
| 278 | + |
| 279 | +For more Python libaries, please have a look at |
| 280 | +[PyPI](http://pypi.python.org/pypi), the Python Package Index. |
| 281 | + |
0 commit comments