Over a million developers have joined DZone.

XSS ChEF: Chrome Extension Exploitation Framework

DZone's Guide to

XSS ChEF: Chrome Extension Exploitation Framework

Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

Recently I've been busy with my new little project. What started out as a proof of concept suddenly became good enough to demonstrate it with Kyle Osborn at BlackHat, so I decided I might just present it here too ;)

Zombifying alert(1)

What do you do when you find XSS on a website? alert(1) of course. What you can do instead is to try to make something bigger out of it. You have several options:
  • If you're Samy, you write a worm (and you almost go to jail in return because the worm is so successful)
  • If you're a bad guy, you redirect to an exploit-kit. 
  • If you're a pentester - you can use that XSS for further exploitation.
Let's focus on this last case - you want to exploit the application. You can do that manually via some handcrafted JS code, you can use various libraries with ready-made features  (like XSS-Track ) or you can inject a BeEF hook and make your tested application a zombie ready to receive commands from the zombie master (i.e. you). BeEF is probably as good as it gets when it comes to exploiting XSS within web pages.

Chrome extensions are web apps too!

Chrome extensions are basically just HTML5 applications and can suffer from standard web vulnerabilities (read  our BlackHat whitepaper:  Advanced Chrome Extension Exploitation: Leveraging API powers for Better Evil for more details).  Among them our beloved  XSS . Yes, as it turns out, XSS vulnerabilities in Chrome extensions are pretty common (again - see white paper).

Exploiting XSS in Chrome extensions is way cooler though, because they have much more capabilities than the standard webpages. Depending on the permissions declared in the manifest, they may be able to:
  • get the content of every page that you visit (and URLs that you visit in incognito mode)
  • execute JS in context of every website (Global XSS)
  • take screenshots of your browser tabs
  • monitor and alter your browsing history & cookies (even httpOnly!)
  • access your bookmarks
  • even change your proxy settings
And, once you've got XSS, you can do all of the above within your payload. Once you know the details of the asynchronous chrome.* APIs.

But that's so cumbersome!

Yeah, I know. And I'm lazy too, so I've created a tool called XSS CheF - Chrome Extension Exploitation Framework which does the work for me. It's basically a BeEF equivalent for Chrome extensions. So, once you've found XSS vulnerability within Chrome extension, you can simply inject a payload like this:

<img src=x onerror="if(location.protocol.indexOf('chrome')==0){
To get total control over the whole browsing session via attacker's console.

XSS ChEF is d esigned from the ground up for 
exploiting extensions. It's fast (thanks to using WebSockets), and it comes p reloaded with automated 
attack scripts:


XSS ChEF is available on GitHub under GPLv3 license. As always - clone, download, test it and let me know how do you feel about it. Suggestions & contributions are more than welcome.






Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.


Published at DZone with permission of Krzysztof Kotowicz , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}