__AFL_LOOP inside a .so lib && persistent mode autodetect

121 views
Skip to first unread message

Nikolay Shaplov

unread,
Oct 11, 2020, 1:20:00 PM10/11/20
to afl-users
When I tried to fuzz a simple example program, with __AFL_LOOP inside
it printed
[+] Persistent mode binary detected.
and body of __AFL_LOOP actually executed several times in a loop

Then I switched to a real project, and I get no Persistent mode binary
detected, and the body of the loop is executed only once.

The difference is that in real project is a part of module (extension) that is
loaded at runtime as .so lib.

Is there any way to make afl detect that persistent mode, or force it to use
it.

Or what is the right way?


--
Software Developer: https://www.upwork.com/freelancers/~014a87e140ff02c0da
Body-oriented Therapist: https://vk.com/nataraj_rebalancing (Russian)


Jakub Wilk

unread,
Oct 12, 2020, 3:17:51 AM10/12/20
to afl-...@googlegroups.com
* Nikolay Shaplov <dh...@nataraj.su>, 2020-10-11, 20:19:
>When I tried to fuzz a simple example program, with __AFL_LOOP inside
>it printed
>[+] Persistent mode binary detected.
>and body of __AFL_LOOP actually executed several times in a loop
>
>Then I switched to a real project, and I get no Persistent mode binary
>detected, and the body of the loop is executed only once.
>
>The difference is that in real project is a part of module (extension)
>that is loaded at runtime as .so lib.

By default, afl-fuzz enables persistent mode only if the binary contains
the "##SIG_AFL_PERSISTENT##" string (which is added by the __AFL_LOOP
macro). If you used __AFL_LOOP in a shared library, afl-loop won't
detect it.

>Is there any way to make afl detect that persistent mode, or force it
>to use it.

You can use the __AFL_PERSISTENT environment variable to force
persistent mode.

--
Jakub Wilk

Nikolay Shaplov

unread,
Oct 12, 2020, 12:29:07 PM10/12/20
to afl-...@googlegroups.com, Jakub Wilk
В письме от понедельник, 12 октября 2020 г. 10:17:44 MSK пользователь Jakub
Wilk написал:

> >Is there any way to make afl detect that persistent mode, or force it
> >to use it.
>
> You can use the __AFL_PERSISTENT environment variable to force
> persistent mode.
Thanks, that helped!
Reply all
Reply to author
Forward
0 new messages