Skip to content

Commit de74a9a

Browse files
authored
Merge branch 'Gallopsled:dev' into dev
2 parents 8e5f43d + 24d217c commit de74a9a

Some content is hidden

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

109 files changed

+7545
-556
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You should see `[DEBUG]` statements that show what's happening behind the scenes
3939

4040
## Verify on Ubuntu
4141

42-
If possible, please verify that your issue occurs on 64-bit Ubuntu 18.04. We provide a Dockerfile based on Ubuntu 18.04 via `docker.io` to make this super simple, no VM required!
42+
If possible, please verify that your issue occurs on 64-bit Ubuntu 22.04. We provide a Dockerfile based on Ubuntu 22.04 via `docker.io` to make this super simple, no VM required!
4343

4444
```sh
4545
# Download the Docker image

.github/workflows/android.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,21 @@ jobs:
66
android-test:
77
strategy:
88
matrix:
9-
python-version: [3.8]
9+
python-version: ['3.10']
1010
os: [ubuntu-latest]
1111
runs-on: ${{ matrix.os }}
1212
timeout-minutes: 30
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Cache for pip
17-
uses: actions/cache@v4
18-
id: cache-pip
19-
with:
20-
path: ~/.cache/pip
21-
key: ${{ matrix.os }}-cache-pip
22-
2316
- name: Set up Python ${{ matrix.python-version }}
2417
uses: actions/setup-python@v5
2518
with:
2619
python-version: ${{ matrix.python-version }}
20+
cache: 'pip'
21+
cache-dependency-path: |
22+
**/pyproject.toml
23+
**/requirements*.txt
2724
2825
- name: Install Linux dependencies
2926
run: |
@@ -35,6 +32,19 @@ jobs:
3532
binutils-arm-linux-gnueabihf \
3633
libc6-dbg
3734
35+
- name: Cache for avd
36+
uses: actions/cache@v4
37+
id: cache-avd
38+
with:
39+
path: |
40+
~/.android
41+
/usr/local/lib/android/sdk/emulator
42+
/usr/local/lib/android/sdk/platform-tools
43+
/usr/local/lib/android/sdk/system-images
44+
key: ${{ matrix.os }}-cache-avd-${{ hashFiles('travis/setup_avd*.sh') }}
45+
restore-keys: |
46+
${{ matrix.os }}-cache-avd-
47+
3848
- name: Install Android AVD
3949
run: |
4050
sudo usermod -aG kvm $USER

.github/workflows/ci.yml

+91-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,28 @@ jobs:
55
test:
66
strategy:
77
matrix:
8-
python_version: ['2.7', '3.10']
8+
python_version: ['3.10', '3.12']
99
os: [ubuntu-latest]
10+
include:
11+
- python_version: '2.7'
12+
os: ubuntu-22.04
1013
runs-on: ${{ matrix.os }}
1114
timeout-minutes: 30
15+
services:
16+
libcdb-cache:
17+
image: nginx
18+
volumes:
19+
- /home/runner/libcdb-cache:/var/cache/nginx
20+
ports:
21+
- 3000:3000 # https://debuginfod.elfutils.org proxy cache
22+
- 3001:3001 # https://libc.rip/ proxy cache
23+
- 3002:3002 # http://archive.ubuntu.com/ proxy cache
24+
- 3003:3003 # https://gitlab.com/ proxy cache
25+
env:
26+
DEBUGINFOD_URLS: http://localhost:3000/
27+
PWN_LIBCRIP_URL: http://localhost:3001/
28+
PWN_UBUNTU_ARCHIVE_URL: http://localhost:3002/
29+
PWN_GITLAB_LIBCDB_URL: http://localhost:3003/
1230
steps:
1331
- uses: actions/checkout@v4
1432
with:
@@ -18,26 +36,54 @@ jobs:
1836
run: |
1937
git fetch origin
2038
git log --oneline --graph -10
39+
40+
- name: Fix libcdb-cache permissions
41+
id: fix-perms
42+
run: |
43+
sudo chown -R runner:runner /home/runner/libcdb-cache
44+
echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
45+
46+
- name: Cache for libcdb requests
47+
uses: actions/cache@v4
48+
with:
49+
path: ~/libcdb-cache
50+
key: libcdb-python${{ matrix.python_version }}-${{ steps.fix-perms.outputs.date }}
51+
restore-keys: |
52+
libcdb-python${{ matrix.python_version }}-
53+
libcdb-
54+
55+
- name: Install libcdb-cache service config
56+
run: |
57+
sudo chown -R 101:101 /home/runner/libcdb-cache
58+
container_id=$(docker ps --all --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
59+
docker cp ./travis/libcdb_nginx_cache.conf $container_id:/etc/nginx/nginx.conf
60+
docker restart $container_id
2161
2262
- name: Install RPyC for gdb
2363
run: |
24-
# The version packaged in python3-rpyc is too old on Ubuntu 22.04
64+
# The version packaged in python3-rpyc is too old on Ubuntu 24.04
65+
# We use ^6.0 from pip.
2566
sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver
26-
/usr/bin/python -m pip install rpyc
67+
/usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc
2768
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
28-
69+
2970
- name: Cache for pip
3071
uses: actions/cache@v4
31-
id: cache-pip
72+
if: matrix.python_version == '2.7'
3273
with:
3374
path: ~/.cache/pip
34-
key: ${{ matrix.os }}-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-
3577

3678
- name: Set up Python ${{ matrix.python_version }}
3779
if: matrix.python_version != '2.7'
3880
uses: actions/setup-python@v5
3981
with:
4082
python-version: ${{ matrix.python_version }}
83+
cache: 'pip'
84+
cache-dependency-path: |
85+
**/pyproject.toml
86+
**/requirements*.txt
4187
4288
- name: Set up Python 2.7
4389
if: matrix.python_version == '2.7'
@@ -78,6 +124,7 @@ jobs:
78124
binutils-powerpc-linux-gnu \
79125
binutils-s390x-linux-gnu \
80126
binutils-sparc64-linux-gnu \
127+
binutils-riscv64-linux-gnu \
81128
gcc-multilib \
82129
libc6-dbg \
83130
elfutils \
@@ -149,11 +196,18 @@ jobs:
149196
pwn shellcraft --list |tail
150197
pwn shellcraft -l --syscalls |tail
151198
pwn shellcraft -l execve
199+
pwn shellcraft -l execve + exit
152200
pwn shellcraft --show i386.linux.loader_append
201+
pwn shellcraft --show i386.linux.loader_append + i386.linux.sh
153202
pwn shellcraft -f asm --color amd64.linux.sh
203+
pwn shellcraft -f asm --color amd64.linux.setreuid + amd64.linux.cat /etc/passwd
204+
pwn shellcraft -f asm --color amd64.linux.setreuid = amd64.linux.cat /key+secret --delim =
154205
pwn shellcraft -f elf amd64.linux.syscalls.exit 0 </dev/null |pwn hex
206+
pwn shellcraft -f elf amd64.linux.cat /etc/passwd + amd64.linux.syscalls.exit 0 </dev/null |pwn hex
155207
pwn shellcraft -f i --color amd64.linux.cat /etc/passwd </dev/null
208+
pwn shellcraft -f i --color amd64.linux.cat /etc/passwd + amd64.linux.sh </dev/null
156209
pwn shellcraft -f c amd64.linux.syscalls.exit 0 </dev/null
210+
pwn shellcraft -f c amd64.linux.cat /etc/passwd + amd64.linux.syscalls.exit 0 </dev/null
157211
pwn shellcraft -f str aarch64.linux.sh </dev/null
158212
pwn shellcraft -abr -f elf -o /dev/null amd64.linux.cat /etc/passwd </dev/null
159213
pwn shellcraft -nzr thumb.linux.syscalls.execve /bin/cat '["/bin/cat", "/etc/os-release"]' </dev/null
@@ -195,16 +249,45 @@ jobs:
195249
python -m build
196250
197251
- uses: actions/upload-artifact@v4
198-
if: matrix.python_version != '2.7'
252+
if: matrix.python_version == '3.10'
199253
with:
200254
name: packages
201255
path: dist/
256+
include-hidden-files: true
202257

203258
- uses: actions/upload-artifact@v4
204259
with:
205260
name: coverage-${{ matrix.python_version }}
206261
path: .coverage*
262+
include-hidden-files: true
263+
264+
- name: Fix libcdb-cache permissions
265+
run: |
266+
container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
267+
docker stop $container_id
268+
sudo chown -R runner:runner /home/runner/libcdb-cache
207269
270+
windows-test:
271+
runs-on: windows-latest
272+
timeout-minutes: 30
273+
continue-on-error: true
274+
steps:
275+
- uses: actions/checkout@v4
276+
277+
- name: Set up Python 3.12
278+
uses: actions/setup-python@v5
279+
with:
280+
python-version: '3.12'
281+
282+
- name: Install dependencies
283+
run: |
284+
pip install --upgrade pip
285+
pip install --upgrade --editable .
286+
287+
- name: Sanity checks
288+
run: |
289+
python -bb -c 'from pwn import *'
290+
python -bb examples/text.py
208291
209292
upload-coverage:
210293
runs-on: ubuntu-latest
@@ -221,7 +304,7 @@ jobs:
221304

222305
- name: Install coveralls
223306
run: |
224-
pip install tomli coveralls
307+
pip install --break-system-packages tomli coveralls || pip install tomli coveralls
225308
226309
- name: Upload coverage to coveralls.io
227310
run: |

.github/workflows/docker.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ jobs:
2222
password: ${{ secrets.DOCKERHUB_PASSWORD }}
2323

2424
- name: Build and push base image
25-
uses: docker/build-push-action@v5
25+
uses: docker/build-push-action@v6
2626
if: github.event_name == 'workflow_dispatch'
2727
with:
2828
context: "{{defaultContext}}:extra/docker/base"
2929
push: true
3030
tags: pwntools/pwntools:base
3131

3232
- name: Build and push stable image
33-
uses: docker/build-push-action@v5
33+
uses: docker/build-push-action@v6
3434
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/stable')
3535
with:
3636
context: "{{defaultContext}}:extra/docker/stable"
3737
push: true
3838
tags: pwntools/pwntools:stable
3939

4040
- name: Build and push beta image
41-
uses: docker/build-push-action@v5
41+
uses: docker/build-push-action@v6
4242
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/beta')
4343
with:
4444
context: "{{defaultContext}}:extra/docker/beta"
4545
push: true
4646
tags: pwntools/pwntools:beta
4747

4848
- name: Build and push dev image
49-
uses: docker/build-push-action@v5
49+
uses: docker/build-push-action@v6
5050
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/dev')
5151
with:
5252
context: "{{defaultContext}}:extra/docker/dev"
@@ -56,7 +56,7 @@ jobs:
5656
pwntools/pwntools:latest
5757
5858
- name: Build and push ci image
59-
uses: docker/build-push-action@v5
59+
uses: docker/build-push-action@v6
6060
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/dev')
6161
with:
6262
context: "{{defaultContext}}:travis/docker"

.github/workflows/lint.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@ jobs:
55
lint:
66
strategy:
77
matrix:
8-
python-version: [3.8]
8+
python-version: ['3.10']
99
os: [ubuntu-latest]
1010
runs-on: ${{ matrix.os }}
1111
timeout-minutes: 30
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: Cache for pip
15-
uses: actions/cache@v4
16-
id: cache-pip
17-
with:
18-
path: ~/.cache/pip
19-
key: ${{ matrix.os }}-cache-pip
2014

2115
- name: Set up Python ${{ matrix.python-version }}
2216
uses: actions/setup-python@v5
2317
with:
2418
python-version: ${{ matrix.python-version }}
19+
cache: 'pip'
20+
cache-dependency-path: |
21+
**/pyproject.toml
22+
**/requirements*.txt
2523
2624
- name: Critical lint
2725
run: |

.github/workflows/pylint.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@ jobs:
55
build:
66
strategy:
77
matrix:
8-
python-version: [3.8]
8+
python-version: ['3.10']
99
os: [ubuntu-latest]
1010
runs-on: ${{ matrix.os }}
1111
timeout-minutes: 30
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: Cache for pip
15-
uses: actions/cache@v4
16-
id: cache-pip
17-
with:
18-
path: ~/.cache/pip
19-
key: ${{ matrix.os }}-cache-pip
2014

2115
- name: Set up Python ${{ matrix.python-version }}
2216
uses: actions/setup-python@v5
2317
with:
2418
python-version: ${{ matrix.python-version }}
19+
cache: 'pip'
20+
cache-dependency-path: |
21+
**/pyproject.toml
22+
**/requirements*.txt
2523
2624
- name: PyLint
2725
run: |

0 commit comments

Comments
 (0)