Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crack Concolic cannot Dump Valid Constraint #6

Open
chinggg opened this issue Nov 28, 2023 · 1 comment
Open

Crack Concolic cannot Dump Valid Constraint #6

chinggg opened this issue Nov 28, 2023 · 1 comment

Comments

@chinggg
Copy link

chinggg commented Nov 28, 2023

I am trying to understand how CoFuzz's concolic execution works by running the readelf target.

https://github.com/Tricker-z/CoFuzz/blob/main/src/fuzz/executor.py#L130-L154 The main loop in HybridExecutor.run() keeps calling __crack_seed, but I found this function did not work at all because constraint_info = self.concolic.crack(seed_input, crack_addr) doesn't contain valid patterns for dump_constraint to parse constraint. So constraint_dict is always empty and no seeds are generated by 'crack'.
https://github.com/Tricker-z/CoFuzz/blob/main/src/fuzz/executor.py#L101-L102

I followed the setup in run_target.md, here is the script I used to build the readelf target:

# start in top folder
cd binutils-2.37
export LLVM_CC_NAME=clang-10 LLVM_CXX_NAME=clang++-10
CC=wllvm LLVM_COMPILER=clang ./configure --disable-shared
LLVM_COMPILER=clang make -j$(nproc)

cd binutils
extract-bc readelf
cp readelf.bc ../../

# back in top folder
cd ../..
# The random seed can be set with $AFL_RAND_SEED
BB_IDENT_FILE=/tmp/bb_ident_file Trace_CC=clang-10 Trace_CXX=clang++-10 trace/build/clang-trace readelf.bc -o readelf_trace
AFL_CC=clang-10 AFL_CXX=clang++-10 fuzzer/afl-clang-fast readelf.bc -o readelf_afl
third_party/concolic/qsym/symcc readelf.bc -o readelf_cofuzz

mkdir test
cp readelf* test/

Create readelf.cfg under test/:

[put]
# Program under test
cohuzz_bin=readelf_cofuzz
trace_bin=readelf_trace
argument=-a @@

Run the two commands concurrently under test/ to execute afl and cofuzz:

../fuzzer/afl-fuzz -m none -i fuzz_in/ -o fuzz_out/ -S afl -- ./readelf_afl -a @@
python3 ../src/cofuzz.py -c ./readelf.cfg -o fuzz_out/ -a afl
Repository owner deleted a comment from jidalii Feb 26, 2024
@amie0
Copy link

amie0 commented Jan 13, 2025

I found the same problem, eventually cofuzz generated code from conolic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants