Dictionaries provide AFL++ with syntax tokens and keywords for your target format, dramatically improving fuzzing efficiency for structured inputs.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AFLplusplus/AFLplusplus/llms.txt
Use this file to discover all available pages before exploring further.
What Are Dictionaries?
Dictionaries are collections of interesting tokens, keywords, or byte sequences that are likely meaningful to your target. AFL++ uses these to:- Replace random bytes with known-good values
- Insert format-specific keywords
- Speed up discovery of paths requiring specific tokens
- Bypass simple parsing checks
Using Dictionaries
Pass a dictionary toafl-fuzz with the -x option:
Built-in Dictionaries
AFL++ includes dictionaries for common formats in thedictionaries/ directory:
xml.dict
XML tags and entities
json.dict
JSON syntax elements
png.dict
PNG chunk types and values
sql.dict
SQL keywords and operators
html.dict
HTML tags and attributes
jpeg.dict
JPEG markers and values
Dictionary Formats
AFL++ supports two dictionary formats:File Format (Recommended)
A text file with one token per line:- name: Optional alphanumeric identifier (for documentation)
- value: Token in quotes with hex escaping for special characters
Escape Sequences
Use these escape sequences in values:\xNN: Hex byte (e.g.,\x00for null byte)\\: Literal backslash\": Literal quote\r,\n,\t: Carriage return, newline, tab
Directory Format
Create a directory where each file contains one token:No escaping needed - raw file contents are used as tokens.
Dictionary Levels
Control which tokens are loaded based on complexity levels:- @0 (default): Always loaded
- @1: Loaded if level ≥ 1
- @2: Loaded if level ≥ 2
Creating Custom Dictionaries
Manual Creation
Identify important tokens
Analyze your target format for:
- Magic bytes and headers
- Keywords and commands
- Common delimiters
- Field separators
- Control characters
Auto-generated Dictionaries
AFL++ can automatically generate dictionaries:LTO Mode Auto-Dictionary
Withafl-clang-lto, dictionaries are automatically generated from compile-time comparisons:
This is automatic - just use afl-clang-lto and forget about dictionaries!
LLVM Mode Dictionary Generation
Withafl-clang-fast, generate a dictionary file during compilation:
Full path to dictionary file to create during compilation.
Skip parsing
main() function (often just command-line parsing).Runtime Token Capture
Uselibtokencap to capture tokens during execution:
Dictionary Best Practices
Token size matters
Token size matters
Keep tokens 2-16 bytes for best results:
Quality over quantity
Quality over quantity
Fewer, high-quality tokens > many low-value tokens:
Format-specific tokens
Format-specific tokens
Include tokens specific to your format:
Combine approaches
Combine approaches
Use multiple dictionary sources:
Probabilistic Dictionary Mode
For large dictionaries, AFL++ uses probabilistic mode to avoid slowdowns:Threshold for probabilistic mode. When dictionary + auto-dictionary entries exceed this, not all entries are used all the time.
With 201+ entries, there’s a 1/201 chance that one entry won’t be used directly in a given mutation.
Dictionary Recommendations by Format
XML/HTML
JSON
Binary Formats
Network Protocols
Disabling Auto-Dictionaries
If you want to use only your manual dictionary:Disable loading of LTO-generated auto-dictionaries compiled into the target.
Examples
Example 1: SQL Fuzzer
Example 2: Image Format
Example 3: Protocol Fuzzer
Related Topics
Custom Mutators
Implement structure-aware mutations
CMPLOG
Automatic comparison discovery
LAF-Intel
Split comparisons for easier solving
LTO Mode
Automatic dictionary generation

