Skip to content

Commit 2d8d6a6

Browse files
authored
Merge branch 'dev' into optional-deps
2 parents 8ee99a5 + 51e8eb0 commit 2d8d6a6

File tree

173 files changed

+22215
-1308
lines changed

Some content is hidden

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

173 files changed

+22215
-1308
lines changed

.github/workflows/android.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
- uses: actions/checkout@v4
1515

1616
- name: Cache for pip
17-
uses: actions/cache@v3
17+
uses: actions/cache@v4
1818
id: cache-pip
1919
with:
2020
path: ~/.cache/pip
2121
key: ${{ matrix.os }}-cache-pip
2222

2323
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

@@ -37,6 +37,7 @@ jobs:
3737
3838
- name: Install Android AVD
3939
run: |
40+
sudo usermod -aG kvm $USER
4041
source travis/setup_avd_fast.sh
4142
sed -i 's/skip_android = True/skip_android = False/' docs/source/conf.py
4243
set | grep ^PATH >.android.env

.github/workflows/ci.yml

+25-11
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,23 @@ jobs:
1919
git fetch origin
2020
git log --oneline --graph -10
2121
22+
- name: Install RPyC for gdb
23+
run: |
24+
# The version packaged in python3-rpyc is too old on Ubuntu 22.04
25+
sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver
26+
/usr/bin/python -m pip install rpyc
27+
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
28+
2229
- name: Cache for pip
23-
uses: actions/cache@v3
30+
uses: actions/cache@v4
2431
id: cache-pip
2532
with:
2633
path: ~/.cache/pip
2734
key: ${{ matrix.os }}-cache-pip
2835

2936
- name: Set up Python ${{ matrix.python_version }}
3037
if: matrix.python_version != '2.7'
31-
uses: actions/setup-python@v4
38+
uses: actions/setup-python@v5
3239
with:
3340
python-version: ${{ matrix.python_version }}
3441

@@ -62,7 +69,6 @@ jobs:
6269
sudo apt-get update
6370
sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
6471
ash bash-static dash ksh mksh zsh \
65-
python3-rpyc \
6672
gdb gdbserver socat \
6773
binutils-multiarch qemu-user-static \
6874
binutils-aarch64-linux-gnu \
@@ -72,6 +78,7 @@ jobs:
7278
binutils-powerpc-linux-gnu \
7379
binutils-s390x-linux-gnu \
7480
binutils-sparc64-linux-gnu \
81+
binutils-riscv64-linux-gnu \
7582
gcc-multilib \
7683
libc6-dbg \
7784
elfutils \
@@ -112,6 +119,10 @@ jobs:
112119
113120
- name: Coverage doctests
114121
run: |
122+
# Python version installed using setup-python interferes with gdb's python
123+
# by setting LD_LIBRARY_PATH and gdb's python becoming unable to load built-in modules
124+
# like _socket. This is a workaround.
125+
unset LD_LIBRARY_PATH
115126
PWNLIB_NOTERM=1 python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest
116127
117128
- name: Coverage running examples
@@ -164,6 +175,7 @@ jobs:
164175
pwn phd -l 0x3d --color=always /etc/os-release
165176
166177
pwn checksec /bin/bash
178+
(ulimit -v 500000 && pwn checksec /bin/bash)
167179
168180
pwn errno 2
169181
pwn errno -1
@@ -172,24 +184,26 @@ jobs:
172184
pwn constgrep -c freebsd -m ^PROT_ '3 + 4'
173185
pwn constgrep ^MAP_ 0
174186
pwn constgrep -e O_RDWR
187+
pwn constgrep C
175188
176189
pwn libcdb file /lib/x86_64-linux-gnu/libc.so.6
177190
pwn libcdb lookup puts 5f0 __libc_start_main_ret d0a
178191
pwn libcdb hash b229d1da1e161f95e839cf90cded5f719e5de308
179192
180193
- name: Build source and wheel distributions
181-
if: matrix.python_version > '2.7'
194+
if: matrix.python_version != '2.7'
182195
run: |
183196
python -m build
184197
185-
- uses: actions/upload-artifact@v3
198+
- uses: actions/upload-artifact@v4
199+
if: matrix.python_version != '2.7'
186200
with:
187201
name: packages
188202
path: dist/
189203

190-
- uses: actions/upload-artifact@v3
204+
- uses: actions/upload-artifact@v4
191205
with:
192-
name: coverage
206+
name: coverage-${{ matrix.python_version }}
193207
path: .coverage*
194208

195209

@@ -201,10 +215,10 @@ jobs:
201215
with:
202216
fetch-depth: 20
203217

204-
- uses: actions/download-artifact@v3
218+
- uses: actions/download-artifact@v4
205219
with:
206-
name: coverage
207-
path: .
220+
pattern: coverage-*
221+
merge-multiple: true
208222

209223
- name: Install coveralls
210224
run: |
@@ -243,7 +257,7 @@ jobs:
243257
needs: test
244258
steps:
245259
- name: Download artifacts
246-
uses: actions/download-artifact@v3
260+
uses: actions/download-artifact@v4
247261
with:
248262
name: packages
249263
path: dist

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Cache for pip
15-
uses: actions/cache@v3
15+
uses: actions/cache@v4
1616
id: cache-pip
1717
with:
1818
path: ~/.cache/pip
1919
key: ${{ matrix.os }}-cache-pip
2020

2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

.github/workflows/pylint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Cache for pip
15-
uses: actions/cache@v3
15+
uses: actions/cache@v4
1616
id: cache-pip
1717
with:
1818
path: ~/.cache/pip
1919
key: ${{ matrix.os }}-cache-pip
2020

2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

.readthedocs.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ build:
77
tools:
88
python: "3"
99

10+
sphinx:
11+
configuration: docs/source/conf.py
12+
1013
python:
1114
install:
1215
- requirements: docs/requirements.txt

CHANGELOG.md

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

1010
| Version | Branch | Release Date |
1111
| ---------------- | -------- | ---------------------- |
12-
| [4.13.0](#4130-dev) | `dev` |
13-
| [4.12.0](#4120-beta) | `beta` |
14-
| [4.11.0](#4110-stable) | `stable` | Sep 15, 2023
12+
| [4.14.0](#4140-dev) | `dev` |
13+
| [4.13.0](#4130-beta) | `beta` |
14+
| [4.12.1](#4121) | |
15+
| [4.12.0](#4120-stable) | `stable` | Feb 22, 2024
16+
| [4.11.1](#4111) | | Nov 14, 2023
17+
| [4.11.0](#4110) | | Sep 15, 2023
1518
| [4.10.0](#4100) | | May 21, 2023
1619
| [4.9.0](#490) | | Dec 29, 2022
1720
| [4.8.0](#480) | | Apr 21, 2022
@@ -67,18 +70,108 @@ The table below shows which release corresponds to each branch, and what date th
6770
| [3.0.0](#300) | | Aug 20, 2016
6871
| [2.2.0](#220) | | Jan 5, 2015
6972

70-
## 4.13.0 (`dev`)
73+
## 4.14.0 (`dev`)
74+
75+
- [#2360][2360] Add offline parameter for `search_by_hash` series function
76+
- [#2356][2356] Add local libc database provider for libcdb
77+
- [#2374][2374] libcdb.unstrip_libc: debug symbols are fetched only if not present
78+
- [#2327][2327] Add basic support to debug processes on Windows
79+
- [#2322][2322] Add basic RISCV64 shellcraft support
80+
- [#2330][2330] Change `context.newline` when setting `context.os` to `"windows"`
81+
- [#2389][2389] Fix passing bytes to `context.log_file` and `crc.BitPolynom`
82+
- [#2391][2391] Fix error message when passing invalid kwargs to `xor`
83+
- [#2376][2376] Return buffered data on first EOF in tube.readline()
84+
- [#2387][2387] Convert apport_corefile() output from bytes-like object to string
85+
- [#2388][2388] libcdb: add `offline_only` to `search_by_symbol_offsets`
86+
87+
[2360]: https://github.com/Gallopsled/pwntools/pull/2360
88+
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
89+
[2374]: https://github.com/Gallopsled/pwntools/pull/2374
90+
[2327]: https://github.com/Gallopsled/pwntools/pull/2327
91+
[2322]: https://github.com/Gallopsled/pwntools/pull/2322
92+
[2330]: https://github.com/Gallopsled/pwntools/pull/2330
93+
[2389]: https://github.com/Gallopsled/pwntools/pull/2389
94+
[2391]: https://github.com/Gallopsled/pwntools/pull/2391
95+
[2376]: https://github.com/Gallopsled/pwntools/pull/2376
96+
[2387]: https://github.com/Gallopsled/pwntools/pull/2387
97+
[2388]: https://github.com/Gallopsled/pwntools/pull/2388
98+
99+
## 4.13.0 (`beta`)
100+
101+
- [#2242][2242] Term module revamp: activating special handling of terminal only when necessary
102+
- [#2277][2277] elf: Resolve more relocations into GOT entries
103+
- [#2281][2281] FIX: Getting right amount of data for search fix
104+
- [#2293][2293] Add x86 CET status to checksec output
105+
- [#1763][1763] Allow to add to the existing environment in `process` instead of replacing it
106+
- [#2307][2307] Fix `pwn libcdb file` crashing if "/bin/sh" string was not found
107+
- [#2309][2309] Detect challenge binary and libc in `pwn template`
108+
- [#2308][2308] Fix WinExec shellcraft to make sure it's 16 byte aligned
109+
- [#2279][2279] Make `pwn template` always set context.binary
110+
- [#2310][2310] Add support to start a process on Windows
111+
- [#2335][2335] Add lookup optimizations in DynELF
112+
- [#2334][2334] Speed up disasm commandline tool with colored output
113+
- [#2328][2328] Lookup using $PATHEXT file extensions in `which` on Windows
114+
- [#2189][2189] Explicitly define p64/u64 functions for IDE support
115+
- [#2339][2339] Fix: Allow setting attributes on gdb Breakpoints
116+
- [#2323][2323] Retry failed lookups after one week in libcdb
117+
- [#2325][2325] Match against local system libc first in libcdb
118+
- [#2336][2336] Add `ELF.stripped` and `ELF.debuginfo` properties
119+
- [#2161][2161] Add basic support for darwin shellcraft/asm/disasm/run_shellcode/run_assembly
120+
- [#2161][2161] Fix freebsd amd64 SyscallABI
121+
- [#2160][2161] Fix invalid shellcraft.mov on arm64
122+
- [#2284][2161] Fix invalid shellcraft.pushstr_array on arm64
123+
- [#2345][2345] Fix pwn constgrep when it matches a non-constant type
124+
- [#2338][2338] Fix: follow symlink for libs on ssh connection
125+
- [#2341][2341] Launch GDB correctly in iTerm on Mac
126+
- [#2268][2268] Add a `flatten` argument to `ssh.libs`
127+
- [#2347][2347] Fix/workaround Unicorn Engine 1GB limit that calls exit()
128+
- [#2233][2233] Fix gdb.debug: exe parameter now respected, allow empty argv
129+
130+
[2242]: https://github.com/Gallopsled/pwntools/pull/2242
131+
[2277]: https://github.com/Gallopsled/pwntools/pull/2277
132+
[2281]: https://github.com/Gallopsled/pwntools/pull/2281
133+
[2293]: https://github.com/Gallopsled/pwntools/pull/2293
134+
[1763]: https://github.com/Gallopsled/pwntools/pull/1763
135+
[2307]: https://github.com/Gallopsled/pwntools/pull/2307
136+
[2309]: https://github.com/Gallopsled/pwntools/pull/2309
137+
[2308]: https://github.com/Gallopsled/pwntools/pull/2308
138+
[2279]: https://github.com/Gallopsled/pwntools/pull/2279
139+
[2310]: https://github.com/Gallopsled/pwntools/pull/2310
140+
[2335]: https://github.com/Gallopsled/pwntools/pull/2335
141+
[2334]: https://github.com/Gallopsled/pwntools/pull/2334
142+
[2328]: https://github.com/Gallopsled/pwntools/pull/2328
143+
[2189]: https://github.com/Gallopsled/pwntools/pull/2189
144+
[2339]: https://github.com/Gallopsled/pwntools/pull/2339
145+
[2323]: https://github.com/Gallopsled/pwntools/pull/2323
146+
[2325]: https://github.com/Gallopsled/pwntools/pull/2325
147+
[2336]: https://github.com/Gallopsled/pwntools/pull/2336
148+
[2161]: https://github.com/Gallopsled/pwntools/pull/2161
149+
[2345]: https://github.com/Gallopsled/pwntools/pull/2345
150+
[2338]: https://github.com/Gallopsled/pwntools/pull/2338
151+
[2341]: https://github.com/Gallopsled/pwntools/pull/2341
152+
[2268]: https://github.com/Gallopsled/pwntools/pull/2268
153+
[2347]: https://github.com/Gallopsled/pwntools/pull/2347
154+
[2233]: https://github.com/Gallopsled/pwntools/pull/2233
155+
156+
## 4.12.1
157+
158+
- [#2373][2373] Fix displaying bright color variation in terminal output
159+
- [#2378][2378] Don't go though a shell in `gdb.debug`
160+
161+
[2373]: https://github.com/Gallopsled/pwntools/pull/2373
162+
[2378]: https://github.com/Gallopsled/pwntools/pull/2378
163+
164+
## 4.12.0 (`stable`)
71165

72-
73-
74-
## 4.12.0 (`beta`)
75166
- [#2202][2202] Fix `remote` and `listen` in sagemath
76167
- [#2117][2117] Add -p (--prefix) and -s (--separator) arguments to `hex` command
77168
- [#2221][2221] Add shellcraft.sleep template wrapping SYS_nanosleep
78169
- [#2219][2219] Fix passing arguments on the stack in shellcraft syscall template
79170
- [#2212][2212] Add `--libc libc.so` argument to `pwn template` command
80171
- [#2257][2257] Allow creation of custom templates for `pwn template` command
81172
- [#2225][2225] Allow empty argv in ssh.process()
173+
- [#2349][2349] Fix term.readline omitting a trailing \n
174+
- [#2352][2352] add `RETURN_CONST` as an allowed `_const_code` in safeeval
82175

83176
[2202]: https://github.com/Gallopsled/pwntools/pull/2202
84177
[2117]: https://github.com/Gallopsled/pwntools/pull/2117
@@ -87,8 +180,24 @@ The table below shows which release corresponds to each branch, and what date th
87180
[2212]: https://github.com/Gallopsled/pwntools/pull/2212
88181
[2257]: https://github.com/Gallopsled/pwntools/pull/2257
89182
[2225]: https://github.com/Gallopsled/pwntools/pull/2225
183+
[2349]: https://github.com/Gallopsled/pwntools/pull/2349
184+
[2352]: https://github.com/Gallopsled/pwntools/pull/2352
185+
186+
## 4.11.1
187+
188+
- [#2271][2271] FIX: Generated shebang with path to python invalid if path contains spaces
189+
- [#2272][2272] Fix `tube.clean_and_log` not logging buffered data
190+
- [#2281][2281] FIX: Getting right amount of data for search fix
191+
- [#2287][2287] Fix `_countdown_handler` not invoking `timeout_change`
192+
- [#2294][2294] Fix atexit SEGV in aarch64 loader
193+
194+
[2271]: https://github.com/Gallopsled/pwntools/pull/2271
195+
[2272]: https://github.com/Gallopsled/pwntools/pull/2272
196+
[2281]: https://github.com/Gallopsled/pwntools/pull/2281
197+
[2287]: https://github.com/Gallopsled/pwntools/pull/2287
198+
[2294]: https://github.com/Gallopsled/pwntools/pull/2294
90199

91-
## 4.11.0 (`stable`)
200+
## 4.11.0
92201

93202
- [#2185][2185] make fmtstr module able to create payload without $ notation
94203
- [#2103][2103] Add search for libc binary by leaked function addresses `libcdb.search_by_symbol_offsets()`

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ include *.md *.txt *.sh *.yml MANIFEST.in
66
recursive-include docs *.rst *.png Makefile *.py *.txt
77
recursive-include pwnlib *.py *.asm *.rst *.md *.txt *.sh __doc__ *.mako
88
recursive-include pwn *.py *.asm *.rst *.md *.txt *.sh
9-
recursive-exclude *.pyc
9+
global-exclude *.pyc

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Pwntools is best supported on 64-bit Ubuntu LTS releases (14.04, 16.04, 18.04, a
3737
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
3838

3939
```sh
40-
apt-get update
41-
apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
40+
sudo apt-get update
41+
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
4242
python3 -m pip install --upgrade pip
4343
python3 -m pip install --upgrade pwntools[full]
4444
```

docs/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ isort
88
mako>=1.0.0
99
paramiko>=1.15.2
1010
pip>=6.0.8
11-
pyelftools>=0.2.3
11+
pyelftools>=0.29, <0.30; python_version<'3'
12+
pyelftools>=0.29; python_version>='3'
1213
pygments>=2.0
1314
pypandoc
1415
pyserial>=2.7

0 commit comments

Comments
 (0)