From 10b91964b9389f8c6968f37a2d21b9516493cade Mon Sep 17 00:00:00 2001 From: HexRav3n <65924830+HexRav3n@users.noreply.github.com> Date: Mon, 30 Dec 2024 10:25:40 -0800 Subject: [PATCH] Update MgmtPointMessaging.cs Fixes an issue with "get secrets" in which the provided mediaGUID displays incorrect password due to the formatting stripping off the last character and keeping the "{" in the front of the parameter. Found from copying over pxethiefy output to sharpsccm to extract secrets from policies. --- lib/MgmtPointMessaging.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MgmtPointMessaging.cs b/lib/MgmtPointMessaging.cs index 486832f..1b5c0a6 100644 --- a/lib/MgmtPointMessaging.cs +++ b/lib/MgmtPointMessaging.cs @@ -572,7 +572,7 @@ public static async void SendPolicyAssignmentRequestWithExplicitData(string mach string szMediaGUIDPlain = szMediaGUID.Trim(new char[] { '{', '}' }); string szMediaGUIDCurlyBrackets = $"{{{szMediaGUIDPlain}}}"; - (MessageCertificateX509 signingCertificate, MessageCertificateX509 encryptioncertificate, SmsClientId _) = GetCertsAndClientId(null, null, szEncodedSigningCert, machineGUID, null, null, null, szMediaGUIDCurlyBrackets.Substring(0, 31)); + (MessageCertificateX509 signingCertificate, MessageCertificateX509 encryptioncertificate, SmsClientId _) = GetCertsAndClientId(null, null, szEncodedSigningCert, machineGUID, null, null, null, szMediaGUIDCurlyBrackets.Substring(1, 31)); if (signingCertificate == null) { return; @@ -840,4 +840,4 @@ public static X509Store StoreCertificate(X509Certificate2 certificate, string st return x509Store; } } -} \ No newline at end of file +}