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

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

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

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

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

图1

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

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

图2

运行该xlsx后会从远端(C&C:people.dohabayt.com)下载释放恶意swf文件(MD5: ee34f466491a5c5cd7423849f32b58f5)并运行,该swf文件会再次请求服务端,下载加密数据以及解密KEY,解密后的文件swf(md5: f63a51e78116bebfa1780736d343c9eb),该文件为Flash 0day exploit,漏洞触发后请求远端下载恶意shell并执行。在实时分析的过程中,我们发现攻击者已关闭最终木马荷载的下发。

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

图 3

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

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

图4

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

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

图5

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

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

图6

代码中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.

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

图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.

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

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

图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.

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

图10

漏洞攻击的C&C是people.dohabayt.com,其对应的ip地址为185.145.128.57(荷兰),从该域名的whois信息显示该域名注册时间为2018-02-18,说明攻击者在今年2月期间就开始筹备攻击。

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

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

图11

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

图12

people.bayt.com是一个中东地区的求职网站,攻击者使用的C&C只是多了一个doha(多哈),明显有伪装域名进行钓鱼的意图,因此我们大胆猜测攻击者针对地区为卡塔尔多哈。

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


分享到:


相關文章: