binary-analysis
Analyzes binary files for vulnerabilities and develops exploits. Use when working with ELF/PE executables, pwn challenges, buffer overflow, heap exploitation, ROP chains, format string bugs, or shellcode development.
When & Why to Use This Skill
This Claude skill automates binary analysis and vulnerability research for ELF and PE executables. It streamlines the security auditing process by identifying dangerous functions, calculating offsets, and developing exploits using industry-standard tools like pwntools, ROPgadget, and checksec. It is designed to assist security researchers and developers in identifying critical flaws such as buffer overflows, heap exploitations, and format string bugs.
Use Cases
- CTF (Capture The Flag) Challenges: Rapidly analyzing pwn challenges to identify security protections and automate the discovery of exploitable vulnerabilities.
- Security Auditing & Penetration Testing: Performing deep-dive assessments on compiled binaries to find and validate memory corruption issues and logic flaws.
- Exploit Development: Streamlining the creation of Proof-of-Concept (PoC) exploits, including ROP chain construction, shellcode development, and offset calculation.
- Reverse Engineering: Analyzing suspicious or unknown executables to understand their security posture and identify potential entry points for exploitation.
| name | binary-analysis |
|---|---|
| description | Analyzes binary files for vulnerabilities and develops exploits. Use when working with ELF/PE executables, pwn challenges, buffer overflow, heap exploitation, ROP chains, format string bugs, or shellcode development. |
| allowed-tools | Bash, Read, Write, Grep, Glob |
Binary Analysis Skill
Quick Workflow
Progress:
- [ ] Run checksec (identify protections)
- [ ] Identify binary type and dangerous functions
- [ ] Find vulnerability (BOF/format string/heap)
- [ ] Calculate offsets
- [ ] Develop exploit with pwntools
- [ ] Test locally, then remote
Quick Analysis Pipeline
# 1. File identification
file <binary>
# 2. Security features
checksec --file=<binary>
# 3. Interesting strings
strings <binary> | grep -iE "flag|ctf|password|correct|wrong|win|shell|secret"
# 4. Function symbols
nm <binary> 2>/dev/null | grep -E " T | t " | head -20
# 5. Dangerous functions
objdump -d <binary> 2>/dev/null | grep -E "gets|strcpy|sprintf|scanf|system|exec"
# 6. Auto vulnerability scan
cwe_checker <binary>
Reference Files
| Topic | Reference |
|---|---|
| Protections & Vuln Detection | reference/protections.md |
| Exploitation Templates | reference/exploits.md |
| Advanced Tools | reference/tools.md |
Quick Commands
# Generate cyclic pattern
python3 -c "from pwn import *; print(cyclic(200))"
# Find offset
python3 -c "from pwn import *; print(cyclic_find(0x61616167))"
# Find ROP gadgets
ROPgadget --binary <binary> | grep "pop rdi"
# Find one_gadget
one_gadget <libc>
Tools Summary
| Tool | Purpose |
|---|---|
| checksec | Check binary protections |
| pwntools | Exploit development |
| ROPgadget | Find ROP gadgets |
| one_gadget | Find libc one-shot gadgets |
| cwe_checker | Auto vuln detection |
| qira | Runtime analysis |
| Triton | Symbolic execution |