-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pwnlib 2.2 rewrite of context, logging, tubes, various bugfixes #158
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…/info message one time
…_once for messages (see #102)
…section header flags
…ed version of binutils. For example, on an i386 system, there should be no reason for an extra version of binutils to be installed.
I can confirm that f66c6b7 permits |
This was referenced Dec 14, 2014
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major pwnlib overhaul to address outstanding issues.
It is highly recommended to look at the diff with whitespace disabled (add ?w=1 to URL or
git diff -w
).Issues Closed
The following issues are closed by this pull request.
Test Coverage
I have added a great deal of unit tests to
pwntools
, and started a regression testing framework.Unit Test Coverage
One test fails without a custom-built
binutils-mips
.Integration Testing
I've created a new repository at zachriggle/pwnlib-regression which performs regression testing against functionality. This uses a binary which is designed to run shellcode, leak offsets, and in general be useful for testing pwntools.
bbgp
andpork
do not work. I have created a new branch for that repo with the changes necessary to work properly.Additionally, I've verified that most of the
pwnlib-write-ups
exploits still work, as well as my collection ofio.smashthestack.com
exploits which I cannot publish. All of the publishedwargames
exploits work.Major Changes
Documentation
A good deal of documentation has been added and updated.
pwnlib.context
This has been made into a proper module. The global
context
is now just a globally-scoped object.The mechanism used for defaults and threading have been updated, so that they're a bit cleaner.
Setting
context.arch
now sets othercontext
values to sane defaults.pwnlib.log
Uses the normal Python logging subsystem. Log levels for individual modules can now be set, while
context.log_level
provides a maximum verbose-ness for logging (same behavior as before). This is useful for when developing to see e.g. verboseELF
messages without printing everything atube
ever sees.All animation still works exactly as it did.
log.waitfor
can now be used with the scopingwith
keyword.The
log_level
module is removed.pwnlib.asm
Large amount re-written to completely migrate to binutils, rather than relying on
nasm
for x86 and dealing with the differences. Also auto-detects the names of binaries, as the exact triplet of the installed version may differ. Since we're not relying on any ABIs when assembling shellcode, it doesn't matter if we usearm-linux-gnueabi
orarm-none-none
.pwnlib.shellcraft
In keeping with the changes to
pwnlib.asm
, all of the i386 shellcode has been rewritten ingas -Mintel
syntax.pwnlib.gdb
Includes
gdb.debug
for debugging over SSH, as shown in #108.pwnlib.data
All of the precompiled binutils have been removed. Users should use their package manager to install cross-architecture assemblers/disassemblers.
pwnlib.util.crc
Instead of performing text processing at-runtime to scrape constants, this information has been cached in
pwnlib/util/crc/known.py
.pwnlib.util.packing
Rather than the same repeating copy/pasted/modified code, most of the routines are created dynamically at runtime. This should make maintenance easier, and less prone to copy-paste errors.
pwnlib.tubes
The internal buffering was pulled out into a separate
Buffer
class. The mechanism used to fix timeouts,_fix_timeout
was pulled out into a context-aware structure.pwnlib.tubes.tube.tube
now inherits frompwnlib.tubes.timeout.Timeout
so that alltube
objects can leverage this behavior.