5
5
test :
6
6
strategy :
7
7
matrix :
8
- python_version : ['2.7 ', '3.10 ']
8
+ python_version : ['3.10 ', '3.12 ']
9
9
os : [ubuntu-latest]
10
+ include :
11
+ - python_version : ' 2.7'
12
+ os : ubuntu-22.04
10
13
runs-on : ${{ matrix.os }}
11
14
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/
12
30
steps :
13
31
- uses : actions/checkout@v4
14
32
with :
@@ -18,26 +36,54 @@ jobs:
18
36
run : |
19
37
git fetch origin
20
38
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
21
61
22
62
- name : Install RPyC for gdb
23
63
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.
25
66
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
27
68
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
28
-
69
+
29
70
- name : Cache for pip
30
71
uses : actions/cache@v4
31
- id : cache-pip
72
+ if : matrix.python_version == '2.7'
32
73
with :
33
74
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-
35
77
36
78
- name : Set up Python ${{ matrix.python_version }}
37
79
if : matrix.python_version != '2.7'
38
80
uses : actions/setup-python@v5
39
81
with :
40
82
python-version : ${{ matrix.python_version }}
83
+ cache : ' pip'
84
+ cache-dependency-path : |
85
+ **/pyproject.toml
86
+ **/requirements*.txt
41
87
42
88
- name : Set up Python 2.7
43
89
if : matrix.python_version == '2.7'
78
124
binutils-powerpc-linux-gnu \
79
125
binutils-s390x-linux-gnu \
80
126
binutils-sparc64-linux-gnu \
127
+ binutils-riscv64-linux-gnu \
81
128
gcc-multilib \
82
129
libc6-dbg \
83
130
elfutils \
@@ -149,11 +196,18 @@ jobs:
149
196
pwn shellcraft --list |tail
150
197
pwn shellcraft -l --syscalls |tail
151
198
pwn shellcraft -l execve
199
+ pwn shellcraft -l execve + exit
152
200
pwn shellcraft --show i386.linux.loader_append
201
+ pwn shellcraft --show i386.linux.loader_append + i386.linux.sh
153
202
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 =
154
205
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
155
207
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
156
209
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
157
211
pwn shellcraft -f str aarch64.linux.sh </dev/null
158
212
pwn shellcraft -abr -f elf -o /dev/null amd64.linux.cat /etc/passwd </dev/null
159
213
pwn shellcraft -nzr thumb.linux.syscalls.execve /bin/cat '["/bin/cat", "/etc/os-release"]' </dev/null
@@ -195,16 +249,45 @@ jobs:
195
249
python -m build
196
250
197
251
- uses : actions/upload-artifact@v4
198
- if : matrix.python_version != '2.7 '
252
+ if : matrix.python_version == '3.10 '
199
253
with :
200
254
name : packages
201
255
path : dist/
256
+ include-hidden-files : true
202
257
203
258
- uses : actions/upload-artifact@v4
204
259
with :
205
260
name : coverage-${{ matrix.python_version }}
206
261
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
207
269
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
208
291
209
292
upload-coverage :
210
293
runs-on : ubuntu-latest
@@ -221,7 +304,7 @@ jobs:
221
304
222
305
- name : Install coveralls
223
306
run : |
224
- pip install tomli coveralls
307
+ pip install --break-system-packages tomli coveralls || pip install tomli coveralls
225
308
226
309
- name : Upload coverage to coveralls.io
227
310
run : |
0 commit comments