Skip to content

Instantly share code, notes, and snippets.

@Gioyik
Created November 24, 2014 22:02
Show Gist options
  • Save Gioyik/129434e054a2db0e598e to your computer and use it in GitHub Desktop.
Save Gioyik/129434e054a2db0e598e to your computer and use it in GitHub Desktop.
Get value from password inputs on a website
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment