Cyber security

GDBleed – Advanced Binary Instrumentation with GDB

GDBleed – Dynamic-Static binary instrumentation framework on top of GDB

GDBleed is a gdb wrapper exposing a set of commands for x86-64, ARM and MIPS (x86 and ARM thumb-mode in progress) architectures to perform binary instrumentation.

The objective was to exploit the hackish features of GDB python API, while ignoring the software performance attribute (for now). And in the end to have a user-friendly framework.

GDBleed focus is applicability, then we have efficiency. The more CPU archs it does suport the better it is.

Why?

  • “easy”-fast minimal static-dynamic code instrumentation supporting all main CPU archs
  • Framework based on tools with a strong community support: GDB, gcc, r2, keystone, LIEF, etc.
  • No control flow information is needed
  • ideal for IoT devices, why?
    • no binary instrumentation for MIPS
    • cross-compilation is boring (and if it works then it will break somewhere during the execution)
    • A lot of the new IoT devices still using old linux kernel versions not supporting EBPF

Usage

  • run gdb from the current folder
  • Start the process using start command or attach gdb to the debugged process
  • Run the command
source gdbleed.py
  • For more info take a look at the tests folder

Usage Of The Hooking functionalities

Req

  • Tested on ubuntu 20.04
  • Dep: keystone, LIEF

Installation

  • Install
# GEF gdb extension, ref https://github.com/hugsy/gef
sudo apt-get -y install unzip cmake binutils
  • Declare env vars
# python's version which your gdb intalled supports
export PYTHON_VER="python3"
sudo apt-get install ${PYTHON_VER}-distutils ${PYTHON_VER}-setuptools

# Choose module versions (i suggest not changing the major number version)
export KEYSTONE_VER="0.9.2"
export LIEF_VER="0.12.3"
  • From current folder run:
./setup.sh

Required for hooking/instrumentation also aka Inline GOT hooking

  • Install

export TARGET=arm-linux-gnueabi
sudo apt-get install -y binutils-${TARGET} gcc-${TARGET}

export TARGET=mips-linux-gnu
sudo apt-get install -y binutils-${TARGET} gcc-${TARGET}
  • add vim highlighting
augroup filetypedetect
  au! BufRead,BufNewFile *.c.bleed setfiletype c
augroup END
Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

4 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

4 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

4 weeks ago