afl-clang error

1,530 views
Skip to first unread message

Najeeb Choudhary

unread,
Oct 2, 2016, 8:23:24 AM10/2/16
to afl-users

hey all 

i am use first time afl-clang or afl-fuzz... i have counter issue when i am compile
test.c

 
#include <stdio.h>
int main(int argc, char** argv) {

    /* Reset state. */
    memset(buf, 0, 100);

    /* Read input data. */

    read(0, buf, 100);

    /* Parse it in some vulnerable way. You'd normally call a library here. */
    if (buf[0] != 'p') puts("error 1"); else
    if (buf[1] != 'w') puts("error 2"); else
    if (buf[2] != 'n') puts("error 3"); else
      abort();


}



program they give i error this


plz sortout what i am doing wrong. and plz give some example for compile with afl-clang or alf-gcc.. i am use ubuntu 16.04

Florian Weimer

unread,
Oct 2, 2016, 8:41:05 AM10/2/16
to Najeeb Choudhary, afl-users
* Najeeb Choudhary:

> program they give i error this
>
> <https://lh3.googleusercontent.com/-7cg8lTWHGkU/V_D8ERqqwBI/AAAAAAAAAcQ/LL22KDW_8Rk46LIx6etqLV68LmePV-VbgCLcB/s1600/afl4.png>

Text is: “Oops, failed to execute 'clang' - check your PATH”

It seems that clang is not actually installed.

What happens if you enter “clang” in the terminal? (Please post any
error messages as text, thank you.)

Najeeb Choudhary

unread,
Oct 2, 2016, 12:44:50 PM10/2/16
to afl-users, mohd.najee...@gmail.com, f...@deneb.enyo.de
thanks Florian Weimer 
i war not install clang...that's why error show me now it work good.... 

Najeeb Choudhary

unread,
Oct 2, 2016, 1:36:52 PM10/2/16
to afl-users, mohd.najee...@gmail.com, f...@deneb.enyo.de
may i ask one more think.....

i have incounter one more issue when i am test program with gcc afl-fuzz work perfect but
when i compiled with afl-gcc i was see this error am also try this 
$ LIMIT_MB=50
$ ( ulimit -Sv $[LIMIT_MB << 10]; /path/to/tested_binary ... )

Florian Weimer

unread,
Oct 2, 2016, 1:38:47 PM10/2/16
to Najeeb Choudhary, afl-users
* Najeeb Choudhary:

> *may i ask one more think.....*
>
> *i have incounter one more issue when i am test program with gcc afl-fuzz
> work perfect but*
> *when i compiled with afl-gcc i was see this error am also try this *
> *$ LIMIT_MB=50*
> *$ ( ulimit -Sv $[LIMIT_MB << 10]; /path/to/tested_binary ... )*
>
> <https://lh3.googleusercontent.com/-Vn8g3gD2ljQ/V_FFXrEYPmI/AAAAAAAAAck/B9wxZqUh1FAa0dvRCvzzDs0vC-ztyGF4wCLcB/s1600/afl5.png>

Please post the error messages as text.

Najeeb Choudhary

unread,
Oct 2, 2016, 5:04:21 PM10/2/16
to afl-users, mohd.najee...@gmail.com, f...@deneb.enyo.de
this is error when i compile with afl-clang and fuzz with afl-fuzzer (note: this error not show when code compile with gcc)
najeeb@najeeb:~/Music/ctf/roptuts/test$ ls
in  input  out  test  test.c
najeeb@najeeb:~/Music/ctf/roptuts/test$ afl-fuzz -n -i in/ -o out/ -- ./test 
afl-fuzz 2.35b by <lca...@google.com>
[+] You have 2 CPU cores and 1 runnable tasks (utilization: 50%).
[+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[*] Checking core_pattern...
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'in/'...

[-] PROGRAM ABORT : Test case 'in//test' is too big (1.40 MB, limit is 1.00 MB)
         Location : read_testcases(), afl-fuzz.c:1466

najeeb@najeeb:~/Music/ctf/roptuts/test$ 

Florian Weimer

unread,
Oct 2, 2016, 5:06:52 PM10/2/16
to Najeeb Choudhary, afl-users
* Najeeb Choudhary:

> this is error when i compile with afl-clang and fuzz with afl-fuzzer (note:
> this error not show when code compile with gcc)
> najeeb@najeeb:~/Music/ctf/roptuts/test$ ls
> in input out test test.c
> najeeb@najeeb:~/Music/ctf/roptuts/test$ afl-fuzz -n -i in/ -o out/ --
> ./test
> afl-fuzz 2.35b by <lca...@google.com>
> [+] You have 2 CPU cores and 1 runnable tasks (utilization: 50%).
> [+] Try parallel jobs - see /usr/local/share/doc/afl/parallel_fuzzing.txt.
> [*] Checking CPU core loadout...
> [+] Found a free CPU core, binding to #0.
> [*] Checking core_pattern...
> [*] Setting up output directories...
> [+] Output directory exists but deemed OK to reuse.
> [*] Deleting old session data...
> [+] Output dir cleanup successful.
> [*] Scanning 'in/'...
>
> [-] PROGRAM ABORT : Test case 'in//test' is too big (1.40 MB, limit is 1.00
> MB)
> Location : read_testcases(), afl-fuzz.c:1466
>
> najeeb@najeeb:~/Music/ctf/roptuts/test$

It seems you accidentally used your fuzz target “test” as a fuzz
input.

Najeeb Choudhary

unread,
Oct 2, 2016, 5:26:41 PM10/2/16
to afl-users, mohd.najee...@gmail.com, f...@deneb.enyo.de
sorry but i don't get.......may i know how i resolver is issue 

Florian Weimer

unread,
Oct 2, 2016, 5:27:39 PM10/2/16
to Najeeb Choudhary, afl-users
* Najeeb Choudhary:

> sorry but i don't get.......may i know how i resolver is issue

You copied your test program into the AFL input directory.

Najeeb Choudhary

unread,
Oct 3, 2016, 5:58:46 AM10/3/16
to afl-users, mohd.najee...@gmail.com, f...@deneb.enyo.de
thanks for helping me.... your really helpful

i war this "afl-fuzz -i in/ -o out/ ../lab @@" AND i don't that is use @@ is there
Reply all
Reply to author
Forward
0 new messages