From ffbf0dd466e2a284b18a6f611b8fb13807fb2e76 Mon Sep 17 00:00:00 2001 From: Elad Shamir Date: Tue, 8 Jun 2021 01:13:55 +0000 Subject: [PATCH] Add option to load certificate from base64 blob --- Rubeus/lib/Ask.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Rubeus/lib/Ask.cs b/Rubeus/lib/Ask.cs index c92114c9..28cb07e3 100755 --- a/Rubeus/lib/Ask.cs +++ b/Rubeus/lib/Ask.cs @@ -130,8 +130,16 @@ public static X509Certificate2 FindCertificate(string certificate, string storeP public static byte[] TGT(string userName, string domain, string certFile, string certPass, Interop.KERB_ETYPE etype, string outfile, bool ptt, string domainController = "", LUID luid = new LUID(), bool describe = false, bool verifyCerts = false) { try { + X509Certificate2 cert; - X509Certificate2 cert = FindCertificate(certFile, certPass); + if (Helpers.IsBase64String(certFile)) + { + cert = new X509Certificate2(Convert.FromBase64String(certFile), certPass); + } + else + { + cert = FindCertificate(certFile, certPass); + } if(cert == null) { Console.WriteLine("[!] Failed to find certificate for {0}", certFile);