### 漏洞类型:整数溢出漏洞
### 影响组件介绍:Adobe Flash Player、Adobe AIR SDK和Adobe AIR SDK & Compiler都是美国奥多比(Adobe)公司的产品。Adobe Flash Player是一款多媒体播放器产品;Adobe AIR SDK和Adobe AIR SDK & Compiler都是适用于Adobe AIR(一个跨操作系统的运行时环境)的标准开发工具包。
## 漏洞分析:
### 原因:
action script 3.0中avm2.intrinsics.memory.casi32函数在进行内存操作时,发生整数溢出,导致没有正确检查到内存操作的偏移,导致内存越界读写。可使Uint Vector的length字段被改写,进而使用ActionScript3的Sound对象,泄露基地址,构造ROP,运行shellcode,等等。
### 详细分析:</br>
casi32函数:casi32是ActionScript3里面用来操作domainMemory的函数之一,domainMemory是用来加速内存读写操作而加入的工具类。
casi32(addr:int, expectedVal:int, newVal:int):int
该函数的语意是:”Compare And Swap” (比较并交换),第一个参数addr表示操作的内存地址(相对于domainMemory),第二个参数expectedVal表示要比较的值,而最后一个参数newVal是要交换的值。
该函数内部机制中存在长度检查时的整数溢出,导致检查不正确;(具体调试过程见[http://weibo.com/p/1001603769606924861349](http://)或[https://blogs.technet.microsoft.com/mmpc/2014/11/05/cracking-the-cve-2014-0569-nutshell/](http://)),
这样,我们可以构造利用条件,首先利用flash vector在内存中建立ByteArray和Uint Vector相连的布局;
### 代码:
//预先定义的ByteArray对象,大小为0x1000
```
1._local3 = (this.orlyfx[_local1] as ByteArray);
```
//domainMemory值设为_local3;
```
2.ApplicationDomain.currentDomain.domainMemory = _local3;
```
//比较_local3与0x1000大小;相等则将_local长度设为0
//但内存不会立即释放,对应数组还保持0x1000字节的内存
```
3._local3.atomicCompareAndSwapLength(0x1000, 0);
```
//调用casi32,casi32函数内由于整数溢出造成执行流改变,致使向_loc3偏移0x1000处成功写入0x40000001
```
4.if(casi32(0x1000, 1022, 0x40000001) == 1022)
```
后续使用ActionScript3的Sound对象,泄露基地址,构造ROP,运行shellcode具体代码可见[http://www.myhack58.com/Article/html/3/62/2014/56259_2.htm
](http://)
全部评论 (1)