performing-binary-exploitation-analysis
Fungsinya
Alat ini membantu menemukan celah keamanan pada program komputer (file ELF) yang dapat memungkinkan penyerang menjalankan perintah. Alat ini mencari kerentanan buffer overflow dan membuat program kecil (exploit) untuk menunjukkan masalahnya.
Kapan dipakai
- ✓Saat menguji keamanan sebuah program dengan izin.
- ✓Saat mengikuti kompetisi keamanan (CTF).
- ✓Saat memeriksa apakah pertahanan program terhadap serangan berfungsi dengan baik.
Link skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-binary-exploitation-analysis/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Analisis program ini untuk mencari celah keamanan dan buatkan contoh cara memanfaatkannya.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Alat ini menggunakan utilitas seperti `checksec` untuk melihat proteksi program dan `pwntools` untuk membuat serangan. Alat ini mengidentifikasi titik di mana program gagal, lalu membuat kode yang memanfaatkan celah tersebut untuk menjalankan perintah.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Performing Binary Exploitation Analysis
For authorized security testing and CTF challenges only.
Analyze ELF binaries for exploitation vectors using checksec, ROPgadget, and pwntools for buffer overflow and ROP chain development.
When to Use
- Analyzing ELF binaries during authorized penetration tests to identify memory corruption vulnerabilities
- Solving binary exploitation challenges in CTF competitions
- Evaluating the effectiveness of compiler mitigations (NX, ASLR, stack canaries, PIE, RELRO) on target binaries
- Developing proof-of-concept exploits for vulnerability reports to demonstrate impact
- Training security engineers in exploit development techniques for defensive awareness
- Validating that security patches for buffer overflow vulnerabilities are effective
Do not use against systems without explicit written authorization. Binary exploitation techniques can cause system instability and must only be applied in controlled environments (lab VMs, CTF platforms, authorized pentests with scope documents).
Prerequisites
- Linux system (Ubuntu/Debian recommended) for exploit development
- Python 3.8+ with
pwntools(pip install pwntools) - GDB with
pwndbgorGEFplugin for enhanced debugging ROPgadgetfor ROP chain gadget discovery (pip install ROPgadget)checksec(included with pwntools or standalone viaapt install checksec)- Target vulnerable binary compiled for testing (e.g., from pwnable.kr, ROP Emporium, or custom test binaries)
- Basic understanding of x86/x86_64 calling conventions and stack layout
Workflow
Step 1: Install the Exploitation Toolkit
# Install pwntools and dependencies
pip install pwntools ROPgadget
# Install GDB with pwndbg plugin
git clone https://github.com/pwndbg/pwndbg
cd pwndbg && ./setup.sh
# Alternatively, install GEF (GDB Enhanced Features)
# bash -c "$(curl -fsSL https://gef.blah.cat/sh)"
# Install supporting tools
sudo apt install -y gdb nasm gcc-multilib libc6-dbg
# Verify installation
python3 -c "from pwn import *; print('pwntools version:', version)"
checksec --version
ROPgadget --version
Step 2: Analyze Binary Protections with checksec
Before writing any exploit, enumerate the security mitigations compiled into the binary:
from pwn import *
# Load the target binary
binary_path = "./vulnerable_server"
elf = ELF(binary_path)
# checksec output explains what mitigations are in place
print(f"Architecture: {elf.arch}")
print(f"Bits: {elf.bits}")
print(f"Endianness: {elf.endian}")
print()
# Key security properties
# RELRO: Full = GOT is read-only, Partial = GOT header read-only, No = writable GOT
# Stack Canary: Detects stack buffer overflows via random canary value
# NX (No-eXecute): Prevents executing code on the stack (DEP)
# PIE: Position Independent Executable, randomizes base address
# ASLR: OS-level address randomization (check /proc/sys/kernel/randomize_va_space)
# Also available via command line:
# checksec --file=./vulnerable_server
# Command-line checksec output example:
checksec --file=./vulnerable_server
# RELRO STACK CANARY NX PIE
# Partial RELRO No canary found NX disabled No PIE
# Check ASLR status on the system
cat /proc/sys/kernel/randomize_va_space
# 0 = disabled, 1 = conservative, 2 = full randomization
Step 3: Find the Buffer Overflow Offset
Determine exactly how many bytes are needed to overwrite the return address:
from pwn import *
context.binary = ELF("./vulnerable_server")
context.log_level = "info"
# Method 1: Use cyclic pattern to find exact offset
# Generate a unique cyclic pattern
pattern_length = 200
pattern = cyclic(pattern_length)
print(f"Generated cyclic pattern of length {pattern_length}")
# Send the pattern to the binary
p = process("./vulnerable_server")
p.sendline(pattern)
p.wait()
# After the crash, read the value in RIP/EIP from core dump or GDB
# Then find the offset:
# For 64-bit: crashed_value = p.corefile.fault_addr
# Or manually from GDB: "info registers rip" after crash
crashed_rip = 0x6161616c # Example value from crash
offset = cyclic_find(crashed_rip)
print(f"Offset to return address: {offset} bytes")
# Method 2: Use GDB with pwndbg to find offset interactively
# In GDB:
# pwndbg> cyclic 200
# pwndbg> run < <(python3 -c "from pwn import *; print(cyclic(200).decode())")
# pwndbg> cyclic -l $rsp (or cyclic -l <value in RIP>)
…
Pertanyaan umum
Apa itu file ELF?
Ini adalah jenis file eksekusi yang umum di sistem Linux dan Unix, seperti program yang Anda jalankan di komputer.
Apa itu 'buffer overflow'?
Ini adalah celah ketika program mencoba menulis data lebih banyak ke area memori daripada yang bisa ditampungnya, sehingga berpotensi menimpa informasi penting dan membuka jalan bagi eksekusi kode berbahaya.
Apa itu ROP (Return-Oriented Programming)?
Ini adalah teknik lanjutan yang digunakan ketika program memiliki proteksi yang mencegah eksekusi kode secara langsung. Sebagai gantinya, penyerang 'merangkai' potongan-potongan kode yang sudah ada di dalam program untuk mencapai tujuan yang diinginkan.
Detail
Deskripsi asli dari pembuat
Analyze ELF binaries for memory-corruption vulnerabilities and build proof-of-concept exploits using pwntools, checksec, and ROPgadget for buffer overflows and ROP chains. Use when a penetration test or CTF challenge requires evaluating compiler mitigations (NX, ASLR, stack canaries, PIE, RELRO) or developing a working exploit to demonstrate impact. '
Popularitas
- Bintang GitHub
- 35k
- Peringkat
- #8193
- Lisensi
- Apache-2.0
- Diperbarui
- 31/8/2026
Komentar
- …
Skill lain dari repositori ini
abusing-dpapi-for-credential-access
35kMemberi agent AI Anda instruksi siap pakai untuk tugas tertentu, sehingga hasilnya lebih baik dan pengerjaannya lebih cepat.
abusing-shadow-credentials-for-privesc
35kMengajarkan agent AI Anda menulis teks yang jelas dan terstruktur dengan baik.
achieving-cmmc-level-2-compliance
35kMembantu agent Anda menyiapkan lingkungan untuk kepatuhan CMMC Level 2. Skill ini menerapkan persyaratan keamanan dan mengelola dokumentasi yang diperlukan.
acquiring-disk-image-with-dd-and-dcfldd
35kMembantu agent Anda membuat salinan persis dari hard drive. Berguna untuk memastikan tidak ada informasi yang hilang atau berubah selama investigasi.
Skill serupa
reverse-engineer-anything
422kMembantu agent Anda memeriksa aplikasi dan paket yang sudah dirilis untuk menjelaskan fitur, membandingkan versi, atau memandu pembangunan ulang dengan alat REA.
1password
394kMembantu agent Anda mengatur CLI 1Password, masuk, serta membaca atau menyisipkan rahasia tanpa menampilkan nilainya di chat.
healthcheck
394kMembantu agent Anda mengaudit komputer atau server OpenClaw dari risiko keamanan seperti SSH, firewall, pembaruan, dan cadangan, lalu menyarankan perbaikan aman.