This commit is contained in:
trickster0
2021-09-28 00:55:18 +03:00
parent 1183c97133
commit de8bde70bc
4 changed files with 40 additions and 0 deletions
@@ -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]
@@ -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();
}
+10
View File
@@ -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"}
+12
View File
@@ -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()));
}