hamburger

BitDam Blog

Roy Rashti
Roy Rashti
2 minutes & 31 seconds read · March 21, 2018

GandCrab – The new Ransomeware in the block

A few days ago, I was examining files that we’ve detected in one of our customers.

I encountered an interesting PDF (SHA1 – d75e3d2c235bf1e52cca16f597fe05fcfce89ad6) which is the dropper and installer of the new version of GandCrab Ransomware.

A lot was said about Ransomwares, dozens of solutions claim to protect against it and yet we encounter new ones, almost on a daily basis.

As most of the malwares these days, the creators of GandCrab used emails as their primary attack vector to install the Ransomware. Here’s how they did it;

When the PDF is opened, the user sees the captcha shown in figure 1.

Figure 1

 

This captcha is an image that leads to the following URL –

http://butcaketforthen[.]com/docs/Feb-00974.doc

When clicked, the server sends a doc file.

The docfile (SHA1 – 9742c3bd6845af4134f53764afcc60de6458f0d9) is a simple doc file that like most of the VBA Macro-based infectors, asks the user to ‘Enable Content’ (shown in figure 2)

Figure 2

 

When the user enables the content, it allows the VBA code to run.

The file contains an invalidly signed macro that holds a lot of code, probably used to deceive and have a legitimate-macro look at first glance.

Looking at the code’s entry point, we see an AutoOpen function that runs automatically when the document is being opened and the content is enabled (shown in figure 3).

Trying to avoid signatures, the authors of this infector are avoiding some of the suspiciously looking strings in their code. This is why we don’t see “Powershell” or “WebClient” here.

Figure 3

 

We can see “cmd.exe”, some url and strings concatenated from a form’s labels. A quick glance at the embedded objects of the document reveals what’s probably going to be the rest of our cmd line (figure 4).

Figure 4

 

As the code is running, a cmd process is started with the arguments shown in figure 5.

Figure 5
Figure 5

 

This powershell command downloads a script from http://sorinnohoun[.]com/sc1/sct5  and calls a function called “Invoke-GandCrab”.

Looking at the powershell script (SHA1-d9fb7d948fb35550a6fe82c9c94fb609d9a1f682), we see a large, well documented function called “Invoke-Inj” that injects a dll into a process. Just after that, there’s a function called “Invoke-GandCrab” (visible in figure 6, without the base64 content).

Figure 6
Figure 6

 

That function has a base64 string that holds the entire malicious dll which is the ransomware itself. The dll is being decoded and transferred into the injector.

Once the PS code is loaded, “Invoke-GandCrab” is called. The dll is loaded and in that point- the bad guys has won.

 

About the author

 

 

Read more
Maor hizkiev
Maor hizkiev
2 minutes & 51 seconds read · February 21, 2018

What’s the story behind Spectre?

In January, a severe hardware flaw was discovered in Intel’s microprocessors (named “Meltdown”). An additional vulnerability, named “Spectre” has also been discovered. This one is much more severe, and it challenges the design of modern CPUs. These two are vulnerabilities in computer hardware, not software. As such, they affect virtually all high-end microprocessors produced over the last 20 years. Patching them requires large-scale coordination across the industry, and in some cases drastically affects the performance of computers. Moreover, sometimes patching isn’t possible; the vulnerability will remain until the computer is discarded.

An attacker can create a foothold inside any organization, using an email containing a specially crafted DOC or PDF file that utilizes Spectre. He can then use this foothold for any malicious activity such as malware or ransomware.

Spectre and Meltdown aren’t anomalies. Instead, they represent a new area to look for vulnerabilities and a new avenue of attack. An evidence to this is that several different groups of unrelated people had individually discovered the aforementioned exploits during the same few months. And it all happened while exploring the field of hardware exploits more intently.

How are modern CPUs designed today?

Microprocessors have become so fast that they spend a lot of time waiting for data (CPU instructions) to move in and out of memory. The speculative execution mechanism was designed to increase performance. A processor guesses what are the instructions that it is going to receive (e.g., following a conditional branch) and executes them. If the guess turns out to be correct, it’s a performance win. If it’s wrong, the microprocessor throws away what it has done without losing any time.

CPUs are not the only ones using speculative execution. The media world, for example, is using it all the time. Weren’t you surprised that immediately after the super bowl all the news were filled with analysis and articles about the Eagles? The reporters have prepared in advance for both cases, working hard to create 2 story versions. Then, when the game ended, they discarded the wrong story where the patriots were winning. And didn’t it give you as a reader the feeling that they are extremely fast in writing in-depth articles?

Getting back to the CPU world, the problem with the speculative execution mechanism is that there’s no permission check when the speculative execution code is running. As a result, the data is left exposed for everyone to read.

What are the implications of the Spectre vulnerability?

The Spectre and Meltdown vulnerabilities allow malicious applications to bypass memory isolation mechanisms and access sensitive data. A large number of the effective mitigations today are based upon secrets, i.e. ASLR is based upon the low chance of an attacker guessing the locations of randomly placed areas in the memory, and a stack cookie is based on placing a runtime value before the stack ends.

An attacker can leverage these vulnerabilities to discover the secrets and bypass the mitigations. ASLR and other mitigations have been extremely effective and practically caused thousands of vulnerabilities to become un-exploitable.

BitDam can protect you against Spectre, Meltdown and future microprocessor vulnerabilities. It entails zero effort and no updates are required. BitDam can do this since its unique approach is not based on secrets nor on information about how attacks work. If you want to get better protection against malicious email attachments check out BitDam’s solution or schedule a trial.

Read more
Roy Rashti
Roy Rashti
3 minutes & 27 seconds read · January 22, 2018

A Small Change Is the Best Evasive Technique

We all know that email is the path most traveled by cyber attackers when targeting organizations. Email attachments are used by attackers to inject malware into an organization in order to create the beachhead that facilitates the rest of the attack. We know that people can’t resist opening attachments.

In this post I will demonstrate how easy it is to bypass most security means that scan email attachments. We use the score on VirusTotal to show how we take a malicious Word attachment and transform it from a score of 17 (/60) to a score of 1 (/60) through a set of simple manipulations. VirusTotal is the de-facto benchmark for most security products that analyze attachments. The 1/60 score basically means that the file we have created will get through most relevant security products on the market today.

Technical details

Let’s assume that I’m an attacker and that I have put together an excellent ransomware attack. I plan to deliver a document via email that would drop and launch my malicious code. This is pretty easy to do using VBA macros. Under relevant security settings, Office applications allow me to run Visual Basic code that executes under the application’s process with the user’s privileges.

Let’s assume that I have a server, waiting to deliver my ransomware, and that I’ve created a Word document with the macro shown in figure 1. This macro implements the ‘Document Open’ function that runs automatically when the Word opens the document. It creates a powershell process that downloads the executable, places it in “c:\windows\temp” and launches it.

figure-1
Figure 1

It’s pretty straight forward; the code is neither obfuscated nor sophisticated so I would expect very high detection rate in VirusTotal. The results are rather disappointing; less than a third of the vendors marked this file as malicious.

17/60

Still, if I want to spread this file, I would prefer a much lower detection rate for my file.
I assume that many attackers use Document_Open() to autorun their code. Since most security solutions today base their signatures on past attacks, I need to come up with a slightly different method, so I may be able to bypass them. Instead of Document_Open(), I will use Document_Close(), which means that my code will run automatically when the document is closed. That did the trick for four more vendors.

So far I have managed to bypass 47 out of the 60 vendors – not bad!

Next, I will try not to have “exe”, “http” and “powershell” strings in the code. Instead of spending my time trying obfuscating, I have broken-up the very same string I had before and concatenated it into one variable, whose name was changed to ‘a’. The code shown in figure 2 managed to bypass one more vendor. 48 vendors are out, 12 are still in the game.

figure 2
Figure 2

12/60

At this point I had to think a little bit out of the box. Almost every attacker uses obfuscation, so that road is probably well covered. I’ll just place the Powershell execution line in the document properties, under the “Subject” field, and read it from there. Figure 3 shows what the code looks like.

Figure-3
Figure 3

The code is running as expected, and when I tested the file on VirusTotal, I saw the pleasing result that you can see in figure 4.

1/60

Figure-4
Figure 4

Only one vendor detected this file! My guess is that the other vendors didn’t see this kind of technique before. If I want to start spreading my ransomware at this point, all I need to do is to decorate the email with nice emojis and spread it to any email address I know.

In contrast with almost all other security products, BitDam does not rely on chasing the “attack du-jour”, and thus is able to “see” the maliciousness of the file despite any manipulations we use. If you want to get better protection against malicious email attachments check out BitDam’s solution or schedule a demo.

About the author

Read more
Pages: