diff options
author | Matt Graeber <mattgraeber@gmail.com> | 2013-07-03 17:44:35 -0700 |
---|---|---|
committer | Matt Graeber <mattgraeber@gmail.com> | 2013-07-03 17:44:35 -0700 |
commit | 29329e1707f3ca4d7d7374ecd7ddd074e8a372cc (patch) | |
tree | 2bf7a55aff3fdae67347f813d1514dc240e80ab0 | |
parent | 371c65c9a7493f0a8e02a6f888d6b75a42a77566 (diff) | |
parent | eb85e1ce9d7409ccd0fe27a310ed8708dfd0308f (diff) | |
download | PowerSploit-29329e1707f3ca4d7d7374ecd7ddd074e8a372cc.tar.gz PowerSploit-29329e1707f3ca4d7d7374ecd7ddd074e8a372cc.zip |
Merge pull request #8 from obscuresec/master
Add checks to terminate script if not running in proper environment.
-rw-r--r-- | Exfiltration/Get-GPPPassword.ps1 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Exfiltration/Get-GPPPassword.ps1 b/Exfiltration/Get-GPPPassword.ps1 index 6a9c192..6e6594d 100644 --- a/Exfiltration/Get-GPPPassword.ps1 +++ b/Exfiltration/Get-GPPPassword.ps1 @@ -60,6 +60,10 @@ catch {Write-Error "$Error[0]"} } + #ensure that machine is domain joined and script is running as a domain account + if (((Get-WmiObject Win32_ComputerSystem).partofdomain) -eq $False) {throw 'Machine is not joined to a domain.'} + if (($Env:USERDNSDOMAIN) -eq $Null) {throw 'Account is not a domain account.'} + #discover potential files containing passwords $XMlFiles = Get-ChildItem -Path "\\$Env:USERDNSDOMAIN\SYSVOL" -Recurse -Include 'groups.xml','services.xml','scheduledtasks.xml','datasources.xml' @@ -123,4 +127,4 @@ catch {Write-Error $Error[0]} } -}
\ No newline at end of file +} |