Here are my notes on the latest malware sample using CVE-2019-0541 to target Poland and drop .NET RAT. I’m going to focus on finding similarities between this case, and previous .NET rat connecting to the same IP address dropped by a COVID-19 document.

Name: conhost.exe

MD5: 0acecad57c4015e14d9b3bb02b433d3e


Firstly, we’ll start the investigation from the older sample, that was used together with COVID-19 document lure, potentially targeting Ukraine. Unfortunately, at the time that I’ve noticed the sample, the C2 wasn’t responding so we’ll have to stick with the already finished Any.Run reports.

Process Graph

Looking at the process graph of the infection, we can see some characterstics about it.

  • Payload was dropped by initial document sample.
  • Payload was executed with cmd.exe.
  • Payload executed a bunch of commands via cmd.exe.
    • reg.exe
    • systeminfo.exe
    • attrib.exe

C2: cloud-security.ggpht[.]ml|145.239.23[.]7

Let’s focus on the EXE. It’s an .NET executable so reverse engineering it shouldn’t be to hard.

$ file conhost.exe 
conhost.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows

As the function names were not clearly not easy to distinguish, we can pass it to de4dot tools in order to change it inot something more readable.

DnSpy Initial Look

Starting out, here is hardcoded domain of the C2 together with the User-Agent used in communication.

Domaind and UA

Now let’s take a look at the characteristics of this RAT. First of all is the function that gathers some information about the system in order to, then, identify itself to the C2 servers. Information consists of:

  • User Name.
  • Machine Name.
  • Network Interfaces.
  • MD5 of the currently executing file.

Host Information Gathering

Later on, that information is sent to the C2 in a POST request, with information passed in X-Reg header. Value of Set-Cookie, returned by the server will be saved in a variable, and used in every further request to the server.

First Request to C2

Regarding further communication with C2, all is done with GET requests. In Cookie field, we have a value previously passed to us from the C2. Further more, C2 will serve us with two informations - data to track executed commands and a base64 encoded command, that will be later on decoded and executed via cmd.exe.

Commands from C2

Last network method is used to exfiltrate base64 encoded data from the infected system to the C2. To track, to which command sample responds, in the Cookie field the first value from the previous GET request is added.

Exfiltrate Data

And that’s whole communication with the C2, basically also most of the functionality of the RAT - executing commands from the C2 and exfiltrating returned data. Nothing fancy and complicated. To bring a little context, here is the function that executes commands.

Execute CMD

Name: EdgeSubProtect.dll

MD5: d2b81c4f5d075daa681f823cc9a5e4c0


Moving on to the next sample, this one was used together with CVE-2019-0541 exploit in a .CHM file. Firstly looking at the functions we can see a different type of obfuscation, functions name consist only of l, 1, 0 and o characters.

Functions Names

First thing that is noticable in the sample is a bunch of encrypted strings used later in the RATs workflow. Algorithm is very simple, we have one array that is key and a bunch of arrays - all of the numbers in arrays are xored with a corresponding number in key array, modulo key length.

Encrypted Strings

Here’s a small Python script and the output of it.

strings = [

key = [203,25,58,129,170,254,47,161,200,190,213,64,138,49,207,13,128,3,174]

for string in strings:
    out = ''
    for i in range(0, len(string)):
        out += chr(string[i] ^ key[i % len(key)])

# Output
# Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.319.43
# ;YSC=
# $timeout
# $screen
# $type
# $upload
# cmd.exe
# /c 
# REG ADD HKCU\\Console /v CodePage /t REG_DWORD /d 65001 /f
# :
# "
# '
# &
# ,
# x2
# \\.\root\cimv2
# SELECT * FROM Win32_ComputerSystem
# SELECT * FROM Win32_ComputerSystemProduct
# Name
# Manufacturer
# Model
# IdentifyingNumber
# 0
# 1
# \"(https?:\/\/).*?\"
# \"[A-Za-z]:.*\"
# |

C2: microsoft-hohm[.]space

Generally, apart from the function names, this code uses a lot more of CallSite than the previous sample. For example, here is a function that generates SHA1 hash of a file currently executed, substringed from the 10+ index.

SHA1 Hash

In addition, here we have a function that, recovers information about the infected system, this time using WMI and ManagementScope interface.

Information Gathering

Together with strings recovered from the sample, we can immedietaly see used information that will be recovered from the system and later on, passed to the C2 server. In these there are:

  • User Name.
  • Computer Name.
  • Network Interfaces.
  • SHA1 Hash of a file currently executed.
SELECT * FROM Win32_ComputerSystem
SELECT * FROM Win32_ComputerSystemProduct
return ll1001o.<>o__7.<>p__18.Target(ll1001o.<>o__7.<>p__18, typeof(string), Environment.UserName, lll0l0o1oo010l.ll0o01o010000, arg, lll0l0o1oo010l.ll0o01o010000, arg2, lll0l0o1oo010l.ll0o01o010000, arg3, lll0l0o1oo010l.ll0o01o010000, arg4, lll0l0o1oo010l.ll0o01o010000, lll0lo1llo11001.llol011lllo11);

Moving on, we have functions used to communicate with C2. Once again, we have three functions that perform communication with C2 - first one used to identify to the server, second to get commands and third to return data from this commands. First command is POST request to the C2 that uses Referer field to pass all the gather information. Once again, value from the Set-Cookie will be saved and used in later communication in a Cookie field.

Initial Request

Here, we have another function that will use a GET request to get commands from the C2 server. It’s functioning is mostly identical to the function from the previous sample, so we won’t dig into this much further.

Get Commands

Lastly, there is a function to send back data, from the executed commands. Using POST request, base64 encoded data will be sent back to the C2.

Exfiltrate Data

So, it seems that both C2 protocols seem to be pretty consistent. In this sample, commands will be once again executed with cmd.exe. In addition, we have one more feature to the RAT that wasn’t there in the previous version - taking screenshots of screen. Here is the function responsible for that, which base64 encodes the picture.

Screenshots Function