Interactive educational platform for comparing safe vs malicious execution of vulnerable C programs.
The app runs each program twice under a debugger, then visualizes:
- instruction-by-instruction divergence
- register and stack changes
- stdout differences
- risk findings (issue type + severity)
- Upload C source or precompiled binary and run safe/malicious inputs side by side
- Step-level timeline with first-divergence marker
- Register and stack diff highlighting
- Program output comparison (
stdout) - Risk analysis panel with findings such as:
- information leak (format-string behavior)
- stack/control-flow corruption (overflow behavior)
- stack corruption signal (subtle memory corruption)
- Issue summary panel that shows:
- detected issue type(s)
- highest severity
- backend runtime error details (if any)
Located in demo/:
vulnerable.c- stack overflow via unsafestrcpyheap_vulnerable.c- heap overflow intomallocbuffer (heap_buf), works with the heap trace windowformat_string.c- format-string vulnerability viaprintf(user_input)integer_issue.c- signed/unsigned integer conversion bug causing unsafe copy size
- Backend: Flask, Python 3.10+
- Frontend: React (Create React App), Node 16+
- Tracing:
- Linux: GDB Python API
- macOS: LLDB Python API
| Tool | Minimum | Purpose |
|---|---|---|
| Python | 3.10+ | Backend runtime |
| Node.js | 16+ | Frontend runtime |
| GCC / Clang | modern | Compile uploaded C files |
| GDB (Linux) | 7.x+ w/ Python | Trace collection on Linux |
| LLDB (macOS) | Xcode CLT | Trace collection on macOS |
Install common dependencies (Debian/Ubuntu):
sudo apt update && sudo apt install -y gcc gdb python3 python3-pip nodejs npmmacOS (for LLDB + compiler tools):
xcode-select --installcd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.pyBackend runs at http://localhost:5001.
cd frontend
npm install
npm startFrontend runs at http://localhost:3000 and proxies /api to backend.
- Upload one demo file (
vulnerable.c,heap_vulnerable.c,format_string.c, orinteger_issue.c) - Enter:
- a safe input
- a malicious input
- Click Run Both Executions
- Inspect:
- Risk Findings (high-level security signal)
- Issue Summary (issue type, severity, and errors)
- Timeline and Diff panels for technical evidence
- Safe:
Alice - Malicious: 100-220
Acharacters
- Safe:
Alice - Malicious: 100–220
Acharacters (overflows the 64-bytemallocbuffer)
- Safe:
Hello - Malicious:
%p.%p.%p.%p.%p.%p.%p.%p
- Safe:
8 - Malicious:
-1
Upload .c source or binary.
Body:
{
"program_id": "a1b2c3d4",
"safe_input": "Alice",
"malicious_input": "AAAA..."
}Returns full trace with steps and captured stdout.
Returns step diff + summary fields:
first_divergence_stepstdout_diffrisk_findings
4277_Final_Project/
├── backend/
│ ├── app.py
│ ├── routes/
│ ├── services/
│ ├── tests/
│ ├── uploads/
│ └── traces/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ └── services/
│ └── package.json
└── demo/
├── vulnerable.c
├── heap_vulnerable.c
├── format_string.c
└── integer_issue.c
- Step alignment is by instruction index, not semantic control-flow matching
- Long-running binaries are capped (
MAX_STEPS) - Platform-specific debugger behavior can differ across Linux/macOS
- Runs execute user-provided binaries: use only in trusted local environments
This project is intended for local, educational security demonstrations.