Skip to content

Commit 1c5bc6b

Browse files
committed
fix hard coded system root paths in PowerUp.ps1
1 parent a0e7fc4 commit 1c5bc6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Privesc/PowerUp.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,11 +3079,11 @@ https://www.mandiant.com/blog/malware-persistence-windows-registry/
30793079
$ModulePath = "$BasePath\$($Module.ModuleName)"
30803080

30813081
# if the module path doesn't exist in the process base path folder
3082-
if ((-not $ModulePath.Contains('C:\Windows\System32')) -and (-not (Test-Path -Path $ModulePath)) -and ($KnownDLLs -NotContains $Module.ModuleName)) {
3082+
if ((-not $ModulePath.Contains("$Env:SystemRoot\System32")) -and (-not (Test-Path -Path $ModulePath)) -and ($KnownDLLs -NotContains $Module.ModuleName)) {
30833083

30843084
$Exclude = $False
30853085

3086-
if ($PSBoundParameters['ExcludeWindows'] -and $ModulePath.Contains('C:\Windows')) {
3086+
if ($PSBoundParameters['ExcludeWindows'] -and $ModulePath.Contains($Env:SystemRoot)) {
30873087
$Exclude = $True
30883088
}
30893089

@@ -3851,7 +3851,7 @@ Author: Antti Rantasaari - 2014, NetSPI
38513851
$Null = $DataTable.Columns.Add('encr')
38523852

38533853
# Get list of virtual directories in IIS
3854-
C:\Windows\System32\InetSRV\appcmd.exe list vdir /text:physicalpath |
3854+
& "$Env:SystemRoot\System32\InetSRV\appcmd.exe list vdir /text:physicalpath" |
38553855
ForEach-Object {
38563856

38573857
$CurrentVdir = $_

0 commit comments

Comments
 (0)