• View our reviews on Hot Scripts
  • JS Tutorial

Recent Comments

Powered by Disqus

Back to articles

Get password behind asterix when auto filling forms

Using different passwords for different websites is almost mandatory nowadays, but it is also pretty hard to keep track of all passwords, so people usually use form fillers. Either it is a built in webrowser or plugin, or standalone application, you just save password once and then auto fill login form without even remembering your password. But what if someday you'll need that password? Here is an example of how to get it.

This code snippet is with explanations and it won't work, it is only for education purpose, use code snippet in the end of the article, to get you password.

Explanation example:

        //defining variables
        var s,F,j,f,i; s = "";
        //getting all forms that are in webpage
        F = document.forms; 
        //loop through forms
        for(j=0; j<F.length; ++j) 
            f = F[j]; 
            //loop through all form elements
            for (i=0; i<f.length; ++i) 
                //if form element has a type of password (field with asterix)
                if (f[i].type.toLowerCase() == "password") 
                    s += f[i].value + "n"; //we will save it in s variable
        //if anything was saved to s display it
        if (s) 
            alert("Passwords in forms on this page: n" + s); 
        //else there were no passwords in this website
            alert("There are no passwords in forms on this page.");

And this is the real code to get your password, just go to address where login form is, auto fill it, but don't login, or just press Stop loading button in your browser if auto filler automatically logs in. Once form is filled and you see asterixes in the password field, copy this javascript code into your website address field (delete existing address), and you password will pop up like this:

Real code to use:

javascript: var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('Password not found in ' + g + ' forms');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){prompt('Password found ', s)}else{alert('Password is blank')}return true;}}

Or bookmark this link, for easier use: Retrieve passwords

Now all you'd have to do is to, go to specific page, autofill form and then click on this bookmark to get entered passwords

You may also be interested in:

Powered by

blog comments powered by Disqus