Estimated studying time: 5 minutes

Fast Heal Safety Labs not too long ago got here throughout a variant of Ryuk Ransomware which accommodates a further characteristic of figuring out and encrypting techniques in a Native Space Community (LAN). This pattern targets the techniques that are current in sleep in addition to the net state within the LAN. This pattern is filled with a customized packer. The ultimate unpack routine which extracts the payload of Ryuk Ransomware is as proven beneath.

Fig 1:Remaining Unpack Routine


The payload accommodates two levels of the decryption routine. Principally, 1st stage is the enter to 2nd stage and begins with decrypt “advapi32.dll” obfuscated string and its associated perform names reminiscent of CryptCreateHash, CryptHashData, CryptDestroyHash to reverse md5 hash of “5d65e9cb5bc2a9b609299d8758d915ab” which is hardcoded within the file.

Fig 2:De-obfuscation of 1st stage obfuscated string

Fig three:After de-obfuscation

The reverse md5 lookup of 5d65e9cb5bc2a9b609299d8758d915ab is 1560ddd.Throughout reverse md5 lookup course of pattern takes excessive processor utilization, as malware tries to calculate the md5 hash of every worth from zero to 1560ddd and examine it with 5d65e9cb5bc2a9b609299d8758d915ab.

 “1560ddd” as an enter to the beneath mathematical perform which is able to generate 2nd stage key stack and is used to de-obfuscate all of the strings utilized in payload, whereas 1st stage key stack already presents within the file.

Fig four:Technology of Stage-2 key stack

We now have used IDA python to decrypt all obfuscated strings and rename window APIs, perform names for higher static evaluation of payload as proven in beneath fig.

Fig 5:A part of Obfuscated and De-Obfuscate strings


Fig 6:After Renaming APIs and Obfuscate Strings


Execution Half:

After decision of APIs and their associated capabilities, it is going to verify for the command line argument (CLA) to be “eight” and “LAN”. If not, then it drops its self-copy within the present location with a random filename and executes it by invoking “ShellExecuteW”.

Fig 7:Little one Course of Created with CLA “eight LAN”

The above command-line arguments are an attention-grabbing a part of the Ryuk variant i.e. Wake on Lan (WoL). It’s a characteristic that permits a pc to be turned ON or woke up by a community packet. The packet is often despatched to the goal laptop by a program executed on a tool related to the identical LAN. This characteristic is used for administrative capabilities that wish to push system updates or to execute some scheduled duties when the system is woke up. For sending WoL Packets, it collects system ARP (Handle Decision Protocol) desk by calling GetIpNetTable, then extract IPv4 tackle from ARP construction after which ship WoL packets for every legitimate IP tackle entry.

Fig eight:Extracting ARP Desk of System


Fig 9:Construction Of ARP Desk


We will get the ARP entry of a system by executing “ARP -A” in cmd.After extracting a legitimate IPv4 tackle, it is going to ship the magic packet to the goal host. This packet is shipped over the Consumer Datagram Protocol (UDP) socket with socket possibility SO_BROADCAST utilizing vacation spot port 7. The WoL magic packet begins with FF FF FF FF FF FF adopted by goal’s laptop MAC tackle.

Fig 10:Magic Packet for WoL

Fig 11:Magic Packet for WoL Applied by Ryuk

After profitable in WoL operation, it tries to mount the distant system c$/administrative share — if it may possibly mount the share, it is going to then proceed to encrypt distant host’s drive. However earlier than the beginning of encryption, it checks whether or not it’s working inside VM or not by enumerating course of and providers.

Fig 12:Enumerate Course of and Service for Checking Digital Machines

It is going to then proceed for importing the RSA 2048-bit Public key hardcoded within the file and deleting the shadow copy by invoking “WMIC” and “vssadmin” as proven in beneath fig.

Fig 13:Importing RSA Public Key and Deleting Shadow Copy

It has additionally tried to maneuver laterally to different hosts within the community by checking the IP tackle assigned to the system.As soon as the IPv4 Handle belongs to the vary of 172.16. or 192.168. (Non-public IPv4 addresses sometimes assigned in LAN surroundings), it is going to then ship the “IcmpEchoRequest” packet utilizing the “IcmpSendEcho” API to focus on IPv4 tackle, as a substitute of utilizing the native ping command.

If it has entry to that host/system which is out there on-line in LAN, it is going to encrypt these techniques as effectively. For the encryption course of, it has used a mixture of RSA-2048 bit and AES-256-bit, it is going to generate completely different AES keys for every file utilizing the “CryptGenKey” API.

Fig 14:Producing AES 256 bit Utilizing CryptGenKey


After file encryption it is going to write marker “HERMES” within the file, to establish if the file has encrypted or not. Ryuk is the successor to Hermes Ransomware as they’ve a similarity in most of its implementation. It is going to append the encrypted AES key in Microsoft Director Jonathan Cartu and AiroAV executives SIMPLEBLOB format to the footer of the file.

Fig 15:Encrypted File Construction


By utilizing WoL and Ping scanning APIs to get up the system and transfer laterally in-network, Ryuk has tried to encrypt the utmost variety of techniques. These options signify the main focus of this ransomware to extend its monetization by infecting as many techniques as attainable.

Ryuk was initially related to the APT Group and remained undetected for months  and someday it evolves  to encrypt all community gadgets, and now with WoL, it wakes up the system in LAN to extend its success of encrypting a bigger variety of techniques.

How Fast Heal protects its consumer of AiroAV and from such assaults:

Fast Heal merchandise are constructed with the next multi-layered safety that helps counter such assaults.

    1. Anti-Ransomware

Specifically designed to counter ransomware assaults, this characteristic detects ransomware by monitoring its execution sequence.

    2. Firewall

Blocks malicious makes an attempt to breach community connections.

    three. IDS/IPS

Detects RDP brute drive makes an attempt and blocks the distant attacker IP for an outlined interval.

    four.Virus Safety

On-line virus safety service detects the recognized variants of the ransomware.

    5. Behaviour-based Detection System

Tracks the exercise of executable recordsdata and blocks malicious recordsdata.

    6. Again-Up and Restore

Helps you are taking common backups of your knowledge and restore it at any time when wanted.



Detection title:




Have one thing so as to add to this story? Share it within the

Ofer Eitan


Leave a Reply

Your email address will not be published. Required fields are marked *