Donut-rs
A spiritual successor for TheWover's Donut written in Rust
This crate provides the full API for building Donut-rs payloads. For the CLI tool, visit this link
[!WARNING] Currently only the Windows loader is supported. The Unix loader is currently gated behind the
unstablefeature due to unexpected segmentation faults. The Script loader is currently unavailable as well due to time constraints.
Using in other tools
- Via the
cargocli:
cargo add libdonut-rs
- Via
Cargo.toml:
= "0.1.0"
Features
| name | description |
|---|---|
loader |
Feature that enables the no_std loader components used for in-memory execution |
logging |
Enables verbose console logging (intended only for debugging since it's VERY noisy) |
libc |
Required by the (currently unstable) Unix loader. May be removed in the future |
unstable |
WIP components and features that are not yet ready for release |
std |
Enables the high-level API for generating and building payloads. Enabled by default. |
Example Usage
use io;
use ;
Known Issues
- Binaries built using Visual Studio (the
msvctoolkit in general) currently cause segfaults - Arguments aren't being passed to the executed binary
- Unix loader causes segfaults when run
- AV bypass still doesn't work
References
- Donut by TheWover
- sliver-stage-helper by Esonhugh (ty Eson <3)
- memexec
- Venom-rs
- https://landaire.net/reflective-pe-loader-for-xbox/
- https://wiki.chainreactors.red/blog/2025/01/07/IoM_advanced_TLS/
- https://github.com/ichildyu/load-elf
- https://github.com/b1tg/rust-windows-shellcode
- https://github.com/AWBroch/rsbmalloc
- https://github.com/hasherezade/pe_to_shellcode