fuzzing
하는 일
이 스킬은 메모리 오류와 버그를 찾기 위해 컴파일된 프로그램과 라이브러리를 퍼징 테스트하는 방법을 설명합니다. 자신의 코드를 테스트하는 개발자와 보안 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓개발자가 출시 전에 파일 파서의 충돌 버그를 찾으려는 경우.
- ✓보안 엔지니어가 신뢰할 수 없는 입력을 읽는 라이브러리를 테스트해야 할 때.
- ✓팀이 퍼징 실행으로 발견한 충돌을 줄이고 정리하려는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/fuzzing/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 라이브러리의 파일 파서가 충돌을 일으키는지 찾도록 퍼즈 테스트를 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 AI에게 퍼징 도구를 고르고, 작은 테스트 하네스를 작성하고, 입력을 모으고, 찾은 충돌을 줄이고 정렬하도록 안내합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Coverage-Guided Fuzzing Playbook
Find memory-corruption and logic bugs by systematically mutating inputs while tracking code coverage. Works on parsers, network protocol handlers, file format readers, crypto implementations.
1. Target Scoping
Before writing a harness, answer:
- What is the attack surface? (file parser / network socket / library API)
- What input format does the target consume? (binary struct / text / TLV)
- Is source available? (instrumented build) or binary-only? (QEMU/Frida mode)
# Quick API surface for a library
nm -D /workspace/target.so | grep ' T ' | awk '{print $3}' | sort > /workspace/exports.txt
# or via radare2
r2 -q -e bin.demangle=true -c "aaa; afl~pub" /workspace/target.so 2>/dev/null | head -40
2. Fuzzer Selection
| Scenario | Fuzzer | Rationale |
|---|---|---|
| Source available, C/C++ | AFL++ | Best coverage feedback, mutator ecosystem |
| Source available, any lang | libFuzzer | In-process, lower overhead, LLVM native |
| Binary-only | AFL++ QEMU mode | AFL_USE_QEMU=1 |
| Binary-only (faster) | AFL++ Frida mode | Lighter than QEMU on some targets |
| Multi-CPU farm | AFL++ + honggfuzz | honggfuzz for socket fuzzing |
| Go / Rust | native go-fuzz / cargo fuzz |
Language-native instrumentation |
| Network protocol daemon | AFL++ persistent + preeny | Desock the accept() loop |
3. Instrumented Build (source-available)
# AFL++
CC=afl-clang-fast CXX=afl-clang-fast++ \
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -g -O1" \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -g -O1" \
-S /workspace/src -B /workspace/build-afl
cmake --build /workspace/build-afl -j$(nproc)
# libFuzzer (alternative)
CC=clang CXX=clang++ \
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=fuzzer,address,undefined -g" \
-DCMAKE_CXX_FLAGS="-fsanitize=fuzzer,address,undefined -g" \
-S /workspace/src -B /workspace/build-lf
cmake --build /workspace/build-lf -j$(nproc)
Minimum sanitizer flags: -fsanitize=address,undefined. Add
-fsanitize=memory (MSan) on a separate build for uninit reads.
Do NOT combine MSan with ASan — they conflict.
4. Harness Skeleton
AFL++ persistent-mode harness (C)
/* harness.c — compile with afl-clang-fast */
#include <stdint.h>
#include <string.h>
/* Include target headers */
#include "target_api.h"
/* AFL++ persistent mode — loops inside the same process (~20x faster) */
__AFL_FUZZ_INIT();
int main(void) {
__AFL_INIT();
const uint8_t *buf = __AFL_FUZZ_TESTCASE_BUF;
while (__AFL_LOOP(10000)) {
size_t len = __AFL_FUZZ_TESTCASE_LEN;
/* Call the target function directly */
target_parse(buf, len); /* replace with actual API */
}
return 0;
}
libFuzzer target (C)
/* fuzz_target.cc */
#include <stdint.h>
#include <stddef.h>
#include "target_api.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
/* Wrap any setup in thread_local or static init if needed */
target_parse(data, size);
return 0; /* non-zero aborts fuzzer */
}
Key harness rules:
- Allocate nothing that leaks between iterations (use arena or reset)
- Do not call
exit()orabort()inside the harness — let ASan terminate - Minimize initialization overhead outside the fuzz loop
- If target needs a null-terminated string:
strndup((char*)data, size)
5. Seed Corpus Curation
# Create corpus dir
mkdir -p /workspace/corpus/initial
# If target is a file parser, seed with real samples
find /usr/share -name "*.png" 2>/dev/null | head -10 | \
xargs -I{} cp {} /workspace/corpus/initial/
# For binary protocols, create minimal valid inputs by hand
# For text protocols, minimal valid requests:
printf 'GET / HTTP/1.0\r\n\r\n' > /workspace/corpus/initial/http_get.bin
# AFL++ minimize corpus to remove redundant seeds
afl-cmin -i /workspace/corpus/initial \
-o /workspace/corpus/minimized \
-- /workspace/build-afl/harness @@
Good seed = valid, minimal, diverse. 5–50 seeds beats 5000 random bytes.
6. Run AFL++
mkdir -p /workspace/findings/afl
# Single-core
AFL_SKIP_CPUFREQ=1 \
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 \
afl-fuzz \
-i /workspace/corpus/minimized \
-o /workspace/findings/afl \
-t 1000 \ # timeout per testcase (ms)
-- /workspace/build-afl/harness @@
# Multi-core (1 main + N-1 secondary)
자주 묻는 질문
퍼징이란 무엇인가요?
프로그램에 수정된 입력을 많이 보내고 충돌이나 오류를 살피는 것입니다.
어떤 도구를 언급하나요?
AFL++, libFuzzer, Honggfuzz와 소스 및 바이너리 대상을 위한 방법을 언급합니다.
버그도 고치나요?
아닙니다. 개발자가 고칠 수 있도록 충돌을 찾고 정리하는 것을 돕습니다.
상세 정보
작성자의 원본 설명
Coverage-guided fuzzing methodology for compiled binaries and libraries: target scoping, fuzzer selection (AFL++/libFuzzer/Honggfuzz), harness skeleton, ASan+UBSan flags, corpus curation, crash triage and minimization (afl-tmin/minimize_corpus), exploitability rubric. Outputs corpora and crashes to /workspace/. Triggers on: 'fuzz', 'fuzzing', 'AFL', 'libFuzzer', 'harness', 'crash triage', 'coverage-guided', 'afl-tmin', 'sanitizer', 'corpus'.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14167
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.