diff --git a/src/malware/file.rs b/src/malware/file.rs index 4714913..85707dd 100644 --- a/src/malware/file.rs +++ b/src/malware/file.rs @@ -21,10 +21,8 @@ You can use `SET | more` or `Get-ChildItem Env:` to get the list use crate::malware::tools::{process_is_admin, regex_to_string}; use base64::engine::{general_purpose, Engine}; use clap::Parser; -use std::env; -use std::ffi::OsString; use std::io::Result as IOResult; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::time::Duration; use std::{thread, time}; @@ -33,27 +31,11 @@ pub struct FileCreate { #[clap( short = 'f', long, - required = false, + required = true, default_value = "", help = "Full path filename (regex)" )] filename: String, - #[clap( - short = 'v', - long, - required = false, - default_value = "", - help = "Use the CMD variable" - )] - cmd_var: String, - #[clap( - short = 'p', - long, - required = false, - default_value = "", - help = "Use the CMD path" - )] - cmd_path: String, #[clap( short = 'm', long, @@ -111,15 +93,6 @@ impl FileCreate { return 1; } - let fullname: String; - if self.filename.len() > 0 { - fullname = regex_to_string(&self.filename); - } else { - let filename: String = regex_to_string(&self.cmd_path); - let var_path: OsString = env::var_os(&self.cmd_var).unwrap(); - let full_path: PathBuf = Path::new(&var_path).join(filename); - fullname = String::from(full_path.to_string_lossy()); - } println!("Create a file on disk");