(See part one of TAU’s Hakbit Ransomware analysis here.)
Many blue team defenders out there will attest to the fact that ransomware is on the rise, and that ransomware doesn’t appear to be going away any time soon. Ransomware is only one of the numerous types of commodity-based emerging threats which the TAU (Threat Analysis Unit) team actively monitors and responds to. Due to the fast-paced nature of commodity based threats such as ransomware, there is a natural priority and sense of urgency to react quickly to new ransomware families, campaigns, and variants in order to provide prevention and detection capabilities. During a recent investigation into Hakbit ransomware, TAU decided to hit the “pause” button and take some time out to investigate this particular ransomware variant. The research methodology and findings are discussed within this report.
Initial Triage
Starting with a recent Hakbit ransomware variant, the first phase was to perform a combination of static and dynamic analysis of the binary for the purpose of triage. The sample analyzed (SHA256 d187292551fce9f4751a8fab00b9f33088c7a38b7454825e35390b524ba969bd) is covered in greater detail in this blog post writeup. A full list of Indicators of Compromise (IOCs) and Tactics, Techniques and Procedures (TTPs) can be found at the end of this report.
Pivoting off of the import hash in VirusTotal returned over half a million samples. Using the import hash can often be useful when tracking threat actors and groups behind different malware families and campaigns. In this instance, the import hash is too broad and will retrieve far too many false positive samples for analysis. Upon closer inspection of our original binary, there were a couple of noteworthy artifacts. The first observation was that the binary was using the SmartAssembly .NET obfuscator by RedGate (specifically version 7.0.7.2439). Taken from the RedGate web site:
“SmartAssembly is an obfuscator that helps protect your application against reverse-engineering or modification, by making it difficult for a third-party to access your source code”.
In other words, although file obfuscation is often used for legitimate purposes such as to protect source code and intellectual property, malware authors also use such obfuscators in an attempt to hide their malicious source code. Obfuscation can ultimately make malware analysis more challenging as well as time consuming. This can be problematic when responding to malware outbreaks that have a high severity, impact, and infection rate.
The second interesting artifact from the Hakbit sample found was the following code snippet shown, which is explained below.
Figure 1: Hakbit code snippet
Walking through this code shows a network call attempted to a legitimate service icanhazip[.]com in order to retrieve the infected client’s IP address. This, along with the date of encryption, the unique client identifier key, and either the number of files encrypted or possible affected files are posted to a free, legitimate hosting service at a FTP address hosted on 000webhost[.]com. This would appear to be an attempt to notify the ransomware operator(s) of infected systems, so that they can keep track of their victims. It is worth noting that ransomware that leaks data publicly is also on the rise, and this may be another intention of this code snippet. Incidentally and per our observations, despite detonating this sample multiple times, no such call out was made to either of the two addresses. Upon further code review, it was found that the above function expected a string variable to be of a particular value. As the string value was globally set, and no other function used this variable, this entire function was bypassed. It is worth noting that performing full static analysis will often be the only way to confirm the full or partial functionality of malware.
As the import hash mentioned earlier was too broad, the next step was to construct a simple YARA rule to search for similar samples, thereby returning a more realistic sized set of samples that were associated with these two artifacts. The YARA rule is shown below.
Figure 2: YARA rule
The results yielded 25 samples from VirusTotal which required further analysis. As part of the processing of these additional samples, each sample was briefly statically and dynamically analyzed in order to produce the resulting output data to work with. The dynamic analysis processing consisted of using our purpose built MalwareLambda platform, as well as some 3rd party static analysis tools such as de4dot and monodis. These tools were used primarily to deobfuscate the SmartAssembly obfuscated binaries, as well as to disassemble and extract interesting artifacts such as strings, functions, classes and base64 encoded strings from the .NET/C# assemblies. The high level data pipeline is shown below.
Figure 3: Research pipeline
The resulting 25 samples can be cross referenced by their compile date and the number of submitters, which is shown in the below diagram.
Figure 4: Samples submitted to VirusTotal by compile date
Results
The first observation made was the spread of ransomware samples across primarily three different versions of SmartAssembly.
Figure 5: Smart Assembly versions
The three different versions of SmartAssembly shown are interesting because they may help to understand if either an individual, group of actors or certain campaigns are using a particular obfuscator version or type.
Our next step is to understand and review the encrypted file extension types found in the 25 samples so far. Although we might have expected all 25 samples to use the same Hakbit file extension “.crypted” for encrypting files on disk, the data shows us that this is not actually the case. In fact there are 5 additional file extensions found in our pool of samples.
Figure 6: Samples by encrypted file extension
Another interesting feature of reviewing the ransom note messages is that we can get an idea as to the different families, campaigns or variants, and their associated ransom demands. As shown in the following diagram, Hakbit ransomware typically includes ransom demands for between 0.3 and 3 Bitcoins. Interestingly although only one sample of Hentai Onichan ransomware was analyzed, it demands a payment of 30 BTC or approximately $267,000 at the time of writing this report. This could infer that this ransomware may be used as part of a targeted attack due to the way in which the demand is so much higher than other ransomwares in our sample set. The data shown in the diagram is drawn using a logarithmic scale to highlight the differences in ransom amounts.
Figure 7: Ransom Demand (BTC) by Ransomware
Further studying of the BitCoin wallet addresses indicate two things. Firstly, there are some wallet addresses that are used across the same ransomware family. For example, five out of the 25 samples feature the same wallet address for Hakbit ransomware. Secondly, this shows us wallet addresses featured in other ransomware families. One wallet address in particular is featured across four different ransomware families. This can also be cross-referenced by the file extension types shown above.
Figure 8: Ransomware by BTC wallet address
Without needing to do a deep and thorough dive, and using the data that we have collected, it is already clear that we are looking at non-Hakbit ransomware families which appear to be related to our initial Hakbit sample. Pivoting off of the contact email addresses contained within the ransom note messages, and performing some high-level OSINT, shines a further light on four additional ransomware families. Shown below is a graph visualization of the ransomware family names (represented by the red nodes), the contact email address found from within the ransom notes (represented by the green nodes), and the edges (represented by the lines) which highlight the connectedness and relationships of each.
Figure 9: Related ransomware families by contact email address
Taking things a step further, and using the country submitter information, we can also work out the relationships between the email contact addresses featured in the ransom note messages. We can then look to see whether or not there are any trends in terms of whether a specific actor or group is targeting specific countries. Although the sample set is small, we can make some high level inferences about the graph visualization below. One example might be the email contact address used for Ravack ransomware. Ravack was featured in two samples submitted from Malaysia to VirusTotal, which may suggest that the contact address featured may be for a particular campaign or particular threat actor that is specifically targeting a country or region. This doesn’t directly suggest that Ravack is only targeting Malaysia, however further collection and processing of Ravack ransomware samples at scale may help to confirm or deny that theory, particularly with more targeted attacks.
Figure 10: Relationship between country submitter and ransom email contact
Other artifacts that can also be included are the non-generic PE file icon resource types. Shown below are the icon resources. These can potentially be used to further pivot and uncover related variants and campaigns.
Figure 11: Non-generic icon resources for related Hakbit samples
One other trend that can be used to track variants of a ransomware family or campaign, or even a group of ransomware families that are related, as in the case of Hakbit, are the AV detection rates. From this data one might infer whether certain features that were introduced by the ransomware authors are more successful at evading traditional AV over their development and release cycle.
Figure 12: AV detections by submitted date
Another method might be to look at the network calls and DNS lookups made during sample detonation, which can be used to build a picture as to any malicious IP’s or domain names in use. While actors may not typically reuse or share the same domain names or IP addresses in general, further analysis of the network artifacts could show whether or not certain calls are made to any interesting domains or IP addresses, which leads us on to our next section.
Modules/Add-ons Identification
Modules and add-ons are typical of Ransomware as a Service (RaaS) and standalone ransomware. Featuring modular functionality at a cost, ultimately gives the cyber criminal a competitive edge over other competing ransomwares while being able to generate more money by enticing their customer base with new features in their code. With the gradual rise of RaaS and with the increased sophistication and aggressive release cycle by the ransomware authors and cyber criminals, reviewing samples for similarity may expose certain levels of code reuse which may tie in to features or services paid for by affiliates or customers of ransomware. Another method would be to statically analyze the code, and look for new features, modules or add-ons which may suggest a different feature set is available, or if a certain actor is using a fully featured RaaS. In the case of Hakbit, the SharpExec tool was discovered. Taken from the SharpExec page hosted on Github:
“SharpExec is an offensive security C# tool designed to aid with lateral movement”
Only by iterating through the research methodology were we able to uncover one sample which attempted to download the ProcessHide tool. Taken from their page also hosted on Github:
“Hide any process from any monitoring tool that uses NtQuerySystemInformation”
The graph below shows the number of samples out of the 25 samples analyzed which contained either SharpExec or ProcessHide.
Figure 13: SharpExec and ProcessHide usage
These types of tools can be further correlated with submitter country, email contact address and so on. Other types of features may include evasion techniques that bypass operating system protections, fully undetectable (FUD) to evade AV, IP tracking and so on.
Conclusion
From a single sample, and using some of the extracted metadata contained in this sample, we were able to pivot across some of those data points in order to uncover a total of 10 related ransomware families. This was discovered through the combination of static and dynamic analysis. This example can be helpful in expanding our understanding behind not only the code reuse amongst cyber criminals, but also the relationships between other ransomware families, campaigns and variants.
Collecting and tracking metadata specific to ransomware aid in mapping out a clearer picture of related different actors, campaigns, and variants from a single sample. Such information includes obfuscator details, email contact addresses, wallet addresses, and other generic executable file metadata indicators like file hash types and mutexes. Using these techniques along with other TTPs, such as those featured in the MITRE ATT&CK Framework, can aid with detection, prevention, hunting, incident response, forensic investigations, and help build out your cyber threat intelligence knowledge and expertise.
Indicators of Compromise
Indicator |
Type |
befc6ff8c63889b72d1f5aec5e5accc1b4098a83cd482a6bb85182ecd640b415 |
SHA256 |
871eef727aaad88b734bb372f19e72ccf38034195666c35390f5c3064f5469a3 |
SHA256 |
b8f019d7a305d98e6da53ead39c92774650890e63ee7d09102d790fb81300aeb |
SHA256 |
afb4596b666bf63f06d2de19ec5739db579103949453bfa4b6b5baacfdf59309 |
SHA256 |
d187292551fce9f4751a8fab00b9f33088c7a38b7454825e35390b524ba969bd |
SHA256 |
f1388fbe51253d8f07a98eabfe0422e39821d936166cc85c92a0418854ae15fb |
SHA256 |
23d7693284e90b752d40f8c0c9ab22da45f7fe3219401f1209c89ac98a4d7ed3 |
SHA256 |
cd63dad48fe881b1cabe155a74c1d8e1a1fd83402a1e06d4a5faa52056c7ffc9 |
SHA256 |
9806ccaff8e8027b7058e39726266a452240001d3ab28de551e31a8d88f0ae32 |
SHA256 |
ce483f17ec2e7aeb49d1e0c46d493ed6148c6dabeeb25ec059ab037e108e2fc8 |
SHA256 |
940df3b1cf603388cf9739cc208c1a88adfe39d2afe51e24a51878adca2be4e3 |
SHA256 |
89646f623d2bdb47f418c8b94a9b9783bac3117f72833a0230af82320e5a084b |
SHA256 |
10dc9cb12580bc99f039b1c084ca6f136047ac4d5555ad90a7b682a2ffac4dc5 |
SHA256 |
db3ef67666e18047aa24a90bfa32ca456641209147703853413d56eb74d44673 |
SHA256 |
e63aeb1aa61c38a5bed126b41ca587a892de0311730b892aee77541a761e1a02 |
SHA256 |
7e6db426de4677efbf2610740b737da03c68a7c6295aca1a377d1df4d35959e5 |
SHA256 |
53806ba5c9b23a43ddbfa669798d46e715b55a5d88d3328c5af15ba7f26fbadd |
SHA256 |
d1b634201a6158a90f718a082c0fe0ee1769ff4b613dd9756a34318fa61eea47 |
SHA256 |
7a7a5110cb9a8ee361c9c65f06293667451e5200d21db72954002e5725971950 |
SHA256 |
049425dac929baf288c44c981ef63417d097fb95f5199c9f33e5ef5e2ec20590 |
SHA256 |
79a817c6cb70d88fa07c3b8eefe1e95687ca06fbb6293dc6673359c6da6dc59b |
SHA256 |
c8f18fb0baf81b31daa929499b2dcaa7f297bd05ec1ecff319ae5e8b34dade00 |
SHA256 |
7a38f70d923669a989ea52fa1c356c5ac7ccce4067a37782973466102e3d27f6 |
SHA256 |
edcac243808957cc898d4a08a8b0d5eaf875f5f439a3ca0acfaf84522d140e7e |
SHA256 |
a35853ec25b96495a07ddee1c3778c9ad2df2e216c77df455555dba784d39f02 |
SHA256 |
070940acdcf608923d044edc79ba4121 |
MD5 |
fcc1d31bcb5dfa32df25d14579f82514 |
MD5 |
d93760ab95f24e0e5e6419e8b9b54a38 |
MD5 |
4e536cc77278fb55e7287803c0266b7c |
MD5 |
0389294561acbb3c9c2bda2455304fdc |
MD5 |
3eab0191acface952d7e45db1c752430 |
MD5 |
d38f63c08174dba2225a8c8293e4fd8b |
MD5 |
a932f05ad9201d4c263eb1483f122443 |
MD5 |
1534b2e65d18404de183da28e37e3b1f |
MD5 |
6bb03255fa85251db782721265e686b7 |
MD5 |
a9778b0ad4a0db4ffcdf245383612989 |
MD5 |
50e29b865d0873f1f28bbf1942e6ec89 |
MD5 |
2a66b3b2638dfc5dfcf8aaf825993269 |
MD5 |
0e7f3a662d61cac2d3df93bc60845f39 |
MD5 |
af3b2a7d498724271189545fdd29ee48 |
MD5 |
0dcfe58d200058289ea8c13551d13ce8 |
MD5 |
41be5e2ba0663bda47ac42a38a319311 |
MD5 |
d209e35f7cb4677a6072415b1266118e |
MD5 |
45476cb160a030539fea7327946e8232 |
MD5 |
23fb59ad1eb4be42f91c3d58c63ac67b |
MD5 |
98c45b597c92a005c76e8afce1cc5148 |
MD5 |
5b5c37282fd6607c553d4c4c5f9d8716 |
MD5 |
98e1bca914035e3cbfe86ee19911b2cd |
MD5 |
90e26c44e1148d5be61538932b9b14d1 |
MD5 |
097f827f2402b65c4ffb40d65bb21cba |
MD5 |
f34d5f2d4577ed6d9ceec516c1f5a744 |
ImpHash |
Global\c1a76b5a-12ab-45c5-b9d9-d692faa6e7a2 |
Mutex |
Global\3747bdbf-0ef0-42d8-9234-70d68801f407 |
Mutex |
1HaLXTNdaXTGQtDuDURPA9kLxhyM4DzhsT |
BTC Wallet |
32bzWrWXXbWGSwB4gGTQt8RdzuNQVaS9Md |
BTC Wallet |
3FuA6nChPEEiSYnpHyVKuYcSh5Cxx8W44Q |
BTC Wallet |
1MYNpqa9CKnjvcvxd25iB7qxxeZbfWsBzP |
BTC Wallet |
1F9i1vpfGfKXaUqhhgTmxe9Y2aS8stSGvR |
BTC Wallet |
3CLYu1SJMryXD4iuUeLoL1e5nNbaMb6siQ |
BTC Wallet |
1ErGqSg86nW2kEH6dFwe217SNSCdcwWJQ7 |
BTC Wallet |
1Kex5QmBGtJLDagn3o2p1yoqyKn2A6EFG9 |
BTC Wallet |
1AMiV6GkuSLSgiiS1pWahEzvNtEiiiofRS |
BTC Wallet |
zoula50@protonmail[.]com |
|
recoba90@protonmail[.]com |
|
unlockransomware@protonmail[.]com |
|
servo99@protonmail[.]com |
|
servo33@protonmail[.]com |
|
agarrard@protonmail[.]com |
|
torsec1@secmail[.]pro |
|
zen_jan1@protonmail[.]com |
|
hentai.onichan.key@protonmail[.]com |
|
daaaataaaaa@protonmail[.]com |
|
clearcuMc04997@gmail[.]com |
|
The post TAU Threat Analysis: Relations to Hakbit Ransomware appeared first on VMware Carbon Black.
Article Link: https://www.carbonblack.com/2020/06/15/tau-threat-analysis-relations-to-hakbit-ransomware/