Skip to content

Instantly share code, notes, and snippets.

@amriunix
Last active January 20, 2020 10:16
Show Gist options
  • Save amriunix/07d79a3da8c6fbff9fa7408c08b7efc2 to your computer and use it in GitHub Desktop.
Save amriunix/07d79a3da8c6fbff9fa7408c08b7efc2 to your computer and use it in GitHub Desktop.
Elevate of Privileges (EoP) using powershell
$Username = "Domain\User"
$Password = "Pass"
$PasswordSS = ConvertTo-SecureString -String $Password -AsPlainText -Force
$Creds = New-Object -Typename System.Management.Automation.PSCredential $Username,$PasswordSS
Start-Process 'C:\Windows\system32\ping.exe' -ArgumentList '127.0.0.1' -Credential $Creds
# Or
Invoke-Command -Computer localhost -Credential $Creds -ScriptBlock {C:\Windows\system32\ping.exe 127.0.0.1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment