EPATHOBJ 提权0day x64利用

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

控制的PathRecord)加入PathRecord Chain中
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
创建看门狗线程
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
一旦PathRecord->next被替换成ExploitRecord,之前
© 2011 Vulnhunt, Inc. All rights reserved.
32EXP修改的地方
ExitPatchRecord不需要指定的地址,任意地址即可(xp64
NtAllocateVirtualMemory无法分配指定地址内存)
PolyDraw 喷射的PATCHRECORD的Points.y置0
谢谢!
© 2011 Vulnhunt, Inc. All rights reserved.
FlattenPath 触发将Freelist node添加进 PATHOBJ Chain
EPATHOBJ__ bFlatten
无限循环 PathRecord->next = PathRecord
BO OM
交换 PathRe cord>next 与 Exploit PathRe cord
HalDispatchTable改写 © 2011 Vulnhunt, Inc. All rights reserved. Shellcode执行
引用/感谢
Binvul 论坛
boywhp:http://www.binvul.com/viewthread.php?tid= 321&extra=page%3D1
J00ru大神:http://j00ru.vexillium.org/?p=783
© 2011 Vulnhunt, Inc. All rights reserved.
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
不执行CreateRoundRectRgn和执行的区别
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
调用 FlattenPath(Device) 将freelist->next节点(用户层
360安全卫视临时patch
© 2011 Vulnhunt, Inc. All rights reserved.
利用特点
可以任意写内核地址,但是写入的值无法控制,是
PACHRECORD对象的地址,该对象指向的内容可以 控制
© 2011 Vulnhunt, Inc. All rights reserved.
© 2011 Vulnhunt, Inc. All rights reserved.
EPATHOBJ
漏洞细节
X32位利用 X64位利用
© 2011 Vulnhunt, Inc. All rights reserved.
EPATHOBJ 漏洞细节
© 2011 Vulnhunt, Inc. All rights reserved.
instruder 2013年7月23日
© 2011 Vulnhunt, Inc. All rights reserved.
EPATHOBJ 提权0day
谷歌工程师Tavis Ormandy 最早3月份在一次windows
内核压力测试中发现的
5月中旬其博客公布了漏洞利用细节 6月初国内论坛看雪有网友公开了x32位攻击代码 通杀xp 、2003、vista、win7、win8、2008 所有系统
更好的应对防御 本地内核提权防御思路

内核SHELLCODE特征 检测是否R3进程加载ntkrpamp.exe、win32k.sys、hal.dll等内 核模块


NtAllocateVirtualMemory 分配低地址内存
进程权限变更、创建SYSTEM权限的CMD

© 2011 Vulnhunt, Inc. All rights reserved.
HalDispatchTable成功执行Shellcode
Shellcode执行复制System进程的toke到当前进程
© 2011 Vulnhunt, Inc. All rights reserved.
EXP SUCCESS!
整个流程
大量CreateRoundRectRgn Failed to AllocateObject 0X42424242
EPATHOBJ 漏洞细节
EPATHOBJ 在分配新的pathrecord node时, 先从freelist里面寻找,若找到则直接返回里面 的node,而该 node内存没有正确初始化导致可 以添加用户层控制的node到pathobj chain表中, 从而可以任意地址写入node的地址。
© 2011 Vulnhunt, Inc. All rights reserved.
PathRecord
Next
创建WatchDog PolyDraw Spam PathRecord
HalDis patchT able
WatchD og Thread
对象分配失败
ExploitPathRec ord
Pre
调用reinit将 PathRecord加入到 freelist ExitPathRecor Next d
© 2011 Vulnhunt, Inc. All rights reserved.
X64利用
MmUserProbeAddress = 0x000007ff`ffff0000 PATCHRECORD NODE属于内核地址,一般都很大
通过改写MmUserProbeAddress ,达到任意内核地址
的EPATHOBJ__bFlatten 循环就会被终止,调用 EPATHOBJ__pprFlattenRec函数 触发任意地址写 PathObj对象地址
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
尝试调用NtQueryIntervalProfile 是否写入
X32位利用
Exploit目标 :
控制freelist->next 指针指向用户层控制BUFFER 触发chain 任意地址写
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
分配3个PathRecord
© 2011 Vulnhunt, Inc. All rights reserved.
X64利用
利用难点
64位内核堆栈、各种堆默认没有可执行属性 xp 64不能分配指定地址内存 win8 不能不能分配0地址开始的64k内存
© 2011 Vulnhunt, Inc. All rights reserved.
MmUserProbeAddress
NtReadVirtualMemory
读写的途径
© 2011 Vulnhunt, Inc. All rights reserved.
X64利用流程
1 触发漏洞修改MmUserProbeAddress 大于0x7fff0000 2 调用NtReadVirtualMemory的指定ReturnLength指向 HalDispatchTable ,写入SHELLCODE地址到 HalDispatchTable 3 调用NtQueryIntervalProfile 触发调用HalDispatchTable, 从而执行SHELLCODE
修改Exp EXE基址为低地址பைடு நூலகம்
© 2011 Vulnhunt, Inc. All rights reserved.
64Exp Test
成功测试xp64 200364 win764 200864
© 2011 Vulnhunt, Inc. All rights reserved.
Exp研究意义
EXP讲解
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
© 2011 Vulnhunt, Inc. All rights reserved.
EXP讲解
为啥大量调用CreateRoundRectRgn导致对象分配失败?
PolyDrarcreaterecnewpathalloc分配失败调用 reinitvFreeBlocks循环调用freepathalloc将用户层 控制的内存添加到freelist中
相关文档
最新文档