Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
rustbof — A Rust template for writing Beacon Object Files (BOFs) | Kitploit
Tools/GitHubGitHub/joaoviictorti/rustbof
Post-ExploitationCommand and ControlRed TeamingPayload Development
GitHubjoaoviictorti/rustbof

rustbof

A Rust template for writing Beacon Object Files (BOFs)

View Repository
129126 months agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

rustbof

Rust License

This project enables the development of BOFs using Rust with full no_std support. It leverages Rust's safety features and modern tooling while producing small, efficient COFF objects.

The framework provides everything needed for BOF development. The build process compiles your code to a static library, which boflink then links into a COFF object with proper relocations and imports for Beacon's dynamic function resolution.

Requirements

  • Rust nightly
  • boflink
  • cargo-make

Quick Start

The easiest way to get started is using the project template with cargo-generate. This will create a new BOF project with all the necessary configuration already set up:

root@kitploit:~
cargo generate --git https://github.com/joaoviictorti/rustbof .template
cd <project-name>
cargo make

Alternatively, you can clone the repository and explore the examples/ directory, which contains working BOF implementations demonstrating various use cases. These examples serve as practical references for building your own BOFs.

root@kitploit:~
git clone https://github.com/joaoviictorti/rustbof
cd rustbof/examples/whoami
cargo make

You can also use Docker to build without installing the toolchain locally:

root@kitploit:~
git clone https://github.com/joaoviictorti/rustbof
cd rustbof
docker build -t rustbof .
docker run -it rustbof

Usage

The #[rustbof::main] attribute macro generates the entry point required by BOF loaders. Your main function can be simple with no arguments, or receive raw argument data for parsing.

A basic BOF that prints a message:

root@kitploit:~
#![no_std]

use rustbof::println;

#[rustbof::main]
fn main() {
    println!("Hello from Rust BOF!");
}

For BOFs that need to receive arguments, use DataParser to extract typed values from the raw argument buffer:

root@kitploit:~
#![no_std]

use rustbof::println; 
use rustbof::data::DataParser;

#[rustbof::main]
fn main(args: *mut u8, len: usize) {
    let mut parser = DataParser::new(args, len);
    let name = parser.get_str();
    println!("Hello, {name}!");
}

Examples

The examples directory contains working BOFs: whoami, ipconfig and env.

License

rustbof is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rustbof by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.

Download Tool