> Purpose This document is a professional checklist for using GDB to understand, analyze, and assess exploitability of Android Native (ARM64) binaries and shared libraries. Target audience:
- Android Exploitation
- Native Debugging
- Vulnerability Research
- Android Security Research
- 01.Environment Preparation
- 02.Binary Reconnaissance (Before Running)
- 03.Starting GDB Session (Android)
- 04.Initial GDB Setup
- 05.Breakpoints and Flow Control
- 06.Execution Control
- 07.Registers Inspection (ARM64)
- 08.Stack Analysis
- 09.Heap Analysis
- 10.Crash and Segmentation Fault Analysis
- 11.Exploitability Assessment
- 12.Memory Protections Verification
- 13.Shared Library Debugging
- 14.Syscall and Low-Level Analysis
- 15.Post-Crash Actions
- 16.Documentation for GitHub
This checklist is explicitly designed for Android exploitation and native debugging. It is not a generic GDB reference.
Android-specific assumptions and context:
- Android Runtime and Native Layer (Bionic libc, linker, ART interaction)
- ARM64 (AArch64) calling conventions and register usage
- Android process model (zygote-spawned apps, isolated processes)
- Android-specific memory layout and mappings
- Use of
adbandgdbserverfor remote debugging - Debugging native binaries and shared libraries inside APKs
- Analysis of crashes originating from JNI, NDK code, or native services
Out of scope by design:
- Desktop Linux exploitation workflows
- Kernel exploitation
- Generic GDB command reference
- Non-ARM architectures unless explicitly stated
The goal of this document is to guide Android exploit developers and security researchers in reasoning about crashes, memory corruption, and exploitability using GDB in real Android environments.
Ensure the debugging environment is properly prepared before starting.
- Android device or emulator (ARM64)
- USB debugging enabled
adbworking correctlygdbinstalled on the hostgdbserveravailable on the devicepwndbgorgefconfigured- Binary compiled with:
-g-fno-omit-frame-pointer(if possible)
Initial static inspection of the binary before execution.
file binaryreadelf -l binarynm -C binaryreadelf -h binaryadb push binary /data/local/tmp/gdbserver :1234 ./binarygdb binary
target remote :1234adb shell ps -A | grep targetgdbserver :1234 --attach <PID>set architecture aarch64
set print pretty on
set pagination offb main
b vuln_function
b *0xADDRESS
run
continuesi# step one instruction
ni# next instruction
step# step into function
next# step over functioninfo registersAlways focus on:
pcspx0tox7(function arguments)x30(link register)
bt
x/40gx $spChecklist:
- Return address
- Stack frame layout
- Overwritten values
info proc mappings
x/32gx 0xHEAP_ADDRESSLook for:
- Heap corruption
- Use-after-free patterns
- Heap metadata overwrite
x/i $pc
info registersDetermine crash type:
- NULL pointer dereference
- Buffer overflow
- Use-after-free
- Double free
- Program counter control
- Register influence
- Stack or heap shaping
- ASLR bypass feasibility
- NX enforcement
- RELRO status
info proc mappingsreadelf -h binary | grep Type- Is the stack executable?
info sharedlibrary
b dlopen
info functionsx/i $pc- Syscall number:
x8 - Arguments:
x0tox5
- Save register state
- Save stack snapshot
- Dump relevant memory regions
- Document offsets and control points
Each vulnerability should include:
- Vulnerability description
- Root cause analysis
- Crash logs
- GDB outputs or screenshots
- Exploitability conclusion
- Mitigation notes
If you cannot explain the crash using only GDB output, you do not understand the bug.
GDB is not just a tool. It is the language exploit developers think in.
Use this checklist during:
- Capture The Flag competitions
- Native and Android bug bounty research
- Malware analysis
- Android exploitation research
This document is designed to be easily extended with advanced sections such as pwndbg, gef, real-world labs, and exploit walkthroughs.
This project is licensed under the MIT License - see the LICENSE file for details.
