r/ExploitDev • • 6d ago

Why would you use a concrete execution fuzzer

Just to preface this, im a noob so be kind plz.

So I was doing some research on different types of fuzzers and I found out what concrete and symbolic execution were.
But my question is, why would anyone choose to use a purely concrete execution based fuzzer if it generates inputs that don’t take branching conditions into consideration?
Like what if it runs into something like: if (x == 4873) {do something}. Then what? It just guesses until it gets it right? Meanwhile, something like symbolic or Concolic execution would just see which value needs to be mapped to x and then it do it.

Also aren’t popular fuzzers like AFL++ concrete based? Why would people use them if what I’m saying is true?

Anyways, if you made it this far then thanks for reading, and I hope you have some sort of answer to these questions.🧌

10 Upvotes

10 comments sorted by

3

u/randomatic 5d ago

Actual expert here. Multiple published studies show that combining pure symbolic + concolic leads to best results when your fuzzing campaign is a few days. There isn't any research that shows for longer, but I would expect the same to hold.

Why?

Symbolic execution picks a path, raises assembly to an IL, bitblasts to a SAT formula, and then uses a solver like Z3 to determine if it's a feasible path. There is a lot of overhead and bookkeeping doing this, which is the real time sync. The solver itself, interestingly enough, often isn't, even though obviously SAT is NP-complete. Overall, you are usually looking <1 exec/sec.

As you said, you can ensure you're always considering a fresh branch (which doesn't mean it's solvable/reachable --just that you are testing it). Concolic execution is not really a hybrid -- it's just using a concrete trace to pick the specific path. As mentioned above, path selection is a huge lever where you can use different algorithms. Concolic is relatively easy to implement, and helps eliminate some otherwise symbolic constraints.

Fuzzing OTOH just runs the program as quickly as it can, often using quick heuristics as a feedback cycle to inject new inputs. While it's not goal directed, the sheer speed means you're getting 100's to 1000's exec/sec (or faster). In your actual example, a modern fuzzer would probably work. They have a heuristic where on CMP instructions (your if statement), the compared constant itself is added to the feedback look.

Probably the hardest example is something like:

```

while(input[i] != 0){

if(input[i] == 'c') counter++

}

if(counter == 12345) bug();

```

This is hard because to reach the bug, you need to first understand how many times to iterate the loop. Many people have studied this problem, and come up with lots of heuristics that seem to improve on symexec. For fuzzing, you're probably looking at luck.

Why does the hybrid work? Generally regular fuzzing gets stuck by not considering a branch. Symbolic execution can unlock that area of code, and then fuzzing hammers it for simpler constraints until it gets stuck again.

1

u/sklumpu 5d ago

Are there any hybrid fuzzers that you would recommend?

1

u/randomatic 5d ago

Everything OSS is research grade. Driller (https://www.ndss-symposium.org/wp-content/uploads/2017/09/driller-augmenting-fuzzing-through-selective-symbolic-execution.pdf) uses angr (https://github.com/angr/angr), and you can pair that with afl/libfuzzer. I'd guess, but have not checked, that their AIxCC source code likely has it.

There are also commercial solutions; you can PM if interested and you have corporate budget.

You may ask why this is the case. Writing a fuzzer is fairly simple. Writing a symbolic executor is like building the saturn 5 rocket: any part that is off just a little bit will make things go wildly off course when used over millions of instructions in a typical execution.

7

u/gimme_super_head 6d ago

Twin at this point the best fuzzer is the one the AI writes for you.

2

u/[deleted] 6d ago

Unfort but true. In the past I'd have made a harness with Frida and used RPC and Python to generate inputs. Not much of a point writing all that shit out anymore.

2

u/Ok_Tap7102 5d ago

Concrete exploration like fuzzing is really brute force in that you JUST RUN the damn target with different inputs until it does something interesting. As you're actually running the code, it's not uncommon to reach 10,000s of executions per second, which if you let run for days on end will solve your 4873 example easy peasy .

Where you have massive comparisons for branching like comparing two 128 bit numbers (which would take 1000s of years to solve) then CompCov breaks down the comparison into byte by byte coverage steps, so you can "partially solve" a big complex gate bit by bit, as opposed to getting that one exceedingly rare lucky guess

https://andreafioraldi.github.io/articles/2019/07/20/aflpp-qemu-compcov.html

Symbolic execution on the other hand only works on relatively simple binaries, you basically have to emulate the entire operating system when you encounter a syscall which is much more straightforward in Linux bins but approaches impossible in Windows.

Path explosion is also a very real thing, simplest example: say the program runs your input through a hashing function and compares the first byte of the output to the byte literal 0xAA. This might take a while for a concrete execution as the CPU needs to hash every iteration, but still possible... The same thing is practically impossible for a symbolic executor, as to do so as then you would have to symbolically evaluate the whole hashing function which would probably take years, assuming you had unlimited RAM

-4

u/Impossible-Line1070 6d ago

Just use mythos

0

u/[deleted] 6d ago

[deleted] — view deleted comment

1

u/sklumpu 6d ago

Do you have any experience with hybrid/concolic fuzzers that use both approaches?

2

u/Ok_Tap7102 5d ago

Angr has driller

I believe it's job is that you fuzz as much as you can but where you reach a condition that you can't branch, you give your inputs and the trace leading up to that point and then angr tries to symbolically solve past it

Just noting that it's paper and code are likely 10 years old so it doesn't get a lot of active research and development

https://grimmcyber.com/guided-fuzzing-with-driller/