GitHub - hugsy/gef: GEF - GDB Enhanced Features for exploit devs & reversers
source link: https://github.com/hugsy/gef
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
GEF - GDB Enhanced Features
GEF
is a kick-ass set of commands for X86, ARM, MIPS, PowerPC and SPARC to
make GDB cool again for exploit dev. It is aimed to be used mostly by exploiters
and reverse-engineers, to provide additional features to GDB using the Python
API to assist during the process of dynamic analysis and exploit development.
It has full support for both Python2 and Python3 indifferently (as more and more
distros start pushing gdb
compiled with Python3 support).
Some of GEF
features include:
- One single GDB script.
- Entirely OS Agnostic, NO dependencies:
GEF
is battery-included and is installable in 2 seconds (unlike PwnDBG). - Fast limiting the number of dependencies and optimizing code to make the commands as fast as possible (unlike PwnDBG).
- Provides more than 50 commands to drastically change your experience in GDB.
- Easily extendable to create other commands by providing more comprehensible layout to GDB Python API.
- Works consistently on both Python2 and Python3.
- Built around an architecture abstraction layer, so all commands work in any GDB-supported architecture such as x86-32/64, ARMv5/6/7, AARCH64, SPARC, MIPS, PowerPC, etc. (unlike PEDA)
- Suited for real-life apps debugging, exploit development, just as much as CTF (unlike PEDA or PwnDBG)
Check out the Screenshot page for more.
Setup
Quick install
Simply make sure you have GDB 7.7 or higher.
# via the install script $ wget -q -O- https://github.com/hugsy/gef/raw/master/scripts/gef.sh | sh # manually $ wget -O ~/.gdbinit-gef.py -q https://github.com/hugsy/gef/raw/master/gef.py $ echo source ~/.gdbinit-gef.py >> ~/.gdbinit
Run
Then just start playing (for local files):
$ gdb -q /path/to/my/bin
gef➤ gef help
Or (for remote debugging):
remote:~ $ gdbserver 0.0.0.0:1234 /path/to/file
Running as PID: 666
And:
local:~ $ gdb -q
gef➤ gef-remote -t your.ip.address:1234 -p 666
Update
If your host/VM is connected to the Internet, you can update gef
easily to the
latest version (even without git
installed). with
python /path/to/gef.py --update
$ python ~/.gdbinit-gef.py --update
Updated
This will deploy the latest version of gef
's master branch from Github.
If no updates are available, gef
will respond No update
instead.
Install via Git
To install from Git, simply clone this repository and specify the path to
gef.py
inside the ~/.gdbinit
file:
$ git clone https://github.com/hugsy/gef.git $ echo source `pwd`/gef/gef.py >> ~/.gdbinit
If you like living on the edge, you can then switch to the dev
branch:
$ git checkout dev
Dependencies
There are none: GEF
works out of the box!
However, to enjoy all the coolest features from some commands, it is recommended to install:
For a quick installation, simply use the pip
packaged version:
# for Python2.x $ pip2 install capstone unicorn keystone-engine ropper # for Python3.x $ pip3 install capstone unicorn keystone-engine ropper retdec-python
Just make sure you are using the pip
corresponding to the version of Python
your GDB was compiled with. If you are experiencing issues installing them,
post an issue on the GitHub of the respective projects. If your bug is not
related to GEF
, you will not get an answer.
Additional commands
GEF was built to also provide a solid base for external scripts. The
repository gef-extras
is an open
repository where anyone can freely submit their own commands to extend GDB via
GEF's API.
To benefit from it:
# clone the repo $ https://github.com/hugsy/gef-extras.git # specify gef to load this directory $ gdb -ex 'gef config gef.extra_plugins_dir "/path/to/gef-extras/scripts"' -ex 'gef save' -ex quit [+] Configuration saved
You can also use the structures defined from this repository:
$ gdb -ex 'gef config pcustom.struct_path "/path/to/gef-extras/structs"' -ex 'gef save' -ex quit [+] Configuration saved
There, you're now fully equipped epic pwnage with all GEF's goodness!!
Bugs & Feedbacks
To discuss gef
, gdb
, exploitation or other topics, feel free to join the
##gef
channel on the Freenode IRC network. You can also to me (hugsy
) via the
channel. For those who do not have an IRC client (like weechat
or irssi
),
simply click here.
For bugs or feature requests, just go here and provide a thorough description if you want help.
Side Note: GEF
fully relies on the GDB API and other Linux-specific sources
of information (such as /proc/<pid>
). As a consequence, some of the features
might not work on custom or hardened systems such as GrSec.
Contribution
gef
was created and maintained by myself,
@_hugsy_
, but kept fresh thanks to all
the contributors.
Or if you just like the tool, feel free to drop a simple "thanks" on IRC, Twitter or other, it is always very appreciated.
Open-Source Rewards
I love Open-Source, and just like
my other projects
I've decided to offer a ? 4 ? (a.k.a beer4bugs) bounty for
GEF
, to thank everybody who helps keeping the project living and always
better.
The rule is simple, provide a (substantial) contribution to GEF
, such as:
- Submitting a Pull-Request for a new feature/command.
- Submitting a Pull-Request for a new architecture support.
- Or sending a relevant issue request (like a bug, crash, or else).
Poke me on the IRC ##gef
channel about it, and next time we meet in person
(like at a conference), I'll be happy to pay you a beer.
I do also accept beers if you think that the tool is cool! ?
Cheers ?
Happy Hacking
Recommend
-
22
During the recent Google Cloud Next conference, Object Computing, Inc. (OCI) announced...
-
6
The Microsoft Graph SDKs are designed to simplify building high-quality, efficient and resilient applications accessing Microsoft Graph. Integrate your app with the Microsoft Graph .NET SDK v4, now available in public preview, and leverage ne...
-
5
UbiquitiPosted on August 19, 2021WiFiman Introduces Enhanced Signal Tracking Features Last week, WiFiman received two powerful updates, including visual enhan...
-
6
China Airlines A333 at Taipei on Jun 14th 2020, all primary computers, reversers and autobrakes failed on touchdownIncident: China Airlines A333 at Taipei on Jun 14th 2020, all primary computers, reversers and autobrakes failed on touchdown
-
19
New features in Microsoft Graph Bookings APIs provide enhanced booking infrastructure December 21st, 2021 The Microsoft Graph team is committed to providing b...
-
3
Our slice of the metaverse: 7 key AR features for iOS devsJanuary 05, 2022 Augmented and virtual worlds are expanding, and someday soon, people will do many of the things they currently do in real life...
-
11
One small patch for GDB, one giant leap for reversers! One thing that really bothered me for a long time while debugging is the need to calculate the libraries loaded addresses versus the addresses at disk if you want to follow and co...
-
7
News Devs Sound Off on C# 11 Preview Features Like Parameter Null Checking By
-
6
As the developers of Bean Stalker we want to show you why our multiplayer is different, why it is important to...
-
12
Not FoundYou just hit a route that doesn't exist... the sadness.LoginRadius empowers businesses to deliver a delightful customer experience and win customer trust. Using the LoginRadius Identity...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK