Open steppanovva opened 5 months ago
Hmm, IIRC afl-fuzz will mute output by default, but running DynamoRIO with winafl.dll directly should not. Does switching to latest DynamoRIO from https://github.com/DynamoRIO/dynamorio/releases help? Note: You might need to rebuild winafl.
Tackled this problem (I used previous binary compiled without -g flag, so apparently instruments were unable to locate main() correctly).
Now the output of
C:\Users\stepanova.anna\dev\projects\winafl\DynamoRIO-Windows-10.0.0\bin64\drrun.exe -c ..\winafl.dll -debug -target_module target.exe -target_offset 0x1cf3 -fuzz_iterations 10 -nargs 2 -- target.exe .\input\1.txt
is absolutely correct.
Ten times text below:
call target_function
File is open
File is closed
Size is read: 4
Array is filled
0 1 2 3
Array should be printed here
Array deleted
But now, when I try to run afl-fuzz.exe with command:
..\afl-fuzz.exe -i .\input -o .\output -D C:\Users\stepanova.anna\dev\projects\winafl\DynamoRIO-Windows-10.0.0\bin64 -t 20000 -- -coverage_module target -target_module target -target_offset 0x1cf3 -fuzz_iterations 5000 -nargs 2 -- target.exe @@
I result in an error:
[-] PROGRAM ABORT : Test case 'id_000000' results in a timeout
Location : perform_dry_run(), C:\Users\stepanova.anna\dev\projects\winafl\afl-fuzz.c:3254
As I understand, it usually happens when debug mode is working uncorrectly but it is not the case this time. Don't you know what the problem can be? Maybe I have missed some crucial points?
Full output:
WinAFL 1.17 by <ifratric@google.com>
Based on AFL 2.43b by <lcamtuf@google.com>
[+] You have 16 CPU cores with average utilization of 0%.
[+] Try parallel jobs - see afl_docs\parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[+] Process affinity is set to 1.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning '.\input'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Attempting dry run with 'id_000000'...
[-] The program took more than 20000 ms to process one of the initial test cases.
In WinAFL, this error could also mean incorrect instrumentation params.
Please make sure instrumentation runs correctly using the debug mode
(see the README) before attempting to run afl-fuzz.
[-] PROGRAM ABORT : Test case 'id_000000' results in a timeout
Location : perform_dry_run(), C:\Users\stepanova.anna\dev\projects\winafl\afl-fuzz.c:3254
The only thing I notice is that in afl-fuzz command line, you use target
instead of target.exe
.
One thing you might try is using TinyInst instead of DynamoRIO instrumentation. TinyInst mode makes it easier to diagnose some issues IMO, in the above case it will tell you a real reason why the run hanged. You need to compile with -DTINYINST=1
, the usage is similar to DR but some flags are slightly different / have different names. See https://github.com/googleprojectzero/winafl/blob/master/readme_tinyinst.md for usage examples.
Greetings,
Ran into a problem and unfortunately have no idea what the mistake i make. Any help to resolve this issue would be greatly appreciated. I am attaching afl.target.exe.22576.0000.proc.log Source code of test.cpp can be found at the very end of the issue.
If needed, I will provide any more information.
Description
Output
None
Expected output - 10 times (due to fuzz_iterations option = 10) text below:
Log file output afl.target.exe.22576.0000.proc
Handlers are called 10 times but no console output and an empty coverage map
To be mentioned
1. Target is running correctly without instrumentation. Command:
target .\input\1
Output:2. Target seems to be running correctly with command
C:\Users\stepanova.anna\dev\projects\winafl\DynamoRIO-Windows-10.0.0\bin64\drrun.exe -debug -- target .\input\1
See expected output but have no idea what threads are mentioned at the end. Output:test.cpp