Skip to content

Commit

Permalink
Adds tolower() as it was dropping .DLL files in my local
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Hull committed Sep 8, 2017
1 parent 6eb3c6f commit 0a89499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Privesc/PowerUp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,7 @@ https://www.mandiant.com/blog/malware-persistence-windows-registry/
# the known DLL cache to exclude from our findings
# http://blogs.msdn.com/b/larryosterman/archive/2004/07/19/187752.aspx
$Keys = (Get-Item "HKLM:\System\CurrentControlSet\Control\Session Manager\KnownDLLs")
$KnownDLLs = $(ForEach ($KeyName in $Keys.GetValueNames()) { $Keys.GetValue($KeyName) }) | Where-Object { $_.EndsWith(".dll") }
$KnownDLLs = $(ForEach ($KeyName in $Keys.GetValueNames()) { $Keys.GetValue($KeyName).tolower() }) | Where-Object { $_.EndsWith(".dll") }
$KnownDLLPaths = $(ForEach ($name in $Keys.GetValueNames()) { $Keys.GetValue($name).tolower() }) | Where-Object { -not $_.EndsWith(".dll") }
$KnownDLLs += ForEach ($path in $KnownDLLPaths) { ls -force $path\*.dll | Select-Object -ExpandProperty Name | ForEach-Object { $_.tolower() }}
$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
Expand Down

0 comments on commit 0a89499

Please sign in to comment.