AngrgDB : Use Angr Inside GDB

AngrgDB use angr inside GDB. Create an angr state from the current debugger state.

Install

pip install angrgdb
echo “python import angrgdb.commands” >> ~/.gdbinit

Usage

AngrgDB implements the angrdbg API in GDB.

You can use it in scripts like this:

from angrgdb import *

gdb.execute(“b *0x004005f9”)
gdb.execute(“r aaaaaaaa”)

sm = StateManager()
sm.sim(sm[“rax”], 100)

m = sm.simulation_manager()
m.explore(find=0x00400607, avoid=0x00400613)

sm.to_dbg(m.found[0]) #write input to GDB

gdb.execute(“x/s $rax”)
#0x7fffffffe768: “ais3{I_tak3_g00d_n0t3s}”
gdb.execute(“c”)
#Correct! that is the secret key!

You can also use angrgdb commands directly in GDB for simple stuffs:

  • angrgdb sim <register name> [size] Symbolize a register
  • angrgdb sim <address> [size] Symbolize a memory area
  • angrgdb list List all items that you setted as symbolic
  • angrgdb find <address0> <address1> ... <addressN> Set the list of find targets
  • angrgdb avoid <address0> <address1> ... <addressN> Set the list of avoid targets
  • angrgdb reset Reset the context (symbolic values and targets)
  • angrgdb run Generate a state from the debugger state and run the exploration
  • angrgdb shell Open an shell with a StateManager instance created from the current GDB state
  • angrgdb interactive Generate a state from the debugger state and explore by hand using a modified version of angr-cli

An example crackme solve using angrgdb+GEF+idb2gdb:

Loading Scripts In GDB

This is a tip if you don’t want to use angrgdb from the cli but you want to use a python script. To load a script in GDB use source script.py.

TODO

  • add remote angrdbg like in IDAngr
R K

Recent Posts

Kali Linux 2024.4 Released, What’s New?

Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…

3 hours ago

Lifetime-Amsi-EtwPatch : Disabling PowerShell’s AMSI And ETW Protections

This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…

3 hours ago

GPOHunter – Active Directory Group Policy Security Analyzer

GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…

2 days ago

2024 MITRE ATT&CK Evaluation Results – Cynet Became a Leader With 100% Detection & Protection

Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…

5 days ago

SecHub : Streamlining Security Across Software Development Lifecycles

The free and open-source security platform SecHub, provides a central API to test software with…

1 week ago

Hawker : The Comprehensive OSINT Toolkit For Cybersecurity Professionals

Don't worry if there are any bugs in the tool, we will try to fix…

1 week ago