Zum Inhalt springen
Skillpedia
Tests8.0k · #12717

fuzzing-dictionary

Was er macht

Dieser Skill erstellt eine Wörterbuch-Datei mit nützlichen Tokens, damit ein Fuzzer realistische Schlüsselwörter und Magic Values ausprobiert. Er richtet sich an Entwickler, die Parser, Protokolle und Dateiformat-Handler fuzzen.

Wann du ihn nutzt

  • ✓Wenn du einen Parser für JSON, XML oder eine eigene Konfigurationsdatei fuzzt.
  • ✓Wenn das Fuzzing an Eingabeprüfungen hängen bleibt, die gegen feste Wörter oder Bytes vergleichen.
  • ✓Wenn du für einen Fuzzer Schlüsselwörter aus Quellcode, Headern oder Spezifikationen gewinnen willst.

Link zum Skill

https://github.com/trailofbits/skills/blob/main/plugins/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/trailofbits/skills/blob/main/plugins/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich will aus unserem Quellcode des Konfigurations-Parsers ein Fuzzing-Wörterbuch erstellen, damit der Fuzzer die gültigen Schlüsselwörter kennt.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent sammelt Wörter und Byte-Folgen, nach denen das Ziel sucht, etwa Schlüsselwörter und Magic Numbers, und schreibt sie im Standardformat für Wörterbücher. Der Fuzzer mischt diese Tokens dann in seine Eingaben.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Fuzzing Dictionary

A fuzzing dictionary provides domain-specific tokens to guide the fuzzer toward interesting inputs. Instead of purely random mutations, the fuzzer incorporates known keywords, magic numbers, protocol commands, and format-specific strings that are more likely to reach deeper code paths in parsers, protocol handlers, and file format processors.

Overview

Dictionaries are text files containing quoted strings that represent meaningful tokens for your target. They help fuzzers bypass early validation checks and explore code paths that would be difficult to reach through blind mutation alone.

Key Concepts

Concept Description
Dictionary Entry A quoted string (e.g., "keyword") or key-value pair (e.g., kw="value")
Hex Escapes Byte sequences like "\xF7\xF8" for non-printable characters
Token Injection Fuzzer inserts dictionary entries into generated inputs
Cross-Fuzzer Format Dictionary files work with libFuzzer, AFL++, and cargo-fuzz

When to Apply

Apply this technique when:

  • Fuzzing parsers (JSON, XML, config files)
  • Fuzzing protocol implementations (HTTP, DNS, custom protocols)
  • Fuzzing file format handlers (PNG, PDF, media codecs)
  • Coverage plateaus early without reaching deeper logic
  • Target code checks for specific keywords or magic values

Skip this technique when:

  • Fuzzing pure algorithms without format expectations
  • Target has no keyword-based parsing
  • Corpus already achieves high coverage

Quick Reference

Task Command/Pattern
Use with libFuzzer ./fuzz -dict=./dictionary.dict ...
Use with AFL++ afl-fuzz -x ./dictionary.dict ...
Use with cargo-fuzz cargo fuzz run fuzz_target -- -dict=./dictionary.dict
Extract from header grep -o '".*"' header.h > header.dict
Generate from binary strings ./binary | sed 's/^/"&/; s/$/&"/' > strings.dict

Step-by-Step

Step 1: Create Dictionary File

Create a text file with quoted strings on each line. Use comments (#) for documentation.

Example dictionary format:

# Lines starting with '#' and empty lines are ignored.

# Adds "blah" (w/o quotes) to the dictionary.
kw1="blah"
# Use \\ for backslash and \" for quotes.
kw2="\"ac\\dc\""
# Use \xAB for hex values
kw3="\xF7\xF8"
# the name of the keyword followed by '=' may be omitted:
"foo\x0Abar"

Step 2: Generate Dictionary Content

Choose a generation method based on what's available:

From LLM: Prompt ChatGPT or Claude with:

A dictionary can be used to guide the fuzzer. Write me a dictionary file for fuzzing a <PNG parser>. Each line should be a quoted string or key-value pair like kw="value". Include magic bytes, chunk types, and common header values. Use hex escapes like "\xF7\xF8" for binary values.

From header files:

grep -o '".*"' header.h > header.dict

From man pages (for CLI tools):

man curl | grep -oP '^\s*(--|-)\K\S+' | sed 's/[,.]$//' | sed 's/^/"&/; s/$/&"/' | sort -u > man.dict

From binary strings:

strings ./binary | sed 's/^/"&/; s/$/&"/' > strings.dict

Step 3: Pass Dictionary to Fuzzer

Use the appropriate flag for your fuzzer (see Quick Reference above).

Common Patterns

Pattern: Protocol Keywords

Use Case: Fuzzing HTTP or custom protocol handlers

Dictionary content:

# HTTP methods
"GET"
"POST"
"PUT"
"DELETE"
"HEAD"

# Headers
"Content-Type"
"Authorization"
"Host"

# Protocol markers
"HTTP/1.1"
"HTTP/2.0"

Pattern: Magic Bytes and File Format Headers

Use Case: Fuzzing image parsers, media decoders, archive handlers

Dictionary content:

# PNG magic bytes and chunks
png_magic="\x89PNG\r\n\x1a\n"
ihdr="IHDR"
plte="PLTE"
idat="IDAT"
iend="IEND"

# JPEG markers
jpeg_soi="\xFF\xD8"
jpeg_eoi="\xFF\xD9"

Pattern: Configuration File Keywords

Use Case: Fuzzing config file parsers (YAML, TOML, INI)

Dictionary content:

# Common config keywords
"true"
"false"
"null"
"version"
"enabled"
"disabled"

# Section headers
"[general]"
"[network]"
"[security]"

Advanced Usage

Tips and Tricks

Tip Why It Helps
Combine multiple generation methods LLM-generated keywords + strings from binary covers broad surface
Include boundary values "0", "-1", "2147483647" trigger edge cases
Add format delimiters :, `=
Häufige Fragen

Welche Fuzzer können das Wörterbuch nutzen?

Laut Skill funktionieren Wörterbuch-Dateien mit libFuzzer, AFL++ und cargo-fuzz.

Woher kommen die Tokens?

Sie können aus Quellcode, Header-Dateien, Binärdateien und Spezifikationen des Formats stammen.

Brauche ich eine besondere Syntax?

Die Datei nutzt Zeichenketten in Anführungszeichen. Der Skill erklärt, wie man Hex-Escapes für Bytes schreibt, die man nicht eintippen kann.

Details

Originalbeschreibung des Autors

Builds and applies fuzzing dictionaries so a fuzzer can produce the keywords, magic bytes, and tokens a target expects. Covers extracting tokens from source, headers, binaries, and specifications, dictionary syntax, and wiring one into libFuzzer or AFL++. Use when fuzzing a parser, protocol, or file format, when coverage stalls at input validation, or when a target compares against fixed strings.

repo: trailofbits/skills

Beliebtheit

GitHub-Sterne
8.0k
Platz im Ranking
#12717
Lizenz
CC-BY-SA-4.0
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills