IC00AJ74 · Week 4 · activity 4

Task 4: Static analysis of a trojan

Decompile an encrypted .NET sample and explain its persistence and DDoS behavior.
180minutes
1point

In the previous task, we took the first steps for JIT-compiled binary reverse engineering. The binary was created with C# as .NET project.

In this task, we are going to figure out what file boom.ecrypted is actually doing. Based on the previous task, we have enough information to decrypt the file and get the original binary file. This task is going a little further with binary reversing.

boom.encrypted is included in misc/malware/ and is the same file the dropped executable would download, so no network download is needed.

Let’s see what the basic Linux command file has to say about this one:

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

Looks like we are probably facing .NET assembly again.

We can still use the previously mentioned ILSpy. Alternatively, dnSpyEx (an actively maintained fork of dnSpy) is convenient for GUI-based analysis when a Windows environment is available.

When using ILSpy, pay attention to the tool parameters. The one about whole project decompilation is really useful in this case. Decompilation might take some time. Files are not protected at all.

This malware was written in Visual Basic (we can see the code as C#) and looks like it has been a Microsoft Visual Studio project.

Now, the intention of this task is to write a short report on what the program is actually doing.

Since we can read the program mostly in C#, it shouldn’t be that hard at all. (In most cases malware is written in C language or protected somehow, and in those cases we might need to read pure machine instructions instead.)

You are free to use any tools you want, as long as you are not analysing in your host system in an unsafe environment. Even though this malware is not dangerous anymore, it’s good to have principles, and it leaves some files on your machine anyway.

TIP: In case .resource files (binary type) are provided instead of .resx format, you can convert it into .resx format from command-line as:

resgen Resource.resource Resource.resx (you might need to install the mono-complete package (Debian) for that)

Working with .resx files

If you have an up-to-date Windows 11 machine with Pro, Enterprise, or Education licence, you can use Windows Sandbox to executing the files, if you want to, particularly for seeing the hidden GUI. Another way is to use Windows evaluation image on VMware or other virtualization solutions.

Answer at least to these questions in your report (if they differ from your template, use these in confusion):

  • What was the connected domain? What did it do at first? Did it enable something that further steps succeeded?
  • This file contains two additional binaries. (These files have been encoded to .resx file somehow) What are their names? How are those files used?
  • Find a way to reverse these files as well, and include the general purposes of these files as well to your report. Additionally:
    • How were bots controlled? There were at least two ways; describe the automatic approach at least.
    • Some source code or ideas of some common DDoS tools have been used in this malware. Describe three of them. It’s enough to identify tools, you can look for information about them elsewhere.
    • Malware actually contains a hidden GUI for DDoS tools it is using. Can you find and use it? Describe how you did/could do it.

Shared files

Shared files