Skip to content

Instantly share code, notes, and snippets.

@Evilcry
Created August 11, 2018 13:05
Show Gist options
  • Save Evilcry/ba70b8fa746ef7ae352d14bcaaf6bfbb to your computer and use it in GitHub Desktop.
Save Evilcry/ba70b8fa746ef7ae352d14bcaaf6bfbb to your computer and use it in GitHub Desktop.
discover Unquoted Service Paths that can be abused to escalate privileges
#Requires -RunAsAdministrator
$services = Get-WmiObject win32_service | select Name, PathName
Foreach ( $entry in $services ) {
if ( $entry.PathName -match "Program" ) {
if ( $entry.PathName -notmatch "\`"*\`"" -and $entry.PathName -match " ") {
Write-Host "Potentially Vulnerable Service: $($entry.Name) with Path: $($entry.PathName)" -BackgroundColor DarkGreen
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment