angr / wheels

Wheels for speeding up builds and helping people out.
BSD 2-Clause "Simplified" License
7 stars 4 forks source link

shellphish_afl - difference in afl-fuzz file when compiling manually #2

Open lzina opened 5 years ago

lzina commented 5 years ago

Hi,

I installed shellphish_afl-1.2.1-py2.py3-none-manylinux1_x86_64.whl in order to run shellphish/fuzzer and it works as expected.

For optimization issues, I want to edit the afl-fuzz.c file. However, when I download shellphish_afl (i tried both 1.1/1.2.1), run setup.py to compile files, create the same folders architecture, and actually replace afl-fuzz in afl-unix , the shellphish/fuzzer does not work as expected. Below is the error I get:

afl-fuzz 2.52b by <lcamtuf@google.com>
[+] Looks like we're not running on a tty, so I'll be a bit less verbose.
[+] You have 3 CPU cores and 4 runnable tasks (utilization: 133%).
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[*] Checking core_pattern...
[*] Setting up output directories...
[*] Scanning '/dev/shm/work/Palindrome/input'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[*] Attempting dry run with 'id:000000,orig:seed-0'...
[*] Spinning up the fork server...

[-] Hmm, looks like the target binary terminated before we could complete a
    handshake with the injected code. Perhaps there is a horrible bug in the
    fuzzer. Poke <lcamtuf@coredump.cx> for troubleshooting tips.
)B[?25h
[-] PROGRAM ABORT : Fork server handshake failed
         Location : init_forkserver(), afl-fuzz.c:2253

Attached both afl-fuzz exec files: afl-fuzz.zip

I read the setup.py, build.sh etc. and didn't see any special command or relevant path that should cause the problem.

Maybe one of you can think about any idea?

Thanks!!

lzina commented 5 years ago

As I see, the issue is remarked as a bug, Will it be fixed soon? and actually, what is the bug?

lzina commented 5 years ago

I found the problem!

If you choose to compile the afl-fuzz.c by yourself, be aware to the fact that you also need to replace the afl-qemu-trace in the relevant ARCHES under afl-unix/tracers .

For example I built the qemu-2.10.0 with build_qemu_support.sh and replaced the afl-qemu-trace file in both ~/venv/bin/afl-unix/tracers/i386 and ~/venv/bin/afl-unix/tracers/x86_64 accordingly.

rhelmot commented 5 years ago

@zardus can you assign this to one of your students?

lzina commented 5 years ago

what do you mean "assign this to one of your students"? assign what?

On Mon, May 20, 2019 at 9:14 PM Audrey Dutcher notifications@github.com wrote:

@zardus https://github.com/zardus can you assign this to one of your students?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angr/wheels/issues/2?email_source=notifications&email_token=AH5H5EUXEQMR2OBHIMQJCWLPWLS7TA5CNFSM4HN4PTA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZUU2Y#issuecomment-494094955, or mute the thread https://github.com/notifications/unsubscribe-auth/AH5H5EUQF34P23Y36625LXLPWLS7TANCNFSM4HN4PTAQ .

zardus commented 5 years ago

My interpretation of this issue is that we just need to make sure repackage shellphish-afl whenever we repackage shellphish-qemu. Once people start manually in custom ways, I'd say they're on their own.