fuzzing-dictionary
하는 일
퍼저가 현실적인 키워드와 매직 값을 시도하도록 유용한 토큰이 담긴 사전 파일을 만듭니다. JSON, XML, 사용자 정의 설정 파일의 파서나 파일 형식 처리기를 퍼징하는 개발자를 위한 것입니다.
사용하는 경우
- ✓JSON, XML 또는 사용자 정의 설정 파일의 파서를 퍼징할 때.
- ✓퍼징이 고정된 단어나 바이트와 비교하는 입력 검사에서 멈출 때.
- ✓소스 코드, 헤더, 명세에서 키워드를 가져와 퍼저에 넣고 싶은 경우.
스킬 링크
https://github.com/trailofbits/skills/blob/main/plugins/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 설정 파서의 소스로 퍼징 사전을 만들어서, 퍼저가 유효한 키워드를 알 수 있게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 대상이 찾는 단어와 바이트 열(키워드와 매직 넘버처럼)을 모아 표준 사전 형식으로 씁니다. 그다음 퍼저가 이 토큰을 입력에 섞습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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 | :, `= |
자주 묻는 질문
어떤 퍼저가 사전을 쓸 수 있나요?
사전 파일은 libFuzzer, AFL++, cargo-fuzz와 함께 작동한다고 설명합니다.
토큰은 어디에서 오나요?
소스 코드, 헤더 파일, 바이너리, 형식 명세에서 가져올 수 있습니다.
특별한 문법이 필요한가요?
파일은 따옴표로 묶은 문자열을 쓰며, 입력할 수 없는 바이트는 16진수 이스케이프로 쓰는 방법을 스킬이 설명합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 8.0k
- 순위
- #12717
- 라이선스
- CC-BY-SA-4.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
audit-context-building
8.0k에이전트가 보안 검토 전에 낯선 코드베이스를 익히고, 각 함수가 가정하고 보장하며 의존하는 것을 정리하도록 돕습니다.
algorand-vulnerability-scanner
8.0k에이전트가 TEAL이나 PyTeal 기반 Algorand 스마트 계약에서 키 재설정 공격, 수수료 미검증 등 보안 문제 11가지를 찾도록 돕습니다.
audit-prep-assistant
8.0k에이전트가 외부 보안 검토를 위해 코드베이스를 준비하도록 돕습니다. 정적 분석, 테스트 커버리지, 죽은 코드 정리, 명확한 문서화를 포함합니다.
cairo-vulnerability-scanner
8.0k에이전트가 StarkNet Cairo 스마트 계약에서 오버플로, 위험한 계층 간 메시지, 서명 재사용 등 6가지 문제를 검사하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.