Langsung ke konten
Skillpedia
Testing6.5k Β· #14167

fuzzing

Fungsinya

Skill ini menjelaskan metode fuzz testing untuk program dan pustaka terkompilasi guna menemukan kesalahan memori dan bug. Skill ini untuk pengembang dan insinyur keamanan yang menguji kode mereka sendiri.

Kapan dipakai

  • βœ“Saat seorang pengembang ingin menemukan bug crash pada parser berkas sebelum rilis.
  • βœ“Saat seorang insinyur keamanan perlu menguji pustaka yang membaca input yang tidak tepercaya.
  • βœ“Saat sebuah tim ingin memperkecil dan mengurutkan crash yang ditemukan oleh sebuah proses fuzzing.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/fuzzing/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/fuzzing/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBantu saya menyiapkan fuzz testing untuk parser berkas di pustaka kami guna menemukan crash.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill meminta AI memilih alat fuzzing, menulis harness uji kecil, mengumpulkan input, dan memperkecil serta mengurutkan crash yang ditemukan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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() or abort() 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)
Pertanyaan umum

Apa itu fuzzing?

Fuzzing mengirim banyak input yang dimodifikasi ke sebuah program dan mengamati adanya crash atau error.

Alat apa yang disebut?

Skill menyebut AFL++, libFuzzer, dan Honggfuzz, serta pendekatan untuk target sumber dan biner.

Apakah skill ini memperbaiki bug?

Tidak. Skill ini membantu menemukan dan mengurutkan crash agar pengembang bisa memperbaikinya.

Detail

Deskripsi asli dari pembuat

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'.

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14167
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa