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.1.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.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: donut_decryptor-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5e2cfa26febbba5a0460a148844ebcc26329b1d7dbf3d360e4261e958396500f
MD5 02eda9914ffcbf244c46de6d5718933e
BLAKE2b-256 95c105122a5e5e877133999aa041224317628284eef19abe45cbb0a399329f7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for donut_decryptor-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for donut_decryptor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3539ee7e6206b047ac91ed16f4eb35e9147b79a08f41a9d3a3d20c716a7fd85c
MD5 668fa3778e01f088c56a9a82b3884365
BLAKE2b-256 fe190c56c4fe302f55f7091950896560b77b4d460070c85dd220538a464c42ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for donut_decryptor-0.1.1-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