【OOB】MSHTML!CPasteCommand::ConvertBitmaptoPng heap-based buffer overflow学习
IE 11 MSHTML!CPasteCommand::ConvertBitmaptoPng heap-based buffer overflow学习
MS14-056, CVE-2014-4138
Time-line
8 May 2014: This vulnerability was submitted to ZDI.
9 June 2014: This vulnerability was acquired by ZDI.
23 June 2014: This vulnerability was disclosed to Microsoft by ZDI.
14 October 2014: This vulnerability was address by Microsoft in MS14-056.
21 December 2016: Details of this vulnerability are released.
越界访问漏洞
版本:Microsoft Internet Explorer 11.0.9600.16521
概述
图片被粘贴到IE11中,会把BMP格式转换成PNG格式,MSHTML!CPasteCommand::ConvertBitmaptoPng函数执行这个操作。
这个函数使用BMP图片的大小来储存转换好的PNG图片,如果转换后的PNG大于BMP则会发生溢出
CPasteCommand::ConvertBitmaptoPng 伪代码
函数原型
ConvertBitmaptoPng(
[IN] VOID* poBitmap,
UINT uBitmapSize,
[OUT] VOID** ppoPngImage,
UINT* puPngImageSize
)
{
// BMP到PNG的转换
CMemStm* poCMemStm;
IWICStream* poWicBitmap;
STATSTG oStatStg;
TSmartArray<unsigned char> poPngImage;
UINT uReadSize;
// Create a CMemStm for the PNG image.
CreateStreamOnHGlobal(NULL, True, poCMemStm);
// Create an IWICStream from the BMP image.
InitializeFromMemory(poBitMap, uBitmapSize,
&GUID_ContainerFormatBmp, &poWicBitmap)));
// Write BMP image in IWICStream to PNG image in CMemStm
WriteWicBitmapToStream(poWicBitmap, &GUID_ContainerFormatPng, poCMemStm);
// Get size of PNG image in CMemStm and save it to the output variable.
oCMemStm->Stat(&oStatStg, 0);
*puPngImageSize = oStatStg.cbSize.LowPart;
// Allocate memory for the PNG
//这一句产生问题,使用了BMP的大小给PNG分配内存
poPngImage->New(uBitmapSize);
// Go to start of PNG image in CMemStm
poCMemStm->Seek(0, STREAM_SEEK_SET, NULL, &pPositionLow);
// Read PNG image in CMemStm to allocated memory.
//这一句读入PNG的内容,导致溢出
poCMemStm->Read(poPngImage, *puPngImageSize, &uReadSize);
// Save location of allocated memory with PNG image to output variable.
*ppoPngImage = poPngImage;
}
POC
只有用js实现图片复制的脚本,图片本身需要另外生成
这个洞因为没有完整的POC所以我没有调,但是其实作者在概述里已经说的很清楚了,这个洞的成因比较有意思放在这里开阔一下思路。
【OOB】MSHTML!CPasteCommand::ConvertBitmaptoPng heap-based buffer overflow学习的更多相关文章
- CVE-2016-10190 FFmpeg Http协议 heap buffer overflow漏洞分析及利用
作者:栈长@蚂蚁金服巴斯光年安全实验室 -------- 1. 背景 FFmpeg是一个著名的处理音视频的开源项目,非常多的播放器.转码器以及视频网站都用到了FFmpeg作为内核或者是处理流媒体的工具 ...
- CVE-2016-10191 FFmpeg RTMP Heap Buffer Overflow 漏洞分析及利用
作者:栈长@蚂蚁金服巴斯光年安全实验室 一.前言 FFmpeg是一个著名的处理音视频的开源项目,使用者众多.2016年末paulcher发现FFmpeg三个堆溢出漏洞分别为CVE-2016-10190 ...
- metasploit--exploit模块信息
Name Disclosure Date Rank Description ---- ...
- Kali linux 2016.2(Rolling)中的Exploits模块详解
简单来将,这个Exploits模块,就是针对不同的已知漏洞的利用程序. root@kali:~# msfconsole Unable to handle kernel NULL pointer der ...
- BUFFER OVERFLOW 10 Vulnerability & Exploit Example
SRC= http://www.tenouk.com/Bufferoverflowc/Bufferoverflow6.html THE VULNERABLE AND THE EXPLOIT W ...
- sqlmap用法大全
sqlmap参数详解: Usage: python sqlmap.py [options] Options(选项): -h, --help Show basic help mes ...
- fuzz实战之honggfuzz
Honggfuzz实战 前言 本文介绍 libfuzzer 和 afl 联合增强版 honggfuzz .同时介绍利用 honggfuzz 来 fuzz 网络应用服务. 介绍 honggfuzz 也是 ...
- An Assembly Language
BUFFER OVERFLOW 3 An Assembly Language Introduction Basic of x86 Architecture Assembly Language Comp ...
- arcmap Command
The information in this document is useful if you are trying to programmatically find a built-in com ...
随机推荐
- Asp.Net Mvc的几个小问题
突然想到一些小问题,对写代码影响不大,当是又很实用. MVC 中视图中的model的大小写问题,什么时候用大写,什么时候用小写? 所谓强类型视图,就是通过@model指令指明当前Model(属性)的具 ...
- Jenkins+Jmeter+Ant自动化集成环境搭建
1.搭建环境,安装以下工具 JDK:jdk1.7.0_79 Ant:apache-ant-1.9.7 Jmeter: apache-jmeter-3.0 Jenkins: jenkins-1.651. ...
- java实现版本比较
package com.hzxc.chess.server.util; /** * Created by hdwang on 2018/3/19. * 版本比较工具类 */ public class ...
- 解题:BZOJ 2989 数列
题面 学习二进制分组 题目本身可以看成二维平面上的问题,转成切比雪夫距离后就是矩形和了 二进制分组是将每个修改添加到末尾,然后从后往前二进制下进位合并,这样最多同时有$\log n$组,每个修改只会被 ...
- Qtree4——动态点分治
题目描述 给出一棵边带权的节点数量为n的树,初始树上所有节点都是白色.有两种操作: C x,改变节点x的颜色,即白变黑,黑变白 A,询问树中最远的两个白色节点的距离,这两个白色节点可以重合(此时距离为 ...
- 收藏:IPicture总结
1.IPicture接口对象的创建方法1:直接通过文件创建LPCSTR szFileUrl; IPicture *pIPicture; OleLoadPicturePath(CComBSTR(szFi ...
- 关于NIO一些优化
1. 使用NIO开发web服务,传输文件内容,可以使用FileChannel.transferTo(position,count,socketChannel)来提升性能: 经过测试,确实能提升10% ...
- zabbix agent安装(三)
转载于https://mp.weixin.qq.com/s/33ab-JLoRfMkeI4aZDciJQ 前一篇文章介绍了zabbix server安装,这篇文章主要讲解zabbix agent安装以 ...
- ubuntu ssh root登陆
原文:https://blog.csdn.net/wy_97/article/details/78294562 1.默认使用ubuntu用户登录,密码为服务器配置时设置的密码,可在重置密码中修改 2. ...
- python 获取自身ip
原文 见过很多获取服务器本地IP的代码,个人觉得都不是很好,例如以下这些 不推荐:靠猜测去获取本地IP方法 #!/usr/bin/env python # -*- coding: utf-8 -*- ...