Compare commits

...
7 Commits
Author SHA1 Message Date
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
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 475ffa632e Always run Android tests on staging branches and new tags (#866) 2017-01-23 14:43:32 -05:00
9 changed files with 98 additions and 58 deletions

No files matched your search

+5 -1
View File
@@ -13,6 +13,7 @@ addons:
- mksh
- zsh
- pandoc
- gdb
cache:
- pip
- directories:
@@ -22,11 +23,14 @@ cache:
python:
- "2.7"
before_install:
- echo $-
- source travis/install.sh
- source travis/ssh_setup.sh
- echo $-
install:
- pip install --upgrade pip
- pip install --upgrade --editable .
- pip install --requirement docs/requirements.txt
- 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'
+30 -11
View File
@@ -9,9 +9,11 @@ The table below shows which release corresponds to each branch, and what date th
| Version | Branch | Release Date |
| ---------------- | -------- | ---------------------- |
| [3.5.0](#350) | `dev` | Mar 18, 2017 (planned)
| [3.4.0](#340) | `beta` | Feb 4, 2017 (planned)
| [3.3.4](#334) | `stable` | Jan 12, 2016
| [3.6.0](#350) | `dev` | May 6, 2017 (planned)
| [3.5.0](#350) | `beta` | Mar 25, 2017 (planned)
| [3.4.1](#341) | `stable` | 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
@@ -27,22 +29,39 @@ The table below shows which release corresponds to each branch, and what date th
| [3.0.0](#300) | | Aug 20, 2016
| [2.2.0](#220) | | Jan 5, 2015
## 3.6.0
To be released on May 6, 2017.
## 3.5.0
To be released on Mar 18, 2017.
To be released on Mar 25, 2017.
## 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
To be released on Feb 4, 2017.
- [#800][800] Add `shell=` option to `ssh.process()`
- [5d9792f][5d9792f] Add `context.buffer_size` for fine-tuning `tube` performance
- [#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
@@ -166,7 +185,7 @@ Multiple bug fixes.
- [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()` aiases
- [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())`
@@ -253,7 +272,7 @@ Android support via a new `adb` module, `context.device`, `context.adb_host`, an
- 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 randommization of settings like XOR keys and register ordering (default off).
- 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
@@ -266,7 +285,7 @@ Android support via a new `adb` module, `context.device`, `context.adb_host`, an
#### Encoders Module
- Added a `pwnlib.encoders` module for assembled-shellcode encoders/decoders
- Includes position-indepentent basic XOR encoders
- 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
+1 -1
View File
@@ -2,7 +2,7 @@
![pwntools logo](https://github.com/Gallopsled/pwntools/blob/stable/docs/source/logo.png?raw=true)
[![Docs](https://readthedocs.org/projects/pwntools/badge/?version=stable)](https://docs.pwntools.com/)
[![PyPI](https://img.shields.io/badge/pypi-v3.3.4-green.svg?style=flat)](https://pypi.python.org/pypi/pwntools/)
[![PyPI](https://img.shields.io/badge/pypi-v3.4.1-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)
+8 -5
View File
@@ -226,7 +226,7 @@ def debug(args, execute=None, exe=None, ssh=None, env=None, **kwargs):
if not ssh and context.os == 'android':
host = context.adb_host
attach((host, port), exe=exe, execute=execute, need_ptrace_scope = False)
attach((host, port), exe=exe, execute=execute, need_ptrace_scope = False, ssh=ssh)
# gdbserver outputs a message when a client connects
garbage = gdbserver.recvline(timeout=1)
@@ -247,8 +247,8 @@ def get_gdb_arch():
@LocalContext
def attach(target, execute = None, exe = None, need_ptrace_scope = True):
"""attach(target, execute = None, exe = None, arch = None) -> None
def attach(target, execute = None, exe = None, need_ptrace_scope = True, ssh = None):
"""attach(target, execute = None, exe = None, arch = None, ssh = None) -> None
Start GDB in a new terminal and attach to `target`.
:func:`pwnlib.util.proc.pidof` is used to find the PID of `target` except
@@ -401,8 +401,11 @@ def attach(target, execute = None, exe = None, need_ptrace_scope = True):
cmd += ' -q '
if exe and context.native:
if ssh:
ssh.download_file(exe)
exe = os.path.basename(exe)
if not os.path.isfile(exe):
log.error('no such file: %s' % exe)
log.error('No such file: %s' % exe)
cmd += ' "%s"' % exe
if pid and not context.os == 'android':
@@ -460,7 +463,7 @@ def ssh_gdb(ssh, process, execute = None, arch = None, **kwargs):
l = tubes.listen.listen(0)
forwardport = l.lport
attach(('127.0.0.1', forwardport), execute, local_exe, arch)
attach(('127.0.0.1', forwardport), execute, local_exe, arch, ssh=ssh)
l.wait_for_connection() <> ssh.connect_remote('127.0.0.1', gdbport)
return c
+3 -1
View File
@@ -478,7 +478,9 @@ class ROP(object):
"""
Generates padding to be inserted into the ROP stack.
"""
return cyclic.cyclic(offset + count)[-count:]
if count:
return cyclic.cyclic(offset + count)[-count:]
return ''
def describe(self, object):
"""
+1 -1
View File
@@ -1 +1 @@
__version__ = '3.4.0beta4'
__version__ = '3.4.1'
+1 -1
View File
@@ -80,7 +80,7 @@ except ImportError:
setup(
name = 'pwntools',
packages = find_packages(),
version = '3.4.0beta4',
version = '3.4.1',
data_files = [('',
glob.glob('*.md') + glob.glob('*.txt')),
],
+47 -37
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash -e
set -e
local_deb_extract()
{
wget $1
@@ -8,52 +9,54 @@ local_deb_extract()
rm -f *.tar.* *deb*
}
get_binutils()
install_deb()
{
BINUTILS_PREFIX='https://launchpad.net/~pwntools/+archive/ubuntu/binutils/+files/binutils-'
BINUTILS_SUFFIX='-linux-gnu_2.22-6ubuntu1.1cross0.11pwntools12~precise_amd64.deb'
local_deb_extract "${BINUTILS_PREFIX}${1}${BINUTILS_SUFFIX}"
}
get_qemu()
{
echo "Installing qemu"
QEMU_INDEX='http://packages.ubuntu.com/en/yakkety/amd64/qemu-user-static/download'
QEMU_URL=$(curl "$QEMU_INDEX" | grep kernel.org | grep -Eo 'http.*\.deb')
local_deb_extract "$QEMU_URL"
version=${2:-zesty}
package=$1
echo "Installing $package"
INDEX="http://packages.ubuntu.com/en/$version/amd64/$package/download"
URL=$(curl "$INDEX" | grep -Eo "https?://.*$package.*\.deb" | head -1)
local_deb_extract "$URL"
}
setup_travis()
{
export PATH=$PWD/usr/bin:$PATH
export LD_LIBRARY_PATH=$PWD/usr/lib
export LD_LIBRARY_PATH=$PWD/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
# Install libbfd-multiarch and libopcodes-multiarch if not found in the cache
if [ ! -f usr/lib/libbfd-2.22-multiarch.so ];
then
# Install the multiarch binutils
local_deb_extract http://mirrors.mit.edu/ubuntu/pool/universe/b/binutils/binutils-multiarch_2.22-6ubuntu1_amd64.deb
pushd usr/lib
ln -sf libbfd-2.22-multiarch.so libbfd-2.22.so
ln -sf libopcodes-2.22-multiarch.so libopcodes-2.22.so
popd
fi
# Install a more modern binutils, which is required for some of the tests
[[ -f usr/bin/objcopy ]] || install_deb binutils
# Install/upgrade qemu
if ! (which qemu-arm-static && qemu-arm-static -version | grep 2.6.1); then
get_qemu
fi
[[ -f usr/bin/qemu-arm-static ]] || install_deb qemu-user-static xenial
# Install our custom binutils
which arm-linux-gnu-as || get_binutils arm
which mips-linux-gnu-as || get_binutils mips
which powerpc-linux-gnu-as || get_binutils powerpc
# Install cross-binutils
[[ -f usr/bin/x86_64-linux-gnu-ar ]] || install_deb binutils-multiarch
[[ -f usr/bin/aarch64-linux-gnu-as ]] || install_deb binutils-aarch64-linux-gnu
[[ -f usr/bin/arm-linux-gnueabihf-as ]] || install_deb binutils-arm-linux-gnueabihf
[[ -f usr/bin/mips-linux-gnu-as ]] || install_deb binutils-mips-linux-gnu
[[ -f usr/bin/powerpc-linux-gnu-as ]] || install_deb binutils-powerpc-linux-gnu
# Test that the installs worked
which arm-linux-gnu-as
which mips-linux-gnu-as
which powerpc-linux-gnu-as
which qemu-arm-static
as --version
x86_64-linux-gnu-ar --version
aarch64-linux-gnu-as --version
arm-linux-gnueabihf-as --version
mips-linux-gnu-as --version
powerpc-linux-gnu-as --version
qemu-arm-static --version
# Force-install capstone because it's broken somehow
[[ -f usr/lib/libcapstone.so.3 ]] || install_deb libcapstone3
# Install a newer copy of GDB
if [[ ! -f usr/bin/gdb ]]; then
git clone --depth=1 https://github.com/zachriggle/pwntools-gdb-travis-ci.git
tar xf pwntools-gdb-travis-ci/gdb.tar.xz
which gdb
usr/bin/gdb --version
fi
# Get rid of files we don't want cached
rm -rf usr/share
@@ -74,8 +77,14 @@ setup_android_emulator()
if [ -n "$TRAVIS" ]; then
if [ -z "$TRAVIS_COMMIT_RANGE" ]; then
echo "TRAVIS_COMMIT_RANGE is empty, forcing Android Emulator installation"
elif ! git show "$TRAVIS_COMMIT_RANGE" ; then
elif ! (git show "$TRAVIS_COMMIT_RANGE" >/dev/null) ; then
echo "TRAVIS_COMMIT_RANGE is invalid, forcing Android Emulator installation"
elif [[ "$TRAVIS_BRANCH" =~ "staging" ]]; then
echo "TRAVIS_BRANCH ($TRAVIS_BRANCH) indicates a branch we care about"
echo "Forcing Android Emulator installation"
elif [[ -n "$TRAVIS_TAG" ]]; then
echo "TRAVIS_TAG ($TRAVIS_TAG) indicates a new relase"
echo "Forcing Android Emulator installation"
elif (git log --stat "$TRAVIS_COMMIT_RANGE" | grep -iE "android|adb"); then
echo "Found Android-related commits, forcing Android Emulator installation"
else
@@ -83,9 +92,11 @@ setup_android_emulator()
# emulator, while still leaving the code intact, we remove the
# RST file that Sphinx searches.
rm -f 'docs/source/adb.rst'
rm -f 'docs/source/protocols/adb.rst'
# However, the file needs to be present or else things break.
touch 'docs/source/adb.rst'
touch 'docs/source/protocols/adb.rst' || true
echo "Skipping Android emulator install, Android tests disabled."
return
@@ -182,5 +193,4 @@ elif [[ "$(uname)" == "Linux" ]]; then
setup_android_emulator
fi
dpkg -l
set +e
+2
View File
@@ -54,3 +54,5 @@ Host example.pwnme
EOF
ssh -o "StrictHostKeyChecking no" -vvvv [email protected] id
set +e