Skip to main content

A tool generating and comparing control flow graphs of GO samples.

Project description

GoResolver

GoResolver is a Go analysis tool using both Go symbol extraction and Control Flow Graph (CFG) similarity to identify and resolve the function symbols of an obfuscated Go binary.

This tool supports all three major operating systems, Windows, MacOS and Linux as well as their respective executables formats, PE, ELF and Mach-O for the X86, AMD64, ARM and ARM64 architectures.

How to install

To install GoResolver, we recommend pulling directly from PyPi :

pip install goresolver

This will install GoResolver as well as its necessary dependencies.

As GoResolver may need differents Go version for its similairty analysis, you will also need to install base Go version (1.20.6 or superior) as a dependency.

See https://go.dev/dl/ to install the right Go version for your device.

Building from source

If you wish to build & install GoResolver from source instead, please follow the steps below :

Dependencies :

You will need to install base Go version (1.20.6 or superior). See https://go.dev/dl/ to install the right Go version for your device.

Build process :

To build GoResolver from source use Hatch's usual build command :

hatch build

The built archive will be placed in the "dist" directory as a .whl file. To install GoResolver, simply install the .whl file using pip.

pip install dist/goresolver-*.whl

Command Line Usage

Once installed, a new utility goresolver will be available.

usage: goresolver [-h] [-l [LIBS ...]] [-v [VERSIONS ...]] [-f] [-s] [-r COMPARE_REPORT] [-b BACKUP_PATH] [-o OUTPUT] [-t THRESHOLD] [-q] [-x] [-g] sample_path [reference_path]

positional arguments:
  sample_path                          Path to the GO sample to analyze.
  reference_path                       Path to the GO reference sample to compare to (if any).

options:
  -h, --help                           show this help message and exit
  -l, --libs [LIBS ...]                List of GO libs to include in the generated samples.
  -v, --go-version VERSION             The GO version to build the reference samples with.
  -f, --force                          Force build existing samples.
  -s, --show                           Show available go versions.
  -r, --compare-report COMPARE_REPORT  Path to an already generated GoGrapher report.
  -b, --backup-path BACKUP_PATH        Path where to save the intermediary GoGrapher report.
  -o, --output OUTPUT                  Path of the output JSON report.
  -t, --threshold THRESHOLD            Value at which matches are considered significant.
  -q, --quiet                          Reduce the amount of logs.
  -x, --extract                        Extract symbols from the Go sample.
  -g, --graph                          Compare the Go sample against generated references.

Here is a typical workflow using GoResolver :

goresolver "path/to/sample.exe" -o "path/to/report.json"

Options

-l, --libs [LIBS ...]                List of GO libs to include in the generated samples.
-v, --go-version VERSION             The GO version to build the reference samples with.

The --libs and --go-version options allows you to tweak which Go version and libraries are used to generate the reference sample.

By default, GoResolver will attempt to identify to GoVersion used to generate the sample and failing that test a range of Go version and select the closest one.

-t, --threshold THRESHOLD            Value at which matches are considered significant.

The --threshold allow you to tweak the confidence threshold necessary to consider symbols obtained through the graph algorithm in a range of 0.0 to 1.O. The default value is 0.9.

-x, --extract                        Extract symbols from the Go sample.
-g, --graph                          Compare the Go sample against generated references.

The --extract and --graph options allow you to toggle either algorithm in isolation. Best result are achieved when both options are turned on, which is the default behavior.

Plugins

GoResolver comes with plugins for both IDA and Ghidra in the Plugin directory of this repository. Theses plugins make using GoResolver in conjunction with theses tools easier, by giving an easy way to import reports generated by the CLI tool into their respective databases.

Both plugins share the same common directory. When installing one or the other be sure to copy the accompanying ida or ghidra files as well.

IDA

To install the IDA plugin copy the following files to the ~/.idapro/plugins/goresolver directory :

common/
goresolver_ida.py
ida-plugin.json
ida_config_form.py

Ghidra

To Install the Ghidra plugin copy the following files to your choosed plugin directory, Ex: ~/.ghidra/plugins/goresolver :

common/
goresolver_ghidra.py

Then add the directory to Ghidra's Script Manager.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goresolver-1.3.2.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goresolver-1.3.2-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file goresolver-1.3.2.tar.gz.

File metadata

  • Download URL: goresolver-1.3.2.tar.gz
  • Upload date:
  • Size: 40.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for goresolver-1.3.2.tar.gz
Algorithm Hash digest
SHA256 7d42318ad2f21b2b6bda3a58609c8ce92cb639296c839056176898d6c68fab32
MD5 4a1f4f8f9a678252d8a67c4ce82316ff
BLAKE2b-256 b42ff3e251993f06fd7299e2bf3f66bd891851290d9cf8e08c6365d3955c1f37

See more details on using hashes here.

Provenance

The following attestation bundles were made for goresolver-1.3.2.tar.gz:

Publisher: publish.yml on volexity/GoResolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file goresolver-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: goresolver-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for goresolver-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46d57932ac115bb7a333371eaee9d7bb4fb14ee0a55ab2c5fe0c6d4958d5ddcd
MD5 f5c5f0a5b9f9fe81530d27cc4f834429
BLAKE2b-256 3732caebfa91c9487266fd2b67927200ff1b91d623c06e42cb447beced511c7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for goresolver-1.3.2-py3-none-any.whl:

Publisher: publish.yml on volexity/GoResolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page