神秘的sigs文件中挖据出新APT组织-Nazar
The following article is from 关键基础设施安全应急响应中心 Author 绿盟科技 田泽夏
三年前左右,在2017年4月14日,一个神秘的黑客组织影子经纪人(ShadowBrokers)在互联网上公布了一系列的黑客工具和漏洞,这些曾经被NSA利用的工具/漏洞一定程度上给互联网带来了大地震。
这批泄露中涵盖多种黑客工具和不同的漏洞,例如Windows的“永恒之蓝”漏洞,就是造成WannaCry以及后来NotPetya勒索软件席卷全球的最大元凶。除此之外,研究人员还发现了更多未知内容,尝试解读出其中隐藏的各种秘密。
Sigs.py这个文件据说是作为一个精简版的恶意软件扫描器,被NSA部署在目标系统中,通过扫描目标系统是否存在一些行为特征,从而判断目标系统中是否还有其他APT存在。
这个文件中包含44个特征指纹(Signatures)用来检测其他APT组织的行为,编号为1-45号,其中不包括第42号。如果研究人员的推测是正确的,那么这个文件就表明NSA掌握至少44个APT组织的恶意行为特征,这远超目前公开的APT数量。
下图是sigs.py文件的部分内容:
到目前为止,研究人员已经解开了29个特征的谜底,对应到了各自的APT特征。15个特征的归属仍然是个迷,再一次间接表明NSA在识别各种APT行动上的能力。下面是研究人员暂时还没有解开的特征序号:
这次的研究发现其实更正了一个关于sig37的错误。在此之前,CrySySLab发布的报告中称sig37可能和APT组织IronTiger(亦称作EmissaryPanda)有关,被推测是一个和中国有关的APT组织。然而在这次峰会上,Guerrero-Saade表示sig37对应的可能完全是另一个全新的黑客组织,极有可能和伊朗有关。通过对比这些活动和现有的公开APT组织活动,可以确定sig37代表着一个全新的黑客组织,并且活动时间最早可以追溯至2008年,但主要活动时间在2010年至2013年。
Guerrero-Saade暂时将这个组织的名字命名为Nazar,源于与其相关的恶意样本中出现的一个字符串。有趣的是,“Nazar”从波斯语(伊朗使用的语言之一)翻译成罗马字符时意思为“监视”,结合NSA和伊朗这一因素,也给sig37的新归属增添了几分真实性。
下面是Nazar的组件结构简图:
该恶意软件使用子组件DLL来实现麦克风录音和屏幕抓图功能以及按键记录功能。恶意代码利用两个自定义资源,即“godown.dll”和“filesystem.dll”,并注册为OLE控件,来枚举连接的驱动器,遍历文件夹结构并处理某些C&C功能。恶意代码使用内核驱动程序来嗅探来自受害者机器接口的数据包,并解析它们以获取特定的字符串。
Guerrero-Saade已经在其个人博客中更新了关于Sig37和Nazar组织更详细的分析内容
1rule apt_ZZ_SIG37_NAZAR_GpUpdatesExe
2{
3 meta:
4 desc = "SIG37 GpUpdates dropper, Chilkat Zip2Secure"
5 author = "JAG-S"
6 hash = "75e4d73252c753cd8e177820eb261cd72fecd7360cc8ec3feeab7bd129c01ff6"
7 strings:
8 $open = "open" ascii wide fullword
9 $regsrv = "regsvr32.exe" ascii wide
10 $filename1 = "Godown.dll -s" ascii wide
11 $filename2 = "ViewScreen.dll -s" ascii wide
12 $filename3 = "Filesystem.dll -s" ascii wide
13
14 condition:
15 uint16(0) == 0x5a4d
16 and
17 ($open and $regsrv and (1 of ($filename*)))
18}
19
20rule apt_ZZ_SIG37_NAZAR_FarsiResources
21{
22 meta:
23 desc = "SIG37 GpUpdates Shared Farsi resources"
24 author = "JAG-S"
25 hash = "75e4d73252c753cd8e177820eb261cd72fecd7360cc8ec3feeab7bd129c01ff6"
26 condition:
27 uint16(0) == 0x5a4d
28 and
29 for any i in (0..pe.number_of_resources - 1): //FARSI resources
30 (
31 hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "893cf8c164106784669b395825f17c21f46a345babfff6144686e8e1a48bf2f1"
32 or
33 hash.sha256(pe.resources[i].offset, pe.resources[i].length) == "26ee0ff37e6ffd30ca5415992ececc5faeb8e6a937fcbeb3952ce5581456b7b5"
34 )
35}
36
37rule apt_ZZ_SIG37_NAZAR_GoDownDll
38{
39 meta:
40 desc = "SIG37 Dropped TypeLibrary"
41 author = "JAG-S"
42 hash = "8fb9a22b20a338d90c7ceb9424d079a61ca7ccb7f78ffb7d74d2f403ae9fbeec" //??
43 strings:
44 $godown1 = /Godown [0-9.]{1,4} Type LibraryWWW/ ascii wide
45 $godown2 = "Godown.Shutdown.1" ascii wide
46 $godown3 = "qGODOWNLibWWW" ascii wide
47
48 $guid1 = "{772BA12D-8A62-4DD3-B3E8-92DA702E6F3D}" ascii wide //TypeLib reg
49 $guid2 = "{B64E94AF-D56B-48B4-B178-AF0723E72AB5}" ascii wide //TypeLib reg
50 $guid3 = "{DBCB4B31-21B8-4A0F-BC69-0C3CE3B66D00}" ascii wide
51
52 $shutdown1 = "aShutdownd" ascii wide
53 $shutdown2 = "IShutdownWWWd" ascii wide
54 $shutdown3 = "IShutdown InterfaceWWW" ascii wide
55 $shutdown4 = "method PowerOffWWW" ascii wide
56 $shutdown5 = "property TimeoutWW" ascii wide
57
58 condition:
59 uint16(0) == 0x5a4d
60 and
61 (
62 any of ($godown*)
63 or
64 any of ($guid*)
65 or
66 2 of ($shutdown*)
67 )
68}
69
70rule apt_ZZ_SIG37_NAZAR_Kzher_pdb
71{
72 meta:
73 desc = "GoDown PDB Path"
74 author = "JAG-S"
75 hash = "4d0ab3951df93589a874192569cac88f7107f595600e274f52e2b75f68593bca"
76 hash = "d9801b4da1dbc5264e83029abb93e800d3c9971c650ecc2df5f85bcc10c7bd61"
77 hash = "1110c3e34b6bbaadc5082fabbdd69f492f3b1480724b879a3df0035ff487fd6f"
78 strings:
79 $pdb_spec = "C:\\khzer\\DLLs\\DLL's Source\\" ascii wide
80 $pdb_gen = "C:\\khzer\\" ascii wide
81
82 condition:
83 uint16(0) == 0x5a4d
84 and
85 any of them
86}
87
88
89rule apt_ZZ_SIG37_NAZAR_GpUpdates_Distribute
90{
91 meta:
92 desc = "SIG37 GpUpdates unpacked distributor: Distribute.exe"
93 author = "JAG-S"
94 hash = "6b8ea9a156d495ec089710710ce3f4b1e19251c1d0e5b2c21bbeeab05e7b331f"
95 parent = "d34a996826ea5a028f5b4713c797247913f036ca0063cc4c18d8b04736fa0b65"
96 strings:
97 $uniq_filename1 = "\\godown.dll" ascii wide
98
99
100 $common_filename1 = "\\ViewScreen.dll" ascii wide
101 $common_filename2 = "\\filesystem.dll" ascii wide
102 $common_filename3 = "\\dllcache\\svchost.exe" ascii wide
103 $common_filename4 = "\\lame_enc.dll" ascii wide
104 $common_filename5 = "\\hodll.dll" ascii wide
105
106 $service1 = "Provides basic host functionality" ascii wide
107 $service2 = "EYService" ascii wide
108 $service3 = "Windows Host Service" ascii wide
109 condition:
110 uint16(0) == 0x5a4d
111 and
112 (
113 any of ($uniq_filename*)
114 or
115 all of ($common_filename*)
116 or
117 (all of ($service*) and 3 of ($common_filename*))
118 )
119}
对于sigs.py的探究还在继续,这次发现可谓是给研究人员的一针兴奋剂,至于还未解密的那些特征(Signatures)带来的是真相还是所谓真相的冰山一角,就让我们拭目以待吧。
参考链接:
[1].OPCDE峰会演讲视频:https://www.youtube.com/watch?v=QImyKDvryq8&feature=youtu.be
[2].Sigs.py文件:https://github.com/misterch0c/shadowbroker/blob/master/windows/Resources/TeDi/PyScripts/sigs.py
[3].CrySysLab报告:https://www.crysys.hu/publications/files/tedi/ukatemicrysys_territorialdispute.pdf
[4].Guerrero-Saade博客:https://www.epicturla.com/blog/the-lost-nazar
[5].https://securityaffairs.co/wordpress/102138/apt/nazar-apt-shadow-brokers-leak.html
[6].https://www.zdnet.com/article/security-researcher-identifies-new-apt-group-mentioned-in-2017-shadow-brokers-leak/#ftag=RSSbaffb68
格物实验室专注于工业互联网、物联网和车联网三大业务场景的安全研究。 致力于以场景为导向,智能设备为中心的漏洞挖掘、研究与安全分析,关注物联网资产、漏洞、威胁分析。目前已发布多篇研究报告,包括《物联网安全白皮书》、《物联网安全年报2017》、《物联网安全年报2018》、《物联网安全年报2019》、《国内物联网资产的暴露情况分析》、《智能设备安全分析手册》等。与产品团队联合推出绿盟物联网安全风控平台,定位运营商行业物联网卡的风险管控;推出固件安全检测平台,以便快速发现设备中可能存在的漏洞,以避免因弱口令、溢出等漏洞引起设备控制权限的泄露。
往期回顾
本公众号原创文章仅代表作者观点,不代表绿盟科技立场。所有原创内容版权均属绿盟科技研究通讯。未经授权,严禁任何媒体以及微信公众号复制、转载、摘编或以其他方式使用,转载须注明来自绿盟科技研究通讯并附上本文链接。
关于我们
绿盟科技研究通讯由绿盟科技创新中心负责运营,绿盟科技创新中心是绿盟科技的前沿技术研究部门。包括云安全实验室、安全大数据分析实验室和物联网安全实验室。团队成员由来自清华、北大、哈工大、中科院、北邮等多所重点院校的博士和硕士组成。
绿盟科技创新中心作为“中关村科技园区海淀园博士后工作站分站”的重要培养单位之一,与清华大学进行博士后联合培养,科研成果已涵盖各类国家课题项目、国家专利、国家标准、高水平学术论文、出版专业书籍等。
我们持续探索信息安全领域的前沿学术方向,从实践出发,结合公司资源和先进技术,实现概念级的原型系统,进而交付产品线孵化产品并创造巨大的经济价值。
长按上方二维码,即可关注我们