555 points · by npace12 · 3y ago · 101 comments
I needed a way to monitor network calls made by chrome extensions so I made a small extension.
You can install it by dropping the zip or crx into the extensions page. It'll be on the chrome store whenever/if it gets through the review.
Hopefully it's useful to others.
The process is roughly the same as inspecting the UI, you basically enable remote debugging and then launch the Browser Toolbox: https://superuser.com/questions/1608096/how-to-inspect-firef...
(this is also a great way to figure out what you need to do for a user-chrome CSS file, e.g. if you want to change how tabs appear beyond just theming. though using a user-chrome CSS file is unfortunately a minor pain in the ass.)
I had to switch it to "multi-process mode" to get network requests from extensions to show up, but that broadly makes sense.
e.g. here's ublock pulling a random block list that I clicked on to test: https://i.imgur.com/wBYbBM2.png
and here's Firefox itself updating the safe-browsing list in the background: https://i.imgur.com/JYxWwjW.png
A well made extension will only pop up an occasional toast. One that needs the server to work will show the toast when the user expects it to be talking to the server. One sending keypresses or other suspicious data will be really obvious.
For example, even if the extension itself can't make requests, there are plenty of ways to 'trick' a webpage into making a request on your behalf when you have permissions to modify the Dom of the web page.
Next, back in the normal browser-- Click the puzzle piece icon where your extensions icons are to the right side of the URL address bar. Click the little thumbtack next to Little Rat extension. Now it's installed and shows in the list of extension icons
Not being familiar with exactly what data these APIs (or similar?) provide: could extensions' abilities to access other extensions' requests imply any security concerns for e.g. password manager extensions? Or auth-token-using extensions?
Does anyone know an equivalent that do the same thing on Firefox?
You will be amazed at the obvious extension policy violations Mozilla is letting many of their "recommended" extensions get away with.
[1]: https://firefox-source-docs.mozilla.org/devtools-user/browse...
[2]: https://firefox-source-docs.mozilla.org/networking/http/logg...
[3]: https://firefox-source-docs.mozilla.org/devtools-user/about_...
I've reported these and several other extensions again every time they were updated in great technical detail and through various official channels, but stopped bothering when about a year and several extension updates later nothing had changed.
I'll be watching this. Thanks for the project!
declarativeNetRequest.onRuleMatchedDebug is not available [1] Even though the docs say it's behind a flag [2], it's undefined.
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1745773 [2]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...
0: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...
0: https://github.com/dnakov/little-rat/blob/f0b9b6be39af9fe7f4...
1) Go to Releases, right click the crx file and save.
2) In Chrome, go to Extensions then drag and drop the crx file
3) Profit> This extension is not listed in the Chrome Web Store and may have been added without your knowledge. Learn more https://support.google.com/chrome_webstore/answer/2811969?vi...
https://github.com/dnakov/little-rat/blob/main/popup.js#L36
I do not want to have to worry about whether another extension can inject xss into yours with a crafted request/id/name.
* the content security policy does not allow unsafe-inline
* extension ids are autogenerated by chrome
Also, if I delete an extension, it still appears in the list of extensions in Little Rat. Any easy way to fix this?
Thanks
chrome.declarativeNetRequest.onRuleMatchedDebug.addListener((e) => {
if (e.request.initiator?.startsWith('chrome-extension://')) {
Given that the extension is using a "Debug" API, it seems unlikely that the Chrome Web Store will approve. "Only available for unpacked extensions with the declarativeNetRequestFeedback permission as this is intended to be used for debugging purposes only." https://developer.chrome.com/docs/extensions/reference/decla...Network requests initiated by other extensions in their own context are not visible to other extensions through the webRequest API.
The upnacked zip worked just fine though!
Nice extension, thanks!
(Vivaldi 6.2.3096.3 on Linux)
Repeated clicking results in loop of 1) muting second to the last extension 2) muting the extension I'm actually clicking 3) unmuting second to the last and 4) unmuting the one I'm clicking :-D
It is quite hard to describe, I may create a video and upload it somewhere later.
I was clicking around for a bit and noticed one more thing: it does not display "Anti Anti Debug" extension - but that extension suddenly appears when I toggle any mute button.
Maybe that extension is doing something funny? It is too late for me to try now but I will keep digging around tomorrow.
There are several clones that are trying to piggyback on that name though. You have to go for the original one - the one from Raymond Hill (or gorhill)!
Here the actual code of the extension is basically 2 files, one of 114 lines and the other 66. Plain js, easy to digest. Looks pretty safe.
Also, plenty of these extensions have been acquired by data firms or other sketchy places to then add your browser to botnets. If these are absolutely necessary for you, I highly recommend downloading the source and dumping it into Chrome/Edge via developer mode. At least then you know they can't update it in the background and you know what you're running.
> No wonder reddit used to go down so often...
That's uncalled for. If this were reddit I'd have a much spicier retort.
you leaving is actually part of the reason I left at the time, you were one of the few admins who regularly participated (it seemed)