Skip to content

shaheeryasirofficial/Red-Team-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Red-Team-Rust

A structured collection of Rust notes for offensive security — covering language fundamentals through red team tooling and malware development patterns.

Blog   Rust   MIT License


About

This repository accompanies the Rust for Offensive Security blog series. It is intended for security researchers, red teamers, and developers who want a practical, ground-up understanding of Rust in the context of offensive tooling and systems programming.

The full write-ups, explanations, and code walkthroughs are published on the blog:

📖 top-gun-diary.gitbook.io/blog/rust-series


Topics Covered

Rust for Offensive Security

Read →

  • Why Rust for red teaming and exploit development
  • Memory safety advantages over C/C++
  • AV/EDR evasion properties of Rust binaries
  • Threat actors using Rust in real-world campaigns
  • Installing Rust, VS Code, and the rust-analyzer extension
  • Writing and running your first Rust program

Rust Fundamentals

Read →

Tooling & Project Structure

  • Cargo — build system and package manager
  • Cargo.toml — project configuration and dependencies
  • Cargo.lock — reproducible builds and supply-chain awareness
  • Crates — Rust libraries and how to add them

Language Basics

  • The main function and macros (println!, print!)
  • Escape sequences and output formatting
  • Single-line and multi-line comments
  • Variables and mutability (let, mut)
  • Scalar data types — integers (i32, u8, etc.), floats (f64), char, bool
  • String types — &str vs owned String
  • Constants (const)
  • Arithmetic, comparison, logical, and assignment operators

Control Flow

  • if, else if, else
  • if as an expression
  • match — pattern matching and return values
  • loop, while, for loops
  • break, continue, and returning values from loops

Functions & Scope

  • Defining and calling functions
  • Parameters and return values
  • Omitting the return keyword
  • Variable scope and block-level lifetimes
  • Shadowing

Memory Model

  • Ownership — the three rules
  • Move semantics and copy types
  • Cloning with .clone()
  • Borrowing and references (&, &mut)
  • Mutable reference rules

Data Structures

  • Arrays — fixed-size, indexed access, iteration
  • Vectors — dynamic lists, push, pop, insert, remove
  • Tuples — mixed-type grouping, destructuring, returning multiple values
  • HashMaps — key-value storage, insert, get, remove, iteration
  • Structs — custom types, field access, mutation
  • Enums — variants, matching, enums with data

Offensive & Systems Programming (progressively added)

  • Low-level memory manipulation
  • Red team tooling patterns
  • Malware-oriented Rust techniques
  • AV/EDR evasion concepts

Purpose

This project exists for anyone who wants to:

  • Learn Rust from a security-first perspective
  • Build reliable red team tools with fewer runtime surprises
  • Understand why Rust is replacing C/C++ in modern offensive operations
  • Strengthen systems programming fundamentals

Contributing

Contributions are welcome — whether it's fixing a typo, adding a topic, or sharing a better code example. Open a PR or raise an issue.


License

Licensed under the MIT License.


Made by ShaheerYasir

About

A beginner-friendly collection of Rust notes focused on Red Team Tooling • Malware Development • Systems Programming • Rust Fundamentals

Topics

Resources

License

Stars

Watchers

Forks

Contributors