Ransomware 101 - Part 2 : Understanding Fundamentals

Sandesh Ajgekar
6 min readJun 5, 2022

--

After we understand how ransomware code work, let’s dig into some fundamental knowledge of ransomware.

  1. What is Ransomware-as-a-Service (RaaS) ?
  2. How RaaS work ?
  3. How Ransomware attack does happen ?
  4. What security controls should be present in order to prevent ransomware attack ?
  5. How to respond to ransomware attack ?
  6. How NOT to respond to ransomware attack ?

If you still haven’t, I strongly recommend you to first read part 1 of this series. Link is below

What is Ransomware-as-a-Service (RaaS) ?

As we all know by now that ransomware is a beautifully crafted nasty little code, but there is an entire industry revolve around it called Ransomware-as-a-Service. Ransomware as a service (RaaS) business model is similar to software as a service (SaaS) business model that involves selling or renting ransomware to buyers, called affiliates who pay to launch ransomware attacks developed by the operators. Attacker with minimum technical ability can also do large scale attacks with this technology which makes it more dangerous than ever.

Traditional ransomware attack vs RaaS attack
Traditional way of Attack VS RaaS way of Attack

How RaaS work ?

  1. The developer creates custom exploit code (payload). Payload is then licensed to affiliate for a fee or share of profit in proceeds from the attack.
  2. The affiliate updates the hosting site (RaaS operation site) with the new payload. RaaS operator sells all kinds of services that may require to launch the attack.
  3. The affiliate identifies attack vector and delivers the exploit code to the victim (e.g., via malicious email or link).
  4. The victim clicks the link or goes to the website.
  5. The ransomware is downloaded and executed on the victim’s computer.
  6. The ransomware encrypts the victim’s files, move to the network laterally, establish persistence, destroys data backups, and covers its tracks.
  7. The victim receives a ransom note and instructions to pay ransom in cryptocurrency that will go to the money launderer as a proxy.
  8. A money launderer will move the money through multiple channels to obscure the identities of the affiliate and developer.
  9. The affiliate will then send a decryptor to the victim once a ransom payment has been received.

How ransomware attack does happen ?

There are many attack vectors that can be carry out by the ransomware attacker. Some are as follows

  1. Phishing — Social engineering technique to trick user to click on malicious link/file often sent in email, text messages or social media which will infect the system.
  2. Drive-by download — Unintentional download of malicious file from redirected site into system that leads to ransomware attack.
  3. Malvertising — Injecting malicious code into legitimate advertisement.
  4. Exposed services — Misconfigurations in the system. Exploiting common vulnerabilities to gain access into the network.
  5. Unsafe physical connections — Connecting malicious device (pendrive etc.) to the official system.
  6. Supply chain attacks — Targeting service provider to force the malicious service update to spread the ransomware to all the customers.
  7. Ransomware as a Service (RaaS)

For simplicity let’s group attack vectors in 3 main stages –

stage 1: Find a way-in to your network (Gain Access)

stage 2: Take control of your systems and connected devices, then deploys the malware payload

stage 3: Infect systems and connected devices with ransomware (Impact)

Ransomware attack stages

Often use in combination of attack vectors, ransomware attacks are much more sophisticated. Below is the MITRE Attack mapping of REvil ransomware.

https://raw.githubusercontent.com/projsandy/Ransomware-POC/main/Revil_Ransomware.svg

What are the security controls should be present in order to prevent ransomware attack ?

Ransomware is one of the most common and one of most damaging cyber-attacks. Single mitigation measures are not enough to stop ransomware. Organization should adopt a defence-in-depth (multi-layer) strategy to protect from not only ransomware, but other type of cyber-attacks.

In case of ransomware attack, BACKUP is a key player. There are 3 types of backup

  1. Full backup — Making identical copy of entire data periodically (weekly/ monthly).
  2. Incremental backup — Only backup the information that has changed since the last time you performed a backup of any kind.
  3. Differential backup — Backup the information that has changed since the last time you performed a full backup.

You can store backup in online, offline mode or on cloud. Securing the backup is as important as taking it. It is recommended to have multiple backups stored in multiple physical locations for better security.

Besides backup, best way to mitigate ransomware attack is implement multilayer protection. Following are some general security control that can be implemented at every stage of ransomware attack -

General mitigations at each stage of attack
  1. Password Manager
  2. Update and Patching
  3. Logging and Alerting
  4. Application whitelisting
  5. Cyber Security Training
  6. Multifactor Authentication
  7. Backups
  8. Disable macros
  9. Email domain protection
  10. Principle of least privilege
  11. Secure system exposed to internet
  12. Network segmentation
  13. Security tool (anti-malware, firewall, DLP, etc.)
  14. Protective domain name service
  15. Reduce shadow IT

How to respond to a ransomware attack ?

Incident response strategy of any cyber-attack is often subjective to every organizations. But following is the general SOP to consider in ransomware attack -

1 ) Isolate systems

Isolation should be your first task in any kind of malware attack. The majority of ransomware will scan the target network, encrypt files stored on network shares and try to propagate laterally to other systems. Everyone in the organization should be trained enough and should have presence of mind to pull the network cable of the workstation they are working on, after they first aware of the files being get encrypted.

2 ) Disable maintenance tasks

Organizations should immediately disable automated system maintenance tasks such as temporary file removal and log rotation on affected systems, as these tasks can interfere with files that may be useful for investigators and forensics teams.

3 ) Take memory dump

You should take memory dump for the infected system because important artefacts may still present in the memory and can be helpful to decrypt the files without paying any ransom.

4 ) Create forensic image of the systems

Some ransomware decryptors contain bugs that can damage data during the process. To ensure data integrity, you should always create image of your infected system. If anything goes wrong during decryption process, you can easily rollback and do it again.

If infected data is not immediately required to you, then you can store your images securely as a backup. Because ransomware decryptor keys may will get public eventually, in that case you have a chance to get your data back.

5 ) Identify the ransomware

You can identify ransomware strain you got infected and try to find any open source decryptor available online. You can use CryptoSheriff online tool for the strain identification.

After you identify the strain you can search for decrptor for the infected ransomware. The No More Ransom Project is a very good resource for the same.

6 ) Decide whether to PAY the ransom or NOT

You should hire a malware analyst/Data recovery specialist to reverse engineer the malware to decide if you should pay the ransom or not.

While paying ransom can be cheaper compare to overall cost and may reduce the disruption but there are some concerns-

  1. There is no guarantee that you will receive a decryptor from attacker.
  2. The decryptor you get from attacker may not work properly.
  3. If you pay ransom now, you will may get targeted again and again by criminals.

How NOT to respond to a ransomware attack ?

  1. Do NOT restart infected devices
  2. Do NOT connect external storage devices to the infected system without firmware level writeblocker
  3. Do NOT communicate over the infected network
  4. Do NOT try to delete files because you may damage the important malware artifacts.
  5. Do NOT pay the ransom immediately
  6. Do NOT trust ransomware attacker at all

--

--

Sandesh Ajgekar

Information Security and Detection Engineering Enthusiast