GEF (pronounced ʤɛf - "Jeff") is a set of commands for x86/64, ARM, MIPS, PowerPC and SPARC to assist exploit developers and reverse-engineers when using old school GDB. It provides additional features to GDB using the Python API to assist during the process of dynamic analysis and exploit development. Application developers will also benefit from it, as GEF lifts a great part of regular GDB obscurity, avoiding repeating traditional commands, or bringing out the relevant information from the debugging runtime.
Run this commands
#Step (1)sudowget-O~/.gdbinit-gef.py-qhttps://raw.githubusercontent.com/hugsy/gef/dev/gef.py#Step (2)sudoechosource~/.gdbinit-gef.py>>~/.gdbinit#Step (3)# Add this inside ~/.gdbinitdefineinit-gefsource/root/.gdbinit-gef.pyenddocumentinit-gefInitializesGEF (GDB EnhancedFeatures)end#Step (4)# Create this in /usr/local/bin/gdb-gef#!/bin/shexecgdb-q-exinit-gef"$@"#Step (5)chmod+x/usr/local/bin/gdb-gef
#Step To install1.gitclone--recurse-submoduleshttps://github.com/rizinorg/rizin2.cdrizin3.sudomesonbuild4.sudomesoncompile-Cbuild5.sudomesoninstall-Cbuild#Incase if you want to uninstall (make sure inside rizin directory)sudoninja-Cbuilduninstall
Once done compile you should see something like this
Now we can use it!
rizin
#To attach the binaryrizin./challenge_elf#To analyze the binaryaa#To print, dissamble and see the functionpdf@mainpdf@main|grepcmp#To dispaly to numeric base? 0x149a
display Numeric Base
pdf @main with grep
rz-bin
Rz-bin is a powerful tool to handle binaries, to get information on imports, sections, headers and other data. It can present this information in several formats accepted by other tools, including rizin itself. rz-bin understands many file formats: Java CLASS, ELF, PE, Mach-O or any format supported by plugins, and it is able to obtain symbol import/exports, library dependencies, strings of data sections, xrefs, entrypoint address, sections, architecture type.
#To search for stringsrz-bin-z./challenge_elf
#To search for strings and this information is represented as a #rizin commands listrz-bin-zr./challenge_elf
#To get Binary Informationrz-bin-I./challenge_elf
#To get Binary Entrypointsrz-bin-e./challenge_elf
#To get list of imports on the binaryrz-bin-i./challenge_elf
# To get a list of exportsrz-bin-E/usr/lib/libettercap.so|head
# To get a list of symbols almost the same like importsrz-bin-s./challenge_elf
# To get a list of symbols and produces a rizin script insteadrz-bin-sr./challenge_elf|head
# To get list of libraryrz-bin-l./challenge_elf
# To get list of program sectionsrz-bin-S./challenge_elf
# To get list of program sections and produces a rizin script insteadrz-bin-Sr./challenge_elf
#Here is simple script to use everything easily (I name it ezrizin)# How to use?# ezrizin challenge_elf#!/bin/bashecho-e"\e[92m[Get Entrypoints]\e[39m"rz-bin-e $1echo-e"\n\e[92m[Get Strings Information]\e[39m"rz-bin-z $1echo-e"\n\e[92m[Get Binary Information]\e[39m"rz-bin-I $1echo-e"\n\e[92m[Get List of Import]\e[39m"rz-bin-i $1echo-e"\n\e[92m[Get List of Library]\e[39m"rz-bin-l $1echo-e"\n\e[92m[Get List of Program Sections]\e[39m"rz-bin-S $1