Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Cutter | 14,045 | 6 days ago | 475 | gpl-3.0 | C++ | |||||
Free and Open Source Reverse Engineering Platform powered by rizin | ||||||||||
Garbro | 1,816 | 6 days ago | 234 | mit | C# | |||||
Visual Novels resource browser | ||||||||||
Iaito | 1,537 | 6 years ago | 37 | gpl-3.0 | C++ | |||||
This project has been moved to: | ||||||||||
Dexcalibur | 944 | 2 | 8 months ago | 18 | September 27, 2021 | 30 | apache-2.0 | JavaScript | ||
[Official] Android reverse engineering tool focused on dynamic instrumentation automation leveraging Frida. It disassembles dex, analyzes it statically, generates hooks, discovers reflected methods, stores intercepted data and does new things from it. Its aim is to be an all-in-one Android reverse engineering platform. | ||||||||||
Sonyheadphonesclient | 793 | 17 days ago | 19 | mit | C++ | |||||
A {Windows, macOS, Linux} client recreating the functionality of the Sony Headphones app | ||||||||||
Pbtk | 783 | 3 years ago | 10 | gpl-3.0 | Python | |||||
A toolset for reverse engineering and fuzzing Protobuf-based apps | ||||||||||
Canalyzat0r | 593 | 4 years ago | gpl-3.0 | Python | ||||||
Security analysis toolkit for proprietary car protocols | ||||||||||
Fhex | 357 | 5 months ago | 2 | gpl-3.0 | C++ | |||||
A Full-Featured HexEditor compatible with Linux/Windows/MacOS | ||||||||||
Boomerang | 272 | 3 years ago | 34 | other | C++ | |||||
Boomerang Decompiler - Fighting the code-rot :) | ||||||||||
Resym | 213 | 4 months ago | 13 | apache-2.0 | Rust | |||||
Cross-platform tool that allows browsing and extracting C and C++ type declarations from PDB files. |
Protobuf is a serialization format developed by Google and used in an increasing number of Android, web, desktop and more applications. It consists of a language for declaring data structures, which is then compiled to code or another kind of structure depending on the target implementation.
pbtk (Protobuf toolkit) is a full-fledged set of scripts, accessible through an unified GUI, that provides two main features:
Extracting Protobuf structures from programs, converting them back into readable .protos, supporting various implementations:
Editing, replaying and fuzzing data sent to Protobuf network endpoints, through a handy graphical interface that allows you to edit live the fields for a Protobuf message and view the result.
PBTK requires Python ≥ 3.5, PyQt 5, Python-Protobuf 3, and a handful of executable programs (chromium, jad, dex2jar...) for running extractor scripts.
Archlinux users can install directly through the package:
$ yay -S pbtk-git
$ pbtk
On most other distributions, you'll want to run it directly:
# For Ubuntu/Debian testing derivates:
$ sudo apt install python3-pip git openjdk-9-jre libqt5x11extras5 python3-pyqt5.qtwebengine python3-pyqt5
$ sudo pip3 install protobuf pyqt5 pyqtwebengine requests websocket-client
$ git clone https://github.com/marin-m/pbtk
$ cd pbtk
$ ./gui.py
Windows is also supported (with the same modules required). Once you run the GUI, it should warn you on what you are missing depending on what you try to do.
The GUI can be lanched through the main script:
./gui.py
The following scripts can also be used standalone, without a GUI:
./extractors/jar_extract.py [-h] input_file [output_dir]
./extractors/from_binary.py [-h] input_file [output_dir]
./extractors/web_extract.py [-h] input_url [output_dir]
Let's say you're reverse engineering an Android application. You explored a bit the application with your favorite decompiler, and figured it transports Protobuf as POST data over HTTPS in a typical way.
You open PBTK and are greeted in a meaningful manner:
The first step is getting your .protos into text format. If you're targeting an Android app, dropping in an APK and waiting should do the magic work! (unless it's a really exotic implementation)
This being done, you jump to ~/.pbtk/protos/<your APK name>
(either through the command line, or the button on the bottom of the welcome screen to open your file browser, the way you prefer). All the app's .protos are indeed here.
Back in your decompiler, you stumbled upon the class that constructs data sent to the HTTPS endpoint that interests you. It serializes the Protobuf message by calling a class made of generated code.
This latter class should have a perfect match inside your .protos directory (i.e com.foo.bar.a.b
will match com/foo/bar/a/b.proto
). Either way, grepping its name should enable you to reference it.
That's great: the next thing is going to Step 2, selecting your desired input .proto, and filling some information about your endpoint.
You may also give some sample raw Protobuf data, that was sent to this endpoint, captured through mitmproxy or Wireshark, and that you'll paste in a hex-encoded form.
Step 3 is about the fun part of clicking buttons and seeing what happens! You have a tree view representing every field in the Protobuf structure (repeated fields are suffixed by "+", required fields don't have checkboxes).
Just hover a field to have focus. If the field is an integer type, use the mouse wheel to increment/decrement it. Enum information appears on hover too.
Here it is! You can determine the meaning of every field with that. If you extracted .protos out of minified code, you can rename fields according to what you notice they mean, by clicking their names.
Happy reversing! 👌 🎉
PBTK stores extracted .proto information into ~/.pbtk/protos/
(or %APPDATA%\pbtk\protos
on Windows).
You can move in, move out, rename, edit or erase data from this directory directly through your regular file browser and text editor, it's the expected way to do it and won't interfere with PBTK.
HTTP-based endpoints are stored into ~/.pbtk/endpoints/
as JSON objects. These objects are arrays of pairs of request/response information, which looks like this:
[{
"request": {
"transport": "pburl",
"proto": "www.google.com/VectorTown.proto",
"url": "https://www.google.com/VectorTown",
"pb_param": "pb",
"samples": [{
"pb": "!....",
"hl": "fr"
}]
},
"response": {
"format": "other"
}
}]
PBTK uses two kinds of pluggable modules internally: extractors, and transports.
Extractors are defined in extractors/*.py
. They are defined as a method preceded by a decorator, like this:
@register_extractor(name = 'my_extractor',
desc = 'Extract Protobuf structures from Foobar code (*.foo, *.bar)',
depends={'binaries': ['foobar-decompiler']})
def my_extractor(path):
# Load contents of the `path` input file and do your stuff...
# Then, yield extracted .protos using a generator:
for i in do_your_extraction_work():
yield proto_name + '.proto', proto_contents
# Other kinds of information can be yield, such as endpoint information or progress to display.
Transports are defined in utils/transports.py
. They are defined as a class preceded by a decorator, like this:
@register_transport(
name = 'my_transport',
desc = 'Protobuf as raw POST data',
ui_data_form = 'hex strings'
)
class MyTransport():
def __init__(self, pb_param, url):
self.url = url
def serialize_sample(self, sample):
# We got a sample of input data from the user.
# Verify that it is valid in the form described through "ui_data_form" parameter, fail with an exception or return False otherwise.
# Optionally modify this data prior to returning it.
bytes.fromhex(sample)
return sample
def load_sample(self, sample, pb_msg):
# Parse input data into the provided Protobuf object.
pb_msg.ParseFromString(bytes.fromhex(sample))
def perform_request(self, pb_data, tab_data):
# Perform a request using the provided URL and Protobuf object, and optionally other transport-specific side data.
return post(url, pb_data.SerializeToString(), headers=USER_AGENT)
The following could be coming for further releases:
I've tried to do my best to produce thoroughly readable and commented code (except for parts that are mostly self-describing, like connecting GUI signals) for most modules, so you can contribute.
As pbtk uses PyQt, it is released under the GNU GPL license (I, hereby, etc.) I would likely have chosen something public domain-like otherwise.
There's no formalized rule for the letter case of the project name, the rule is just about following your heart ❤