
Pwntools v3.0 Released
Hey guys, Pwntools developer here!
If you haven’t used it before, Pwntools is a Python library/framework developing exploits for Capture The Flag (CTF) competitions, like DEFCON CTF, picoCTF, and wargames like pwnable.kr.
Pwntools makes the exploit developer’s life easier by providing a suite of easy and quick tools that do exactly what an exploit developer would want them to — without the hassle of writing template code or dealing with various minor gotchas.
If you’re a new user to pwntools, you can check out the Getting Started page on the documentation, available at docs.pwntools.com.
The v3.0 release is a big one for us, and our first in over eighteen months!
Both existing and new users can install Pwntools with a simple pip install --upgrade pwntools.
For those who just want to see what’s new, you can check out the CHANGELOG.md here.
In particular, all of the changes which were made on the Binjitsu fork of Pwntools have been merged back into upstream Pwntools.
Everything below here is the changelog, for ease of reference.
3.0.0 (August 20 2016)
This was a large release (1305 commits since 2.2.0) with a lot of bugfixes and changes. The Binjitsu project, a fork of Pwntools, was merged back into Pwntools. As such, its features are now available here.
As always, the best source of information on specific features is the comprehensive docs at http://ift.tt/2bralSQ.
This list of changes is non-complete, but covers all of the significant changes which were appropriately documented.
Android
Android support via a new adb module, context.device, context.adb_host, and context.adb_port.
Assembly and Shellcode
- Assembly module enhancements for making ELF modules from assembly or pre-assembled shellcode. See
asm.make_elfandasm.make_elf_from_assembly. asmandshellcraftcommand-line tools support flags for the new shellcode encodersasmandshellcraftcommand-line tools support--debugflag for automatically launching GDB on the result- Added MIPS, PowerPC, and AArch64 support to the
shellcraftmodule - Added Cyber Grand Challenge (CGC) support to the
shellcraftmodule - Added syscall wrappers for every Linux syscall for all supported architectures to the
shellcraftmodule- e.g.
shellcraft.<arch>.gettimeofday - (e.g.
shellcraft.i386.linux.foobar)
- e.g.
- Added in-memory ELF loaders for most supported architectures
- Only supports statically-linked binaries
shellcraft.<arch>.linux.loader
Context Module
- Added
context.aslrwhich controls ASLR on launched processes. This works with bothprocess()andssh.process(), and can be specified per-process with theaslr=keyword argument. - Added
context.binarywhich automatically sets allcontextvariables from an ELF file. - Added
context.device,context.adb,context.adb_port, andcontext.adb_hostfor connecting to Android devices. - Added
context.kernelsetting for SigReturn-Oriented-Programming (SROP). - Added
context.log_filesetting for sending logs to a file. This can be set with theLOG_FILEmagic command-line option. - Added
context.noptracesetting for disabling actions which requireptracesupport. This is useful for turning allgdb.debugandgdb.attachoptions into no-ops, and can be set via theNOPTRACEmagic command-line option. - Added
context.proxywhich hooks all connections and sends them to a SOCKS4/SOCKS5. This can be set via thePROXYmagic command-line option. - Added
context.randomizeto control randommization of settings like XOR keys and register ordering (default off). - Added
context.termianlfor setting how to launch commands in a new terminal.
DynELF and MemLeak Module
- Added a
DynELF().libcproperty which attempt to find the remote libc and download the ELF from LibcDB. - Added a
DynELF().stackproperty which leaks the__environpointer from libc, making it easy to leak stack addresses. - Added
MemLeak.StringandMemLeak.NoNewlinesand other related helpers for handling special leakers which cannot e.g. handle newlines in the leaked addresses and which leak a C string (e.g. auto-append a'\x00'). - Enhancements for leaking speed via
MemLeak.compareto avoid leaking an entire field if we can tell from a partial leak that it does not match what we are searching for.
Encoders Module
- Added a
pwnlib.encodersmodule for assembled-shellcode encoders/decoders - Includes position-indepentent basic XOR encoders
- Includes position-independent delta encoders
- Includes non-position-independent alphanumeric encoders for Intel
- Includes position-independent alphanumeric encoders for ARM/Thumb
ELF Module
- Added a
Coreobject which can parse core-files, in order to extract / search for memory contents, and extract register states (e.g.Core('./corefile').eax).
Format Strings
- Added a basic
fmtstrmodule for assisting with Format String exploitation
GDB Module
- Added support for debugging Android devices when
context.os=='android' - Added helpers for debugging shellcode snippets with
gdb.debug_assembly()andgdb.debug_shellcode()
ROP Module
- Added support for SigReturn via
pwnlib.rop.srop- Occurs automatically when syscalls are invoked and a function cannot be found
- SigReturn frames can be constructed manually with
SigreturnFrame()objects
- Added functional doctests for ROP and SROP
Tubes Process Module
process()has many new options, check out the documentationaslrcontrols ASLRsetuidcan disable the effect of setuid, allowing core dumps (useful for extracting crash state via the newCore()object)- TTY echo and control characters can be enabled via
rawargument
stdoutandstderrare now PTYs by defaultstdincan be set to a PTY also via settingstdin=process.PTY
Tubes SSH Module
- Massive enhancements all over
sshobjects now have assh.process()method which avoids the need to handle shell expansion via the oldssh.run()method- Files are downloaded via SFTP if available
- New
downloadanduploadmethods auto-detect whether the target is a file or directory and acts accordingly - Added
listen()method alias forlisten_remote() - Added
remote()method alias forconnect_remote()
Utilities
- Added
fit()method to combine the functionality offlat()with the functionality ofcyclic() - Added
negative()method to negate the value of an integer via two’s complement, with respect to the current integer size (context.bytes). - Added
xor_key()method to generate an XOR key which avoids undesirable bytes over a given input. - Added a multi-threaded
bruteforce()implementation,mbruteforce(). - Added
dealarm_shell()helper to remove the effects ofalarm()after you’ve popped a shell.
Submitted August 23, 2016 at 01:13AM by ebeip90
via reddit http://ift.tt/2bIeGPj
Leave a comment