Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计异常

binary-protection-bypass二进制保护旁路

Agent Skill

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

总安装

6,303

周安装

268

GitHub Stars

349

下载量

2,208
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/yaklang/hack-skills --skill binary-protection-bypass

简介

详解 ASLR、NX、RELRO 等防护机制的绕过方法,提供实战攻击向量。

  • 适合 CTF 挑战与渗透测试学习,列出每种保护对应的破解前提条件。
  • 强调组合防护下的攻击难度,提醒多数模型在此类推理上的局限性。
  • 仅限合法授权场景使用,禁止用于非法入侵或破坏他人系统。
  • binary-protection-bypass 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

SKILL: Binary Protection Bypass — Expert Attack Playbook

AI LOAD INSTRUCTION: Expert binary protection identification and bypass techniques. Covers ASLR, PIE, NX, RELRO, canary, FORTIFY_SOURCE, stack clash, CET shadow stack, and ARM MTE. Each protection is paired with its bypass methods and required primitives. Distilled from ctf-wiki mitigation sections and real-world exploitation. Base models often confuse which protections block which attacks and miss the combinatorial effect of multiple protections.

0. RELATED ROUTING

Advanced Reference

Load PROTECTION_BYPASS_MATRIX.md for comprehensive protection × bypass × primitive matrix.


1. PROTECTION IDENTIFICATION

$ checksec ./binary
[*] '/path/to/binary'
    Arch:     amd64-64-little
    RELRO:    Full RELRO          ← GOT read-only
    Stack:    Canary found        ← stack canary enabled
    NX:       NX enabled          ← stack not executable
    PIE:      PIE enabled         ← position-independent code
    FORTIFY:  Enabled             ← fortified libc functions

Quick Identification Table

ProtectionCheck CommandBinary Indicator
ASLRcat /proc/sys/kernel/randomize_va_spaceOS-level (0=off, 1=partial, 2=full)
PIEchecksec or readelf -h (Type: DYN)Binary compiled with -pie
NXchecksec or readelf -l (no RWE segment)gcc -z noexecstack (default on)
Canarychecksec or look for __stack_chk_fail@pltgcc -fstack-protector-all
Partial RELROreadelf -l (GNU_RELRO segment, .got.plt writable)gcc -Wl,-z,relro
Full RELROreadelf -l + .got section read-onlygcc -Wl,-z,relro,-z,now
FORTIFYPresence of __printf_chk, __memcpy_chk etc.gcc -D_FORTIFY_SOURCE=2

2. ASLR BYPASS

ASLR randomizes base addresses of stack, heap, libc, and mmap regions at each execution.

Bypass MethodRequired PrimitiveNotes
Information leakAny read primitive (format string, OOB read, UAF)Leak libc/stack/heap address → calculate base
Partial overwriteWrite primitive (limited length)Overwrite last 1-2 bytes (page offset fixed)
Brute force (32-bit)Ability to reconnect/retry~256–4096 attempts (8-12 bits entropy)
Return-to-PLTStack overflowPLT addresses are at fixed offset from binary base (if no PIE)
ret2dlresolveStack overflow + write primitiveResolve arbitrary function without knowing libc base
Format string leakFormat string vulnerability%N$p for stack/libc/heap addresses
Stack readingByte-by-byte (fork server)Read stack byte-by-byte via crash oracle

ASLR Entropy (x86-64 Linux)

RegionEntropy (bits)Positions
Stack22~4M
mmap / libc28~256M
Heap (brk)13~8K
PIE binary28~256M

3. PIE BYPASS

PIE (Position Independent Executable) randomizes the binary's own code/data base address.

Bypass MethodRequired PrimitiveNotes
Information leakRead return address from stackPIE base = leaked_addr - known_offset
Partial overwriteOne-byte or two-byte writeLast 12 bits of page offset are fixed
Format string leakFormat string vulnerability%N$p where N points to.text return address
Relative addressingKnowledge of binary layoutIf you know relative offsets, only need one leak

Partial Overwrite Details

PIE binary loaded at: 0x555555554000 (example)
Function at offset 0x1234: 0x555555555234

Overwrite return address last 2 bytes: 0x?234 → 0x?XXX
Unknown: bits 12-15 (one nibble = 4 bits = 16 possibilities)
Success rate: 1/16 per attempt

4. NX / DEP BYPASS

NX (No-eXecute) / DEP (Data Execution Prevention) prevents execution of code on the stack/heap.

Bypass MethodDetail
ROP (Return-Oriented Programming)Chain existing code gadgets ending in ret
ret2libcCall libc functions (system, execve) directly
ret2csuUse __libc_csu_init gadgets for controlled function calls
ret2dlresolveForge dynamic linker structures to resolve arbitrary functions
SROPUse sigreturn to set all registers from fake signal frame
mprotect ROPChain mprotect(addr, size, PROT_RWX) → make page executable → jump to shellcode
JIT sprayIn JIT environments (V8, etc.), create executable code via JIT compiler

mprotect Chain

# Make stack executable, then jump to shellcode
rop = b'A' * offset
rop += p64(pop_rdi) + p64(stack_page)     # page-aligned address
rop += p64(pop_rsi) + p64(0x1000)         # size
rop += p64(pop_rdx) + p64(7)              # PROT_READ|PROT_WRITE|PROT_EXEC
rop += p64(mprotect_addr)
rop += p64(shellcode_addr)                 # jump to shellcode on now-executable stack

5. RELRO BYPASS

RELRO LevelGOT StatusBypass
No RELROGOT fully writableDirect GOT overwrite
Partial RELRO.got.plt writable (lazy binding)GOT overwrite still works
Full RELROAll GOT entries resolved at load, GOT read-onlyCannot write GOT → target other structures

Full RELRO Alternative Targets

TargetWhenHow
__malloc_hookglibc < 2.34Overwrite with one_gadget
__free_hookglibc < 2.34Overwrite with system, trigger free("/bin/sh")
_IO_FILE vtableAny glibcFSOP / vtable hijack
__exit_funcsAny glibcOverwrite exit handler list
TLS_dtor_listglibc ≥ 2.34Thread-local destructor list (needs pointer guard)
.fini_arrayIf writableOverwrite destructor function pointers
Stack return addressDirect stack writeOverwrite return address for ROP

See arbitrary-write-to-rce for comprehensive target list.


6. CANARY BYPASS

MethodConditionDetail
Format string leakprintf(user_input)%N$p to read canary from stack
Brute-forcefork() server (canary persists in child)Byte-by-byte: 256 × (canary_size-1) attempts
Stack readingPartial overwrite / info leakOverwrite canary's null byte, leak via output
Thread canary overwriteOverflow reaches TLSCanary at fs:[0x28]; overflow past buffer to TLS → overwrite canary with known value
Canary-relative overwriteOverflow after canary but before return addrSkip canary, only overwrite return address (rare layout)
Heap-basedVulnerability is on heap, not stackCanary only protects stack
__stack_chk_fail GOT overwritePartial RELROOverwrite __stack_chk_fail@GOT to point to harmless function → canary check passes

Canary Format

x86:    0x00XXXXXX (4 bytes, leading null byte)
x86-64: 0x00XXXXXXXXXXXXXX (8 bytes, leading null byte)

The leading \x00 prevents string operations from accidentally reading the canary.


7. FORTIFY_SOURCE BYPASS

_FORTIFY_SOURCE=2 adds buffer size checking and restricts format string operations.

Fortified FunctionRestrictionBypass
__printf_chk%n with positional args (%N$n) forbiddenUse non-positional %n or %hn chain
__memcpy_chkDestination buffer size checkedUse heap overflow instead of stack
__strcpy_chkSame
__read_chkRead size checked against buffer

Format String with FORTIFY_SOURCE

# %1$n is blocked by __printf_chk
# But sequential (non-positional) %n may still work:
# Print exact byte count, then %hn — must be very precise
# Or: find unfortified printf in binary/libc via ROP

8. CET (Control-flow Enforcement Technology)

Intel CET adds two mechanisms:

Shadow Stack

  • Hardware-maintained copy of return addresses
  • On ret, CPU checks shadow stack matches actual stack
  • Mismatch → #CP fault (control protection exception)
ImpactDetail
ROP blockedReturn address overwrite detected on ret
JOP possiblejmp [reg] not checked by shadow stack
COP possiblecall [reg] pushes to shadow stack but target validated by IBT

Indirect Branch Tracking (IBT)

  • Indirect jmp/call must land on ENDBR64 instruction
  • Non-ENDBR landing → #CP fault

Bypass:

  • Data-only attacks (don't change control flow)
  • Find valid ENDBR gadgets that chain into useful operations
  • JOP with ENDBR-prefixed gadgets
  • Target structures outside CFI scope (modprobe_path, function pointer arrays)

9. MTE (Memory Tagging Extension, ARM)

ARM MTE assigns 4-bit tags to memory pointers and allocations. Tag mismatch = fault.

AspectDetail
Tag bits4 bits in pointer (bits 56-59) = 16 possible tags
Granule16 bytes (each 16-byte granule has one tag)
CheckLoad/store: pointer tag must match memory tag
ProbabilisticRandom tag → 1/16 chance attacker guesses correctly

Bypass Approaches

MethodSuccess Rate
Brute-force1/16 per attempt (6.25%)
Tag oracleSide-channel to determine tag (timing, error messages)
In-bounds exploitStay within same tagged region (use relative offsets)
Tag bypass gadgetUse LDGM/STGM instructions if accessible
Speculative executionSpectre-style bypass of tag check

10. DECISION TREE

Binary analysis: checksec output
├── NX disabled?
│   └── Shellcode on stack/heap (simplest path)
│
├── NX enabled (standard modern binary)?
│   ├── Need code execution → ROP/ret2libc
│   │
│   ├── Canary enabled?
│   │   ├── fork server? → byte-by-byte brute-force
│   │   ├── Format string? → leak canary via %p
│   │   ├── Heap vuln? → canary doesn't protect heap
│   │   └── Partial RELRO? → overwrite __stack_chk_fail@GOT
│   │
│   ├── PIE enabled?
│   │   ├── Format string? → leak .text address → PIE base
│   │   ├── Partial overwrite → last 12 bits fixed (1/16 brute-force)
│   │   └── OOB read? → leak code pointer
│   │
│   ├── ASLR enabled?
│   │   ├── Info leak available → leak libc base
│   │   ├── No leak → ret2dlresolve or SROP
│   │   ├── 32-bit? → brute-force feasible (~4096 attempts)
│   │   └── Return-to-PLT (no libc base needed for PLT calls)
│   │
│   ├── RELRO level?
│   │   ├── None/Partial → GOT overwrite
│   │   └── Full → alternative targets:
│   │       ├── glibc < 2.34 → __malloc_hook / __free_hook
│   │       ├── glibc ≥ 2.34 → _IO_FILE / exit_funcs / TLS_dtor_list
│   │       ├── .fini_array (if writable)
│   │       └── Stack return address
│   │
│   └── FORTIFY_SOURCE?
│       ├── Blocks positional %n → use sequential %n or heap exploit
│       └── Blocks buffer overflows in fortified functions → use unfortified paths
│
├── CET (shadow stack)?
│   ├── ROP blocked → data-only attack or JOP
│   └── ENDBR-gadget chaining
│
└── MTE (ARM)?
    ├── 1/16 brute-force
    └── Stay in-bounds for relative corruption

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.4%
按下载量换算737

Claude

31.87%
按下载量换算704

Cursor

20.53%
按下载量换算453

Gemini CLI

8.39%
按下载量换算185

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills