Convert Figma logo to code with AI

longld logopeda

PEDA - Python Exploit Development Assistance for GDB

5,871
806
5,871
71

Top Related Projects

Modular visual interface for GDB in Python

6,915

GEF (GDB Enhanced Features) - a modern experience for GDB with advanced debugging capabilities for exploit devs & reverse engineers on Linux

7,493

Exploit Development and Reverse Engineering with GDB Made Easy

6,168

A hacky debugger UI for hackers

9,886

Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.

Quick Overview

PEDA (Python Exploit Development Assistance) is an enhanced GDB plugin for Linux that enhances the debugging experience with features tailored for exploit development and reverse engineering. It provides colorized and customizable output, memory analysis tools, and various helper functions to streamline the debugging process.

Pros

  • Enhances GDB with a more user-friendly interface and colorized output
  • Provides powerful memory analysis tools and pattern generation for exploit development
  • Includes helpful commands for assembly instruction analysis and register manipulation
  • Supports both x86 and x86-64 architectures

Cons

  • Limited to Linux environments and GDB
  • May have a learning curve for users not familiar with GDB or exploit development
  • Some features may not work correctly on certain system configurations
  • Requires manual installation and setup, which can be challenging for beginners

Getting Started

To install PEDA, follow these steps:

git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit

To use PEDA, simply run GDB as usual:

gdb ./your_binary

Once in GDB, you can use PEDA-specific commands, such as:

gdb-peda$ checksec
gdb-peda$ pattern create 100
gdb-peda$ dumpargs

These commands will show security features of the binary, create a cyclic pattern, and dump function arguments, respectively.

Competitor Comparisons

Modular visual interface for GDB in Python

Pros of gdb-dashboard

  • Cleaner, more modern interface with customizable modules
  • Lightweight and doesn't modify GDB's behavior
  • Easier to integrate with existing GDB workflows

Cons of gdb-dashboard

  • Less feature-rich compared to PEDA's extensive functionality
  • May require more manual configuration for advanced debugging tasks
  • Limited support for exploit development features

Code Comparison

PEDA:

def context_register():
    regs = peda.getregs()
    result = []
    for r in REGISTERS[peda.getarch()]:
        if r in regs:
            result.append("%s: 0x%x" % (r.upper().ljust(3), regs[r]))
    return result

gdb-dashboard:

def format_register(reg):
    try:
        value = gdb.parse_and_eval(f'${reg}')
        return f'{reg:<3} {value:#x}'
    except gdb.error:
        return f'{reg:<3} ??'

Both projects aim to enhance GDB's debugging experience, but they take different approaches. PEDA offers a comprehensive set of features for exploit development and reverse engineering, while gdb-dashboard focuses on providing a clean, customizable interface for general-purpose debugging. The choice between them depends on the user's specific needs and preferences in their debugging workflow.

6,915

GEF (GDB Enhanced Features) - a modern experience for GDB with advanced debugging capabilities for exploit devs & reverse engineers on Linux

Pros of GEF

  • More comprehensive feature set, including advanced memory analysis tools
  • Better support for modern architectures and debugging techniques
  • Actively maintained with frequent updates and improvements

Cons of GEF

  • Steeper learning curve due to more complex functionality
  • Potentially slower performance on older systems or with large binaries
  • Requires Python 3, which may not be available on all systems

Code Comparison

PEDA:

def context_register():
    regs = peda.getregs()
    result = ""
    for r in REGISTERS[peda.getarch()]:
        if r in regs:
            result += "%s: 0x%x\n" % (r.upper().ljust(3), regs[r])
    return result

GEF:

def context_regs():
    for regname in current_arch.all_registers:
        reg = gef.arch.register(regname)
        if reg is None:
            continue
        value = align_address(long(reg))
        gef_print("{:s} = {:#x}".format(regname, value))

Both examples show how each tool handles displaying register information, with GEF offering a more streamlined approach using architecture-specific functions.

7,493

Exploit Development and Reverse Engineering with GDB Made Easy

Pros of pwndbg

  • More actively maintained with frequent updates
  • Better integration with GDB, offering seamless debugging experience
  • Extensive feature set, including memory inspection and register tracking

Cons of pwndbg

  • Steeper learning curve due to more complex features
  • Heavier resource usage, which may impact performance on older systems

Code Comparison

pwndbg:

import gdb
class PwnDbg(gdb.Command):
    def __init__(self):
        super(PwnDbg, self).__init__("pwndbg", gdb.COMMAND_USER)

PEDA:

class PEDA(gdb.Command):
    def __init__(self):
        super(PEDA, self).__init__("peda", gdb.COMMAND_DATA)

Both projects extend GDB functionality, but pwndbg offers a more comprehensive approach to debugging and exploit development. PEDA is simpler and lighter, making it easier for beginners to get started. However, pwndbg's advanced features and active development make it a more powerful tool for experienced users. The code snippets show that both projects implement custom GDB commands, but pwndbg's implementation suggests a broader scope with its "COMMAND_USER" classification compared to PEDA's "COMMAND_DATA".

6,168

A hacky debugger UI for hackers

Pros of Voltron

  • More extensive debugging capabilities, supporting multiple debuggers and architectures
  • Highly customizable interface with modular views
  • Better suited for complex debugging scenarios and reverse engineering tasks

Cons of Voltron

  • Steeper learning curve due to more complex setup and configuration
  • May be overkill for simpler debugging tasks
  • Requires additional setup for some features compared to PEDA's out-of-the-box functionality

Code Comparison

PEDA (simple command):

gdb-peda$ pattern create 100
'AAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AAL'

Voltron (view setup):

import voltron
voltron.setup()
voltron.debugger.command('break main')
voltron.debugger.command('run')
voltron.view.register()
voltron.view.stack()
voltron.view.disasm()

Both tools enhance GDB debugging, but Voltron offers more flexibility and power at the cost of complexity, while PEDA provides a simpler, more accessible experience for basic debugging tasks.

9,886

Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.

Pros of gdbgui

  • Provides a modern, user-friendly web-based interface for GDB
  • Supports remote debugging and works across different platforms
  • Offers visual representations of data structures and memory

Cons of gdbgui

  • Requires additional setup and dependencies compared to PEDA
  • May have a steeper learning curve for users familiar with command-line GDB
  • Could be slower for quick debugging sessions due to its web-based nature

Code Comparison

PEDA (command-line interface):

gdb-peda$ break main
gdb-peda$ run
gdb-peda$ next
gdb-peda$ print variable

gdbgui (web-based interface):

// No direct code comparison available
// gdbgui uses a graphical interface with buttons and input fields
// Users interact with the debugger through the web UI

Summary

PEDA enhances the command-line GDB experience with additional features and colorized output, making it ideal for users comfortable with terminal-based debugging. gdbgui, on the other hand, offers a more visual and intuitive debugging experience through its web-based interface, which may be preferable for those who prefer graphical tools or are new to GDB. The choice between the two depends on personal preference, debugging requirements, and the specific development environment.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

peda

PEDA - Python Exploit Development Assistance for GDB

Key Features:

  • Enhance the display of gdb: colorize and display disassembly codes, registers, memory information during debugging.
  • Add commands to support debugging and exploit development (for a full list of commands use peda help):
    • aslr -- Show/set ASLR setting of GDB
    • checksec -- Check for various security options of binary
    • dumpargs -- Display arguments passed to a function when stopped at a call instruction
    • dumprop -- Dump all ROP gadgets in specific memory range
    • elfheader -- Get headers information from debugged ELF file
    • elfsymbol -- Get non-debugging symbol information from an ELF file
    • lookup -- Search for all addresses/references to addresses which belong to a memory range
    • patch -- Patch memory start at an address with string/hexstring/int
    • pattern -- Generate, search, or write a cyclic pattern to memory
    • procinfo -- Display various info from /proc/pid/
    • pshow -- Show various PEDA options and other settings
    • pset -- Set various PEDA options and other settings
    • readelf -- Get headers information from an ELF file
    • ropgadget -- Get common ROP gadgets of binary or library
    • ropsearch -- Search for ROP gadgets in memory
    • searchmem|find -- Search for a pattern in memory; support regex search
    • shellcode -- Generate or download common shellcodes.
    • skeleton -- Generate python exploit code template
    • vmmap -- Get virtual mapping address ranges of section(s) in debugged process
    • xormem -- XOR a memory region with a key

Installation

git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit
echo "DONE! debug your program with gdb and enjoy"

Screenshot

start

pattern arg

patts