# Exploiting Stack Buffer Overflows

Methodology for discovering and exploiting stack-based buffer overflows in native...

- Repository: https://github.com/xalgorix/xalgorix (1285 stars)
- Category: Security
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add xalgorix/xalgorix --skill exploiting-stack-buffer-overflows -g -a claude-code -y`
Codex: `npx skills add xalgorix/xalgorix --skill exploiting-stack-buffer-overflows -g -a codex -y`
Cursor: `npx skills add xalgorix/xalgorix --skill exploiting-stack-buffer-overflows -g -a cursor -y`
Gemini CLI: `npx skills add xalgorix/xalgorix --skill exploiting-stack-buffer-overflows -g -a gemini-cli -y`

## Description

Methodology for discovering and exploiting stack-based buffer overflows in native binaries during authorized engagements, covering crash triage, offset discovery with De Bruijn patterns, control of the saved return address, and escalation paths (ret2win, stack shellcode, ROP) depending on which mitigations are present.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Exploiting Stack Buffer Overflows

## When to Use

- During authorized binary exploitation assessments, CTF-style engagements, or vulnerability research where a native
  program (ELF/PE) copies attacker-controlled data onto the stack without bounds checking.
- When a target uses unsafe functions such as `strcpy`, `strcat`, `sprintf`, `gets`, or misuses length-taking functions
  like `fgets`, `read`, `memcpy`, or `sscanf` with an unbounded `%s`.
- When a service crashes with a `Segmentation Fault` after large input, and you need to determine whether the saved
  return address (EIP/RIP) is controllable.
- As the entry-point methodology that feeds into ret2win, stack shellcode, ret2libc, ret2syscall, and ROP techniques.

## Critical: Concepts/Steps Most Often Missed

The rest: https://github.com/xalgorix/xalgorix/blob/HEAD/internal/tools/skills/data/binary-exploitation/exploiting-stack-buffer-overflows/SKILL.md
