skills/ctf/ctf-pwn/SKILL.md
CTF 二进制漏洞利用(Pwn)技术。当挑战提供 ELF/PE 可执行文件并开放 nc 端口、存在栈溢出/堆溢出/格式化字符串/UAF 漏洞时使用。覆盖 ROP 链构造、堆利用(tcache/House of Orange/Spirit)、内核利用、seccomp 沙箱逃逸、pwntools 自动化利用脚本编写
npx skillsauth add wgpsec/AboutSecurity ctf-pwnInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
以下参考资料按漏洞类型组织,按需加载:
| 漏洞类型 | skill 引用 | |---------|----------------| | 栈溢出 / ret2win / Canary绕过 | references/stack-overflow.md | | 格式化字符串 / 泄漏 / GOT覆写 / Blind Pwn | references/format-string.md | | 堆(UAF/double free/tcache/House of X) | references/heap-exploitation.md | | ROP(ret2csu/ret2libc/SROP/seccomp绕过/RETF) | references/rop-techniques.md | | 内核堆喷 / tty_struct / userfaultfd / modprobe_path | references/kernel-exploitation.md | | KASLR / KPTI / SMEP / SMAP / FGKASLR 绕过 | references/kernel-bypass.md | | 自定义VM / JIT / 类型混淆 / FSOP / Windows / ARM | references/advanced-pwn.md | | Python沙箱 / FUSE / Busybox / 受限Shell | references/sandbox-escape.md | | 栈溢出基础 / 结构体覆写 / 有符号整数 / Canary | references/overflow-basics.md | | ROP链构造 / ret2csu / XOR编码 / shellcode | references/rop-and-shellcode.md | | 高级ROP / 双栈迁移 / UTF-8 SROP / RETF绕seccomp | references/rop-advanced.md | | 堆技术(House of Apple2/Einherjar/自定义分配器) | references/heap-techniques.md | | 堆FILE结构(fastbin→stdout/vtable劫持/glibc 2.24+) | references/heap-fsop.md | | 内核基础(环境/堆喷结构/栈溢出/提权原语) | references/kernel.md | | 内核技术(tty_struct/userfaultfd/SLUB/Panic泄漏) | references/kernel-techniques.md | | 高级利用2(字节码/io_uring/整数截断/GC) | references/advanced-exploits-2.md | | 高级利用3(栈变量重叠/1字节溢出/GOT覆写) | references/advanced-exploits-3.md | | 高级利用4(Windows SEH/ARM Thumb/Forth/GF(2)) | references/advanced-exploits-4.md | | 高级利用5(Chip-8模拟器/浮点Canary/Bloom Filter) | references/advanced-exploits-5.md | | Pwn 实战笔记(堆速查/利用备忘/常用命令) | references/field-notes.md |
format-string.md (331行):
kernel-bypass.md (421行):
kernel-exploitation.md (398行):
advanced-pwn.md (591行):
Pwn 题目分析?
├─ 检查保护: checksec binary
│ ├─ PIE 关闭 → 地址固定,直接覆写 GOT/PLT
│ ├─ Partial RELRO → GOT 可写 → GOT覆写
│ ├─ Full RELRO → 需找替代目标(hooks/vtable/.fini_array)
│ ├─ NX 开启 → 不能执行栈/堆shellcode → 用 ROP
│ └─ Canary → 需泄漏或用堆/字节溢出绕过
├─ 漏洞类型
│ ├─ 栈溢出
│ │ ├─ 基础 ret2win → `stack-overflow.md`
│ │ ├─ ret2libc / ROP → `rop-techniques.md`
│ │ ├─ Canary绕过 → `stack-overflow.md` + `advanced-pwn.md`
│ │ └─ 堆叠溢出 → `advanced-pwn.md`
│ ├─ 格式化字符串
│ │ └─ `format-string.md`
│ ├─ 堆(UAF/double free/tcache)
│ │ ├─ 基础 tcache poisoning → `heap-exploitation.md`
│ │ ├─ House of X/Orange/Lore → `heap-exploitation.md` + `advanced-pwn.md`
│ │ └─ FSOP → `advanced-pwn.md`
│ ├─ 内核模块
│ │ ├─ 基础环境/提权 → `kernel-exploitation.md`
│ │ └─ 保护绕过 → `kernel-bypass.md`
│ └─ 自定义 VM / JIT / 类型混淆
│ └─ `advanced-pwn.md`
└─ 利用链
├─ 泄漏 → 计算libc基址 → one_gadget / system / FSOP
├─ ROP → ret2libc / SROP / ret2dlresolve / seccomp绕过
└─ 堆 → House of X / tcache poisoning → __free_hook / TLS dtors
| 保护 | 状态 | 影响 | 绕过方法 | |------|------|------|---------| | PIE | 关闭 | GOT/PLT/函数地址固定 | 直接覆写 | | PIE | 开启 | 地址随机化 | 泄漏 → 计算基址 | | RELRO | Partial | GOT 可写 | GOT覆写 | | RELRO | Full | GOT 只读 | hooks/vtable/.fini_array/FSOP | | NX | 开启 | 栈不可执行 | ROP | | NX | 关闭 | 栈可执行 | shellcode | | Canary | 有 | 溢出被检测 | 泄漏/字节溢出/BRK |
gets() / scanf("%s") / strcpy() → 栈溢出
printf(user_input) → 格式化字符串
free() 后继续使用 → UAF
read(fd, buf, size) → 堆溢出 / 栈溢出
from pwn import *
context.binary = elf = ELF('./binary')
libc = ELF('./libc.so.6')
p = remote('host', port) # or process('./binary')
# 泄漏 → 计算基址 → 覆写 → getshell
bash -c '{ echo "cmd1"; echo "cmd2"; sleep 1; } | nc host port'
one_gadget libc.so.6 列出所有,再筛选满足约束的cyclic_find() 精确定位溢出偏移testing
Azure 云环境渗透测试总体方法论。当目标使用 Azure/Microsoft 365/Entra ID、发现 Azure 相关资产(Blob Storage/App Service/Azure VM/Azure Functions)、获取 Azure 凭据(Service Principal/Managed Identity/Access Token)、或需要对 Azure 环境进行安全评估时使用。提供从未授权枚举到 Entra ID 攻击、服务提权、Cloud-to-OnPrem 横向移动的全流程决策树。覆盖 35+ Azure 服务攻击面
tools
Mythic C2 操作方法论。当需要部署 Mythic、选择 Mythic Agent、安装 C2 Profile、配置 HTTP/DNS/WebSocket/SMB/TCP 通信、生成 payload、管理回连任务,或把 Mythic 作为跨平台 C2 框架用于授权红队演练时使用。覆盖 mythic-cli 安装、Agent/Profile 选择、SSL 证书配置、payload 构建和基础 OPSEC 判断
development
Docker 安全测试与容器渗透方法论。当需要评估 Docker 容器、Docker Daemon、Docker Registry、镜像层、构建产物或容器逃逸风险时使用。覆盖容器环境识别、特权容器逃逸、docker.sock/Remote API 利用、procfs/cgroup/capabilities 滥用、Docker 用户组提权、运行时/内核 CVE、Registry 枚举、镜像层 Secret 分析和构建上下文泄露。发现 Docker 容器环境、Registry 暴露、镜像凭据或容器配置错误时应使用此技能
development
使用 PadBuster 进行 Padding Oracle 攻击。当发现 Web 应用使用 CBC 模式加密且存在 Padding Oracle 漏洞时使用。PadBuster 可自动解密密文和伪造任意明文对应的合法密文,适用于加密 Cookie/Token/URL 参数。任何涉及 Padding Oracle 攻击、CBC 密文解密、Cookie 伪造的场景都应使用此技能