AFL++
💎Vulnerabiltiies to be discovered
The next vulnerabilities should be discovered in this sections:
VULN-RECOVERY-OOB
⚙️AFL++ setup
If you didn't set up the
Use
dynamic-analysis profile's infrastructure, please do so by running the command docker-compose --profile dynamic-analysis up.Use
docker exec --interactive --tty aflplusplus bash to enter the container where the CLI application is contained.📚AFL++ documentation
The AFL++ documentation is available here.
Steps
Changing the input stream of the C library
- At the moment, the files from
sandcastle/c_modulesare used to compile a shared object usingMakefile. To increase the speed of the future fuzzing process, copy the folder with C sources in/root/analysis/afl++/c_modulesand modifytest.cto read the parameters for thegenerate_recovery_tokencall fromstdinor a file. You should establish a convention for how the parameters are sent. For example, a 4-byte integer can be the first, followed by the bytes representing the string. - Use
afl-ccto compile the source code you adapted. You can also leverage the already existingMakefile. The resulting executable file should be stored in/root/analysis/afl++/c_modules/test. Also make the required modifications to use Address Sanitizer and debugger symbols. - Create the directories
/root/analysis/afl++/c_modules/inputsand/root/analysis/afl++/c_modules/output. - Using the convention that you established, create the file
/root/analysis/afl++/c_modules/inputs/examplethat contains a valid input for the program you compiled. - Ensure the environment respects the expected state and that the program runs correctly by using
cat /analysis/afl++/c_modules/inputs/example | /analysis/afl++/c_modules/test.
🚧Solution
To display the solution of this task, enter the text i-surrender-to-the-code-security-gods in the field below.
Fuzzing the program
- Create an
afl-fuzzcommand that takes the demo inputs from/root/analysis/afl++/c_modules/inputsand writes the analysis to/root/analysis/afl++/c_modules/output. Let the program fuzz for a minute.
🚧Solution
To display the solution of this task, enter the text i-surrender-to-the-code-security-gods in the field below.
Validating the crashes
- For each crash, find the generated example input in
/root/analysis/afl++/c_modules/outputsand run to validate the crash. - Use
gdbto run the program with the generated example input and see where the program is crashing.
🚧Solution
To display the solution of this task, enter the text i-surrender-to-the-code-security-gods in the field below.