WannaCry/WCry/WannaCrypt0r Ransomware: Digital Blood Bath!

On Friday, 12 May 2017 the world woke up to a massive Cyber Attack targeting their Windows Operating Systems. Globally on that morning, around 100,000 computers in over 100 countries had been compromised by a ransomware that took their machines hostage.

This malware referred to as WannaCry, Wcry and WannaCrypt0r, was the culprit behind the attacks. Europol described the attack as unprecedented as multiple organizations in the UK and globally confessed to being compromised. Telefonica, Britain's National Health Service (NHS), FedEx, Deusche Bahn and LATAM Airlines were among those hardly hit.

Shortly after the attack was discovered, a security researcher found a kill-switch which prevented new infections. It was later reported that new versions that lack the kill-switch were detected.

Source of Exploit

The malware exploits the MS17-010 exploit to propagate on the network. This exploit is known as the Equation Group's EternalBlue exploit, part of the FuzzBunch toolkit released by the hacking team Shadow Brokers weeks ago.

The Shadow Brokers hacking team is attributed to the Russian Intelligence and leaked a large cache of weaponized exploits used by the "Equation Group" (attributed to the NSA). One interesting leak was an exploit going by the name EternalBlue which attacks Microsoft's Windows Operating Systems. Microsoft went ahead to release a patch to fix this vulnerability, most likely being advised by the NSA to do so after the leak. This patch number was MS17-010 and was released back in March.

This vulnerability would have otherwise allowed remote attackers to gain remote code execution on systems and fully compromise the computer with full administrative level rights (SYSTEM permissions).

WannaCrypt0r Behavior

WannaCry does not use a sophisticated method for its attack delivery. It initially uses a password protected .zip file containing a document inside. This while opened, downloads a second stage which is an unsigned executable file which contains the delivery method for infection, worm replication and exploitation. The malicious software beacons out to the following domain to check its online state: hxxp://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com

If it is up, it will not execute (this is the kill-switch). This means you can use DNS to redirect to a legitimate site to ensure it stays up. This malicious domain has since been sink holed and is now up and active. On compromising a victim and after all files are encrypted, victims are presented with a ransom note with the ransom demand and deletion threat as shown below:

In general, the malware arrives through an exploit as depicted in step 1 of the image that follows. The second step involves querying a domain to check whether it is up or not.

This is the kill-switch of the ransomware. If the domain queried is up, the malware does not trigger. At step 3, the malware begins the encryption of files. The ransom note is dropped at stage 4 once all the files are encrypted. Once this is done, the malware then encrypts the shared files.

To spread to other systems, the malware uses the file that was dropped and run as a service. The service name that is used at this point is "Microsoft Security Center (2.0)".

This service scans for other SMB shares on the network, and uses the EternalBlue vulnerability to spread to other systems. According to McAfee, a vulnerable machine with Server Message Block (SMB) enabled receives SMB packets containing the shellcode exploit with encrypted payload.

On the vulnerable machine kernel mode, the srv2.sys SMB 2.0 driver is exploited, while at user mode, the Isass.exe process is injected the compromised launcher.dll which contains the ransomware binary at the resource level.

The ransomware process is then launched by the compromised Isass.exe process. The malware behavior between the kernel mode and user mode is shown in the image below:

Prevention from Infection

Microsoft has since patched the vulnerability by releasing updates for Windows XP systems, Windows Vista, Windows Server 2008 and Windows Server 2003 that can be downloaded here. Organizations and individuals should however ensure that the following measures are taken into account as a precaution to protect from Ransomware infections:

Note: For computers that cannot be patched, they need to be moved to a separate network where they will least be likely to be infected by the malware.

1. Take regular backups of important data: Important data should be stored on offline storage media to safeguard against network attacks such as ransomware attacks. This ensures that important data can be restored without having to worry about paying ransom demands.
2. Install and Update Security Solutions: Ensure you are running an up-to-date security solution such as antivirus software and end point security solutions.
3. Keep Windows Up-to-Date: Ensure that updates are installed regularly to protect against malware infections. Some updates include critical security updates that are vital for protecting an online presence.
4. Creating Awareness: Awareness can be created at the organization by carrying out training to educate employees on the importance of safe Cyber practices, and these have proven to greatly reduce chances of infection.
5. Disable Macros: Macros are a common attack vector into a target system and disabling them reduces the scope of infection.
6. Penetration Testing: Conducting regular security assessments provide an understanding of an organization's security posture.
7. Contact Enovise: Lets us in to help you keep the bad guys out and protect your critical assets!!!