VULNTRACE

VULNTRACE is a custom-built dynamic analysis framework that maps program execution flows to identify memory corruption vulnerabilities, logical flaws, and insecure code paths. It integrates with Frida for runtime instrumentation and supports both Windows PE files and Linux ELF binaries.

Python Frida C Active Development

Core Features

Feature Description
API Call Tracing Hooks all Win32/POSIX API calls and logs arguments, return values, and call stacks.
Memory Leak Detection Tracks all malloc/HeapAlloc calls and flags unfreed allocations at process exit.
Taint Analysis Propagates a β€œtaint” mark from user-controlled input and reports when tainted data reaches sensitive sinks (e.g., strcpy, system, exec).
Coverage Mapping Records code coverage per module, generating a heatmap of executed vs. unexecuted basic blocks.
Report Generation Outputs findings in JSON and HTML formats with source file correlation where symbols are available.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         VULNTRACE Core          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Frida    β”‚  β”‚  Analysis  β”‚  β”‚
β”‚  β”‚  Agent    β”‚  β”‚  Engine    β”‚  β”‚
β”‚  β”‚ (JS/C)    β”‚  β”‚ (Python)   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚        β”‚              β”‚         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚       Event Bus (IPC)     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                β”‚                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚      Report Generator     β”‚  β”‚
β”‚  β”‚    (JSON / HTML Output)   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Usage

Basic Analysis

# Trace all API calls for a Windows executable
python vulntrace.py --target ./target.exe --mode trace --output report.json

# Enable taint analysis from CLI arguments
python vulntrace.py --target ./parser --mode taint --source argv --output report.html

# Detect memory leaks
python vulntrace.py --target ./service.exe --mode leaks --timeout 30

Configuration File (vulntrace.yaml)

target: "./vulnerable_app.exe"
mode: full    # trace | taint | leaks | coverage | full
output:
  format: html
  path: "./reports/"
hooks:
  - "VirtualAlloc"
  - "CreateFile"
  - "WriteFile"
taint_sources:
  - type: "argument"
    index: 1
taint_sinks:
  - "strcpy"
  - "sprintf"
  - "system"

Example Output

{
  "target": "vulnerable_app.exe",
  "analysis_mode": "taint",
  "findings": [
    {
      "severity": "CRITICAL",
      "type": "Stack Buffer Overflow",
      "sink": "strcpy",
      "taint_source": "argv[1]",
      "stack_trace": [
        "0x004011a3 vulnerable_app!process_input",
        "0x004010de vulnerable_app!main"
      ],
      "recommendation": "Replace strcpy with strncpy and validate input length."
    }
  ]
}

GitHub Repository

πŸ”— github.com/vulnquest58/vulntrace

Note: Public release pending final security review and documentation pass.