skills/AI/AI-Assisted-Fuzzing-and-Vulnerability-Discovery/SKILL.md
AI-assisted fuzzing and vulnerability discovery. Use this skill whenever the user wants to generate fuzzing seeds, evolve grammars, analyze crashes, create proof-of-vulnerability exploits, or generate patches for discovered bugs. Trigger on mentions of fuzzing, AFL++, libFuzzer, vulnerability discovery, crash analysis, exploit generation, or security testing with LLMs.
npx skillsauth add abelrguezr/hacktricks-skills ai-fuzzing-assistantInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps you leverage large language models to supercharge traditional vulnerability research pipelines. It covers seed generation, grammar evolution, crash analysis, exploit generation, and AI-guided patching.
Use this skill when you need to:
Traditional fuzzers mutate bytes blindly. LLMs can generate syntax-correct, security-relevant inputs that reach deeper code paths faster.
Use the seed generator script:
python scripts/gen_seeds.py --format <format> --count <N> --output <file>
Supported formats:
sql - SQL injection payloadsxss - Cross-site scripting payloadspath - Path traversal payloadsurl - URL manipulation payloadscustom - Custom format (provide prompt)Example:
python scripts/gen_seeds.py --format sql --count 200 --output seeds.txt
afl-fuzz -i seeds.txt -o findings/ -- ./target @@
Tips:
Let the LLM evolve a grammar based on coverage feedback instead of just generating seeds.
Workflow:
Use the grammar evolution script:
python scripts/evolve_grammar.py \
--grammar grammar.txt \
--coverage-report coverage.json \
--output grammar_v2.txt
Key parameters:
--max-epochs - Number of refinement iterations (default: 5)--coverage-threshold - Stop when Δcoverage < threshold (default: 0.01)--diff-mode - Use diff/patch instructions for efficient editsExample prompt for grammar refinement:
The previous grammar triggered 12% of program edges.
Functions not reached: parse_auth, handle_upload.
Add or modify rules to cover these areas.
After finding a crash, you need a deterministic proof-of-vulnerability.
Use the crash analyzer script:
python scripts/analyze_crashes.py \
--crash-db crashes/ \
--target ./binary \
--output povs/
What it does:
Output structure:
povs/
├── crash_001/
│ ├── input.bin # Minimal triggering input
│ ├── gdb-session.txt # Reproduction steps
│ └── analysis.md # Vulnerability explanation
└── failed_seeds.txt # Re-queued for fuzzing
Fine-tuned code models can suggest targeted mutation patterns for specific functions.
Generate mutation dictionaries:
python scripts/gen_seeds.py \
--format custom \
--prompt "Give mutation dictionary entries likely to break memory safety in sprintf wrapper" \
--output mutations.txt
Example output:
{"pattern": "%99999999s"}
{"pattern": "AAAAAAAA....<1024>....%n"}
Integrate with AFL++:
afl-fuzz -i seeds.txt -o findings/ \
-x mutations.txt \
-- ./target @@
Cluster crash signatures and generate unified patches that fix multiple bugs from a common root cause.
python scripts/analyze_crashes.py \
--crash-db crashes/ \
--mode super-patch \
--output patches/
Prompt template:
Here are N stack traces + file snippets.
Identify the shared mistake and generate a unified diff fixing all occurrences.
Interleave confirmed PoV-validated patches with speculative patches at a tunable ratio.
Configuration:
{
"confirmed_ratio": 1,
"speculative_ratio": 2,
"penalty_threshold": 0.3
}
graph TD
subgraph Discovery
A[LLM Seed/Grammar Gen] --> B[Fuzzer]
C[Fine-Tuned Model Dicts] --> B
end
B --> D[Crash DB]
D --> E[Agent PoV Gen]
E -->|valid PoV| PatchQueue
D -->|cluster| F[LLM Super-Patch]
PatchQueue --> G[Patch Submitter]
Recommended sequence:
gen_seeds.pyanalyze_crashes.py for PoV generation# Generate seeds
python scripts/gen_seeds.py --format sql --output seeds/
# Run with mutation dictionary
afl-fuzz -i seeds/ -o findings/ -x mutations.txt -- ./target @@
# Generate grammar
python scripts/evolve_grammar.py --grammar grammar.txt
# Compile with grammar
clang -fsanitize=fuzzer -o fuzzer fuzzer.cpp
./fuzzer grammar.txt
# Generate seeds
python scripts/gen_seeds.py --format custom --prompt "..." --output seeds/
# Run
hfuzz_run -i seeds/ -o findings/ -- ./target @@
Seeds not triggering new coverage:
Grammar not improving:
PoV generation failing:
Patches being rejected:
testing
How to perform a House of Lore (small bin attack) heap exploitation. Use this skill whenever the user mentions heap exploitation, small bin attacks, fake chunks, glibc heap vulnerabilities, or needs to insert fake chunks into small bins for arbitrary read/write. Trigger for CTF challenges involving heap corruption, glibc 2.31+ exploitation, or when the user needs to bypass malloc sanity checks using fake chunk linking.
testing
How to perform House of Force heap exploitation attacks. Use this skill whenever the user mentions heap exploitation, House of Force, top chunk manipulation, arbitrary memory allocation, malloc manipulation, or wants to allocate chunks at specific addresses. Also trigger for CTF challenges involving heap overflows, top chunk size overwrites, or when the user needs to calculate evil_size for heap attacks. Make sure to use this skill for any binary exploitation task involving glibc heap manipulation, even if they don't explicitly say "House of Force".
tools
How to perform House of Einherjar heap exploitation to allocate memory at arbitrary addresses. Use this skill whenever the user mentions heap exploitation, glibc heap attacks, arbitrary memory allocation, off-by-one overflow exploitation, tcache poisoning, fast bin attacks, or any CTF challenge involving heap manipulation. This is essential for binary exploitation tasks where you need to control malloc() return addresses.
testing
How to identify, analyze, and exploit heap overflow vulnerabilities in binary exploitation challenges and real-world scenarios. Use this skill whenever the user mentions heap overflows, memory corruption, heap grooming, tcache poisoning, fast-bin attacks, or any heap-related vulnerability in CTF challenges, binary analysis, or security research. This skill covers heap overflow fundamentals, exploitation techniques, heap grooming strategies, and real-world CVE analysis.