How whitecat18/rust-for-malware-development works
Project Type & Purpose
• Type: An open-source collection of Rust Proof-of-Concepts (PoCs) for malware techniques, encryption methods, evasion, reverse shells, etc.
• Purpose: Provide red-teamers and researchers with standalone Rust crates demonstrating Windows-specific attack/injection/encryption techniques.
File Structure
• Root contains:
– Documentation: README.md, deps.md, CLEAN.md, docker.md
– Cross-compile container: Dockerfile
– Top-level folders, each housing one or more independent Cargo projects:
· Malware Techniques (e.g., Process-Injection, Process, Persistence, Evasion, BSOD, Keyloggers…)
· Encryption Methods
· Syscalls (direct, indirect, parallel, TartarusGate, RecycledGate)
· Enumeration, Dynamic_Resolver, Api_Hooking, Named_Pipe, Reverse Shell, etc.
• Each folder is a standalone Rust crate with its own Cargo.toml and src/.
Readme Insights
• Categorization: “Malware Techniques” vs “Encryption Techniques”
• Build process: compile per-crate with Cargo; optional Docker for cross-compilation; clean command via CLEAN.md.
• Dependencies: windows-rs, winapi, ntapi, custom assembly (.asm) for syscalls/trampolines.
• Interaction examples: Named pipe client/server, reverse-shell client/server, GitHub-API stealer.
Components & Interactions to Capture
a. Main Components
– Monorepo (Git)
– Category Groups (Malware Techniques, Encryption, Syscalls, Enumeration, etc.)
– Individual Crates (standalone Cargo projects)
– Build System (Cargo CLI, optional Docker container)
– External Dependencies (crates.io; GitHub repos for windows-rs, ntapi, etc.)
– Interactive Modules:
• Reverse Shell client ↔ server (TCP)
• Named Pipe client ↔ server (Windows IPC)
• GitHub API stealer ↔ GitHub service
b. Relationships & Data Flow
– Developer pulls the Git monorepo → runs cargo build per crate
– Optionally spins up Docker (via Dockerfile) for cross-compilation
– Crates import common Windows-API crates (windows-rs, ntapi)
– Interactive modules communicate over network or named pipes
c. Architectural Patterns
– Monolithic monorepo of micro-crates (no shared workspace manifest)
– One crate = one PoC executable or library
– Heavy use of low-level Windows API (dynamic resolver, direct syscalls)
d. Key Technologies
– Rust toolchain & Cargo
– WinAPI bindings (windows-rs, winapi-rs, ntapi)
– Inline assembly (.asm) for syscall stubs
– Docker for cross-compile (Dockerfile)
– Documentation scripts (deps.md, CLEAN.md)
Detailed Architectural Elements
– Monorepo Root
• README.md, Dockerfile, deps.md, CLEAN.md
– Build System
• Cargo (per-crate)
• Docker container (for cross-compile)
– Repo Categories
• Malware Techniques
• Process-Injection
• GhostingProcess
• Persistence/PPid_spoofing
• WaitingThreadHijacking
• …etc.
• Encryption Methods
• Aes_Encryption
• Khufu_encryption
• ecc_shellcode_exec
• payload_shuffling
• …etc.
• Syscalls
• direct_syscalls
• indirect_syscalls (rust_syscalls lib)
• parallel_syscalls
• TartarusGate
• RecycledGate
• Interactive Demos
• Reverse Shell: rev_shell (client), rev_receive (server)
• Named Pipe: pipe_client, pipe_server
• GitHub API stealer: stealer/GitHub_API
– External Crate Dependencies
• windows-rs, winapi-rs, ntapi, janoglezcampos/rust_syscalls, etc.
• The monorepo’s hierarchical layout
• Independent crate boundaries
• Build and packaging pipeline
• Network/IPC interactions for multi-component demos
• External dependency flows