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.
Metadata
Release files for donut-decryptor 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| donut_decryptor-0.1.1.tar.gz | 30.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| donut_decryptor-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.8 MB
Release files / donut_decryptor-0.1.1.tar.gz
| Download URL | donut_decryptor-0.1.1.tar.gz |
|---|---|
| Size | 30.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e2cfa26febbba5a0460a148844ebcc26329b1d7dbf3d360e4261e958396500f
|
|
BLAKE2b-256 checksum How to use checksums |
95c105122a5e5e877133999aa041224317628284eef19abe45cbb0a399329f7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 12, 2026.
Transparency logRelease files / donut_decryptor-0.1.1-py3-none-any.whl
| Download URL | donut_decryptor-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3539ee7e6206b047ac91ed16f4eb35e9147b79a08f41a9d3a3d20c716a7fd85c
|
|
BLAKE2b-256 checksum How to use checksums |
fe190c56c4fe302f55f7091950896560b77b4d460070c85dd220538a464c42ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 12, 2026.
Transparency log