From 3f1855cf5b84df2168bc50da2f54aac0cee44817 Mon Sep 17 00:00:00 2001 From: jarilaos <32414258+jarilaos@users.noreply.github.com> Date: Mon, 12 Apr 2021 04:47:00 +0200 Subject: [PATCH] Interactive mode support It allows to execute Rubeus in an interactive mode. It is useful to avoid the command line process auditing functionality. It switches to interactive mode only when no command line arguments have been input as mimikatz does. It is also useful if you want to use it with loaders which inject the process into memory such as PEzor. Although Donut already allows hardcoding arguments, it is not efficient generating a binary for each command. This condition (&& args[0] != "") is just to make it work properly with PEzor. I don't know why but the loader adds an empty first argument. It has no impact on the normal behavior. --- Rubeus/Program.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Rubeus/Program.cs b/Rubeus/Program.cs index 1b643297..9bc5d859 100755 --- a/Rubeus/Program.cs +++ b/Rubeus/Program.cs @@ -93,7 +93,7 @@ public static string MainString(string command) return output; } - public static void Main(string[] args) + public static void MainArgs(string[] args) { // try to parse the command line arguments, show usage on failure and then bail var parsed = ArgumentParser.Parse(args); @@ -119,5 +119,27 @@ public static void Main(string[] args) MainExecute(commandName, parsed.Arguments); } } + + public static void Main(string[] args) + { + if (args.Length > 0 && args[0] != "") + { + MainArgs(args); + } + else + { + string command; + do + { + Console.Write("Rubeus # "); + command = Console.ReadLine(); + if (command != "" && command != "exit") + { + args = command.Split(); + MainArgs(args); + } + } while (command != "exit"); + } + } } }