Skip to main content

Decryptor for files containing Donut shellcode

Project description

donut_decryptor

A configuration and module extractor for the donut binary obfuscator

Description

donut-decryptor checks file(s) for known signatures of the donut obfuscator's loader shellcode. If located, it will parse the shellcode to locate, decrypt, and extract the DONUT_INSTANCE structure embedded in the binary, and report pertinent configuration data. If a DONUT_MODULE is present in the binary it is decrypted and dumped to disk.

Installation

You can install donut-decryptor for usage by navigating to the root directory of the project and using pip:

cd /path/to/donut-decryptor
python -m pip install .

Following installation, a command-line script is available. For usage instructions use:

donut-decryptor --help

Development

This project uses Hatch for project management, Ruff for linting and formatting, and mypy for type checking.

Setup

Install Hatch:

pip install hatch

Running Tests

hatch run test
hatch run test-cov  # with coverage

Linting and Formatting

hatch run lint:style   # check style
hatch run lint:fmt     # format code and fix issues
hatch run lint:typing  # run mypy type checking
hatch run lint:all     # run all checks

Examples

The files present in the samples directory are 7z files password protected using the password `infected``, all of which contain donuts which can be decoded using this script.

TODO list

  • Update detection rules and instance parsing for alternative output formats:
    • Hex
    • C-String/Ruby
    • Python
    • C#
    • Powershell
  • Consider moving loader/instance mapping to a YAML configuration file.

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

donut_decryptor-0.1.0.tar.gz (30.8 MB view details)

Uploaded Source

Built Distribution

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

donut_decryptor-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file donut_decryptor-0.1.0.tar.gz.

File metadata

  • Download URL: donut_decryptor-0.1.0.tar.gz
  • Upload date:
  • Size: 30.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for donut_decryptor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec31e3bb4106d3208c8ec70b8c856a4bb4047ac79385b27e4a8dc304b954a2ba
MD5 7c88dafb2e3c1256fd7f7a1dfe346296
BLAKE2b-256 ad0a664bc77cb991387f309f473cb31e811c8be7dfdf4374e6f6fbcb8075045b

See more details on using hashes here.

Provenance

The following attestation bundles were made for donut_decryptor-0.1.0.tar.gz:

Publisher: publish.yml on volexity/donut-decryptor

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

File details

Details for the file donut_decryptor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for donut_decryptor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2be7282e60c1b8bedc91a2352119b993b27c3617e4ef3252c12402d1030f1a5
MD5 d2668da38f059c4bd5a2402e57016aae
BLAKE2b-256 b105bbc3d0a1896a044576b3fbf4eeb61f7eeaabb75dfde746988dd7e4cf6ee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for donut_decryptor-0.1.0-py3-none-any.whl:

Publisher: publish.yml on volexity/donut-decryptor

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