Vulnerable Web Server written in C++
Standard Build (Vulnerable) This builds the server with security features disabled (ASLR/PIE disabled where possible) to facilitate exploit testing.
mkdir build && cd buildcmake -DENABLE_ASLR=OFF ..make./damn_vulnerable_web_server ../serve/ 8081
Secure Build (ASLR Enabled) This builds the server with ASLR and Stack Protectors enabled.
mkdir build && cd buildcmake -DENABLE_ASLR=ON ..make./damn_vulnerable_web_server ../serve/ 8081
Testing ASLR
You can verify the ASLR status of the build using the provided test script:
python3 ../tests/test_aslr.py
- Buffer Overflow
- Path Traversal
- Uncontrolled format string
- Command Injection
- Session Fixation
- Insecure Temporary File Creation Race Condition
- Use-After-Free (Heap)
- Heap Buffer Overflow
- Integer Overflow
- Type Confusion
Read solutions.md
To find vulnerabilities automatically using AFL++, we have provided a Docker setup.
-
Build the Docker image:
docker build -t vuln-server-fuzz . -
Run the fuzzer:
docker run --rm -v $(pwd)/fuzz_output:/src/fuzz/out vuln-server-fuzz
This will compile the server with ASan (Address Sanitizer) and run AFL++ in a container. The server has been modified to support a --fuzz flag which reads requests from stdin, making it compatible with AFL's standard mode.
Crashes will be saved in fuzz/out/default/crashes/.