This directory provides a graphical user interface plugin for Ghidra to allow users to easily interact with and view progress of the Manticore symbolic execution engine for analysis of smart contracts and native binaries.
❗ATTENTION❗ This project is experimental and may be unstable or unusable for arbitrary use-cases and targets. Please open an issue if you have any difficulties using the existing features. We will consider new feature suggestions on a case-by-case basis. If possible, please open a pull request to improve or fix the project.
We require:
- An installation of Ghidra
- Python 3.7+ with versioned Python executable (e.g.
python3.7
) on PATH. The version is derived frompython3
command.- Must also have Python
shiv
tool accessible by same versioned Python executable, i.e.python3.7 -m shiv --version
) - It is easiest to use and activate a Python virtual environment (check out the
init-python
target in the justfile for commands needed to set up a virtual environment).
- Must also have Python
- Java JDK 11+
- Gradle
just
command runner
The plugin is built with Gradle. Be sure you have the Python requirements installed. The built plugin will be a zip
file in the MUI/dist
directory:
$ export GHIDRA_INSTALL_DIR=<path_to_ghidra_directory> $ just build
If you want to run the build commands manually, please take a look at the justfile.
ManticoreUI (MUI) requires a copy of Ghidra. We are currently developing against the latest release(s) (10.1.5
at time of writing).
Manticore only operates on native binaries within a Linux environment. The Ghidra plugin does not support EVM.
- Build MUI Ghidra
- Run Ghidra and navigate to
File -> Install Extensions
. Click the green+
in the top right, and select the builtMUI
extension zip inMUI/dist
- Restart Ghidra
The Ghidra plugin interacts with Manticore via the MUI Server, which is bundled with the plugin.
At its present form, MUI Ghidra manifests as three Ghidra components named MUI Setup
(used to specify args and run Manticore), MUI Log
, and MUI State List
(which together display Manticore output).
- To run Manticore on the current binary, open the
MUI Setup
component viaMUI -> Run Manticore
in the menu. - Fill in Manticore and program arguments in the
MUI Setup
component - Add desired Find, Avoid, Custom, or Global Hooks.
- Click the
Run
Button. - View log message output and a list of states and their statuses via the
MUI Log
/MUI State List
components which will be visible onRun
. Alternatively, you can open the components manually viaMUI -> Show Log / Show State List
in the menu.
- The
MUI Setup
component allows you to specify keymanticore
arguments - You may add additional arguments in the
Extra Manticore Arguments
field at the bottom of the panel - Click
Run
to being an instance of Manticore with your desired arguments - You may run multiple Manticore instances at once
- At present,
stdout
frommanticore
is output to the log - You may stop the execution of manticore and clear the log with the Stop and Clear buttons on the toolbar
- You can switch between Manticore instances by clicking on their respective log tabs
- Closing a log tab will stop the execution of the Manticore instance associated with it
- The State List displays the states and their statuses of the Manticore instance whose log tab is currently being viewed
- Switching log tabs will cause the State List to show the state list of the newly-focused Manticore instance
- You may click on the State statuses to expand a list of States with that status alongside their respective IDs
- At present, possible State statuses include
ACTIVE
,WAITING
,PAUSED
,FORKED
,COMPLETE
, andERRORED
- Right-clicking on an address/instruction in the Listing component (which displays the analyzed program's disassembly) will reveal two new Menu options:
MUI -> Toggle Find Instruction
andMUI -> Toggle Avoid Instruction
- Setting an address/instruction to
Find
will highlight it Green, and setting it toAvoid
will highlight it Red - Additionally, you may create a custom hook via
MUI -> Create Custom Hook at Address
, and a dialog where you can input Python code for the custom hook will be shown - Global hooks can be set via the Toolbar in
MUI -> Create Global Hook
, after which the same dialog to write Python code will be shown - You may delete set hooks via the Hook List component in the
MUI Setup
window
- Fork and clone the repo
- Install the GhidraDev plugin in Eclipse
- Import the project via
File -> Import -> General -> Projects from Folder or Archive
- Link your installation of Ghidra via
GhidraDev -> Link Ghidra
. The necessary.project
and.pydevproject
files will be generated for Eclipse. - Format your code with the included
MUI/GhidraEclipseFormatter.xml
(taken from upstream Ghidra) by runningjust format
with the tool just. - Copy the desired version of the
manticore_server
binary to theos/linux/x86_64
directory of the plugin. - When you first build the plugin, a gradle method will copy any common plugin resources to the
data
directory and the protobuf compiler binary will generate theManticoreServerGrpc.java
andManticoreServerOuterClass.java
files to serialize messages for communication with the server. - Quick plugin installation is enabled by the
just install
command.