Created
August 11, 2018 13:05
-
-
Save Evilcry/ba70b8fa746ef7ae352d14bcaaf6bfbb to your computer and use it in GitHub Desktop.
discover Unquoted Service Paths that can be abused to escalate privileges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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