Table of Contents
These functions are used to determine if you have Admin level privledges
This function will let you know if you are currently in an Admin Privledge Level window
function If-Admin-Window {
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
$isAdmin = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
if($isAdmin){
Write-host 'Is Admin Window' -BackgroundColor DarkRed -ForegroundColor White
}
else{
Write-host 'Not Admin Window' -BackgroundColor DarkBlue -ForegroundColor White
}
}
This function will run the current user against LocalGroupMember to return True or False if Profile has Admin Privledges
function If-Admin {
$user = "$env:COMPUTERNAME\$env:USERNAME"
$isAdmin = (Get-LocalGroupMember 'Administrators').Name -contains $user
if($isAdmin){
Write-host 'Is Admin' -BackgroundColor DarkRed -ForegroundColor White
}
else{
Write-host 'Not Admin' -BackgroundColor DarkBlue -ForegroundColor White
}
}
Listed below are payloads that have used one of these functions:
No current Examples to show. Please feel free to submit your own payload of you using this function
