text
stringlengths
1
38.9k
Through this vector , we could drop our own Quasar clien on the attacker ’s server and execute it .
Our Quasar RAT will connect to our own ( secured , of course ) Quasar serve , allowing us to control that attacker ’s server with his own RAT .
We can also replace β€œ shfolder.dll ” ( and add a DLL export proxy to avoid a crash ) , which is loaded whenever the attacker clicks the builder tab – allowing us to infect the server while it runs , without the need to wait for application restart .
Although Downeks has been publicly examined to some extent , our analysis found several features not previously described .
Earlier Downeks samples were all written in native code .
However , among our Downeks samples , we found new versions apparently written in .NET .
We observe many behavioral similarities and unique strings across both the native-Downeks versions , and the new .NET Downeks versions .
Almost all of the strings and behaviors we describe in this analysis of a .NET version are also present in the native version .
We observed these samples deployed only against Hebrew-speaking targets .
Downeks .NET internal name is β€œ SharpDownloader ” , β€œ Sharp ” may be a reference to the language it was written in – C# .
As seen in previous Downeks versions , it uses masquerades with icons , filenames and metadata imitating popular legitimate applications such as VMware workstation and CCleaner , or common file formats such as DOC and PDF .
All 3 samples were compiled with the same timestamp .
Downeks.NET is obfuscated using β€œ Yano ” and can be easily de-obfuscated using the de4dot utility .
SHA256 : 4dcf5bd2c7a5822831d9f22f46bd2369c4c9df17cc99eb29975b5e8ae7e88606 .
SHA256 : 905f6a62749ca6f0fd33345d6a8b1831d87e9fd1f81a59cd3add82643b367693 .
SHA256 : c885f09b10feb88d7d176fe1a01ed8b480deb42324d2bb825e96fe1408e2a35f .
Downeks is a backdoor with only very basic capabilities .
It communicates with the C2 server using HTTP POST requests .
It runs in an infinite loop , in each iteration it requests a command from the C2 , and then it sleeps for a time period it receives in the C2 response ( defaulting to 1 second if no sleep-time sent ) .
The data that is sent in the POST is serialized with json , which is then is encrypted , and finally encoded in base64 .
The json format is typically { β€œmth ” :” some_method ” , β€œ data ” :” some_encrypted_data ” } .
server responds using the same format and serialization/encryption/encoding .
As described in earlier analyses , Downeks ’ main purpose is as a downloader .
Unfortunately , we were unable to get anyservers to issue download commands to any samples that we tested in our lab .
The download is initiated upon receiving json with a β€œ download ” command , which includes the URL of the file to be downloaded .
Downeks can also be instructed to execute binaries that already exist on the victim machine .
After successful execution , Downeks returns the results to theDowneks also has a self-update capability , if instructed by the C2 .
Downeks can be instructed with the β€œ img ” command to capture the victim screen and transmit it back to the C2 .
The parameters β€œ wth ” and β€œ qlt ” specify β€œ width ” and β€œ quality ” .
Downeks .NET creates a file in the β€œ Appdata ” directory , based on certain properties of the machine .
During our analysis , Downeks created a file in β€œ Appdata\Roaming ” containing only β€œ SD{new line} 0 ” ( β€œ SD ” possibly for β€œ SharpDownloader ” ) .
Although this file itself is not particularly interesting , the older ( native ) Downeks versions also creates a file in Appdata\Roaming , with identical data .
The filenames across the two variants bear striking similarities .
The .NET variant creates β€œ 1FABFBFF0000065132F71D94 ” , while the native version creates β€œ 000206511FABFBFF ” .
We observed the string β€œ 1FABFBFF0000065132F71D94 ” in memory during debugging of the native variant .
This is a pseudo-unique ID for each machine , based on install date taken from the registry , volume serial number , OS version and service pack , Processor architecture , and computer name .
Downeks enumerates any antivirus products installed on the victim machine and transmits the list to the C2 .
It constructs this list using the WMI query : β€œSELECT displayName FROM AntivirusProduct ” .
Downeks achieves host persistence through either the registry β€œ run ” key or with a shortcut in the start-up folder .
In another similarity between both variants , Dowenks assesses the victim ’s external IP using an HTTP request toDowneks can be instructed by the C2 to perform a few other commands :Check if the computer name and user name , or external IP address , is in a provided list and if so , display a message box with a message as defined by the C2 .
Kill any running process and attempt to delete the associated executable .
β€œ Setup ” command – sends various info about the machine with each iteration of the C2 communications loop .
Downeks has static encryption keys hardcoded in the code .
Palo Alto Networks customers are protected from Downeks and Quasar used in this attack :WildFire properly classifies these Downeks and Quasar samples as malicious .
Traps detects and blocks malicious behavior exhibited by new , unknown Quasar samples .
C2 servers associated with this activity are blocked through Threat Prevention DNS signatures .
URI TERROR ATTACK & KASHMIR PROTEST THEMED SPEAR PHISHING emails TARGETING INDIAN EMBASSIES AND INDIAN MINISTRY OF EXTERNAL AFFAIRS - CYSINFO .
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 email to target officials in the Indian Embassies and Indian Ministry of External Affairs ( MEA ) .
In order to infect the victims , the attackers distributed spear-phishing emails containing malicious word document which dropped a 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 Indian Ministry of Home Affairs to send out email to the victims .
Attackers also used the name of the top-ranking official associated with Minister of Home affairs in the signature of the email , this is to make it look like the email was sent by a high-ranking Government official associated with Ministry of Home Affairs ( MHA ) .
In the The first wave of attack , The attackers spoofed an email id that is associated with Indian Ministry of Home Affairs ( MHA ) and an email was sent 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 as if an investigation report related to Uri terror attack was shared by the MHA official .
On Sept 20th,2016 similar Uri Terror report themed email was also sent to an email id connected with Indian embassy in Thailand .
This email was later forwarded on Oct 24th,2016 from a spoofed email id which is associated with Thailand Indian embassy to various email recipients connected to the Indian Ministry of External Affairs as shown in the below screen shot .
In this case Attackers again spoofed an email id associated with Indian Ministry of Home Affairs and the mail was sent on September 1,2016 to an email id associated Thailand Indian embassy , this email was later forwarded on Oct 24th,2016 from a spoofed email of Thailand Indian embassy to various email recipients connected to the Indian Ministry of External Affairs ( MEA ) .
This time the email was made to look like an investigation report related to Jammu & Kashmir protest was 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 Thailand Indian embassy to the MEA officials .
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 .
When the victim opens the attached word document it prompts the user to enable macro content and both the documents ( Uri Terror Report.doc and mha-report.doc ) displayed the same content and contained a Show Document button .
In case of both the documents ( Uri Terror Report.doc and mha-report.doc ) the malicious macro code was heavily obfuscated (used obscure variable/function names to make analysis harder ) and did not contain any auto execute functions .
Malicious activity is trigged only on user interaction , attackers normally use this technique to bypass sandbox/automated analysis .
Reverse engineering both the word documents ( Uri Terror Report.doc & mha-report.doc ) exhibited similar behaviour except the minor difference mentioned below .
In 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 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 event occurs a malicious obfuscated function ( chugnnarabashkoim() ) gets called .
The malicious macro code first decodes a string which contains a reference to the pastebin url .
The macro then decodes a PowerShell script which 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 in legitimate sites like Pastebin has advantages and it is highly unlikely to trigger any suspicion in security monitoring and also can bypass reputation based devices .
The dropped file was determined as modified version of 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 the actor groups in the middle east .
Once infected njRAT communicates to the attacker and allows the attacker to log keystrokes , upload/download files , access victims web camera , audio recording , steal credentials , view victims desktop , open reverse shell etc .
The dropped file was analyzed in an isolated environment ( without actually allowing it to connect to the c2 server ) .
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 Upon execution malware makes a connection to the c2 server on port 5555 and sends the system & operating system information along with some base64 encoded strings to the attacker as shown below .
This section contains the details of the c2 domain ( khanji.ddns.net ) .
Attackers used the DynamicDNS to host the c2 server , this allows the attacker 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 past .
During the timeline of this cyber attack most of these IP addresses were located in Pakistan and few IP addresses used the hosting provider infrastructure .
The c2 domain ( khanji.ddns.net ) was also found to be associated with multiple malware samples in the past , Some of these malware samples made connection to pastebin urls upon execution , which is similar to the behavior mentioned previously .
Based on the base64 encoded content posted in the Pastebin , userid 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 malwares in other campaigns to decode and drop malware executable ) , these posts were made between July 21st , 2016 to September 30 , 2016 .
Below screen shot shows the posts made by the user , the hits column in the below screen shot gives an idea of number of times the links were visited ( probably by the malicious macro code ) , this can give rough idea of the number of users who are probably infected as a result of opening the malicious document .
Doing a Google search for the Pastebin userid landed me on a YouTube video posted by an individual demonstrating his modified version of njRAT control panel/builder kit .
The Pastebin userid matched with the email ID mentioned by this individual in the YouTube video description section .
This same keyword was also found in the njRAT c2 communication used in this attack .
After inspecting the njRAT builder kit it was determined that this individual customized the existing njRAT builder kit to bypass security products .
The product information in the builder kit matched with this individual ’s YouTube username and the YouTube channel .
The njRAT used in this cyber attack was built from this builder kit .
Based on this information it can be concluded that espionage actors used this individual ’s modified version of njRAT in this cyber attack .
Even though this individual ’s email id matched with the Pastebin id where base64 encoded malicious code was found , it is hard to say if this individual was or was not involved in this cyber attack .
It could be possible that the espionage actors used his public identity as a diversion to mislead and to hide the real identity of the attackers or it is also possible that this individual was hired to carry out the attack .
The indicators are provided below , these indicators can be used by the organizations ( Government , Public and Private organizations ) to detect and investigate this attack campaign .
14b9d54f07f3facf1240c5ba89aa2410 ( googleupdate.exe ) .
2b0bd7e43c1f98f9db804011a54c11d6 ( malib.dll ) .
feec4b571756e8c015c884cb5441166b ( msccvs.dll ) .
84d9d0524e14d9ab5f88bbce6d2d2582 ( officeupdate.exe ) .
khanji.ddns.net 139.190.6.180 39.40.141.25 175.110.165.110 39.40.44.245 39.40.67.219 .
http://pastebin.com/raw/5j4hc8gT http://pastebin.com/raw/6bwniBtB .