Skip to content

Instantly share code, notes, and snippets.

@JAStanton
Last active August 21, 2022 01:11
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JAStanton/3490cf799a0d184cedd7 to your computer and use it in GitHub Desktop.
Save JAStanton/3490cf799a0d184cedd7 to your computer and use it in GitHub Desktop.
MITM Chrome Extension

How to MITM with a chrome extension

  • Download these files and update them
  • goto chrome://extensions and drag the parent folder holding these files into the window (you may need to turn chrome extension developer mode on)
  • goto website and watch the magic.

For some extra awesomeness replace a javascript file with a js file from dropbox with ?dl=1 at the end of the js url. Now you can modify the file locally, it will update itself, and you just have to refresh the browser. Pretty cool!

chrome.webRequest.onBeforeRequest.addListener(function (details) {
if (details.url == "https://file you want to replace.js") {
return {
redirectUrl: "https://www.replacement file.js"
};
}
}, {
urls: ["https://URL YOU WANT TO MITM/"]
}, ["blocking"]);
{
"manifest_version": 2,
"name": "MITM Chrome Ext",
"description": "",
"version": "0.1",
"permissions": [
"webRequest",
"webRequestBlocking",
"https://URL YOU WANT TO MITM/"
],
"background": {"scripts": ["background.js"]}
}
@iounpaladin
Copy link

This is awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment