How invicti-security/brainstorm works
Project type and purpose
• This is a command-line web-fuzzing tool (“brainstorm”) that orchestrates iterative discovery of hidden endpoints by combining:
• A local LLM (via Ollama) for intelligent path suggestion
• A traditional fuzzing engine (ffuf CLI) for probing those paths
• It also includes a benchmarking component to compare model performance.
Main components of the system
• CLI Entry Points (Python scripts)
• fuzzer.py – general path discovery
• fuzzer_shortname.py – 8.3-style short filenames
• benchmark.py – runs benchmarks and produces reports
• Prompt Loader
• Reads static files under prompts/ (files.txt, shortname.txt)
• AI Client Module
• Connects to the local Ollama REST API (default localhost:11434)
• Sends prompt + context and receives suggested paths
• Fuzzing Engine Wrapper
• Spawns ffuf subprocess calls with generated wordlists and URL templates
• Parses ffuf output (stdout or JSON) for “successful” HTTP codes
• Result Aggregator & Persistence
• Writes discovered links to all_links.txt and filenames to all_filenames.txt
• Updates in-memory state for next AI prompt
• Benchmarking & Reporting
• Runs multiple model+cycle configurations
• Aggregates stats and emits HTML/Markdown reports (benchmark_report.html, .md)
External Dependencies
• Ollama LLM service (local REST API)
• ffuf CLI tool in PATH
• Python runtime and third-party packages (requirements.txt)
Relationships and data flow
1. User invokes one of the Python scripts
2. Script reads initial prompts/files and loads any existing results
3. Loop (N cycles):
a. Send current discoveries + static prompt to Ollama → receive new path guesses
b. Call ffuf with these guesses → collect new successful endpoints
c. Merge new results into state and append to output files
4. End of loop → script exits (or benchmark module generates final report)
Important architectural patterns
• Pipeline/iteration with feedback loop between AI suggestions and traditional fuzzing
• Clear separation between “suggestion” (LLM) and “validation” (ffuf) stages
• Modular CLI scripts for different use cases
• File-based persistence for reproducibility and chaining