From 6de1d78af875300f8f1d82fad64b4471ed33882a Mon Sep 17 00:00:00 2001 From: Harmj0y Date: Fri, 12 Feb 2016 17:25:13 -0500 Subject: Added Pester tests for Get-SiteListPassword Encrypted password check for Get-SiteListPassword fields --- Privesc/Get-SiteListPassword.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Privesc') diff --git a/Privesc/Get-SiteListPassword.ps1 b/Privesc/Get-SiteListPassword.ps1 index a37f63c..f631872 100644 --- a/Privesc/Get-SiteListPassword.ps1 +++ b/Privesc/Get-SiteListPassword.ps1 @@ -128,8 +128,13 @@ function Get-SiteListPassword { try { $PasswordRaw = $_.Password.'#Text' - # decrypt the base64 password - $DecPassword = if($PasswordRaw) { (Get-DecryptedSitelistPassword -B64Pass $PasswordRaw).Decrypted } else {''} + if($_.Password.Encrypted -eq 1) { + # decrypt the base64 password if it's marked as encrypted + $DecPassword = if($PasswordRaw) { (Get-DecryptedSitelistPassword -B64Pass $PasswordRaw).Decrypted } else {''} + } + else { + $DecPassword = $PasswordRaw + } $Server = if($_.ServerIP) { $_.ServerIP } else { $_.Server } $Path = if($_.ShareName) { $_.ShareName } else { $_.RelativePath } -- cgit v1.2.3