Esta pagina se ve mejor con JavaScript habilitado

Instalación de GDB-gef en FreeBSD

 ·  🎃 kr0m

Gef es un set de comandos y ayudas visuales que hacen que GDB sea mucho mas atractivo, es muy similar a peda pero gef soporta mas arquitecturas X86, ARM, MIPS, PowerPC y SPARC de este modo si hacemos reversing de firmwares también nos servirá ya que la mayoría de sistemas empotrados llevan un microprocesador MIPS o ARM. Está muy enfocado al reversing pero para debugear también nos será de gran ayuda.

Instalamos el software necesario, yo lo estoy haciendo bajo FreeBSD pero en Gentoo es muy similar:

pkg install gdb py37-keystone-engine py37-unicorn py37-capstone py37-ropper

Como usuario regular instalamos Gef:

fetch https://github.com/hugsy/gef/raw/master/gef.py
mv gef.py .gdbinit-gef.py
echo source ~/.gdbinit-gef.py » ~/.gdbinit

Arrancamos GDB:

gdb

GNU gdb (GDB) 9.2 [GDB v9.2 for FreeBSD]  
Copyright (C) 2020 Free Software Foundation, Inc.  
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>  
This is free software: you are free to change and redistribute it.  
There is NO WARRANTY, to the extent permitted by law.  
Type "show copying" and "show warranty" for details.  
This GDB was configured as "x86_64-portbld-freebsd12.1".  
Type "show configuration" for configuration details.  
For bug reporting instructions, please see:  
<http://www.gnu.org/software/gdb/bugs/>.  
Find the GDB manual and other documentation resources online at:  
    <http://www.gnu.org/software/gdb/documentation/>.  
  
For help, type "help".  
Type "apropos word" to search for commands related to "word".  
GEF for freebsd ready, type `gef' to start, `gef config' to configure  
80 commands loaded for GDB 9.2 [GDB v9.2 for FreeBSD] using Python engine 3.7  
gef➤

En una sesión de debug Gef se vé del siguiente modo:

Para actualizarlo es tan sencillo como ejecutar:

python ~/.gdbinit-gef.py --update

Si te ha gustado el artículo puedes invitarme a un RedBull aquí