From 09532466a634ba8d35170d65362fb0865c130eb6 Mon Sep 17 00:00:00 2001 From: anthemtotheego Date: Fri, 18 Feb 2022 08:24:13 -0600 Subject: [PATCH 1/2] Update Harvest.cs Removed System.Environment.Exit(0); and replaced with return; This allows you to run monitor or harvest mode inline (non sacrificial process) without it killing your process. --- Rubeus/lib/Harvest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rubeus/lib/Harvest.cs b/Rubeus/lib/Harvest.cs index ba2d8377..03582669 100755 --- a/Rubeus/lib/Harvest.cs +++ b/Rubeus/lib/Harvest.cs @@ -88,7 +88,7 @@ public void HarvestTicketGrantingTickets() if (collectionStart.AddSeconds(this.runFor) < DateTime.Now) { Console.WriteLine("[*] Completed running for {0} seconds, exiting\r\n", runFor); - System.Environment.Exit(0); + return; } } From 46b9d96b9cfc01732fce4bad7f9299f9d811e6b6 Mon Sep 17 00:00:00 2001 From: anthemtotheego Date: Fri, 18 Feb 2022 08:27:48 -0600 Subject: [PATCH 2/2] Update Helpers.cs Replaced System.Environment.Exit(1); with return null; This will prevent the process from being killed if ran inline (in a non sacrificial process). --- Rubeus/lib/Helpers.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rubeus/lib/Helpers.cs b/Rubeus/lib/Helpers.cs index ee2e0a1f..3427f055 100755 --- a/Rubeus/lib/Helpers.cs +++ b/Rubeus/lib/Helpers.cs @@ -59,7 +59,7 @@ public static byte[] StringToByteArray(string hex) if ((hex.Length % 16) != 0) { Console.WriteLine("\r\n[X] Hash must be 16, 32 or 64 characters in length\r\n"); - System.Environment.Exit(1); + return null; } // yes I know this inefficient @@ -564,4 +564,4 @@ static public List> GetADObjects(SearchResultCollect #endregion } -} \ No newline at end of file +}