首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

CVE-2018-5002 第二波Flash零日漏洞在野攻击分析预警

背景

2018年6月1日,360核心安全高级威胁应对团队在全球范围内率先捕获了新的一起使用Flash 零日漏洞的在野攻击,黑客精心构造了一个从远程加载Flash漏洞的Office文档,打开文档后所有的漏洞利用代码和恶意荷载均通过远程的服务器下发,此次攻击主要针对中东地区。

相关漏洞文件分析

该样本具有比较诱惑性的文件名basic_salary.xlsx(基本工资),其内容也与标题符合,为各个时间阶段的工资,语言采用阿拉伯语。

basic_salary.xlsx(MD5: c8aaaa517277fb0dbb4bbf724245e663)文档内容完整,其部分内容截图如下:

图1

黑客通过activex控件和数据嵌入了一个远程的flash文件链接,相关的漏洞攻击代码由远程的服务器脚本控制下发。

图2

漏洞攻击流程分析

图3

漏洞攻击的多个阶段流程如下:

图4

漏洞原理分析

漏洞的flash攻击代码经过了高度混淆,经过调试分析我们在攻击样本中定位到了零日漏洞攻击代码。

图5

经过还原后的关键代码如下:

package

{

public class class_6

{

{

try{

}

catch(e:Error)

{

return;

}

li8(123456);

}

public function class_6(){

super();

}

}

}

代码中Static-init methods Flash会使用解释器去处理,解释器在处理try catch语句时没有正确的处理好异常的作用域,导致代码中li8(123456)指令触发异常后会被catch块捕获。

而处理try catch语句时由于Flash认为没有代码能执行到catch语句块,所以也没有对catch语句块中的字节码做检查,攻击者通过在catch语句块中使用getlocal,setlocal指令来实现对栈上容易地址读写。最终,攻击者通过交换栈上的2个对象指针来将漏洞转为类型混淆问题完成攻击。

Flash will use the interpreter to handle Static-init methods. The interpreter handles the try catch statement does not correctly handle the exception, and this will make li8 (123456) instruction caught by the catch block when it triggers the exception.

Because Flash assumes that it is impossible to execute to the catch block when processing the try catch statement, it does not check the bytecode in the catch block. The attacker uses the getlocal, setlocal instruction in the catch block to read and write arbitrary addresses on the stack.

In this wild used 0 day, the attacker switches the vulnerability to a type confusion by exchanging two object pointers on the stack and finally completes the attack.

进一步调试攻击代码,可以观察到漏洞利用的字节码,发现函数的localcount 值为2,而在catch块中getlocal,setlocal已经操作448和498位置的数据。

The vulnerability exploited bytecode discovery function has a localcount value of 2, whereas in the catch block getlocal, setlocal has manipulated the data at locations 448 and 498.

图7

调试观察利用中setlocal操作栈数据,图中可以看到ecx的值是class5对象的指针,068fc1a0正是class7的指针。

Let’s observe setlocal operation stack data. The value of ecx is the pointer of the class5 object, and 068fc1a0 is the pointer of class7.

图 8

图9

交换完2个对象的指针后攻击者通过比较对象成员的值来判断利用是否成功。

After exchanging the pointers of two objects, the attacker judges whether the exploited is successful by comparing the values of the object members.

图10

攻击关联信息分析

直接访问people.dohabayt.com ,访问会被强制重定向到https://people.bayt.com/sushasolomon/ 一名卡塔尔航空的职员介绍主页。

图11

图12

总结

通过分析我们可以发现此次攻击不计成本使用了零日漏洞,攻击者在云端开发了精巧的攻击方案,并花了至少三个月以上筹备攻击,针对攻击目标定制了详细的钓鱼攻击内容,是一起典型的APT攻击。请相关单位和普通用户都需提高安全防范意识,及时更新Flash版本,并使用360安全卫士防御可能出现的漏洞威胁。

本文转自黑白之道 版权归原作者所有

安全圈综合整理 如有侵权请联系删除

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20180608A1CXAQ00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券