Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

GDB 'exploitable' plugin

Jonathan Foote

15 April 2015


  • Compatible x86/x86_64/ARM/MIPS Linux
  • Compatible GDB 7.2 or later
  • Python 2.7 or later (for

The 'exploitable' plugin (exploitable/

'exploitable' is a GDB extension that classifies Linux application bugs by severity. The extension inspects the state of a Linux application that has crashed and outputs a summary of how difficult it might be for an attacker to exploit the underlying software bug to gain control of the system. The extension can be used to prioritize bugs for software developers so that they can address the most severe ones first.

The extension implements a GDB command called 'exploitable'. The command uses heuristics to describe the exploitability of the state of the application that is currently being debugged in GDB. The command is designed to be used on Linux platforms and versions of GDB that include the GDB Python API. Note that the command will not operate correctly on core file targets at this time.

WARNING: This is an engineering tool. It has not been exhaustively tested, and has not been executed on many flavors of Linux! Please read and understand the classification rules (lib/ before use and modify the source code to suit your specific testing needs if necessary.


Global installation and usage

  1. Optionally, run integration tests:

     $ python test
  2. Install script to GDB data directory (probably as root)

     # python install
  3. Run the command

     (gdb) exploitable

Local usage

  1. Copy all files in this directory and its sub-directories to a sub-directory that is accessible from GDB

  2. Source the exploitable file as a script and run a command

     (gdb) source my-exploitable-dir/
     (gdb) exploitable

In many cases exploitable makes guesses and calculates values based on GDB's stack unwind. The extension will work best if GDB can find the debug symbols for binaries, especially libc.

Note that the extension's classification capability is significantly degraded when run in a GDB session with a core file target. When GDB is run against a core file, much of the information that the extension uses for classification is not present via conventional GDB APIs.


Smoke testing

This project includes test cases (tests/) that can be used as a starting point for testing the 'exploitable' command on new Linux platforms. A Makefile is included. Note that test case filenames generally correspond to the most exploitabile tag that should be applied to the test case, however, because Linux platforms handle errors differently, an exact correspondence will not exist for all of the test cases on most Linux platforms.

A few unit tests have been implemented in lib/gdb_wrapper/tests/ is meant to be invoked from GDB -- see comments in the file for details.

Integration testing

Integration tests for x86 and ARM platforms are located in test/ and test/, respectively. These tests are designed for use with, but can (and should) be run locally on an up-to-date Ubuntu x86_64 any time functional changes are made to the code. Note that, if not modified, requires access to a private AWS S3 bucket to install dependencies. Please contact the author if you require access to the S3 bucket.

To run the integration x86 tests, try this from the project root directory:

    $ ./tests/

Note that these tests are quite fragile and will (hopefully improve over time).

Tested platforms

At the time of this writing integration tests pass on the following platforms:

  • Ubuntu 13.10 32-bit, GDB 7.2
  • Ubuntu 13.10 64-bit, GDB 7.4
  • Ubuntu 13.10 64-bit, GDB 7.6
  • Travis-ci Ubuntu 64-bit, GDB 7.4

The authors of the GDB Python API tend to break backwards compatibility regularly, so beware.

Internals Overview

exploitable runs in GDB's Python interpreter (which depends on the Python C API) and uses GDB's Python API. For details, see:

exploitable iterates over a list of ordered "rules" (lib/ to generate a Classification (lib/ If the state of the application running in GDB matches a rule, exploitable adds a corresponding "tag" to the Classification. The result of an exploitable invocation is a Classification-- either printed to the GDB's stdout or stored to a pickle file, depending on command parameters.

The entry point for the GDB command is defined in Iteration over the rules is implemented by a Classifier object (lib/ The methods that determine whether a rule matches or not are contained in per-platform "analyzers" (lib/analyzers/). The state of the application is queried via a set of GDB API wrapper objects and methods (see lib/gdb_wrapper/ for details). A Classification (lib/ retains attributes for the "most exploitable" (lowest ordered) tag (matching rule), but it also includes an ordered list of all other matching tags.

Classification rule definitions, located in lib/, can be re-prioritized by simple cut/paste.


Please contribute your changes, fixes, and issues to the master branch at ! To help things go smoothly, please ensure that the integration tests (see test/ in the home directory) pass before you submit your code. Feel free to change the integration tests themselves if you are fixing bugs or adding features. Feel free to contact the author ( if you have any questions or feedback.

This package consists of a triage script and a GNU Debugger (GDB) extension named 'exploitable'. The triage script is a simple batch wrapper for the 'exploitable' GDB extension. The triage script is designed to prioritize bugs for software developers so that they can address the most severe ones first. For more information on the 'exploitable' GDB extension, see the 'exploitable' section below.

The triage script automates invocations of GDB and the 'exploitable' GDB extension. The script invokes a target application one or more times via GDB. Each invocation includes execution of the exploitable command. Results of the exploitable command are accumulated and a summary is printed to stdout.

WARNING: The triage script was written to address some specific testing needs, so it is not particularly robust or extensible. The script is being distributed as a starting point and example for writing a custom wrapper for the 'exploitable' extension.

In practice the triage script is meant to run an application with a set of crashing inputs that have been discovered via other means. If an application invocation does not cause GDB to break, the triage script will hang (CTRL-C to stop).

Note that some output from the application under test may be printed to the console as the triage script runs (particularly output from libc_message). Also note that the 'exploitable' extension will not operate correctly on core file targets at this time.


The triage script is designed to be invoked from this directory.

Print help

  1. From this directory, invoke triage

     python --help

Running included exploitable tests (Hello exploitable!)

  1. Build exploitable tests

     cd exploitable/tests && make && cd ../..
  2. Invoke triage with the tests as arguments

     python \$sub `find exploitable/tests/bin -type f`
  3. Cleanup test binaries

     cd exploitable/tests && make clean && cd ../..

Example application usage

  1. Invoke triage with application and crashing inputs as arguments. For example:

     python "jasper --input \$sub --output /dev/null" `find /mnt/foo/crashers -type f`

This example will invoke japser for each file in /mnt/foo/crashers.