AFL режим QEMU не работает с Dlopen () - PullRequest
0 голосов
/ 03 июля 2018

все. Я использую AFL с режимом QEMU. И я написал этот небольшой двоичный файл, чтобы проверить все.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>

int main(int argc, char **argv){
    typedef int (*pf_t)(char*);
    void* handle;
    char* error;
    char mystring[100];

    fgets(mystring,sizeof(mystring),stdin);
    printf("mystring: %s\n",mystring);

    handle = dlopen("libdiag.so",RTLD_NOW);
    if(!handle){
    fprintf(stderr,"%s\n",dlerror());
    exit(1);
    }


    dlclose(handle);

    return 0;

}

Все работает хорошо, если я не добавляю dlopen (). Но если я добавлю это, afl остановится здесь. Я использую команду "afl-fuzz -i in -o out -Q ./a.out"

afl-fuzz 2.49b by <lcamtuf@google.com>
[+] You have 8 CPU cores and 3 runnable tasks (utilization: 38%).
[+] Try parallel jobs - see docs/parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #1.
[*] Checking CPU scaling governor...
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'in'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[*] Attempting dry run with 'id:000000,orig:aahat.jpg'...
[*] Spinning up the fork server...
[+] All right - fork server is up.

Я не знаю почему. Все, что я знаю, это то, что кто-то сказал, что у режима afl qemu что-то не так с dlopen. Мне интересно, кто-то может дать мне несколько советов? Спасибо!

...