я пытался использовать американский Fuzzy Lop, но я не могу заставить его работать на простом примере, как это:American Fuzzy Lop не удается с помощью простого примера
#include <stdio.h>
#include <string.h>
int main(int argc, char * argv[]){
char name[10];
if (argc > 1){
strcpy(name, argv[1]);
printf("HELLO %s\n", name);
}
return 0;
}
компилировать одну версию этого кода используя обычный gcc и другой, используя afl-clang. ССАГПЗ версия затем помещается в папку ввода, и я назвать fuzzer так:
afl-fuzz -i input/ -o output/ -m 2G ./a.out @@
Но это не работает.
[*] Attempting dry run with 'id:000000,orig:a.out'...
[*] Spinning up the fork server...
[-] Whoops, the target binary crashed suddenly, before receiving any input
from the fuzzer! There are several probable explanations:
- The current memory limit (2.00 GB) is too restrictive, causing the
target to hit an OOM condition in the dynamic linker. Try bumping up
the limit with the -m setting in the command line. A simple way confirm
this diagnosis would be:
(ulimit -Sv $[2047 << 10]; /path/to/fuzzed_app)
Tip: you can use http://jwilk.net/software/recidivm to quickly
estimate the required amount of virtual memory for the binary.
- The binary is just buggy and explodes entirely on its own. If so, you
need to fix the underlying problem or find a better replacement.
- Less likely, there is a horrible bug in the fuzzer. If other options
fail, poke <[email protected]> for troubleshooting tips.
[-] PROGRAM ABORT : Fork server crashed with signal 6
Location : init_forkserver(), afl-fuzz.c:2056
Что я делаю неправильно?
Я не совсем понимаю, какие параметры фактически переданы программе. – Downvoter
AFL должен иметь пример канонического кода, который вы можете попробовать. – user3386109
'char name [10];' слишком коротко, чтобы удерживать фактический переданный параметр. Используйте ['strncpy (.., .., 10)'] (http://linux.die.net/man/3/strncpy) вместо 'strcpy' – Soren