zebbern/secops-cli-guides/buffer-overflow-exploitation
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user asks to "exploit buffer overflow vulnerabilities", "develop stack-based exploits", "find EIP offset", "identify bad characters", "create shellcode payloads", "perform fuzzing for crashes", or "gain remote code execution via memory corruption". It provides comprehensive techniques for discovering and exploiting buffer overflow vulnerabilities in Windows applications.
Install
npx vskill@latest install zebbern/secops-cli-guides/buffer-overflow-exploitationSKILL.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:
Monitor in Immunity Debugger
- Attach Immunity Debugger to target process
- Press F9 to run the application
- Run fuzzer and note crash byte count
- Observe EIP value (should show
41414141for 'AAAA')
Phase 2: Finding EIP Offset
Generate Unique Pattern
Create a non-repeating pattern to identify exact offset:
Pattern saved to: C:\Program Files\Immunity Inc\Immunity Debugger\pattern.txt
Send Pattern to Application
Determine Offset
After crash, note EIP value from Immunity Debugger:
Result: Exact position found (e.g., offset 2006)
Verify Offset Control
Verify EIP shows 42424242 (BBBB) confirming offset control.
Phase 3: Bad Character Identification
Generate Bad Character Array
Create complete byte array for testing:
Output saved to: C:\Program Files\Immunity Inc\Immunity Debugger\bytearray.txt
Standard Bad Character Array
Send Bad Characters
Analyze in Immunity
- Right-click ESP register → Follow in Dump
- Examine hex dump for truncated or corrupted sequences
- Note character before corruption as bad character
Automated Bad Character Detection
Common Bad Characters
| Character | Hex | Description | |
|---|---|---|---|
| NULL | \x00 | String terminator | |
| LF | \x0a | Line feed | |
| CR | \x0d | Carriage return | |
| Space | \x20 | Whitespace delimiter |
Phase 4: Finding JMP ESP
Search for JMP ESP Instruction
Locate a reliable return address to redirect execution:
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:
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:
Phase 5: Shellcode Generation
Generate Reverse Shell Payload
Parameters Explained
| Parameter | Purpose | |
|---|---|---|
-p | Payload type | |
LHOST | Attacker IP for callback | |
LPORT | Attacker listening port | |
EXITFUNC=thread | Clean exit without crashing | |
-b | Bad characters to avoid | |
-e | Encoder for obfuscation | |
-f python | Output format | |
-v shellcode | Variable name |
Phase 6: Final Exploit Construction
Complete Exploit Template
Execute Exploit
Quick Reference
Mona Commands Cheatsheet
| Command | Purpose | |
|---|---|---|
!mona pattern_create LENGTH | Create unique pattern | |
!mona pattern_offset EIP | Find offset position | |
!mona bytearray | Generate byte array | |
!mona bytearray -cpb "\x00" | Exclude bad chars | |
!mona compare -f FILE -a ADDR | Compare memory | |
!mona jmp -r esp | Find JMP ESP | |
!mona modules | List loaded modules | |
!mona find -s BYTES -m MODULE | Search in module |
Exploitation Workflow Summary
Buffer Structure
Common Offsets Reference
| Application | Command | Offset | |
|---|---|---|---|
| VulnServer TRUN | TRUN . | 2006 | |
| MiniShare 1.4.1 | GET | 1787 | |
| PCMan FTP PORT | PORT | 2006 | |
| FreeFloat FTP USER | USER | 230 |
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:
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:
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:
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
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/buffer-overflow-exploitation/SKILL.md
Popularity
- Repository stars
- 30
- Repository forks
- 8
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 9 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zebbern/secops-cli-guides/buffer-overflow-exploitation)