viernes, 23 de diciembre de 2011

Libro: Gray Hat Python: Programación en Python para hacking e ingeniería inversa


 
 
Python se está convirtiendo en el lenguaje de programación elegido por muchos que se dedican al hacking, a la ingeniería inversa y a probar software. La razón principal es que es fácil y rápido de escribir, soporta bajo nivel y tiene bibliotecas que nos hacen felices.

Ya no tendremos que buscar siempre en foros y manuales, Gray Hat Python muestra el uso de Python para una amplia variedad de tareas de hacking. Este libro explica los conceptos detrás de las herramientas de hacking y las técnicas con depuradores, troyanos, fuzzers y emuladores. Pero el autor, Justin Seitz, va más allá de la teoría mostrando cómo aprovechar las herramientas existentes de seguridad basadas en Python - y cómo construir las tuyas propias cuando lo necesites.

Leyendo este libro aprenderas a:

  • Automatizar las tediosas tareas de ingeniería inversa y seguridad
  • Diseñar y programar tu propio depurador
  • Fuzzear drivers de Windows y a crear potentes fuzzers desde el principio
  • Divertirte con la inyección de código y librerías, técnicas de soft y hard hooking y otros trucos con software
  • Esnifar tráfico seguro de sesión web cifrada
  • Usar PyDBG, Immunity Debugger, Sulley, IDAPython, PyEMU y más

Fuente: hackplayers 



domingo, 4 de diciembre de 2011

Python tools for penetration testers

Si usted está involucrado en la investigación de vulnerabilidades, la ingeniería inversa o de pruebas de penetración, te sugiero probar el lenguaje de programación Python. Cuenta con un amplio conjunto de bibliotecas y programas útiles. Esta página muestra algunos de ellos.

La mayoría de las herramientas mencionadas están escritas en Python, otros son sólo enlaces Python para los actuales bibliotecas de C, es decir, que las bibliotecas de fácil utilización de los programas en Python.

Algunas de las herramientas más agresivas
(pentest frameworks, bluetooth smashers, web application vulnerability scanners, war-dialers, etc.) se quedan fuera, porque la situación legal de estas herramientas es todavía un poco confusa en Alemania - incluso después de la decisión de el más alto tribunal. Esta lista es la clara intención de ayudar a whitehats, y por ahora prefiero errar en el lado seguro.

Network

  • Scapy: send, sniff and dissect and forge network packets. Usable interactively or as a library
  • pypcap, Pcapy and pylibpcap: several different Python bindings for libpcap
  • libdnet: low-level networking routines, including interface lookup and Ethernet frame transmission
  • dpkt: fast, simple packet creation/parsing, with definitions for the basic TCP/IP protocols
  • Impacket: craft and decode network packets. Includes support for higher-level protocols such as NMB and SMB
  • pynids: libnids wrapper offering sniffing, IP defragmentation, TCP stream reassembly and port scan detection
  • Dirtbags py-pcap: read pcap files without libpcap
  • flowgrep: grep through packet payloads using regular expressions
  • httplib2: comprehensive HTTP client library that supports many features left out of other HTTP libraries
  • Knock Subdomain Scan, enumerate subdomains on a target domain through a wordlist
  • Mallory, man-in-the-middle proxy for testing
  • mitmproxy: SSL-capable, intercepting HTTP proxy. Console interface allows traffic flows to be inspected and edited on the fly

Debugging and reverse engineering

  • Paimei: reverse engineering framework, includes PyDBG, PIDA, pGRAPH
  • Immunity Debugger: scriptable GUI and command line debugger
  • IDAPython: IDA Pro plugin that integrates the Python programming language, allowing scripts to run in IDA Pro
  • PyEMU: fully scriptable IA-32 emulator, useful for malware analysis
  • pefile: read and work with Portable Executable (aka PE) files
  • pydasm: Python interface to the libdasm x86 disassembling library
  • PyDbgEng: Python wrapper for the Microsoft Windows Debugging Engine
  • uhooker: intercept calls to API calls inside DLLs, and also arbitrary addresses within the executable file in memory
  • diStorm64: disassembler library for AMD64, licensed under the BSD license
  • python-ptrace: debugger using ptrace (Linux, BSD and Darwin system call to trace processes) written in Python

Fuzzing

  • Sulley: fuzzer development and fuzz testing framework consisting of multiple extensible components
  • Peach Fuzzing Platform: extensible fuzzing framework for generation and mutation based fuzzing
  • antiparser: fuzz testing and fault injection API
  • TAOF, including ProxyFuzz, a man-in-the-middle non-deterministic network fuzzer
  • untidy: general purpose XML fuzzer
  • Powerfuzzer: highly automated and fully customizable web fuzzer (HTTP protocol based application fuzzer)
  • FileP: file fuzzer. Generates mutated files from a list of source files and feeds them to an external program in batches
  • SMUDGE
  • Mistress: probe file formats on the fly and protocols with malformed data, based on pre-defined patterns
  • Fuzzbox: multi-codec media fuzzer
  • Forensic Fuzzing Tools: generate fuzzed files, fuzzed file systems, and file systems containing fuzzed files in order to test the robustness of forensics tools and examination systems
  • Windows IPC Fuzzing Tools: tools used to fuzz applications that use Windows Interprocess Communication mechanisms
  • WSBang: perform automated security testing of SOAP based web services
  • Construct: library for parsing and building of data structures (binary or textual). Define your data structures in a declarative manner
  • fuzzer.py (feliam): simple fuzzer by Felipe Andres Manzano
  • Fusil: Python library used to write fuzzing programs

Web

  • ProxMon: processes proxy logs and reports discovered issues
  • WSMap: find web service endpoints and discovery files
  • Twill: browse the Web from a command-line interface. Supports automated Web testing
  • Windmill: web testing tool designed to let you painlessly automate and debug your web application
  • FunkLoad: functional and load web tester

Forensics

  • Volatility: extract digital artifacts from volatile memory (RAM) samples
  • SandMan: read the hibernation file, regardless of Windows version
  • LibForensics: library for developing digital forensics applications
  • TrIDLib, identify file types from their binary signatures. Now includes Python binding

Malware analysis

  • pyew: command line hexadecimal editor and disassembler, mainly to analyze malware
  • Exefilter: filter file formats in e-mails, web pages or files. Detects many common file formats and can remove active content
  • pyClamAV: add virus detection capabilities to your Python software
  • jsunpack-n, generic JavaScript unpacker: emulates browser functionality to detect exploits that target browser and browser plug-in vulnerabilities
  • yara-python: identify and classify malware samples

PDF

  • Didier Stevens' PDF tools: analyse, identify and create PDF files (includes PDFiD, pdf-parser and make-pdf and mPDF)
  • Opaf: Open PDF Analysis Framework. Converts PDF to an XML tree that can be analyzed and modified.
  • Origapy: Python wrapper for the Origami Ruby module which sanitizes PDF files
  • pyPDF: pure Python PDF toolkit: extract info, spilt, merge, crop, encrypt, decrypt...
  • PDFMiner: extract text from PDF files
  • python-poppler-qt4: Python binding for the Poppler PDF library, including Qt4 support

Misc

  • InlineEgg: toolbox of classes for writing small assembly programs in Python
  • Exomind: framework for building decorated graphs and developing open-source intelligence modules and ideas, centered on social network services, search engines and instant messaging
  • RevHosts: enumerate virtual hosts for a given IP address
  • simplejson: JSON encoder/decoder, e.g. to use Google's AJAX API
  • PyMangle: command line tool and a python library used to create word lists for use with other penetration testing tools
  • Hachoir: view and edit a binary stream field by field

Other useful libraries and tools

  • IPython: enhanced interactive Python shell with many features for object introspection, system shell access, and its own special command system
  • Beautiful Soup: HTML parser optimized for screen-scraping
  • matplotlib: make 2D plots of arrays
  • Mayavi: 3D scientific data visualization and plotting
  • RTGraph3D: create dynamic graphs in 3D
  • Twisted: event-driven networking engine
  • Suds: lightweight SOAP client for consuming Web Services
  • M2Crypto: most complete OpenSSL wrapper
  • NetworkX: graph library (edges, nodes)
  • pyparsing: general parsing module
  • lxml: most feature-rich and easy-to-use library for working with XML and HTML in the Python language
  • Pexpect: control and automate other programs, similar to Don Libes `Expect` system
  • Sikuli, visual technology to search and automate GUIs using screenshots. Scriptable in Jython
  • PyQt and PySide: Python bindings for the Qt application framework and GUI library
For more libaries, please have a look at PyPI, the Python Package Index.

Fuente: summify