jwilk / python-afl

American Fuzzy Lop fork server and instrumentation for pure-Python code
https://jwilk.net/software/python-afl
MIT License
350 stars 33 forks source link

Program 'test.py' not found or not executable #13

Open NikParam42 opened 4 years ago

NikParam42 commented 4 years ago

Hello everyone! Why this error does not allow me to run fuzzing?

I tried to manually set the AFL_SKIP_BIN_CHECK=1 environment variables, but it doesn't help.

NikParam42 commented 4 years ago

I solved this error. It was correct to run this way $ py-afl-fuzz [options] -- python /path/to/fuzzed/python/script [...]

But why is it written like this in README if it's wrong? $ py-afl-fuzz [options] -- /path/to/fuzzed/python/script [...]

jwilk commented 4 years ago

I can only guess that you did something like

$ py-afl-fuzz -i in -o out -- test.py

when you actually needed:

$ py-afl-fuzz -i in -o out -- ./test.py

(Assuming that test.py exists in the current working directory, is executable and has appropriate shebang.)

NikParam42 commented 4 years ago

I can only guess that you did something like

$ py-afl-fuzz -i in -o out -- test.py

when you actually needed:

$ py-afl-fuzz -i in -o out -- ./test.py

(Assuming that test.py exists in the current working directory, is executable and has appropriate shebang.)

fuzz

jwilk commented 4 years ago

Does target.py have the executable bit set? Does it have correct shebang?

soemthlng commented 2 years ago

@jwilk A python script without a shebang is not suitable for this fuzzer?

jwilk commented 2 years ago

py-afl-fuzz passes all the arguments verbatim to afl-fuzz, and the later doesn't know of course anything about Python. So your options are: either add shebang and set the exctuable bit, or specify the interpreter explicitly on the command line.

soemthlng commented 2 years ago

@jwilk Ok, I set shebang like this. #!/home/myname/anaconda3/bin/python3.8 import asyncio import logging

and I set the executable bit rwxr-xr-x.

but py-afl-fuzz still does not work.

I print this error. [-] PROGRAM ABORT : Program 'test_device.py' not found or not executable Location : check_binary(), afl-fuzz.c:6548

And I have no idea how to specify the interpreter explicitly on the command line. Could you let me know?