Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

$
0
0
【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

2017-08-25 14:23:55

阅读:255次
点赞(0)
收藏
来源: 安全客





【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

作者:360天眼实验室






【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

作者:360天眼实验室


背景

APT 过程的关键环节

洛马的Kill Chain模型

武器构建

伪装的正常文档捆绑漏洞利用代码

载荷投递

发送带捆绑了恶意附件的邮件到目标

突破利用

目标尝试点击打开邮件附件,触发漏洞或代码执行机制,如果是内存类的漏洞,可能的Shellcode会得到执行


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

图片来源:http://www.darkreading.com/attacks-breaches/deconstructing-the-cyber-kill-chain/a/d-id/1317542

面临的挑战

获取定向攻击活动的线索

IP/Domain/Sample

从海量样本中识别特殊的样本

关注鱼叉邮件

大部分的恶意邮件附件是Botnet与勒索软件相关的


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

图片来源:https://www.threatconnect.com/platform/methodology/

鱼叉邮件攻击中所使用的漏洞


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码
漏洞利用与shellcode

Shellcode:什么和为什么

基本上就是一段不需要操作系统负责加载执行的机器码

内存破坏类Exploit的必要组件,相对独立

1)漏洞利用成功以后第一阶段执行的指令,开辟通信通道连接到C&C服务器

2)获取其他恶意组件代码执行,包括后门远控及各种专用恶意组件


方法

样本集

关注鱼叉攻击中被高频使用的RTF文件

11672 个样本文件

绝大多数收集自VirusTotal, 40%被捆绑了已知的Exploit

漏洞在样本中分布


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

shellcode检测

扫描文件中可能存在Shellcode的对象

足够大的block


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

在Block中扫描Shellcode中频繁用到的指令

从ASCII转换为二进制

搜索Shellcode指令


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

使用IDA反汇编二进制数据

通过IDC脚本调用MakeCode()来查找和生成ASM代码

idaw.exe-c-A-S“extract_sc.idcoffset”binary_data.dat
【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码
Shellcode检测和抽取演示

【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

Shellcode抽取

抽取统计

一半样本只包含一段shellcode

另一半样本包含两段Shellcode


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

Shellcode 聚类

N-gram feature


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

两阶段的 K-means 聚类

第1阶段挑出小簇

第2阶段划分剩下的大簇


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

统计


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

分析

两个基本假设

高级恶意代码有其独特的Shellcode

APT攻击由于其定向性涉及的恶意代码数量比一般攻击要少得多


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

已知的

Cluster 60

Sample 数量: 1

258fc73ce3ba011948f8704bbe3d87bc

www.agv-us.com

58.158.177.102


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

数据来源: Alienvault


Cluster 100

Sample 数量: 4

F845e5cc072360fa6ef1b8d50f9491ec

194.28.172.58


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码

数据来源: Alienvault

360威胁情报中心的判定


【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码
未知的

Cluster 108

6 shellcodes

217.91.17.152:443 216.70.141.250:80 msnmail.mobwork.net

Cluster 56

2 shellcodes

firewall.happytohell.com

Cluster 65

6 shellcodes

boy-girl2013.narod2.ru


结论

一个简单有效的方法

可能漏过许多,但误报很少

单维度的数据异常不够

假设1并不一定正确

Shellcode可能并没有全部被抽取

聚类算法可以再优化


团队介绍

360天眼实验室

360企业安全集团的安全研究机构

关注恶意代码及APT攻击事件分析

2015年5月发布海莲花团伙的报告



【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码
【技术分享】通过Shellcode聚类识别定向攻击(APT)相关的恶意代码
本文由 安全客 原创发布,如需转载请注明来源及本文地址。
本文地址:http://bobao.360.cn/learning/detail/4317.html

Viewing all articles
Browse latest Browse all 12749

Latest Images

Trending Articles





Latest Images