File tree Expand file tree Collapse file tree
fuzzers/binary_only/python_qemu Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ cd LibAFL/bindings/pylibafl
99python3 -m venv .env
1010# Activate virtual environment
1111source .env/bin/activate
12- # Install maturin
13- pip install maturin
12+ # Install dependencies
13+ pip install maturin distlib patchelf
1414# Build python module
1515maturin develop
1616```
@@ -19,21 +19,27 @@ This is going to install `pylibafl` python module into this venv.
1919
2020## Use bindings
2121
22- ### Example: Running baby_fuzzer in fuzzers/baby_fuzzer/baby_fuzzer.py
22+ ### Example: Running the test fuzzer
2323
2424First, make sure the python virtual environment is activated. If not, run `source .env/bin/activate
2525` . Running ` pip freeze` at this point should display the following (versions may differ):
2626
2727``` ini
28- maturin ==0.12.6
28+ distlib ==0.4.0
29+ maturin ==1.12.6
30+ patchelf ==0.17.2.4
2931pylibafl ==0.7.0
30- toml ==0.10.2
3132```
3233
3334Then simply run
3435
3536``` sh
36- python PATH_TO_BABY_FUZZER/baby_fuzzer.py
37+ ./test.sh
3738```
3839
39- The crashes directory will be created in the directory from which you ran the command.
40+ You should see the following show up after a short pause:
41+
42+ ```
43+ Starting to fuzz from python!
44+ PylibAFL works!
45+ ```
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33mkdir in || true
4- echo " a" > ./in/a
4+ echo " a" > ./in/a
55
66timeout 10 python3 ./test.py
77export exit_code=$?
88if [ $exit_code -eq 124 ]; then
9- # 124 = timeout happened. All good.
10- exit 0
9+ # 124 = timeout happened. All good.
10+ echo " PylibAFL works!"
11+ exit 0
1112else
12- exit $exit_code
13+ exit $exit_code
1314fi
14-
Original file line number Diff line number Diff line change 44
55First, install python bindings (check ` LibAFL/bindings/pylibafl ` ) and use the virtual environment.
66
7+ Then, install lief.
8+ ``` bash
9+ $ pip install lief
10+ ```
11+
712Then, create the ` in ` folder and put some input inside
813``` bash
914$ mkdir in
1015$ echo aaaaa > in/input
1116```
1217
18+ Finally, compile the binary.
19+ ``` bash
20+ $ gcc fuzz.c -o a.out
21+ ```
22+
1323## Run
1424
1525``` bash
You can’t perform that action at this time.
0 commit comments