From 41cad0ee9fa8a18a77d68b696c2cc24d14e95352 Mon Sep 17 00:00:00 2001 From: b33f Date: Tue, 18 Jul 2017 13:08:31 +0100 Subject: Fix for edge case where System.Core is not loaded Make sure System.Core is loaded before creating an AES object. https://github.com/PowerShellMafia/PowerSploit/issues/247 --- Exfiltration/Get-GPPPassword.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Exfiltration/Get-GPPPassword.ps1 b/Exfiltration/Get-GPPPassword.ps1 index f7be74c..7703508 100644 --- a/Exfiltration/Get-GPPPassword.ps1 +++ b/Exfiltration/Get-GPPPassword.ps1 @@ -118,6 +118,9 @@ http://rewtdance.blogspot.com/2012/06/exploiting-windows-2008-group-policy.html } $Base64Decoded = [Convert]::FromBase64String($Cpassword) + + # Make sure System.Core is loaded + [System.Reflection.Assembly]::LoadWithPartialName("System.Core") |Out-Null #Create a new AES .NET Crypto Object $AesObject = New-Object System.Security.Cryptography.AesCryptoServiceProvider @@ -345,4 +348,4 @@ http://rewtdance.blogspot.com/2012/06/exploiting-windows-2008-group-policy.html } catch { Write-Error $Error[0] } -} \ No newline at end of file +} -- cgit v1.2.3