Welcome to the Self-Deletion-Techniques directory of Rust-for-Malware-Development.
Tricks that let a running executable wipe itself off disk while it is still executing — no second process, no batch file, no admin rights.
Alternate_Data_Stream: Renames the binary into an NTFS alternate data stream that does not show up in normal directory listings, then marks the file for delete-on-close. Windows finishes the deletion the moment the last handle drops.
normal_techniques:
Straightforward self-delete patterns — batch-handoff, MoveFileEx with DELETE_ON_REBOOT, and similar. Some only fire under specific conditions, so pick the variant that matches your host.
git clone https://github.com/Whitecat18/Rust-for-Malware-Development.git
cd Rust-for-Malware-Development/Self-Deletion-Techniques
Each sub-folder is its own Cargo project. Build with cargo build --release.