Skip to content

Commit 78f6f80

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into rop
2 parents e93ca77 + 447ac94 commit 78f6f80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4001
-369
lines changed

.github/ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thanks for contributing to Pwntools!
44

55
When reporting an issue, be sure that you are running the latest released version of pwntools (`pip install --upgrade pwntools`).
66

7-
Please verify that your issue occurs on 64-bit Ubuntu 14.04. You can use the Dockerfile on `docker.io` for quick testing.
7+
Please verify that your issue occurs on 64-bit Ubuntu 22.04. You can use the Dockerfile on `docker.io` for quick testing.
88

99
```
1010
$ docker pull pwntools/pwntools:stable

.github/workflows/ci.yml

+21-33
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ jobs:
55
test:
66
strategy:
77
matrix:
8-
python_version: ['3.10', '3.12']
8+
python_version: ['3.10', '3.12', '3.13']
99
os: [ubuntu-latest]
10-
include:
11-
- python_version: '2.7'
12-
os: ubuntu-22.04
1310
runs-on: ${{ matrix.os }}
1411
timeout-minutes: 30
1512
services:
@@ -36,7 +33,7 @@ jobs:
3633
run: |
3734
git fetch origin
3835
git log --oneline --graph -10
39-
36+
4037
- name: Fix libcdb-cache permissions
4138
id: fix-perms
4239
run: |
@@ -66,17 +63,8 @@ jobs:
6663
sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver
6764
/usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc
6865
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
69-
70-
- name: Cache for pip
71-
uses: actions/cache@v4
72-
if: matrix.python_version == '2.7'
73-
with:
74-
path: ~/.cache/pip
75-
key: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
76-
restore-keys: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-
7766
7867
- name: Set up Python ${{ matrix.python_version }}
79-
if: matrix.python_version != '2.7'
8068
uses: actions/setup-python@v5
8169
with:
8270
python-version: ${{ matrix.python_version }}
@@ -85,17 +73,6 @@ jobs:
8573
**/pyproject.toml
8674
**/requirements*.txt
8775
88-
- name: Set up Python 2.7
89-
if: matrix.python_version == '2.7'
90-
run: |
91-
sudo apt-get update
92-
sudo apt-get install -y \
93-
python2.7 python2.7-dev python2-pip-whl
94-
sudo ln -sf python2.7 /usr/bin/python
95-
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
96-
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
97-
sudo chown -R $USER /usr/local/lib/python2.7
98-
9976
10077
- name: Verify tag against version
10178
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
@@ -125,11 +102,12 @@ jobs:
125102
binutils-s390x-linux-gnu \
126103
binutils-sparc64-linux-gnu \
127104
binutils-riscv64-linux-gnu \
105+
binutils-loongarch64-linux-gnu \
128106
gcc-multilib \
129107
libc6-dbg \
130108
elfutils \
131109
patchelf
132-
110+
133111
- name: Testing Corefiles
134112
run: |
135113
ulimit -a
@@ -155,10 +133,6 @@ jobs:
155133
- name: Install documentation dependencies
156134
run: pip install -r docs/requirements.txt
157135

158-
- name: Manually install non-broken Unicorn
159-
if: matrix.python_version == '2.7'
160-
run: pip install unicorn==2.0.0rc7
161-
162136
- name: Disable yama ptrace_scope
163137
run: |
164138
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # required by some gdb doctests
@@ -244,7 +218,6 @@ jobs:
244218
pwn libcdb hash b229d1da1e161f95e839cf90cded5f719e5de308
245219
246220
- name: Build source and wheel distributions
247-
if: matrix.python_version != '2.7'
248221
run: |
249222
python -m build
250223
@@ -260,7 +233,7 @@ jobs:
260233
name: coverage-${{ matrix.python_version }}
261234
path: .coverage*
262235
include-hidden-files: true
263-
236+
264237
- name: Fix libcdb-cache permissions
265238
run: |
266239
container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
@@ -283,12 +256,27 @@ jobs:
283256
run: |
284257
pip install --upgrade pip
285258
pip install --upgrade --editable .
286-
259+
260+
- name: Install documentation dependencies
261+
run: pip install -r docs/requirements.txt
262+
287263
- name: Sanity checks
288264
run: |
289265
python -bb -c 'from pwn import *'
290266
python -bb examples/text.py
291267
268+
- name: Coverage doctests
269+
run: |
270+
python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest
271+
272+
# FIXME: Paths are broken when uploading coverage on ubuntu
273+
# coverage.exceptions.NoSource: No source for code: '/home/runner/work/pwntools/pwntools/D:\a\pwntools\pwntools\pwn\__init__.py'.
274+
# - uses: actions/upload-artifact@v4
275+
# with:
276+
# name: coverage-windows
277+
# path: .coverage*
278+
# include-hidden-files: true
279+
292280
upload-coverage:
293281
runs-on: ubuntu-latest
294282
needs: test

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 2
55
build:
66
os: ubuntu-22.04
77
tools:
8-
python: "3"
8+
python: "3.12"
99

1010
sphinx:
1111
configuration: docs/source/conf.py

CHANGELOG.md

+45-14
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ The table below shows which release corresponds to each branch, and what date th
99

1010
| Version | Branch | Release Date |
1111
| ---------------- | -------- | ---------------------- |
12-
| [4.15.0](#4150-dev) | `dev` |
13-
| [4.14.0](#4140-beta) | `beta` |
14-
| [4.13.1](#4131-stable) | `stable` | Sep 29, 2024
12+
| [5.0.0](#500-dev) | `dev` |
13+
| [4.15.0](#4150-beta) | `beta` |
14+
| [4.14.0](#4140-stable) | `stable` | Jan 15, 2025
15+
| [4.13.1](#4131) | | Sep 29, 2024
1516
| [4.13.0](#4130) | | Aug 12, 2024
1617
| [4.12.0](#4120) | | Feb 22, 2024
1718
| [4.11.1](#4111) | | Nov 14, 2023
@@ -71,8 +72,33 @@ The table below shows which release corresponds to each branch, and what date th
7172
| [3.0.0](#300) | | Aug 20, 2016
7273
| [2.2.0](#220) | | Jan 5, 2015
7374

74-
## 4.15.0 (`dev`)
75-
75+
## 5.0.0 (`dev`)
76+
77+
- [#2519][2519] Drop Python 2.7 support / Require Python 3.10
78+
- [#2507][2507] Add `+LINUX` and `+WINDOWS` doctest options and start proper testing on Windows
79+
- [#2522][2522] Support starting a kitty debugging window with the 'kitten' command
80+
- [#2524][2524] Raise EOFError during `process.recv` when stdout closes on Windows
81+
- [#2526][2526] Properly make use of extra arguments in `packing` utilities. `sign` parameter requires keyword syntax to specify it.
82+
- [#2517][2517] Allow to passthru kwargs on `ssh.__getattr__` convenience function to fix SSH motd problems
83+
- [#2527][2527] Allow setting debugger path via `context.gdb_binary`
84+
- [#2530][2530] Do NOT error when passing directory arguments in `checksec` commandline tool.
85+
- [#2529][2529] Add LoongArch64 support
86+
- [#2504][2504] doc: add example case for `tuple` (host, port pair) in `gdb.attach`
87+
88+
[2519]: https://github.com/Gallopsled/pwntools/pull/2519
89+
[2507]: https://github.com/Gallopsled/pwntools/pull/2507
90+
[2522]: https://github.com/Gallopsled/pwntools/pull/2522
91+
[2524]: https://github.com/Gallopsled/pwntools/pull/2524
92+
[2526]: https://github.com/Gallopsled/pwntools/pull/2526
93+
[2517]: https://github.com/Gallopsled/pwntools/pull/2517
94+
[2527]: https://github.com/Gallopsled/pwntools/pull/2527
95+
[2530]: https://github.com/Gallopsled/pwntools/pull/2530
96+
[2529]: https://github.com/Gallopsled/pwntools/pull/2529
97+
[2504]: https://github.com/Gallopsled/pwntools/pull/2504
98+
99+
## 4.15.0 (`beta`)
100+
101+
- [#2508][2508] Ignore a warning when compiling with asm on nix
76102
- [#2471][2471] Properly close spawned kitty window
77103
- [#2358][2358] Cache output of `asm()`
78104
- [#2457][2457] Catch exception of non-ELF files in checksec.
@@ -91,6 +117,7 @@ The table below shows which release corresponds to each branch, and what date th
91117
- [#2364][2364] Deprecate direct commandline scripts invocation and exclude nonsense ones
92118
- [#2506][2506] ROP: fix `ROP(ELF(exe)).leave` is `None` in some ELF
93119

120+
[2508]: https://github.com/Gallopsled/pwntools/pull/2508
94121
[2471]: https://github.com/Gallopsled/pwntools/pull/2471
95122
[2358]: https://github.com/Gallopsled/pwntools/pull/2358
96123
[2457]: https://github.com/Gallopsled/pwntools/pull/2457
@@ -109,7 +136,15 @@ The table below shows which release corresponds to each branch, and what date th
109136
[2364]: https://github.com/Gallopsled/pwntools/pull/2364
110137
[2506]: https://github.com/Gallopsled/pwntools/pull/2506
111138

112-
## 4.14.0 (`beta`)
139+
## 4.14.1
140+
141+
- [#2533][2533] Fix installation on Python 3.5 and lower
142+
- [#2518][2518] fix: update apport coredump path handling for CorefileFinder
143+
144+
[2533]: https://github.com/Gallopsled/pwntools/pull/2533
145+
[2518]: https://github.com/Gallopsled/pwntools/pull/2518
146+
147+
## 4.14.0 (`stable`)
113148

114149
- [#2356][2356] Add local libc database provider for libcdb
115150
- [#2360][2360] Add offline parameter for `search_by_hash` series function
@@ -131,6 +166,7 @@ The table below shows which release corresponds to each branch, and what date th
131166
- [#2382][2382] added optional port, gdb_args and gdbserver_args parameters to gdb.debug()
132167
- [#2435][2435] Speed up gdbserver handshake in gdb.debug()
133168
- [#2436][2436] Add resolution_addr parameter to Ret2dlresolvePayload
169+
- [#2497][2497] Fix remote.fromsocket() to handle AF_INET6 socket
134170

135171
[2436]: https://github.com/Gallopsled/pwntools/pull/2436
136172
[2371]: https://github.com/Gallopsled/pwntools/pull/2371
@@ -152,14 +188,9 @@ The table below shows which release corresponds to each branch, and what date th
152188
[2382]: https://github.com/Gallopsled/pwntools/pull/2382
153189
[2435]: https://github.com/Gallopsled/pwntools/pull/2435
154190
[2437]: https://github.com/Gallopsled/pwntools/pull/2437
155-
156-
## 4.13.2
157-
158-
- [#2497][2497] Fix remote.fromsocket() to handle AF_INET6 socket
159-
160191
[2497]: https://github.com/Gallopsled/pwntools/pull/2497
161192

162-
## 4.13.1 (`stable`)
193+
## 4.13.1
163194

164195
- [#2445][2445] Fix parsing the PLT on Windows
165196
- [#2466][2466] Fix PLT emulation with Unicorn 2.1.0
@@ -184,7 +215,7 @@ The table below shows which release corresponds to each branch, and what date th
184215
- [#2308][2308] Fix WinExec shellcraft to make sure it's 16 byte aligned
185216
- [#2279][2279] Make `pwn template` always set context.binary
186217
- [#2310][2310] Add support to start a process on Windows
187-
- [#2335][2335] Add lookup optimizations in DynELF
218+
- [#2335][2335] Add lookup optimizations in DynELF
188219
- [#2334][2334] Speed up disasm commandline tool with colored output
189220
- [#2328][2328] Lookup using $PATHEXT file extensions in `which` on Windows
190221
- [#2189][2189] Explicitly define p64/u64 functions for IDE support
@@ -271,7 +302,7 @@ The table below shows which release corresponds to each branch, and what date th
271302

272303
## 4.11.0
273304

274-
- [#2185][2185] make fmtstr module able to create payload without $ notation
305+
- [#2185][2185] make fmtstr module able to create payload without $ notation
275306
- [#2103][2103] Add search for libc binary by leaked function addresses `libcdb.search_by_symbol_offsets()`
276307
- [#2177][2177] Support for RISC-V 64-bit architecture
277308
- [#2186][2186] Enhance `ELF.nx` and `ELF.execstack`

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ To get you started, we've provided some example solutions for past CTF challenge
3232

3333
# Installation
3434

35-
Pwntools is best supported on 64-bit Ubuntu LTS releases (18.04, 20.04, 22.04, and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.).
35+
Pwntools is best supported on 64-bit Ubuntu LTS releases (22.04 and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.).
3636

37-
Python3 is suggested, but Pwntools still works with Python 2.7. Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with
37+
Pwntools supports Python 3.10+ since version 5.0.0. Use Pwntools 4.x for older versions as well as Python 2.7. Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with
3838

3939
```sh
4040
sudo apt-get update

TESTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Pwntools makes extensive use of unit tests and integration tests to ensure every
44

55
## Test Suite
66

7-
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!
7+
To run the test suite, it is best to use Ubuntu 22.04 or 24.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!
88

99
```sh
1010
bash travis/install.sh
@@ -15,7 +15,7 @@ PWNLIB_NOTERM=1 make -C docs doctest
1515

1616
## Testing in Docker
1717

18-
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.
18+
A `Dockerfile` has been provided which has a clean testing environment with Ubuntu Jammy. It is very similar to the online Github Actions CI testing environment, but uses a more modern version of Ubuntu.
1919

2020
See `travis/docker/README.md` for more information.
2121

docs/requirements.txt

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@ capstone
22
coverage[toml]
33
python-dateutil
44
doc2dash
5-
docutils<0.18; python_version<'3'
6-
docutils>=0.18; python_version>='3'
5+
docutils>=0.18
76
intervaltree
87
isort
98
mako>=1.0.0
109
paramiko>=1.15.2
1110
pip>=6.0.8
12-
pyelftools>=0.29, <0.30; python_version<'3'
13-
pyelftools>=0.29; python_version>='3'
11+
pyelftools>=0.29
1412
pygments>=2.0
1513
pypandoc
1614
pyserial>=2.7
1715
pysocks
1816
psutil
1917
requests>=2.5.1
2018
ropgadget>=5.3
21-
sphinx==1.8.6; python_version<'3'
22-
sphinx>=7.0.0; python_version>='3'
19+
sphinx>=8.1.3, <9
2320
sphinx_rtd_theme
2421
sphinxcontrib-autoprogram<=0.1.5

docs/source/adb.rst

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from pwn import *
55
adb = pwnlib.adb
66

7+
import doctest
8+
doctest_additional_flags = doctest.OPTIONFLAGS_BY_NAME['LINUX']
9+
710
:mod:`pwnlib.adb` --- Android Debug Bridge
811
=====================================================
912

docs/source/asm.rst

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import subprocess
55
from pwn import *
66

7+
# TODO: Remove global POSIX flag
8+
import doctest
9+
doctest_additional_flags = doctest.OPTIONFLAGS_BY_NAME['POSIX']
10+
711
:mod:`pwnlib.asm` --- Assembler functions
812
=========================================
913

0 commit comments

Comments
 (0)