aboutsummaryrefslogtreecommitdiff
path: root/Privesc
diff options
context:
space:
mode:
authorb33f <ru.boonen@gmail.com>2017-08-10 22:05:41 +0100
committerGitHub <noreply@github.com>2017-08-10 22:05:41 +0100
commit3d0d32d9ee6af70f0dfd5ecfe809a49a65d6822d (patch)
tree8e7b123e78f0d3485d69089fa4f92ace1c3653ce /Privesc
parent1950a169e3a979108fe3fe8df2306ce78bae6a75 (diff)
downloadPowerSploit-3d0d32d9ee6af70f0dfd5ecfe809a49a65d6822d.tar.gz
PowerSploit-3d0d32d9ee6af70f0dfd5ecfe809a49a65d6822d.zip
Path array fix for Get-ModifiablePath
This is a fix for: https://github.com/PowerShellMafia/PowerSploit/issues/248
Diffstat (limited to 'Privesc')
-rw-r--r--Privesc/PowerUp.ps18
1 files changed, 7 insertions, 1 deletions
diff --git a/Privesc/PowerUp.ps1 b/Privesc/PowerUp.ps1
index 2680986..062045c 100644
--- a/Privesc/PowerUp.ps1
+++ b/Privesc/PowerUp.ps1
@@ -2069,7 +2069,13 @@ https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/wind
if ($VulnServices) {
ForEach ($Service in $VulnServices) {
- $ModifiableFiles = $Service.pathname.Split(' ') | Get-ModifiablePath
+ $SplitPathArray = $Service.pathname.Split(' ')
+ $ConcatPathArray = @()
+ for ($i=0;$i -lt $SplitPathArray.Count; $i++) {
+ $ConcatPathArray += $SplitPathArray[0..$i] -join ' '
+ }
+
+ $ModifiableFiles = $ConcatPathArray | Get-ModifiablePath
$ModifiableFiles | Where-Object {$_ -and $_.ModifiablePath -and ($_.ModifiablePath -ne '')} | Foreach-Object {
$CanRestart = Test-ServiceDaclPermission -PermissionSet 'Restart' -Name $Service.name