diff --git a/Execute_Without_Create_Process/Cargo.toml b/Execute_Without_Create_Process/Cargo.toml new file mode 100644 index 0000000..6d1dc3b --- /dev/null +++ b/Execute_Without_Create_Process/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "Execute_Without_Create_Process" +version = "0.1.0" +edition = "2018" +author = "trickster0" +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/Execute_Without_Create_Process/src/main.rs b/Execute_Without_Create_Process/src/main.rs new file mode 100644 index 0000000..56b7d55 --- /dev/null +++ b/Execute_Without_Create_Process/src/main.rs @@ -0,0 +1,10 @@ +use std::process::Command; + +fn main() { + //executes process via cmd in the same process context with .output + if let Ok(command) = Command::new("cmd").arg("/c").arg("dir").output() { + println!("{}",String::from_utf8_lossy(&command.stdout)) + } + //Spawns a new process with .spawn + Command::new("notepad").spawn(); +} diff --git a/base64_system_enum/Cargo.toml b/base64_system_enum/Cargo.toml new file mode 100644 index 0000000..84956dc --- /dev/null +++ b/base64_system_enum/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "base64_system_enum" +version = "0.1.0" +edition = "2018" +author = "trickster0" +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +whoami = { git = "https://github.com/libcala/whoami" } +base64 = {version="0.13.0"} diff --git a/base64_system_enum/src/main.rs b/base64_system_enum/src/main.rs new file mode 100644 index 0000000..e18ff01 --- /dev/null +++ b/base64_system_enum/src/main.rs @@ -0,0 +1,12 @@ +use base64; +use whoami; + +fn main() { + let deviceName =base64::encode(&whoami::hostname()); + let userName =base64::encode(&whoami::username()); + let procNamePath = std::env::current_exe(); + println!("Hostname: {}\nEncoded Hostname: {}",whoami::hostname(),deviceName); + println!("Username: {}\nEncoded Username: {}",whoami::username(),userName); + println!("Executable Path: {:?}",procNamePath.unwrap()); + println!("Decoded Username: {:?}",String::from_utf8_lossy(&base64::decode("REVTS1RPUC1VNElFMEVF").unwrap())); +}