@aegis-scan/skills 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/ATTRIBUTION.md +75 -0
  2. package/CHANGELOG.md +129 -0
  3. package/LICENSE +21 -0
  4. package/README.md +123 -0
  5. package/dist/bin.d.ts +3 -0
  6. package/dist/bin.d.ts.map +1 -0
  7. package/dist/bin.js +122 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/commands/info.d.ts +5 -0
  10. package/dist/commands/info.d.ts.map +1 -0
  11. package/dist/commands/info.js +75 -0
  12. package/dist/commands/info.js.map +1 -0
  13. package/dist/commands/install.d.ts +7 -0
  14. package/dist/commands/install.d.ts.map +1 -0
  15. package/dist/commands/install.js +87 -0
  16. package/dist/commands/install.js.map +1 -0
  17. package/dist/commands/list.d.ts +7 -0
  18. package/dist/commands/list.d.ts.map +1 -0
  19. package/dist/commands/list.js +82 -0
  20. package/dist/commands/list.js.map +1 -0
  21. package/dist/index.d.ts +13 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +13 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/skills-loader.d.ts +23 -0
  26. package/dist/skills-loader.d.ts.map +1 -0
  27. package/dist/skills-loader.js +213 -0
  28. package/dist/skills-loader.js.map +1 -0
  29. package/package.json +63 -0
  30. package/skills/defensive/README.md +9 -0
  31. package/skills/mitre-mapped/README.md +10 -0
  32. package/skills/offensive/snailsploit-fork/advanced-redteam/SKILL.md +148 -0
  33. package/skills/offensive/snailsploit-fork/ai-security/SKILL.md +592 -0
  34. package/skills/offensive/snailsploit-fork/basic-exploitation/SKILL.md +10783 -0
  35. package/skills/offensive/snailsploit-fork/bug-identification/SKILL.md +1256 -0
  36. package/skills/offensive/snailsploit-fork/crash-analysis/SKILL.md +12466 -0
  37. package/skills/offensive/snailsploit-fork/deserialization/SKILL.md +185 -0
  38. package/skills/offensive/snailsploit-fork/edr-evasion/SKILL.md +1806 -0
  39. package/skills/offensive/snailsploit-fork/exploit-dev-course/SKILL.md +428 -0
  40. package/skills/offensive/snailsploit-fork/exploit-development/SKILL.md +699 -0
  41. package/skills/offensive/snailsploit-fork/fast-checking/SKILL.md +487 -0
  42. package/skills/offensive/snailsploit-fork/file-upload/SKILL.md +822 -0
  43. package/skills/offensive/snailsploit-fork/fuzzing/SKILL.md +340 -0
  44. package/skills/offensive/snailsploit-fork/fuzzing-course/SKILL.md +2105 -0
  45. package/skills/offensive/snailsploit-fork/graphql/SKILL.md +209 -0
  46. package/skills/offensive/snailsploit-fork/idor/SKILL.md +608 -0
  47. package/skills/offensive/snailsploit-fork/initial-access/SKILL.md +1528 -0
  48. package/skills/offensive/snailsploit-fork/jwt/SKILL.md +276 -0
  49. package/skills/offensive/snailsploit-fork/keylogger-arch/SKILL.md +197 -0
  50. package/skills/offensive/snailsploit-fork/mitigations/SKILL.md +1351 -0
  51. package/skills/offensive/snailsploit-fork/oauth/SKILL.md +366 -0
  52. package/skills/offensive/snailsploit-fork/open-redirect/SKILL.md +487 -0
  53. package/skills/offensive/snailsploit-fork/osint/SKILL.md +399 -0
  54. package/skills/offensive/snailsploit-fork/osint-methodology/SKILL.md +434 -0
  55. package/skills/offensive/snailsploit-fork/parameter-pollution/SKILL.md +595 -0
  56. package/skills/offensive/snailsploit-fork/race-condition/SKILL.md +881 -0
  57. package/skills/offensive/snailsploit-fork/rce/SKILL.md +1069 -0
  58. package/skills/offensive/snailsploit-fork/request-smuggling/SKILL.md +773 -0
  59. package/skills/offensive/snailsploit-fork/shellcode/SKILL.md +477 -0
  60. package/skills/offensive/snailsploit-fork/sqli/SKILL.md +372 -0
  61. package/skills/offensive/snailsploit-fork/ssrf/SKILL.md +830 -0
  62. package/skills/offensive/snailsploit-fork/ssti/SKILL.md +349 -0
  63. package/skills/offensive/snailsploit-fork/vuln-classes/SKILL.md +1229 -0
  64. package/skills/offensive/snailsploit-fork/waf-bypass/SKILL.md +820 -0
  65. package/skills/offensive/snailsploit-fork/windows-boundaries/SKILL.md +15153 -0
  66. package/skills/offensive/snailsploit-fork/windows-mitigations/SKILL.md +14546 -0
  67. package/skills/offensive/snailsploit-fork/xss/SKILL.md +784 -0
  68. package/skills/offensive/snailsploit-fork/xxe/SKILL.md +996 -0
  69. package/skills/ops/README.md +6 -0
@@ -0,0 +1,340 @@
1
+ <!-- aegis-local: forked 2026-04-23 from SnailSploit/Claude-Red@c74d53e2938b59f111572e0819265a1e73029393; attribution preserved, see ATTRIBUTION.md -->
2
+
3
+ ---
4
+ name: offensive-fuzzing
5
+ description: "Practical offensive fuzzing methodology covering target identification, fuzzer selection (AFL++, libFuzzer, Honggfuzz, Boofuzz, syzkaller), harness writing, corpus curation, mutation strategies, coverage measurement, and crash triage. Use when setting up or running fuzz campaigns against any target: file parsers, network protocols, kernel drivers, EDR engines, embedded firmware, or language runtimes."
6
+ ---
7
+
8
+ # Offensive Fuzzing
9
+
10
+ ## Fuzzer Types
11
+
12
+ | Type | Coverage | Speed | Tools |
13
+ |------|----------|-------|-------|
14
+ | BlackBox | Poor | Fast | Peach, Boofuzz |
15
+ | GreyBox | Good | Fast | AFL++, Honggfuzz, libFuzzer, WinAFL |
16
+ | Snapshot | Good | Fastest | Nyx, wtf, Snapchange |
17
+ | WhiteBox | Best | Slow | KLEE, QSYM, SymSan |
18
+ | Ensemble | Best | Fast | AFL++ + Honggfuzz + libFuzzer |
19
+
20
+ **GreyBox sub-variants:** Directed (AFLGo, UAFuzz), Grammar (AFLSmart, Tlspuffin), Concolic (QSYM, Driller), Kernel (syzkaller, kAFL, wtf).
21
+
22
+ ## Core Workflow
23
+
24
+ ```
25
+ Research target → Choose analyses → Build harness → Seed corpus → Instrument → Fuzz → Triage crashes → Report
26
+ ```
27
+
28
+ ### 1. Research Target
29
+
30
+ - Map all input surfaces (files, network, IPC, syscalls, IOCTL)
31
+ - Identify high-value areas: previously patched code, complex parsers, newly added code, input ingestion points
32
+ - For kernel modules: look beyond `copy_from_user` — DMA-BUF ops, page fault handlers, VM operation structs, allocation callbacks
33
+
34
+ ### 2. Instrument and Build
35
+
36
+ ```bash
37
+ # AFL++ (preferred for GreyBox)
38
+ CC=afl-clang-fast CXX=afl-clang-fast++ cmake -DCMAKE_BUILD_TYPE=Release .. && make -j
39
+
40
+ # libFuzzer + ASan/UBSan (C/C++)
41
+ cmake -DCMAKE_CXX_FLAGS="-fsanitize=fuzzer,address,undefined -O1 -g" ..
42
+
43
+ # CmpLog build for hard compares
44
+ AFL_LLVM_CMPLOG=1 CC=afl-clang-fast CXX=afl-clang-fast++ make clean all
45
+ ```
46
+
47
+ **Windows (MSVC):** `Project Properties → C/C++ → Address Sanitizer: Yes (/fsanitize=address)`
48
+
49
+ ### 3. Write Harness
50
+
51
+ **libFuzzer (C++):**
52
+ ```cpp
53
+ #include <cstdint>
54
+ #include <cstddef>
55
+ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
56
+ parse_or_process(data, size);
57
+ return 0;
58
+ }
59
+ ```
60
+
61
+ **Honggfuzz HF_ITER (persistent mode — preferred for large targets):**
62
+ ```cpp
63
+ #include "honggfuzz.h"
64
+ int main(int argc, char** argv) {
65
+ initialize_target(); // runs once
66
+ for (;;) {
67
+ size_t len; uint8_t *buf;
68
+ HF_ITER(&buf, &len);
69
+ FILE* s = fmemopen(buf, len, "r");
70
+ target_function(s);
71
+ fclose(s);
72
+ reset_target_state();
73
+ }
74
+ }
75
+ ```
76
+
77
+ **AFL++ persistent mode (`__AFL_LOOP`):**
78
+ ```cpp
79
+ while (__AFL_LOOP(10000)) {
80
+ // re-read input and process
81
+ }
82
+ ```
83
+
84
+ **macOS IPC (Mach message fuzzing):**
85
+ ```c
86
+ void *lib_handle = dlopen("libexample.dylib", RTLD_LAZY);
87
+ pFunction = dlsym(lib_handle, "DesiredFunction");
88
+ ```
89
+
90
+ ### 4. Build Seed Corpus
91
+
92
+ - Pull from target's test suite, bug reports, and real-world samples
93
+ - Web-crawl (Common Crawl) for file formats; filter by MIME type
94
+ - Minimize: `afl-cmin -i raw_corpus -o seeds -- ./target @@`
95
+ - Trim inputs: `afl-tmin -i crash -o crash.min -- ./target @@`
96
+
97
+ ### 5. Launch Fuzzing
98
+
99
+ **AFL++ parallel (primary + secondary with cmplog):**
100
+ ```bash
101
+ afl-fuzz -M f1 -i seeds -o findings -x dict.txt -- ./target @@
102
+ afl-fuzz -S s1 -i seeds -o findings -c 0 -- ./target @@
103
+ ```
104
+
105
+ **libFuzzer:**
106
+ ```bash
107
+ ./target_libfuzzer corpus/ -max_total_time=3600 -workers=4
108
+ ```
109
+
110
+ **Binary-only (QEMU):**
111
+ ```bash
112
+ afl-fuzz -Q -i seeds -o findings -- target.exe @@
113
+ ```
114
+
115
+ **Snapshot (AFL++ Nyx):**
116
+ ```bash
117
+ NYX_MODE=1 AFL_MAP_SIZE=1048576 afl-fuzz -i seeds -o findings -- ./target_nyx @@
118
+ ```
119
+
120
+ **Ensemble (AFL++ + Honggfuzz sharing corpus):**
121
+ ```bash
122
+ # Terminal 1
123
+ afl-fuzz -M fuzzer1 -i seeds -o sync_dir -- ./target @@
124
+ # Terminal 2
125
+ ../honggfuzz/honggfuzz -i sync_dir/fuzzer1/queue -W sync_dir/hfuzz \
126
+ --linux_perf_ipt_block -t 10 -- ./target ___FILE___
127
+ ```
128
+
129
+ ### 6. Monitor and Unstick
130
+
131
+ If progress stalls:
132
+ - Enable CmpLog: `-c 0` on AFL++ secondaries
133
+ - Add dictionary: `-x dict.txt` or `AFL_TOKEN_FILE`
134
+ - Switch to directed fuzzing (AFLGo) targeting specific BBs/functions
135
+ - Use concolic assistance (QSYM, Driller) on hard branches
136
+ - Snapshot the target to increase exec/s
137
+ - `AFL_MAP_SIZE=1048576`, `-L 0` for MOpt scheduler
138
+
139
+ ### 7. Triage Crashes
140
+
141
+ ```bash
142
+ # 1. Minimize
143
+ afl-tmin -i crash -o crash.min -- ./target @@
144
+ # 2. Symbolize
145
+ ASAN_OPTIONS=abort_on_error=1:symbolize=1 ./target crash.min 2>asan.log
146
+ # 3. Hash + bucket
147
+ ./cov-tool --bbids ./target crash.min > cov.hash
148
+ ./bucket.py --key "$(cat cov.hash)" --log asan.log --out triage/
149
+ ```
150
+
151
+ **Sanitizer env quick reference:**
152
+ ```
153
+ ASAN_OPTIONS=abort_on_error=1:symbolize=1:detect_stack_use_after_return=1
154
+ UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
155
+ TSAN_OPTIONS=halt_on_error=1:history_size=7
156
+ MSAN_OPTIONS=poison_in_dtor=1:track_origins=2
157
+ ```
158
+
159
+ ## Oracle Selection
160
+
161
+ | Bug Class | Oracle |
162
+ |-----------|--------|
163
+ | Memory safety | ASan, HWASan (AArch64, lower overhead) |
164
+ | Uninitialized reads | MSan |
165
+ | Concurrency | TSan |
166
+ | Undefined behavior | UBSan |
167
+ | Type safety | TypeSan |
168
+ | Heap hardening | Scudo Hardened Allocator |
169
+ | Logic bugs | Differential / idempotency oracles |
170
+ | Kernel memory | KASAN, KMSAN, KCSAN |
171
+ | Kernel UB | KUBSan (`CONFIG_UBSAN_TRAP=y`) |
172
+ | CFI | KCFI (`-fsanitize=kcfi`, Clang 18) |
173
+ | Binary-only | QASAN (QEMU+ASan), DynamoRIO |
174
+
175
+ **Property oracle patterns:**
176
+ - Idempotency: `f(x) == f(f(x))`
177
+ - Differential: compare two impls, bucket on output mismatch
178
+ - Invariants: monotonic lengths, checksum equality, schema validation post-parse
179
+
180
+ ## Specialized Targets
181
+
182
+ ### Kernel (Linux) — syzkaller
183
+
184
+ ```json
185
+ {
186
+ "target": "linux/arm64",
187
+ "http": ":56700",
188
+ "workdir": "/path/to/workdir",
189
+ "kernel_obj": "/path/to/kernel",
190
+ "image": "/path/to/rootfs.ext3",
191
+ "sshkey": "/path/to/id_rsa",
192
+ "procs": 8,
193
+ "enable_syscalls": ["openat$module_name", "ioctl$IOCTL_CMD", "mmap"],
194
+ "type": "qemu",
195
+ "vm": { "count": 4, "cpu": 2, "mem": 2048 }
196
+ }
197
+ ```
198
+
199
+ - Limit `enable_syscalls` to deepen coverage on specific subsystems
200
+ - Use `syz-extract` to pull constants for custom modules
201
+ - Enable `CONFIG_KASAN=y`, `CONFIG_KCFI=y`, `CONFIG_DEBUG_INFO_BTF=y`
202
+ - Use `kcov` filters and `syz_cover_filter` to direct coverage
203
+ - Network fuzzing: inject via `TUN/TAP` + pseudo-syscalls (`syz_emit_ethernet`)
204
+ - Crash decode: `./scripts/decode_stacktrace.sh vmlinux ... < dmesg.log`
205
+
206
+ **syzkaller repro:**
207
+ ```bash
208
+ syz-execprog -repeat=0 -procs=1 -cover=0 -debug target.repro
209
+ ```
210
+
211
+ ### EDR / Windows Scanning Engines
212
+
213
+ **WTF snapshot harness skeleton (mpengine.dll / mini-filter):**
214
+ ```cpp
215
+ g_Backend->SetBreakpoint("nt!KeBugCheck2", [](Backend_t *Backend) {
216
+ const uint64_t BCode = Backend->GetArg(0);
217
+ Backend->Stop(Crash_t(fmt::format("crash-{:#x}", BCode)));
218
+ });
219
+ ```
220
+
221
+ **FilterConnectionPort fuzzing:**
222
+ ```cpp
223
+ HANDLE hPort;
224
+ FilterConnectCommunicationPort(L"\\PortName", 0, NULL, 0, NULL, &hPort);
225
+ FilterSendMessage(hPort, fuzzData, sizeof(fuzzData), NULL, 0, &bytesReturned);
226
+ ```
227
+
228
+ **IOCTL fuzzing pattern:**
229
+ ```cpp
230
+ HANDLE hDev = CreateFile(L"\\\\.\\DeviceName", GENERIC_READ|GENERIC_WRITE, ...);
231
+ DeviceIoControl(hDev, ioctlCode, inputBuf, inputLen, outBuf, outLen, &ret, NULL);
232
+ ```
233
+
234
+ - Take snapshots after initialization, right before parse/dispatch loop
235
+ - Use IDA Lighthouse for coverage visualization
236
+ - Monitor: `DRIVER_VERIFIER_DETECTED_VIOLATION (0xc4)`, `IRQL_NOT_LESS_OR_EQUAL (0xa)`
237
+ - WinDbg: `.symfix; !analyze -v; k; !heap -p -a @rax`
238
+
239
+ **Cross-platform mpengine.dll on Linux (loadlibrary + HF_ITER + Intel PT):**
240
+ ```cpp
241
+ // Bypass Lua VM to avoid stability issues
242
+ insert_function_redirect((void*)luaV_execute_address, my_lua_exec, HOOK_REPLACE_FUNCTION);
243
+ for (;;) {
244
+ HF_ITER(&buf, &len);
245
+ ScanDescriptor.UserPtr = fmemopen(buf, len, "r");
246
+ __rsignal(&KernelHandle, RSIG_SCAN_STREAMBUFFER, &ScanParams, sizeof ScanParams);
247
+ }
248
+ ```
249
+
250
+ ### Rust
251
+
252
+ ```bash
253
+ # Full Rust fuzzing pipeline
254
+ cargo test # 1. property tests
255
+ cargo +nightly miri test # 2. UB via interpreter
256
+ cargo +nightly careful test # 3. runtime bounds checks
257
+ cargo fuzz run fuzz_target_1 -- -max_total_time=3600 # 4. libFuzzer crashes
258
+ RUSTFLAGS="--cfg loom" cargo test --release # 5. concurrency (if needed)
259
+ cargo fuzz coverage fuzz_target_1 # 6. coverage report
260
+ ```
261
+
262
+ Focus unsafe blocks on: `Vec::from_raw_parts`, unchecked indexing, `transmute` size mismatches, pointer arithmetic, FFI integer truncation.
263
+
264
+ ### Embedded / Binary-Only
265
+
266
+ - **LibAFL**: Modular Rust framework; Unicorn engine, snapshot module, LBRFeedback (zero-instrumentation on Intel), SAND decoupled sanitization
267
+ - **Retrowrite / QASAN**: Binary rewriting for coverage + ASan without source
268
+ - **Nautilus**: Grammar-based fuzzing for structured formats
269
+
270
+ ### Language Ecosystems
271
+
272
+ - **Go 1.18+**: `go test -fuzz=Fuzz -run=^$ ./...`
273
+ - **Python**: [Atheris](https://github.com/google/atheris) (CPython native extension fuzzing)
274
+ - **Rust**: `cargo-fuzz` or `honggfuzz-rs`
275
+ - **JS engines**: Fuzzilli with extended instrumentation (`__builtin_return_address(0)` for PC tracking)
276
+ - **Wasm runtimes**: `wasmtime-fuzz`, `wafl` for differential fuzzing across V8/Wasmer/Wasmtime
277
+ - **Smart contracts**: Echidna, Foundry-fuzz (Solidity); Move-Fuzz (Aptos/Sui)
278
+
279
+ ## CI/CD Integration
280
+
281
+ ```yaml
282
+ - name: Build with afl-clang-fast
283
+ run: CC=afl-clang-fast make -j
284
+ - name: Fuzz (smoke, 15 min)
285
+ run: timeout 15m afl-fuzz -i seeds -o findings -- ./target @@ || true
286
+ - name: Upload crashes
287
+ if: always()
288
+ uses: actions/upload-artifact@v4
289
+ with:
290
+ path: findings/**/crashes/*
291
+ ```
292
+
293
+ Use **ClusterFuzzLite** for persistent continuous fuzzing; cache corpora between runs.
294
+
295
+ ## Crash Analysis Quick Reference
296
+
297
+ **Linux:**
298
+ ```bash
299
+ ulimit -c unlimited && sysctl -w kernel.core_pattern=core.%e.%p
300
+ gdb -q ./target core.* -ex 'bt' -ex 'info reg' -ex q
301
+ addr2line -e ./target 0xDEADBEEF
302
+ ```
303
+
304
+ **Windows:**
305
+ ```powershell
306
+ # Enable local dumps
307
+ New-Item 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Force
308
+ # PageHeap
309
+ gflags /p /enable target.exe /full
310
+ ```
311
+
312
+ **Kernel KASAN/KMSAN:**
313
+ ```bash
314
+ dmesg -T | egrep -i 'kasan|kmsan' -A 60
315
+ ./scripts/decode_stacktrace.sh vmlinux /lib/modules/$(uname -r)/build < dmesg.log
316
+ ```
317
+
318
+ **Reproducibility:** pin CPU governor, disable ASLR only where safe, fix RNG seeds, save input sequences in persistent mode, record binary hashes and sanitizer options with every crash.
319
+
320
+ ## Tool Index
321
+
322
+ | Tool | Use Case |
323
+ |------|----------|
324
+ | [AFL++](https://github.com/AFLplusplus/AFLplusplus) | General GreyBox, CmpLog, MOpt, Nyx |
325
+ | [Honggfuzz](https://github.com/google/honggfuzz) | Intel PT, crash detection, HF_ITER |
326
+ | [libFuzzer](https://llvm.org/docs/LibFuzzer.html) | In-process, source available |
327
+ | [syzkaller](https://github.com/google/syzkaller) | Linux/Windows kernel syscall fuzzing |
328
+ | [wtf](https://github.com/0vercl0k/wtf) | Snapshot fuzzing, Windows targets |
329
+ | [Nyx](https://github.com/nyx-fuzz/Nyx) | AFL++ snapshot mode (Intel PT) |
330
+ | [Snapchange](https://github.com/awslabs/snapchange) | AWS snapshot fuzzing |
331
+ | [LibAFL](https://github.com/AFLplusplus/LibAFL) | Custom Rust fuzzing framework |
332
+ | [AFLGo](https://github.com/aflgo/aflgo) | Directed fuzzing to target BB/function |
333
+ | [kAFL](https://github.com/IntelLabs/kAFL) | Kernel + OS fuzzing |
334
+ | [Jackalope](https://github.com/googleprojectzero/Jackalope) | Binary coverage-guided (Windows/macOS) |
335
+ | [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz) | Rust libFuzzer integration |
336
+ | [Atheris](https://github.com/google/atheris) | Python fuzzing |
337
+ | [Nautilus](https://github.com/nautilus-fuzz/nautilus) | Grammar-based fuzzing |
338
+ | [AFLTriage](https://github.com/quic/AFLTriage) | Automated crash triage |
339
+ | [afl-cov](https://github.com/mrash/afl-cov) | Coverage analysis for AFL++ |
340
+ | [ClusterFuzz](https://github.com/google/clusterfuzz) | Distributed fuzzing infrastructure |