Skip to content

Commit 01d80ca

Browse files
committed
+BugFix
It's always the small things...
1 parent af103ec commit 01d80ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UAC-TokenMagic.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ function UAC-TokenMagic {
253253
# We don't actually check if the process is elevated, be smart
254254
# QueryLimitedInformation = 0x1000
255255
$hProcess = [UACTokenMagic]::OpenProcess(0x00001000,$false,$ProcPID)
256-
if ($hProcess) {
256+
if ($hProcess -ne 0) {
257257
echo "[*] Successfully acquired $((Get-Process -Id $ProcPID).Name) handle"
258258
} else {
259259
echo "[!] Failed to get process token!`n"
260+
Break
260261
}
261262
} else {
262263
# Prepare ShellExecuteEx

0 commit comments

Comments
 (0)