Compare commits

..
1869 Commits
Author SHA1 Message Date
Mathias Svensson d689805690 Release 3.11.0 2018-01-03 08:19:05 +01:00
Zach Riggle 953e73aa37 Update changelog for 3.11 and 3.12 2018-01-03 08:03:28 +01:00
Mathias Svensson ee9f9fa7de Merge branch 'stable' into beta 2018-01-03 08:02:50 +01:00
Benno Fünfstück 46a1c44fc9 elf.py: fix variable name typo (fixes dt_rpath undefined var) (#1008) 2018-01-02 11:36:08 -06:00
Zach Riggle 6944b664e8 Switch server to ftp.ubuntu.org (#1084)
Currently ftp.debian.org is down on port 21

(cherry picked from commit ec5185c0c4)
2017-12-11 17:47:21 -06:00
Mathias Svensson 712295f3c5 Release 3.11.0beta0 2017-10-25 12:06:47 +02:00
Mathias Svensson cca1083f0b Release 3.10.0 2017-10-25 12:01:59 +02:00
Mathias Svensson 9dacd1b5d9 Merge branch 'stable' into beta 2017-10-25 11:56:07 +02:00
Zach Riggle d9f5a5b009 Update CHANGELOG.md 2017-10-23 23:48:53 -05:00
Zach Riggle 74a5876c0d Fix corefile environment variables and speed up ELF.string() (#1055)
* Fix corefile environment variables and speed up ELF.string()

* Even more doctests

* Fix doctest arch

* No longer split on = since it isn't necessary

* Fix arch again

* Delete intermediate corefiles

* Do not flag for extended testing when the commit SHA is what matches
2017-10-23 23:45:11 -05:00
Zach Riggle 9d6b4881fe Fix path checking in ssh_process.corefile for edge cases (#1058)
Fixes #1047
2017-10-23 15:37:48 -05:00
Zach Riggle 91025408a4 Fix incorrect variable in log statement (#1057)
Fixes #1056
2017-10-23 14:39:12 -05:00
Zach Riggle b53e58a840 Use "file /path/to/file" when debugging processes 2017-10-18 14:52:13 -05:00
Zach Riggle 438096f97f Remove doctest prefixes, these are just examples 2017-10-18 14:41:49 -05:00
Zach Riggle 7bab49e7b9 Update GDB docs and examples 2017-10-15 15:31:39 -05:00
Zach Riggle 412d345964 QEMU-related enhancements (#1052)
* Add support for finding QEMU's LD_PREFIX

* Refactor pwnlib.qemu and add official documentation

* Add more documentation, support for sysroot

* More docs, binfmt info

* Fix variable name overload

* Fix missed refactor

* Check for empty/null env

* Add qemu.rst to index
2017-10-12 21:41:36 -05:00
Zach Riggle b088f46988 Update CHANGELOG 2017-10-12 11:26:10 -05:00
Zach Riggle 8f3839d69e Add cyclic default args to context (#1049)
* Add cyclic default args to context

Specifically, this adds context.cyclic_alphabet and context.cyclic_size

This helps cut down on writing "n=8" all the time for users who use 8-byte
subsequences on 64-bit architectures.

Exposing the default alphabet means that users can avoid "bad bytes" in
cyclic patterns which are generated by pwntools internally (e.g. ROP padding)

Some pwnlib.util.packing docstrings were changed to clarify that word_size is
in bits.

The doctests in pwnlib.util.cyclic were updated and extended to have more
and better doctests, as well as better exaples.

* Add an example showing an alphabet with NUL bytes

This is important because old code would use pack(..., "all") when an integer
value was provided, instead of using the correct width.
2017-10-11 19:08:31 -05:00
Zach Riggle 5a81e71368 Update README 2017-10-11 16:59:37 -05:00
Zach Riggle 1577263334 Overhaul ROP.setRegisters to support more complex cases needed by AMD64 (#1044)
* Overhaul ROP.setRegisters to support more complex cases needed by AMD64

Additionally, have a separate cache for ROPs composed of multiple ELF files

* Better presentation for stack padding slots

* Remove unnecessary stack adjustment on amd64

For amd64, it is possible that len(stackArguments) == 0.

* Add a doctest for amd64 register dependency stuff

* More i386 adjust optimizations

* Use nextGadgetAddr as the adjust value

* Always use padding for the last "ret" adjustment

* Better dump display

* Update doctests for new ROP dump() enhancements

* Add badchars support for ROP gadgets

* More doctest fixes, also ensure ROP.search does not return gadgets ending in e.g. int 0x80
2017-10-11 16:57:38 -05:00
Mathias Svensson 7ad5a4e34e Merge branch 'beta' into dev 2017-10-05 09:59:45 +02:00
Mathias Svensson 513682373e Release 3.10.0beta2 2017-10-05 09:44:33 +02:00
Mathias Svensson df7c1fef9d Release 3.9.2 2017-10-05 09:40:21 +02:00
Zach Riggle 559ffa7c9e Merge branch 'beta' into dev 2017-10-01 16:56:31 -05:00
Zach Riggle 2512026b3c Merge branch 'stable' into beta 2017-10-01 16:56:09 -05:00
Zach Riggle 518ed71488 Better error message on gdb.debug when qemu-user is missing 2017-10-01 12:27:23 -05:00
Zach Riggle 26d60cbf63 Expose icache_flush for the ARM alphanumeric encoder 2017-10-01 12:27:04 -05:00
Zach Riggle b234b319df Do not attempt to populate the libraries used by statically-linked binaries (#1043)
This causes a background instance to be spawned, which is not intended.
2017-09-29 16:34:47 -05:00
Zach Riggle 6577f24d3a Add --shared to shellcraft 2017-09-29 16:15:26 -05:00
Mathias Svensson 4a7ff431b9 Merge branch 'beta' into dev 2017-09-28 11:41:59 +02:00
Mathias Svensson 716c67d993 Release 3.10.0beta1 2017-09-28 11:37:08 +02:00
Mathias Svensson 91768424ba Release 3.9.1 2017-09-28 11:33:14 +02:00
Zach Riggle af2f8b4bf4 Fix shellcraft.arm.trap (#1041) 2017-09-27 16:21:32 -05:00
Zach Riggle 9ed8ab6d4f Reduce log spam when downloading the Android NDK 2017-09-26 12:22:16 -05:00
Zach Riggle 19f7268701 Reduce log spam when downloading the Android SDK 2017-09-26 12:21:04 -05:00
Zach Riggle e4d919d6bf Update README.md for 3.9.1 release 2017-09-26 12:16:57 -05:00
Zach Riggle 93d9a2cb5e Merge branch 'beta' into dev 2017-09-26 12:13:56 -05:00
Zach Riggle 69f8cc2c47 Merge branch 'stable' into beta 2017-09-26 12:12:20 -05:00
Zach Riggle ab0ac00c73 Disable glibc buffering in fread for processes using PTYs
See issue #1038 for extensive details
2017-09-26 11:26:45 -05:00
Zach Riggle d87ab3ac65 Try to cut down on the crazy verbosity of logging (#1036)
* Prevent Sphinx from dumping all level=INFO logging output to stdout.

See Gallopsled/pwntools#1036 for more information.

* Filter out Paramiko logs too, apply filter to all root handlers during testing

* Remove unused import

(cherry picked from commit 54c47b3daa)
2017-09-26 11:26:45 -05:00
Zach Riggle 23cd5cb819 Fix some unicode problems in readline (#1029)
Technically this introduces issues with e.g. 'unhex ffdf | python foo.py' if
foo.py uses .interactive().  However, that was already broken for other reasons.

Fixes #1004

(cherry picked from commit ebbe917713)
2017-09-26 11:26:45 -05:00
Zach Riggle 47d5cf7da1 Make some docs warnings go away and add some accessor methodds (#1035) 2017-09-22 16:23:47 -07:00
Zach Riggle a7263688db Make 'pwn template' better (#1032)
* Slightly enhance template and advertise for the feature itself in scripts

Add single-dash to the "very good" characters in shell escaping, to avoid
the need to single-quote things like --host and --port.

* Add --quiet option for pwn template, move gdbscript down a bit

* Slightly better docs for 'pwn template'

* Add checksec information directly to 'pwn template' output
2017-09-21 18:55:03 -07:00
Zach Riggle 630c4651fa Synthesize fault_addr on amd64 if it is zero. (#1031)
* Synthesize fault_addr on amd64 if it is zero.

Fixes Gallopsled/pwntool#1018

* Add a doctest for fault_addr on amd64

* Fix doctest
2017-09-21 17:53:32 -07:00
Zach Riggle 54c47b3daa Try to cut down on the crazy verbosity of logging (#1036)
* Prevent Sphinx from dumping all level=INFO logging output to stdout.

See Gallopsled/pwntools#1036 for more information.

* Filter out Paramiko logs too, apply filter to all root handlers during testing

* Remove unused import
2017-09-21 17:50:53 -07:00
Kristoffer Søholm bb25140807 DynELF bug fixes (#1017)
* DynELF: trust ELF base address

* Bug fixes for DynELF:

 * Fixed lookup when not using libcdb
 * Fixed _find_linkmap returning 0 instead of None when linkmap doesn't
   exist
 * Fixed _lookup_build_id crashing if linkmap cannot be found
 * Misc cleanup

* Changes based on feedback
2017-09-21 14:10:21 -07:00
Zach Riggle ebbe917713 Fix some unicode problems in readline (#1029)
Technically this introduces issues with e.g. 'unhex ffdf | python foo.py' if
foo.py uses .interactive().  However, that was already broken for other reasons.

Fixes #1004
2017-09-16 20:11:58 -05:00
Mathias Svensson b62804eff6 Begin working on 3.11.0 2017-09-11 19:13:20 +02:00
Mathias Svensson ec98dc1246 Release 3.10.0beta0 2017-09-11 18:59:06 +02:00
Mathias Svensson 92ad1a4933 Release 3.9.0 2017-09-11 18:52:47 +02:00
Zach Riggle 7cd3c7b300 Merge branch 'beta' into dev 2017-09-08 12:41:42 -05:00
Zach Riggle 3e163e9cf2 Merge branch 'stable' into beta 2017-09-08 12:41:06 -05:00
Zach Riggle 267c6cc15a Force Ubuntu 12.04 until we can migrate to 14.04 (#1023)
* Force use of Ubuntu 12 builds on Travis CI until we can migrate to 14

* Fix Travis Dockerfile

* Add bash command logging to Travis scripts, since Travis removed its own logging

* curl should follow redirects when grabbing Ubuntu packages

* Update Travis cache directories to newer version of Python, as seen in Travis logs

* Use ::1 instead of ip6-localhost since Travis 12.04 changes broke it
2017-09-08 12:40:31 -05:00
Benno Fünfstück 5831796f6f Add configurable gdbinit (#1007)
* fix typo in comment

* new config option: context.gdbinit

This allows setting the default gdbinit for GDB, which is helpful when you want
to enable some GDB extension only when using pwntools and not by default.
2017-09-06 12:56:55 -05:00
Christophe GRENIER c438893d7e Fix for overwritten env when parsing core file (#1014)
* Fix for overwritten env when parsing core file

* warn_once message when dealing with overwritten pointer to env variable in core file
2017-09-06 12:55:37 -05:00
Mathias Svensson 3e33180655 Update CHANGELOG 2017-07-29 13:26:21 +02:00
Mathias Svensson e09543c098 Start working on 3.10 2017-07-29 13:02:55 +02:00
Mathias Svensson 1a94acab67 Release 3.9.0beta0 2017-07-29 12:23:04 +02:00
Mathias Svensson 6263a347bd Release 3.8.0 2017-07-29 10:23:27 +02:00
Mathias Svensson a344047348 Make concat_all faster while also simplifying it's logic (#1003) 2017-07-21 16:34:39 -05:00
Mathias Svensson 4aa96b48ba Merge branch 'beta' into dev 2017-07-15 00:21:49 +02:00
Mathias Svensson 6f2598aee0 Merge branch 'stable' into beta 2017-07-15 00:20:04 +02:00
Mathias Svensson 3f42ce8636 Change the author_email since the new pypi didn't accept the old one 2017-07-15 00:19:05 +02:00
Mathias Svensson 901f3eddb1 Merge branch 'beta' into dev 2017-07-14 22:57:36 +02:00
Mathias Svensson 5180230f04 Merge branch 'stable' into beta; release 3.8.0beta1 2017-07-14 09:05:40 +02:00
Mathias Svensson 1ab07de033 Release 3.7.1 2017-07-14 09:00:42 +02:00
Zach Riggle 5936d0f565 Merge branch 'beta' into dev 2017-06-27 13:53:03 -05:00
Zach Riggle e3fd03458a Merge branch 'stable' into beta 2017-06-27 13:52:27 -05:00
Zach Riggle 55016fb416 Fix config types for integer values (#998)
* Fix config types for integer values

Fixes Gallopsled/pwntools#988

* Add warning for unsupported configuration types
2017-06-26 18:52:38 -05:00
Zach Riggle 08b316098b Update ISSUE_TEMPLATE.md 2017-06-22 00:26:47 -05:00
Zach Riggle a27cb1c168 Update ISSUE_TEMPLATE.md 2017-06-21 11:37:26 -05:00
Zach Riggle d923729dfb Update ISSUE_TEMPLATE
Closes Gallopsled/pwntools#994
2017-06-21 11:35:14 -05:00
Mathias Svensson db75ecb897 Start working on 3.9.0dev 2017-06-19 23:42:29 +02:00
Mathias Svensson 0dc2949790 Release 3.8.0beta0 2017-06-19 22:31:39 +02:00
Mathias Svensson 52b8f4fa29 Release 3.7.0 2017-06-19 22:19:31 +02:00
Zach Riggle 89a848b51f Update CHANGELOG 2017-06-19 13:36:51 -05:00
Zach Riggle 672b4dd090 Update CHANGELOG 2017-06-19 13:34:42 -05:00
Zach Riggle 094e44fd65 Merge branch 'beta' into dev 2017-06-12 12:45:30 -05:00
Zach Riggle 4552624883 Merge branch 'stable' into beta 2017-06-09 17:30:50 -05:00
Kenny K b171f1e2e3 pwn template start() doesn't return io object if only local. (#975) 2017-06-09 17:29:05 -05:00
pedroysb 85523e6d8a Fixing error when setuid=True (#992)
Importing stat module to fix some errors on lines 361 to 364. The errors are caused when using the parameter setuid=True.
2017-06-09 12:41:38 -05:00
Zach Riggle 8b761fc0e3 Fix test which relies on w3challs (#993) 2017-06-09 12:23:00 -05:00
Zach Riggle b83db46c34 Fix issue with newer versions of ADB 2017-06-05 15:45:21 -05:00
Zach Riggle 40c1796fc4 Correct recvrepeat docs 2017-05-28 19:39:32 -05:00
Zach Riggle 984d54d9b2 Empty commit to test whether Docker.io rebuilds are large or small 2017-05-25 20:06:16 -05:00
Zach Riggle 3cbc527deb Update Makefile and generated Makefiles 2017-05-25 14:51:09 -05:00
Zach Riggle 1482fb7545 Add base configuration 2017-05-25 14:48:09 -05:00
Zach Riggle 7ed6f5fe6b Make pwntools:stable depend on pwntools:base 2017-05-25 14:47:36 -05:00
Zach Riggle fd5a7fea68 Fix "Full RELRO" detection in ELFs (targeting dev) (#981)
* Fix Full RELRO detection in ELFs.

This add supports for the newer DF_BIND_NOW and DF_1_NOW flags.
These are used instead of DT_BIND_NOW when linking with gold.
Also fixed the order of checks, now it reports "No RELRO" when
BIND_NOW is present but GNU_RELRO is not (in which case the bindings
are done at start but they will not be marked as read-only).

* Add x86 test binaries for relro check.
2017-05-25 14:32:35 -05:00
Steven Van Acker 8953dc3d5c bandit.labs.overthewire.org SSH is now on port 2220 (#984) 2017-05-25 14:32:05 -05:00
Zach Riggle fda1821fd9 LibcDB Docs, Doctests, Negative Caching, Sane Cache (#986)
* Make libcdb optional

* Add negative caching for libc databases

* Add docs and doctests, add md5/sha1/sha256

* Add libcdb to main docs

* Slightly more useful doctests

* Expose functions in __all__

* Slightly better logging messages

* Fix __all__
2017-05-23 04:42:09 -05:00
Zach Riggle f7568b47b3 Capitalize first words of sentences 2017-05-21 13:40:30 -05:00
Zach Riggle 2ccd36ca7f Fix Ubuntu versions 2017-05-21 13:38:13 -05:00
Zach Riggle 9062360041 Fix document heading 2017-05-15 18:37:00 -05:00
Zach Riggle 3f9c192a5e Add a bit more args docs 2017-05-15 13:02:59 -05:00
Mathias Svensson b8e902b611 Merge branch 'beta' into dev 2017-05-12 10:21:37 +02:00
Mathias Svensson d586d6f660 Merge branch 'stable' into beta 2017-05-12 10:06:53 +02:00
Mathias Svensson 6709a4f747 Release 3.6.1 2017-05-12 10:01:41 +02:00
Mathias Svensson 1a4a1e11ba Follow-up to #980 making it actually work 2017-05-12 09:57:34 +02:00
Zach Riggle f82c0aa3a2 Add mako files to MANIFEST (#980) 2017-05-10 19:59:41 -05:00
Zach Riggle 646ca1eb26 Attempt at fixing #974; I don't have a keyboard with a keypad right now, so can't test. (#979) 2017-05-10 17:00:33 -05:00
Mathias Svensson 8055ec98ce Prepare work on 3.8.0 2017-05-08 20:56:08 +02:00
Mathias Svensson aa1f3f7f5a Merge branch 'beta' into dev 2017-05-08 20:22:39 +02:00
Mathias Svensson 043627a56d Release 3.6.0 2017-05-08 20:00:47 +02:00
Mathias Svensson a40a0ecab4 Merge branch 'stable' into beta 2017-05-08 19:59:31 +02:00
Zach Riggle bbe20c9748 Update CHANGELOG 2017-05-04 13:40:55 -05:00
Zach Riggle c700f9194c Update CHANGELOG 2017-05-04 13:40:08 -05:00
Zach Riggle 71a3e43be3 Update CHANGELOG 2017-05-04 13:38:44 -05:00
Zach Riggle 267b9990c2 Update CHANGELOG 2017-05-04 13:38:32 -05:00
Zach Riggle cfee8e0b24 Update CHANGELOG 2017-05-04 13:37:45 -05:00
Zach Riggle 32a767d469 Update CHANGELOG 2017-05-04 13:37:06 -05:00
Zach Riggle eaea783e2a Verify corefiles are the same via hash before using cached copy (#970) 2017-05-04 13:04:48 -05:00
Zach Riggle 9bda42e45d Merge remote-tracking branch 'upstream/beta' into dev 2017-05-01 23:50:16 -05:00
Zach Riggle f4b3469fb4 Fix incorrect ordering in template for non-ssh remotes (#968) 2017-05-01 23:49:57 -05:00
Zach Riggle 0903f9055b Fix typo: PRSP vs PRPS 2017-05-01 15:13:45 -05:00
Zach Riggle 0a23a457c5 Add ARCH_HAS_ELF_RANDOMIZE 2017-05-01 15:13:45 -05:00
David Tomaschik 7fe6dd0e8e Respect TERM_PROGRAM for run_in_new_terminal. Fixes #964. (#967)
* Respect TERM_PROGRAM for run_in_terminal.  Fixes #964.

* Set args for TERM_PROGRAM.
2017-05-01 01:22:49 -05:00
Zach Riggle 4772a22fed Only use PPA for older Ubuntu releases (#961)
Fixes Gallopsled/pwntools#953
2017-04-28 12:25:38 -05:00
Roman 42692c685e Add ability to set env vars in template (#960)
* added ability to set env vars in template

* changed env param to general *a, **kw
2017-04-21 15:11:09 -05:00
micbou aa3acc162f Fix dd documentation (#959) 2017-04-21 15:10:51 -05:00
Mathias Svensson 676e6869a0 Merge branch 'beta' into dev 2017-04-20 01:25:48 +02:00
Mathias Svensson 9b50163760 Allow setting the terminal through a tuple instead of a list (#957) 2017-04-20 01:25:25 +02:00
Zach Riggle 289109f499 Merge remote-tracking branch 'upstream/beta' into dev 2017-04-18 13:44:45 -05:00
Roman e90fb15596 Fixed processing of lists in config file (#954)
* fixed handling of lists in config file

* changed list to tuple
2017-04-18 13:44:40 -05:00
Zach Riggle 3b9c0db1a2 Better error messages for run_in_new_terminal 2017-04-18 13:44:29 -05:00
Roman dd7a67b6d7 Fixed errors in template generator (#952)
* fixed port type

* missed exploit.py template

* fixed condition availability parameters
2017-04-17 12:35:47 -05:00
Mathias Svensson ad87c17f73 Merge branch 'beta' into dev 2017-04-15 11:24:55 +02:00
Mathias Svensson 2714a30488 Release 3.6.0beta1 2017-04-15 10:52:38 +02:00
Mathias Svensson ac386877d1 Release 3.5.1 2017-04-15 10:43:55 +02:00
Zach Riggle 4f08b6d79c Allow setting context.device=None, and use context.arch to determine default ABI for adb.compile (#950) 2017-04-13 13:54:17 -05:00
Zach Riggle 348f6dfbe7 Update CHANGELOG for 3.5.1 and 3.6.1beta release 2017-04-13 13:40:43 -05:00
Zach Riggle 80219df5cc Require a path for 'pwn template' (#947)
Closes Gallopsled/pwntools#943
2017-04-13 10:37:21 -05:00
Zach Riggle 065c79d29c Speed up ssh via caching checksec results (#945)
* Speed up ssh via caching checksec results

Closes Gallopsled/pwntools#944

* Fix logging message

(cherry picked from commit 8a7bb9b9f4)
2017-04-12 21:47:41 -05:00
Zach Riggle 310f186e5f Do not attempt to populate GOT and PLT symbols for Corefiles (#948)
Closes Gallopsled/pwntools#946
2017-04-12 21:47:05 -05:00
Hlynur Óskar Guðmundsson bac44542ed Made an error message when a default terminal is not found more verbose and helpful (#941) 2017-04-11 12:10:30 -05:00
Zach Riggle a54e697b55 Add CONFIG_COP_ACCESS from CVE-2017-0583 2017-04-04 17:06:18 -05:00
Gábor Szarka 5f1294af09 Make DynELF more robust to different base addresses (#933)
The check for when certain ELF fields contain offsets instead of pointers can be
made more precise by checking for the type field in the ELF header instead of
comparing the value to some hard-coded range.
2017-04-02 17:07:08 -05:00
Grazfather 7cc4ced8d6 gdb: Use quiet (-q) option (#940) 2017-04-02 17:06:17 -05:00
Mathias Svensson 5c72d62c90 Update the CRC list 2017-03-30 13:56:44 -05:00
Zach Riggle 925cb43024 Run autopep8 on known crcsums before merging Idolf's change, so that the difference is visible 2017-03-30 13:55:08 -05:00
Zach Riggle 6f42e1c337 Fix more logging messages 2017-03-28 11:16:08 -05:00
Zach Riggle 8a7bb9b9f4 Fix logging message 2017-03-28 11:14:50 -05:00
Mathias Svensson 512c2544b5 Start working on 3.7.0 2017-03-26 22:43:05 +02:00
Mathias Svensson 8120b5c037 Merge branch 'stable' into beta 2017-03-26 22:18:01 +02:00
Mathias Svensson 55456814fc Release 3.5.0 2017-03-26 21:13:03 +02:00
Zach Riggle eb3e3797cd Update CHANGELOG for 3.6.0beta release 2017-03-23 13:15:03 -05:00
Zach Riggle 3416b7c949 Fix conditional for logging 2017-03-19 17:11:33 -05:00
Zach Riggle dc9882abe7 Use _run for objdump output 2017-03-06 14:27:13 -06:00
Zach Riggle 664622fa07 Use all symbols in inverted PLT search 2017-03-06 14:05:53 -06:00
Zach Riggle 930f2a4a32 Do not dump PLT emulation data to DEBUG logs unless explicitly set via PLT_DEBUG 2017-03-04 18:31:24 -06:00
Zach Riggle 10ef77b997 Add missing link to Changelog 2017-03-04 16:10:50 -06:00
Zach Riggle ecba8e4b38 Update changelog for 3.5.0 2017-03-04 16:09:08 -06:00
Mathias Svensson 0d3b97b378 Merge branch 'beta' into dev 2017-03-03 23:20:08 +01:00
Zach Riggle 33945f6885 Clean up socket-class and socket-type code in sock/remote/listen (#920)
* Clean up socket-class and socket-type code in sock/remote/listen

* Slight change to docs

* Add doctests for listen and attribute documentation

* Fix bug in listen.close()

* Fix regression on ipv6 sockets

* Simplify documentation

* Fix doctest
2017-03-03 14:04:58 -06:00
Zach Riggle b7ddfa995e Fix ARM PLT parsing, and big-endian ARM emulation (#910)
* Do not use UC_MODE_BIG_ENDIAN, its support is poor

* Ghetto-swap endianness for emulation of PLT instructions

* Reduce instruction alignment so that all ARM PLT entries are found

* Add tests for ELF PLT loading

* Fix canary detection on PowerPC

* Fix x32 emulation

* Fix two failing doctests

* Add AArch64 to supported big-endian architectures

* Add MIPS GOT parsing code, fix unpack macros to use ELF settings

* Why, MIPS, are you so complicated?

* Catch weird edge cases

* I don't know what's real anymore

* Fix synthetic symbol generation and add tests

* Remove canary test

* Guard against errors in MIPS GOT

* Fix doctests
2017-03-02 19:03:45 -06:00
Mathias Svensson 3b2be2b2a7 Merge branch 'stable' into beta 2017-03-02 11:47:55 +01:00
Zach Riggle 0a3ac521ad Work around appdirs error for Travis CI builds (#924)
Closes Gallopsled/pwntools#921
2017-03-01 17:58:22 -06:00
Zach Riggle 1f72e45eaf Attempt appdirs workaround 2017-02-25 01:44:55 -05:00
Zach Riggle 421a3093fc Remove spinners that will probably get us yelled at 2017-02-25 01:25:08 -05:00
Zach Riggle d08fc6d3a0 Simplify Travis Dockerfile 2017-02-24 15:50:33 -05:00
Zach Riggle dd6931907a Update user-agents 2017-02-24 14:15:29 -05:00
Zach Riggle de3a68d8b4 Update 'pwn template' template to support argv and auto-downloading the target file (#919) 2017-02-22 12:09:55 -05:00
Zach Riggle 93b828ff97 Add missing basic templates for AArch64 (#918)
* Add missing basic templates for AArch64

* Simplify aarch64 templates

* Fix broken doctests
2017-02-21 19:48:58 -05:00
Zach Riggle 326dd83321 Handle errors during ssh.checksec() (#917)
* Handle errors during ssh.checksec()

Closes Gallopsled/pwntools#916

* Add additional error handling for ulimit checks
2017-02-21 14:57:58 -05:00
Mathias Svensson f8bb49c78f Merge branch 'beta' into dev 2017-02-17 14:56:39 +01:00
Mathias Svensson 510e247034 Merge branch 'stable' into beta 2017-02-17 14:48:14 +01:00
Mathias Svensson 4d529cd543 Release 3.4.1 2017-02-17 14:29:51 +01:00
Kristoffer Søholm e021f57806 Fixed bug in generatePadding (issue #891) 2017-02-17 14:15:31 +01:00
Zach Riggle b6cfec6284 Do not fail with gdb.debug() over ssh when given an absolute path (#894)
* Do not fail with gdb.debug() over ssh when given an absolute path

Fixes Gallopsled/pwntools#885

* Prevent failing on stable since this directory doesn't exist
2017-02-17 00:02:53 -05:00
Zach Riggle 4834032b14 Doctest all members, even if they are not exported via __all__ (#914)
* Doctest all members

* Fix doctest failures in asm and remove canary in context

* Fix failing doctest

* Use automodule for pwnlib.context

* Fix failing tests in context module

* Use automodule for pwnlib.memleak
2017-02-16 23:40:50 -05:00
Zach Riggle 1273552189 Do not skip "hidden" doctests (#912)
* Check to see if hidden members are doctested

* Do not skip undocumented members

* Fix broken tests, promote missing tests
2017-02-16 21:30:35 -05:00
Zach Riggle ef1e3cfb97 Fix regression in f4b0e3a5 2017-02-16 19:43:26 -05:00
Zach Riggle e9fc0125a6 Add "pwn template" command for generating templates (#909) 2017-02-16 19:38:34 -05:00
Zach Riggle 81239be429 Fix checksec nx, execstack, relro reporting (#904)
* Fix checksec nx, execstack, relro reporting

Also add a disable_nx function

* Add disablenx command-line utility

Also fix bug where invoking command-line utilities directly by module name
(python -m pwnlib.commandline.foo) would fail
2017-02-16 17:20:28 -05:00
Zach Riggle f4b0e3a5b9 Do not allow interactive assembly, it doesn't work anyway 2017-02-16 16:48:59 -05:00
Kristoffer Søholm 1f1a6667a1 Added test for issue #891 (#903) 2017-02-15 17:00:54 -05:00
Zach Riggle 464e9e54e1 Add 'pwn debug' command-line utility (#905)
Also fixes a bug in process() which would throw the wrong exception
when qemu-user cannot be located for a non-native binary.
2017-02-15 17:00:24 -05:00
Zach Riggle a786a58db7 Emulate PLT for better symbols (#899)
* Emulate all relocation sections for PLT symbols

This adds a dependency on Unicorn

* Don't look up empty symbols
2017-02-15 16:57:24 -05:00
Zach Riggle bc471d13f9 Fix MIPS ELF bit-ness by checking masks in increasing order (#901)
Closes Gallopsled/pwntools#900
2017-02-14 11:36:28 -05:00
Zach Riggle 6af464fc0e Make SROP doctests slightly more verbose 2017-02-13 18:12:52 -05:00
Zach Riggle 29e38a7d49 Add missing --init to docker invocation 2017-02-13 18:02:11 -05:00
Zach Riggle 658589704a Add pwnlib.config module and documentation (#893)
This adds functionality for user configuration files at ~/.pwn.conf
and /etc/pwn.conf.  Previously this was only used by the pwnlib.log
module, and was entirely undocumented.

This is now documented, and offers an easy mechanism for other parts
of the code to have extension points.
2017-02-13 17:55:01 -05:00
Zach Riggle 71855ebd2f Fix Aarch64 syscalls (#897)
* Remove unavailable syscalls from AArch64

The Linux kernel has apparently stopped supporting these

* Rewrite shellcraft.aarch64.linux.cat, add open which uses openat

Fixes Gallopsled/pwntools#896

* Fix doctests to use openat
2017-02-13 17:50:45 -05:00
Zach Riggle 393751351b Add dockerfile for testing-in-a-box on Xenial (#895) 2017-02-13 17:34:26 -05:00
Mathias Svensson c8a690d617 Removed all uses of sh_command_with and sh_prepare (#892) 2017-02-13 14:59:27 -05:00
Kristoffer Søholm 8b8a50b580 Fixed bug in generatePadding (issue #891) 2017-02-13 11:39:42 +01:00
Mathias Svensson 3b07dfe7cc Begin work on 3.6.0 2017-02-13 01:52:59 +01:00
Mathias Svensson 5877f8e97e Merge branch 'stable' into beta-staging 2017-02-13 01:34:31 +01:00
Mathias Svensson 4ebcbee34b Release 3.4.0 2017-02-13 01:31:16 +01:00
Mathias Svensson d25d62c126 Merge branch 'stable' into stable-staging 2017-02-13 01:31:00 +01:00
Zach Riggle 5392611ed5 Use updated testing scripts from 3.5.0 on 3.4.0 2017-02-13 01:17:57 +01:00
Zach Riggle 7c139c7179 Shellcode syscall templates (#871)
* Add templates from generator

* Add abi.stack to all ABIs

* Enable shellcraft.arch.os.foobar.template

* Add pwnlib.registers.current()

* Add syscalls symlinks

* Add syscall generator

* Enable shellcraft.foo() shortcut for shellcraft.arch.os.syscalls.foo()

* Make templates more verbose

* Remove old templates

* Add makefile

* Delete old templates, make shellcraft --list work

This also speeds up boot time by like 0.05 seconds

* Remove unnecessary execve wrappers

* Check for common arch as well

* Don't explode on string arguments that are register names

* Catch bad argument names

* Remove accidental import

* Add aarch64 ABIs since we enabled aarch64 tests

* Fix mmap vs mmap2 syscall

* Make shellcraft command-line work for syscalls

* Remove unnecessary wrapper templates

* Set all default values to zero

* Add example of automatic determination of types

* Add missing register architectures

* Add PowerPC ABIs

* More syscall examples

* Handle mmap vs mmap2

* Add missing import, use full path

* Just use the string name

* Fix rt_sigreturn on amd64

* __NR_ --> SYS_ because of old expectations

* rstrip to remove blankline

* Fix Thumb doctests which uses unpredictable jump labels

* Import additional syscalls by updating the function source.

Support variable-argument syscalls.

Support spilling to the stack.

* Simplified constants.eval logic means no extra parens

* Simplify vararg representation; fix oepn() argument name explicitly

* Fix syscall examples

* Fix reordering of arguments, since we have to support stack spill

* Fix argument name in doctest

* Make Codacy happy

* Restore connect template accidentally removed in 9fceb12b

* Scrape all architectures for syscall names

* Enable void* and void** to be pushed

* Make Codacy happy

* Add __doc__ to sdist

* Follow shellcraft template symlinks

* Detect syscall shellcodes in shellcraft based on path

(cherry picked from commit 94462845fa)
2017-02-12 18:37:20 -05:00
Zach Riggle da9ce55dfd Fix changelog formatting 2017-02-12 18:26:11 -05:00
Zach Riggle 9d394e0df1 Add missing info to 3.4.0 changelog 2017-02-12 18:26:02 -05:00
Zach Riggle f962d2bd21 Add missing info to 3.4.0 changelog 2017-02-12 18:24:50 -05:00
Zach Riggle 667d290d9b Fix regression from 189b1fb3c 2017-02-11 15:16:14 -05:00
Zach Riggle 766c4d8a7f sh_string should return '' for empty strings (#887) 2017-02-11 15:02:46 -05:00
Zach Riggle 189b1fb3c2 Add missing registers to AArch64 sigreturn frame, and update test 2017-02-10 22:54:24 -05:00
Zach Riggle 6c1b882b40 Upgrade warnings to errors in demo 2017-02-10 22:38:04 -05:00
Zach Riggle 0c76348072 Fix AArch64 SROP register name 2017-02-10 22:37:23 -05:00
Zach Riggle 2f7d78bc64 Add sigreturn/corefile examples and sanity tests 2017-02-10 22:34:27 -05:00
Zach Riggle 646723fa8e Remove unneded arg from aarch64 sigreturn 2017-02-10 22:19:11 -05:00
Zach Riggle e77915fba6 Handle PC/SP being invalid in Corefiles 2017-02-10 22:16:13 -05:00
Zach Riggle a02e8da1ea Add AArch64 support to corefiles 2017-02-10 22:16:13 -05:00
Zach Riggle 6979cb0d2b Search for QEMU coredumps first 2017-02-10 21:57:18 -05:00
Zach Riggle bc8942006b Convert alignment error to a warning; add AArch64 2017-02-10 21:54:26 -05:00
Zach Riggle 07c7b51f25 Add ip and fp aliases to user_regs_struct on arm 2017-02-10 21:51:53 -05:00
Zach Riggle ee655cac60 Add Android and AArch64 support to SigreturnFrame 2017-02-10 21:19:48 -05:00
Zach Riggle b668815323 Fix elf.functions not containing back-references 2017-02-10 21:07:56 -05:00
Zach Riggle a26a1a1f35 Permit setting SROP arguments directly 2017-02-10 21:03:26 -05:00
Zach Riggle ab42519e26 Enable disassembling entire functions 2017-02-10 19:28:59 -05:00
Zach Riggle 59b44b4fe6 Fix typo from 0c8006ca 2017-02-10 19:28:26 -05:00
Zach Riggle f4f21f147b Squelch error messages when restarting the server 2017-02-10 12:54:01 -05:00
Zach Riggle c06822571f Do not overrite tube.flat with ADB protocol Client 2017-02-10 12:40:22 -05:00
Zach Riggle 383a4f4596 adb.push() should return the target path 2017-02-09 15:25:13 -05:00
Zach Riggle 25d63da30e Do not print connection messages when using AdbClient 2017-02-09 15:20:01 -05:00
Zach Riggle dd2ad30a51 Catch exceptions when SSHing into machines with unsupported architectures (#884)
Fixes fefd48f34
2017-02-05 17:00:09 -05:00
Zach Riggle d160f9b7c9 Make corefiles great again (#839)
Adds a large amount of functionality around Corefiles, to support smarter exploitation

Adds a ".corefile" property to both local and remote (ssh) processes.  See the
documentation for the corefile module for extensive examples and tests.

Additionally, context.delete_corefiles and context.rename_corefiles have been added,
to control the behavior of the ".corefile" property.
2017-02-05 10:49:50 -05:00
Zach Riggle 0bdbc2b8c3 Make pwnlib.rop consistent with context.bytes (#882)
Fixes Gallopsled/pwntools#879
2017-02-05 09:36:45 -05:00
Zach Riggle d0c4d8488e Disable exit-on-error at the end of bash scripts (#881) 2017-02-05 07:43:38 -05:00
Zach Riggle f3968afbbb Add aarch64 documentation, which enables doctests (#875)
* Add aarch64 documentation, which enables doctests

* Fix failing doctest

* Attempt to figure out whats going on with Travis

* Use the Xenial version of qemu-static since the Zesty version is broken for AArch64
2017-02-02 00:32:25 -05:00
Zach Riggle 2d04acb867 Enhance adb.which to support all=True 2017-01-31 15:05:26 -05:00
Zach Riggle 62842e20f0 Make command-line tools work better 2017-01-29 18:50:46 -05:00
Zach Riggle c929217947 Restore dupsh from d21af22f82
Closes Gallopsled/pwntools#873
2017-01-27 08:17:16 -05:00
Zach Riggle ff08a859f8 Docker: Install unprivileged user pwntools, use correct tags 2017-01-26 16:03:26 -05:00
Zach Riggle ba24b440c5 Convert symlink to actual file, since Docker Hub doesnt like symlinks 2017-01-26 14:40:34 -05:00
Zach Riggle b31adf27d0 Update dockerfiles and add various distros / release versions 2017-01-26 14:04:37 -05:00
Zach Riggle 20d27c651a Silence commits in the build logs 2017-01-25 18:14:06 -05:00
Zach Riggle ba7911651e Install a recent version of GDB onto Travis (#872)
These files should be cached automagically.
2017-01-25 17:21:59 -05:00
Zach Riggle cded6cda47 Make upgrades / add fields to process() (#869)
- Show the PID when a process is created
- Make process.cwd into a property, which fetches the real CWD from procs
- Record the UID/GID and SUID/SGID of the executed file
- Add a few doctests
- Make _stop_noticed a timestamp
2017-01-24 19:30:26 -05:00
Zach Riggle 25941b52bb Multiple SSH enhancements (#868)
- Break out ssh_channel into subclass ssh_process
- Make ssh.process() directly instantiate ssh_process
- Add ssh_process().ELF
- Add ssh_process().corefile
- Record the UID and GID of the executed binary
- Add the created PID to the ssh_process message
2017-01-24 19:02:57 -05:00
Zach Riggle b79a750af6 Force-install libcapstone3 since it is causing errors 2017-01-24 18:02:43 -05:00
Zach Riggle eede2e2e1d Always upgrade Pip first 2017-01-24 17:43:19 -05:00
Zach Riggle 2a59f5cf4c Fix chunked reading of ELF files (#865)
* Fix chunked reading of ELF files

This introduces a new dependency on 'intervaltree', which is used
to automatically select segments which are relevant for a given
virtual-address range.

This also introduces a new ELF.memory attribute, which is the tree
of memory ranges, which point at the segment objects that describe
the memory range.

These are recalculated when ELF.address is adjusted, and we have
tests for that.

This also optimizes some of the other routines to avoid the wrapped
file-seeking, and to just use the mmap.

* Rewrite install scripts to use more modern versions of binutils

* Load segments in file-order, chop any overlaps
2017-01-24 13:41:29 -05:00
Mathias Svensson a3e82e27bb Fix a few edge cases in weird ELF files (#867)
* Fix a few edge cases in weird ELF files

* Add a check for PT_LOAD
2017-01-24 19:14:29 +01:00
Zach Riggle 368a708663 Upgrade documentation requirements on Travis 2017-01-24 12:00:34 -05:00
Zach Riggle 4a7de306f0 Convert impossible doctest into a code-block 2017-01-23 15:47:43 -05:00
Zach Riggle 69bbd0839a Clean up pwnlib.asm documentation and doctests 2017-01-23 15:39:36 -05:00
Zach Riggle 475ffa632e Always run Android tests on staging branches and new tags (#866) 2017-01-23 14:43:32 -05:00
Zach Riggle 06db497901 Add a bit more documentation to context.rst 2017-01-23 12:16:30 -05:00
Zach Riggle 5106c4eb75 Fix test in dpkg_search_for_binutils 2017-01-23 12:11:02 -05:00
Zach Riggle 08b7b190a7 A few documentation touch-ups 2017-01-23 12:08:36 -05:00
Zach Riggle 8259d07207 Remove useless doctest lines 2017-01-23 12:01:27 -05:00
Zach Riggle ad2eb77cfa Explicitly run a few asm tests 2017-01-23 12:00:08 -05:00
Zach Riggle ec04c860c0 Remove unnecessary doctests:: blocks 2017-01-23 11:59:48 -05:00
Zach Riggle ffe4cf6807 Add doctest for print_binutils_instructions 2017-01-23 11:19:36 -05:00
Zach Riggle 673073f08d Add a test for pwnlib.asm.dpkg_search_for_binutils 2017-01-23 11:15:57 -05:00
Zach Riggle 0e45f23af8 Add pwnlib.protocols module (#860)
* Add pwnlib.protocols module

Migrate pwnlib.adb.protocol into that directory, and add compatibility shims

* Add documentation links, and run doctests

* Make doctests run

* pwnlib.protocols.adb.Client.transport should work with no device
2017-01-20 18:59:23 -05:00
Zach Riggle 31cd98affe Do not truncate the ELF file when saving to the same path 2017-01-20 15:27:46 -05:00
Zach Riggle 3e4a1bcc72 Fix errant version number printing 2017-01-20 15:22:59 -05:00
Zach Riggle 85c3074574 Allow calling ELF.save() with no arguments 2017-01-20 15:22:59 -05:00
Zach Riggle 178e64a4f7 Add symlink option for ssh.set_working_directory to simplify exploits (#862)
* Add symlink option for ssh.set_working_directory to simplify exploit code

* Add additional options and tests to symlink=xxx
2017-01-20 14:58:08 -05:00
Zach Riggle 179476604e Fix error message format string
Closes Gallopsled/pwntools#863
2017-01-20 14:38:37 -05:00
Zach Riggle fc6e00d9f0 Update changelog for 3.5.0 2017-01-19 15:18:17 -05:00
Zach Riggle 8b1f1dce84 Update changelog for 3.5.0 2017-01-19 15:11:44 -05:00
Zach Riggle 8345bc3824 Add parse_kconfig and kernel information to pwnlib.elf.ELF (#861) 2017-01-19 11:01:31 -05:00
Zach Riggle 300f8e0c1a Speed up processing of symbols slightly, by not checking for each entry 2017-01-17 16:38:01 -05:00
Zach Riggle 9ace73a977 Replace broken function-decorator context.quiet with working context.quietfunc
Fixes: ae6a0745f
2017-01-17 15:10:25 -05:00
Zach Riggle fb16e158ec Use tubes.buffer for net.wget, add more tests 2017-01-17 13:58:49 -05:00
Jakub Wilk e519874947 Fix typos (#859) 2017-01-16 11:42:38 -05:00
Zach Riggle 2e90d05156 Actually implement ssh.sftp setter, so it can be set to None 2017-01-14 15:05:15 -05:00
Zach Riggle b6e3d5d8c5 Fix register usage in execve shellcode (#857)
The previous code worked, but we emitted a register swap that hid the fact we were using the wrong registers

Fixes Gallopsled/pwntools#856
2017-01-13 14:00:28 -05:00
Zach Riggle 0726d8d339 Fix hexdump alignment for weird widths
Closes Gallopsled/pwntools#849
2017-01-12 17:57:54 -05:00
Mathias Svensson bd5a368754 Merge branch 'beta' into dev 2017-01-12 23:48:54 +01:00
Mathias Svensson 602efd2790 Release 3.4.0beta4 2017-01-12 23:42:25 +01:00
Mathias Svensson 2f7f0de984 Release 3.3.4 2017-01-12 23:40:13 +01:00
Zach Riggle 45d2c11535 Update changelog for 3.3.4 2017-01-12 17:30:30 -05:00
Zach Riggle 16b507e197 Change hexdump_iter to not rely on the length of its input file (#850)
We cannot determine the length of the file if passed e.g. a tube or a pipe or PTY or character device (e.g. stdin or /dev/null).

Supercedes: 9c2f0f4e
(cherry picked from commit 14f717b7b4)
2017-01-12 17:20:15 -05:00
Zach Riggle 53f041a4d2 Fix shellcraft.amd64.popad registers (#853)
Fixes Gallopsled/pwntools#848
2017-01-12 16:47:44 -05:00
Zach Riggle b2a5b76cf7 Do not perform temporary register selection if we don't need to (#852)
Fixes Gallopsled/pwntools#847
2017-01-12 16:36:49 -05:00
Zach Riggle 9cb438842c Use class- and init-level documentation for Sphinx autodocs 2017-01-12 16:09:23 -05:00
Zach Riggle 14f717b7b4 Change hexdump_iter to not rely on the length of its input file
We cannot determine the length of the file if passed e.g. a tube or a pipe or
or PTY or character device (e.g. stdin or /dev/null).
2017-01-12 15:01:42 -05:00
Zach Riggle f792407c19 Remove hanging comment 2017-01-11 19:22:48 -05:00
Zach Riggle 9c2f0f4e89 Fix hexdump_iter for actual file objects, like those used by phd (#846) 2017-01-11 15:06:11 -05:00
Zach Riggle eb0bb6ea8d Add doctest for hexdump_iter 2017-01-11 00:51:28 -05:00
Zach Riggle f46112e873 Fix hexdump_iter for actual file objects, like those used by phd 2017-01-11 00:45:39 -05:00
Zach Riggle 975844d83d Add SigreturnFrame.__flat__ 2017-01-10 21:29:36 -05:00
Zach Riggle 466c0e4179 Add elf.process, elf.fit, process.fit
Also fix the implementation of elf.flag
2017-01-10 21:27:50 -05:00
Zach Riggle 17e4f01976 Enhance output of amd64.mov shellcraft for very large values 2017-01-10 18:18:34 -05:00
Mathias Svensson fecd6f8222 Merge branch 'beta' into dev 2017-01-11 00:03:09 +01:00
Mathias Svensson 7ba3a1b32f Release 3.4.0beta3 2017-01-10 23:53:59 +01:00
Mathias Svensson d1edd275d9 Release 3.3.3 2017-01-10 23:52:50 +01:00
Zach Riggle 8f012947e9 Add build-essential and pip upgrade to installation steps (#845)
Fixes Gallopsled/pwntools#844
2017-01-10 17:35:50 -05:00
Zach Riggle 36b05bac2b Add doctests for the hexdump utility (#842)
Related: Gallopsled/pwntools#837
Related: Gallopsled/pwntools#840
2017-01-10 17:21:54 -05:00
Zach Riggle cb4991c41d Fix regression in amd64.mov with 32-bit values >= 0x80000000 (#843)
Fixes Gallopsled/pwntools#841
Caused by: Gallopsled/pwntools#504 (9ca377c)
2017-01-10 15:56:50 -05:00
Mathias Svensson 65f18b6091 Merge branch 'beta' into dev 2017-01-10 18:43:46 +01:00
Mathias Svensson 48616c633d Release 3.4.0beta2 2017-01-10 18:30:16 +01:00
Mathias Svensson 323975f343 Release 3.3.2 2017-01-10 18:28:24 +01:00
Zach Riggle f65c258956 Fix hexdump regression in 3.3.1 (#840) 2017-01-10 12:15:34 -05:00
Mathias Svensson c928a0425e Merge branch 'beta' into dev 2017-01-10 17:00:15 +01:00
Mathias Svensson f5e16d3db6 Release 3.4.0beta1 2017-01-10 16:59:22 +01:00
Mathias Svensson d55874a6d3 Release 3.3.1 2017-01-10 16:53:24 +01:00
Zach Riggle 0426d498d9 Resolve feature regression in hexdump(..., cyclic=True)
This code wasnt updated when the code was changed to operate on file descriptors.

Additionally, there was a functional regression, that the first line would be skipped.

Fixes: Gallopsled/pwntools#836
Caused by: Gallopsled/pwntools#695 (d65991d)
2017-01-09 21:59:19 -05:00
Zach Riggle fefd48f341 Add ssh.checksec functionality (#835)
Looks like this:

[x] Connecting to example.pwnme on port 22
[+] Connecting to example.pwnme on port 22: Done
[*] [email protected]:
    Distro    Ubuntu 14.04
    OS:       linux
    Arch:     amd64
    Version:  3.11.0
    ASLR:     Enabled
    Note:     Susceptible to ASLR ulimit trick (CVE-2016-3672)

Fixes Gallopsled/pwntools#753
2017-01-09 13:55:38 -05:00
Zach Riggle 132f48e6ee Fix failing doctest. Not sure what changed, but it was clearly not guaranteed to be right, given global state. 2017-01-07 19:16:04 -05:00
Zach Riggle e205e17b6d Fix doctests in ELF module 2017-01-07 18:32:37 -05:00
Zach Riggle d0267f3ee7 packing.fit() should handle extremely large offsets as if they are cyclic patterns 2017-01-07 18:21:14 -05:00
Zach Riggle 0c8006ca4e Enable passing an elf.Function to flat() 2017-01-07 18:14:57 -05:00
Zach Riggle bd88c92991 Greatly enhance and update the pwnlib.elf module documentation. 2017-01-07 18:10:59 -05:00
Zach Riggle 12f1bb9126 Add signal names to negative exit codes for process.poll() 2017-01-07 16:37:57 -05:00
Zach Riggle 3fa2c659fd Merge branch 'beta' into dev 2017-01-05 12:41:28 -05:00
Zach Riggle a2c67e5075 Merge branch 'stable' into beta 2017-01-05 12:39:25 -05:00
Zach Riggle 54e722819b Defer attempts to start ADB server until we actually fail to connect (#833)
* Defer attempts to start ADB server until we actually fail to connect

* Upgrade to a warning message; fix .version() multiple calls with _autoclose

* Add doctest which tests the kill/restart behavior
2017-01-05 12:38:51 -05:00
Zach Riggle 179a0656f5 Add better example of NOPTRACE 2017-01-04 23:16:22 -05:00
Zach Riggle 58b2e36a1b Fix empty code-block 2017-01-04 23:13:50 -05:00
Zach Riggle 24ae51dae4 Greatly enhance documentation for the GDB module, and expose its members in toplevel 2017-01-04 23:06:34 -05:00
Zach Riggle 14e68ec226 Remove _raw variants from public documentation 2017-01-04 14:57:22 -05:00
Zach Riggle 485dcede2c Fix heading style for ADB docs 2017-01-04 14:45:54 -05:00
Zach Riggle 50acdbbe41 Add hyperlinks to tube class 2017-01-04 14:44:30 -05:00
Zach Riggle 4e0e9d2acb Add hyperlinks to process class 2017-01-04 14:43:51 -05:00
Zach Riggle bc7c8cd423 Add missing :const: to docstrings 2017-01-04 14:37:43 -05:00
Zach Riggle a8446bef47 Fix sh_string RST formatting 2017-01-04 14:36:21 -05:00
Zach Riggle afdcdec577 Fix sh_string docs 2017-01-04 14:23:06 -05:00
Zach Riggle c13ff2cb08 Clarify documentation and remove leading process.XXX in docs 2017-01-04 14:18:02 -05:00
Zach Riggle a12d0b6a4c Move PTY, PIPE, STDOUT to toplevel 2017-01-04 14:15:38 -05:00
Zach Riggle 3dd6045488 Fix regression caused by 0cead77 2017-01-04 14:14:23 -05:00
Zach Riggle cca9782424 Add PR_SET_PTRACER to process and ssh.process (#828)
* Add PR_SET_PTRACER to initialization, and add doctests for process.leak/corefile

* Add PR_SET_PTRACER to SSH processes

* Do not warn about YAMA if we dont need to

* Fix doctest to use raw strings

* Fix typo in doctest

* Apparently GDB is not installed on Travis by default

* Add warning message to process("foo") vs process("./foo")

* Add gdb.corefile; make run_in_new_terminal return a PID

* Intentionally break doctest because I dont believe that it worked

* Fix codacy issues

* Fix gdb.attach return value

* Add missing import

* Fix typo, use waitpid

* Refactor some code into gdb.version / gdb.binary

* Permit GDB with multipart versions

* Fix repr() on Corefile

* Silence run-in-new-terminal message for gdb.corefile

* Fix version number

* Remove Yama warning message entirely, it should no longer be necessary

* Version detection is hard.  Regular expressions to the rescue!

* Remove process.kill/stop/resume, those will be a different PR

* Fix doctests

* The GDB used by Travis must be so old!

* Apparently Travis is entirely borked.  Use a less robust test.
2017-01-04 12:59:22 -05:00
Zach Riggle 5ce5339ab5 Silence warning during doctests 2017-01-04 12:58:04 -05:00
Zach Riggle 0cead77039 Move STDOUT/PIPE to process class, so they can be referenced directly 2017-01-04 12:52:19 -05:00
Zach Riggle 1d59a90fa8 Change all imports to absolute per PEP-328, and sort imports (#832) 2017-01-03 18:04:45 -05:00
Zach Riggle ac017d97dc Enable leaking memory relatively with MemLeak (#822)
* Enable leaking memory relatively with MemLeak

Fixes Gallopsled/pwntools#758

* Add RelativeMemLeak alias for MemLeak(..., relative=True)

* Make codacy happy
2016-12-29 13:21:02 -05:00
WGH b584ca349a fixed RuntimeError in setup.py caused by pandoc on non-amd64 arches (#820)
If pandoc is not installed locally, pwntools' setup.py
tells pypandoc to download one.

Unfortunately, it fails on non-amd64 arches because
pypandocs provides precompiled binaries only for amd64.

Since pypandoc is not hard dependency for pwntools,
this error can be skipped without major harm.

In fact, pwntools' setup.py already handles ImportError
gracefully. The problem is, arch mismatch causes
a completely different exception.
2016-12-28 19:12:47 -05:00
Mathias Svensson 8b30700f92 Bump to 3.5.0dev 2016-12-24 12:14:05 +01:00
Mathias Svensson 7ed118763b Merge branch 'dev' into beta 2016-12-24 11:54:21 +01:00
Mathias Svensson 5a370162e5 Release 3.3.0 2016-12-24 11:26:18 +01:00
Mathias Svensson 253ab78e4c Merge branch 'stable' into beta 2016-12-24 11:25:12 +01:00
Mathias Svensson e997c17397 Merge branch 'beta' into dev 2016-12-24 11:10:10 +01:00
Mathias Svensson 0acc8ee499 Merge branch 'stable' into beta 2016-12-24 11:00:32 +01:00
Mathias Svensson d39f9a145e Release 3.2.1 2016-12-24 10:53:02 +01:00
Zach Riggle f14e0e5652 Reorder get_buffer_size so that the value is validated
This prevents silly things like tube.recv("abcdef") which will hang
2016-12-22 16:41:51 -05:00
Zach Riggle aaa83983ad Merge branch 'beta' into dev 2016-12-22 16:27:46 -05:00
Zach Riggle 1b76a27bd5 Merge remote-tracking branch 'upstream/stable' into beta-staging 2016-12-22 16:26:31 -05:00
Zach Riggle 87491bf6dc Fix install script for new branches, where TRAVIS_COMMIT_RANGE is empty 2016-12-22 14:40:43 -05:00
Zach Riggle b30835ec5b Fix regression introduced in 386e68691f 2016-12-22 14:03:09 -05:00
Zach Riggle 1241073391 Remove support for installation without psutil (#821)
* Remove support for installation without psutil.

OpenBSD was the edge case we cared about, it is supported for over a year (giampaolo/psutil#615)

* Bump psutil version to when they introduced OpenBSD support
2016-12-20 14:06:06 -05:00
Zach Riggle cfcd79e169 Update install strings to include libffi-dev and be consistent 2016-12-16 11:37:13 -06:00
Zach Riggle 706a784904 Directly invoke sock.close() when we hit POLLHUP 2016-12-15 20:20:07 -06:00
Zach Riggle 70c96330de Make sock.connected much more robust by using socket.poll (#817)
* Make sock.connected much more robust by using socket.poll

* Fix use of socket.socket.recv vs. ssh transport recv
2016-12-15 20:15:19 -06:00
Zach Riggle cae3cddc07 Fix incorrect error message in serialtube 2016-12-15 20:04:12 -06:00
Zach Riggle 5373dcdeed Fix dev-only regression in serialtube constructor, and use Timeout object properties 2016-12-15 20:04:12 -06:00
Zach Riggle 5d4bf3db6c Add MemLeak.u64/u32/... aliases 2016-12-15 17:15:10 -06:00
Zach Riggle fbfa54ad61 Fix failing doctestse on dev 2016-12-15 16:45:08 -06:00
Zach Riggle b323264032 Merge branch 'beta' into dev 2016-12-15 15:05:16 -06:00
Zach Riggle 332c9d2031 Merge remote-tracking branch 'upstream/stable' into beta-staging 2016-12-15 14:52:39 -06:00
Zach Riggle 036397c861 Fix adb.uninstall() typo (#816)
Closes Gallopsled/pwntools#783
2016-12-15 14:52:25 -06:00
Zach Riggle dcf03fd44d Bugfix for None data from field (#815) 2016-12-15 14:13:36 -06:00
Zach Riggle df54bf2bb3 Dont barf if home directory is not writable (#814)
* Handle the home directory being read-only / cache directory being unavailable

Fixes Gallopsled/pwntools#799

* Add doctest for context.cache_dir
2016-12-15 14:04:45 -06:00
Zach Riggle 386e68691f Multiple ADB performance and functionality fixes (#811)
* Fix ADB wait_for_device with ANDROID_SERIAL set, and fix performance

* Fix QEMU usage for native binaries

* Fix adb.write and adb.listdir operating on the wrong type of object

* Fix failing unit test with new behavior in adb.protocol.Client.list

* Fix adb server startup issue

* Rework deferred initialization to work around class-scope superclass attributes, and add test for AdbDevice
2016-12-14 17:34:18 -06:00
Zach Riggle 2c841eaa21 Add adb.{unlink,mkdir,makedirs,isdir,exists} (#809)
* Add adb.{unlink,mkdir,makedirs,isdir,exists}

* Change unlink() to throw an exception rather than return a string

* Fix doctest and code for isdir

* Remove unused variable
2016-12-14 16:49:41 -06:00
Zach Riggle 22f170abc7 Check the name before attempting to call startswith() (#805) 2016-12-14 16:47:38 -06:00
Zach Riggle 350610fbee Fix error message with StrictHostKeyChecking (#813) 2016-12-14 16:37:05 -06:00
Zach Riggle c7b3852eae Fix exception thrown under 32-bit Python interpreters. (#804)
Fixes Gallopsled/pwntools#518
2016-12-14 16:26:29 -06:00
Zach Riggle eaf6402198 Fix adb.partitions listing (#802)
* Fix adb.partitions listing

* Add adb.walk and adb.find functions to ensure adb.partitions works on devices without a find binary

* Add adb.readlink to simplify logic for reading symlinks
2016-12-14 15:37:47 -06:00
Zach Riggle d2c6184a00 Add missing changelog entry 2016-12-14 14:58:00 -06:00
Zach Riggle e5645e7b53 Update CHANGELOG missing links 2016-12-14 14:49:54 -06:00
Zach Riggle 09dbe0a54d Update CHANGELOG links 2016-12-14 14:49:27 -06:00
Zach Riggle 0bd0de78f9 Update CHANGELOG 2016-12-14 14:48:19 -06:00
Zach Riggle 546061e577 Modify coredump_filter of spawned processes so that library contents are included 2016-12-12 18:26:46 -06:00
Zach Riggle 5ebc8b5bb7 Check the name before attempting to call startswith() 2016-12-12 18:26:46 -06:00
Zach Riggle b83a6c7db8 Fix process.leak by providing a sane default leak size 2016-12-05 15:44:04 -05:00
Owlz 5d9792fb4c Variable Size Buffer Fill (#806)
Support custom buffer-read sizes for `tube` objects via their internal `Buffer` object.  Default buffer size is 4096.  Buffer size can be set per-object at instantiation-time (`tube(buffer_fill_size=...)`), by attribute (`tube.buffer_fill_size=...`), or in a context (`context.buffer_size=...`).
2016-12-05 15:21:08 -05:00
Zach Riggle 1c54e347f2 Add 'shell' option for ssh.process to pass to "sh -c" (#800)
Add 'shell' option for ssh.process to pass to "sh -c"
2016-11-29 11:52:44 -07:00
Ricky Zhou 2f597f41d4 Properly handle exceptions in remote._connect. (#793)
Previously, if getaddrinfo or socket.socket threw an exception,
_connect would return without ever calling h.success or h.failure. As a
result, progress indicators would continue to update indefinitely.

Fix this by using a with statement instead.

(Also remove an unused variable and fix a typo.)
2016-11-28 14:45:20 -07:00
Zach Riggle 7545dafffb Wrap context.log_console when using terminal I/O (#797)
Fixes Gallopsled/pwntools#792
2016-11-23 11:11:17 -07:00
Zach Riggle 3acec5421f Set shell=False 2016-11-12 23:16:32 -08:00
Mathias Svensson 620364dd1d Fixed a link in CHANGELOG.md 2016-11-12 21:10:05 +01:00
Mathias Svensson b441cf967a Start work on 3.4.0 2016-11-12 20:39:25 +01:00
Mathias Svensson 76c21548db Release 3.3.0beta0 2016-11-12 19:33:58 +01:00
Mathias Svensson ad71d9235b Release 3.2.0 2016-11-12 13:43:56 +01:00
Mathias Svensson 2e5f8061b2 Merge branch 'stable' into beta 2016-11-12 12:59:46 +01:00
Zach Riggle 099404277e Enhance documentation and error logging for ssh.process preexec_fn usage (#787)
Also fix other incorrect log usage

Fixes Gallopsled/pwntools#786
2016-11-12 12:58:24 +01:00
Zach Riggle 30c34b785a Fix ROP.call(Function(...)) breaking dump()
Fixes #770
2016-11-10 14:23:28 -08:00
Zach Riggle 6c304d3511 Add a bit more docs to the ADB module 2016-11-10 13:50:15 -08:00
Zach Riggle dc297e17ae Fix docstring commit [skip ci] 2016-11-07 18:52:12 -08:00
Zach Riggle fa402ceb57 Add adb.uptime and adb.boot_time 2016-11-07 17:53:52 -08:00
Zach Riggle 483adb8e2d Update ISSUE_TEMPLATE.md 2016-11-07 12:05:00 -08:00
Zach Riggle 76fe04e356 Fix log message error in adb.uninstall 2016-11-01 16:14:55 -07:00
Justin Steven 82312baba0 Add cyclic_metasploit() and cyclic_metasploit_find() (#785)
* Add cyclic_metasploit and cyclic_metasploit_find

* Stop using mutable default arguments
2016-10-26 17:19:19 -07:00
Zach Riggle d101a775aa Fix adb.uninstall() typo
Closes Gallopsled/pwntools#783
2016-10-26 10:25:34 -07:00
Mathias Svensson 5fda6580e8 Expose the BitPolynom (#755) 2016-10-23 22:38:50 +02:00
Mathias Svensson 9185437626 Merge branch 'beta' into dev 2016-10-23 11:35:03 +02:00
Mathias Svensson bde40c36ae Merge branch 'stable' into beta 2016-10-23 11:12:35 +02:00
Mathias Svensson 894b17e74a Release 3.1.1 2016-10-23 11:11:39 +02:00
Mathias Svensson 33b734cbc6 Added a doctest for MemLeak.struct 2016-10-23 11:11:32 +02:00
Morten Brøns-Pedersen 3e8454412e Bugfix in MemLeak.struct. (#768)
The function didn't work due to `sizeof` not being defined.  This PR imports
`ctypes` and uses `ctypes.sizeof`.
2016-10-23 10:53:04 +02:00
Zach Riggle 420f99c5d0 Automatic update checking should not log to stdout. (#774)
This breaks piping into files for all of the command-line utilities.
2016-10-20 15:41:00 -07:00
Zach Riggle 98052e4166 Add an error to cyclic() if the requested length is too long (#782)
$ cyclic 999999999
[ERROR] Can't create a pattern length=999999999 with len(alphabet)==26 and n==4

Fixes Gallopsled/pwntools#781
2016-10-19 09:18:41 -07:00
Mathias Svensson e971856c74 Merge branch 'beta' into dev 2016-10-18 23:09:45 +02:00
Mathias Svensson 09ee73c31d Merge branch 'stable' into beta 2016-10-18 22:58:20 +02:00
Zach Riggle 0c4d1365e9 Fix documentation generation since autoprogram broke Python2 2016-10-18 22:57:32 +02:00
Mathias Svensson b3f941c3f5 Merge branch 'beta' into dev 2016-10-18 22:42:29 +02:00
Justin Steven 67e11a9aeb Fix typos in cyclic.py's docstrings (#775) 2016-10-18 13:26:42 -07:00
Mathias Svensson 7d5f8ca4b4 Release 3.2.0beta4 2016-10-18 22:22:19 +02:00
Zach Riggle 7695acc798 Fix bash completion regression (#772)
Fixes Gallopsled/pwntools#767
2016-10-18 22:17:31 +02:00
Zach Riggle 3f48a0b803 Remove all Github update checks (#761)
These were nice-to-have, but as long as PyPi is updated and functioning
properly, we don't need to check Github.

Fixes Gallopsled/pwntools#756
2016-10-18 21:58:03 +02:00
Zach Riggle fd731154ff Make process.argv optional, using context.binary 2016-10-15 14:29:13 -07:00
Isaac 906bc94a5f fix typo in TESTING.md (#769) 2016-10-15 13:31:42 +02:00
bstub db03e7de10 Adding escaped hex output format to shellcraft -f option (#765)
* adding output format for python hex-notation

* cleaned up implementation

* changed format identifier to {a} --escaped

* {a] was taken by asm, changed format identifier to {d} --escaped

* adding {e}lf to help
2016-10-14 13:13:02 -07:00
Morten Brøns-Pedersen 97e03fd29f Bugfix in MemLeak.struct. (#768)
The function didn't work due to `sizeof` not being defined.  This PR imports
`ctypes` and uses `ctypes.sizeof`.
2016-10-14 13:11:18 -07:00
Zach Riggle 09b8bb93a7 Fix regressions introduced by f9133b1680 2016-10-14 13:10:13 -07:00
Zach Riggle f9133b1680 Add STDERR argument, and write docs for args module (#760)
Add STDERR argument, and write docs for args module

Fixes Gallopsled/pwntools#759
2016-10-10 19:13:45 -07:00
Mathias Svensson 8aa21bd99a Merge branch 'beta' into dev 2016-10-11 03:06:21 +02:00
Mathias Svensson e5b6aedd3d Release 3.2.0beta3 2016-10-11 03:00:18 +02:00
Zach Riggle 4b405c69b6 Fix incorrect usage of argv in unhex 2016-10-11 02:59:52 +02:00
Zach Riggle 9af20c778f Fix incorrect usage of argv in unhex 2016-10-10 17:55:13 -07:00
Mathias Svensson d1621dca87 Merge branch 'beta' into dev 2016-10-10 15:50:53 +02:00
Mathias Svensson 31b047d29b Release 3.2.0beta2 because pypi is being retarded 2016-10-10 15:48:52 +02:00
Mathias Svensson 39970c3847 Merge branch 'beta' into dev 2016-10-10 14:59:41 +02:00
Mathias Svensson e0c65c9d6d Release 3.2.0beta1 2016-10-10 14:58:51 +02:00
Zach Riggle 59d0cd2eeb Fix wait-for-device with kick=True re-using the same client (#757) 2016-10-10 14:58:00 +02:00
Zach Riggle 8d11fb8594 Fix wait-for-device with kick=True re-using the same client (#757) 2016-10-09 20:00:00 -07:00
Zach Riggle aec3fa6879 Remove all Github update checks (#761)
These were nice-to-have, but as long as PyPi is updated and functioning
properly, we don't need to check Github.

Fixes Gallopsled/pwntools#756
2016-10-07 15:30:38 -07:00
Zach Riggle ab6602407e Move issue/pr templates to .github 2016-10-07 15:18:58 -07:00
Zach Riggle 42ab0c985d Sort inputs with isort 2016-10-05 15:51:05 -07:00
Zach Riggle b215828133 Make tube.stream() more robust 2016-10-05 15:49:41 -07:00
Zach Riggle e3af4ce6a7 Update changelog 2016-10-05 15:44:13 -07:00
Zach Riggle 96c6edcc37 Update changelog 2016-10-05 15:44:03 -07:00
Zach Riggle b198ec8633 Add tube.stream() 2016-10-05 15:43:04 -07:00
Mathias Svensson c8a87381e8 Merge branch 'beta' into dev 2016-10-02 20:38:08 +02:00
Mathias Svensson 548e033e7e Release 3.2.0beta0 by merging branch 'stable' into beta 2016-10-02 20:32:09 +02:00
Mathias Svensson fc097f3446 Fixed a link in the CHANGELOG 2016-10-02 20:27:51 +02:00
Mathias Svensson eb92a95134 Release 3.1.0 2016-10-02 20:12:51 +02:00
Zach Riggle c706461f10 Add branch table 2016-10-02 20:07:12 +02:00
Zach Riggle b0ad5eb915 Add branch table 2016-09-28 13:31:56 -07:00
Zach Riggle 94f88cc8ba Update changelog 2016-09-28 13:13:53 -07:00
Zach Riggle 1e414afbeb Add connect() alias for remote(), add docs for tcp() and udp() aliases 2016-09-28 13:05:54 -07:00
Zach Riggle 869ec42082 Add ssh.read and ssh.write aliases 2016-09-28 13:04:28 -07:00
Zach Riggle 4893819b4c Add adb.install, adb.uninstall, and adb.packages 2016-09-28 12:42:22 -07:00
Zach Riggle fb1b952769 Do not wrap non-functions 2016-09-27 19:31:50 -07:00
Zach Riggle 859380285f Handle missing properties for AdbDevice 2016-09-27 19:08:41 -07:00
Zach Riggle 2af55c9bc3 Allow device-scoped access to ADB facilities off of AdbDevice 2016-09-27 19:04:24 -07:00
Zach Riggle 4725b1be96 adb.adb(["shell", ...]) should go through adb.process() 2016-09-27 13:55:35 -07:00
Zach Riggle 5af5f0c55d Fix adb.push statement ordering 2016-09-26 18:10:18 -07:00
Zach Riggle e84f395c97 Wait for the currently-selected device in wait_for_device 2016-09-26 18:03:27 -07:00
Zach Riggle fbf51ad96e Fix target adb.push() 2016-09-26 17:56:28 -07:00
Zach Riggle 52433339ec adb.protocol.Connection should always pack as 32-bit 2016-09-26 17:43:26 -07:00
Zach Riggle f277d5502f Allow adb.push to specify a full target filename in an existing directory 2016-09-26 16:53:31 -07:00
Zach Riggle 794122ec13 Add kwargs to handle weird "adb devices" output 2016-09-26 16:49:34 -07:00
Zach Riggle 65b266e9b3 Revert part of 8793dec, fix commands, remove shippable.yml 2016-09-26 16:49:34 -07:00
Zach Riggle ca6eddc235 shellcraft.xxx.linux.sh now passes argv0 (#734)
shellcraft.xxx.linux.sh now passes argv0

If you need shorter shellcode, use "execve" directly.

Fixes Gallopsled/pwntools#626
2016-09-25 18:31:29 -07:00
Zach Riggle 8793decd1c Remove additional references to "--pre" and use "python setup.py develop" instead of "-e" magic
Related to Gallopsled/pwntools#735
2016-09-19 17:18:57 -07:00
Mathias Svensson 628aaabd04 Bump the version number in the pip badge 2016-09-19 23:24:01 +02:00
Mathias Svensson 3544167f26 Merge branch 'beta' into dev 2016-09-19 23:16:04 +02:00
Mathias Svensson 9cca9c989b Merge branch 'stable' into beta 2016-09-19 23:07:53 +02:00
Mathias Svensson f42c291fef Release 3.0.4 2016-09-19 22:57:54 +02:00
Zach Riggle dacdd397ab Merge remote-tracking branch 'upstream/stable' into beta 2016-09-19 13:10:34 -07:00
Zach Riggle c0f02d453a Merge pull request #752 from zachriggle/fix-setup
Add all MD and TXT files to binary distribution; include correct file…
2016-09-19 21:52:55 +02:00
Felix Yan 627ed5cbd5 Fix a typo: termianl -> terminal (#750) 2016-09-19 10:28:18 -07:00
Mathias Svensson 3fb64f9fe0 Merge branch 'beta' into dev 2016-09-19 00:31:31 +02:00
Mathias Svensson 254958bae9 Merge branch 'stable' into beta 2016-09-19 00:28:50 +02:00
Mathias Svensson 1cb47220f1 Fixed this binutils-multiarch path 2016-09-19 00:27:56 +02:00
Mathias Svensson d9be4f9ce0 Made the wget timeout longer 2016-09-19 00:18:37 +02:00
Mathias Svensson 2cd5aadf9d Merge branch 'beta' into dev 2016-09-18 22:58:32 +02:00
Mathias Svensson 6ebcc6f3a2 Merge branch 'stable' into beta 2016-09-18 22:31:34 +02:00
Mathias Svensson 21ce572dd6 Make CHANGELOG.md closer follow dev for easier forwardporting in the future 2016-09-18 22:30:23 +02:00
Mathias Svensson 1c47a30446 Bump the version number in README.md 2016-09-18 22:26:44 +02:00
Mathias Svensson 5b8ccb60a6 Merge branch 'beta' into dev 2016-09-18 22:14:53 +02:00
Mathias Svensson 89fc74facf Merge branch 'stable' into beta 2016-09-18 21:35:21 +02:00
Mathias Svensson 5a79a5e609 Release 3.0.3 2016-09-18 21:21:42 +02:00
Mathias Svensson c92f9bed42 I was being stupid when I did #744, since @zachriggle was not done. This is (hopefully) a more proper fix. 2016-09-18 21:09:29 +02:00
Mathias Svensson bfb534378b Removed verbosity from travis files 2016-09-18 19:35:28 +02:00
Mathias Svensson 0ddcf8b129 Add a test that we will *not* update when we have a never local version 2016-09-18 19:35:06 +02:00
Mathias Svensson a66376b8a0 Merge branch 'faster-update-import' of https://github.com/zachriggle/pwntools into merge-738 2016-09-18 15:23:25 +02:00
Mathias Svensson 9cb53d90fe Merge branch 'corefile-pyelftools' of https://github.com/binjitsu/binjitsu into release-3.0.3 2016-09-18 15:00:37 +02:00
Mathias Svensson a31cec5e81 Removed aarch64 install as it is broken and not currently needed and stopped bailing out even if .ssh exists 2016-09-18 14:50:52 +02:00
Zach Riggle 5367a3528d Promote binutils installation 2016-09-18 14:49:59 +02:00
Zach Riggle 669e7295c6 Auto-detect the current URL for QEMU rather than relying on a hard-coded URL 2016-09-18 14:49:03 +02:00
Zach Riggle a7f32d1b0f Bail on any error 2016-09-18 14:48:05 +02:00
Mathias Svensson efc531a2a9 Merge pull request #744 from Idolf/fix-tests
Fix Travis CI (building upon #743)
2016-09-18 14:45:53 +02:00
Mathias Svensson 8b959c9ede Removed aarch64 install as it is broken and not currently needed and stopped bailing out even if .ssh exists 2016-09-18 14:39:43 +02:00
Zach Riggle 68051f9987 Promote binutils installation 2016-09-17 20:50:20 -07:00
Zach Riggle 3636657ca0 Auto-detect the current URL for QEMU rather than relying on a hard-coded URL 2016-09-17 20:40:26 -07:00
Zach Riggle f282ef8bbc Bail on any error 2016-09-17 20:09:17 -07:00
Zach Riggle d5fbb21f72 Switch from pkg_resources to packaging, for performance reasons
Also backports the PyPi documentation changes to stable.

Fixes #736
2016-09-17 18:13:57 -07:00
Zach Riggle 57e9bf58a5 Update changelog 2016-09-17 18:06:30 -07:00
Zach Riggle 0ce21d9b45 Add pandoc requirement for Travis 2016-09-14 19:00:36 -07:00
Zach Riggle 89649fbeb0 Use HTTPS for link 2016-09-14 15:28:14 -07:00
Zach Riggle 5924c0f340 Use new domain for update_demo 2016-09-14 14:57:05 -07:00
Zach Riggle 2f9f10c182 Remove SSH info 2016-09-14 14:27:34 -07:00
Zach Riggle d7c98c4819 Remove reference to --pre until Gallopsled/pwntools#735 has a solution 2016-09-14 14:10:22 -07:00
Zach Riggle cd0ba369b8 Fix bug introduced by internal changes to pyelftools v0.2.4 2016-09-14 12:23:47 -07:00
Zach Riggle bebc84522d Make update mechanism more robust, add tests (#729)
* Make update mechanism more robust, add tests
* Add pwnlib.update to documentation, enable doctests

Fixes Gallopsled/pwntools#723
Fixes Gallopsled/pwntools#724
2016-09-12 21:09:52 -07:00
Zach Riggle e7875c78bc Add pwnlib.flag and submit_flag (#732)
* Add pwnlib.flag and submit_flag
2016-09-12 21:03:16 -07:00
Zach Riggle 0a37694436 Sort imports with isort 2016-09-12 20:35:36 -07:00
Zach Riggle 742a11bfdc Add links to CONTRIBUTING and TESTING in templates 2016-09-10 17:33:22 -07:00
Zach Riggle 1e7262ce31 Add templates for Pull Requests and Issues (#733)
Fixes #651
2016-09-10 17:27:02 -07:00
Zach Riggle d733cf6560 Fix failing doctest because of httpbin slowness (#731) 2016-09-09 17:46:34 -07:00
Zach Riggle 3818dda9d9 Extract copy-pasted callback routine, add better errors and doctests … (#728)
* Extract copy-pasted callback routine, add better errors and doctests for adb.{push,pull}
* Add protocol submodule to documentation and doctests
* Add and fix doctests in adb.protocol
* Use pprint to sort dicts
2016-09-09 15:29:38 -07:00
Zach Riggle 18c4a49aa3 Add pprint to toplevel 2016-09-08 14:34:47 -07:00
Zach Riggle 77f7a362d0 Version bump 2016-09-08 10:56:38 -07:00
Zach Riggle 738fadc016 Add .os to Device and set it automatically (#727)
The use case here is setting context.os via:

>>> context.device = adb.wait_for_device()
2016-09-07 16:34:10 -07:00
Zach Riggle b97f30f36f Add better description to PyPI, more classifiers (#721) 2016-09-07 16:34:00 -07:00
Mathias Svensson de05e7a4b8 Merge branch 'beta' into dev 2016-09-06 11:46:45 -10:00
Mathias Svensson 5fe024838b Release 3.1.0beta1 2016-09-06 11:36:27 -10:00
Mathias Svensson 8b07fe12e6 Release 3.0.2 2016-09-06 11:33:46 -10:00
Mathias Svensson cd828d6bca Merge branch 'beta' into dev 2016-09-06 11:31:21 -10:00
Mathias Svensson b60103b839 Merge branch 'stable' into beta 2016-09-06 11:30:58 -10:00
Mathias Svensson 684e9f6791 Changed util.fiddling.hexdump_iter to take a file object instead of a string. This massively speeds up phd <file> | less for huge files. (#695) (#725) 2016-09-06 11:30:51 -10:00
Mathias Svensson 5acc4c8ec3 Merge branch 'beta' into dev 2016-09-06 10:07:53 -10:00
Mathias Svensson a5c2b9276a Merge branch 'stable' into beta 2016-09-06 10:07:33 -10:00
Mathias Svensson 8d15fceb92 Backported #720. (#722)
The backport only includes the changes in pwnlib/update.py, not the
stuff in pwnlib/commandline/
2016-09-06 10:06:45 -10:00
Zach Riggle 913a3eba9e Pwn update (#720)
* Fix help printing e.g. "shellcraft shellcraft" instead of "pwn shellcraft" when invoking legacy entry points [skip ci]

* Add "pwn update" command; prevent automatic updates from showing pre-release
2016-09-02 16:58:47 -07:00
Zach Riggle 041e62bf0b Update changelog [skip ci] 2016-09-02 15:20:14 -07:00
Zach Riggle e61f571f7c Add adb.protocol module, and use it for most things (#709) 2016-09-02 15:16:26 -07:00
Zach Riggle 36d00b615d Update changelog [skip ci] 2016-09-02 15:10:10 -07:00
Zach Riggle 25d340b5c5 Re-implement sh_string to use embedded literals, add lots of tests (#717)
* Re-implement sh_string to use embedded literals, add lots of tests
* Add docs for sh_string so that unit tests get picked up
* Mark the docstrings as raw
* Rewrite doctests to not "print" since this breaks with invisible characters (issue with doctest itself)
* Add test which uses 16KB of random non-NUL data
2016-09-02 14:56:05 -07:00
Zach Riggle 8f06c1f90f Add docs for Xenial binutils, and attempt to auto-detect Debian packages (#718)
An error message will be printed like this when a package is found:

>>> context.arch='powerpc'
>>> pwnlib.asm.print_binutils_instructions('objdump', context)
[ERROR] Could not find 'objdump' installed for ContextType(arch = 'powerpc', bits = 32, endian = 'big')
    Try installing binutils for this architecture:
    $ sudo apt-get install binutils-powerpc-linux-gnu
2016-09-02 14:21:40 -07:00
Zach Riggle ae6a0745ff Fix function-decorator use-case for context.quiet (#714) 2016-09-01 16:23:32 -07:00
Zach Riggle 1d924af9d2 Update changelog [skip ci] 2016-09-01 15:36:47 -07:00
Zach Riggle fed432877c Merge pull request #711 from binjitsu/brk
Add heap leak from the linker. Fixes Gallopsled/pwntools#435
2016-09-01 15:35:19 -07:00
Zach Riggle 46261091dd Update date formatting 2016-09-01 15:17:59 -07:00
Zach Riggle c356b69a13 Add notices 2016-09-01 15:16:24 -07:00
Zach Riggle 6cff484b8c Update changelog [skip ci] 2016-09-01 15:15:30 -07:00
Zach Riggle 8314dff386 Update changelog [skip ci] 2016-09-01 15:14:24 -07:00
Zach Riggle dc40ac1117 Add heap leak from the linker. Fixes Gallopsled/pwntools#435
(cherry picked from commit 5808882cfe)
2016-09-01 14:57:00 -07:00
Zach Riggle 288b9668b7 Add Android emulator to Travis (#705)
* Add Android emulator to Travis

* More robust handling of ADB device status, and lack of devices

* Add platform-tools to PATH for adb, fastboot, etc.

* Add basic tests for some ADB code

* Add with_device annotation to auto-detect a device

* Skip Android emulator installation if we dont need it

* Do not install emulator in all cases (e.g. OSX)
2016-08-30 17:44:14 -07:00
Zach Riggle 3c0697b81e Refactor command-line tools to use a single "pwn" entry point. (#701)
Adds an install-time option to disable legacy commands, and only use 'pwn':

  $ pip install --install-option='--only-use-pwn-command'

Documentation is updated to show 'pwn' entry point and sub-commands.

Fixes #404
Fixes #660
2016-08-30 17:37:28 -07:00
Zach Riggle 6e4e46386f Do not install emulator in all cases (e.g. OSX) 2016-08-30 17:30:29 -07:00
Zach Riggle 9b179567da Remove un-cacheable Android SDK and NDK directories from Travis cache 2016-08-30 17:28:30 -07:00
Zach Riggle b20e17dd13 Skip Android emulator installation if we dont need it 2016-08-30 17:27:33 -07:00
Zach Riggle 3dcfafc0de Fix unit test quote style and ELLIPSE formatting 2016-08-30 16:32:05 -07:00
Zach Riggle 348bcac0ff Fix unit test failures in ADB module 2016-08-30 14:40:32 -07:00
Zach Riggle a43c3b4967 Add with_device annotation to auto-detect a device 2016-08-29 14:43:04 -07:00
Zach Riggle 40bf991153 Add basic tests for some ADB code 2016-08-29 14:43:04 -07:00
Zach Riggle 8f98c01b77 More robust handling of ADB device status, and lack of devices 2016-08-29 14:43:04 -07:00
Zach Riggle 18a8cfb88d Disable verbose logging 2016-08-29 14:43:04 -07:00
Zach Riggle 2acdeef320 Add missing bracket 2016-08-29 14:43:04 -07:00
Zach Riggle 23c09b4b1b Add platform-tools to PATH for adb, fastboot, etc. 2016-08-29 14:43:04 -07:00
Zach Riggle 84c71d6b07 Squelch travis 4MB log error 2016-08-29 14:43:04 -07:00
Zach Riggle c6aa6bccb8 Add Android emulator to Travis 2016-08-29 14:43:04 -07:00
Zach Riggle 041c665185 Reorganize Travis stuff; add hook to re-generate demo.pwntools.com on pushes to stable (#708) 2016-08-29 14:24:51 -07:00
Zach Riggle 70f9c0305d Add alarm option for process() (#704)
* Add `alarm` option for process()

* Add signal to toplevel import
2016-08-29 14:20:37 -07:00
Zach Riggle 66e41bd862 Refactor command-line tools to use a single "pwn" entry point.
Adds an install-time option to disable legacy commands, and only use 'pwn':

  $ pip install --install-option='--only-use-pwn-command'

Documentation is updated to show 'pwn' entry point and sub-commands.

Fixes #404
Fixes #660
2016-08-28 11:46:09 -07:00
Zach Riggle 5140d03b4d Add MIPS documentation, which should also trigger doctests (#700)
* Add MIPS documentation, which should also trigger doctests
* Fix broken and missing doctests for MIPS pushstr / syscall
* Add optimization for mips.mov to fix doctest
* Exit cleanly so QEMU doesn't complain
2016-08-28 11:40:42 -07:00
Mathias Svensson b016179ccc Merge branch 'beta' into dev 2016-08-24 20:04:59 -07:00
Mathias Svensson efaea581a1 Merge branch 'stable' into beta 2016-08-24 20:04:06 -07:00
Evan Grim 24dfaa0ff7 Fix typos (#702) 2016-08-24 20:03:37 -07:00
Zach Riggle f4a72da40e Update MIPS execve to use pushstr_array 2016-08-24 14:59:50 -07:00
Zach Riggle 6376d07266 Add MIPS pushstr_array
Example resulting state:

$ shellcraft mips.pushstr_array '$t1' '["hello", "world", "boss!"]' -d --after
...
pwndbg> telescope $t1 4
00:0000| t1 sp  0x76ffec7c --> 0x76ffec8c <-- 'hello'
01:0004|        0x76ffec80 --> 0x76ffec92 <-- 'world'
02:0008|        0x76ffec84 --> 0x76ffec98 <-- 'boss!'
03:000c|        0x76ffec88 <-- 0x0
2016-08-24 17:57:24 -04:00
Zach Riggle ea94ee4ca5 Disallow usage of semicolons in run_in_new_terminal.
Fixes Gallopsled/pwntools#690
Fixes Gallopsled/pwntools#635
2016-08-24 14:36:43 -07:00
Zach Riggle 452605e854 Fix pwnlib.gdb temporary file removal.
In two instances, the file was not removed because of an incorrect lambda.

In two further instances, use of shell concatenation via run_in_new_terminal
were changed into GDB 'shell' commands.

This fixes Gallopsled/pwntools#629
2016-08-24 14:36:43 -07:00
Mathias Svensson dea8f00c01 Merge pull request #698 from Idolf/dev
Merged beta into dev and fixed the version number and changelog
2016-08-24 14:35:11 -07:00
Mathias Svensson b9d6b27b4e Merge branch 'beta' into dev 2016-08-24 14:24:21 -07:00
Mathias Svensson 300ef0b462 Merge branch 'Idolf-beta-changelog' into beta 2016-08-24 14:20:02 -07:00
Mathias Svensson 6e79272e8d Updated the changelog 2016-08-24 14:17:46 -07:00
Morten Brøns-Pedersen d65991d402 Changed util.fiddling.hexdump_iter to take a file object instead of a string. This massively speeds up phd <file> | less for huge files. (#695) 2016-08-24 14:15:29 -07:00
Zach Riggle de94449a87 Remove unreleased version from Changelog 2016-08-22 17:34:44 -07:00
Zach Riggle faeb57b35c Use manual 3.0.1 shield until we figure out how to make this automagic 2016-08-22 16:42:45 -07:00
Mathias Svensson e1332d277c Merge branch 'beta' into dev (#678) 2016-08-22 15:26:40 -07:00
Mathias Svensson e4c2a48696 Merge pull request #679 from Gallopsled/stable
Even more documentation (#678)
2016-08-22 15:22:39 -07:00
Mathias Svensson 6415367f15 Even more documentation (#678) 2016-08-22 15:16:02 -07:00
Mathias Svensson fcf2842d87 I am an idiot 2016-08-22 14:58:42 -07:00
Mathias Svensson 422dccd8da Merge branch 'beta' into dev 2016-08-22 14:54:33 -07:00
Mathias Svensson abd08a94ea Fixed the logo path to be closer to stable 2016-08-22 14:48:26 -07:00
Mathias Svensson e877f7455a Merge branch 'stable' into beta 2016-08-22 14:37:33 -07:00
Mathias Svensson 70c224f429 Merged in some documentation fixes.
Since this commit only changes documentation and not code, it does not
trigger a new release.
2016-08-22 14:33:47 -07:00
Mathias Svensson 5f7c525023 Fix some more documentation 2016-08-22 14:30:11 -07:00
Mathias Svensson 16de5ec22c Fix a lot of documentation (#675) 2016-08-22 13:11:50 -07:00
Mathias Svensson e635bcfea7 Merging #674 into dev 2016-08-20 18:40:54 -07:00
Mathias Svensson 12b60447da Merging #674 into beta 2016-08-20 18:39:00 -07:00
Mathias Svensson 5c804d49d0 Release 3.0.1 after merging #673 2016-08-20 18:26:35 -07:00
Mathias Svensson cde19135eb Fixed some documentation 2016-08-20 18:19:07 -07:00
Mathias Svensson 77da84c5a8 Prepare the dev branch 2016-08-20 17:51:55 -07:00
Mathias Svensson 2663762a9a Prepare the beta branch 2016-08-20 17:48:37 -07:00
Mathias Svensson 7aa9605629 3.0.0 release 2016-08-20 17:24:46 -07:00
Morten Brøns-Pedersen 757d7fe2c6 Merge pull request #667 from Idolf/issue-455
sh_string was broken in some cases, adds functionality to fix it. Fixes #455
2016-08-20 10:52:28 +02:00
Morten Brøns-Pedersen 9e724203b9 Merge pull request #650 from binjitsu/issue-591
Remove old inode-walking code in gdb module
2016-08-20 10:38:58 +02:00
Mathias Svensson 72207cf914 Fixed #455 2016-08-19 20:08:47 -07:00
Zach Riggle 824852bf33 Fix README links so they are valid, and work on pwntools.com (#653) 2016-08-18 13:14:42 -07:00
Zach Riggle b382849671 Add auto-update detection for new releases (#659) 2016-08-18 12:48:43 -07:00
Zach Riggle 0e814c91cc Merge pull request #669 from Idolf/issue-661
Adds some forgotten imports, fixes #661
2016-08-18 12:09:13 -07:00
Mathias Svensson d55a47a8fc Fixed a link in README.md (#670) 2016-08-18 11:58:17 -07:00
Zach Riggle 3b65f8775a Add coveralls.io build steps to .travis.yml (#655)
* Add coveralls.io build steps to .travis.yml

Fixes Gallopsled/pwntools#205

* Fix unit tests which fail under Coveralls

* Remove non-coverage "make doctest"

* Only report coverage for our code

* Add .coveragerc, ignore .coverage, shorten Travis script line

* Add Coveralls shield

* Fix spacing with badges and logo

* Add undocumented command-line tools to increase coverage
2016-08-18 11:22:41 -07:00
Zach Riggle fce5081c30 Make constgrep errors more verbose (#654) 2016-08-18 11:19:41 -07:00
Zach Riggle 39afc7998a Missed case where p_type needs to be converted to a string (#647) 2016-08-18 11:18:30 -07:00
Zach Riggle 1bfc56daa0 Actually enable the Thumb encoder (#646)
* Actually enable the Thumb encoder

* Fix thumb nop encoding NUL bytes
2016-08-18 11:14:47 -07:00
Zach Riggle 2d08e7cd99 Fix encoders.null typo (#645) 2016-08-18 11:14:10 -07:00
Mathias Svensson f7696f0388 Fixes #661 2016-08-18 11:07:47 -07:00
avarx 2947fb16dd Fix typo (#666) 2016-08-18 09:30:43 -07:00
Zach Riggle 9e57328d1b Add warning described in Gallopsled/pwntools#518 (#652) 2016-08-17 19:57:24 -07:00
Kristoffer Søholm 2198df5ea5 Merge pull request #664 from Gallopsled/fix-link
Fix install.html link.
2016-08-17 14:43:30 -07:00
Zach Riggle 40cc12ba95 Fix install.html link.
Fixes Gallopsled/pwntools#641
2016-08-17 13:31:27 -07:00
Zach Riggle 13f1815b7d Merge branch 'master' into issue-591 2016-08-17 12:04:43 -07:00
Zach Riggle 16846a80c6 Merge pull request #663 from Gallopsled/fix-link
Fix URL.  Fixes #662
2016-08-17 11:09:40 -07:00
Zach Riggle b29467dab6 Fix URL. Fixes Gallopsled/pwntools#662 2016-08-17 10:53:08 -07:00
Zach Riggle 969a9fe754 Remove old inode-walking code in gdb module
Fixes Gallopsled/pwntools#591
2016-07-26 15:03:04 +01:00
Mathias Svensson 23b0a019da Fixed a keyfile bug 2016-07-23 12:03:07 +02:00
Zach Riggle 99f9c80f15 Merge pull request #643 from PtxDK/patch-1
Update README.md
2016-07-18 17:53:46 +01:00
Kristoffer Søholm 3d5f859dd0 Merge pull request #638 from Idolf/remove-stale-files
Various stuff not merged correctly in #636.
2016-07-03 23:19:02 +02:00
Kristoffer Søholm 5c5e797cbf Merge pull request #637 from Idolf/remove-self-import
Builder imported itself
2016-07-03 23:04:43 +02:00
Patrick Krøll Brandt b2698f5513 Update README.md 2016-07-03 21:51:12 +02:00
Mathias Svensson 2baebf9e51 Use the pwntools twitter handle 2016-07-03 21:29:47 +02:00
Mathias Svensson 640051d41c Updated README.md based on the binjitsu-arm-syscall branch 2016-07-03 21:11:03 +02:00
Mathias Svensson 2f8de42cd8 Fixed IRC reference 2016-07-03 20:54:06 +02:00
Mathias Svensson ac8e053ca0 Removed binjitsu files not identified as stale in #636. 2016-07-02 23:09:57 +02:00
Mathias Svensson 741dffb47d Builder imported itself 2016-07-02 22:36:53 +02:00
Mathias Svensson ee77289111 Merge pull request #636 from binjitsu/pwntools-merge
Pwntools merge with Binjitsu
2016-07-02 21:10:42 +02:00
Zach Riggle 01cda51e3e Add date 2016-06-30 14:52:24 +02:00
Zach Riggle 2d72ccc30c Add commit count to changelog 2016-06-30 14:51:59 +02:00
Zach Riggle eee6ce3521 Add test for QEMU installation 2016-06-30 14:39:00 +02:00
Zach Riggle 7f933d3ffc Update QEMU static version 2016-06-30 14:38:16 +02:00
Zach Riggle 8680f2eeb6 Update Changelog for 3.0.0 release 2016-06-30 14:17:35 +02:00
Zach Riggle 06b81a3279 Remove Binjitsu fork info 2016-06-30 13:36:11 +02:00
Zach Riggle 33cdabf0ab Replace project name references 2016-06-30 02:28:42 +02:00
Zach Riggle c32ae58811 Replace domain names 2016-06-30 02:26:46 +02:00
Zach Riggle d4e42f86d0 Replace binjitsu/binjitsu with Gallopsled/pwntools 2016-06-30 02:26:22 +02:00
Zach Riggle bd6ef3f45e Merge remote-tracking branch 'gallopsled/master' into pwntools-merge 2016-06-30 02:24:01 +02:00
Zach Riggle a613d75abb Move logger functions to toplevel (add success) 2016-06-28 12:57:13 +02:00
Zach Riggle 2d8c8593de Modify ADB commands to specify host and port if they are provided via environment 2016-06-28 12:56:47 +02:00
Zach Riggle 054e3d50d5 Move logger functions to toplevel 2016-06-28 12:56:23 +02:00
Kristoffer Søholm bc93beb576 Merge pull request #625 from cebrusfs/patch-1
Fix wrong format string parameters in memleak.py
2016-06-23 01:32:17 +02:00
Kristoffer Søholm 2490ea207c Merge pull request #630 from justinsteven/bugfix/typo_attaching_you
Fix typo
2016-06-23 01:31:12 +02:00
Zach Riggle b06b544323 Clean up ADB partition code, enable enumeration and tab-completion 2016-06-21 06:29:17 +02:00
Zach Riggle 18d9646498 Do not return "." in listdir() 2016-06-21 06:22:01 +02:00
Justin Steven fc5b7b9425 Fix typo 2016-06-17 00:34:42 +10:00
Zach Riggle e8d8f4c4cc Do not record one-time warnings if they are not actually emitted 2016-06-14 16:04:02 -07:00
Zach Riggle e18eef7fae Add --file option to checksec for checksec.sh compatibility 2016-06-09 19:12:08 -06:00
Zach Riggle 396efcf71a Extend process() display changes to "stopped" message 2016-06-07 15:54:44 -06:00
Zach Riggle ee485a68d5 Strip adb shell from the display 2016-06-07 15:52:28 -06:00
Zach Riggle c0bc668450 Add a few twiddly bits for better process logs 2016-06-07 15:51:10 -06:00
Zach Riggle 7c8806950b Wrap all property accessors with str() 2016-06-07 12:42:12 -06:00
Zach Riggle ba5815bba5 Convert absolute paths to relative paths 2016-06-07 11:36:08 -06:00
Zach Riggle 25016264e7 Fix listdir implementation for some phones lacking a -1 option for LS 2016-06-07 11:31:38 -06:00
Zach Riggle 4d83a0d017 Silence GDB license on attach 2016-05-29 19:08:37 -04:00
Zach Riggle 67fd986360 Support unauthorized devices; old devices dont support -t 2016-05-29 19:00:43 -04:00
Zach Riggle fc1a7e2d11 Add warning message to cyclic_find; fix two-space indentation 2016-05-29 13:19:58 -05:00
Zach Riggle 112a246881 Minor fix for OS X serialtube naming for certain adapters 2016-05-28 20:07:19 -05:00
Zach Riggle c0c91841a7 Fix install info 2016-05-25 14:00:21 -05:00
Zach Riggle 70df2fa5f3 Fix double-warning for GDB without ASLR 2016-05-24 17:51:45 -07:00
Zach Riggle aedbafd9d6 Add ASLR-disabled warning to GDB 2016-05-24 17:50:16 -07:00
Zach Riggle 51f62206f6 Add ASLR-disabled warning to SSH 2016-05-24 17:49:30 -07:00
Zach Riggle a9ac751b89 Add ASLR disabled warning message 2016-05-24 17:47:57 -07:00
Zach Riggle ab31b3091c Add context.verbose 2016-05-24 17:47:43 -07:00
Zach Riggle 322942f2d3 Fix elfpatch so it doesnt spew logging info 2016-05-21 22:15:25 -07:00
Zach Riggle 9967347d70 Rename Property.name to support ro.product.name 2016-05-17 22:36:22 -07:00
Zach Riggle 01ec1328f9 Refactor adb.partitions to provide an iterator 2016-05-17 21:48:15 -07:00
Zach Riggle 020469788a Add adb.address, fix adb.symbols, add adb.partitions 2016-05-17 21:41:43 -07:00
Zach Riggle 348456e290 Merge pull request #78 from Manouchehri/patch-2
libffi-dev is required.
2016-05-17 18:12:07 -07:00
David Manouchehri 01e5057b05 libffi-dev is required. 2016-05-18 01:04:43 +00:00
Zach Riggle c97da1524c Merge pull request #77 from Manouchehri/patch-1
Use Trusty for Dockerfile?
2016-05-17 17:50:00 -07:00
Zach Riggle ec506414ee Catch reconnect exception, fix listdir() 2016-05-17 20:22:11 -04:00
Zach Riggle 10eb718058 Allow pwnlib.adb.Property objects to be compared to strings 2016-05-17 19:56:02 -04:00
Zach Riggle c575c66895 Stringify device in argv 2016-05-17 19:46:54 -04:00
Zach Riggle a30ab0ca80 Add pwnlib.device.Device class 2016-05-17 19:46:02 -04:00
Zach Riggle a598103ca9 Add auto-transform support for Android ABIs 2016-05-17 19:30:05 -04:00
Zach Riggle d2a377cfbc Add "kick" option to adb.wait_for_device 2016-05-17 19:18:09 -04:00
Zach Riggle 3ab9063d43 Force TTY allocation for ADB shell 2016-05-17 19:18:09 -04:00
David Manouchehri 8958123e3e Use Trusty. 2016-05-17 22:31:06 +00:00
Zach Riggle c57aa1a507 Fix failing tests 2016-05-17 14:47:35 -07:00
Zach Riggle ffe2e7cf1f Pwndbg and its depenencies should not be in the Binjitsu dockerfile 2016-05-16 22:41:50 -07:00
Zach Riggle fdbd19fdd2 Add decorators for common MemLeak scenarios, make the class more robust / transparent. 2016-05-16 22:41:50 -07:00
Zach Riggle 30bfc92037 Add vsyscall to Corefile 2016-05-11 21:02:41 -07:00
Zach Riggle d84a1073d7 Add unit test for generating shared libraries 2016-05-11 20:46:01 -07:00
Zach Riggle 8d934d65e1 Make vdso detection better; add Mapping.data so you can do core.vdso.data 2016-05-11 20:44:36 -07:00
MengHuan Yu 89d1c67696 Fix wrong format string parameters in memleak.py
Fix wrong format string parameters of a debug message in `memleak.py`.
2016-05-11 16:56:53 +08:00
Zach Riggle a77aa1be73 Add adb.unlock_bootloader 2016-05-10 16:34:36 -07:00
Zach Riggle 176b0af30b Add support for older devices with last_kmsg 2016-05-10 11:43:44 -07:00
Zach Riggle 03e9546127 Remove double-serial-number 2016-05-09 22:48:57 -07:00
Zach Riggle 05672c3e14 Add adb.compile to build single source files or NDK projects 2016-05-09 22:26:00 -07:00
Zach Riggle 7a5760cd39 More robust "adb.push" 2016-05-09 16:58:20 -07:00
Zach Riggle 78584929d7 adb pull shows weird content for newer versions, rely on exit code 2016-05-09 16:53:10 -07:00
Zach Riggle 56ad2276f4 Add kallsyms 2016-05-09 13:51:56 -07:00
Zach Riggle d76b6c5560 Use specific commands for each device 2016-05-06 21:08:34 -07:00
Zach Riggle e59a44d8b3 Auto-detect default serial port on OSX 2016-05-06 21:08:25 -07:00
Zach Riggle 2f11018a1e Add adb.kernel.lastmsg 2016-05-06 18:54:32 -07:00
Zach Riggle 21fc7759e0 Actually use serialtube arguments 2016-05-06 18:53:46 -07:00
Zach Riggle d2933acba2 Make uart_enable() work for Shamu 2016-05-06 14:17:02 -07:00
Zach Riggle efa9c26842 Bulk removal of get_serialno() 2016-05-06 11:22:19 -07:00
Zach Riggle b61941835a Add documentation for ADB module 2016-05-05 14:53:59 -07:00
Zach Riggle c75bf4ad75 Clean up code, silence adb.kernel.cmdline 2016-05-05 14:31:59 -07:00
Zach Riggle 8138315fa6 Minor fixups 2016-05-05 14:27:12 -07:00
Zach Riggle f1e7715e6f Finish implementation of adb.kernel.symbols 2016-05-05 14:25:49 -07:00
Zach Riggle 544342b9fe Use log.debug instead of print 2016-05-05 14:21:48 -07:00
Zach Riggle 430bee44b7 Use fancy new context decorator 2016-05-05 14:20:43 -07:00
Zach Riggle 31c1070ac8 I have an instance of a class “Context” called “context” with a property that returns an object which is actually a Context Manager which can be used as a function decorator to modify the state of the object “context” while in the context of the decorated function. 2016-05-05 14:19:52 -07:00
Zach Riggle 59102739f5 Move enable_uart() into the Kernel object 2016-05-05 14:19:52 -07:00
Zach Riggle a02d3277ce Lots of changes for adb module to support direct access to properties, kernel data, and the ability to enable UART debugging 2016-05-05 14:19:52 -07:00
Zach Riggle 2f75eb6c3a Add context.device so that we can scope serial numbers 2016-05-05 14:19:52 -07:00
Zach Riggle 22c97ee762 Fix package URL for qemu-user-static on Travis 2016-05-04 13:03:39 -07:00
Zach Riggle 500a2720a5 Fix regression with vma=None 2016-05-04 01:08:02 -07:00
Zach Riggle 2fc9a83a50 Fix serial tubes 2016-05-04 00:11:27 -07:00
Zach Riggle b572a9da4a Simplify context.adb for the basic case 2016-05-04 00:11:27 -07:00
Zach Riggle 3db45f46e4 Add "shared" option for ELF-building functions to generate DSOs. 2016-05-03 13:24:24 -07:00
Zach Riggle 41383b3330 ArgumentParser object must be at global scope for documentation generation to work 2016-04-25 15:30:42 -05:00
Zach Riggle 1a3d81f8f1 Do not manually close the log file.
It should get cleaned up by gc anyway.
2016-04-25 15:24:24 -05:00
Zach Riggle 4e04c8bfb3 Add repr() for timeout maximum 2016-04-25 15:12:37 -05:00
Zach Riggle 94abecce80 A bit more documentation for context.proxy 2016-04-25 14:56:02 -05:00
Zach Riggle 7f733aa63b Modify elfdiff to copy the files to a single location so that the first two lines of objdump dont get compared. 2016-04-25 14:39:19 -05:00
Zach Riggle b26a2f21fc Default argument for fit() 2016-04-25 14:04:59 -05:00
Zach Riggle d91b05b43a Switch from error to a single warning. 2016-04-25 14:04:53 -05:00
Zach Riggle 9aff300cee Fix wget() keyword 2016-04-22 14:52:30 -07:00
Zach Riggle 806d506510 Enhancements to Corefile to expose vdso/vvar/exe 2016-04-22 12:56:46 -07:00
Zach Riggle f0010e4413 Switch _lookup_build_id to use compare; remove breakpoint 2016-04-22 11:25:42 -07:00
Zach Riggle 58c61897ba Take failure case with error message 2016-04-22 10:52:32 -07:00
Zach Riggle dc083ae7b9 Fix regression on searching for DT_NULL 2016-04-22 10:51:16 -07:00
Zach Riggle 7029b38cce Refactor and optimize the fast-path DynELF search 2016-04-22 10:36:41 -07:00
Zach Riggle cf19d35d14 Add helpful warning for DynELF without elf= 2016-04-22 10:08:50 -07:00
Zach Riggle c498ddcb6d Switch to exceptions 2016-04-22 10:04:36 -07:00
Zach Riggle 7253234fba Add handling for negative values, extend use of compare 2016-04-22 10:03:35 -07:00
Zach Riggle 7925b44582 Speed up DynELF leaking with field_compare
Also modify log.progress / log.waitfor update frequency.
2016-04-22 10:01:07 -07:00
Zach Riggle 494a078be9 Fix ADB port getenv() as integer 2016-04-21 14:37:48 -07:00
Zach Riggle 8ef546bc34 Only print the banner once per log file per execution 2016-04-21 14:23:06 -07:00
Zach Riggle 64416909bb Sort imports 2016-04-21 14:39:08 -05:00
Zach Riggle 1c6689eca4 Lower log verbosity and fix whitespace 2016-04-21 14:36:16 -05:00
Zach Riggle 4dfc571702 Add fast-path for fit() 2016-04-21 03:51:58 -07:00
Zach Riggle cb40e4b883 Update fit() doctests 2016-04-21 03:45:33 -07:00
Zach Riggle 12564a7e0d It appears that fit() has always been completely broken from my understanding of it. 2016-04-21 03:44:22 -07:00
Zach Riggle d51ad7f989 Various enhancements to DynELF and MemLeak for speed 2016-04-21 02:12:56 -07:00
Zach Riggle bbc91d6211 Add DynELF.stack and a few other improvements 2016-04-21 00:14:40 -07:00
Zach Riggle 21c10be67e Add MemLeak.p for pointer-width sizes 2016-04-21 00:14:40 -07:00
Zach Riggle ca43832880 Pass kwargs to gdb.debug 2016-04-21 00:14:40 -07:00
Zach Riggle c9dabb8606 Must re-root after restarting 2016-04-21 00:14:40 -07:00
Zach Riggle eb8f905449 Fix searching for gadget subsets, and add SYS_rt_sigreturn fallback
Fixes binjitsu/binjitsu#73
2016-04-20 17:11:44 -07:00
Peter Shih 1b9a4ca123 fix inconsistent logging level in tube.
(cherry picked from commit fe4086e710)
2016-04-20 18:24:59 -05:00
Zach Riggle 02e0c3804c Update QEMU url so testing works 2016-04-19 17:39:23 -05:00
Zach Riggle 50624322c4 Remove MIPS documentation, since Travis is on 12.04 and you cant build AArch64 binutils for it. 2016-04-19 17:07:54 -05:00
Zach Riggle 63d564810b Remove AArch64 documentation, since Travis is on 12.04 and you cant build AArch64 binutils for it. 2016-04-19 16:11:42 -05:00
Zach Riggle 03d8efaba2 Fix ELF.process() for non-Android 2016-04-19 14:01:14 -07:00
Zach Riggle c47538da1f Add dateutil to requirements 2016-04-19 13:52:51 -07:00
Zach Riggle 3192839ff8 Restore context clear, but move it inside the local scope.
The clear is necessary because vars(context) will only retrieve the set keys.  Any other context bits set later will not be correctly set to default values.
2016-04-19 14:59:43 -05:00
Zach Riggle abc646511a Simplify a few lines with getattr 2016-04-19 14:51:47 -05:00
Zach Riggle d3ab88364c Remove context clear which breaks things in interactive mode when there is no exception handler. 2016-04-19 14:49:23 -05:00
Zach Riggle 3d61ba339a Add docs for mips shellcode 2016-04-17 18:42:14 -07:00
Zach Riggle 84a1a540b0 Add docs for aarch64 shellcode 2016-04-17 18:41:34 -07:00
Zach Riggle efa8c77d3c adb: Multiple enhancements. Add push and pull. 2016-04-17 18:41:11 -07:00
Zach Riggle 734d3a17e6 gdb: Silence unlink errors, push binaries to Android devices. 2016-04-17 18:40:46 -07:00
Zach Riggle 378a32b390 Fix exception on extract=True for make_elf_from_assembly 2016-04-17 18:40:22 -07:00
Zach Riggle 6bf0989e2f ELF supports ADB 2016-04-17 18:39:45 -07:00
Zach Riggle 158f6d7758 run_in_new_terminal supports argv in addition to strings 2016-04-17 18:39:35 -07:00
Zach Riggle 38047c15c6 Android constants are the same as Linux constants 2016-04-17 17:21:57 -07:00
Zach Riggle 56fbd583e6 Change log levels of ADB commands, better Android support in GDB 2016-04-15 14:40:12 -07:00
Zach Riggle 2d8e5f0050 Fix pid_by_name so that the results are actually sorted, and do not return any zombie processes. 2016-04-15 11:44:37 -07:00
Zach Riggle 1b865681fc Add Android examples, cut down verbosity of adb calls. 2016-04-14 12:19:32 -07:00
Zach Riggle bcc57b3138 Add adb module, lots of refactoring GDB module to be more clean and support Android gdb.attach(). 2016-04-14 11:56:04 -07:00
Zach Riggle 87a612282d Add aarch64 sh for Android 2016-04-14 11:52:05 -07:00
Zach Riggle 215ddafc65 Add aarch64 sh 2016-04-14 11:51:38 -07:00
Zach Riggle 474d96eb52 Use shorthand 2016-04-13 15:40:01 -05:00
Zach Riggle b868c12d63 Update PLT parsing for Thumb mode entries 2016-04-13 15:38:23 -05:00
Zach Riggle d9f120e617 Add host / port support to Binjitsu 2016-04-13 15:22:21 -05:00
Zach Riggle 2c788f4f55 Fix ptrace vararg 2016-04-13 15:22:12 -05:00
Zach Riggle 2d3eb7204d Fixes for Android AArch64 debugging 2016-04-13 12:51:50 -05:00
Zach Riggle 4e2d5f096a Fix typo 2016-04-12 18:37:39 -05:00
Zach Riggle b60218a4d7 First pass support for debugging Android binaries natively. 2016-04-12 16:44:41 -05:00
Zach Riggle 51dd430ad0 Always have context.native return False for Android and CGC 2016-04-12 16:44:27 -05:00
Zach Riggle 60e5a80790 Make run_in_new_terminal work on OSX under tmux 2016-04-12 16:44:03 -05:00
Zach Riggle d4f10b0d6e Don't look for QEMU if running natively. 2016-04-12 16:43:47 -05:00
Zach Riggle 95d4b8e09d Add missing log object 2016-04-12 16:43:32 -05:00
Morten Brøns-Pedersen 29bf5fc5fc Merge pull request #615 from peter50216/patch-3
fix inconsistent logging level in tube.
2016-04-12 12:08:02 +02:00
Peter Shih fe4086e710 fix inconsistent logging level in tube. 2016-04-12 10:18:06 +08:00
Zach Riggle 0af33f3a6f Simplify process.core since I just learned about the gcore command line tool. 2016-04-04 20:11:54 -07:00
Zach Riggle 68207adbe4 Write the GDB script to the terminal when debugging is enabled 2016-04-04 16:20:52 -07:00
Morten Brøns-Pedersen 8a57fe4143 Merge pull request #612 from Gallopsled/martian-dash-docset
Added support for generating a Dash docset.
2016-03-31 10:15:05 +02:00
Kristoffer Søholm 2da5414609 Merge pull request #601 from Gallopsled/bugfix-memleak
Bugfix: `pwnlib.memleak.MemLeak`
2016-03-31 09:15:06 +02:00
Morten Brøns-Pedersen 9ff2d5b9bd removed tabs and trailing whitespace and tidied up a little 2016-03-31 08:30:41 +02:00
Morten Brøns-Pedersen 5d9b68d1c8 Merge branch 'dash-docset' of https://github.com/martian/pwntools into martian-dash-docset 2016-03-31 08:23:12 +02:00
Morten Brøns-Pedersen bc77ad6c47 Merge pull request #604 from peter50216/patch-1
Remove unused statement in context.arch
2016-03-31 08:09:25 +02:00
Morten Brøns-Pedersen cfb38c4ef4 Merge pull request #606 from peter50216/patch-2
Fix inconsistency between error message and code.
2016-03-31 08:08:38 +02:00
Morten Brøns-Pedersen b2e5ff427b Merge pull request #608 from peter50216/master
Fix pack when sign=True and word_size='all'
2016-03-31 08:08:09 +02:00
Morten Brøns-Pedersen dec4a74efc Merge pull request #610 from binjitsu/issue_609
Fix Gallopsled/pwntools#609
2016-03-31 08:06:13 +02:00
Pi-Hsun Shih 999ad63200 Fix pack when sign=True and word_size='all'
(cherry picked from commit 17caf96582)
2016-03-28 12:10:59 -04:00
Zach Riggle b45ef8dfbd Dont always try to prefix binutils with 'g'.
Fixes Gallopsled/pwntools#607
2016-03-28 12:00:51 -04:00
Zach Riggle f64d0b0749 Fix Gallopsled/pwntools#609
(cherry picked from commit 320e0dd80b)
2016-03-28 11:57:16 -04:00
Zach Riggle 320e0dd80b Fix Gallopsled/pwntools#609 2016-03-28 11:56:58 -04:00
Pi-Hsun Shih 17caf96582 Fix pack when sign=True and word_size='all' 2016-03-28 03:35:29 +00:00
Zach Riggle c1e3d26d29 Add Unicorn, dependencies, tabs->spaces 2016-03-25 18:21:31 -04:00
Zach Riggle 73ddedebb4 Fix doctests for SFTP 2016-03-25 14:24:23 -07:00
martian 7f236f5064 Added support for generating a Dash docset.
Dash docsets can be read by various applications:

Dash         OS X, iOS         https://kapeli.com
Zeal         Linux, Windows    https://zealdocs.org
Velocity     Windows           http://velocity.silverlakesoftware.com
LovelyDocs   Android           http://lovelydocs.io
dasht        POSIX             https://github.com/sunaku/dasht
Helm Dash    emacs             https://github.com/areina/helm-dash

(cherry picked from commit dc37b0b5b2)
2016-03-25 15:57:20 -04:00
Zach Riggle 80ebf7109a Fix binjitsu/binjitsu#69 2016-03-25 13:29:12 -04:00
Morten Brøns-Pedersen 36ccc2bc81 bugfix: ui.yesno() now correctly handles <enter>
This bug happened because we no longer disable input processing in the terminal.
In particular `\r` is now translated to `\n`.  The fix is to interpret both `\r`
and `\n` as <enter> in `term/key.py`.

(cherry picked from commit 383f245082)
2016-03-25 13:21:04 -04:00
Morten Brøns-Pedersen 72416c4705 bugfix: don't call shutdown(2) when calling tubes.sock.close()
This can be a problem since sockets inherited by children will see the
`shutdown(2)` call as well.

(cherry picked from commit 77bfc16341)
2016-03-25 13:20:19 -04:00
Sam Brown 8f2878d0ab corrected util.twiddling.bits implementation to handle 0 validly
(cherry picked from commit 6449e14e9e)
2016-03-25 13:14:39 -04:00
Morten Brøns-Pedersen 10487c23ac added fiddling.bits(0) as a doctest
(cherry picked from commit 10c3f079c5)
2016-03-25 13:13:49 -04:00
Mathias Svensson a18c23cf2d Fix annoying setup.py behaviour.
When installing pwntools, setup.py required a very new version of
requests -- even though we never used any new features.

This is a problem, since the required version is much never than what is
in e.g. ubuntu's package repo. While this by itself is not much of a
problem, it is a problem if one installs python-pip from the distro's
repo as well, since python-pip will try to use the newest version of the
requests library, which caused pip to break.

The solution: Do not force such a new version of python, instead live
with a much older version.

(cherry picked from commit f91299986e)
2016-03-25 13:10:31 -04:00
Sam Brown 714f27fee9 added mailing list link to README.md
(cherry picked from commit 126e2857ad)
2016-03-25 13:08:35 -04:00
peter50216 9942ae157f Don't depend on python dict.item() order.
(cherry picked from commit 3564b9e014)
2016-03-25 13:07:12 -04:00
peter50216 36ead5ac57 Fix inconsistency between error message and code.
Code says context.bits should be > 0, but error message says >= 0.
Since 0 bit architecture doesn't make sense at all, make them all be > 0.
(cherry picked from commit def9400d48)
2016-03-25 13:03:20 -04:00
peter50216 def9400d48 Fix inconsistency between error message and code.
Code says context.bits should be > 0, but error message says >= 0.
Since 0 bit architecture doesn't make sense at all, make them all be > 0.
2016-03-25 15:52:10 +08:00
Morten Brøns-Pedersen 18049ddddb example of gdb.attach
(cherry picked from commit 883ddb30b5)
2016-03-23 13:29:02 -04:00
peter50216 6f74c7f13e Don't depend on python dict.item() order.
(cherry picked from commit 3564b9e014)
2016-03-23 13:27:58 -04:00
Kristoffer Søholm e6380f75a9 Merge pull request #605 from peter50216/patch-2
Don't depend on python dict.item() order.
2016-03-23 09:55:04 +01:00
peter50216 3564b9e014 Don't depend on python dict.item() order. 2016-03-23 16:36:13 +08:00
peter50216 e16ac422b5 Remove unused statement in context.arch 2016-03-23 16:25:13 +08:00
Zach Riggle 17b48f7186 Catch corner case in process.leak 2016-03-22 10:27:38 -07:00
Zach Riggle a518a60388 Open in binary mode 2016-03-21 18:05:07 -07:00
Zach Riggle 78e394bd6d Add documentation to process.leak and another option 2016-03-21 18:04:51 -07:00
Zach Riggle 282b853c2a Add process.leak() function for testing leaks 2016-03-21 18:01:06 -07:00
Zach Riggle aa64f71075 Add aliases for connect_remote and listen_remote 2016-03-17 16:42:08 -04:00
Zach Riggle 354213c475 Learn full path to the executable for ssh.process 2016-03-17 16:14:19 -04:00
Zach Riggle d22f6c457f Remove argparse requirement. Fixes Gallopsled/pwntools#598. 2016-03-16 12:58:42 -04:00
Zach Riggle 03baaa3807 Update Docs badge 2016-03-16 12:55:29 -04:00
Zach Riggle a5df5ee6a0 More trying to fix ReadTheDocs build 2016-03-16 07:00:43 -07:00
Zach Riggle c5b3d343ad Fix build for readthedocs.org which dies on terminal stuff. 2016-03-16 06:59:36 -07:00
Zach Riggle 1413caf401 Merge pull request #71 from kbeckmann/master
Import pwnlib.util.safeeval in constgrep
2016-03-16 09:45:37 -04:00
Zach Riggle 09a637eabe Fix more docs links 2016-03-16 06:45:16 -07:00
Zach Riggle bb95c6fbbd Fix docs link 2016-03-16 06:44:26 -07:00
Zach Riggle b0cb09ae67 Complete fix in 0ce1ebb for Gallopsled/pwntools#601 2016-03-16 06:42:39 -07:00
Zach Riggle 669c963290 Fix typo in Dockerfile 2016-03-16 06:15:59 -07:00
Konrad Beckmann 0e0cb7c0e3 Import pwnlib.util.safeeval in constgrep 2016-03-16 10:59:58 +01:00
Zach Riggle bc20216579 Add ASAN/MSAN/UBSAN to checksec 2016-03-15 16:11:21 -07:00
Morten Brøns-Pedersen fcd62d4cf1 Merge pull request #597 from binjitsu/issue_596
Extract list of data elements from Buffer when unget()'ing a Buffer
2016-03-15 14:49:21 +01:00
Zach Riggle 0ce1ebbd81 Fixes Gallopsled/pwntools#601 2016-03-14 18:36:33 -04:00
Morten Brøns-Pedersen 894ffbc1b7 fixed doctests 2016-03-14 13:50:57 +01:00
Morten Brøns-Pedersen b00a328d8a added __getitem__ for pwnlib.memleak.MemLeak 2016-03-14 13:44:11 +01:00
Morten Brøns-Pedersen ceadb59c93 bugfix: pwnlib.memleak.MemLeak would return wrong addresses when searching backwards if a leak failed; several new doctests has been added as well 2016-03-14 13:43:47 +01:00
Morten Brøns-Pedersen 22038eaf2d Merge pull request #600 from Gallopsled/example-attach
example of `gdb.attach`
2016-03-14 11:35:52 +01:00
Morten Brøns-Pedersen 044a2a630d Merge pull request #546 from Gallopsled/packing-dd
added `pwnlib.util.packing.dd` inspired by the command line util of t…
2016-03-14 11:25:32 +01:00
Morten Brøns-Pedersen f4ae5da477 some slight improvements to pwnlib.util.packing.dd 2016-03-14 11:12:41 +01:00
Morten Brøns-Pedersen 883ddb30b5 example of gdb.attach 2016-03-14 10:41:09 +01:00
Zach Riggle d3074011d6 Update Dockerfile 2016-03-10 15:59:55 -05:00
Zach Riggle 03b8eb8694 Update Dockerfile 2016-03-10 15:58:25 -05:00
martian dc37b0b5b2 Added support for generating a Dash docset.
Dash docsets can be read by various applications:

Dash         OS X, iOS         https://kapeli.com
Zeal         Linux, Windows    https://zealdocs.org
Velocity     Windows           http://velocity.silverlakesoftware.com
LovelyDocs   Android           http://lovelydocs.io
dasht        POSIX             https://github.com/sunaku/dasht
Helm Dash    emacs             https://github.com/areina/helm-dash
2016-03-08 18:15:54 -08:00
Zach Riggle 3b383ece1c Extract list of data elements from Buffer when unget()'ing a Buffer. Fixes #596
(cherry picked from commit fde04c737b)
2016-03-03 15:51:18 -05:00
Zach Riggle fde04c737b Extract list of data elements from Buffer when unget()'ing a Buffer. Fixes #596 2016-03-03 15:50:05 -05:00
Zach Riggle 524a76b925 Skip $PATH resolution for which() when a path component is detected. Also remove carriage returns from ssh.interactive() output. 2016-02-19 23:22:58 -05:00
Jonas Rudloff d498a34e70 Merge pull request #594 from YASME-Tim/receiving
💊 Recieved -> Received #593
2016-02-08 12:50:27 +01:00
YASME-Tim 79d4248666 💊 #593 Last occurrence of recieved fixed 2016-02-07 13:23:15 +01:00
YASME-Tim fa25a733bd 💊 Recieved -> Received 2016-02-07 13:17:19 +01:00
Zach Riggle 541734a097 Simplify coredump_filter code in case the process dies between the two statements 2016-01-28 13:49:06 -05:00
Zach Riggle cf203cc91e Enable compression for SSH 2016-01-28 00:27:38 -05:00
Zach Riggle b52b970a28 Update ssh.process to match process for usage of setuid 2016-01-28 00:27:25 -05:00
Zach Riggle b36c78805f Add process.corefile; improve process.libs; update process.setuid 2016-01-28 00:26:54 -05:00
Zach Riggle 54584e09c0 Merge pull request #66 from PankajKataria/master
Fix typo
2016-01-24 17:29:39 -05:00
Zach Riggle 2314322369 Add tcp and udb helper classes for remote 2016-01-22 23:29:02 -05:00
Zach Riggle 0ef6a9a383 Add context.device 2016-01-22 23:15:53 -05:00
Zach Riggle 131eefaf05 Add context.noptrace option 2016-01-22 23:14:00 -05:00
Zach Riggle 63ca4f51b1 Ensure coredumps contain *everything* 2016-01-04 18:08:00 -05:00
Zach Riggle e806bf73f6 Fix Corefile parsing verbosity, and make elf.string() bail when reads fail. 2015-12-29 15:09:35 -05:00
Zach Riggle 2cf84db4ca Handle Corefiles with no environment variables 2015-12-29 13:09:59 -05:00
Zach Riggle cb5f04de6b Fix presentation of env on log line when env={} 2015-12-29 12:49:52 -05:00
Zach Riggle c8228729f1 Allow empty environments via SSH 2015-12-29 12:31:40 -05:00
Pankaj Kataria 098888da2f Fix typo
Fix typo
2015-12-27 08:28:06 +05:30
Zach Riggle c250f00abe Fix XOR shellcode and tests for arm and aarch64 2015-12-26 13:13:59 -08:00
Zach Riggle 02ffc4034e Simplify aarch64 by one instruction 2015-12-26 15:10:43 -05:00
Pankaj Kataria 00047af206 Corrected description of download_dir function 2015-12-26 23:22:35 +05:30
Zach Riggle 5a60b591be Fix IRC link 2015-12-21 17:19:22 -05:00
Zach Riggle e54cd0ddf7 Merge branch 'ssh-agent' 2015-12-21 17:02:44 -05:00
Zach Riggle 8eec3e2d12 Disable use of ssh-agent by default 2015-12-21 16:59:44 -05:00
Zach Riggle 1738218f81 Don't be too aggressive with ssh.process() status messages 2015-12-12 02:38:14 -05:00
Zach Riggle e3c1aad702 Fix bug for NT_FILE and environment variable addresses 2015-12-12 02:37:35 -05:00
Zach Riggle df7f08a5ed Fix corefile support for mappings without NT_FILE 2015-12-11 19:19:15 -05:00
Zach Riggle 44548b0a72 Better error handling for ssh.process(), and less verbose log messages 2015-12-11 17:55:24 -05:00
Zach Riggle 5512ecf450 Add warning message for when the corefile isn't loaded 2015-12-11 16:00:26 -05:00
Zach Riggle 8b969da149 Fix regression when parsing some functions like __libc_start_main@@GLIBC_2.0 2015-12-11 15:58:19 -05:00
Zach Riggle 176e45d9f6 Assume that core files are desired 2015-12-11 15:48:09 -05:00
Zach Riggle 594f35e4f7 Enhance corefile parsing to extract environment variable addresses 2015-12-11 15:48:09 -05:00
Zach Riggle ea2493bd56 Do not dump GDB traffic when debugging is verbose 2015-12-11 04:10:37 -05:00
Zach Riggle 3ef1e1a7d5 Further enhancements to Core 2015-12-11 04:10:37 -05:00
Zach Riggle e978986a84 Add support for extracting register state from core files 2015-12-11 04:10:37 -05:00
Zach Riggle faf3e42861 Merge branch 'socks5' 2015-12-11 04:07:30 -05:00
Zach Riggle 32cff88c56 Update .executable to be the original binary, so that .libs and .libc works for process() and ssh_channel() 2015-12-10 22:00:02 -05:00
Zach Riggle f32069589d Convert ssh_channel.exe ==> ssh_channel.executable to be the same as process.executable 2015-12-10 21:46:13 -05:00
Zach Riggle 926231b4ed Fix test 2015-12-08 12:39:45 -05:00
Zach Riggle f08e2c8731 Move output to stdout 2015-12-08 10:24:54 -05:00
Zach Riggle ee1ca61d37 Silence log output in unit test 2015-12-08 10:24:46 -05:00
Zach Riggle 42d08b43fc logging 2015-12-07 17:28:45 -05:00
Zach Riggle ab692c1569 Add logging and socks to the toplevel 2015-12-07 17:23:34 -05:00
Zach Riggle 7640c3fa9f Simplify context setup 2015-12-07 17:23:18 -05:00
Zach Riggle 3db5c4d0ce Add support for SOCKS proxies 2015-12-07 17:15:25 -05:00
Zach Riggle 3bcf57bcd3 Add unit test for aslr==0 to set unlimited stack size 2015-12-07 17:06:23 -05:00
Zach Riggle 714bc320c4 Fix argument for tube.p64 2015-12-03 13:26:57 -05:00
Zach Riggle 24c32f541d Fix log message for ssh.interactive() 2015-12-03 13:26:45 -05:00
Zach Riggle f8753f2f5b Add **kw to run_shellcode 2015-12-03 13:26:20 -05:00
Zach Riggle 507deae10f Add KB,MB,GB globals 2015-12-03 13:25:37 -05:00
Zach Riggle d4dbdb58df Fix "execute" argument to gdb.debug variants 2015-12-03 13:25:12 -05:00
Zach Riggle 59ae1a999a Add ssh.which and other minor bugfixes in ssh 2015-11-30 09:50:42 -05:00
Zach Riggle 1582064bed Add .libc to process and ssh.process; also convert DynELF.libc to a property 2015-11-23 13:10:29 -08:00
Zach Riggle 506be041b7 Add nosetuid to ssh.process 2015-11-20 20:08:44 -08:00
Zach Riggle 8699c98a6f Add signed and unsigned 2015-11-20 20:05:36 -08:00
Zach Riggle 1bcc4626e3 Add option to disable setuid 2015-11-20 23:04:57 -05:00
Jonas Rudloff 8f355195db Merge pull request #586 from Gallopsled/fiddling-naf
added `pwnlib.util.fiddling.naf` to compute the non-adjacent form of …
2015-11-20 17:07:05 +01:00
Morten Brøns-Pedersen 32b9b90175 Merge pull request #583 from binjitsu/wait
Add `wait` as an alias for `wait_for_close`
2015-11-20 16:49:56 +01:00
Morten Brøns-Pedersen 82500a1bc0 added pwnlib.util.fiddling.naf to compute the non-adjacent form of a number 2015-11-20 15:32:53 +01:00
Zach Riggle d6e4c7d76d Add log.hexdump 2015-11-15 00:16:14 -05:00
Zach Riggle ee8a96c39d Re-add cyclic hexdump to hexdump() 2015-11-15 00:15:57 -05:00
Zach Riggle 49dd666026 Fix dealarm_shell issue where "which" doesnt sent a new line if the binary is missing 2015-11-15 00:15:41 -05:00
Zach Riggle 675155abc8 Convert len => length 2015-11-12 14:58:05 -05:00
Zach Riggle 8d4b1f84f8 Add context.aslr and options to disable ASLR via process() and ssh.process() 2015-11-10 16:26:25 -05:00
Kristoffer Søholm 9949d7d979 Merge pull request #584 from Gallopsled/setup-py-requests-issue
Fix annoying setup.py behaviour.
2015-11-09 21:09:35 +01:00
Mathias Svensson f91299986e Fix annoying setup.py behaviour.
When installing pwntools, setup.py required a very new version of
requests -- even though we never used any new features.

This is a problem, since the required version is much never than what is
in e.g. ubuntu's package repo. While this by itself is not much of a
problem, it is a problem if one installs python-pip from the distro's
repo as well, since python-pip will try to use the newest version of the
requests library, which caused pip to break.

The solution: Do not force such a new version of python, instead live
with a much older version.
2015-11-09 21:00:43 +01:00
Zach Riggle 8ffb0dfacf Enhance error messages 2015-11-09 14:36:48 -05:00
Zach Riggle aff7b8e3a3 Simplify a few lines of code 2015-11-09 14:36:11 -05:00
Zach Riggle 438c9a303b Add tube.sendlines method 2015-11-09 13:10:50 -05:00
Zach Riggle f0f4180fd4 Fix test failure introduced by bc6cc93 2015-11-07 23:15:59 -05:00
Zach Riggle aad6e9ae9b Add support for setting log colors from ~/.pwn.conf 2015-11-07 23:12:37 -05:00
Zach Riggle bc6cc93537 Add option to skip setting TTY raw mode. Use os.environ for process() so that preexec_fn can use it. 2015-11-07 20:06:00 -05:00
Zach Riggle 89a60e71b8 Remove termcap did_init, since it breaks terminals 2015-11-07 16:20:25 -05:00
Zach Riggle 6c6b16bb16 Simplify PTY slave logic 2015-11-07 16:08:21 -05:00
Zach Riggle b1575e6a0f Fix infinite recursion on accessing self.proc in close() 2015-11-07 16:04:00 -05:00
Zach Riggle 4c38d29ac3 Gate termcap.get with an initialization flag 2015-11-07 15:48:14 -05:00
Zach Riggle 232ebd5e6d Update docs/requirements.txt to install all requirements. 2015-11-07 15:43:36 -05:00
Zach Riggle f79b447378 Remove CLA 2015-11-07 15:31:14 -05:00
Zach Riggle 45ea91fa8e Fix syscall stubs using "from" as a variable name. 2015-11-07 15:31:14 -05:00
Zach Riggle 55a47c95b9 Fix documentation errors. 2015-11-07 15:31:14 -05:00
Zach Riggle dbd334673d Fix behavior with getpass() by making stdin also be a raw TTY 2015-11-07 15:31:14 -05:00
Zach Riggle 73d8e06a4b Detect gdbserver in the working directory 2015-11-03 19:16:36 -05:00
Zach Riggle 6f248e8a5e Add context.mask 2015-11-03 17:05:18 -05:00
Zach Riggle e6d64d8ade Add wait alias for wait_for_close 2015-11-03 16:43:07 -05:00
Zach Riggle d90566d30a Add wait alias for wait_for_close 2015-11-03 16:42:51 -05:00
Zach Riggle 6db7b8cfbf Fix term mode. Broken since 11fa0d8d6d 2015-11-03 16:38:58 -05:00
Zach Riggle aa323a40df Ensure self.cwd is always set; simplifies some logic 2015-11-03 16:29:04 -05:00
Zach Riggle 8fc7e64ff5 Default working directory is "." 2015-11-03 16:27:36 -05:00
Zach Riggle 2264290a6f Don't print e.g. '\x04' * 0x1 2015-10-30 16:27:55 -04:00
Zach Riggle 170d4999eb Update Android sh scripts to properly set arg0 since it is expected. 2015-10-29 19:39:27 -04:00
Zach Riggle 3520393b62 Add Android includes 2015-10-29 19:37:53 -04:00
Zach Riggle 88ff1f3533 Update Thumb execve to properly support string arrays 2015-10-29 19:37:14 -04:00
Zach Riggle e5223e4bd1 Update ARM execve to properly support string arrays 2015-10-29 19:31:53 -04:00
Ryan afdb7a4449 Update about.rst 2015-10-27 15:04:31 -04:00
Zach Riggle d3814a3d39 Add Android OS 2015-10-27 15:02:30 -04:00
Zach Riggle 515af41f85 Update Android sh path 2015-10-27 15:02:25 -04:00
Jonas Rudloff 458c6971ea Merge pull request #507 from binjitsu/faster-travis
Use container-based Travis CI so that it builds faster
2015-10-26 13:02:25 +01:00
Jonas Rudloff 24401a34ce Merge pull request #580 from Gallopsled/alt-fix-pr-563
alternative to PR #563; this works by simply never emitting CR
2015-10-26 10:44:33 +01:00
Zach Riggle c66b809006 Add Android templates and headers as symlinks 2015-10-25 23:48:26 -04:00
Zach Riggle c2339b62f1 Fix asm regression 2015-10-25 19:35:57 -04:00
Zach Riggle e7a72e086b Add default arguments for mmap 2015-10-25 19:31:00 -04:00
Zach Riggle 1bed4850b0 Dont send cd command if there's no change 2015-10-25 19:29:58 -04:00
Zach Riggle 4993b4ada7 Simplify header layout 2015-10-25 19:29:41 -04:00
Zach Riggle 2c8652bf91 Detect whether gdbserver is installed 2015-10-25 19:18:05 -04:00
Zach Riggle 2219f183c2 Fix ARM push. There is no push-immediate. 2015-10-25 18:36:02 -04:00
Zach Riggle 278ebee345 Add sublime-settings [skip ci] 2015-10-25 16:51:38 -04:00
Zach Riggle 81de47c025 Add errno command-line helper 2015-10-25 16:40:24 -04:00
Kristoffer Søholm 46cc634e8b Merge pull request #581 from scoops/patch-1
Update about.rst
2015-10-24 00:31:07 +02:00
Ryan f71ae3b06f Update about.rst 2015-10-23 11:48:06 -04:00
Ryan 9cdfa82bc3 Update about.rst
Smoothed out some phrasing that bugged me.
2015-10-23 11:45:26 -04:00
Morten Brøns-Pedersen 08c8c2e8e4 alternative to PR #563; this works by simply never emitting CR 2015-10-23 09:11:25 +02:00
Zach Riggle e1b93c77f5 Merge pull request #61 from jaybosamiya/patch-1
Fix typos
2015-10-15 17:34:02 -04:00
Jay Bosamiya 77383048fb Fix typo
"Data" is, by itself plural. "Datas" is not a word.
2015-10-16 01:59:24 +05:30
Jay Bosamiya fb3c55af06 Fix typos
I'm pretty sure it shouldn't be "he" there.
2015-10-16 01:58:00 +05:30
Morten Brøns-Pedersen a09d87c579 Merge pull request #579 from Gallopsled/fiddling-bits-0-doctest
added `fiddling.bits(0)` as a doctest
2015-10-15 09:49:59 +02:00
Morten Brøns-Pedersen 10c3f079c5 added fiddling.bits(0) as a doctest 2015-10-15 09:42:37 +02:00
Morten Brøns-Pedersen 55e830b214 Merge pull request #578 from sam-b/master
corrected util.fiddling.bits implementation to handle 0 validly
2015-10-15 09:27:16 +02:00
Sam Brown 6449e14e9e corrected util.twiddling.bits implementation to handle 0 validly 2015-10-14 23:10:17 +01:00
Zach Riggle d7a0bafc5f Permit dot access to symbol names, add elf.sym alias for elf.symbols 2015-10-14 13:22:31 -04:00
Zach Riggle 11fa0d8d6d This contains a large merge from the Samurai internal repo.
Changes:

- `pwn/init` initialization code simplified, and some was moved to `pwnlib/args`
- `scramble` script added to `pwnlib.commandline`; support for encoders added to relevant scripts
- Added shellcode encoders for several architectures
- Added CGC architecture shellcode and constants
- Added Shellcraft templates for every syscall
- Added `xor_key` helper for generating a 4-byte XOR key for a data stream
- Added `getdents` for use with the relevant shellcraft scripts
- Add ELF loaders for all architectures
- Lots of MIPS and AArch64 shellcode
2015-10-12 02:13:13 -04:00
Morten Brøns-Pedersen 768b24e192 added __neq__ method to pwnlib.term.key
(cherry picked from commit 31d06cb807)
2015-10-06 18:09:25 -04:00
Morten Brøns-Pedersen 42d8f59e11 import completer with pwnlib.term and update no-available-completions-text 2015-10-06 18:09:09 -04:00
Morten Brøns-Pedersen c734802900 fix before and after keywords for term.output() 2015-10-06 18:08:58 -04:00
Zach Riggle b4945667c7 Clean up code from 442873e 2015-10-06 18:08:09 -04:00
antoniob 442873e5be close file descriptors in process.close() and avoid leaving zombie processes around
(cherry picked from commit fa2e11391e)
2015-10-06 18:06:10 -04:00
Zach Riggle 29eefaac2b Revert disable-randomization change from 3b9614a535 2015-10-06 18:05:57 -04:00
Morten Brøns-Pedersen daf117e270 Merge pull request #576 from antoniobianchi333/master
close file descriptors in process.close() and avoid leaving zombie processes around
2015-10-05 12:33:40 +02:00
antoniob fa2e11391e close file descriptors in process.close() and avoid leaving zombie processes around 2015-10-05 01:05:24 -07:00
Zach Riggle c5a92cdfb6 Simplify use if int() 2015-09-21 14:14:40 -04:00
Jonas Rudloff 6c9761d83d Merge pull request #574 from en0/master
Fixed lookup feature where the packing util was being called with wrong argument
2015-09-21 19:04:24 +02:00
Ian Laird 80f744cc6d Fixed issue on lookup function where the packing util was being called with inproper argument type 2015-09-19 23:29:57 -06:00
Zach Riggle 4c61ed3b0b Fix #59 2015-09-15 15:11:26 -04:00
Zach Riggle 88d1643804 Fix ssh.run() environment variables 2015-09-01 14:50:44 -04:00
Morten Brøns-Pedersen a454d54975 Merge pull request #571 from Gallopsled/term-before-after-fix
fix `before` and `after` keywords for `term.output()`
2015-08-31 10:13:17 +02:00
Morten Brøns-Pedersen 5a92096231 Merge pull request #570 from Gallopsled/term-completer
import `completer` with `pwnlib.term` and update no-available-complet…
2015-08-31 10:13:04 +02:00
Morten Brøns-Pedersen cfa9b00789 Merge pull request #569 from Gallopsled/term-key-neq
added `__neq__` method to `pwnlib.term.key`
2015-08-31 10:12:38 +02:00
Zach Riggle f12253e34d Add dockerfile 2015-08-31 03:53:31 -04:00
Zach Riggle 783cc096a6 Fix which() precedence 2015-08-30 23:29:46 -04:00
Zach Riggle 549541b6ea Handle EINTR on select 2015-08-30 23:21:30 -04:00
Zach Riggle a2916b7d01 Add live demo 2015-08-30 22:55:00 -04:00
Zach Riggle a6a5cfeb9c Add i686 alias 2015-08-30 15:01:05 -04:00
Zach Riggle c18f8a202d Sockets should be set to non-blocking for spawned processes 2015-08-25 16:54:30 -04:00
Zach Riggle 59a309d6ac Fix UDP socket buffering 2015-08-25 16:47:16 -04:00
Zach Riggle a676adbc52 Update ELF 2015-08-23 16:51:12 -04:00
Zach Riggle e08aebe9fd Remove shippable, since its crap 2015-08-22 15:41:17 -04:00
Zach Riggle f968120997 Only request ptrace_scope when required 2015-08-22 15:40:05 -04:00
Robert Larsen 60307ed1c7 Merge branch 'master' of https://github.com/Gallopsled/pwntools 2015-08-18 12:22:13 +02:00
Robert Larsen 71d1535f33 Removed test file. 2015-08-18 12:21:30 +02:00
Zach Riggle b03d83dfe7 Add elf.functions 2015-08-14 18:20:01 -04:00
Zach Riggle f9c7ea87fa process() now handles empty environments 2015-08-14 17:58:08 -04:00
Jonas Rudloff e0e150f87b Merge pull request #568 from RobertLarsen/master
Shellcodes for MIPS/i386/amd64
2015-08-14 16:55:40 +02:00
Robert Larsen a6fd7f8411 Fixed more documentation. 2015-08-13 09:56:38 +02:00
Robert Larsen 400b5f4995 Fixed documentation. 2015-08-13 09:48:16 +02:00
Morten Brøns-Pedersen 5394d9d91c import completer with pwnlib.term and update no-available-completions-text 2015-08-11 22:07:40 +02:00
Morten Brøns-Pedersen 000d2b2fc7 fix before and after keywords for term.output() 2015-08-11 22:02:45 +02:00
Morten Brøns-Pedersen 31d06cb807 added __neq__ method to pwnlib.term.key 2015-08-11 21:04:37 +02:00
Robert Larsen 55067001c3 Merge branch 'master' of https://github.com/Gallopsled/pwntools 2015-08-10 11:09:14 +02:00
Morten Brøns-Pedersen 06f0f8c8af Merge pull request #566 from Gallopsled/bugfix-term-enter
bugfix: `ui.yesno()` now correctly handles <enter>
2015-08-06 04:37:04 +02:00
Zach Riggle 1a389ca2b8 Update binutils.rst 2015-07-30 13:34:27 -04:00
Zach Riggle ecbe0e9fa9 Update binutils.rst 2015-07-30 13:34:16 -04:00
Robert Larsen 175f26c605 Merge branch 'master' of https://github.com/Gallopsled/pwntools 2015-07-30 13:36:16 +02:00
Zach Riggle 76d78a0e7e Install QEMU 2.3 instead of 2.1 2015-07-29 08:03:01 -04:00
Zach Riggle 3f8d4cc37c Add aarch64 binutils 2015-07-29 07:52:19 -04:00
Robert Larsen 9beb63dc9d Added readfile shellcode for i386. 2015-07-22 16:00:32 +02:00
Robert Larsen d6a358d1dc Added readfile shellcode for amd64. 2015-07-22 15:35:12 +02:00
Morten Brøns-Pedersen 83d44b500d Merge pull request #567 from Gallopsled/bugfix-no-shutdown-on-close
bugfix: don't call `shutdown(2)` when calling `tubes.sock.close()`
2015-07-17 09:37:11 +02:00
Morten Brøns-Pedersen 1eb35819ac Merge pull request #560 from binjitsu/register-ordering
Add setregs shellcode helper for i386 to demonstrate regsort
2015-07-17 09:34:46 +02:00
Morten Brøns-Pedersen 8a2e54232b Merge pull request #561 from binjitsu/gdb-unlink
Unlink GDB temporary files.  Fixes #519
2015-07-17 09:31:09 +02:00
Morten Brøns-Pedersen 77bfc16341 bugfix: don't call shutdown(2) when calling tubes.sock.close()
This can be a problem since sockets inherited by children will see the
`shutdown(2)` call as well.
2015-07-16 23:35:30 +02:00
Morten Brøns-Pedersen 383f245082 bugfix: ui.yesno() now correctly handles <enter>
This bug happened because we no longer disable input processing in the terminal.
In particular `\r` is now translated to `\n`.  The fix is to interpret both `\r`
and `\n` as <enter> in `term/key.py`.
2015-07-16 23:30:45 +02:00
Zach Riggle e7ef1c1029 Merge pull request #55 from eQu1NoX/MAIN-arm
Integration test for ARM
2015-07-15 12:11:09 -04:00
eQuiNoX__ e6752fbd30 Correct tests that depend on 0x900000 vs 0x0 2015-07-15 13:14:59 +02:00
eQuiNoX__ de393e4afa Integration test for ARM 2015-07-15 12:40:44 +02:00
Zach Riggle f92ea95299 Rebuild the ARM constants with __ARM_EABI__ and __KERNEL__ 2015-07-14 16:33:20 -04:00
Zach Riggle ee4028c10a Merge pull request #54 from eQu1NoX/MAIN2
MIPS integration tests for SROP
2015-07-14 08:17:17 -04:00
eQuiNoX__ 69ee58343e Trivial correction 2015-07-14 14:06:43 +02:00
eQuiNoX__ dca6232d97 Mips integration tests 2015-07-14 13:54:55 +02:00
Zach Riggle 8c1565ae3e Update README.md 2015-07-13 20:12:02 -04:00
Zach Riggle d1a70dc0fb Add screenshot 2015-07-13 20:10:35 -04:00
Zach Riggle 48a1cc72b0 Create README.md 2015-07-13 20:07:09 -04:00
Zach Riggle c29aebdb77 Add docstrings to QEMU functions 2015-07-13 16:28:48 -04:00
Zach Riggle ae888803b6 Add qemu-XXX-static binaries to Travis 2015-07-13 15:24:01 -04:00
Zach Riggle 4386b8d82a Merge pull request #49 from eQu1NoX/MAIN2
Adding in Aarch64 support.
2015-07-10 23:23:59 -07:00
eQuiNoX__ a44ba4fa16 Adding in doctests 2015-07-09 16:25:58 +02:00
Zubin Mithra 9ac4e8d9cb Adding in Aarch64 support.
This commit adds in Aarch64 SROP support. PoC that calls mprotect
can be viewed at

https://bitbucket.org/eQu1NoX/pwntest-arm64/src/a7936795d47c\?at\=master
2015-07-09 15:42:18 +02:00
Robert Larsen 853cdb4a25 Prevent nul byte. 2015-07-08 15:32:18 +02:00
Robert Larsen bd547f3fdc Added thumb/Linux shellcode for reading a file. 2015-07-08 14:13:45 +02:00
Robert Larsen a69dc3ebc6 Removed unneeded import. 2015-07-08 13:05:25 +02:00
Robert Larsen 3da395f11a An offset was slightly off. Fixed. 2015-07-08 12:38:28 +02:00
Robert Larsen b6c81925a9 Added MIPS/Linux shellcode for reading a file. 2015-07-08 12:35:08 +02:00
Zach Riggle 9559a99854 Fix doctests in ELF 2015-07-06 22:50:57 -07:00
Zach Riggle 1897045707 Merge remote-tracking branch 'nemopwn/master' 2015-07-06 21:54:57 -07:00
Zach Riggle 973efff68b Merge pull request #48 from binjitsu/asm-large-pages
Fix large page sizes on AMD64
2015-07-06 18:15:27 -07:00
Zach Riggle dd58f40991 Fix large page sizes on AMD64 2015-07-06 21:10:18 -04:00
Zach Riggle 0f710677d3 Touch README to force Travis rebuild 2015-07-06 14:50:20 -07:00
Zach Riggle 6d2ccdcf93 Merge remote-tracking branch 'gallopsled/master' 2015-07-06 14:47:22 -07:00
Robert Larsen 18cdcfd409 Added wrappers for ensuring the right operating system. 2015-07-06 15:41:12 +02:00
Robert Larsen c591d69a3a Added bindsh shellcode for MIPS. 2015-07-06 15:11:04 +02:00
Jonas Rudloff 073257dcac Merge pull request #565 from RobertLarsen/fix-sockaddr-usage
Fixed regression due to changed return value.
2015-07-06 14:59:23 +02:00
Robert Larsen 02c67d547d Removed comment. 2015-07-06 14:22:50 +02:00
Robert Larsen 61edc646e1 Use big endian (network byte order) for port. 2015-07-06 13:55:21 +02:00
Robert Larsen f424a9caf7 Merge branch 'fix-sockaddr-usage' of https://github.com/RobertLarsen/pwntools 2015-07-06 13:42:45 +02:00
Robert Larsen a95bb8e353 Revert "Revert "Fix sockaddr, optimize off some zero bytes""
This reverts commit 400013e680.
2015-07-06 13:25:15 +02:00
nemo 5d1e3500f0 Two changes:
- Add .ropeproject to .gitignore
- Make documentation of class ELF display normally
2015-07-06 16:15:47 +08:00
Jonas Rudloff d66676a862 findpeer- and connectstager shellcodes 2015-07-05 15:54:50 +02:00
Jonas Rudloff 6bdcb41252 fixed mov and syscall for thumb 2015-07-05 15:54:27 +02:00
Jonas Rudloff aa4a0a889c connectback stager for amd64 2015-07-05 13:04:36 +02:00
Jonas Rudloff 401d9f567e connectback stager for i386 2015-07-05 12:55:46 +02:00
Jonas Rudloff 400013e680 Revert "Fix sockaddr, optimize off some zero bytes"
This reverts commit bb5ea7677c.
2015-07-05 12:29:48 +02:00
Jonas Rudloff 5a637a534e amd64 findpeerstager recvives size 2015-07-05 12:14:41 +02:00
Jonas Rudloff f36470e628 findpeerstager now recvives the size 2015-07-05 10:31:56 +02:00
Robert Larsen bfcc9ac326 Works! 2015-07-04 23:34:36 +02:00
Robert Larsen 8ede459860 Fixed regression due to changed return value. 2015-07-04 01:47:55 +02:00
Robert Larsen 7855e433d0 Added connect shellcode which almost work. 2015-07-04 01:34:34 +02:00
Robert Larsen 5ab2f403bd Works...kind of. 2015-07-03 13:50:35 +02:00
Robert Larsen 2ed7e83dad Use the nop generator. 2015-07-03 13:50:08 +02:00
Robert Larsen 64c37569a3 Added stager and a nop generator. 2015-07-03 13:49:49 +02:00
Robert Larsen 8db93e8c04 Support three more arguments for syscalls. 2015-07-03 11:18:18 +02:00
Robert Larsen 7779ebff3c Fixed documentation. 2015-07-03 08:42:08 +02:00
Robert Larsen 2d67781ba4 Shaved off some instructions and made the port matching work. 2015-07-02 23:39:51 +02:00
Zach Riggle 37c55233ed Merge pull request #45 from eQu1NoX/MAIN2
Test for amd64
2015-07-02 14:02:44 -07:00
eQuiNoX__ 1f289e3dbd The following changes were made :-
- test for amd64 added in
- sigreturn template for amd64 added in. sigreturn template for i386 modified
- read.asm added for amd64
2015-07-02 19:01:57 +02:00
Robert Larsen 7dfd489e89 Nul free. 2015-07-02 15:55:19 +02:00
Robert Larsen 579d7bf58f Added findpeersh shellcode for MIPS/Linux. Port matching not working yet. Also contains a nul byte. 2015-07-02 15:49:08 +02:00
Robert Larsen eba2352dbc Don't overwrite socket register before using it 2015-07-02 15:48:00 +02:00
Robert Larsen ef451105c2 Added MIPS/Linux dupsh shellcode. 2015-07-02 15:05:27 +02:00
Robert Larsen 9a26be0881 Added MIPS/Linux sh shellcode. 2015-07-02 15:01:05 +02:00
Robert Larsen d21af22f82 Added MIPS/Linux dup shellcode. 2015-07-02 14:46:29 +02:00
Robert Larsen 71ef26281c Added Linux MIPS syscall shellcode. 2015-07-02 13:39:39 +02:00
Robert Larsen fa8d00dcfb Prettier. 2015-07-02 12:54:57 +02:00
Robert Larsen 28911442c4 Added test 2015-07-02 10:48:48 +02:00
Robert Larsen 0c0f609752 Added pushstr for MIPS. 2015-07-01 23:38:52 +02:00
Robert Larsen 5ad8ec2c3f Removed comments I no longer need. 2015-07-01 23:38:12 +02:00
Robert Larsen 504518596d More avoid newline. 2015-07-01 23:06:24 +02:00
Robert Larsen 5a6327537b Avoid newlines. 2015-07-01 22:53:16 +02:00
Robert Larsen 6ede0d2d64 Upper and lower halfword were swapped if they contained nul bytes. 2015-07-01 15:05:38 +02:00
Robert Larsen 966f66b19d Don't use pseudo instructions. 2015-07-01 14:19:24 +02:00
Robert Larsen 52dec55e2d Fixed list of registers. Use this in mips/mov.asm 2015-07-01 09:19:26 +02:00
Robert Larsen b3e4cb12b8 Prettier 2015-07-01 00:38:38 +02:00
Robert Larsen 536416dd83 Added more cases. May be done now. 2015-07-01 00:30:07 +02:00
Robert Larsen 2f88aadf0b More correct comments. 2015-06-30 23:48:02 +02:00
Robert Larsen d67384b283 More stuff tested. 2015-06-30 23:26:33 +02:00
Robert Larsen 5cb35801e9 More stuff tested. 2015-06-30 23:24:35 +02:00
Robert Larsen 88b6ea3b1a Be able to mov src=1 2015-06-30 22:51:32 +02:00
Robert Larsen 6be7b53519 Verified another piece. 2015-06-30 22:42:51 +02:00
Robert Larsen 2f1d4f6ebe Added comments about what works. 2015-06-30 15:34:29 +02:00
Zach Riggle d66c273e60 Merge pull request #44 from eQu1NoX/MAIN2
Add in support for mips, mipsel + doctests
2015-06-29 12:27:26 -07:00
Robert Larsen 24dfbc850f Trying to build a mov() shellcode generator for MIPS. 2015-06-29 16:16:47 +02:00
eQuiNoX__ ed7b459be9 Following changes were made :-
- Add support for MIPS and MIPSel
- Change format to offset:register in srop.py
- Correct doctests in srop.py
- Change usage in rop.py
2015-06-29 16:11:19 +02:00
Zach Riggle e544cd43b8 Fix test 2015-06-25 12:54:56 -04:00
Zach Riggle cfdfaff37e Fix SigReturnFrame.get_frame docstring [skip ci] 2015-06-25 12:37:55 -04:00
Zach Riggle 38e9f4274d Fix code-blocks [skip ci] 2015-06-25 12:36:29 -04:00
Zach Riggle 88d79af9c9 Update FormatStr doctest formatting 2015-06-25 00:01:38 -04:00
thetlk e675c2068e Enhance FormatString support, and add doctests 2015-06-24 23:42:03 -04:00
Zach Riggle 4cecbac380 Re-enable teset with workaround for Shippable 2015-06-24 16:24:06 -04:00
Zach Riggle b4f8877660 Skip test which fails on Shippable 2015-06-24 16:03:44 -04:00
Zach Riggle 1f5fde3302 Fix listen(fam=socket.AF_INET6) 2015-06-22 23:50:14 -04:00
Zach Riggle 9e17e76054 Simplify test 2015-06-22 23:21:51 -04:00
Zach Riggle 4f5be7144b Fix process(..., stdout=PIPE) and add tests 2015-06-22 23:19:24 -04:00
Zach Riggle 51d8a89d4b Shippable needs apt-get update to find gcc-multilib 2015-06-22 11:58:28 -04:00
Zach Riggle 523344b64e Add gcc-multilib to Travis and Shippable requirements 2015-06-22 11:53:57 -04:00
Zach Riggle 7486c79a67 Update .travis_install.sh 2015-06-22 09:27:47 -04:00
Zach Riggle 3a565a8171 Fix docstring [skip ci] 2015-06-21 15:40:43 -04:00
Zach Riggle 6b82b6b7dc Fix docstring [skip ci] 2015-06-21 15:39:27 -04:00
Zach Riggle c4dd91c5de Fix docstring [skip ci] 2015-06-21 15:38:14 -04:00
Zach Riggle 4b33859132 Add XOR encoder module for docs 2015-06-21 15:37:44 -04:00
Zach Riggle 6aff977171 Fix assembly for arches which want __start 2015-06-21 15:28:21 -04:00
Zach Riggle 6141e7d465 Add shellcode encoders and API 2015-06-21 15:26:55 -04:00
Zach Riggle 71845f6198 Remove unnecessary gadgets in the example 2015-06-21 15:22:49 -04:00
Zach Riggle d00cae41a6 Make stack and code rwx for generated ELFs 2015-06-21 15:22:33 -04:00
Zach Riggle 1327f2b33b :) 2015-06-19 23:43:04 -04:00
Zach Riggle b6ea53696b Fix setregs 2015-06-18 17:23:55 -04:00
Zach Riggle be1e13389a Make disassembly colors better for operators 2015-06-18 17:18:25 -04:00
Zach Riggle 6e562b2bdb Make shifting easier to read 2015-06-18 17:13:32 -04:00
Zach Riggle dd7c0acae1 Make xor easier to read 2015-06-18 16:50:57 -04:00
Zach Riggle b10f109967 Make not easier to read 2015-06-18 16:46:11 -04:00
Zach Riggle 63da39ea18 Make neg easier to read 2015-06-18 16:42:21 -04:00
Zach Riggle 8b459a066e Update doctests 2015-06-18 16:33:03 -04:00
Zach Riggle 1187e544de Optimize i386 mov for a few special cases 2015-06-18 16:19:08 -04:00
Zach Riggle 49e2c52b0b Fix doctests 2015-06-17 13:04:22 -07:00
Zach Riggle fc0c7a0f69 Revert changes to make_elf. Fixes #33 2015-06-17 12:28:28 -07:00
Zach Riggle d7b957c9c1 Merge pull request #32 from thetlk/master
import pwnlib after sys.path's change
2015-06-17 15:03:53 -04:00
thetlk dad217f9ed import pwnlib after sys.path's change 2015-06-17 16:47:11 +02:00
Zach Riggle ba6eba4b13 Fix doctest 2015-06-17 07:32:09 -04:00
Zach Riggle 4f1745fbdf Restore compact size to generated ELFs 2015-06-17 07:32:09 -04:00
Zach Riggle b218776573 Switch syscall over to getregs 2015-06-17 06:20:01 -04:00
Zach Riggle e867643192 Collapse constant values in regsort, since "mov reg,reg" is at most only as expensive as "mov reg,value" and usually cheaper 2015-06-17 05:58:44 -04:00
Zach Riggle 275a3a09d4 Restore compact size to generated ELFs 2015-06-17 05:45:09 -04:00
Zach Riggle 6f0a62e751 Honor -o option in asm; mark output as executable if output format is ELF 2015-06-17 05:32:35 -04:00
Zach Riggle 70645b432b Make pushstr work for things not-a-string but which can go through packing.flat(). This makes push more simple. 2015-06-17 05:31:55 -04:00
Zach Riggle 4ea3a4932e Slightly better cdq 2015-06-17 04:59:00 -04:00
Zach Riggle 8d1f57a345 Add cdq optimization to setregs 2015-06-17 04:59:00 -04:00
Zach Riggle c00e2b1863 Add correct ipv6 address, allow accept to time out 2015-06-17 04:59:00 -04:00
Zach Riggle 2aac79c9ad Honor -o option in shellcraft; mark output as executable if output format is ELF 2015-06-17 04:59:00 -04:00
Zach Riggle 8121a95bc5 Better colorizing, which can be disabled 2015-06-17 03:45:27 -04:00
Zach Riggle 797d416a47 Add support for conditional instruction printing 2015-06-17 03:18:38 -04:00
Zach Riggle 4ad2cb87a9 Remove debug print 2015-06-17 03:17:50 -04:00
Zach Riggle 400f208ca2 Fix output of the GasLexer to parse templates better 2015-06-17 03:16:45 -04:00
Zach Riggle 800f85fe7a Add Pygments to requirements 2015-06-17 03:09:37 -04:00
Zach Riggle 30dcc6af05 Use Pygments to colorize assembly if possible 2015-06-17 03:08:50 -04:00
Zach Riggle 2078c1dca6 Add TextMate / Sublime Text language bundles 2015-06-17 02:43:10 -04:00
Zach Riggle 966cc482fd Add cat doctest 2015-06-16 23:26:33 -04:00
Zach Riggle 98f27f80d8 Fix ROP doctests 2015-06-16 20:07:55 -04:00
Zach Riggle 3c2b2b22c9 Add ROP doctest 2015-06-16 19:15:32 -04:00
Zach Riggle c03c90c204 Add i386 SROP integration test 2015-06-16 17:56:56 -04:00
Zach Riggle 4265424956 Pass kwargs down to ELF.from_bytes 2015-06-16 16:19:28 -04:00
Zach Riggle 085efbc6b4 Defer deletion of temporary files 2015-06-16 16:19:20 -04:00
Zach Riggle 1d5fe92e04 Fix VMA for make_elf 2015-06-16 16:07:10 -04:00
Zach Riggle 8ba3d52955 Add ROP.from_blob for kokjo :D 2015-06-16 15:41:25 -04:00
Zach Riggle 24c1f2d04a Add documentation for checksec 2015-06-15 23:59:25 -04:00
Zach Riggle 1e59b54c4e Add shellcraft --run 2015-06-15 23:57:58 -04:00
Zach Riggle e21f8a0a24 Don't execute binaries which are not dynamically linked 2015-06-15 23:57:45 -04:00
Zach Riggle 58b6ce5ec4 Add asm --run and --infile 2015-06-15 23:56:17 -04:00
Zach Riggle e54c16c5e9 Dont emit CRLF since it shows empty lines 2015-06-15 23:11:26 -04:00
Zach Riggle ac4524607a Dont emit CRLF since it shows empty lines 2015-06-15 23:09:31 -04:00
Zach Riggle 757f60acb0 Unlink GDB temporary files. Fixes #519 2015-06-15 17:29:27 -04:00
Zach Riggle b57beda046 Fix missing imports, simplify runner module 2015-06-15 17:22:05 -04:00
Zach Riggle 1ac87052c2 Add powerpc and powerpc64 register names so you can "li r0,0" 2015-06-15 14:23:54 -04:00
Zach Riggle 502de0c92f Add missing constants 2015-06-15 14:17:18 -04:00
Zach Riggle 2093ca4632 Dont bail on various architectures 2015-06-15 14:16:51 -04:00
Zach Riggle c0f321fbf2 Unlink GDB temporary files. Fixes #519 2015-06-15 14:06:44 -04:00
Zach Riggle 39beae9c3f Add setregs shellcode helper for i386 to demonstrate regsort
```py
>>> print shellcraft.setregs({'eax':'ebx','ebx':3,'edx':'eax','esi':'edi','edi':'esi','ebp':'ebx'})
    mov edx, eax
    mov eax, ebx
    mov ebp, ebx
    push 0x3
    pop ebx
    xchg edi, esi
```
2015-06-15 13:53:14 -04:00
Zach Riggle 86e422de0c Update TESTING.md 2015-06-15 09:32:11 -04:00
Zach Riggle af5ba55325 Merge remote-tracking branch 'gallopsled/master' into integration 2015-06-15 09:07:34 -04:00
Zach Riggle 405d9cc2af Import iters 2015-06-15 09:01:32 -04:00
Zach Riggle 1631d2265e Fix tests 2015-06-15 08:57:41 -04:00
Zach Riggle 77cc76769c Merge with gallopsled/master 2015-06-15 08:54:50 -04:00
Zach Riggle 31f05f4c7f Emit nicer assembly comments 2015-06-15 08:38:35 -04:00
Zach Riggle 24f49a46cf Add echo example 2015-06-15 08:37:52 -04:00
Zach Riggle 28307ec699 Update TESTING.md 2015-06-15 08:17:46 -04:00
Zach Riggle c50f224b6b Update TESTING.md 2015-06-15 08:14:39 -04:00
Zach Riggle 3a63c0804d Feed results of unpack() through int() so it doesnt return long() 2015-06-15 08:12:45 -04:00
Zach Riggle 1d5825c844 Fix whitespace, 2015-06-15 08:10:55 -04:00
Zach Riggle 709d834945 Fix whitespace, add amd64 version 2015-06-15 08:08:57 -04:00
Zach Riggle f3b0645568 Fix simple case of regsort. Add i386.setregs 2015-06-15 08:05:53 -04:00
Zach Riggle 640d0261fd Add register sorting and dependency resolution module 2015-06-15 07:59:55 -04:00
Zach Riggle 89dd56a2a3 Use LocalContext for ABI 2015-06-15 02:35:55 -04:00
Zach Riggle e45ee3053e Automatically set arch for shellcraft; update i386 exit; add amd64 exit 2015-06-15 02:32:24 -04:00
Zach Riggle 65a60a6170 Automatically set arch for shellcraft; update i386 exit; add amd64 exit 2015-06-15 02:32:07 -04:00
Zach Riggle 63c5d4fb60 Add doctest for i386.linux.exit 2015-06-15 02:21:01 -04:00
Zach Riggle 6c27af5e16 Update __init__.py 2015-06-14 20:49:37 -04:00
Zach Riggle 931d18f836 Update license from pwntools 2015-06-14 20:47:35 -04:00
Zach Riggle 41350f51cf TESTING 2015-06-14 20:46:37 -04:00
Zach Riggle 75b230c052 Enable @LocalContext for ELF.from_XXXX 2015-06-14 20:38:20 -04:00
Zach Riggle 24a70eb8ff Add better tests and ELF.from_bytes 2015-06-14 18:59:26 -04:00
Zach Riggle 918115302c Add make_elf_from_assembly and ELF.from_assembly 2015-06-14 18:53:03 -04:00
Zach Riggle af92658f42 Add context.clear(...) arguments 2015-06-14 17:18:33 -04:00
Zach Riggle ee35d10303 Add TESTING.md 2015-06-14 17:11:51 -04:00
Zach Riggle 3b0cf3cbaf Nope time is bad, not installed on Travis 2015-06-14 16:44:41 -04:00
Zach Riggle 7292806e08 Explicitly time the run 2015-06-14 16:43:12 -04:00
Zach Riggle f263f9e10d Update docstring 2015-06-14 16:38:47 -04:00
Zach Riggle cfa0d50339 Silence Sphinx warning 2015-06-14 16:38:28 -04:00
Zach Riggle 7cf6360dbb Add runner.rst to index.rst 2015-06-14 16:36:06 -04:00
Zach Riggle 32fef0cf05 Add missing link 2015-06-14 16:32:23 -04:00
Zach Riggle 95b1adebbf Fix Sphinx warnings 2015-06-14 16:30:01 -04:00
Zach Riggle df3a746768 Fix docs 2015-06-14 16:29:39 -04:00
Zach Riggle 11bfb24506 Add testexample link 2015-06-14 16:26:14 -04:00
Zach Riggle ddaa95d6dd Fix testexample 2015-06-14 16:24:02 -04:00
Zach Riggle 77e8ab1d84 No shippable caching 2015-06-14 16:23:23 -04:00
Zach Riggle e9497169f1 Remove set -ex 2015-06-14 16:21:16 -04:00
Zach Riggle 9f552c94cb Fix testexample 2015-06-14 16:20:30 -04:00
Zach Riggle 0cdb715e7c Fix runner banner 2015-06-14 16:14:01 -04:00
Zach Riggle 9a5b4e09af Fix SROP banner 2015-06-14 16:13:52 -04:00
Zach Riggle bac6a9f543 Fix testexample module 2015-06-14 16:13:39 -04:00
Zach Riggle b901ff3b1e Add shippable configuration 2015-06-14 16:12:04 -04:00
Zach Riggle de47ac9cf5 Add Shippable badge 2015-06-14 16:07:10 -04:00
Zach Riggle 72e9b3135e Fix Shippable build since it really doesnt have terminfo 2015-06-14 15:55:52 -04:00
Zach Riggle 7413dffac7 Add test example modules 2015-06-14 15:54:56 -04:00
Zach Riggle 7b4a415a90 Skip failing SROP tests 2015-06-14 15:45:18 -04:00
Zach Riggle 465f5875b7 Fix SROP tests 2015-06-14 15:28:47 -04:00
Zach Riggle a50cd85791 Fix Shippable builds 2015-06-14 15:28:08 -04:00
Zach Riggle 1541b20c19 Run install before SSH setup 2015-06-14 15:26:00 -04:00
Zach Riggle 54551eb072 Fix doctest 2015-06-14 15:25:18 -04:00
Zach Riggle a45da211db Move srop module 2015-06-14 15:25:08 -04:00
Zach Riggle 5bfde777bf Fix naming 2015-06-14 15:14:13 -04:00
Zach Riggle 6e0ee86cb9 Import ALL THE THINGS 2015-06-14 15:12:50 -04:00
Zach Riggle b78b91180f Add runner module, for shellcode unit tests 2015-06-14 15:08:04 -04:00
Zach Riggle 77326199e4 Fast path for LocalContext 2015-06-14 14:59:57 -04:00
Morten Brøns-Pedersen 143239bd7f Merge pull request #465 from binjitsu/sorted-imports-upstream
Sort all imports, force import sort checking on doctest
2015-06-11 20:01:52 +02:00
Morten Brøns-Pedersen 61540eb90f Merge pull request #457 from binjitsu/clean-and-log
Don't log twice for clean_and_log.
2015-06-11 20:00:21 +02:00
Morten Brøns-Pedersen 4fbaba7888 Merge pull request #557 from binjitsu/read-n
Enable maximum number of bytes to read
2015-06-11 19:59:07 +02:00
Zach Riggle 13ad3e80f7 Fix doctest 2015-06-11 08:59:58 -04:00
Zach Riggle d2e6db8904 Add config 2015-06-11 08:59:35 -04:00
Zach Riggle a0b6e99e72 Fix failing test due to wrong username 2015-06-11 08:58:07 -04:00
Zach Riggle f5ebcf6dc4 Add mode option to write 2015-06-11 08:55:49 -04:00
Zach Riggle f7eca3e13a Add skip, rename n to count 2015-06-11 08:34:52 -04:00
Zach Riggle 787c015e07 Don't log twice for clean_and_log. 2015-06-11 08:30:12 -04:00
Zach Riggle c69ed7ea15 Sort all imports 2015-06-11 08:25:50 -04:00
Zach Riggle f399a7029d More enhancements to the Travis caching functionality. 2015-06-11 08:13:17 -04:00
Zach Riggle 061ca4ab12 Use container-based Travis CI so that it builds faster 2015-06-11 08:13:17 -04:00
Zach Riggle 287bcae4c4 Merge pull request #25 from eQu1NoX/master
ARM srop support
2015-06-11 06:58:30 -04:00
Zach Riggle 6148801e95 Fix feature regression in cyclic_find which permits integer lookups 2015-06-11 06:58:01 -04:00
Zubin Mithra f23c297d7b moving integ to different branch
Add information about various ARM coprocessors that might be present.

Correct typo

Add in comments

Change how magic numbers and offsets are stored

Use namedtuple

Renaming variables

srop.py doc modified

ARM sp check added in

Cleanup
2015-06-11 12:38:51 +02:00
Morten Brøns-Pedersen 74e55a2ef6 Merge pull request #501 from binjitsu/cmdline-enhance
Enhance asm and shellcraft with auto-debugging; add checksec command-line
2015-06-11 10:42:24 +02:00
Morten Brøns-Pedersen 2e8228490f Merge pull request #499 from binjitsu/process-enhancements
Enhance functionality in process
2015-06-11 10:41:14 +02:00
Morten Brøns-Pedersen 8766c3f7ad Merge pull request #498 from binjitsu/ssh-enhancements
Multiple enhancements to SSH
2015-06-11 10:39:14 +02:00
Morten Brøns-Pedersen eb59165810 Merge pull request #542 from binjitsu/net-shorter
Fix sockaddr ipv6, optimize off some zero bytes
2015-06-11 10:26:00 +02:00
Morten Brøns-Pedersen d48d0624d1 Merge pull request #543 from binjitsu/compress-debug-sendrecv
Compress debug send/recv output if it's the same byte
2015-06-11 10:25:07 +02:00
Morten Brøns-Pedersen 3fab235f30 Merge pull request #551 from binjitsu/disasm-strip
Enable disassembly with stripping the offsets and columns
2015-06-11 10:18:55 +02:00
Morten Brøns-Pedersen c83387b2f3 Merge pull request #555 from Gallopsled/issue553
Fixes #553
2015-06-11 10:16:56 +02:00
Morten Brøns-Pedersen cc4102f7d2 Merge pull request #556 from binjitsu/aarch64
Add support for aarch64-linux
2015-06-11 10:15:22 +02:00
Zach Riggle a4c5492772 Enable maximum number of bytes to read 2015-06-11 03:45:15 -04:00
Zach Riggle 01365128dc Fix feature regression in cyclic_find which permits integer lookups 2015-06-11 03:45:09 -04:00
Zach Riggle 8849b78ed5 Enable maximum number of bytes to read 2015-06-11 03:27:52 -04:00
Zach Riggle fc2032e830 Add support for aarch64-linux 2015-06-10 23:11:48 -04:00
Zach Riggle cbcf23c70d Fail disassembly gracefully 2015-06-10 17:32:53 -04:00
Zach Riggle 1bc94ccc58 Fix doctests 2015-06-10 16:18:40 -04:00
Zach Riggle 347ab75af5 Add parens so ARM doesnt shit itself 2015-06-10 15:36:04 -04:00
Zach Riggle 72768d8b4a Fix doctest 2015-06-10 15:28:07 -04:00
Zach Riggle d3a3359c77 Save pretty name of things passed through constants.eval 2015-06-10 15:27:29 -04:00
Jonas Rudloff b0c3abb23c fix doctest to make travis happy 2015-06-10 20:27:22 +02:00
Jonas Rudloff a3d37d6287 fixed #553 2015-06-10 20:09:16 +02:00
Jonas Rudloff 62fedb388b fixed #552 2015-06-10 19:55:04 +02:00
Zach Riggle 20ea1e0a06 Add docs 2015-06-09 12:53:57 -04:00
Zach Riggle c3b006ef50 Add docs 2015-06-09 12:53:18 -04:00
Zach Riggle e082d441d2 Fix doctest 2015-06-09 12:51:46 -04:00
Zach Riggle 14093c2d54 Fix doctest 2015-06-09 12:51:37 -04:00
Zach Riggle c21426e3a0 Don't modify original representation 2015-06-09 12:49:21 -04:00
Zach Riggle af466424ee Don't modify original representation 2015-06-09 12:49:04 -04:00
Zach Riggle 3c188bc27e Enable disassembly with stripping the offsets and columns 2015-06-09 12:47:08 -04:00
Zach Riggle 6034b2b312 Enable disassembly with stripping the offsets and columns 2015-06-09 12:45:06 -04:00
Zach Riggle ff5f634a76 Add sockaddr changes from upstream 2015-06-09 12:04:08 -04:00
Zach Riggle af9fe4c0d2 Merge pull request #26 from binjitsu/constants
Use complex constants
2015-06-08 14:17:28 -04:00
Zach Riggle 9b9ae29a71 Fix arm shellcode 2015-06-08 14:01:03 -04:00
Zach Riggle 62b3964225 Fix thumb shellcode 2015-06-08 13:56:42 -04:00
Zach Riggle cec172ee9b Use complex constants 2015-06-07 02:35:28 -04:00
Zubin Mithra b349eaff6f Add in ARM support for SROP 2015-06-06 12:24:41 +02:00
Zubin Mithra dfa96abb09 Merge branch 'master' of http://github.com/binjitsu/binjitsu 2015-06-06 03:40:16 +02:00
Zach Riggle 8922d369e9 Allow lookups of libraries running under qemu-user by walking /etc/qemu-binfmt 2015-06-01 12:59:36 -07:00
Zach Riggle 043232336f Added docs for ELF.libc 2015-06-01 12:40:08 -07:00
Zach Riggle ffa321103b Add automatic extraction of libc.so 2015-06-01 12:39:01 -07:00
Zach Riggle 4ac5bce80e Enable .libs detection for alternate-architecture libraries when run via qemu-user. 2015-06-01 12:35:44 -07:00
Morten Brøns-Pedersen dfe4d2c280 Merge pull request #548 from Gallopsled/ua-license
(hopefully) fixes #547
2015-05-30 09:55:59 +02:00
Morten Brøns-Pedersen d5dae58737 Update LICENSE.txt
Removed irrelevant information.
2015-05-30 09:55:34 +02:00
Zach Riggle 9cf7e8f7e7 More more more verbose 2015-05-29 14:38:47 -04:00
Zach Riggle b7731b32e5 Verbose logging for Shippable troubleshooting 2015-05-29 14:37:14 -04:00
Zach Riggle eec0b68b52 Update docs [skip ci] 2015-05-29 14:34:45 -04:00
Zach Riggle e1331055ae Detect if current user is travis, for Shippable 2015-05-29 14:33:28 -04:00
Morten Brøns-Pedersen b9bf5982f6 (hopefully) fixes #547 2015-05-29 09:35:42 +02:00
Zach Riggle 2b909824b8 Compress debug send/recv output if it's the same byte 2015-05-28 17:56:06 -04:00
Morten Brøns-Pedersen f97045be7c added pwnlib.util.packing.dd inspired by the command line util of the same name 2015-05-28 10:49:17 +02:00
eQuiNoX__ f9d080141f Commit code that sets the esp to the next gadget 2015-05-27 12:38:31 +02:00
Jonas Rudloff ee0ace9aeb Merge pull request #544 from binjitsu/dealarm
Add dealarm_shell
2015-05-27 10:54:11 +02:00
Jonas Rudloff 31e93128d1 Merge pull request #528 from binjitsu/libcdb
Add code for libcdb lookups
2015-05-26 17:21:59 +02:00
Morten Brøns-Pedersen 27daa1291a Merge pull request #545 from Gallopsled/fit-docs
updated docstring for `pwnlib.util.packing.fit` and added a check tha…
2015-05-26 14:39:27 +02:00
Morten Brøns-Pedersen 2b4ba2e31c updated docstring for pwnlib.util.packing.fit and added a check that the data actually fits 2015-05-26 09:33:50 +02:00
Zach Riggle 00d9460422 Show a better error message when connecting to an unknown host 2015-05-25 16:15:27 -04:00
Zach Riggle 734591dd84 Add dealarm_shell 2015-05-22 20:50:13 -04:00
Zach Riggle 525f35c143 Fix/optimize dealarm 2015-05-22 20:50:01 -04:00
Zach Riggle b36bd7ace5 Add dealarm_shell 2015-05-22 20:46:19 -04:00
Zach Riggle 6d2ac263df Compress debug send/recv output if it's the same byte 2015-05-22 20:32:46 -04:00
Zach Riggle bb5ea7677c Fix sockaddr, optimize off some zero bytes 2015-05-22 19:54:46 -04:00
Zach Riggle 866f4762ef Remove lookup in .resolve(), add .libc() 2015-05-21 13:30:03 -04:00
Jonas Rudloff 1d251adec5 Merge pull request #523 from binjitsu/push-fix
Fix push() templates
2015-05-21 11:39:58 +02:00
Jonas Rudloff 0fd0677af0 fix travis 2015-05-21 10:51:33 +02:00
Jonas Rudloff a3d7215162 Merge pull request #500 from binjitsu/gdb-enhancements
Add gdb.debug_shellcode and fix cross-arch debugging with qemu-user
2015-05-21 10:08:08 +02:00
Jonas Rudloff 6f23067894 Merge pull request #534 from Gallopsled/terminal-detection
Changed `util.misc.run_in_terminal` to first look for tmux, and then X11
2015-05-21 10:06:46 +02:00
Jonas Rudloff 77a59681b9 Merge pull request #517 from binjitsu/complex-constants
Implement complex constants
2015-05-21 10:05:40 +02:00
Jonas Rudloff 222f0b9474 Merge pull request #535 from Gallopsled/hexdump-highlight
Hexdump highlight
2015-05-21 10:03:27 +02:00
Jonas Rudloff 64f95f5b19 Merge pull request #537 from Gallopsled/iters-exp
added ``iters.exp(s, n)`` as an alias for ``iters.product(*[s]*n)``.
2015-05-21 10:02:47 +02:00
Jonas Rudloff da0bbefb84 Merge pull request #538 from Gallopsled/packing-fit
added `util.packing.fit`
2015-05-21 10:01:49 +02:00
Jonas Rudloff 4ef299a888 Merge pull request #539 from Gallopsled/ui-yesno
added `ui.yesno`
2015-05-21 10:00:47 +02:00
Jonas Rudloff 4aeea41362 Merge pull request #540 from Gallopsled/minor-term-fix
fixes some minor CRLF/LF-issues in `term.term`
2015-05-21 09:59:23 +02:00
Zach Riggle ce458c7fc0 Update docstring [skip ci] 2015-05-20 23:31:16 -04:00
Zach Riggle 329ef332b4 Fix docstring 2015-05-20 23:28:26 -04:00
Zach Riggle 5c0d5132e2 Add DynELF.libc() function 2015-05-20 23:23:55 -04:00
Zach Riggle 06fc1eecd5 Make Call() pretty printing... prettier 2015-05-20 23:21:09 -04:00
Zach Riggle 79c718aa43 Update docstring 2015-05-20 22:59:53 -04:00
Zach Riggle d99f7160bf Integrate new ROP building tools 2015-05-20 22:41:13 -04:00
Zach Riggle de4f14c5d2 Fix up call(0x1234,..) and .migrate 2015-05-20 21:52:19 -04:00
Zach Riggle b064c45d5e Add "cat" shellcode 2015-05-20 21:48:00 -04:00
Morten Brøns-Pedersen fa8df31c4f removed a print-statement left from debugging 2015-05-21 01:08:57 +02:00
Morten Brøns-Pedersen 9effbad62e updated doctests for pwnlib.util.packing.fit 2015-05-20 23:50:23 +02:00
Morten Brøns-Pedersen 4bf8b71707 Happy now, Travis? 2015-05-20 23:48:02 +02:00
Morten Brøns-Pedersen 1b3e9984f4 fixed typo in docstring for pwnlib.util.iters.exp 2015-05-20 13:55:00 +02:00
Morten Brøns-Pedersen ceca7b5384 fixed doctest in pwnlib.util.iters.exp 2015-05-20 13:39:12 +02:00
Morten Brøns-Pedersen 156db1aea9 fixes some minor CRLF/LF-issues in term.term 2015-05-20 12:22:05 +02:00
Morten Brøns-Pedersen 26c99083bd added ui.yesno 2015-05-20 12:18:11 +02:00
Morten Brøns-Pedersen 3ae7d9ec9a added util.packing.fit 2015-05-20 12:14:58 +02:00
Morten Brøns-Pedersen 011c7d96a2 added `iters.exp(s, n) as an alias for iters.product(*[s]*n)`. 2015-05-20 12:08:59 +02:00
Morten Brøns-Pedersen 1447c361b0 Better default terminal in util.misc.run_in_terminal
Changed to detect X11 by the presence of the ``DISPLAY`` environment variable.  Also added the field `terminal` to `context`, which allows the user to specify a default terminal.
2015-05-20 11:50:49 +02:00
Zach Riggle 5064a75f1f Fix str() and dump() 2015-05-18 13:25:13 -04:00
Zach Riggle 2e4692ff22 Add log.info since it wont show up otherwise 2015-05-17 10:05:39 -04:00
Zach Riggle 3b9614a535 WIPWIPWIP 2015-05-16 07:55:49 -04:00
Zach Riggle 4acd9bc928 WIPWIPWIP 2015-05-16 00:21:54 -04:00
Zach Riggle da475754fe Enable flat(-1) 2015-05-15 18:35:54 -04:00
Zach Riggle e2ddcf2471 Dont lose any more work 2015-05-15 15:13:22 -04:00
Zach Riggle 40dae903cc Example for context and cleanliness 2015-05-13 18:13:48 -04:00
Zach Riggle eecafc6ed6 Add @LocalContext decorator 2015-05-13 18:02:43 -04:00
eQuiNoX__ 32e85f5791 We dont store the registers inside srop; we just call get_registers when we need them 2015-05-13 22:33:40 +02:00
eQuiNoX__ e58a661375 The following changes were made :-
- changed usage of "self.arch to with context.local..."
2015-05-13 22:29:26 +02:00
eQuiNoX__ 9eadd74bed get_regpos_mapping removed 2015-05-13 22:07:53 +02:00
eQuiNoX__ 525650bc5b The following changes were made :-
- rop.py does not import _registers_* anymore; instead imports get_registers from srop.py
- rop.py now has a self.arch that is set to context.arch inside __init__
- (_registers_32, _registers_64) => (_registers_i386, _registers_amd64)
- get_registers and get_regpos_mapping added in
- _initialize_values now handles all archs
- get_stackpointer_index changed to get_spindex; made cleaner
- get_frame made cleaner
2015-05-13 22:06:57 +02:00
Morten Brøns-Pedersen c9e5a01605 Updated pdh to support highlighting of byte sequences 2015-05-13 15:21:41 +02:00
Morten Brøns-Pedersen cd4a193404 pwnlib.util.fiddling.hexdump can now highlight byte sequences (with wildcards) 2015-05-13 15:20:31 +02:00
Morten Brøns-Pedersen 94e0064c19 Changed util.fiddling.hexdump_iter to take a file object instead of a string. This massively speeds up phd <file> | less for huge files. 2015-05-13 11:06:38 +02:00
Zach Riggle d3e73d231b Merge pull request #16 from eQu1NoX/master
Initial set of commits integrating SROP with ROP
2015-05-13 00:19:22 -04:00
eQuiNoX__ d7933badf2 Add in the skeleton of integrating SROP with ROP
So now we can populate the accumulator register with the sigreturn syscall number

rop.py now finds "int 0x80" instructions.

Adding in more to srop skeleton; integrating with finding int 0x80 instruction

The following changes were made :-
- s/find/index correction for list
- required imports added in
- None as argument removed

Now generates srop frames whenever function cannot be resolved

Add in code that pivots only if the gadget is not a "pop"

dump is now modified to print out the register information from srop

Uses constants.linux.i386 for syscall numbers now

Added in some exception handling code

Rely on constants to get us the right syscall number based on context.arch

The following changes were made :-
- getattr when getting syscall_number now returns None by default
- ropgadget now looks for syscall and sysenter
- added in getattr("syscall") and getattr("sysenter")

rop.search now returns a namedtuple

The following changes were made :-
1. self.int80, self.syscall and self.sysenter now return namedtuples.
2. We have functions self.raw_address and self.raw_data to specify
   how the raw values that are added in, need to be interpreted so that
   the chain can be built accordingly.

Added in a function _get_syscall_inst that returns the address of a syscall instruction

Checking if travis builds it properly/

The following changes were made :-
- Change the body of _get_syscall_inst, make it cleaner
- Add in a self._syscall_instruction that caches the address of
  a syscall instruction that was found

Removed raw_address and raw_data; modified srop implementation to use raw()

Cleanup getattr

Now the stack pointer is modified so that we can continue constructing the ROP chain if rop.base is specified

No need of enumerate; removed

doctest for rop-srop integration added in
2015-05-13 03:53:03 +02:00
Zach Riggle e4d44c54d8 Detect fortify-source 2015-05-12 02:08:35 -04:00
Zach Riggle c5ec095b7f Fix debugging of thumb shellcode 2015-05-09 15:42:06 -07:00
Zach Riggle 476e8991ca Fix debugging of thumb shellcode 2015-05-09 15:37:58 -07:00
Zach Riggle 6e4f616c44 Allow debugging of thumb shellcode 2015-05-09 15:34:33 -07:00
Zach Riggle ffc44ece88 Fix write-ups link
Closes #15
2015-04-28 17:20:35 -04:00
Jonas Rudloff 0dafc5d02d Merge pull request #524 from binjitsu/packing-autodetect-sign
Enhancements to packing to allow auto-detection of sign, as well as unpack bytearray objects
2015-04-28 13:50:51 +02:00
Jonas Rudloff 3807889f33 Merge pull request #530 from teroz/master
Added clarity to the pwnlib.cyclic example
2015-04-28 09:37:18 +02:00
Zach Riggle 40db24653c Merge pull request #13 from eQu1NoX/master
Adding in doctests + renaming x86/x64 to i386/amd64
2015-04-27 11:24:49 -04:00
Jonas Rudloff 421ca7f82e Merge pull request #532 from Gallopsled/br0ns-fix-531
Quickfix for bpython
2015-04-27 11:09:53 +02:00
Zubin Mithra 9908afd495 Adding in docs for sphinx
Dropping the doctest ifmain statements

Correct underline in rst

Add testsetup to srop.rst

Now uses packing.pack instead of struct.pack

Added in context.arch information to srop.rst and srop.py doctest

Added "context.clear()" to the doctest

Cleaned up _reg_pos_mapping up a bit

Corrected reference link

Replace "print repr()" with "unpack_many"

Added in import to srop.rst
2015-04-27 10:24:26 +02:00
Morten Brøns-Pedersen 4e00935630 Quickfix for bpython
Fixes #531
2015-04-26 21:17:34 +02:00
eQuiNoX__ f81993c303 The following changes were made :-
1. Added in doctests for i386 and amd64.
2. Renamed x86/x64 to i386/amd64.
2015-04-26 13:56:41 +02:00
Zach Riggle 3b9e9bf3a0 Merge pull request #9 from eQu1NoX/master
Initial commit adding in SROP support for x86 and x64
2015-04-25 13:32:17 -04:00
Zach Riggle ebef41df05 Fix the architecture for mips646 ELFs 2015-04-25 10:26:33 -07:00
teroz 764da5af10 Added clarity in the pwnlib.cyclic example
modified:   docs/source/intro.rst
2015-04-25 13:06:21 +02:00
eQuiNoX__ 9f5c2e77b8 Renamed the registers a bit, made the example a bit more complete 2015-04-25 08:15:16 +02:00
eQuiNoX__ 116491c54c Rename registers, add references 2015-04-25 08:09:04 +02:00
eQuiNoX__ 285a370378 Add comments for the SigreturnFrame class 2015-04-25 07:41:53 +02:00
Zubin Mithra 9da1c64513 Removed unused imports 2015-04-24 20:54:56 +02:00
Zubin Mithra 8845115b1f Initial commit for adding in SROP support for x86 and x64 2015-04-24 20:50:26 +02:00
Zach Riggle 6f22a11559 Make ELF work with mips64 binaries 2015-04-24 06:00:09 -07:00
Zach Riggle b7ce1b4ccd Fix mips64 2015-04-24 05:27:23 -07:00
Zach Riggle 19f4009b6e Switch from single-arg "arch" to local context 2015-04-24 04:05:29 -07:00
Zach Riggle 17b0d4efe6 Remove redundant info from checksec, realign fields 2015-04-23 21:49:04 -07:00
Zach Riggle 2077846087 Fix newlines at EOF 2015-04-21 02:43:08 -07:00
Zach Riggle b43be94aaa Add undocumented flag to prevent ASLR from being disabled 2015-04-18 19:58:35 -04:00
Zach Riggle 8a671ac1a7 Switch to GitLab since they have a 10GB quota. Add error handling :) 2015-04-17 01:22:44 -04:00
Zach Riggle 8e799d0516 Switch to GitLab since they have a 10GB quota. Add error handling :) 2015-04-17 01:22:30 -04:00
Zach Riggle c503c9c7d5 Respect timeout for wget 2015-04-16 14:27:47 -04:00
Zach Riggle 59537cac6d Add missing architectures 2015-04-16 01:22:03 -04:00
Zach Riggle 34bfd261ca Fix unknown architectures throwing exceptions on GOT/PLT failure. Hide RWX comment if NX is disabled. 2015-04-16 01:22:03 -04:00
Zach Riggle f752a5d474 Miscellaneous bug fixes and enhancements from Binjitsu which are required for this feature to work. 2015-04-16 01:22:03 -04:00
Zach Riggle ad05fda608 Add missing architectures 2015-04-16 01:18:07 -04:00
Zach Riggle 402e324725 Fix unknown architectures throwing exceptions on GOT/PLT failure. Hide RWX comment if NX is disabled. 2015-04-16 01:08:01 -04:00
Zach Riggle d81e63f03d Remove unneeded fields 2015-04-16 00:25:55 -04:00
Zach Riggle 7d3147958f Add code for libcdb lookups 2015-04-16 00:25:39 -04:00
Zach Riggle fcd04a5c91 Add code for libcdb lookups 2015-04-16 00:14:49 -04:00
Zach Riggle 9d9b880954 i386 vs x86 fixup 2015-04-15 23:52:32 -04:00
Zach Riggle 38097d724f Add .buildid property to ELF 2015-04-15 20:58:13 -04:00
Zach Riggle 230cdafe31 ASM => ELF 2015-04-11 15:38:13 -07:00
Zach Riggle 27b7f15c9c Fix VMA for ASM 2015-04-11 15:38:13 -07:00
Zach Riggle 33ca18f931 Tell user if there are RWX segments 2015-04-09 21:05:14 -04:00
Zach Riggle 5f8ae0ef2d Allow passing in an ELF object or just a path 2015-04-09 20:52:38 -04:00
Zach Riggle 821b08240a Enable passing arguments to the marshalled function; use the same naming scheme as subprocess and pwnlib.tubes.process 2015-04-06 04:34:22 -04:00
Zach Riggle 40ea374001 Enable marshalling simple functions to the remote Python instance 2015-04-05 23:41:53 -04:00
Zach Riggle 7399918a54 By default, recv an ~= infinite number of lines 2015-04-05 23:41:42 -04:00
Zach Riggle 367af48420 Evidently whatever android-ndk uses to build binaries zeroes out sh_info for rel.plt 2015-04-02 17:56:55 -04:00
Zach Riggle 3745f6fd03 Round up mmap size; optionally skip loop after recv 2015-03-31 08:23:35 -04:00
Zach Riggle f643bf8722 Remove ~5 bytes from stager 2015-03-31 07:51:48 -04:00
Zach Riggle 580b16230e Add connect doctest 2015-03-31 07:51:39 -04:00
Zach Riggle ee9ffb7491 Revert "Enable is_register for all architectures"
This reverts commit 475c1d407f.
2015-03-31 06:08:52 -04:00
Zach Riggle 2aa6c1f015 Try to remove "Remote debugging from host" line 2015-03-31 06:07:02 -04:00
Zach Riggle 90b8e50d07 Fix argument order for gdb.debug to mimick gdb.attach 2015-03-31 05:23:13 -04:00
Zach Riggle 6802a2c17b Fix bug in gdb.debug which breaks "execute" argument 2015-03-31 05:18:52 -04:00
Zach Riggle 2faeefeaf0 Fix bug in gdb.debug which breaks "execute" argument 2015-03-31 05:17:19 -04:00
Zach Riggle 24e70378ca Enable using gdbserver for debug_shellcode; add run_elf helper 2015-03-30 14:39:03 -04:00
Zach Riggle b7364fe8ac Add context.native helper to determine if the target can be run without QEMU 2015-03-30 14:32:15 -04:00
Zach Riggle 475c1d407f Enable is_register for all architectures 2015-03-30 14:26:43 -04:00
Zach Riggle c9f0ec84d1 Output to ELF for shellcraft 2015-03-30 14:08:31 -04:00
Zach Riggle 8b1a3e73a1 Merge pull request #6 from cebrusfs/master
Use MOV and SYSCALL templates in acceptloop_ipv4 and mprotect_all
2015-03-29 18:13:13 -04:00
Zach Riggle c472d573f7 Update CONTRIBUTING.md 2015-03-29 17:59:56 -04:00
Zach Riggle 10ed1a2a68 Update CONTRIBUTING.md 2015-03-29 17:59:48 -04:00
Zach Riggle 8ec7faf879 Update CONTRIBUTING.md 2015-03-29 17:59:41 -04:00
Jonas Rudloff 94a07cc48c Merge pull request #525 from RobertLarsen/master
Added sockaddr structure generating function
2015-03-27 12:28:40 +01:00
Robert Larsen a7c902ec37 Added docstring. 2015-03-27 00:28:22 +01:00
Robert Larsen 17c9439536 Moved sockaddr function from packing to net. 2015-03-27 00:03:17 +01:00
Robert Larsen ccd225f257 Removed unneeded import. 2015-03-26 23:46:53 +01:00
Robert Larsen 974b0e7543 Added sockaddr code to i386 connect so that it also supports both ipv4
and ipv6.
2015-03-26 23:46:17 +01:00
Robert Larsen 61e3d3bf18 Moved sockaddr code to packing. Probably not the right place for it. 2015-03-26 23:09:57 +01:00
Zach Riggle 6278f9a94e Linux setup should install openssh server 2015-03-26 17:23:47 -04:00
Zach Riggle 25900adf72 Fix push() templates 2015-03-26 17:22:36 -04:00
Zach Riggle fa62f18378 Enhancements to packing to allow auto-detection of sign, as well as unpack bytearray objects
(cherry picked from commit 6a3e2591c29d5a176136b1e1e16b63de5b64160c)
2015-03-26 15:48:49 -04:00
Jonas Rudloff dd00e4cfef Merge pull request #520 from Gallopsled/memleak-struct
Memleak can now leak whole structures
2015-03-26 18:26:17 +01:00
Zach Riggle b8cc1cc831 Multiple enhancements to SSH
- Request a TTY by default, and disable echoing
	- This turns off stdout buffering
	- Only negative effect is that you lose Ctrl+C
- Further improvements to ssh.process to allow e.g. file handle dup'ing
- Greatly improved documentation of members/attributes
- Added .pid attribute to ssh_channel
- Uses SCP by default, falls back to old method of cat'ing files
- Switched to use exclusively SHA256 instead of multiple hashes.
	- We lose no flexibility or support
- Sorted imports
2015-03-26 02:16:00 -04:00
Zach Riggle de7d161a87 Fix push() templates 2015-03-26 02:12:47 -04:00
Zach Riggle 09d053be0f Update CONTRIBUTING.md 2015-03-25 15:44:10 -04:00
MengHuan Yu 9536b17e5a Fix the coding style in 2 shellcraft examples
Use 4 space indent in 'i386/linux/acceptloop_ipv4.asm' and
'i386/linux/mprotect_all.asm'

BUG=None
TEST=None
2015-03-26 01:41:50 +08:00
MengHuan Yu 2aeda2c993 Use PUSH template in acceptloop_ipv4
BUG=None
TEST=confirmed the behavior by strace.
2015-03-26 01:36:21 +08:00
MengHuan Yu 17c3a27861 Use MOV and SYSCALL templates in some shellcode
In this commit, I only fix 'i386/linux/acceptloop_ipv4.asm' and
'i386/linux/mprotect_all.asm'.

BUG=None
TEST=confirmed the behavior is still the same under
gdb and strace.
2015-03-25 23:48:20 +08:00
Robert Larsen 5214be49f0 Added function for generating a sockaddr structure for shellcodes. 2015-03-24 23:57:00 +01:00
Jonas Rudloff f5d3b4aac0 Merge pull request #512 from RobertLarsen/thumb-connect
Added connect shellcode for thumb/linux.
2015-03-24 21:02:32 +01:00
Jonas Rudloff eafdc0a13e Merge pull request #496 from binjitsu/asm-enhancements
General enhancements to ASM, add make_elf
2015-03-24 20:05:18 +01:00
Jonas Rudloff 007f362dc1 Merge pull request #497 from binjitsu/context-binary
Add context.binary helper
2015-03-24 20:03:46 +01:00
Jonas Rudloff b7a98c9971 Merge pull request #516 from binjitsu/arm-syscall
Arm syscall
2015-03-24 20:02:38 +01:00
Jonas Rudloff 71c6f3339a Merge pull request #515 from RobertLarsen/thumb-stager
Thumb stager
2015-03-24 20:02:29 +01:00
Jonas Rudloff c7890f79c9 Merge pull request #513 from binjitsu/this-file-is-outdated
Remove install_local.sh since it's outdated
2015-03-24 20:02:15 +01:00
Zach Riggle 36f1fc32e0 Ensure textual levels e.g. "debug" are translated to logging.DEBUG 2015-03-24 14:29:03 -04:00
Jonas Rudloff a2bab1ff6f Merge pull request #494 from binjitsu/tube-packing-shortcuts
Tube packing shortcuts
2015-03-24 18:54:23 +01:00
Jonas Rudloff b092b171f8 fixed documentation and whitespace 2015-03-24 18:40:41 +01:00
Jonas Rudloff 20f4b92fd0 Merge pull request #504 from binjitsu/shellcraft-enhancements-mov
Multiple enhancements to shellcraft
2015-03-24 14:29:51 +01:00
Jonas Rudloff 8c73bdc17d Merge pull request #491 from binjitsu/asm-vma-fix
Fix VMA for ASM
2015-03-24 14:19:57 +01:00
Jonas Rudloff a74aea025b Merge pull request #514 from binjitsu/shellcraft-completion-requires-sudo
Don't install shellcraft completion by default.  It requires sudo.
2015-03-24 14:19:42 +01:00
Jonas Rudloff 4c78c1674f Memleak can now leak whole structures 2015-03-24 12:22:42 +01:00
Robert Larsen 74fc4d0e22 Removed comment. 2015-03-23 21:50:37 +01:00
Robert Larsen 1b5145792b Use arm.syscall 2015-03-23 21:49:27 +01:00
Zach Riggle 9ca377c61c Multiple enhancements to shellcraft
- Refactor i386/amd64 mov code to use new register info
	- Mostly this is to clean up the code and remove things like bigger[0][-1]
- A small enhancement to the ARM shellcode
- Resolve hosts for i386.linux.connect
- Add arm.trap
- Add gethostbyname to i386.connect
2015-03-23 02:56:52 -07:00
Zach Riggle 0a6f1e540e Update README.md 2015-03-23 02:39:22 -04:00
Zach Riggle 2caafc879f Update README.md 2015-03-23 02:39:01 -04:00
Zach Riggle 425385e135 Mark .text area as RWX so that self-modifying code can be tested 2015-03-22 23:28:32 -07:00
Zach Riggle f30f2093b0 Less than, not shift 2015-03-22 23:22:47 -07:00
Zach Riggle fadfa11214 *Actually* Add mapping for i686 / 32-bit Linux 2015-03-22 23:18:35 -07:00
Zach Riggle 030407d8e7 Don't close e.g. stdin if dup'ing to it 2015-03-22 23:18:12 -07:00
Zach Riggle 0c513cb06b Mark .text area as RWX so that self-modifying code can be tested 2015-03-22 22:22:36 -07:00
Zach Riggle 2e0d7b8671 Fix output redirection based on filenames 2015-03-22 17:03:02 -07:00
Zach Riggle 14130f3b40 Implement complex constants
- Keep their name so that we have relevant info in shellcode
- Can be manipulated as integers as you'd expect
- Update generation scripts to emit new-style constants
2015-03-22 16:27:05 -07:00
fhare d761e78d91 Add syscall shellcode for arm.
(cherry picked from commit eb8a166659)
2015-03-22 15:54:25 -07:00
fhare cc9fc0b6b1 Add register validation and constant substitution in mov shellcode for arm.
(cherry picked from commit 16c7954e0a)
2015-03-22 15:54:19 -07:00
Zach Riggle 5004787cb9 Add mapping for i686 / 32-bit Linux 2015-03-22 14:58:58 -07:00
Robert Larsen 8021d2bc3c Branch to r8 instead of moving it. 2015-03-22 22:13:28 +01:00
Zach Riggle 1a55837bff Update .travis_install.sh 2015-03-22 06:07:39 -04:00
Zach Riggle c8c9e5d1ea Update .travis_install.sh 2015-03-22 06:07:19 -04:00
Zach Riggle 7387ed55a5 Don't install shellcraft completion by default. It requires sudo. 2015-03-22 05:26:09 -04:00
Zach Riggle 5e601ebd70 Remove install_local.sh since it's outdated 2015-03-22 05:23:59 -04:00
Robert Larsen f51feb0c85 Set condition flags. 2015-03-22 00:33:24 +01:00
Robert Larsen 7c1567bbce No error label. 2015-03-22 00:04:54 +01:00
Robert Larsen 8b823c813d Added stager for thumb/linux. 2015-03-22 00:03:02 +01:00
Zach Riggle 989e7694d8 Fix push and pushstr for ARM 2015-03-21 17:12:45 -04:00
Robert Larsen ce5052b415 Added connect shellcode for thumb/linux. 2015-03-21 21:47:44 +01:00
Zach Riggle f753382a4d Merge remote-tracking branch 'remotes/fhare/master' 2015-03-21 16:44:10 -04:00
Zach Riggle e5b3baae84 Keep link to binary in the cache 2015-03-21 16:32:32 -04:00
Jonas Rudloff 691fe6f1bc Merge pull request #511 from RobertLarsen/amd64-connect
Amd64 connect
2015-03-21 11:27:11 +01:00
Robert Larsen 0429c8c5c8 Added connect shellcode for amd64/linux. 2015-03-21 00:04:14 +01:00
Zach Riggle 1e8bf3e0e9 Remove share directory 2015-03-20 17:17:46 -04:00
Zach Riggle 3fe3502b30 Superficial changes to test CI build time 2015-03-20 17:09:57 -04:00
Zach Riggle 9905ba6605 Try absolute path 2015-03-20 17:09:08 -04:00
Zach Riggle 827d4e5f09 Superficial changes to test CI build time 2015-03-20 17:06:02 -04:00
Zach Riggle f8a64a69c1 Superficial changes to test CI build time 2015-03-20 17:03:15 -04:00
Zach Riggle 50451ceda6 Attempt caching site-packages so we dont rebuild capstone 2015-03-20 17:00:34 -04:00
Zach Riggle 1aff50166a Enable caching of binutils 2015-03-20 16:55:49 -04:00
Zach Riggle a8d02b5108 Enable caching of pip dependencies 2015-03-20 16:07:40 -04:00
Zach Riggle a46e7fdc06 Use container-based Travis CI so that it builds faster 2015-03-20 16:00:25 -04:00
Kristoffer Søholm e87f998c57 Merge pull request #509 from RobertLarsen/fix-doc
Fixed doc.
2015-03-20 17:14:15 +01:00
Robert Larsen 32162a734e Merge branch 'master' of https://github.com/RobertLarsen/pwntools 2015-03-20 15:03:15 +01:00
Robert Larsen 69fe228fd6 Merge branch 'master' of https://github.com/RobertLarsen/pwntools into fix-doc 2015-03-20 15:03:00 +01:00
Robert Larsen 28721dc876 Fixed doc. 2015-03-20 14:59:33 +01:00
Robert Larsen 881590dd3b Added stager for amd64/linux. 2015-03-20 14:56:38 +01:00
Robert Larsen 4905647807 Merge branch 'master' of https://github.com/Gallopsled/pwntools 2015-03-20 14:35:07 +01:00
Robert Larsen 470df7fa1e Added stager for amd64/linux. 2015-03-20 14:33:02 +01:00
Kristoffer Søholm 1bb9482c91 Merge pull request #508 from RobertLarsen/amd64-bindsh
Added bindshell shellcode for amd64/linux.
2015-03-20 13:39:24 +01:00
Kristoffer Søholm 25cff5f92b Merge pull request #492 from binjitsu/arm-mov-reg-reg
Enable mov reg, reg for ARM
2015-03-20 13:20:03 +01:00
Kristoffer Søholm 116df98a5e Merge pull request #493 from binjitsu/bugfix-pause
Fix bug in pause()
2015-03-20 13:17:10 +01:00
Robert Larsen 08fe08cd55 Merge branch 'master' of https://github.com/Gallopsled/pwntools 2015-03-20 13:08:09 +01:00
Kristoffer Søholm ed5229da8b Merge pull request #505 from RobertLarsen/amd64-findpeersh
Amd64 findpeersh
2015-03-20 12:57:54 +01:00
Robert Larsen aad286fbb4 Merge branch 'master' of https://github.com/Gallopsled/pwntools 2015-03-20 12:06:58 +01:00
Robert Larsen ef46969bce Merge branch 'amd64-bindsh' 2015-03-20 11:46:56 +01:00
Robert Larsen f1bd02e571 Merge branch 'amd64-findpeersh' 2015-03-20 11:46:34 +01:00
Robert Larsen 0da1aca8bb Fixed doc. 2015-03-20 11:46:12 +01:00
Robert Larsen 4b869e408b Added bindshell shellcode for amd64/linux. 2015-03-20 11:26:52 +01:00
Zach Riggle 9cdd76cde2 General enhancements to ASM, add make_elf
- Sorted imports
- We can now build whole, compact ELF files.
    - This is useful for e.g. ioarm level 1
- Various fixes for endianness support, bit sizes when assembling
- Don't catch KeyboardInterrupt
2015-03-20 05:07:15 -04:00
Zach Riggle 15426e410f Add context.binary helper 2015-03-20 05:06:35 -04:00
Robert Larsen ed1eaf2a37 Merge pull request #486 from zachriggle/patch-3
Change IRC channel to #pwntools
2015-03-20 09:50:29 +01:00
Robert Larsen 5c8f64e5f6 Merge pull request #429 from zachriggle/patch-1
Update LICENSE-pwntools.txt
2015-03-20 09:49:53 +01:00
Robert Larsen 6c44b36750 Merge pull request #495 from binjitsu/elf-arch-fixes
Various enhancements to ELF
2015-03-20 09:43:29 +01:00
Robert Larsen 83da6ef918 Document constant. 2015-03-20 09:22:44 +01:00
Robert Larsen a0e18aa58a Set the length of the address structure. 2015-03-20 09:16:05 +01:00
Zach Riggle dfcf26f37a Use setsid instead of setpgrp to capture output to /dev/tty 2015-03-19 17:16:35 -04:00
Zach Riggle 50ac72d8eb Use setsid instead of setpgrp to capture output to /dev/tty 2015-03-19 17:15:37 -04:00
Robert Larsen ce9f47a009 Closer to working solution. 2015-03-19 16:00:32 +01:00
Robert Larsen e16d1e2883 Added file for implementing findpeer shellcode. 2015-03-19 00:07:30 +01:00
Robert Larsen 6e8940f051 Added template for implementing the shellcode. 2015-03-19 00:05:58 +01:00
fhare eb8a166659 Add syscall shellcode for arm. 2015-03-18 20:11:23 +01:00
fhare 16c7954e0a Add register validation and constant substitution in mov shellcode for arm. 2015-03-18 20:11:23 +01:00
Zach Riggle f0c4d5814a No isort 2015-03-18 14:33:07 -04:00
Zach Riggle d2f0cec56d Maybe now travis will be happy? 2015-03-17 23:19:16 -04:00
Zach Riggle 2b163fb7fb Sort imports 2015-03-17 19:01:34 -04:00
Zach Riggle b9c581b78c Revert i386 mov changes temporarily 2015-03-17 12:12:06 -07:00
Zach Riggle 290f17a408 Add optimization for values which are negatable 2015-03-18 14:49:49 -04:00
Zach Riggle f22537027f Fix bug in __repr__ and make mov recursive 2015-03-18 14:49:44 -04:00
Zach Riggle 342cf97099 Enhance asm and shellcraft with auto-debugging; add checksec command-line 2015-03-16 22:32:46 -07:00
Zach Riggle 5ddb4f4bda Add gdb.debug_shellcode and fix cross-arch debugging with qemu-user 2015-03-16 21:40:26 -07:00
Zach Riggle 9e2901e70f Merge remote-tracking branch 'gallopsled/master'
Conflicts:
	README.md
	pwn/toplevel.py
	pwnlib/__init__.py
	pwnlib/commandline/shellcraft.py
	pwnlib/shellcraft/__init__.py
	pwnlib/tubes/ssh.py
	pwnlib/util/iters.py
2015-03-16 21:38:57 -07:00
Zach Riggle 98c5b18e58 Enhance functionality in process
- Make stdout a PTY
	- This disables buffering on stdout
- Add options to specify how stdin/stdout/stderr are created
- Expose preexec_fn
- Protect the user from common Python-specific pitfalls
	- e.g. argv elements cannot contain or even end with '\x00'
2015-03-16 20:39:26 -07:00
Zach Riggle d38deb5ae7 Fix imports 2015-03-16 20:13:07 -07:00
Zach Riggle 8e14c3d488 Add context.binary helper 2015-03-16 20:09:49 -07:00
Zach Riggle 820c455b1a Various enhancements to ELF
- Better documentation
- Remove generally unused fields of checksec
- Better support for uncommon architectures
2015-03-16 19:09:49 -07:00
Zach Riggle 19fb739d24 Fix architectures, add more architectures, add better detection for GOT and PLT 2015-03-16 19:09:07 -07:00
Zach Riggle 2784ea58c9 Add mov reg,reg noop 2015-03-16 18:37:14 -04:00
Zach Riggle 7c9638b6df Enable mov reg, reg for ARM 2015-03-16 18:34:33 -04:00
Kristoffer Søholm 34767b08ef Merge pull request #488 from binjitsu/arch
Add missing architecture constants
2015-03-16 23:24:57 +01:00
Zach Riggle 2c5125a74c Add tube.flat
Conflicts:
	pwnlib/tubes/tube.py
2015-03-16 15:22:32 -07:00
Zach Riggle 143fca406a Add packing shortcuts
Conflicts:
	pwnlib/tubes/tube.py
2015-03-16 15:22:12 -07:00
Zach Riggle 0174b33714 Fix bug in pause() 2015-03-16 15:20:25 -07:00
Zach Riggle 7a1d62f2fb Fix bug in pause() 2015-03-16 15:19:58 -07:00
Zach Riggle 6d806cede3 Add tube.flat 2015-03-16 15:19:45 -07:00
Zach Riggle 41c7aeda31 Fix VMA for ASM 2015-03-16 16:47:01 -04:00
Zach Riggle 1fc1406895 Fix leak.raw 2015-03-15 05:32:15 -07:00
Zach Riggle 008b013542 Add packing shortcuts 2015-03-14 19:35:49 -07:00
Zach Riggle e485e5bc93 Add missing architecture constants 2015-03-13 10:44:55 -07:00
Zach Riggle beb07285d6 Add missing architecture constants 2015-03-13 10:41:16 -07:00
Zach Riggle 9a87c2032d Change IRC channel to #pwntools 2015-03-13 12:19:56 -04:00
Mathias Svensson 32b05024d3 Merge pull request #482 from Gallopsled/bruteforce_bugfix
Fixed bug in total_iterations calculation
2015-03-13 01:28:39 +01:00
Kristoffer Søholm 69023995d0 Fixed bug in total_iterations calculation 2015-03-12 20:16:42 +01:00
Kristoffer Søholm 31242554eb Merge pull request #461 from StevenVanAcker/master
multithreaded bruteforcing + bugfixes
2015-03-12 20:08:29 +01:00
Kristoffer Søholm eefe307724 Merge pull request #481 from RobertLarsen/cyclic_length
Made cyclic respect the '--length' argument when looking up.
2015-03-12 19:30:43 +01:00
Robert Larsen f80acf8437 Made cyclic respect the '--length' argument when looking up. 2015-03-12 14:47:37 +01:00
Zach Riggle 4fa6cc0649 Remove link info, put arch on one line 2015-03-12 00:52:06 -07:00
Zach Riggle c825e43ff2 Add linked/static, remove RUNPATH and RPATH if they're OK since it has never been useful 2015-03-12 00:49:44 -07:00
Zach Riggle 506815533a Streamline checksec 2015-03-12 00:24:28 -07:00
Zach Riggle b9951de394 Add documentation to ELF fields 2015-03-12 00:23:14 -07:00
Zach Riggle ca8f0b2f80 Add more info to checksec, and add bits as a property 2015-03-12 00:22:07 -07:00
Zach Riggle a39b9ef25b Add endianness info to checksec script 2015-03-12 00:17:22 -07:00
Zach Riggle 3cfbf0793d Add endianess to ELF 2015-03-12 00:16:41 -07:00
Zach Riggle fced987465 Add checksec command-line script 2015-03-12 00:12:42 -07:00
Zach Riggle 2530b1c586 Make isort happy 2015-03-12 00:02:17 -07:00
Zach Riggle 477d0f54bf Fix arguments 2015-03-12 00:02:17 -07:00
Zach Riggle acc4f64a4b Add asm debugging 2015-03-12 00:02:17 -07:00
Zach Riggle f7c3dae4e1 Add shellcraft debugging 2015-03-12 00:02:17 -07:00
Zach Riggle 38e4ada7ce Rework a bunch of the shellcode for readability. 2015-03-12 00:02:12 -07:00
Zach Riggle 8afb2b6d89 .sendline() should be call-able by itself 2015-03-11 20:30:18 -07:00
Zach Riggle 81c9565e4c Don't wait forever for the PID to show up, handle if there's an issue 2015-03-11 20:29:18 -07:00
Zach Riggle 15f1aeaafe Logging hack for tube sub-classes defined outside of pwnlib 2015-03-09 23:40:35 -07:00
Jonas Rudloff 1ddd80c53d Merge pull request #476 from Gallopsled/autofmtstr
Automated format string explotation
2015-02-27 11:05:29 +01:00
Jonas Rudloff d1ae931728 Better heuristic for leaking elf headers on page boundaries 2015-02-27 10:55:58 +01:00
Zach Riggle 820936ccbd Update README.md 2015-02-26 19:08:07 -05:00
Mathias Svensson 5c0fafc4c9 Merge pull request #480 from binjitsu/issue-442
Fix mis-reporting of NX when there is no GNU_STACK segment
2015-02-26 22:13:36 +01:00
Zach Riggle cefac557d3 Fix mis-reporting of NX when there is no GNU_STACK segment
(cherry picked from commit a96ffc80a2)
2015-02-26 15:42:00 -05:00
Jonas Rudloff 58cc527687 Merge pull request #479 from binjitsu/pwntools-logo
Add logo
2015-02-26 21:37:36 +01:00
Jonas Rudloff ba395ab357 Merge pull request #451 from binjitsu/shellcraft-speedup
Speed up shellcraft loading and clean up code a bit
2015-02-26 21:28:46 +01:00
Jonas Rudloff dc7f4dcff5 fixed logging 2015-02-26 13:22:58 +01:00
Jonas Rudloff bb96f4982c Merge pull request #478 from binjitsu/pwntools-ssh-cwd-executable
Set +x on the directory created via ssh.set_working_directory
2015-02-26 12:56:25 +01:00
Zach Riggle 6e0852baf5 Add logo 2015-02-26 06:31:33 -05:00
Zach Riggle 6499a63bfb Add logo with text 2015-02-26 05:01:58 -05:00
Zach Riggle c2c3aec1c8 Update LICENSE-binjitsu.txt 2015-02-26 04:46:01 -05:00
Zach Riggle 70c34aab2a Update LICENSE-binjitsu.txt 2015-02-26 04:44:51 -05:00
Zach Riggle 3be0ee96a7 Add logo CC BY 2015-02-26 04:43:54 -05:00
Jonas Rudloff 7c0f23476d use pack instead of p32 2015-02-26 10:02:15 +01:00
Zach Riggle 6f8823829f Sort templates 2015-02-25 14:57:47 -05:00
Zach Riggle 71ecf70de6 Speed up shellcraft loading and clean up code a bit 2015-02-25 14:57:47 -05:00
Zach Riggle 1e062ac52b Merge branch 'pwntools' 2015-02-25 14:47:18 -05:00
Zach Riggle fb6b046d8d Merge commit '850efb5' 2015-02-25 14:42:32 -05:00
Zach Riggle b7dc9c934f Set +x on the directory created 2015-02-25 14:26:44 -05:00
Jonas Rudloff cb64e2d4aa Merge branch 'master' of github.com:Gallopsled/pwntools
Conflicts:
	pwnlib/tubes/ssh.py
2015-02-25 19:22:55 +01:00
Jonas Rudloff 8ac88d141c Merge branch 'binjitsu-ssh-run-system-rename' 2015-02-25 19:17:54 +01:00
Jonas Rudloff 8f92f07e62 Merge branch 'ssh-run-system-rename' of git://github.com/binjitsu/binjitsu into binjitsu-ssh-run-system-rename 2015-02-25 19:17:07 +01:00
Jonas Rudloff 0874e1908f fixed nbuckets -> nbucket in dynelf.py for sysv hash lookups
(cherry picked from commit c50d32d700)
2015-02-25 12:05:45 -05:00
Jonas Rudloff cbe13129db fixes bug in memleak.py
(cherry picked from commit 4a7d4fcff7)
2015-02-25 12:05:39 -05:00
Kenny 980d391b1f Fix #469 - verify search_results has items before using
(cherry picked from commit 8bd50f958c)
2015-02-25 12:05:35 -05:00
Jonas Rudloff 133d629bd3 Merge pull request #475 from Gallopsled/dynelf-fix
fix dynelf for sysv lookups
2015-02-25 13:42:39 +01:00
Jonas Rudloff 29889a00df Merge pull request #474 from Gallopsled/memleak-bug
fixes bug in memleak.py
2015-02-25 13:42:25 +01:00
Jonas Rudloff abc6360833 Update ssh.py
Use example.pwnme as hostname instead of localhost
2015-02-25 12:45:53 +01:00
Jonas Rudloff 75f48e74dd Merge pull request #444 from binjitsu/ssh-process-execve
SSH Process-style interface with full control over argv
2015-02-25 12:26:57 +01:00
Jonas Rudloff 017f5861ce Automated format string explotation 2015-02-25 12:11:40 +01:00
Jonas Rudloff c50d32d700 fixed nbuckets -> nbucket in dynelf.py for sysv hash lookups 2015-02-25 11:54:03 +01:00
Jonas Rudloff 28bd8fc3a7 Merge pull request #447 from zachriggle/patch-1
Update 'latest version' documentation since pip can install from git
2015-02-24 23:08:08 +01:00
Jonas Rudloff 31b84d7ba9 Merge pull request #471 from zachriggle/patch-2
Fix gdb.attach for foreign architectures
2015-02-24 22:59:34 +01:00
Zach Riggle 9d1756e99b More useful message on Administratively Prohibited 2015-02-24 16:34:06 -05:00
Jonas Rudloff de50da1849 Merge pull request #463 from binjitsu/capstone3
Update dependency versions
2015-02-24 22:28:03 +01:00
Jonas Rudloff 5a36d7fdc6 Merge pull request #464 from binjitsu/proc-pty-stdout
Set stdout to be a PTY on spawned processes so that stdout is not buffered
2015-02-24 22:25:49 +01:00
Jonas Rudloff 23eed9752c Merge pull request #460 from binjitsu/threading-event-wait
Enable a configurable timeout for recvall
2015-02-24 21:33:18 +01:00
Jonas Rudloff ef71b4c1ef Merge pull request #466 from binjitsu/mit-license-badge
Add MIT license badge
2015-02-24 21:32:12 +01:00
Jonas Rudloff ca9f918ac1 Merge pull request #470 from r3dey3/master
Fix #469 - verify search_results has items before using
2015-02-24 21:32:01 +01:00
Jonas Rudloff 12b2b127af Merge pull request #446 from binjitsu/sphinx-warnings
Squash most of the Sphinx warnings
2015-02-24 21:30:02 +01:00
Jonas Rudloff ea1cb8ad7a Merge pull request #439 from binjitsu/ssh-revamp-localhost-only
Restrict demouser for Travis to localhost only.
2015-02-24 21:27:27 +01:00
Jonas Rudloff 4a7d4fcff7 fixes bug in memleak.py 2015-02-23 20:28:19 +01:00
Zach Riggle cb163e7662 Add install message [skipci] 2015-02-21 12:27:22 -08:00
Zach Riggle fdae85c991 Check for Python development headers 2015-02-21 12:25:46 -08:00
Zach Riggle f171539d83 Include error number 2015-02-21 11:42:47 -08:00
Zach Riggle 44f881b742 Handle when there's no known_hosts or config for SSH 2015-02-21 11:28:18 -08:00
Zach Riggle cc6ca79a45 Add tox 2015-02-21 11:24:31 -08:00
Zach Riggle 9332812af1 tox.ini 2015-02-21 10:27:15 -08:00
Zach Riggle 3f23a8a63a Add missing linker flag 2015-02-21 10:12:27 -08:00
Zach Riggle 35ef86b189 Update ssh.process to use sh_string instead of creating a temporary file 2015-02-21 08:36:46 -08:00
Zach Riggle 5962bca201 Require tox 2015-02-21 08:13:53 -08:00
Zach Riggle 0c8935fc8c make clean should rmeove all temporary files 2015-02-20 16:32:01 -08:00
Zach Riggle 5e1447f8b4 When an exception is thrown on teardown, _run_handlers doesn't exist anymore 2015-02-20 16:27:35 -08:00
Zach Riggle 9ec1ea0852 Add useragents to packaged files; require recent pip 2015-02-20 16:26:40 -08:00
Zach Riggle b54d2dfa47 Pretty please? 2015-02-20 13:50:51 -08:00
Zach Riggle 547e8df98a Fix doctests 2015-02-20 13:39:12 -08:00
Zach Riggle ef74b64e86 Update test suite instructions 2015-02-20 13:30:51 -08:00
Zach Riggle 886e49bd1c Fix architectures between GDB and QEMU; auto-set endianness 2015-02-20 10:06:33 -08:00
Zach Riggle 42486c7a76 Add missing newlines to script 2015-02-19 17:51:32 -08:00
Zach Riggle 57eaede85b Add format argument 2015-02-19 17:50:52 -08:00
Zach Riggle 0ad8649599 Make default arguments a bit more explicit 2015-02-13 11:01:57 -08:00
Zach Riggle 8c183ac0e3 Fix regression which would cause ././binary to be invoked 2015-02-13 11:00:17 -08:00
Zach Riggle c0002895c8 Add an example for dup2ing 0 to 2 because subprocess tries to protect you from this 2015-02-13 10:57:55 -08:00
Zach Riggle a92260d9e5 Add preexec_fn 2015-02-13 10:46:40 -08:00
Zach Riggle b7743546b6 Fix log statements 2015-02-12 21:26:50 -08:00
Zach Riggle 75d260cd77 Add better documentation 2015-02-12 19:40:18 -08:00
Zach Riggle fc4abbf395 Add documentation for process and add shell=True doctest 2015-02-12 19:29:16 -08:00
Zach Riggle a5c8aa31a5 Default arg update 2015-02-12 19:13:16 -08:00
Zach Riggle 9e90e0485c Add file descriptors and documentation to ssh.process 2015-02-12 19:09:28 -08:00
Zach Riggle 1a1afabb23 Better fix for interactive() on raw TTYs 2015-02-12 10:24:35 -08:00
Zach Riggle 37ea0e8882 Remove extra print [skip ci] 2015-02-12 10:24:35 -08:00
Zach Riggle f3237586a5 Add warning message for no gdb-multiarch 2015-02-12 11:18:46 -05:00
Zach Riggle 324ef12b29 Revert PPA link; 2015-02-12 10:50:51 -05:00
Zach Riggle 3b659cc8ec Version fail 2015-02-12 10:48:22 -05:00
Zach Riggle 99aa19f332 Slightly better error message 2015-02-12 10:47:46 -05:00
Zach Riggle c623661f06 --upgrade 2015-02-12 10:47:00 -05:00
Zach Riggle 1d165fbde4 Evidently old versions of Git dont like Cloudflare 2015-02-12 10:37:41 -05:00
Zach Riggle a7816bde40 Change URLs to binjit.su, version to "master" 2015-02-12 10:06:55 -05:00
Zach Riggle de8de2d187 Add unit test for make_elf 2015-02-12 04:39:51 -08:00
Zach Riggle 3df64b6c80 Fix parsing ~/.ssh/config. Removes need for ssh_agent for tests. 2015-02-12 04:36:07 -08:00
Zach Riggle 84fc6a37e3 Use .string since it's easier to compare to Python 2015-02-12 03:52:51 -08:00
Zach Riggle a2fb187c2a Import everything from asm in __all__ 2015-02-12 03:25:15 -08:00
Zach Riggle 8a915a59e7 Fix gdb.attach(arch=...) and add gdb.debug_shellcode 2015-02-12 03:19:51 -08:00
Zach Riggle ea88f746a1 Fix pidof for sockets 2015-02-12 03:17:22 -08:00
Zach Riggle 33c47c159c Enable xor on integers, use default packing 2015-02-12 03:16:56 -08:00
Zach Riggle 0d544d96c8 Add message to ssh setup. Required because ssh-agent env vars must persist in parent shell. 2015-02-12 02:44:43 -08:00
Zach Riggle b9ac583e8a Fix CRLF in ssh.ssh_channel.interactive() when tty=True 2015-02-12 02:38:22 -08:00
Zach Riggle b9cb550856 Fix gdb.attach for foreign architectures 2015-02-10 08:24:45 -05:00
Zach Riggle 7e46c36965 Only show build state for Master branch 2015-02-09 05:07:45 -05:00
Kenny 8bd50f958c Fix #469 - verify search_results has items before using 2015-02-08 15:58:22 -05:00
Zach Riggle 0c9d345c37 Don't change anything at all if shell=True 2015-02-06 05:32:36 -08:00
Zach Riggle b28299a96e Style 2015-02-06 05:32:19 -08:00
Zach Riggle f6dab8cb94 Documentation on pty and tty.setraw 2015-02-06 05:30:33 -08:00
Zach Riggle ab3e58be59 Style, typos 2015-02-06 05:27:17 -08:00
Zach Riggle 068a5915b8 Clean up process tube and add member documentation 2015-02-06 05:02:48 -08:00
Zach Riggle 48ccd3dbe6 Make set_working_directory a bit faster 2015-02-05 20:24:09 -08:00
Zach Riggle 4f1bae8748 Less verbose 2015-02-05 20:18:24 -08:00
Zach Riggle 5ed9d4e2a9 Make the interfaces to process() and ssh.process() a bit more robust and fault-tolerant 2015-02-05 19:53:15 -08:00
Zach Riggle 87d12970f6 Update docs about Capstone.
It builds itself for 3.0.1+ and no longer has dependencies outside of the pip-intallable stuff
2015-02-05 09:07:07 -08:00
Zach Riggle 131e669246 Remove outdated script 2015-02-05 08:53:18 -08:00
Zach Riggle 41f003464b Merge pull request #1 from binjitsu/web-doctests
Make doctests cleaner
2015-02-05 11:52:28 -05:00
Zach Riggle b436d4a99a isort requirement 2015-02-05 04:49:50 -08:00
Zach Riggle b689dc6141 Add MIT license badge [noci] 2015-02-05 04:48:28 -08:00
Zach Riggle 9047360dd6 Add align_up alias 2015-02-05 04:48:28 -08:00
Zach Riggle 339c71abbd sorted imports with isort 2015-02-05 04:48:25 -08:00
Zach Riggle 38a080022d Add MIT license badge 2015-02-05 04:31:25 -08:00
Zach Riggle c1308f454f Enhancements to packing to allow auto-detection of sign, as well as unpack bytearray objects
(cherry picked from commit 6a3e2591c29d5a176136b1e1e16b63de5b64160c)

Conflicts:
	pwnlib/util/packing.py
2015-02-05 02:47:57 -08:00
Zach Riggle bfd1c74ef6 Wait for close on unit test 2015-02-05 01:56:14 -08:00
Zach Riggle 2ec8647d10 Wait for close on unit test 2015-02-05 01:56:03 -08:00
Zach Riggle 96f07f950c Actually save the keys 2015-02-05 01:29:57 -08:00
Zach Riggle acaaf2bf98 Enforce SSH keys for IP 2015-02-05 01:15:22 -08:00
Zach Riggle f1b5df6d99 Enhance test for process tube 2015-02-05 00:19:51 -08:00
Zach Riggle 5e4fa7c03d Enhance test for process tube 2015-02-05 00:15:25 -08:00
Zach Riggle 1a69412209 Handle IOError, and ensure Ctrl+C sent to parent process does not propagate to child
(cherry picked from commit 99cae63745)

Conflicts:
	pwnlib/tubes/process.py
2015-02-05 00:10:54 -08:00
Zach Riggle 99cae63745 Handle IOError, and ensure Ctrl+C sent to parent process does not propagate to child 2015-02-05 00:10:00 -08:00
Zach Riggle d194dfd8ce Set stdout to be a PTY on spawned processes so that stdout is not buffered.
(cherry picked from commit 1273bfa1fb)

Conflicts:
	pwnlib/tubes/process.py
2015-02-04 23:58:28 -08:00
Zach Riggle 2c5ea17ddb Merge remote-tracking branch 'origin/capstone3'
Conflicts:
	docs/source/install.rst
2015-02-04 23:52:51 -08:00
Zach Riggle 1273bfa1fb Set stdout to be a PTY on spawned processes so that stdout is not buffered. 2015-02-04 23:51:23 -08:00
Zach Riggle 226e4b73a6 Have capstone install itself
Specify versions of all requirements.  Had some complaints about old psutils, and this will cause new installs to upgrade.

Update Capstone installation docs.  The 3.0.1 target is self-installing.

Avoid Travis CI build time penalty by using older, pre-built Capstone 2.1
2015-02-05 02:10:46 -05:00
Zach Riggle 9d25c526e9 Add --address to disasm 2015-02-02 21:46:25 -08:00
Zach Riggle 34c4843bbf Make gadget loading faster by saving the original addresses and fixing up at runtime 2015-02-02 21:46:11 -08:00
Zach Riggle 4616f9f107 Fix indentation of docstrings 2015-02-02 04:22:55 -08:00
Zach Riggle 12fe3d310a Fix download_file regression and fix spinners 2015-02-02 04:22:37 -08:00
Zach Riggle 24661aa6e7 Fix isEnabledFor 2015-02-02 03:22:32 -08:00
Steven Van Acker 51e5ee5bf2 support for multithreaded bruteforcing 2015-02-02 12:12:18 +01:00
Zach Riggle 1b5c6162d1 Merge branch 'ssh-upgrades' 2015-02-02 03:01:02 -08:00
Zach Riggle e17e9c8b43 Fix issue where "tar -C /tmp" will fail if /tmp is not +r (enumeratable) 2015-02-02 02:56:37 -08:00
Zach Riggle a9e535eef6 Revamp download_dir (did it ever work?) and add "download" alias 2015-02-02 02:56:37 -08:00
Zach Riggle dfe78552c3 Add upload and put aliases/helpers 2015-02-02 02:56:37 -08:00
Zach Riggle 16dadb3376 Rewrite the upload functionality 2015-02-02 02:56:33 -08:00
Zach Riggle 054b7a5b17 Allow ~/foo in ssh.upload_dir 2015-02-02 00:47:41 -08:00
Zach Riggle 3eccae29d8 Only print checksec info once per ELF 2015-02-01 21:10:45 -08:00
Zach Riggle 37e29db87a Clean up SSH cache to only use SHA256. Additionally ssh.libs() now returns the original binary as well. Currently, the address is set to zero. 2015-02-01 21:09:21 -08:00
Steven Van Acker 112b65f8e9 fixing documentation of bruteforce() 2015-02-01 23:50:28 +01:00
Steven Van Acker 890db20b27 fixing order of arguments for consume(), so that bruteforce() works when start is specified 2015-02-01 11:54:27 +01:00
Zach Riggle dc84e7150a More reverting 2015-02-01 00:21:13 -08:00
Zach Riggle f6e90df62a Revert "Rename "pwn" to "binjitsu""
This reverts commit 8bbaa14afe.
2015-01-31 23:58:16 -08:00
Zach Riggle a96ffc80a2 Fix mis-reporting of NX when there is no GNU_STACK segment 2015-01-31 23:31:49 -08:00
Zach Riggle dae43bb581 Make doctests not spew stuff 2015-01-31 22:47:23 -08:00
Zach Riggle b399f2a439 Merge branch 'threading-event-wait' 2015-01-31 22:45:26 -08:00
Zach Riggle a875adb533 Work around #459 2015-01-31 22:45:13 -08:00
Zach Riggle 6730a63432 Add --upgrade 2015-01-31 20:49:43 -08:00
Zach Riggle 8bbaa14afe Rename "pwn" to "binjitsu" 2015-01-31 20:37:58 -08:00
Zach Riggle 7bc5a9cc31 args => argv 2015-01-29 21:15:24 -08:00
Zach Riggle 1844b85ae6 Enable debugging ssh channels. Enrich information with pid and args. Add documentation 2015-01-29 19:51:32 -08:00
Zach Riggle ff19108e02 Revert default log level back to 1; handle isEnabledFor in accordance with context 2015-01-29 19:51:32 -08:00
Zach Riggle 5e58b94d7a Update install docs 2015-01-29 19:51:32 -08:00
Zach Riggle 9a5bccd837 Remove versioned stuff 2015-01-29 19:42:35 -05:00
Zach Riggle 7865ec93b0 Wake up Travis 2015-01-29 19:42:01 -05:00
Zach Riggle de68ff6734 Update installation instructions 2015-01-29 18:43:36 -05:00
Zach Riggle d26a5a7012 Fix quoting style from repr 2015-01-29 18:41:15 -05:00
Zach Riggle 5f167c657f Fix indentation 2015-01-29 05:08:31 -08:00
Zach Riggle 67faf896f1 Make unhex() a bit more forgiving 2015-01-29 05:06:29 -08:00
Zach Riggle 073a179d29 Don't log twice for clean_and_log. 2015-01-28 22:52:12 -08:00
Zach Riggle 65847258fd Always print security info 2015-01-28 20:54:08 -08:00
Zach Riggle b6a98274c0 Update docs 2015-01-28 20:54:00 -08:00
Zach Riggle da9ee7bd9d Fix hostname 2015-01-28 19:33:14 -08:00
Zach Riggle 47160d7398 Expressly disable tty for upload_data 2015-01-28 17:39:01 -08:00
Zach Riggle 5974be5c01 Fix SSH doctests 2015-01-28 17:38:59 -08:00
Zach Riggle edf68d3ffb Dont spawn a tty for this "sh" example 2015-01-28 16:33:36 -08:00
Zach Riggle dddc0ee163 Restore pep237 2015-01-28 16:32:10 -08:00
Zach Riggle 27e96868b8 Unbreak the build while sphinx fixes their issues.
https://bitbucket.org/birkenfeld/sphinx-contrib/issue/93/
2015-01-28 16:26:19 -08:00
Zach Riggle efce85666d Print the actual command used if debugging 2015-01-28 16:26:15 -08:00
Zach Riggle cdbba52548 Disable echoing of control characters 2015-01-27 22:58:17 -08:00
Zach Riggle 2cc92df291 Use tty by default, and run "stty raw" by default except for when doing a shell (process==None).
Add a doctest for sftp vs non-sftp uploads.
Remove extra output from script generated by ssh.process if not run directly.
2015-01-27 22:46:16 -08:00
Zach Riggle f3a0a4f781 Change magic log number to -1 2015-01-27 22:44:53 -08:00
Zach Riggle b5d33ff064 Don't eat Ctrl+C with all the exceptions 2015-01-27 15:00:30 -08:00
Zach Riggle 7e829db170 Fix path names for sftpclient and make script executable 2015-01-27 14:58:54 -08:00
Zach Riggle 504c502c22 Merge branch 'sftpclient' 2015-01-27 12:17:27 -08:00
Zach Riggle 3324062013 Update ssh object to use sftp first; expose _wd as cwd; optional caching 2015-01-27 12:17:11 -08:00
Zach Riggle 3a767b45dd Unfuck progress 2015-01-26 23:19:55 -08:00
Zach Riggle ebb349c700 Merge branch 'commandline-context-pwntools'
Conflicts:
	pwnlib/commandline/disasm.py
	pwnlib/commandline/shellcraft.py
2015-01-26 22:54:00 -08:00
Zach Riggle 9991348963 Use "from pwn import *" in command-line utilities, and shovel all the context information through a single handler 2015-01-26 22:53:10 -08:00
Zach Riggle b010daa438 Set permissions on temporary working directory 2015-01-26 22:24:14 -08:00
Zach Riggle 73a494cfd0 Clean up import name duplication, add pwnlib.version 2015-01-25 22:02:33 -08:00
Zach Riggle 3c2074cdeb Rename ssh.run to ssh.system 2015-01-25 21:53:27 -08:00
Zach Riggle 16f7021065 Merge branch 'ssh-process-execve-binjitsu' 2015-01-25 21:51:26 -08:00
Zach Riggle bd137c7a4c Add a more robust interface to SSH commands which doesn't require hacky shell escaping if Python is available on the remote host. This interface follows the same style as pwnlib.tubes.process.process 2015-01-25 21:51:08 -08:00
Zach Riggle faf66a3981 Add a more robust interface to SSH commands which doesn't require hacky shell escaping if Python is available on the remote host. This interface follows the same style as pwnlib.tubes.process.process 2015-01-25 21:50:28 -08:00
Zach Riggle 4137fac99b Merge branch 'commandline-context-pwntools'
Conflicts:
	pwnlib/commandline/shellcraft.py
2015-01-25 21:40:09 -08:00
Zach Riggle 57de045db5 Use "from pwn import *" in command-line utilities, and shovel all the context information through a single handler 2015-01-25 21:38:23 -08:00
Zach Riggle 5046f18b90 Merge branch 'shellcraft-speedup' 2015-01-25 21:29:05 -08:00
Zach Riggle dcd3df3f10 Sort templates 2015-01-25 21:24:49 -08:00
Zach Riggle ceec814588 Speed up shellcraft loading and clean up code a bit 2015-01-25 21:21:16 -08:00
Zach Riggle a4860f3167 Watch all branches 2015-01-25 18:15:37 -08:00
Zach Riggle c762eec46c Make doctests cleaner 2015-01-25 18:14:44 -08:00
Zach Riggle 380eda7234 Update log statement 2015-01-25 18:08:22 -08:00
Zach Riggle f02cc65624 Merge branch 'elf-data-property' 2015-01-24 17:20:21 -08:00
Zach Riggle 32ecc909a3 Add .data property 2015-01-24 17:19:56 -08:00
Zach Riggle 8710709ca3 Update 'latest version' documentation since pip can install from git 2015-01-24 16:11:51 -08:00
Zach Riggle ec64ebe3c7 Merge branch 'ssh-revamp-localhost-only' 2015-01-24 01:21:04 -08:00
Zach Riggle fb7d604927 Update self.host to the resolved host 2015-01-24 01:20:05 -08:00
Zach Riggle 93a95d16f1 Restrict demouser for Travis to localhost only. Change host name from localhost to example.pwnme. Add support for getting the hostname and identityfile from ssh_config.
Conflicts:
	pwnlib/tubes/ssh.py
2015-01-24 01:19:55 -08:00
Zach Riggle 9de8211e58 Fix logging in tests 2015-01-23 23:35:45 -08:00
Zach Riggle 0726fb45d8 Squash most of the Sphinx warnings 2015-01-23 23:34:39 -08:00
Zach Riggle 7d08ba6893 Rename ssh.run to ssh.system since that's closer to what it really is 2015-01-23 04:51:07 -08:00
Jonas Rudloff 1be8797cee Merge pull request #440 from binjitsu/issue-438
mips -> tradmips
2015-01-22 14:16:21 +01:00
Zach Riggle 6fc936c708 mips -> tradmips 2015-01-22 04:50:40 -08:00
Zach Riggle 33d7e4ea30 mips -> tradmips 2015-01-22 04:48:30 -08:00
Zach Riggle 5134d4f6a4 Update self.host to the resolved host 2015-01-22 04:24:57 -08:00
Zach Riggle 51bda21142 Restrict demouser for Travis to localhost only. Change host name from localhost to example.pwnme. Add support for getting the hostname and identityfile from ssh_config. 2015-01-22 04:13:01 -08:00
Mathias Svensson 8d5cf044e7 Merge pull request #434 from binjitsu/close-handles-proc
Close extra handles on child processes
2015-01-18 16:35:07 +01:00
Zach Riggle 02a6145c1d Close extra handles on child processes 2015-01-16 14:55:16 -08:00
Jonas Rudloff 46bd8e93b2 Merge pull request #418 from Gallopsled/performance-logger
Added a performance logger
2015-01-16 16:19:28 +01:00
Jonas Rudloff c0fec5ee5a Merge pull request #416 from Gallopsled/log-pwnhandler
Added support for increasing logging for a specific point in the tree
2015-01-16 16:17:51 +01:00
Jonas Rudloff 5b33186a51 Merge pull request #433 from Gallopsled/update-gitignore
Added swp to gitignore
2015-01-16 16:16:42 +01:00
Mathias Svensson 5b5b7a2544 Added swp to gitignore 2015-01-16 16:14:16 +01:00
Zach Riggle 99acaf7471 Make nosetests work 2015-01-15 02:54:57 -05:00
Zach Riggle e48c08baa4 Change default fd back to stdout 2015-01-15 02:23:56 -05:00
Zach Riggle b4e89ab373 Fix dependency for travis 2015-01-15 02:20:22 -05:00
Zach Riggle 806f2a3e7d Merge remote-tracking branch 'upstream/fix-stager' 2015-01-15 02:13:49 -05:00
Zach Riggle c709e7e753 Merge branch 'StevenVanAcker/patch-1' 2015-01-15 02:13:31 -05:00
Zach Riggle 88a83cad71 The great rebranding 2015-01-15 02:03:57 -05:00
Kristoffer Søholm 850efb557f Merge pull request #431 from Gallopsled/fix-stager
Off by one line in stager shellcode
2015-01-13 15:37:47 +01:00
Jonas Rudloff e515d234c7 if construct was of by one line 2015-01-13 14:46:48 +01:00
Mathias Svensson 8a97980bc0 Merge pull request #430 from StevenVanAcker/patch-1
fixing capstone installation under debian/ubuntu
2015-01-13 11:48:51 +01:00
Zach Riggle b41a4057c3 Merge branch 'tubes-are-loggers' 2015-01-12 16:23:23 -05:00
Zach Riggle 49244fe1dc Merge branch 'log-level-one' 2015-01-12 16:23:03 -05:00
Zach Riggle 1c06dca971 Merge branch 'connect-gethostbyname' 2015-01-12 16:22:11 -05:00
Zach Riggle 85379b292d Merge branch 'context-logfile' 2015-01-12 16:22:07 -05:00
Zach Riggle 88195d8c56 Merge branch 'issue-338' 2015-01-12 16:22:03 -05:00
StevenVanAcker e432a6584d fixing capstone installation under debian/ubuntu 2015-01-12 22:04:20 +01:00
Zach Riggle 835a94b356 Update LICENSE-pwntools.txt 2015-01-12 14:42:52 -05:00
Zach Riggle 1c52cd0390 Implement "wrap" word_size 2015-01-12 12:50:04 -05:00
Zach Riggle bc270113b6 Enable use of hostnames for connect shellcode. 2015-01-12 12:26:12 -05:00
Zach Riggle 139937114b Stupid doctests 2015-01-12 12:17:19 -05:00
Zach Riggle 2f22025cea Set level to 1 instead 2015-01-12 12:17:19 -05:00
Zach Riggle 8f13445b73 Fix doctest formatting 2015-01-12 12:17:03 -05:00
Zach Riggle f297cf60ba Defer adding a handler and setting the root logger level 2015-01-12 12:17:03 -05:00
Zach Riggle 19866979bc Get rid of reliance on /dev/null; flush logfile when changing log files 2015-01-12 12:16:19 -05:00
Zach Riggle 372490b4e9 Add doctest 2015-01-12 12:16:19 -05:00
Zach Riggle 9f244268ca Re-add handler, should work after #419 is resolved. 2015-01-12 12:16:19 -05:00
Zach Riggle d3929505c4 Remove handler to check Travis result 2015-01-12 12:16:19 -05:00
Zach Riggle a4f21971d1 Skip emitting and formatting records sent to the LogFile if it's /dev/null, which is also the default value 2015-01-12 12:16:19 -05:00
Zach Riggle 4d31a89a67 Enable per-thread logfiles via context, and retargetting the logfile at runtime 2015-01-12 12:16:19 -05:00
Zach Riggle ca47f5ce27 Tubes are Loggers 2015-01-12 12:15:53 -05:00
Zach Riggle 7e02110bc5 Invert the lookup on logging verbosity, using 1 as a sentinel value for "not set" 2015-01-12 12:15:53 -05:00
Zach Riggle 69073530fd Invert the lookup on logging verbosity, using 1 as a sentinel value for "not set" 2015-01-12 12:15:20 -05:00
Zach Riggle 8943102479 Set logLevel to 1 2015-01-12 12:14:48 -05:00
Mathias Svensson 91ae3968ed Merge pull request #426 from Gallopsled/connect-shellcode
Added a connect shellcode ported from the old pwntools
2015-01-12 18:14:20 +01:00
Mathias Svensson bfb5d09b5f Added a performance logger and updated tube.py to use it 2015-01-12 17:59:15 +01:00
Mathias Svensson 9a830b7185 Missed a docstring 2015-01-12 17:54:18 +01:00
Mathias Svensson 4edb4b8894 Added support for increasing logging for a specific point in the tree 2015-01-12 17:54:18 +01:00
Mathias Svensson 2fb768f8a4 Merge pull request #423 from Gallopsled/doctest-stdout
Order matters
2015-01-12 17:52:38 +01:00
Zach Riggle 0fab4731e7 Merge pull request #427 from Gallopsled/travis-apt-update-once
Only call apt-get update once, shaves off a few seconds
2015-01-12 11:49:55 -05:00
Zach Riggle 492d81b9f8 Only call apt-get update once, shaves off a few seconds 2015-01-12 11:36:15 -05:00
Zach Riggle 9139dc64d9 Fix stderr changing on term.init breaking the logging 2015-01-12 11:31:36 -05:00
Jonas Rudloff 771a56e207 Added a connect shellcode ported from the old pwntools 2015-01-12 16:56:32 +01:00
Zach Riggle cde5ec8343 Merge pull request #425 from Gallopsled/capstones-servers-sucks
Stop relying on Capstone's servers to be up
2015-01-12 10:25:08 -05:00
Zach Riggle 872e13da20 Stop relying on Capstone's servers to be up 2015-01-12 10:11:59 -05:00
Zach Riggle 1a4664f248 Merge pull request #419 from Gallopsled/doctest-stdout
Set logging to stdout when running doctests
2015-01-12 06:12:32 -05:00
Zach Riggle 6e33077081 Set logging to stdout when running doctests, since otherwise output is not captured. Also fix assumption that the console handler is the first handler. Also ensure that the console handler is applied for doctests, since some of them require it. 2015-01-12 06:06:23 -05:00
Zach Riggle 37a46e052a Enable direct calls to pack() without endianness specified to pack negative numbers as positive numbers. Fixes #338. 2015-01-12 02:09:39 -05:00
Jonas Rudloff bd3a68c9ce Merge pull request #408 from Gallopsled/mov-microoptimizations
More micro-optimizations to mov shellcodes
2015-01-11 19:15:32 +01:00
Mathias Svensson 3c9e95bd6a More micro-optimizations to mov shellcodes 2015-01-11 18:49:10 +01:00
Robert Larsen 27f9e65939 Merge pull request #405 from Gallopsled/asm-update
Updated a lot of shellcode
2015-01-11 13:55:20 +01:00
Mathias Svensson 0da236aefa Merge pull request #407 from Gallopsled/shellcraft-strip-doctest
improved doctest stripping in shellcraft
2015-01-11 12:46:15 +01:00
Morten Brøns-Pedersen 2a86bf2440 improved doctest stripping in shellcraft 2015-01-11 12:30:22 +01:00
Mathias Svensson 73ae97f197 Enable caching of env stores for constants.eval 2015-01-11 12:28:40 +01:00
Mathias Svensson 3071cf65a7 Updated a lot of shellcodes to use the new eval feature 2015-01-11 12:09:54 +01:00
Mathias Svensson 93d2f5746a Added an eval method to the constants module, to evaluate constants in the current context 2015-01-11 12:04:23 +01:00
Mathias Svensson 4a8e8220e3 Added context manager for shellcraft/internal.py to make it exception-safe 2015-01-11 12:03:55 +01:00
Mathias Svensson 895373e053 Merge pull request #403 from Gallopsled/commandline-logging
bugfix: command line tools now installs a log handler
2015-01-11 11:59:44 +01:00
Morten Brøns-Pedersen d0793c4fac bugfix: command line tools now installs a log handler 2015-01-11 11:51:45 +01:00
Jonas Rudloff f7d39688dc Merge pull request #401 from Gallopsled/log-no-handler-in-lib
now only install a log handler when not in lib-mode
2015-01-10 22:47:29 +01:00
Morten Brøns-Pedersen 4bb4f4ca35 update doctest-hack to test logging output 2015-01-10 22:41:23 +01:00
Morten Brøns-Pedersen 7fd4dd9348 forgot to import logging 2015-01-10 22:41:23 +01:00
Morten Brøns-Pedersen 9df1b2d093 now only install a log handler when not in lib-mode 2015-01-10 22:41:23 +01:00
Jonas Rudloff b2bb517655 Merge pull request #400 from Gallopsled/pwn-noterm-text
command line flag NOTERM no longer turns text decoration off
2015-01-10 22:39:06 +01:00
Jonas Rudloff 346c9b00cf Merge pull request #399 from Gallopsled/log-no-prefix-caching
bugfix: log message prefixes are no longer cached
2015-01-10 22:37:40 +01:00
Jonas Rudloff 724f292773 Merge pull request #398 from Gallopsled/shellcraft-bash-completion
added bash completion for shellcraft
2015-01-10 22:36:00 +01:00
Kristoffer Søholm d4184db93c Merge pull request #402 from Gallopsled/issue-395
no longer creates an "a.out" when using `pwnlib.asm`
2015-01-10 22:02:03 +01:00
Morten Brøns-Pedersen 3e87bfb307 no longer creates an "a.out" when using pwnlib.asm 2015-01-10 21:18:41 +01:00
Morten Brøns-Pedersen 5823d848e8 command line flag NOTERM no longer turns text decoration off 2015-01-10 20:43:18 +01:00
Morten Brøns-Pedersen bed5f37084 bugfix: log message prefixes are no longer cached
this means that changes to `pwnlib.term.text.when` will now take effect as they should
2015-01-10 20:40:58 +01:00
Morten Brøns-Pedersen 47fd9b1132 added bash completion for shellcraft 2015-01-10 20:23:59 +01:00
Kristoffer Søholm 5905444ff4 Merge pull request #397 from Gallopsled/shellcraft-strip-doctests
"shellcraft -?" now removes any doctests from the docstring
2015-01-10 18:55:14 +01:00
Morten Brøns-Pedersen 61d7aa91bd strip trailing blank lines 2015-01-10 18:46:12 +01:00
Morten Brøns-Pedersen 6b008d3ac0 "shellcraft -?" now removes any doctests from the docstring 2015-01-10 18:43:04 +01:00
br0ns 2c127ddb8d Merge pull request #391 from Gallopsled/less-hacky-performance-fix
Made logging less hacky and removed legacy code
2015-01-10 18:14:20 +01:00
br0ns e90474dadc Merge pull request #357 from Gallopsled/stager
use i386.linux.syscall in stager shellcode
2015-01-10 16:34:41 +01:00
Jonas Rudloff cf5a4c582d use i386.linux.syscall in stager shellcode 2015-01-10 16:22:28 +01:00
br0ns b8088b8bb4 Merge pull request #353 from Gallopsled/syscall-7arg
fixes #351 syscall can now accept 7 arguments
2015-01-10 16:15:30 +01:00
Morten Brøns-Pedersen 0c9c8b449a added doctest for pwnlib.shellcraft.i386.linux.syscall 2015-01-10 16:12:32 +01:00
br0ns ffaab6cd08 Merge pull request #390 from Gallopsled/extra-toplevel
Added math, pickle and StringIO to toplevel.py
2015-01-10 15:13:39 +01:00
br0ns 15335dfc30 Merge pull request #394 from Gallopsled/fix-example
Fixed bug in examples/asm.py. There is no context variable "net".
2015-01-10 14:46:53 +01:00
Mathias Svensson 8d61322857 Merge pull request #393 from Gallopsled/rop-docstring-cleanup
fixed formatting issue in docstring for `pwnlib.rop.ROP.__getattr__`
2015-01-10 14:25:05 +01:00
Mathias Svensson 6ad5b206da Fixed bug in examples/asm.py. There is no context variable "net". 2015-01-10 14:22:30 +01:00
Morten Brøns-Pedersen 96511e8c29 fixed formatting issue in docstring for pwnlib.rop.ROP.__getattr__ 2015-01-10 14:16:32 +01:00
Mathias Svensson 37811b04f4 Cleaned up a lot of legacy code 2015-01-10 13:38:40 +01:00
Mathias Svensson d51eda5f43 Updated documentation 2015-01-10 13:38:39 +01:00
Mathias Svensson da886c4b79 Replaced ugly performance hack with less ugly performance hack 2015-01-10 12:25:18 +01:00
Mathias Svensson 24542f422a Added math, pickle and StringIO to toplevel.py 2015-01-10 12:13:26 +01:00
br0ns ba477dabbc Merge pull request #388 from Gallopsled/issue-387
Ensure arguments go through context transform
2015-01-10 12:12:59 +01:00
Zach Riggle fe034dc67a Ensure arguments go through context transform 2015-01-09 20:12:07 -08:00
Zach Riggle 7d964f86b6 Merge pull request #385 from Gallopsled/typo
fixed typo: "updatez" -> "update"
2015-01-08 12:12:50 -08:00
Jonas Rudloff f011b1789f fixed typo: "updatez" -> "update" 2015-01-08 20:41:06 +01:00
Jonas Rudloff 90da45d8d5 Merge pull request #383 from Gallopsled/log-rootlogger-level
pwnlib root logger now reports parents level if more verbose
2015-01-08 19:36:10 +01:00
Jonas Rudloff baaabd12ca Merge pull request #375 from Gallopsled/stderr-debug-process
Enable logging process stderr directly to log.debug.  This is useful for...
2015-01-08 19:34:00 +01:00
Jonas Rudloff ff2e8f0e8a Merge pull request #384 from Gallopsled/log-docstrings
updated docs for `pwnlib.log`
2015-01-08 19:33:03 +01:00
Jonas Rudloff c6c853dd3c Merge pull request #382 from Gallopsled/pwn-logfile
added command line option "LOG_FILE"
2015-01-08 19:32:18 +01:00
Morten Brøns-Pedersen 661d820b5f updated docs for pwnlib.log 2015-01-08 17:17:26 +01:00
Morten Brøns-Pedersen 0d4ff3b0b9 pwnlib root logger now reports parents level if more verbose 2015-01-08 14:56:30 +01:00
Morten Brøns-Pedersen 55b879c6d4 have command line option "LOG_LEVEL" install a handler for *all* loggers 2015-01-08 14:53:35 +01:00
Morten Brøns-Pedersen 497d766ff0 added command line option "LOG_FILE" 2015-01-08 13:07:43 +01:00
Mathias Svensson 4d9da37586 Merge pull request #381 from Gallopsled/hexdump-remove-dead-code
removed `pwnlib.util.fiddling.sequential_lines` as it is no longer used
2015-01-08 12:01:57 +01:00
Morten Brøns-Pedersen a01dc91ec1 removed pwnlib.util.fiddling.sequential_lines as it is no longer used 2015-01-08 11:44:27 +01:00
Zach Riggle f16ad780a3 Merge pull request #376 from Gallopsled/assembler-list-str
Fix assembler returned when not in special-case architectures (e.g. cris)
2015-01-07 23:15:54 -08:00
Zach Riggle 45ba7865d4 Merge pull request #377 from Gallopsled/hexdump-faster
Hexdump faster
2015-01-07 23:15:38 -08:00
Zach Riggle 8a25962917 Merge pull request #378 from Gallopsled/flat-hexdump-bytearray
Enable flat() for bytearray().  Pass argument given to hexdump() to flat() first.
2015-01-07 23:15:20 -08:00
Zach Riggle 9b4531a15e Enable flat() for bytearray(). Pass argument given to hexdump() to flat() first. 2015-01-07 21:55:51 -08:00
Zach Riggle ee4e8104a2 Disable detection of sequential de bruijn lines in hexdump until a faster alternative is found 2015-01-07 19:56:49 -08:00
Zach Riggle ecb6717d6d Fix assembler returned when not in special-case architectures (e.g. cris) 2015-01-07 19:53:45 -08:00
Zach Riggle fec0fdc9e1 Enable logging process stderr directly to log.debug. This is useful for e.g. strace or ltrace.
At some point in the future for the pwntools-write-ups, this should be very useful to assist debugging exploits.
2015-01-07 17:50:02 -08:00
br0ns 5cf13cba4e Merge pull request #374 from Gallopsled/binutils-old-version
Check the installed binutils version so that users are aware of old versions
2015-01-08 00:20:19 +01:00
Zach Riggle 2a5e19e71b Check the installed binutils version so that users are aware of old versions 2015-01-07 13:30:53 -08:00
Zach Riggle c0b714f965 Add Twitter link, fix style to be consistent
Fixes #373
2015-01-07 13:20:09 -08:00
Zach Riggle 0ffcee5667 Merge pull request #365 from Gallopsled/logging-cleanup
Attempt at improving logging
2015-01-07 11:22:27 -08:00
Zach Riggle ec262b2d70 Merge pull request #339 from Gallopsled/travis-editable-install
Have travis do an editable installation.  This is how we actually use it...
2015-01-06 17:23:55 -08:00
Zach Riggle 2b44d375f7 Merge pull request #372 from Gallopsled/readline-float-default
readline now lets the prompt+input float by default.  replacements for `raw_input` and `input` are installed.
2015-01-06 17:23:07 -08:00
Morten Brøns-Pedersen a072a4be40 readline now lets the prompt+input float by default. replacements for raw_input and input are installed. 2015-01-07 01:06:22 +01:00
Zach Riggle f3ab8b4edd Merge pull request #371 from Gallopsled/readline-eof
`term.readline` now correctly handles EOF on `sys.stdin`, and ^j is interpreted as <enter> (^m)
2015-01-06 15:47:23 -08:00
Morten Brøns-Pedersen a58815df42 letting term.term take over sys.stderr apparently breaks the doctests, so have Travis set env var PWNLIB_NOTERM 2015-01-06 21:00:36 +01:00
Morten Brøns-Pedersen 3e20b93378 term.readline now correctly handles EOF on sys.stdin, and ^j is interpreted as <enter> (^m)
This is useful if a file is redirected to stdin.
2015-01-06 19:55:07 +01:00
Morten Brøns-Pedersen ef5cfeb6c4 changed sys.stdout to sys.stderr a number of places 2015-01-06 19:40:59 +01:00
br0ns 2411161ed5 Merge pull request #367 from Gallopsled/tube-aliases
Add aliases for all tube methods for read*=recv* and write*=send*
2015-01-06 18:38:34 +01:00
Morten Brøns-Pedersen 97f04e4eb7 removed read_thread (alias for recv_thread) as it is not part of the API 2015-01-06 18:30:17 +01:00
Morten Brøns-Pedersen d72a83355e redirect logging output to sys.stdout so we can catch it in doctests 2015-01-06 12:45:57 +01:00
Morten Brøns-Pedersen c73b731c32 delegated a few more calls to the underlying logger 2015-01-06 12:45:57 +01:00
Morten Brøns-Pedersen 3705db475e fixed issue with multiple values for "level" keyword 2015-01-06 12:45:57 +01:00
Morten Brøns-Pedersen 3dee2bbe41 mega commit -- attempt at improving logging 2015-01-06 12:45:57 +01:00
br0ns d573f70576 Merge pull request #368 from Gallopsled/tubes-docs
Update documentation for tubes, and improve the layout.
2015-01-06 11:06:09 +01:00
Jonas Rudloff c4b28836b5 Merge pull request #364 from Gallopsled/issue-363
Change Args to Arguments
2015-01-06 11:00:25 +01:00
Zach Riggle d00a51ad47 Move sock above remote/listen 2015-01-05 23:43:10 -08:00
Zach Riggle d75910c817 Update documentation for tubes, and improve the layout.
Also, add the serial tube to documentation.
2015-01-05 23:36:16 -08:00
Zach Riggle 0ee0cd7ac0 Add aliases for all tube methods for read*=recv* and write*=send* 2015-01-05 23:34:13 -08:00
Zach Riggle 404f0958d0 Change Args to Arguments 2015-01-05 15:36:47 -08:00
Zach Riggle b2d2c64da3 Add expected build time
Tested on a Macbook Pro by building *all* of the architectures.  I presume desktops would be faster.
2015-01-05 15:30:41 -08:00
Zach Riggle a334bdf343 Merge pull request #358 from Gallopsled/update-stuff-for-2.2.0
Update stuff after the 2.2.0 release
2015-01-05 11:41:45 -05:00
Mathias Svensson 899a3b4410 and version.py 2015-01-05 17:34:42 +01:00
Mathias Svensson 30df1e638a Update stuff for 2.2.0 release 2015-01-05 17:32:38 +01:00
Kristoffer Søholm 3888052ba5 Merge pull request #354 from Gallopsled/log-remove-ansilen
remove `pwnlib.log.ansilen` as it is no longer used
2015-01-05 16:10:00 +01:00
Morten Brøns-Pedersen 5f28e1461d remove pwnlib.log.ansilen as it is no longer used 2015-01-05 13:58:54 +01:00
Jonas Rudloff 3062c456f8 Merge remote-tracking branch 'origin/master' into syscall-7arg
Conflicts:
	pwnlib/shellcraft/templates/i386/linux/syscall.asm
2015-01-05 12:41:02 +01:00
Jonas Rudloff 6be81d0b7e fixes #351 syscall can now accept 7 arguments 2015-01-05 12:25:44 +01:00
Zach Riggle ad513db436 Have travis do an editable installation. This is how we actually use it, so this is what should work. 2015-01-04 13:16:42 -05:00
1007 changed files with 104483 additions and 14660 deletions

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
[run]
branch = True
omit =
*/constants/*
source =
pwn
pwnlib
~/.pwntools-cache/
+14
View File
@@ -0,0 +1,14 @@
# Pwntools Issue Template
Thanks for contributing to Pwntools!
When reporting an issue, be sure that you are running the latest released version of pwntools (`pip install --upgrade pwntools`).
Please verify that your issue occurs on 64-bit Ubuntu 14.04. You can use the Dockerfile on `docker.io` for quick testing.
```
$ docker pull pwntools/pwntools:stable
$ docker run -it pwntools/pwntools:stable
```
If possible, provide a proof-of-concept which demonstrates the problem. Include any binaries or scripts necessary to reproduce the issue, and please include the full debug output via setting the environment variable `PWNLIB_DEBUG=1`.
+27
View File
@@ -0,0 +1,27 @@
# Pwntools Pull Request
Thanks for contributing to Pwntools! Take a moment to look at [`CONTRIBUTING.md`][contributing] to make sure you're familiar with Pwntools development.
Please provide a high-level explanation of what this pull request is for.
## Testing
Pull Requests that introduce new code should try to add doctests for that code. See [`TESTING.md`][testing] for more information.
## Target Branch
Depending on what the PR is for, it needs to target a different branch.
You can always [change the branch][change] after you create the PR if it's against the wrong branch.
| Branch | Type of PR |
| -------- | ---------------------------------------------------------------- |
| `dev` | New features, and enhancements
| `dev` | Documentation fixes and new tests
| `stable` | Bug fixes that affect the current `stable` branch
| `beta` | Bug fixes that affect the current `beta` branch, but not `stable`
| `dev` | Bug fixes for code that has never been released
[contributing]: https://github.com/Gallopsled/pwntools/blob/dev/CONTRIBUTING.md
[testing]: https://github.com/Gallopsled/pwntools/blob/dev/TESTING.md
[change]: https://github.com/blog/2224-change-the-base-branch-of-a-pull-request
+6 -1
View File
@@ -2,6 +2,8 @@
*.hi
*.pyc
*~
*.swp
.ropeproject
*.pdf
*/auto/*
*/bin/*
@@ -9,4 +11,7 @@ docs/build
build
MANIFEST
dist
pwntools.egg-info
*.egg-info
*.core
.coverage
.tox
+4
View File
@@ -0,0 +1,4 @@
[settings]
indent=' '
not_skip = __init__.py
force_single_line = 1
+7
View File
@@ -0,0 +1,7 @@
{
"default_encoding": "UTF-8",
"ensure_newline_at_eof_on_save": true,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
+39 -11
View File
@@ -1,15 +1,43 @@
dist: precise
language: python
addons:
apt:
packages:
- gcc-multilib
- lib32stdc++6
- ash
- bash
- dash
- ksh
- mksh
- zsh
- pandoc
- gdb
cache:
- pip
- directories:
- usr
- /home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/
- /home/travis/virtualenv/python2.7.13/bin/
python:
- "2.7"
branches:
only:
- master
before_install:
- echo $-
- source travis/install.sh
- source travis/ssh_setup.sh
- echo $-
install:
- source .travis_install.sh
- source .travis_ssh_setup.sh
- python -c 'from pwn import *; print pwnlib.term.term_mode' NOTERM
- python -c 'from pwn import *; print pwnlib.term.term_mode' NOTERM
- python -c 'from pwn import *; print pwnlib.term.term_mode' NOTERM
- python -c 'from pwn import *; print pwnlib.term.term_mode' NOTERM
script: make -C docs doctest
- pip install --upgrade pip
- pip install --upgrade appdirs # https://github.com/ActiveState/appdirs/issues/89#issuecomment-282326570
- pip install --upgrade --editable .
- pip install --upgrade --requirement docs/requirements.txt
before_script:
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
script:
- PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest
after_success:
- coveralls
- source travis/update_demo.sh
-29
View File
@@ -1,29 +0,0 @@
#!/usr/bin/env bash
setup_linux()
{
sudo apt-get update
sudo apt-get install software-properties-common pwgen
sudo apt-add-repository --yes ppa:pwntools/binutils
sudo apt-get update
sudo apt-get install binutils-arm-linux-gnu binutils-mips-linux-gnu binutils-powerpc-linux-gnu
wget -nc http://www.capstone-engine.org/download/2.1.2/capstone-2.1.2_amd64.deb
(echo "a30bcb58fd82d32b135eec978eaa22230c44e722 *capstone-2.1.2_amd64.deb" | sha1sum -c) || exit
sudo dpkg -i *.deb
}
setup_osx()
{
brew update
brew install binutils
brew install capstone
}
case $(uname) in
Darwin) setup_osx ;;
Linux) setup_linux ;;
esac
pip install -r requirements.txt
pip install -r docs/requirements.txt
pip install .
-18
View File
@@ -1,18 +0,0 @@
#!/usr/bin/env bash
#
# Install a demo user for SSH purposes
#
U=demouser
H=/home/$U
sudo useradd -m $U
ssh-keygen -t rsa -f /tmp/$U -N ''
eval $(ssh-agent -s)
ssh-add /tmp/$U
sudo -u $U mkdir $H/.ssh
sudo -u $U cp /tmp/$U.pub $H/.ssh/authorized_keys
sudo chmod -R 700 $H
(echo -n "$U:"; pwgen 100 1) | sudo chpasswd
+575 -1
View File
@@ -3,7 +3,573 @@
This changelog only includes added major features and changes. Bugfixes and
minor changes are omitted.
## 2.2.0 - 2014-08-28 (pre)
## Release History
The table below shows which release corresponds to each branch, and what date the version was released.
| Version | Branch | Release Date |
| ---------------- | -------- | ---------------------- |
| [3.13.0](#3130) | `dev` | Mar 31, 2018 (planned)
| [3.12.0](#3120) | `beta` | Feb 17, 2018 (planned)
| [3.11.0](#3110) | `stable` | Jan 3, 2018
| [3.10.0](#3100) | | Oct 25, 2017
| [3.9.2](#392) | | Oct 5, 2017
| [3.9.1](#391) | | Sep 28, 2017
| [3.9.0](#390) | | Sep 11, 2017
| [3.8.0](#380) | | Jul 29, 2017
| [3.7.1](#371) | | Jul 14, 2017
| [3.7.0](#370) | | Jun 19, 2017
| [3.6.1](#361) | | May 12, 2017
| [3.6.0](#360) | | May 8, 2017
| [3.5.1](#351) | | Apr 15, 2017
| [3.5.0](#350) | | Mar 26, 2017
| [3.4.1](#341) | | Feb 17, 2017
| [3.4.0](#340) | | Feb 13, 2017
| [3.3.4](#334) | | Jan 12, 2016
| [3.3.3](#333) | | Jan 10, 2016
| [3.3.2](#332) | | Jan 10, 2016
| [3.3.1](#331) | | Jan 10, 2016
| [3.3.0](#330) | | Dec 24, 2016
| [3.2.1](#321) | | Dec 24, 2016
| [3.2.0](#320) | | Nov 12, 2016
| [3.1.1](#311) | | Oct 23, 2016
| [3.1.0](#310) | | Oct 2, 2016
| [3.0.4](#304) | | Sept 19, 2016
| [3.0.3](#303) | | Sept 18, 2016
| [3.0.2](#302) | | Sept 6, 2016
| [3.0.1](#301) | | Aug 20, 2016
| [3.0.0](#300) | | Aug 20, 2016
| [2.2.0](#220) | | Jan 5, 2015
## 3.12.0
To be released on Feb 17, 2018.
- [#1083][1083] Better error messages for `gdb` when `LD_PRELOAD` is incorrect
- [#1085][1085] Add support for extracting Android `BOOTLDR!` images
- [#1075][1075] Add support for detecting GNU Screen for `run_in_new_terminal`
- [#1074][1074] Add support for running `pwntools-gdb` wrapper script instead of `gdb`
- [#1067][1067] Add `pwnlib.tubes.server` module, which adds a reusable `server` listener
- [#1063][1063] Add support for labels in `fit()`, allowing dynamic contents to be injected. (This feature is really cool, check out the pull request!)
[1083]: https://github.com/Gallopsled/pwntools/pull/1083
[1085]: https://github.com/Gallopsled/pwntools/pull/1085
[1075]: https://github.com/Gallopsled/pwntools/pull/1075
[1074]: https://github.com/Gallopsled/pwntools/pull/1074
[1067]: https://github.com/Gallopsled/pwntools/pull/1067
[1063]: https://github.com/Gallopsled/pwntools/pull/1063
## 3.11.0
- [#1044][1044] Enhancements to ROP
+ Much better support for 64-bit Intel (amd64) ROP
+ ROP gadget selection is optimized to favor multi-pops instead of multiple single-pop gadgets
+ Added support for blacklisting byte values in ROP gadget addresses
- [#1049][1049] Enhancements to `cyclic`
+ `context` now has two additional attributes, `cyclic_alphabet` and `cyclic_length`, which correspond to the arguments `alphabet` and `n` to `cyclic()` and `cyclic_find()` and related routines.
+ The motivation for this change is to allow setting the `alphabet` globally, so that any padding / patterns generated internally to pwntools can be controlled. The specific motivation is blacklisting values in ROP padding.
- [#1052][1052] Enhancements for detecting `QEMU_LD_PREFIX` used by QEMU user-mode emulation for sysroots
- [#1035][1035] Minor documentation changes
- [#1032][1032] Enhancements to `pwn template`
- [#1031][1031] More accurate `Coredump.fault_addr` on amd64
- [#1084][1084] Fix broken tests due to `ftp.debian.org` going down
[1044]: https://github.com/Gallopsled/pwntools/pull/1044
[1049]: https://github.com/Gallopsled/pwntools/pull/1049
[1052]: https://github.com/Gallopsled/pwntools/pull/1052
[1035]: https://github.com/Gallopsled/pwntools/pull/1035
[1032]: https://github.com/Gallopsled/pwntools/pull/1032
[1031]: https://github.com/Gallopsled/pwntools/pull/1031
[1084]: https://github.com/Gallopsled/pwntools/pull/1084
## 3.10.0
- [#1007][1007] Add support for setting a `gdbinit` file in the context
- [#1055][1055] Fixes for `Corefile` stack parsing, speed up `ELF.string()`
- [#1057][1057] Fix a variable name typo in `DynELF` logging which results in an exception being thrown
- [#1058][1058] Fix an edge case in `ssh_process.exe`
[1007]: https://github.com/Gallopsled/pwntools/pull/1007
[1055]: https://github.com/Gallopsled/pwntools/pull/1055
[1057]: https://github.com/Gallopsled/pwntools/pull/1057
[1058]: https://github.com/Gallopsled/pwntools/pull/1058
## 3.9.2
- [#1043][1043] Do not attempt to populate the libraries used by statically-linked binaries
[1043]: https://github.com/Gallopsled/pwntools/pull/1043
## 3.9.1
- [#1038][1038] Fix an issue with `process()` where glibc would buffer data internally, causing a hang on `select()`
- [#1036][1036] Fix Travis CI logging verbosity
- [#1029][1029] Fix some `unicode` issues when using the `readline` command history in `tube.interactive()`
[1038]: https://github.com/Gallopsled/pwntools/pull/1038
[1036]: https://github.com/Gallopsled/pwntools/pull/1036
[1029]: https://github.com/Gallopsled/pwntools/pull/1029
## 3.9.0
- [#1003][1003] Make `concat_all` faster while also simplifying it's logic
- [#1014][1014] Fix for overwritten env when parsing core file
- [#1023][1023] Fixes to Travis CI
[1003]: https://github.com/Gallopsled/pwntools/pull/1003
[1014]: https://github.com/Gallopsled/pwntools/pull/1014
[1023]: https://github.com/Gallopsled/pwntools/pull/1023
## 3.8.0
- [#981][981] Fixed RELRO detection logic
- [#986][986] Enhancements to DynELF for controlling usage of LibcDB
- A few documentation fixes
- A few fixes for the Docker image
[981]: https://github.com/Gallopsled/pwntools/pull/981
[986]: https://github.com/Gallopsled/pwntools/pull/986
## 3.7.1
- [#998][998] Fix a bug where integer values could not be set in `.pwn.conf`.
[998]: https://github.com/Gallopsled/pwntools/pull/998
## 3.7.0
- [#933][933] DynELF works better with different base addresses
- [#952][952] A few small fixes were made to `pwn template`, and the CRC database was updated.
- [5c72d62c][5c72d62c] Updated the CRC database
[933]: https://github.com/Gallopsled/pwntools/pull/933
[952]: https://github.com/Gallopsled/pwntools/pull/952
[5c72d62c]: https://github.com/Gallopsled/pwntools/commit/5c72d62c
## 3.6.1
- [#979][979]+[1a4a1e1][1a4a1e1] Fixed [#974][974], a bug related to the terminal handling and numlock.
- [#980][980] Fixed the `pwn template` command.
[974]: https://github.com/Gallopsled/pwntools/issues/974
[979]: https://github.com/Gallopsled/pwntools/pull/979
[980]: https://github.com/Gallopsled/pwntools/pull/980
[1a4a1e1]: https://github.com/Gallopsled/pwntools/commit/1a4a1e1
## 3.6.0
- [#895][895] Added a Dockerfile to simplify testing setup and allow testing on OSX
- [#897][897] Fixed some incorrect AArch64 syscals
- [#893][893] Added the `pwnlib.config` module
+ Configuration options can now be set in `~/.pwn.conf`
+ This replaces the old, **undocumented** mechanism for changing logging colors. Only @br0ns and @ebeip90 were likely using this.
+ More information is available in the documentation [here](http://docs.pwntools.com/en/dev/config.html).
- [#899][899] Pwntools now uses Unicorn Engine to emulate PLT instructions to ensure correct mapping of PIE / RELRO binaries.
- [#904][904] Enhancements to the accuracy of the `pwn checksec` command.
- [#905][905] Added a `pwn debug` command-line utility which automates the process of `gdb.attach(process(...))` to spawn GDB
+ More information is available in the documentation [here](http://docs.pwntools.com/en/dev/commandline.html#pwn-debug)
- [#919][919] Added a `pwn template` command-line utility to simplify the process of bootstrapping a new exploit.
+ More information is available in the documentation [here](http://docs.pwntools.com/en/dev/commandline.html#pwn-template).
- [#948][948] Fix unnecessary warning for Core files
- [#954][954] Fix list processing in `~/.pwn.conf`
- [#967][967] Respect `TERM_PROGRAM` for `run_in_new_terminal`
- [#970][970] Fix overly-aggressive corefile caching
[947]: https://github.com/Gallopsled/pwntools/pull/947
[948]: https://github.com/Gallopsled/pwntools/pull/948
[954]: https://github.com/Gallopsled/pwntools/pull/954
[960]: https://github.com/Gallopsled/pwntools/pull/960
[967]: https://github.com/Gallopsled/pwntools/pull/967
[968]: https://github.com/Gallopsled/pwntools/pull/968
[970]: https://github.com/Gallopsled/pwntools/pull/970
[895]: https://github.com/Gallopsled/pwntools/pull/895
[897]: https://github.com/Gallopsled/pwntools/pull/897
[893]: https://github.com/Gallopsled/pwntools/pull/893
[899]: https://github.com/Gallopsled/pwntools/pull/899
[904]: https://github.com/Gallopsled/pwntools/pull/904
[905]: https://github.com/Gallopsled/pwntools/pull/905
[919]: https://github.com/Gallopsled/pwntools/pull/919
## 3.5.1
- [#945][945] Speed up ssh via caching checksec results (fixes [#944][944])
- [#950][950] Fixes a bug where setting `context.arch` does not have an effect on `adb.compile()` output architecture
[944]: https://github.com/Gallopsled/pwntools/issues/944
[945]: https://github.com/Gallopsled/pwntools/pull/945
[950]: https://github.com/Gallopsled/pwntools/pull/950
## 3.5.0
- [b584ca3][b584ca3] Fixed an issue running `setup.py` on ARM
- [#822][822] Enabled relative leaks with `MemLeak`
+ This should be useful for e.g. heap-relative leaks
- [#832][832] Changed all internal imports to use absolute imports (no functional changes)
- [a12d0b6][a12d0b6] Move `STDOUT`, `PIPE`, `PTY` constants to globals
+ `process(..., stdin=process.PTY)` --> `process(..., stdin=PTY)`
- [#828][828] Use `PR_SET_PTRACER` for all `process()` and `ssh.process()` instances
+ This simplifies debugging on systems with YAMA ptrace enabled
- Various documentation enhancements
+ In particular, the [gdb][gdb], [elf][elf], and [ssh][ssh] docs are much better
- [#833][833] Performance enhancements for `adb` module
- [d0267f3][d0267f3] `packing.fit()` now treats large offsets as cyclic patterns (e.g. `0x61616161` behaves the same as `"aaaa"`)
- [#835][835] Added `ssh.checksec`
+ Reports the kernel version and other relevant information on connection
- [#857][857] Slightly shortened `execve` shellcode
- [300f8e0][300f8e0] Slightly speed up processing of large ELF files
- [#861][861] Adds support for extracting `IKCONFIG` configs from Linux kernel images, and extends `checksec` to report on any insecure configurations discovered
- [#871][871] Moves all of the basic syscall templates to `shellcraft/common` and exposes them via symlinks. Closed [#685][685]
+ Should not have any visible effects from any documented APIs
+ `shellcraft.arch.os.syscall_function()` still works the same
+ We now have the ability to differentiate between the `connect` syscall, and a TCP `connect` helper
- [#887][887] `sh_string` now returns a quoted empty string `''` rather than just an empty string
- [#839][839] Exposes a huge amount of functionality via corefiles which was not previously availble. See the [docs][corefile_docs] for examples.
+ `process().corefile` will automatically instantiate a Corefile for the process
+ QEMU-emulated processes are supported
+ Native processes are supported, including extraction of coredumps from `apport` crash logs
+ Native processes can be dumped *while running*, in a manner similar to `GDB`'s `gcore` script
- [#875][857] Added [documentation][aarch64] (and tests) for AArch64 shellcode
- [#882][882] The `ROP` class now respects `context.bytes` instead of using the hard-coded value of `4` (fixed [#879][879])
- [#869][869] Added several fields to the `process` class (`uid`, `gid`, `suid`, `sgid`) which are recorded at execution time, based on the file permissions
- [#868][868] Changed the way that `ssh.process()` works internally, and it now returns a more specialized class, `ssh_process`.
+ Added `ssh_process.corefile` for fetching remote corefiles
+ Added `ssh_process.ELF` for getting an ELF of the remote executable
+ The `uid`, `gid`, and `suid`, and `sgid` which are recorded at execution time, based on the file permissions
- [#865][865] Fixes `ELF.read` to support contiguous memory reads across non-contiguous file-backed segments
- [#862][862] Adds a `symlink=` argument to `ssh.set_working_directory`, which will automatically symlink all of the files in the "old" working directory into the "new" working directory
[ssh]: http://docs.pwntools.com/en/dev/tubes/ssh.html
[gdb]: http://docs.pwntools.com/en/dev/gdb.html
[elf]: http://docs.pwntools.com/en/dev/elf.html
[corefile_docs]: http://docs.pwntools.com/en/dev/elf/corefile.html
[aarch64]: http://docs.pwntools.com/en/dev/shellcraft/aarch64.html
[685]: https://github.com/Gallopsled/pwntools/pull/685
[822]: https://github.com/Gallopsled/pwntools/pull/822
[828]: https://github.com/Gallopsled/pwntools/pull/828
[832]: https://github.com/Gallopsled/pwntools/pull/832
[833]: https://github.com/Gallopsled/pwntools/pull/833
[835]: https://github.com/Gallopsled/pwntools/pull/835
[839]: https://github.com/Gallopsled/pwntools/pull/839
[857]: https://github.com/Gallopsled/pwntools/pull/857
[861]: https://github.com/Gallopsled/pwntools/pull/861
[862]: https://github.com/Gallopsled/pwntools/pull/862
[865]: https://github.com/Gallopsled/pwntools/pull/865
[868]: https://github.com/Gallopsled/pwntools/pull/868
[869]: https://github.com/Gallopsled/pwntools/pull/869
[871]: https://github.com/Gallopsled/pwntools/pull/871
[875]: https://github.com/Gallopsled/pwntools/pull/857
[879]: https://github.com/Gallopsled/pwntools/issues/879
[882]: https://github.com/Gallopsled/pwntools/pull/882
[887]: https://github.com/Gallopsled/pwntools/pull/887
[b584ca3]: https://github.com/Gallopsled/pwntools/commit/b584ca3
[a12d0b6]: https://github.com/Gallopsled/pwntools/commit/a12d0b6
[d0267f3]: https://github.com/Gallopsled/pwntools/commit/d0267f3
[300f8e0]: https://github.com/Gallopsled/pwntools/commit/300f8e0
## 3.4.1
- [#894][894] Fix a bug when using `gdb.debug()` over ssh.
- [e021f57][e021f57] Fix a bug ([#891][891]) in `rop` when needing to insert padding to fix alignment
[e021f57]: https://github.com/Gallopsled/pwntools/commit/e021f57
[894]: https://github.com/Gallopsled/pwntools/pull/894
[891]: https://github.com/Gallopsled/pwntools/issues/891
## 3.4.0
- [#800][800] Add `shell=` option to `ssh.process()`
- [#806][806] Add `context.buffer_size` for fine-tuning `tube` performance
+ Also adds `buffer_fill_size=` argument for all tubes
- [b83a6c7][b83a6c7] Fix undocumented `process.leak` function
- [546061e][546061e] Modify `coredump_filter` of all spawned processes, so that core dumps are more complete
- [#809][809] Add several functions to `adb` (`unlink`, `mkdir`, `makedirs`, `isdir`, `exists`)
- [#817][817] Make disconnection detection more robust
[800]: https://github.com/Gallopsled/pwntools/pull/800
[806]: https://github.com/Gallopsled/pwntools/pull/806
[809]: https://github.com/Gallopsled/pwntools/pull/809
[817]: https://github.com/Gallopsled/pwntools/pull/817
[5d9792f]: https://github.com/Gallopsled/pwntools/commit/5d9792f
[b83a6c7]: https://github.com/Gallopsled/pwntools/commit/b83a6c7
[546061e]: https://github.com/Gallopsled/pwntools/commit/546061e
## 3.3.4
- [#850][850] and [#846][846] fix issues with `hexdump` and the `phd` command-line utility, when using pipes (e.g. `echo foo | phd`)
- [#852][852] Fixes register ordering in `regsort`
- [#853][853] Fixes the registers restored in `shellcraft.amd64.popad`
[846]: https://github.com/gallopsled/pwntools/pull/846
[850]: https://github.com/gallopsled/pwntools/pull/850
[852]: https://github.com/gallopsled/pwntools/pull/852
[853]: https://github.com/gallopsled/pwntools/pull/853
## 3.3.3
- [#843][843] fixed a bug in `amd64.mov`.
[843]: https://github.com/gallopsled/pwntools/pull/843
## 3.3.2
- [#840][840] fixed a regression introduced by [#837][837].
[840]: https://github.com/gallopsled/pwntools/pull/840
## 3.3.1
- [#833][833] Fixed a performance-impacting bug in the adb module.
- [#837][837] Fixed a bug([#836][836]) causing `hexdump(cyclic=True)` to throw an exception.
[833]: https://github.com/Gallopsled/pwntools/pull/833
[837]: https://github.com/Gallopsled/pwntools/pull/837
[836]: https://github.com/Gallopsled/pwntools/issues/836
## 3.3.0
- [b198ec8][b198ec8] Added `tube.stream()` function, which is like `tube.interact()` without a prompt or keyboard input.
+ Effectively, this is similar to `cat file` and just prints data as fast as it is received.
- [aec3fa6][aec3fa6] Disable update checks against GitHub
+ These checks frequently broke due to GitHub query limits
- [#757][757] Fixed `adb.wait_for_device()` re-use of the same connection
- [f9133b1][f9133b1] Add a `STDERR` magic argument to make logging go to `stderr` instead of `stdout`
+ Usage is e.g. `python foo.py STDERR` or `PWNLIB_STDERR=1 python foo.py`
+ Also adds `context.log_console` to log to any file or terminal
- [67e11a9][67e11a9] Add faster error checking to `cyclic()` when provided very large values
- [5fda658][5fda658] Expose BitPolynom in `globals()`
- [#765][765] Added `-d` option for hex-escaped output for `shellcraft` command-line tool
- [#772][772] Fixed bash completion regressions
- [30c34b7][30c34b7] Fix `ROP.call()` with `Function` objects from `ELF.functions`
- [fa402ce][fa402ce] Add `adb.uptime` and `adb.boot_time`
- [82312ba][82312ba] Add `cyclic_metasploit` and `cyclic_metasploit_find`
[757]: https://github.com/Gallopsled/pwntools/pull/757
[765]: https://github.com/Gallopsled/pwntools/pull/765
[772]: https://github.com/Gallopsled/pwntools/pull/772
[b198ec8]: https://github.com/Gallopsled/pwntools/commit/b198ec8
[aec3fa6]: https://github.com/Gallopsled/pwntools/commit/aec3fa6
[f9133b1]: https://github.com/Gallopsled/pwntools/commit/f9133b1
[67e11a9]: https://github.com/Gallopsled/pwntools/commit/67e11a9
[5fda658]: https://github.com/Gallopsled/pwntools/commit/5fda658
[30c34b7]: https://github.com/Gallopsled/pwntools/commit/30c34b7
[fa402ce]: https://github.com/Gallopsled/pwntools/commit/fa402ce
[82312ba]: https://github.com/Gallopsled/pwntools/commit/82312ba
## 3.2.1
Multiple bug fixes.
- [#783][783] Fix `adb.uninstall` typo
- [#787][787] Added error handling for `ssh.process` argument `preexec_fn`
- [#793][793] Fixed progress message in `remote()` when connections failed
- [#802][802] Fixed partition listing in `adb.partitions`, which accidentally shelled out to the `adb` binary
- [#804][804] Fix error message for 32-bit distributions
- [#805][805] Fix exception in `Core.segments` when a segment has no name
- [#811][811] Fixes and performance improvements for `adb.wait_for_device()`
- [#813][813] Fixed a release script
- [#814][814] Fixed exceptions thrown if the `$HOME` directory is not writable
- [#815][815] Properly handle `None` in `MemLeak`
[783]: https://github.com/Gallopsled/pwntools/pull/783
[787]: https://github.com/Gallopsled/pwntools/pull/787
[793]: https://github.com/Gallopsled/pwntools/pull/793
[802]: https://github.com/Gallopsled/pwntools/pull/802
[804]: https://github.com/Gallopsled/pwntools/pull/804
[805]: https://github.com/Gallopsled/pwntools/pull/805
[811]: https://github.com/Gallopsled/pwntools/pull/811
[813]: https://github.com/Gallopsled/pwntools/pull/813
[814]: https://github.com/Gallopsled/pwntools/pull/814
[815]: https://github.com/Gallopsled/pwntools/pull/815
## 3.2.0
- [#695][695] Fixed a performance regression in `phd`.
- [452605e][452605e] Fixed [#629][629] related to correct removal of temporary files.
- [ea94ee4][ea94ee4] Disallows semi-colons in for the `run_in_terminal` function, since it did not work properly in all cases.
- [6376d07][6376d07] Added the mips shellcode `pushstr_array`.
- [#700][700] Added missing MIPS shellcode documentation to readthedocs, and enabled unit tests
- [#701][701] Command line tools refactored to have a common `pwn` entry point.
+ Added an option to *not* install the traditional `asm`, `disasm`, `checksec`, etc scripts
+ All existing tools can be accessed from the `pwn` command (e.g. `pwn asm nop`).
- [#704][704] The `process` object has a new, optional argument `alarm` for setting a `SIGALRM` timeout for processes.
- [#705][705] Added the Android Emulator to the test suite and Travis CI.
+ Android Emulator is now required for the full test suite
+ Android Emulator tests are skipped if no Android-related changes are detected
- [#711][711] `DynELF` has a new attribute, `heap`, which leaks the current `brk` address (heap base). This is useful for finding heap allocations with dlmalloc-derived allocators like those used by Glibc.
- [#717][717] `sh_string` was rewritten to emit more compact and compatible strings
+ This was achieved by embedding single-quoted non-printable literals
+ Much more testing was added
+ Emitted strings are no longer copy-paste compatible, but work fine with e.g. `tubes` module and the default `subprocess` module
- [#709][709] The `adb` module now directly talks to the `adb` server process via a new module, `adb.protocol`
+ Removes the need to shell out to `adb`
+ Avoids version-compatibility issues with `adb` server vs. client
- [#703][703] Added new methods to `adb`
+ `install` - Installs an APK
+ `uninstall` - Uninstalls a package
+ `packages` - Lists installed packages
- [4893819][4893819] Modified `shellcraft.sh` on all platforms to provide `argv[0]` and set `argc==1`
+ This is needed for systems which have Busybox or other minimal shell for `/bin/sh` which does not behave well with `argc==0` or `argv[0]==NULL`.
- [1e414af][1e414af] Added `connect()` alias for `remote()`
+ For example, `io=connect('google.com', 80)`
+ This also works with `tcp(...)` and `udp(...)` aliases
- [869ec42][869ec42] Added `ssh.read()` and `ssh.write()` aliases
- [2af55c9][2af55c9] `AdbDevice` objects exposed via e.g. `adb.devices()` now offer scoped access to all `adb` module properties
+ It is now possible to e.g. `map(lambda d: d.process(['id']).recvall(), adb.devices())`
[629]: https://github.com/Gallopsled/pwntools/issues/629
[695]: https://github.com/Gallopsled/pwntools/pull/695
[700]: https://github.com/Gallopsled/pwntools/pull/700
[701]: https://github.com/Gallopsled/pwntools/pull/701
[704]: https://github.com/Gallopsled/pwntools/pull/704
[711]: https://github.com/Gallopsled/pwntools/pull/711
[717]: https://github.com/Gallopsled/pwntools/pull/717
[709]: https://github.com/Gallopsled/pwntools/pull/709
[705]: https://github.com/Gallopsled/pwntools/pull/705
[703]: https://github.com/Gallopsled/pwntools/pull/703
[452605e]: https://github.com/Gallopsled/pwntools/commit/452605e854f4870ef5ccfdf7fb110dfd75c50feb
[ea94ee4]: https://github.com/Gallopsled/pwntools/commit/ea94ee4ca5a8060567cc9bd0dc33796a89ad0b95
[6376d07]: https://github.com/Gallopsled/pwntools/commit/6376d072660fb2250f48bd22629bbd7e3c61c758
[1e414af]: https://github.com/Gallopsled/pwntools/commit/1e414afbeb3a01242f4918f111febaa63b640eb7
[869ec42]: https://github.com/Gallopsled/pwntools/commit/869ec42082b4b98958dfe85103da9b101dde7daa
[4893819]: https://github.com/Gallopsled/pwntools/commit/4893819b4c23182da570e2f4ea4c14d73af2c0df
[2af55c9]: https://github.com/Gallopsled/pwntools/commit/2af55c9bc382eca23f89bc0abc7a07c075521f94
## 3.1.1
Fixed a bug in `MemLeak.struct` (PR: #768).
## 3.1.0
A number of smaller bugfixes and documentation tweaks.
## 3.0.4
- Fixed a bug that made 3.0.3 uninstallable (Issue: #751, PR: #752)
## 3.0.3
- Fixed some performance and usability problems with the update system (Issues:
#723, #724, #736. PRs: #729, #738, #747).
- Fixed a bug related to internals in pyelftools (PRs: #730, #746).
- Fixed an issue with travis (Issue: #741, PRs: #743, #744, #745).
## 3.0.2
- Cherry-pick #695, as this was a regression-fix.
- Added a fix for the update checker, as it would suggest prereleases as updates to stable releases.
- Various documentation fixes.
## 3.0.1
A small bugfix release. There were a lot of references to the `master`-branch, however after 3.0.0 we use the names `stable`, `beta` and `dev` for our branches.
## 3.0.0
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 https://pwntools.readthedocs.org.
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_elf` and `asm.make_elf_from_assembly`.
- `asm` and `shellcraft` command-line tools support flags for the new shellcode encoders
- `asm` and `shellcraft` command-line tools support `--debug` flag for automatically launching GDB on the result
- Added MIPS, PowerPC, and AArch64 support to the `shellcraft` module
- Added Cyber Grand Challenge (CGC) support to the `shellcraft` module
- Added syscall wrappers for every Linux syscall for all supported architectures to the `shellcraft` module
+ e.g. `shellcraft.<arch>.gettimeofday`
- (e.g. `shellcraft.i386.linux.`)
- Added in-memory ELF loaders for most supported architectures
+ Only supports statically-linked binaries
+ `shellcraft.<arch>.linux.loader`
#### Context Module
- Added `context.aslr` which controls ASLR on launched processes. This works with both `process()` and `ssh.process()`, and can be specified per-process with the `aslr=` keyword argument.
- Added `context.binary` which automatically sets all `context` variables from an ELF file.
- Added `context.device`, `context.adb`, `context.adb_port`, and `context.adb_host` for connecting to Android devices.
- Added `context.kernel` setting for SigReturn-Oriented-Programming (SROP).
- Added `context.log_file` setting for sending logs to a file. This can be set with the `LOG_FILE` magic command-line option.
- Added `context.noptrace` setting for disabling actions which require `ptrace` support. This is useful for turning all `gdb.debug` and `gdb.attach` options into no-ops, and can be set via the `NOPTRACE` magic command-line option.
- Added `context.proxy` which hooks all connections and sends them to a SOCKS4/SOCKS5. This can be set via the `PROXY` magic command-line option.
- Added `context.randomize` to control randomization of settings like XOR keys and register ordering (default off).
- Added `context.terminal` for setting how to launch commands in a new terminal.
#### DynELF and MemLeak Module
- Added a `DynELF().libc` property which attempt to find the remote libc and download the ELF from LibcDB.
- Added a `DynELF().stack` property which leaks the `__environ` pointer from libc, making it easy to leak stack addresses.
- Added `MemLeak.String` and `MemLeak.NoNewlines` and 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.compare` to 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.encoders` module for assembled-shellcode encoders/decoders
- Includes position-independent 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 `Core` object 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 `fmtstr` module 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()` and `gdb.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 documentation
+ `aslr` controls ASLR
+ `setuid` can disable the effect of setuid, allowing core dumps (useful for extracting crash state via the new `Core()` object)
+ TTY echo and control characters can be enabled via `raw` argument
- `stdout` and `stderr` are now PTYs by default
+ `stdin` can be set to a PTY also via setting `stdin=process.PTY`
#### Tubes SSH Module
- Massive enhancements all over
- `ssh` objects now have a `ssh.process()` method which avoids the need to handle shell expansion via the old `ssh.run()` method
- Files are downloaded via SFTP if available
- New `download` and `upload` methods auto-detect whether the target is a file or directory and acts accordingly
- Added `listen()` method alias for `listen_remote()`
- Added `remote()` method alias for `connect_remote()`
#### Utilities
- Added `fit()` method to combine the functionality of `flat()` with the functionality of `cyclic()`
- 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 of `alarm()` after you've popped a shell.
## 2.2.0
This was a large release with a lot of bugfixes and changes. Only the most significant
are mentioned here.
@@ -16,3 +582,11 @@ are mentioned here.
- Added a serial tube
- Huge performance gains in the buffering for tubes
- Re-added user agents
- Begun using Travis CI with lots of test
- Removed bundled binutils in favor of documenting how to build them yourselves
- Added support for port forwarding though our SSH module
- Added dependency for capstone and ropgadget
- Added a lots of shellcodes
- Stuff we forgot
- Lots of documentation fixes
- Lots of bugfixes
+10 -13
View File
@@ -1,7 +1,5 @@
# Contributing
We love pull requests!
Github has a great guide for contributing to open source projects:
- [Contributing to a project](https://guides.github.com/activities/forking/)
@@ -11,7 +9,7 @@ Github has a great guide for contributing to open source projects:
- [Making a Pull Request](https://guides.github.com/activities/forking/#making-a-pull-request)
- [Huzzah!](https://guides.github.com/activities/forking/#huzzah)
## Pwntools Specifics
## pwntools Specifics
In general, we like to keep things documented. You should add documentation to any new functionality, and update it for any changed functionality. Our docstrings use the [Google Style Python Docstrings](https://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html#example-google).
@@ -21,18 +19,17 @@ Finally, it is probably a good idea to run the test suite locally before doing
the pull-request to make sure everything works, however this is not a
requirement.
Once you are ready to do a pull-request, you should figure out if your changes
constitutes a new feature or a bugfix in stable or beta. If it is a bugfix in
stable or beta, you should do the pull-request against the branch in question,
and otherwise your pull-request should be against the dev branch.
Once you do the pull-request Travis CI will run the test-suite on it. Once it
passes one of the core developers will look at your pull request, possibly
comment on it and then hopefully merge it into master.
comment on it and then hopefully merge it into the branch in question.
## Test Suite
## Automated Testing
To run the test suite, you should be running Ubuntu 12.04 or 14.04, and run the following commands. **Be aware** that this will add a user to your machine, and create a public key for SSH login!
Pull requests against Pwntools require at a minimum that no tests have been broken, and ideally each pull request will include new tests to ensure that all of the functionality works as intended.
```sh
bash .travis_install.sh
bash .travis_ssh_setup.sh
cd docs
pip install -r requirements.txt
make doctest
```
You can find more information on testing in [TESTING.md](TESTING.md).
+1 -1
View File
@@ -13,7 +13,7 @@ directories:
- pwnlib/data/
Copyright (c) 2013 Gallopsled
Copyright (c) 2015 Gallopsled et al.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+7 -1
View File
@@ -1 +1,7 @@
include *.txt
graft examples
graft extra
include *.md *.txt *.sh *.yml MANIFEST.in
recursive-include docs *.rst *.png Makefile *.py *.txt
recursive-include pwnlib *.py *.asm *.rst *.md *.txt *.sh __doc__ *.mako
recursive-include pwn *.py *.asm *.rst *.md *.txt *.sh
recursive-exclude *.pyc
+23 -22
View File
@@ -1,11 +1,14 @@
# pwntools - CTF toolkit
[![Docs latest](https://readthedocs.org/projects/pwntools/badge/)](https://pwntools.readthedocs.org/en/latest)
[![Docs 2.1.3](https://readthedocs.org/projects/pwntools/badge/?version=2.1.3)](https://pwntools.readthedocs.org/en/2.1.3)
[![PyPI](https://img.shields.io/pypi/v/pwntools.svg)](https://pypi.python.org/pypi/pwntools/)
[![Gittip](https://img.shields.io/gittip/gallopsled.svg)](https://www.gittip.com/gallopsled/)
[![Travis](https://travis-ci.org/Gallopsled/pwntools.svg)](https://travis-ci.org/Gallopsled/pwntools)
![pwntools logo](https://github.com/Gallopsled/pwntools/blob/stable/docs/source/logo.png?raw=true)
This is the CTF framework used by Gallopsled in every CTF.
[![Docs](https://readthedocs.org/projects/pwntools/badge/?version=stable)](https://docs.pwntools.com/)
[![PyPI](https://img.shields.io/badge/pypi-v3.11.0-green.svg?style=flat)](https://pypi.python.org/pypi/pwntools/)
[![Travis](https://travis-ci.org/Gallopsled/pwntools.svg)](https://travis-ci.org/Gallopsled/pwntools)
[![Coveralls](https://img.shields.io/coveralls/Gallopsled/pwntools/dev.svg)](https://coveralls.io/github/Gallopsled/pwntools?branch=dev)
[![Twitter](https://img.shields.io/badge/twitter-pwntools-4099FF.svg?style=flat)](https://twitter.com/pwntools)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
Pwntools is a CTF framework and exploit development library. Written in Python, it is designed for rapid prototyping and development, and intended to make exploit writing as simple as possible.
```python
from pwn import *
@@ -17,32 +20,30 @@ r.send(asm(shellcraft.sh()))
r.interactive()
```
However we have made command-line frontends for some of the functionality
in `pwnlib`. These are:
# Try It Now!
* `asm`/`disasm`: Small wrapper for various assemblers.
* `constgrep`: Tool for finding constants defined in header files.
* `cyclic`: De Bruijn sequence generator and lookup tool.
* `hex`/`unhex`: Command line tools for doing common hexing/unhexing operations.
* `shellcraft`: Frontend to our shellcode.
* `phd`: Replacement for `hexdump` with colors.
You can now do a live demo of Pwntools, [right in your browser](https://demo.pwntools.com).
# Documentation
Our documentation is available at [pwntools.readthedocs.org](https://pwntools.readthedocs.org/en/latest/)
Our documentation is available at [docs.pwntools.com](https://docs.pwntools.com/)
To get you started, we've provided some example solutions for past CTF challenges in our [write-ups repository](https://github.com/Gallopsled/pwntools-write-ups).
# Installation
pwntools is best supported on Ubuntu 12.04 and 14.04, but most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.).
Pwntools is best supported on 64-bit Ubuntu LTE releases (12.04, 14.04, and 16.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.). Python 2.7 is required.
Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with
```sh
pip install pwntools
apt-get update
apt-get install python2.7 python-pip python-dev git libssl-dev libffi-dev build-essential
pip install --upgrade pip
pip install --upgrade pwntools
```
However, some of the features (ROP generation and assembling/disassembling foreign architectures) require non-Python dependencies. For more information, see the [complete installation instructions here](https://pwntools.readthedocs.org/en/latest/install.html).
However, some of the features (assembling/disassembling foreign architectures) require non-Python dependencies. For more information, see the [complete installation instructions here](https://docs.pwntools.com/en/stable/install.html).
# Contribution
@@ -50,7 +51,7 @@ However, some of the features (ROP generation and assembling/disassembling forei
See [CONTRIBUTING.md](CONTRIBUTING.md)
# Contact
If you have any questions not worthy of a [bug report](https://github.com/Gallopsled/pwntools/issues), feel free to join us
at [`#gallopsled` on Freenode](irc://irc.freenode.net/gallopsled) and ask away.
Click [here](https://kiwiirc.com/client/irc.freenode.net/gallopsled) to connect.
If you have any questions not worthy of a [bug report](https://github.com/Gallopsled/pwntools/issues), feel free to ping us
at [`#pwntools` on Freenode](irc://irc.freenode.net/pwntools) and ask away.
Click [here](https://kiwiirc.com/client/irc.freenode.net/pwntools) to connect.
There is also a [mailing list](https://groups.google.com/forum/#!forum/pwntools-users) for higher latency discussion.
+44
View File
@@ -0,0 +1,44 @@
# Testing
Pwntools makes extensive use of unit tests and integration tests to ensure everything is in working order, and no regressions occur.
## Test Suite
To run the test suite, it is best to use Ubuntu 12.04 or 14.04, and run the following commands. **Be aware** that this will add a user to the machine, and create a public key for SSH login!
```sh
bash travis/install.sh
bash travis/ssh_setup.sh
pip install --upgrade --editable .
PWNLIB_NOTERM=1 make -C docs doctest
```
## Testing in Docker
A `Dockerfile` has been provided which has a clean testing environment with Ubuntu Xenial. It is very similar to the online Travis CI testing environment, but uses a more modern version of Ubuntu.
See `travis/docker/README.md` for more information.
## New Tests
To add a new test to an existing module, just add an inline doctest. If the test needs access to an external module, add the import statement to the `testsetup` block in the corresponding file in `docs/source/<module>.rst`.
To add an entirely new module, create a new `module.rst` and add it to the list in `index.rst`. The best way to see if your tests are actually being run is to add an intentionally-failing test like:
```py
>>> assert False
```
## Example Test Module
The module `pwnlib.testexample` exists to demonstrate how everything is tied together. The only files which were modified to add this example module and run its tests automatically are:
- `pwnlib/testexample.py`
- `docs/source/testexample.rst`
- `docs/source/index.rst`
## Shellcode and ROP
These are both less easy to test, as they require actually executing code, or loading real binaries. In order to make the process simpler, the `runner` library was created to wrap common tasks. For an example of testing shellcode with these helpers, see [exit.asm](pwnlib/shellcraft/templates/i386/linux/exit.asm).
Additionally, for loading ELF files on-the-fly, the helpers `ELF.from_bytes` and `ELF.from_assembly` are available.
Regular → Executable
+14 -1
View File
@@ -6,6 +6,8 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
DASHBUILD = ./dashbuild.py
TAR = tar
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -14,7 +16,8 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext dash
help:
@echo "Please use \`make <target>' where <target> is one of"
@@ -34,12 +37,17 @@ help:
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " dash to make a Dash docset"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
-rm -rf /tmp/user/pwn*
-rm -rf $(HOME)/.pwntools-cache
-rm -rf /tmp/pwn* 2>/dev/null || true
-rm -rf build
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@@ -136,6 +144,11 @@ gettext:
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
dash:
$(DASHBUILD) source $(BUILDDIR)/dash
$(TAR) --exclude='.DS_Store' -cvzf $(BUILDDIR)/dash/pwntools.tgz -C $(BUILDDIR)/dash pwntools.docset
@echo "Build finished. The Dash docset is in $(BUILDDIR)/dash."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
+99
View File
@@ -0,0 +1,99 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Helper to build Dash docset from sphinx source files.
#
# Dash docsets can be read by various applications:
#
# Dash OS X, iOS https://kapeli.com
# Zeal Linux, Windows https://zealdocs.org
# Velocity Windows http://velocity.silverlakesoftware.com
# LovelyDocs Android http://lovelydocs.io
# dasht POSIX https://github.com/sunaku/dasht
# Helm Dash emacs https://github.com/areina/helm-dash
#
import argparse
import doc2dash.__main__
import os, os.path
import sphinx
import sqlite3
import sys
sys.path.append(os.path.abspath(os.path.join('..', 'pwnlib')))
import version
def main(args):
"""Generate a Dash docset from Sphinx source files."""
srcdir = args.srcdir
dstdir = args.dstdir
name = args.name
if not os.path.exists(dstdir):
os.makedirs(dstdir)
# Generate HTML without indices.
sphinx.build_main([ "sphinx-build", "-b", "html", "-d", os.path.join(dstdir, "doctrees"), \
"-t", "dash", srcdir, os.path.join(dstdir, "html") ])
# Convert to docset.
try:
doc2dash.__main__.main.main( \
[ os.path.join(dstdir, "html"), "-d", dstdir, "-n", name, \
"-f", "-I", "index.html"], "doc2dash", False)
except SystemExit,e:
pass
# Insert a link to the online version.
online = args.online
if online is not None and online != "":
url = online.replace("@VERSION", args.version)
with open(os.path.join(dstdir, name+".docset", "Contents", "Info.plist"), "r+") as f_info:
pl = f_info.read()
pl = pl.replace("</dict>", \
"\t<key>DashDocSetFallbackURL</key>\n\t<string>%s</string>\n</dict>" % url)
f_info.seek(0)
f_info.write(pl)
f_info.truncate()
# Modify the CSS to hide the menu included in the HTML.
with open(os.path.join(dstdir, name+".docset", "Contents", "Resources", "Documents", "_static", "css", "theme.css"), "r+") as f_css:
css = f_css.read()
css = css.replace( \
'@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}',\
'@media screen {.wy-body-for-nav{background:#fcfcfc}' )
css = css.replace( \
'@media screen and (max-width: 480px)', \
'@media screen ')
f_css.seek(0)
f_css.write(css)
f_css.truncate()
# Modify the index
db_conn = sqlite3.connect(os.path.join(dstdir, name+".docset", "Contents", "Resources", "docSet.dsidx"))
try:
db_conn.execute('INSERT INTO "searchIndex" ("name","type","path") VALUES ' \
'("1 Contents", "Guide", "index.html"), ' \
'("2 About pwntools", "Guide", "about.html"), ' \
'("3 Installation", "Guide", "install.html"), ' \
'("4 Getting Started", "Guide", "intro.html"), ' \
'("5 Globals (pwn)", "Guide", "globals.html"), ' \
'("6 Command Line Tools", "Guide", "commandline.html")')
db_conn.execute('DELETE FROM "searchIndex" WHERE "type" = "Module" AND ("name" = "pwn" OR "name" = "pwnlib")')
db_conn.commit()
finally:
db_conn.close()
return 0
parser = argparse.ArgumentParser()
parser.add_argument("--name", help="docset name", default="pwntools")
parser.add_argument("--online", help="URL for online docs", default="https://pwntools.readthedocs.org/en/@VERSION/")
parser.add_argument("--version", help="pwntools version", default=version.__version__)
parser.add_argument("srcdir", help="Source directory containing .rst files")
parser.add_argument("dstdir", help="Destination and working directory")
main(parser.parse_args())
Regular → Executable
+15 -5
View File
@@ -1,6 +1,16 @@
paramiko
argparse
mako
pyelftools
sphinxcontrib-napoleon
sphinxcontrib-autoprogram
sphinxcontrib-autoprogram==0.1.2
isort
paramiko>=1.15.2
mako>=1.0.0
pyelftools>=0.2.3
capstone
ropgadget>=5.3
pyserial>=2.7
requests>=2.5.1
pip>=6.0.8
tox>=1.8.1
pygments>=2.0
sphinx_rtd_theme
doc2dash
coveralls
+3 -3
View File
@@ -11,7 +11,7 @@ nice side-effects.
When redesigning pwntools for 2.0, we noticed two contrary goals:
* We would like to have a "normal" python module structure, to allow other
people to faster get familiar with how pwntools works.
people to familiarize themselves with pwntools quickly.
* We would like to have even more side-effects, especially by putting the
terminal in raw-mode.
@@ -30,10 +30,10 @@ the following:
* Imports everything from the toplevel :mod:`pwnlib` along with
functions from a lot of submodules. This means that if you do
``import pwn`` or ``from pwn import *``, you will access to
``import pwn`` or ``from pwn import *``, you will have access to
everything you need to write an exploit.
* Calls :func:`pwnlib.term.init` to put your terminal in raw mode
and implementing functionality to make it look like it is not.
and implements functionality to make it appear like it isn't.
* Setting the :data:`pwnlib.context.log_level` to `"info"`.
* Tries to parse some of the values in :data:`sys.argv` and every
value it succeeds in parsing it removes.
+13
View File
@@ -0,0 +1,13 @@
.. testsetup:: *
from pwn import *
adb = pwnlib.adb
:mod:`pwnlib.adb` --- Android Debug Bridge
=====================================================
.. automodule:: pwnlib.adb.adb
:members:
.. automodule:: pwnlib.adb.protocol
:members:
+9
View File
@@ -0,0 +1,9 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.args` --- Magic Command-Line Arguments
=====================================================
.. automodule:: pwnlib.args
:members:
+15
View File
@@ -1,10 +1,25 @@
.. testsetup:: *
import tempfile
import subprocess
from pwnlib.context import context
from pwnlib.asm import *
from pwnlib import shellcraft
from pwnlib.tubes.process import process
:mod:`pwnlib.asm` --- Assembler functions
=========================================
.. automodule:: pwnlib.asm
:members:
Internal Functions
-----------------------------------------
These are only included so that their tests are run.
You should never need these.
.. autofunction:: pwnlib.asm.dpkg_search_for_binutils
.. autofunction:: pwnlib.asm.print_binutils_instructions
+2 -30
View File
@@ -14,33 +14,5 @@ pwntools comes with a handful of useful command-line utilities which serve as wr
.. toctree::
.. autoprogram:: pwnlib.commandline.asm:parser
:prog: asm
.. autoprogram:: pwnlib.commandline.constgrep:p
:prog: constgrep
.. autoprogram:: pwnlib.commandline.cyclic:parser
:prog: cyclic
.. autoprogram:: pwnlib.commandline.disasm:parser
:prog: disasm
.. autoprogram:: pwnlib.commandline.elfdiff:p
:prog: elfdiff
.. autoprogram:: pwnlib.commandline.elfpatch:p
:prog: elfpatch
.. autoprogram:: pwnlib.commandline.hex:parser
:prog: hex
.. autoprogram:: pwnlib.commandline.phd:parser
:prog: phd
.. autoprogram:: pwnlib.commandline.shellcraft:p
:prog: shellcraft
.. autoprogram:: pwnlib.commandline.unhex:parser
:prog: unhex
.. autoprogram:: pwnlib.commandline.main:parser
:prog: pwn
Regular → Executable
+116 -11
View File
@@ -11,13 +11,19 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os, subprocess
import os
import subprocess
import sys
build_dash = tags.has('dash')
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../..'))
import pwnlib
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@@ -38,20 +44,58 @@ extensions = [
'sphinxcontrib.napoleon'
]
# Disable "info" logging directly to stdout by Sphinx
import logging
class SphinxPwnlibFilter(logging.Filter):
def filter(self, record):
if record.name.startswith('pwn'):
return False
if record.name.startswith('paramiko'):
return False
return True
log_filter = SphinxPwnlibFilter()
for i, handler in enumerate(logging.root.handlers):
print("Filtering Sphinx handler", handler)
handler.addFilter(log_filter)
# Napoleon settings
napoleon_use_ivar = True
napoleon_use_rtype = False
doctest_global_setup = '''
import sys, os
os.environ['PWNLIB_NOTERM'] = '1'
os.environ['PWNLIB_RANDOMIZE'] = '0'
import pwnlib
pwnlib.context.context.reset_local()
pwnlib.context.ContextType.defaults['log_level'] = 'ERROR'
pwnlib.context.ContextType.defaults['randomize'] = False
pwnlib.util.fiddling.default_style = {}
pwnlib.term.text.when = 'never'
pwnlib.log.install_default_handler()
pwnlib.log.rootlogger.setLevel(1)
# Sphinx modifies sys.stdout, and context.log_terminal has
# a reference to the original instance. We need to update
# it for logging to be captured.
class stdout(object):
def __getattr__(self, name):
return getattr(sys.stdout, name)
def __setattr__(self, name, value):
return setattr(sys.stdout, name, value)
pwnlib.context.ContextType.defaults['log_console'] = stdout()
'''
autodoc_member_order = 'alphabetical'
autoclass_content = 'both'
autodoc_member_order = 'groupwise' # 'alphabetical'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
doctest_test_doctest_blocks = True
doctest_test_doctest_blocks = 'true'
# The suffix of source filenames.
source_suffix = '.rst'
@@ -64,14 +108,13 @@ master_doc = 'index'
# General information about the project.
project = u'pwntools'
copyright = u'2014, Gallopsled et al'
copyright = u'2016, Gallopsled et al.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
import pwnlib
release = pwnlib.__version__
version = release.rsplit('.', 1)[0]
@@ -161,10 +204,10 @@ html_static_path = []
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
html_domain_indices = not build_dash
# If false, no index is generated.
#html_use_index = True
html_use_index = not build_dash
# If true, the index is split into individual pages for each letter.
#html_split_index = False
@@ -207,11 +250,11 @@ latex_elements = {
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'pwntools.tex', u'pwntools Documentation',
u'Gallopsled et al', 'manual'),
u'2016, Gallopsled et al.', 'manual'),
]
intersphinx_mapping = {'python': ('https://docs.python.org/2.7', None),
'paramiko': ('https://paramiko-docs.readthedocs.org/en/1.15/', None)}
'paramiko': ('https://paramiko-docs.readthedocs.org/en/2.1/', None)}
# The name of an image file (relative to this directory) to place at the top of
# the title page.
@@ -240,7 +283,7 @@ intersphinx_mapping = {'python': ('https://docs.python.org/2.7', None),
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pwntools', u'pwntools Documentation',
[u'Gallopsled et al'], 1)
[u'2016, Gallopsled et al.'], 1)
]
# If true, show URL addresses after external links.
@@ -254,7 +297,7 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'pwntools', u'pwntools Documentation',
u'Gallopsled et al', 'pwntools', 'One line description of project.',
u'', 'pwntools', 'CTF exploit writing toolkit.',
'Miscellaneous'),
]
@@ -312,3 +355,65 @@ def linkcode_resolve(domain, info):
pass
return "https://github.com/Gallopsled/pwntools/blob/%s/%s" % (branch, filename)
# The readthedocs theme is used by the Dash generator. (Can be used for HTML too.)
if build_dash:
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
# -- Customization to Sphinx autodoc generation --------------------------------------------
import sphinx.ext.autodoc
from sphinx.util.inspect import safe_getmembers, safe_getattr
# Test hidden members (e.g. def _foo(...))
def dont_skip_any_doctests(app, what, name, obj, skip, options):
return False
# Test non-exported members
class ModuleDocumenter(sphinx.ext.autodoc.ModuleDocumenter):
def get_object_members(self, want_all):
if want_all:
# if not hasattr(self.object, '__all__'):
# for implicit module members, check __module__ to avoid
# documenting imported objects
return True, safe_getmembers(self.object)
# else:
# memberlist = self.object.__all__
# # Sometimes __all__ is broken...
# if not isinstance(memberlist, (list, tuple)) or not \
# all(isinstance(entry, string_types) for entry in memberlist):
# self.directive.warn(
# '__all__ should be a list of strings, not %r '
# '(in module %s) -- ignoring __all__' %
# (memberlist, self.fullname))
# # fall back to all members
# return True, safe_getmembers(self.object)
else:
memberlist = self.options.members or []
ret = []
for mname in memberlist:
try:
ret.append((mname, safe_getattr(self.object, mname)))
except AttributeError:
self.directive.warn(
'missing attribute mentioned in :members: or __all__: '
'module %s, attribute %s' % (
safe_getattr(self.object, '__name__', '???'), mname))
return False, ret
if 'doctest' in sys.argv:
def setup(app):
app.connect('autodoc-skip-member', dont_skip_any_doctests)
sphinx.ext.autodoc.ModuleDocumenter = ModuleDocumenter
+4
View File
@@ -0,0 +1,4 @@
:mod:`pwnlib.config` --- Pwntools Configuration File
====================================================
.. automodule:: pwnlib.config
+25 -8
View File
@@ -1,16 +1,33 @@
.. testsetup:: *
import pwnlib
from pwnlib.context import context
import threading, logging
from pwn import *
import logging
log = pwnlib.log.getLogger('pwnlib.context')
context.clear()
:mod:`pwnlib.context` --- Setting runtime variables
=====================================================
.. autodata:: pwnlib.context.context
Many settings in ``pwntools`` are controlled via the global variable :data:`.context`, such as the selected target operating system, architecture, and bit-width.
.. autoclass:: pwnlib.context.ContextType
:members:
In general, exploits will start with something like:
.. autoclass:: pwnlib.context.Thread
.. code-block:: python
from pwn import *
context.arch = 'amd64'
Which sets up everything in the exploit for exploiting a 64-bit Intel binary.
The recommended method is to use ``context.binary`` to automagically set all of the appropriate values.
.. code-block:: python
from pwn import *
context.binary = './challenge-binary'
Module Members
----------------------------------------------------
.. automodule:: pwnlib.context
:members:
+11 -3
View File
@@ -3,8 +3,16 @@
from pwnlib.elf import *
from pwnlib.util.misc import which
:mod:`pwnlib.elf` --- Working with ELF binaries
===============================================
:mod:`pwnlib.elf` --- ELF Executables and Libraries
===================================================
.. automodule:: pwnlib.elf
:members:
ELF Modules
-------------------
.. toctree::
elf/elf
elf/config
elf/corefile
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
from pwnlib.elf.config import parse_kconfig
:mod:`pwnlib.elf.config` --- Kernel Config Parsing
===========================================================
.. automodule:: pwnlib.elf.config
:members:
+15
View File
@@ -0,0 +1,15 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.elf.corefile` --- Core Files
===========================================================
.. automodule:: pwnlib.elf.corefile
.. autoclass:: pwnlib.elf.corefile.Corefile
:members:
:show-inheritance:
.. autoclass:: pwnlib.elf.corefile.Mapping
:members:
+28
View File
@@ -0,0 +1,28 @@
.. testsetup:: *
from pwn import *
from glob import glob
:mod:`pwnlib.elf.elf` --- ELF Files
===========================================================
.. automodule:: pwnlib.elf.elf
.. autoclass:: pwnlib.elf.elf.ELF
:members:
:show-inheritance:
:inherited-members:
:exclude-members: address_offsets,
get_data,
get_dwarf_info,
get_section,
get_segment,
has_dwarf_info,
iter_sections,
iter_segments
.. autoclass:: pwnlib.elf.elf.Function
:members:
.. autoclass:: pwnlib.elf.elf.dotdict
:members:
+25
View File
@@ -0,0 +1,25 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.encoders` --- Encoding Shellcode
===============================================
.. automodule:: pwnlib.encoders
:members:
.. automodule:: pwnlib.encoders.encoder
:members:
.. automodule:: pwnlib.encoders.amd64
:members:
.. automodule:: pwnlib.encoders.arm
:members:
.. automodule:: pwnlib.encoders.i386
:members:
.. automodule:: pwnlib.encoders.i386.xor
:members:
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.flag` --- CTF Flag Management
==========================================
.. automodule:: pwnlib.flag
:members:
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
import tempfile
:mod:`pwnlib.fmtstr` --- Format string bug exploitation tools
=============================================================
.. automodule:: pwnlib.fmtstr
:members:
+4
View File
@@ -1,3 +1,7 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.gdb` --- Working with GDB
======================================
+6 -6
View File
@@ -13,11 +13,11 @@ Which imports a bazillion things into the global namespace to make your life eas
This is a quick list of most of the objects and routines imported, in rough order of importance and frequency of use.
- ``context``
- :mod:`pwnlib.context`
- :data:`pwnlib.context.context`
- Responsible for most of the pwntools convenience settings
- Set `context.log_level = 'debug'` when troubleshooting your exploit
- Scope-aware, so you can disable logging for a subsection of code via ``pwnlib.context.ContextType.local``
- Scope-aware, so you can disable logging for a subsection of code via :meth:`.ContextType.local`
- ``remote``, ``listen``, ``ssh``, ``process``
- :mod:`pwnlib.tubes`
- Super convenient wrappers around all of the common functionality for CTF challenges
@@ -57,11 +57,11 @@ This is a quick list of most of the objects and routines imported, in rough orde
- ``gdb.debug`` and ``gdb.attach``
- :mod:`pwnlib.gdb`
- Launch a binary under GDB and pop up a new terminal to interact with it. Automates setting breakpoints and makes iteration on exploits MUCH faster.
- Alternately, attach to a running process given a PID, ``pwnlib.tubes`` object, or even just a socket that's connected to it
- Alternately, attach to a running process given a PID, :mod:`pwnlib.tubes` object, or even just a socket that's connected to it
- ``args``
- Dictionary contining all-caps command-line arguments for quick access
- Dictionary containing all-caps command-line arguments for quick access
- Run via ``python foo.py REMOTE=1`` and ``args['REMOTE'] == '1'``.
- Can also control logging verbosity and terminal fancyness
- Can also control logging verbosity and terminal fanciness
- `NOTERM`
- `SILENT`
- `DEBUG`
@@ -78,7 +78,7 @@ This is a quick list of most of the objects and routines imported, in rough orde
- It's the new ``getch``
- ``safeeval``
- :mod:`pwnlib.util.safeeval`
- Functions for safely evalutaing python code without nasty side-effects.
- Functions for safely evaluating python code without nasty side-effects.
These are all pretty self explanatory, but are useful to have in the global namespace.
Regular → Executable
+40 -5
View File
@@ -5,6 +5,20 @@ pwntools
Written in Python, it is designed for rapid prototyping and development,
and intended to make exploit writing as simple as possible.
The primary location for this documentation is at docs.pwntools.com_, which uses
readthedocs_. It comes in three primary flavors:
- Stable_
- Beta_
- Dev_
.. _readthedocs: https://readthedocs.org
.. _docs.pwntools.com: https://docs.pwntools.com
.. _Stable: https://docs.pwntools.com/en/stable
.. _Beta: https://docs.pwntools.com/en/beta
.. _Dev: https://docs.pwntools.com/en/dev
Getting Started
---------------
@@ -28,30 +42,51 @@ Each of the ``pwntools`` modules is documented here.
:maxdepth: 1
:glob:
adb
args
asm
atexception
atexit
constants
config
context
dynelf
encoders
elf
exception
flag
fmtstr
gdb
libcdb
log
memleak
protocols
qemu
replacements
rop
rop/*
runner
shellcraft
shellcraft/*
term
timeout
tubes
tubes/*
ui
update
useragents
util/*
Indices and tables
==================
.. toctree::
:hidden:
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
testexample
.. only:: not dash
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
+8 -12
View File
@@ -20,27 +20,23 @@ following system libraries installed.
Released Version
-----------------
Pwntools is available as a ``pip`` package.
pwntools is available as a ``pip`` package.
.. code-block:: bash
$ apt-get install python2.7 python2.7-dev python-pip
$ pip install pwntools
$ apt-get update
$ apt-get install python2.7 python-pip python-dev git libssl-dev libffi-dev build-essential
$ pip install --upgrade pip
$ pip install --upgrade pwntools
Latest Version
Development
--------------
Alternatively if you prefer to use the latest version from the
repository:
If you are hacking on Pwntools locally, you'll want to do something like this:
.. code-block:: bash
$ git clone https://github.com/Gallopsled/pwntools
$ cd pwntools
$ pip install -e .
$ pip install --upgrade --editable ./pwntools
.. _Ubuntu: https://launchpad.net/~pwntools/+archive/ubuntu/binutils
.. _libcapstone 2.1: http://www.capstone-engine.org
.. _i386: http://www.capstone-engine.org/download/2.1.2/capstone-2.1.2_i386.deb
.. _amd64: http://www.capstone-engine.org/download/2.1.2/capstone-2.1.2_amd64.deb
+8 -5
View File
@@ -7,15 +7,20 @@ installed. We've made this process as smooth as we can.
In these examples, replace ``$ARCH`` with your target architecture (e.g., arm, mips64, vax, etc.).
Building `binutils` from source takes about 60 seconds on a modern 8-core machine.
Ubuntu
^^^^^^^^^^^^^^^^
First, add our `Personal Package Archive repository <http://binutils.pwntools.com>`__.
For Ubuntu 12.04 through 15.10, you must first add the pwntools `Personal Package Archive repository <http://binutils.pwntools.com>`__.
Ubuntu Xenial (16.04) has official packages for most architectures, and does not require this step.
.. code-block:: bash
$ apt-get install software-properties-common
$ apt-add-repository ppa:pwntools/binutils
$ apt-get updatez
$ apt-get update
Then, install the binutils for your architecture.
@@ -56,8 +61,6 @@ OSes, ``binutils`` is simple to build by hand.
gpg --keyserver keys.gnupg.net --recv-keys 4AE55E93
gpg --verify binutils-$V.tar.gz.sig
rm -rf binutils-*
tar xf binutils-$V.tar.gz
mkdir binutils-build
@@ -77,6 +80,6 @@ OSes, ``binutils`` is simple to build by hand.
MAKE=gmake
hash gmake || MAKE=make
$MAKE -j
$MAKE -j clean all
sudo $MAKE install
-27
View File
@@ -1,27 +0,0 @@
Capstone
-------------
Capstone is a disassembly library required for gathering ROP gadgets
and ROP chain generation.
It's a separate requirement from ``binutils`` because it's used by
Jon Salwan's ``ROPgadget`` tool which we use under the covers.
In particular, version ``2.1.2`` should be used. Capstone can be downloaded here_, or installed with the steps below.
Ubuntu
^^^^^^^^^^^^^^^^
.. code-block:: bash
$ wget -nc http://www.capstone-engine.org/download/2.1.2/capstone-2.1.2_amd64.deb
$ apt-get install capstone-2.1.2_amd64.deb
Mac OS X
^^^^^^^^^^^^^^^^
.. code-block:: bash
$ brew install capstone
.. _here: http://www.capstone-engine.org/download.html
+1 -1
View File
@@ -1,5 +1,5 @@
Python Development Headers
-------------
-----------------------------
Some of pwntools' Python dependencies require native extensions (for example, Paramiko requires PyCrypto).
+9 -9
View File
@@ -27,7 +27,7 @@ This exposes a standard interface to talk to processes, sockets, serial ports,
and all manner of things, along with some nifty helpers for common tasks.
For example, remote connections via :mod:`pwnlib.tubes.remote`.
>>> conn = remote('ftp.debian.org',21)
>>> conn = remote('ftp.ubuntu.org',21)
>>> conn.recvline() # doctest: +ELLIPSIS
'220 ...'
>>> conn.send('USER anonymous\r\n')
@@ -67,12 +67,12 @@ actually **interact** with processes.
There's even an SSH module for when you've got to SSH into a box to perform
a local/setuid exploit with :mod:`pwnlib.tubes.ssh`. You can quickly spawn
processes and grab the output, or spawn a process and interact iwth it like
processes and grab the output, or spawn a process and interact with it like
a ``process`` tube.
::
>>> shell = ssh('bandit0', 'bandit.labs.overthewire.org', password='bandit0')
>>> shell = ssh('bandit0', 'bandit.labs.overthewire.org', password='bandit0', port=2220)
>>> shell['whoami']
'bandit0'
>>> shell.download_file('/etc/motd')
@@ -170,14 +170,14 @@ But if you do, it's easy to suss out!
5: eb f9 jmp 0x0
However, you shouldn't even need to write your own shellcode most of the
time! Pwntools comes with the :mod:`pwnlib.shellcraft` module, which is
time! pwntools comes with the :mod:`pwnlib.shellcraft` module, which is
loaded with useful time-saving shellcodes.
Let's say that we want to `setreuid(getuid(), getuid())` followed by `dup`ing
file descriptor 4 to `stdin`, `stdout`, and `stderr`, and then pop a shell!
>>> asm(shellcraft.setreuid() + shellcraft.dupsh(4)).encode('hex')
'6a3158cd8089c389d96a4658cd806a045b6a0359496a3f58cd8075f86a68682f2f2f73682f62696e89e331c96a0b5899cd80'
>>> asm(shellcraft.setreuid() + shellcraft.dupsh(4)).encode('hex') # doctest: +ELLIPSIS
'6a3158cd80...'
Misc Tools
@@ -190,7 +190,7 @@ Find offsets in your buffer that cause a crash, thanks to :mod:`pwnlib.cyclic`.
>>> print cyclic(20)
aaaabaaacaaadaaaeaaa
>>> # Assume EIP = 0x62616166 ('faab') at crash time
>>> # Assume EIP = 0x62616166 ('faab' which is pack(0x62616166)) at crash time
>>> print cyclic_find('faab')
120
@@ -212,8 +212,8 @@ Stop hard-coding things! Look them up at runtime with :mod:`pwnlib.elf`.
You can even patch and save the files.
>>> e = ELF('/bin/cat')
>>> e.read(e.address+1, 3)
'ELF'
>>> e.read(e.address, 4)
'\x7fELF'
>>> e.asm(e.address, 'ret')
>>> e.save('/tmp/quiet-cat')
>>> disasm(file('/tmp/quiet-cat','rb').read(1))
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
from pwnlib.libcdb import *
:mod:`pwnlib.libcdb` --- Libc Database
===========================================
.. automodule:: pwnlib.libcdb
:members:
+17 -3
View File
@@ -1,7 +1,21 @@
:mod:`pwnlib.log` and --- Logging stuff
=================================================================
:mod:`pwnlib.log` --- Logging stuff
===================================
.. automodule:: pwnlib.log
:members: getLogger, install_default_handler, rootlogger
.. autoclass:: pwnlib.log.Progress
:members:
:member-order: bysource
.. autoclass:: pwnlib.log.Logger
:members: debug, info, warn, error, progress, success, failure, indented, info_once, warn_once
:members:
:member-order: bysource
.. autoclass:: pwnlib.log.Handler
:members:
:member-order: bysource
.. autoclass:: pwnlib.log.Formatter
:members:
:member-order: bysource
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

+3 -5
View File
@@ -1,11 +1,9 @@
.. testsetup:: *
from pwnlib.memleak import *
from pwn import *
:mod:`pwnlib.memleak` --- Helper class for leaking memory
=========================================================
.. module:: pwnlib.memleak
.. autoclass:: MemLeak
:members:
.. automodule:: pwnlib.memleak
:members:
+15
View File
@@ -0,0 +1,15 @@
:mod:`pwnlib.protocols` --- Wire Protocols
=============================================
.. automodule:: pwnlib.protocols
Supported Protocols
-------------------
.. toctree::
:maxdepth: 3
:glob:
protocols/*
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
from pwnlib.protocols.adb import AdbClient
:mod:`pwnlib.protocols.adb` --- ADB Protocol Implementation
===========================================================
.. automodule:: pwnlib.protocols.adb
:members:
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.qemu` --- QEMU Utilities
==========================================
.. automodule:: pwnlib.qemu
:members:
+8 -5
View File
@@ -1,11 +1,14 @@
.. testsetup:: *
from pwnlib.elf import *
from pwnlib.rop import *
from pwnlib.util.misc import which
from pwn import *
:mod:`pwnlib.rop` --- Return Oriented Programming
=================================================
.. automodule:: pwnlib.rop
:members:
Submodules
----------
.. toctree::
:glob:
rop/*
+9
View File
@@ -0,0 +1,9 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.rop.rop` --- Return Oriented Programming
==========================================================
.. automodule:: pwnlib.rop.rop
:members:
+9
View File
@@ -0,0 +1,9 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.rop.srop` --- Sigreturn Oriented Programming
==========================================================
.. automodule:: pwnlib.rop.srop
:members:
+9
View File
@@ -0,0 +1,9 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.runner` --- Running Shellcode
===========================================
.. automodule:: pwnlib.runner
:members:
+19
View File
@@ -0,0 +1,19 @@
.. testsetup:: *
from pwn import *
context.clear(arch='aarch64')
:mod:`pwnlib.shellcraft.aarch64` --- Shellcode for AArch64
===========================================================
:mod:`pwnlib.shellcraft.aarch64`
--------------------------------
.. automodule:: pwnlib.shellcraft.aarch64
:members:
:mod:`pwnlib.shellcraft.aarch64.linux`
--------------------------------------
.. automodule:: pwnlib.shellcraft.aarch64.linux
:members:
+1
View File
@@ -1,6 +1,7 @@
.. testsetup:: *
from pwn import *
context.clear(arch='amd64')
:mod:`pwnlib.shellcraft.amd64` --- Shellcode for AMD64
===========================================================
+1
View File
@@ -1,6 +1,7 @@
.. testsetup:: *
from pwn import *
context.clear(arch='arm')
:mod:`pwnlib.shellcraft.arm` --- Shellcode for ARM
===========================================================
+1
View File
@@ -1,6 +1,7 @@
.. testsetup:: *
from pwn import *
context.clear(arch='i386')
:mod:`pwnlib.shellcraft.i386` --- Shellcode for Intel 80386
===========================================================
+19
View File
@@ -0,0 +1,19 @@
.. testsetup:: *
from pwn import *
context.clear(arch='mips')
:mod:`pwnlib.shellcraft.mips` --- Shellcode for MIPS
===========================================================
:mod:`pwnlib.shellcraft.mips`
-----------------------------
.. automodule:: pwnlib.shellcraft.mips
:members:
:mod:`pwnlib.shellcraft.mips.linux`
-----------------------------------
.. automodule:: pwnlib.shellcraft.mips.linux
:members:
+9
View File
@@ -0,0 +1,9 @@
.. testsetup:: *
from pwnlib.regsort import *
:mod:`pwnlib.regsort` --- Register sorting
===========================================================
.. automodule:: pwnlib.regsort
:members:
+1
View File
@@ -1,6 +1,7 @@
.. testsetup:: *
from pwn import *
context.clear(arch='thumb')
:mod:`pwnlib.shellcraft.thumb` --- Shellcode for Thumb Mode
===========================================================
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
import os
from pwnlib.testexample import add
:mod:`pwnlib.testexample` --- Example Test Module
==================================================
.. automodule:: pwnlib.testexample
:members:
+1 -1
View File
@@ -5,7 +5,7 @@
import time
:mod:`pwnlib.timeout` --- Timeout handling
========================================
============================================
.. automodule:: pwnlib.timeout
:members:
+14 -53
View File
@@ -1,69 +1,30 @@
.. testsetup:: *
from pwnlib.tubes.tube import tube
from pwnlib.tubes.ssh import *
from pwnlib.tubes.remote import remote
from pwnlib.util.misc import which
from pwnlib.context import context
from pwn import *
:mod:`pwnlib.tubes` --- Talking to the World!
=============================================
.. automodule:: pwnlib.tubes
Sockets
-------
.. automodule:: pwnlib.tubes.remote
Types of Tubes
-------------------
.. autoclass:: pwnlib.tubes.remote.remote
:members:
:show-inheritance:
.. toctree::
:maxdepth: 3
:glob:
.. automodule:: pwnlib.tubes.listen
tubes/*
.. autoclass:: pwnlib.tubes.listen.listen
:members:
:show-inheritance:
.. automodule:: pwnlib.tubes.sock
:mod:`pwnlib.tubes.tube` --- Common Functionality
-------------------------------------------------
.. autoclass:: pwnlib.tubes.sock.sock()
:show-inheritance:
Processes
---------
.. automodule:: pwnlib.tubes.tube
.. automodule:: pwnlib.tubes.process
.. autoclass:: pwnlib.tubes.process.process
:members: kill, poll, communicate
:show-inheritance:
SSH
---
.. automodule:: pwnlib.tubes.ssh
.. autoclass:: pwnlib.tubes.ssh.ssh
:members:
.. autoclass:: pwnlib.tubes.ssh.ssh_channel()
:members: kill, poll, interactive
:show-inheritance:
.. autoclass:: pwnlib.tubes.ssh.ssh_connecter()
:show-inheritance:
.. autoclass:: pwnlib.tubes.ssh.ssh_listener()
:show-inheritance:
Common functionality
--------------------
.. automodule:: pwnlib.tubes.tube
.. autoclass:: pwnlib.tubes.tube.tube()
:members:
:exclude-members: recv_raw, send_raw, settimeout_raw,
can_recv_raw
.. autoclass:: pwnlib.tubes.tube.tube()
:members:
:exclude-members: recv_raw, send_raw, settimeout_raw,
can_recv_raw, shutdown_raw, connected_raw,
+12
View File
@@ -0,0 +1,12 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.tubes.process` --- Processes
===========================================================
.. automodule:: pwnlib.tubes.process
.. autoclass:: pwnlib.tubes.process.process
:members:
:show-inheritance:
+11
View File
@@ -0,0 +1,11 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.tubes.serialtube` --- Serial Ports
===========================================================
.. automodule:: pwnlib.tubes.serialtube
.. autoclass:: pwnlib.tubes.serialtube.serialtube
:members:
+25
View File
@@ -0,0 +1,25 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.tubes.sock` --- Sockets
===========================================================
.. automodule:: pwnlib.tubes.sock
.. autoclass:: pwnlib.tubes.sock.sock()
:show-inheritance:
.. automodule:: pwnlib.tubes.remote
.. autoclass:: pwnlib.tubes.remote.remote
:members:
:show-inheritance:
.. automodule:: pwnlib.tubes.listen
.. autoclass:: pwnlib.tubes.listen.listen
:members:
:show-inheritance:
+21
View File
@@ -0,0 +1,21 @@
.. testsetup:: *
from pwn import *
:mod:`pwnlib.tubes.ssh` --- SSH
===========================================================
.. automodule:: pwnlib.tubes.ssh
.. autoclass:: pwnlib.tubes.ssh.ssh
:members:
.. autoclass:: pwnlib.tubes.ssh.ssh_channel()
:members: kill, poll, interactive
:show-inheritance:
.. autoclass:: pwnlib.tubes.ssh.ssh_connecter()
:show-inheritance:
.. autoclass:: pwnlib.tubes.ssh.ssh_listener()
:show-inheritance:
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
from pwnlib.update import *
:mod:`pwnlib.update` --- Updating Pwntools
===================================================
.. automodule:: pwnlib.update
:members:
+1
View File
@@ -1,5 +1,6 @@
.. testsetup:: *
from pwn import *
from pwnlib.util.cyclic import *
+2 -1
View File
@@ -1,6 +1,7 @@
.. testsetup:: *
from pwnlib.util.fiddling import *
from pwn import *
from pwnlib.util.fiddling import *
:mod:`pwnlib.util.fiddling` --- Utilities bit fiddling
+1
View File
@@ -1,6 +1,7 @@
.. testsetup:: *
from pwnlib.util.safeeval import *
_get_opcodes = pwnlib.util.safeeval._get_opcodes
:mod:`pwnlib.util.safeeval` --- Safe evaluation of python code
+10
View File
@@ -0,0 +1,10 @@
.. testsetup:: *
from pwn import *
test = pwnlib.util.sh_string.test
:mod:`pwnlib.util.sh_string` --- Shell Expansion is Hard
===============================================================
.. automodule:: pwnlib.util.sh_string
:members:
+1 -1
View File
@@ -4,7 +4,7 @@ the pwntools project.
We have a plan to create a separate repository with examples, primarily
exploits. Until we do so, we recommend new users to look at
https://pwntools.readthedocs.org, as this is a better overview of our features.
https://docs.pwntools.com, as this is a better overview of our features.
In no particular order the docstrings for each example:
+22
View File
@@ -0,0 +1,22 @@
from pwn import *
# Tell pwntools that the target is an Android device
context.os='android'
context.arch='aarch64' # or 'arm'
# Optionally, set the remote ADB server address
context.adb_host='172.16.110.1'
# Wait for a device to become available
print adb.wait_for_device()
# Who am I?
print adb.process('id').recvall().strip()
# Interactive sessions!
io = adb.shell()
io.sendline('echo Hello, world; exit')
print io.recvall().replace('\r\n', '\n').strip()
# Debugging!
gdb.debug('sh').interactive()
+2 -1
View File
@@ -3,7 +3,8 @@ Example showing the interface to `pwnlib.asm.asm` and `pwnlib.shellcraft`.
"""
from pwn import *
context(arch='i386', os='linux', net='tcp4')
context(arch='i386', os='linux')
shellcode = shellcraft.i386_to_amd64()
shellcode_asm = asm(shellcode)
+12
View File
@@ -0,0 +1,12 @@
"""
Example showing `pwnlib.gdb.attach()`
"""
from pwn import *
bash = process('/bin/bash')
gdb.attach(bash, execute = '''
p "hello from pwnlib"
c
''')
bash.interactive()
-1
View File
@@ -26,4 +26,3 @@ atexit.register(r.clean_and_log)
while True:
line = r.recvline()
print re.findall('^prefix (\S+)$', line)[0]
+2 -1
View File
@@ -4,13 +4,14 @@ Script to generate README.md
from pwn import *
out = '''# Examples
While these examples should all work, they are not very representative of
the pwntools project.
We have a plan to create a separate repository with examples, primarily
exploits. Until we do so, we recommend new users to look at
https://pwntools.readthedocs.org, as this is a better overview of our features.
https://docs.pwntools.com, as this is a better overview of our features.
In no particular order the docstrings for each example:
+2 -2
View File
@@ -5,8 +5,8 @@ off some proof-of-concepts.
"""
from pwn import *
from pwnlib.term.completer import LongestPrefixCompleter, \
PathCompleter
from pwnlib.term.completer import LongestPrefixCompleter
from pwnlib.term.completer import PathCompleter
c1 = LongestPrefixCompleter([
'foobar',
+2 -1
View File
@@ -3,9 +3,10 @@ Simple example showing how to use the remote
gdb debugging features available in pwntools.
"""
from pwn import *
import getpass
from pwn import *
s = ssh(getpass.getuser(), '127.0.0.1', port = 22, keyfile = "~/.ssh/id_rsa")
c = gdb.ssh_gdb(s, '/bin/sh', execute = '''
p/x $pc
+31
View File
@@ -0,0 +1,31 @@
from pwn import *
context.arch='aarch64'
frame = SigreturnFrame()
registers = ['x%i' % i for i in range(0, 31)]
registers += ['sp', 'pc']
for index, register in enumerate(registers):
setattr(frame, register, index)
assembly = '\n'.join([
shellcraft.read(constants.STDIN_FILENO, 'sp', 1024),
shellcraft.syscall(constants.SYS_rt_sigreturn)
])
binary = ELF.from_assembly(assembly)
io = binary.process()
io.flat(frame)
io.wait()
assert io.poll() == -11
corefile = io.corefile
for index, register in enumerate(registers):
value = getattr(corefile, register)
if index != value:
log.error("%s != %i (%i)" % (register, index, value))
else:
log.success("%s == %i" % (register, value))
+32
View File
@@ -0,0 +1,32 @@
from pwn import *
context.arch='amd64'
frame = SigreturnFrame()
registers = ['rax', 'rbx', 'rcx', 'rdx',
'rdi', 'rsi', 'rbp', 'rsp',
'rip',
'r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15']
for index, register in enumerate(registers):
setattr(frame, register, index)
assembly = '\n'.join([
shellcraft.read(constants.STDIN_FILENO, 'rsp', 1024),
shellcraft.sigreturn()
])
binary = ELF.from_assembly(assembly)
io = binary.process()
io.flat(frame)
io.wait()
assert io.poll() == -11
corefile = io.corefile
for index, register in enumerate(registers):
value = getattr(corefile, register)
if index != value:
log.error("%s != %i (%i)" % (register, index, value))
else:
log.success("%s == %i" % (register, value))
+32
View File
@@ -0,0 +1,32 @@
from pwn import *
context.arch='arm'
frame = SigreturnFrame()
registers = ['r0', 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',
'r8', 'r9', 'r10', 'fp', 'ip', 'sp', 'pc', 'lr']
for index, register in enumerate(registers):
setattr(frame, register, index)
assembly = '\n'.join([
shellcraft.read(constants.STDIN_FILENO, 'sp', 1024),
shellcraft.sigreturn()
])
binary = ELF.from_assembly(assembly)
io = binary.process()
io.flat(frame)
io.wait()
assert io.poll() == -11
corefile = io.corefile
for index, register in enumerate(registers):
value = getattr(corefile, register)
if index != value:
log.error("%s != %i (%i)" % (register, index, value))
else:
log.success("%s == %i" % (register, value))
+31
View File
@@ -0,0 +1,31 @@
from pwn import *
context.kernel='amd64'
frame = SigreturnFrame()
registers = ['eax', 'ebx', 'ecx', 'edx',
'edi', 'esi', 'ebp', 'esp',
'eip']
for index, register in enumerate(registers):
setattr(frame, register, index)
assembly = '\n'.join([
shellcraft.read(constants.STDIN_FILENO, 'esp', 1024),
shellcraft.sigreturn()
])
binary = ELF.from_assembly(assembly)
io = binary.process()
io.flat(frame)
io.wait()
assert io.poll() == -11
corefile = io.corefile
for index, register in enumerate(registers):
value = getattr(corefile, register)
if index != value:
log.error("%s != %i (%i)" % (register, index, value))
else:
log.success("%s == %i" % (register, value))
+1 -1
View File
@@ -4,7 +4,7 @@ Example showing how to use the ssh class.
from pwn import *
shell = ssh(host='bandit.labs.overthewire.org',user='bandit0',password='bandit0')
shell = ssh(host='bandit.labs.overthewire.org',user='bandit0',password='bandit0', port=2220)
# Show basic command syntax
log.info("username: %s" % shell.whoami())
+10
View File
@@ -0,0 +1,10 @@
"""
Example showing `pwnlib.ui.yesno()`
"""
from pwn import *
if ui.yesno('Do you like Pwntools?'):
print ':D'
else:
print ':('
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# cache list of shellcodes
_shellcraft_shellcodes=$(pwn shellcraft -l)
_shellcraft()
{
COMPREPLY=()
local cur prev opts word code
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h --help -? --show -o --out -f --format"
if [ "${prev}" == "-f" -o \
"${prev}" == "--format" \
] ; then
opts="raw str c hex asm p hexii"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}))
return 0
fi
if [ "${prev}" == "-o" -o \
"${prev}" == "--out" \
] ; then
COMPREPLY=( $(compgen -f ${cur}))
return 0
fi
if [[ "${cur}" == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
# check if a shellcode was already chosen
for word in "${COMP_WORDS[@]}" ; do
for code in ${_shellcraft_shellcodes} ; do
if [ "${word}" == "${code}" ] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
done
done
# complete shellcode name
COMPREPLY=( $(compgen -W "${_shellcraft_shellcodes}" -- ${cur}) )
}
complete -F _shellcraft pwn shellcraft
complete -F _shellcraft shellcraft
+13
View File
@@ -0,0 +1,13 @@
subdirs=xenial stable $(wildcard */)
makefiles=$(wildcard */Makefile)
tags=base stable beta dev
all: $(makefiles) $(subdirs)
$(subdirs):
docker build -t pwntools/pwntools:$(shell basename $(@)) "$@"
$(makefiles):
make -C $(shell dirname $@)
.PHONY: all $(subdirs) $(makefiles)
+1
View File
@@ -0,0 +1 @@
xenial
+6
View File
@@ -0,0 +1,6 @@
FROM pwntools/pwntools:stable
USER root
RUN pip install --upgrade git+https://github.com/Gallopsled/pwntools@beta
RUN PWNLIB_NOTERM=1 pwn update
USER pwntools
+6
View File
@@ -0,0 +1,6 @@
FROM pwntools/pwntools:stable
USER root
RUN pip install --upgrade git+https://github.com/Gallopsled/pwntools@dev
RUN PWNLIB_NOTERM=1 pwn update
USER pwntools
+26
View File
@@ -0,0 +1,26 @@
############################################################
# Dockerfile to build Pwntools container
# Based on Ubuntu
############################################################
FROM kalilinux/kali-linux-docker
MAINTAINER Maintainer Gallopsled et al.
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y git
RUN apt-get install -y libssl-dev
RUN apt-get install -y libffi-dev
RUN apt-get install -y python2.7
RUN apt-get install -y python-pip
RUN apt-get install -y python-dev
RUN pip install --upgrade pip
RUN python -m pip install --upgrade pwntools
RUN PWNLIB_NOTERM=1 pwn update
RUN apt-get install -y sudo
RUN useradd -m pwntools
RUN passwd --delete --unlock pwntools
RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/pwntools
USER pwntools
WORKDIR /home/pwntools
+8
View File
@@ -0,0 +1,8 @@
all: Dockerfile
Dockerfile: ../xenial/Dockerfile FORCE
sed "s|ubuntu:xenial|kalilinux/kali-linux-docker|" < "$<" > "$@"
FORCE:
.PHONY: all
+26
View File
@@ -0,0 +1,26 @@
############################################################
# Dockerfile to build Pwntools container
# Based on Ubuntu
############################################################
FROM ubuntu:precise
MAINTAINER Maintainer Gallopsled et al.
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y git
RUN apt-get install -y libssl-dev
RUN apt-get install -y libffi-dev
RUN apt-get install -y python2.7
RUN apt-get install -y python-pip
RUN apt-get install -y python-dev
RUN pip install --upgrade pip
RUN python -m pip install --upgrade pwntools
RUN PWNLIB_NOTERM=1 pwn update
RUN apt-get install -y sudo
RUN useradd -m pwntools
RUN passwd --delete --unlock pwntools
RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/pwntools
USER pwntools
WORKDIR /home/pwntools
+8
View File
@@ -0,0 +1,8 @@
all: Dockerfile
Dockerfile: ../xenial/Dockerfile FORCE
sed "s|ubuntu:xenial|ubuntu:precise|" < "$<" > "$@"
FORCE:
.PHONY: all
+6
View File
@@ -0,0 +1,6 @@
FROM pwntools/pwntools:base
USER root
RUN pip install --upgrade git+https://github.com/Gallopsled/pwntools@stable
RUN PWNLIB_NOTERM=1 pwn update
USER pwntools
+26
View File
@@ -0,0 +1,26 @@
############################################################
# Dockerfile to build Pwntools container
# Based on Ubuntu
############################################################
FROM ubuntu:trusty
MAINTAINER Maintainer Gallopsled et al.
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y git
RUN apt-get install -y libssl-dev
RUN apt-get install -y libffi-dev
RUN apt-get install -y python2.7
RUN apt-get install -y python-pip
RUN apt-get install -y python-dev
RUN pip install --upgrade pip
RUN python -m pip install --upgrade pwntools
RUN PWNLIB_NOTERM=1 pwn update
RUN apt-get install -y sudo
RUN useradd -m pwntools
RUN passwd --delete --unlock pwntools
RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/pwntools
USER pwntools
WORKDIR /home/pwntools
+8
View File
@@ -0,0 +1,8 @@
all: Dockerfile
Dockerfile: ../xenial/Dockerfile FORCE
sed "s|ubuntu:xenial|ubuntu:trusty|" < "$<" > "$@"
FORCE:
.PHONY: all
+26
View File
@@ -0,0 +1,26 @@
############################################################
# Dockerfile to build Pwntools container
# Based on Ubuntu
############################################################
FROM ubuntu:xenial
MAINTAINER Maintainer Gallopsled et al.
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y git
RUN apt-get install -y libssl-dev
RUN apt-get install -y libffi-dev
RUN apt-get install -y python2.7
RUN apt-get install -y python-pip
RUN apt-get install -y python-dev
RUN pip install --upgrade pip
RUN python -m pip install --upgrade pwntools
RUN PWNLIB_NOTERM=1 pwn update
RUN apt-get install -y sudo
RUN useradd -m pwntools
RUN passwd --delete --unlock pwntools
RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/pwntools
USER pwntools
WORKDIR /home/pwntools
+19
View File
@@ -0,0 +1,19 @@
# Pwntools Mako Assembly Syntax Highlighting
This should work for TextMate and anything that's compatible (e.g. Sublime Text).
![screenshot](screenshot.png)
## Installation
### Sublime Text
Copy the `tmLanguage` files into the `Packages/User` folder in your Sublime Text configuration folder.
These folders are located at the paths shown below. Replace `2` with `3` if you're a ST3 user.
- OS X: `~/Library/Application Support/Sublime Text 2`
- Windows: `%APPDATA%\Sublime Text 2`
- Linux: `~/.config/sublime-text-2`
Open a `.asm` file, and choose `View > Syntax > Open All ... > Pwntools ...`.
+209
View File
@@ -0,0 +1,209 @@
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Pwntools Mako ASM
scopeName: source.pwntools
fileTypes: ['.asm']
uuid: 19bbf78d-4ad8-4385-bb20-5bde8df453bf
patterns:
- comment: x86 instruction
name: support.function.mnemonic.x86.all
match: \b(?i)(v)?(aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|bmi|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts(w?)|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pdep|pext|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|vbroadcastss|vbroadcastsd|vbroadcastf128|vmaskmovps|vmaskmovpd|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(n?e|n?z)?|call|j(mp|n?e|n?ge?|n?ae?|le?|be?|n?o|n?z|n?c|n?p|n?b))\b
- comment: ARM instruction
name: support.function.mnemonic.arm.arithmetic
match: >
(?x)\b((?i)
( (bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?)
| (v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))*
| (mul|mla|mull|smlabb)
| (mov(w|t))
| rev(8|16)?
| (pld|adr|adrl|vswp)
| bkpt
)?(?-i))?\b
- comment: ARM instruction
name: support.function.mnemonic.arm.memory
match: >
(?x)\b((?i)(
swi|svc|wfi|
dmb | clrex | dsb | isb |
v(ldr|str|push|pop) |
(push|pop) |
(st|ld)(
p |
r(ex|s?(h|b)|d)? |
m(
(f|e)(d|a) |
(d|i)(b|a)
)?
) |
b(l|x|lx|lr|r)? |
(i|e)?ret|
b\.(eq|ne|hs|cs|lo|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|nv)+ |
(c|t)?bn?z|
)+(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))\b
- comment: ARM instruction
name: meta.preprocessor.c.include
match: >
\b((?i)(def(b|w|s)|equ|(include|get)(\s+([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*?)\.s)?)?(?-i))\b
- comment: ARM instruction
name: comment.nop
match: >
\b((?i)nop(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
- comment: Comment Block
begin: /\*
end: \*/
name: comment.block
- comment: Directive
name: keyword.control.directive
match: \.(?i)(globl|global|macro|endm|purgem|if|elseif|else|endif|section|text|arm|align|balign|irp|rept|endr|req|unreq|error|short|func|endfunc|hidden|type|fpu|arch|code|altmacro|object_arch|word|int|string)(?-i)\b
- comment: ARM register
name: storage.other.register.arm
match: \b((?i)\$?([xw][0-9]|[xw]1[0-9]||[xw]2[0-9]|[wx]30|wzr|xzr|wsp|fpsr|fpcr|[rcp]1[0-5]|[rcp][0-9]|a[1-4]|v[1-8]|sl|sb|fp|ip|sp|lr|(c|s)psr(_c)?|pc|[sd]3[0-1]|[sd][12][0-9]|[sd][0-9]|fpsid|fpscr|fpexc|q3[0-1]|q2[0-9]|q1[0-9]|q[0-9]|APSR_nzcv|sy)!?(?-i))?\b
- comment: x86 register
name: storage.other.register.x86
match: \b((?i)(al|ah|ax|eax|rax|bl|bh|bx|ebx|rbx|cl|ch|cx|ecx|rcx|dl|dh|dx|edx|rdx|sil|si|esi|rsi|di|di|edi|rdi|bpl|bp|ebp|rbp|sp|esp|rsp|cs|ds|ss|es|fs|gs|ip|eip|rip|flags|eflags|rflags|r8|r9|r10|r11|r12|r13|r14|r15|r8d|r9d|r10d|r11d|r12d|r13d|r14d|r15d|r8w|r9w|r10w|r11w|r12w|r13w|r14w|r15w|r8l|r9l|r10l|r11l|r12l|r13l|r14l|r15l|st0|st1|st2|st3|st4|st5|st6|st7|mm0|mm1|mm2|mm3|mm4|mm5|mm6|mm7|xmm0|xmm1|xmm2|xmm3|xmm4|xmm5|xmm6|xmm7|xmm8|xmm9|xmm10|xmm11|xmm12|xmm13|xmm14|xmm15|xmm16|xmm17|xmm18|xmm19|xmm20|xmm21|xmm22|xmm23|xmm24|xmm25|xmm26|xmm27|xmm28|xmm29|xmm30|xmm31|ymm0|ymm1|ymm2|ymm3|ymm4|ymm5|ymm6|ymm7|ymm8|ymm9|ymm10|ymm11|ymm12|ymm13|ymm14|ymm15|ymm16|ymm17|ymm18|ymm19|ymm20|ymm21|ymm22|ymm23|ymm24|ymm25|ymm26|ymm27|ymm28|ymm29|ymm30|ymm31|zmm0|zmm1|zmm2|zmm3|zmm4|zmm5|zmm6|zmm7|zmm8|zmm9|zmm10|zmm11|zmm12|zmm13|zmm14|zmm15|zmm16|zmm17|zmm18|zmm19|zmm20|zmm21|zmm22|zmm23|zmm24|zmm25|zmm26|zmm27|zmm28|zmm29|zmm30|zmm31|cr0|cr2|cr3|cr4|gdtr|ldtr|idtr|dr0|dr1|dr2|dr3|dr4|dr5|dr6|dr7|msr)!?(?-i))?\b
- comment: SPARC register
name: storage.other.register.sparc
match: \b((?i)\$?([gloi][0-9])!?(?-i))?\b
- comment: MIPS register
name: storage.other.register.mips
match: \b((?i)\$?(r[0-3][0-9]|v[0-2]|a[0-4]|t[0-8]|s[0-9]|t([89]|10|k[0-2]))!?(?-i))?\b
- comment: Numeric Hex
name: constant.numeric.hex
match: (\b|\s+)(\#)?-?(0x|&amp;)[0-9a-fA-F_]+\b
- comment: Numeric Literal
name: constant.numeric.literal
match: (\b|\s+)\#-?[0-9a-zA-Z_]+\b
- comment: Numeric Decimal
name: constant.numeric.dec
match: (\b|\s+)[0-9]+\b
- comment: Label
name: entity.name.tag
match: ([\w${}]+[:])
- comment: Inline Python
name: pwntools.raw.block.python
begin: (<%\s)
end: (%>)
beginCaptures:
'1': {name: 'keyword.control'}
endCaptures:
'1': {name: 'keyword.control'}
patterns:
- {include: source.python}
- comment: Inline Docstring
begin: (<%(\S+)>)
end: (</%(\2)>)
beginCaptures:
'1': {name: 'keyword.control'}
endCaptures:
'1': {name: 'keyword.control'}
patterns:
- {include: comment.block}
- comment: Mako Tag
name: source.mako.tag
begin: (<%\w+\s)
end: (/>)
beginCaptures:
'1': {name: 'keyword.control'}
endCaptures:
'1': {name: 'keyword.control'}
patterns:
- {include: comment.block}
- comment: Mako Substitution
name: source.mako.expression
begin: (\${)
end: (})
beginCaptures:
'1': {name: 'keyword.control'}
endCaptures:
'1': {name: 'keyword.control'}
patterns:
- {include: source.python}
- comment: Mako Comment
match: (^##(.*)$)
name: comment.line.mako
- comment: Mako Directive
begin: ^\s*(%)(\s*((endfor)|(endif)|(endwhile)))?
end: $
beginCaptures:
'1': {name: 'keyword.control'}
'2': {name: 'keyword.control'}
patterns:
- {include: source.python}
name: source.doc.python.mako.controlline
# <key>begin</key>
# <string>^(#)</string>
# <key>beginCaptures</key>
# <dict>
# <key>1</key>
# <dict>
# <key>name</key>
# <string>keyword.control</string>
# </dict>
# </dict>
# <key>end</key>
# <string>$</string>
# <key>name</key>
# <string>source.python.mako.line</string>
# <key>patterns</key>
# <array>
# <dict>
# <key>include</key>
# <string>comment.block</string>
# </dict>
# </array>
# </dict>
# <key>begin</key>
# <string>^\s*(%)(\s*((endfor)|(endif)|(endwhile)))?</string>
# <key>beginCaptures</key>
# <dict>
# <key>1</key>
# <dict>
# <key>name</key>
# <string>keyword.control</string>
# </dict>
# <key>2</key>
# <dict>
# <key>name</key>
# <string>keyword.control</string>
# </dict>
# </dict>
# <key>begin</key>
# <string>(&lt;%\s)</string>
# <key>captures</key>
# <dict>
# <key>1</key>
# <dict>
# <key>name</key>
# <string>keyword.control</string>
# </dict>
# </dict>
# <key>end</key>
# <string>(%&gt;)</string>
# <key>name</key>
# <string>source.mako.substitution</string>
# <key>patterns</key>
# <array>
# <dict>
# <key>include</key>
# <string>source.python</string>
# </dict>
# </array>
# match: "(
# (bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?) |
# (v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))* |
# (and|m(rs|sr)|eor|sub|rsb|add|adc|sbc|rsc|tst|teq|cmp|cmn|orr|mov|bic|mvn |
# (neg) |
# (lsr|lsl|ror|asr)
# )s? |
# (mul|mla|mull|smlabb) |
# (mov(w|t)) |
# rev(8|16)? |
# (pld|adr|adrl|vswp)
# )
Loaded 100 of 1007 files, more files were not shown because too many files have changed in this diff. Show more