Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 3d0d32d

Browse files
Path array fix for Get-ModifiablePath
This is a fix for: #248
1 parent 1950a16 commit 3d0d32d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Privesc/PowerUp.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,13 @@ https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/wind
20692069
if ($VulnServices) {
20702070
ForEach ($Service in $VulnServices) {
20712071

2072-
$ModifiableFiles = $Service.pathname.Split(' ') | Get-ModifiablePath
2072+
$SplitPathArray = $Service.pathname.Split(' ')
2073+
$ConcatPathArray = @()
2074+
for ($i=0;$i -lt $SplitPathArray.Count; $i++) {
2075+
$ConcatPathArray += $SplitPathArray[0..$i] -join ' '
2076+
}
2077+
2078+
$ModifiableFiles = $ConcatPathArray | Get-ModifiablePath
20732079

20742080
$ModifiableFiles | Where-Object {$_ -and $_.ModifiablePath -and ($_.ModifiablePath -ne '')} | Foreach-Object {
20752081
$CanRestart = Test-ServiceDaclPermission -PermissionSet 'Restart' -Name $Service.name

0 commit comments

Comments
 (0)