Bug bounty research: hot or not - 13 Jul 2016
Scornhub - 26 May 2016
The meaning of life tastes like chicken - 24 Feb 2016
fucking astrology man - 09 Dec 2015
Freelance Consulting - 23 Nov 2015
The Wassenaar Effect - 09 Jun 2015
Scantastic! - 11 Feb 2015
It's all fucked - 05 Jan 2015
The tortured poet - 28 Dec 2014
Gone in 660 Seconds - 25 Nov 2014
College Graduation - 20 Nov 2014
Yahoo for the craic! - 21 Sep 2014
IRC what you did there... - 02 Aug 2014
Let me Bug you!? - 19 Jun 2014
Plesk 10 & 11 SSO XXE/XSS - 09 May 2014
Final Year Woes - 24 Apr 2014
SWMing in privilege, or drowning? - 10 Apr 2014
Lucid Surrealist Dreams and techno-lust. - 23 Mar 2014
New Raspberry piToy - 05 Feb 2014
Happy 2014! - 15 Jan 2014
Helpdesk Pilot Xss/CSRF Add an Admin - 30 Nov 2013
Squidoo.com $1,100 bug bounty - 02 Nov 2013
Yahoo Xss bug bounty - 01 Oct 2013
Moodle 2.0 Account Takeover - 04 Sep 2013
Xss Challenge Accepted - 17 Aug 2013
rpliy - rpi python web player - 25 Jul 2013
Busy times - 10 Jul 2013
Source Conference - 27 May 2013
Coinbase.com bug bounty - 04 May 2013
Xssive, Moodle and CSRF - 11 Apr 2013

Yahoo Pipes is Great! - 05 Mar 2013
Science Hack-day Dublin - 03 Mar 2013
Simple port scan - 26 Feb 2013
4chan-tool.py - 19 Feb 2013
Wix.com Xss - 11 Feb 2013
Crawl.py Url Crawling - 09 Feb 2013
Xssive Demo tool - 12 Jan 2013
Cyberbullying? - 27 Dec 2012
Merry XssMas - 24 Dec 2012
Watching BBC Streams - 10 Dec 2012
SWF Disassembly - 26 Nov 2012
C <3 - 16 Nov 2012
Greasemonkey XSS 2 - 21 Oct 2012
Work Logging App - 20 Oct 2012
Greasemonkey XSS - 30 Sep 2012
Guestbook XSS - 18 Sep 2012
OWASP Vicnum Project - 05 Sep 2012
August... - 05 Sep 2012
XSS Scenarios. - 30 Jul 2012
Imageroll - 06 Jul 2012
The Dangers of XSS - 14 Jun 2012

US Threat Gauge - 30 May 2012
Is this art? - 28 May 2012
Rss2Irc - 25 May 2012
Blackboard Xss Jungle - 14 May 2012
Url Info Scraper - 10 May 2012
pythonchallenge.com - 27 Apr 2012
Prime Generator - 15 Apr 2012
Sockso 1.51 Xss - 07 Apr 2012


Ubuntu 10.10 Hardening - 18 Mar 2012
2nd Year Revisited - 17 Mar 2012

Moodle 2.0 Account Takeover

So, a fresh year of college is about to kick off! Our college, like many others, have installed the latest version of moodle for the new year. I have found a pretty severe xss on the latest moodle version, these bugs can and do result in a complete account takeover. This bug effects moodle versions prior to 2.3.9, 2.4.6, 2.5.1 (patches released September the 9th). Edit: There is also a RCE Exploit Developed afterwards by Rapid7 that leveraged this XSS.

I'm going to demonstrate how I can take over a moodle site by chaining this "minor" vulnerability together with other items such as CSRF. It is of course more than possible to escalate privileges to that of a lecturer or admin and also possible to spread an xss worm, I know this based on previous research I did with moodle for my 3rd year project demo. I currently do not have the time it would take to install moodle and test if this is the case.

This time I'd like to do a much more technical proof of concept as my last moodle-takeover post wasn't really that detailed or technical. For the chain of attack, Everything begins with this blog post.

How? All will become clearer if you view this blog post via the RSS feed. You may notice that this particular post has the following line. javascript:MALICIOUS JAVASCRIPT(); You can probably immediately see where this is going.

In moodle there is an option to include a remote RSS feed or blog. As you can probably expect, clicking the "Link to original blog entry" hyperlink results in a very typical prompt box demo containing the domain name of the current site. The attacker now has access to any DOM values within this domain. Luckily for this attacker, These DOM values include the users current moodle session key. This doesn't change once the user logs in, likewise the user's ID doesn't change. We can now run any CSRF attack we want with these values.

What happens if we change this link value to javascript:alert("Session key = "+M.cfg.sesskey+ " User ID = "+window.location.search.split("=")[1]); Now we can see the users session key and user ID are easily accessible from the DOM. These values can then be used to fill in fake forms and submit them as our unsuspecting user. Which will of course lead me on to the second step of our attack, we can send this blog post to an admin, inject javascript into the moodle home/login page, this will be executed every time they log in or access there home page. Now we can steal any users login information. Below you will see both a regular user and an admin users session/id information.

The CSRF form looks like the following...

1">

We will do this by adding malicious html to the moodle welcome page using something similar to the csrf form above. This is also where users login when they first visit the site. This can be submitted to /course/editsection.php. The id parameter in red is usually between 1-3, here we can then use our malicious javascript to steal any user logins by changing where the login form elements are sent or anything else that is malicious/similar. Maybe force every unaware moodle user to install a new plugin? From here the ability to cause havoc is greatly weighed in the malicious attackers favour.

Just for demonstrative purposes you will see an example of the new login window below. Would you try login or download the "Update". Of course this could be done in a much stealthier way, and the popup is just an example that an attackers javascript now runs on the login page. I wonder if they'd make it as obvious...

I reported this bug to moodle, you can find the thread/fix here https://tracker.moodle.org/browse/MDL-41623. (This requires a password to view). <3 XSS. This bug was given the following CVE-2013-4341