Wanncry Components

Introduction

In May 2017, a wave of malicious cyberattacks swept across the globe, targeting vulnerable systems with the WannaCry ransomware. This attack exploited a critical flaw in Microsoft Windows, CVE-2017-0145, known as EternalBlue, affecting over 200,000 computers in more than 150 countries. While the ransomware itself was the primary focus, an often overlooked yet pivotal component that contributed significantly to WannaCry’s success was the Tasksche.exe executable.
In this post, we will provide a deep dive into the Tasksche malware, exploring how it functions as a core part of the WannaCry ransomware’s payload, its behavior, and the technical mechanisms that enable its rapid spread across networks. We will also provide a detailed analysis of its IOCs (Indicators of Compromise) and discuss best practices for defending against this type of attack.

Understanding Tasksche: A Vital Component of WannaCry

Tasksche.exe is a malicious executable associated with the WannaCry ransomware. This component is responsible for lateral movement across networks, payload execution, and establishing persistence within the compromised systems. It is often referred to as a “worm-like” malware because of its ability to propagate autonomously across unpatched machines using network-based exploits.

At its core, Tasksche is responsible for encrypting files on infected systems and spreading the ransomware to other vulnerable systems. This makes it an integral part of WannaCry’s fast-moving, self-replicating nature.

Key Characteristics of Tasksche:

Filenametasksche.exe
MD57f7ccaa16fb15eb1c7399d422f8363e8
SHA-2562584E1521065E45EC3C17767C065429038FC6291C091097EA8B22C8A502C41DD
FiletypeEXE Win32
TargetWindows x64
PackerMicrosoft Visual C++

This executable is typically delivered as a dropped file during the ransomware infection process, often hidden within ZIP archives containing other malicious payloads.

The Infection Lifecycle: How Tasksche Executes and SpreadsInitial Execution and why:
Upon execution, Tasksche.exe extracts its malicious components from a password-protected ZIP archive. The password, often embedded in the executable itself, is used to unlock further files that are necessary for the ransomware’s execution. Once extracted, these files are executed, completing the payload delivery and initiating the encryption process.Tasksche.exe also attempts to connect to a Command and Control (C2) server, often via Tor, for remote communication. This hidden network allows attackers to avoid detection and manage the malware remotely, delivering additional payloads or instructions.

 

Exploiting SMB Vulnerabilities:

A critical aspect of Tasksche.exe’s functionality is its ability to exploit the EternalBlue vulnerability in SMBv1. After executing on the initial victim system, Tasksche.exe scans the local network for other vulnerable machines, attempting to spread the ransomware autonomously. This worm-like behavior enables the malware to infect a wide range of systems with minimal human interaction.

Once the malware connects to another vulnerable machine, it repeats the infection process, encrypting files and deploying the ransomware to other systems on the network. This self-replication behavior is what made WannaCry such a devastating and rapid attack.

Detailed Analysis: Static and Dynamic Behavior of Tasksche

Static Analysis:

In-depth analysis of the Tasksche.exe file reveals critical strings and behaviors that hint at its functionality. Some notable strings include:

  • “Microsoft Enhanced RSA and AES Cryptographic Provider”
  • “WNcry@2ol7” (Password for encrypted components)
  • “msg/m_japanese.wnr” (Indicating support for multiple languages in ransom messages)

These strings suggest that the malware is equipped with multiple communication protocols and localization support, enabling it to deliver ransom notes in various languages to a global audience.

Additionally, Tasksche.exe imports libraries such as:

  • KERNEL32.dll
  • ADVAPI32.dll
  • USER32.dll
  • MSVCRT.dll

These libraries allow the malware to interact with system processes, manage resources, and execute essential functions, such as creating new processes and performing system calls that enable file encryption and propagation.

Dynamic Analysis:

Once executed, Tasksche.exe:

  1. Registers itself as a service (mssecsvc2.0) under the name “Microsoft Security Center (2.0) Service”.
  2. Attempts to connect to a remote server (e.g.,http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com). If the server is active, the malware proceeds with its malicious activities.
  3. Encrypts files on the system, targeting over 170 file types, including documents, spreadsheets, and multimedia files.
  4. Drops a ransom note (typically in multiple languages) demanding payment in Bitcoin for file decryption.

Indicators of Compromise (IOCs)
Hashes:

  • MD5: 7f7ccaa16fb15eb1c7399d422f8363e8
  • SHA-256: 2584E1521065E45EC3C17767C065429038FC6291C091097EA8B22C8A502C41DD
Domain Names:
  • gx7ekbenv2riucmf.onion
  • xxlvbrloxvriy2c5.onion
  • 76jdd2ir2embyv47.onion
  • cwwnhwhlz52maqm7.onion
File Names:
  • tasksche.exe
  • mssecsvc.exe

These indicators are essential for quickly identifying infections and isolating affected systems to prevent further spread.

Best Practices for Protection

To defend against WannaCry and similar ransomware attacks, organizations and individuals should implement the following best practices:

  1. Patch Vulnerabilities: Regularly update systems with the latest security patches to prevent exploitation of vulnerabilities like EternalBlue.
  2. Use Intrusion Detection Systems (IDS): Monitor network traffic for unusual activity, such as SMB exploit attempts and suspicious outbound connections.
  3. Regular Backups: Perform regular backups of critical data and store it offline or in an isolated environment to ensure recovery in case of an attack.
  4. Network Segmentation: Isolate critical systems from general user systems to minimize lateral movement if an infection occurs.
  5. Employee Awareness: Train staff to recognize phishing attempts and other social engineering tactics commonly used to spread ransomware.

Conclusion

Tasksche.exe is a key component of the WannaCry ransomware, responsible for self-propagation and persistence within infected networks. By exploiting vulnerabilities in the SMB protocol, it rapidly spreads across systems, encrypting files and demanding ransom from victims. This in-depth analysis of Tasksche.exe not only highlights its critical role in the WannaCry attack but also emphasizes the importance of maintaining robust security practices to protect against ransomware and other evolving cyber threats.

Stay informed, stay vigilant, and ensure your systems are well-protected to defend against the growing threat of ransomware.