Working Mechanism of Eternalblue and Its Application in Ransomworm

Zian Liu, Chao Chen, Leo Yu Zhang, Shang Gao

TL;DR

This paper dives deep into the Eternalblue exploit, a critical component of notorious ransomware like WannaCry and NotPetya. By meticulously analyzing its inner workings and comparing it to its Metasploit counterpart, the authors reveal that Eternalblue's code remains remarkably consistent when integrated into WannaCry, suggesting that this similarity can be leveraged for more effective detection signatures.

What Problem Does This Paper Address?

The widespread and devastating impact of ransomware like WannaCry and NotPetya, which leverage the Eternalblue exploit, has created an urgent need to understand their attack mechanisms. While dynamic analysis of WannaCry has been extensively studied, static analysis, particularly focusing on the Eternalblue exploit's integration into ransomware, has been relatively limited. This paper aims to bridge this gap by providing a systematic, high-level semantic and code-level understanding of Eternalblue, its application in WannaCry, and how it compares to its implementation in the Metasploit framework. This understanding is crucial for developing robust defenses against such threats.

Methods

The authors employ a multi-faceted approach:

  • Reverse Engineering: They perform a detailed static analysis of the Eternalblue exploit, dissecting its code to understand its intricate workings.
  • Comparative Analysis: A key aspect of their methodology is the direct comparison between the Eternalblue module found in WannaCry and the original Eternalblue exploit, particularly as implemented in the Metasploit framework. This comparison is conducted using code analysis tools and network capture tools.
  • Step-by-Step Breakdown: The paper meticulously breaks down the Eternalblue exploit into its core stages: crafting the original list, buffer grooming, and sending the shellcode. Each stage is explained with a focus on the specific SMB (Server Message Block) commands and vulnerabilities exploited.

Datasets

Not discussed in the paper. The analysis relies on reverse engineering of malware samples and the Metasploit exploit module.

Key Insights and Ideas

  • Eternalblue's Core Mechanism: The paper clearly explains how Eternalblue exploits a buffer overflow vulnerability in the SMB protocol by manipulating SMB Transaction commands. This manipulation allows it to overwrite critical server buffers, leading to the execution of malicious code.
  • WannaCry's Minimal Modification: A significant finding is that the Eternalblue exploit code integrated into WannaCry is almost identical to the original exploit. This suggests that ransomware authors are not significantly altering the core exploit, likely to maintain its effectiveness.
  • Signature-Based Detection Potential: The high degree of code similarity between the original Eternalblue and its WannaCry implementation is a crucial insight. This consistency offers a strong foundation for developing effective signature-based detection methods that can identify this exploit across different malware variants.
  • Buffer Grooming is Key: The paper highlights the importance of "buffer grooming" – a series of carefully orchestrated network requests designed to manipulate the server's memory allocation. This process is critical for ensuring that the overflowed buffer is positioned correctly to allow the shellcode to be injected and executed.
  • SMB Transaction Exploitation: The research emphasizes the role of specific SMB Transaction commands (Trans, Trans2, NT Trans) and how they are abused to trigger the buffer overflow.

Key Results

The primary result is a detailed, step-by-step explanation of the Eternalblue exploit's working mechanism, including its buffer overflow technique and the buffer grooming process. The paper demonstrates that the Eternalblue code within WannaCry is largely unchanged from its original form, which has significant implications for detection. While quantitative results like detection rates are not explicitly presented, the qualitative finding of code similarity directly points to the potential for improved signature-based detection.

Limitations and Future Work

  • Scope of Shellcode Analysis: The paper explicitly states that detailed code analysis of the shellcode itself is beyond the scope of this work, focusing instead on the Eternalblue exploit.
  • Notpetya Analysis: While Notpetya is mentioned, its exploit analysis is only briefly touched upon, noting its encryption and similarity to Eternalblue after decryption. A full analysis of Notpetya's exploit is not provided.
  • Future Work: The authors suggest that their work can be extended to the code analysis for ransomworm detection, implying that the insights gained from analyzing Eternalblue's consistency can be applied to build more effective detection tools.

Summary updated

Abstract

After the leaking of exploit Eternalblue, some ransomworms utilizing this exploit have been developed to sweep over the world in recent years. Ransomworm is a global growing threat as it blocks users’ access to their files unless a ransom is paid by victims. Wannacry and Notpetya are two of those ransomworms which are responsible for the loss of millions of dollar, from crippling U.K. national systems to shutting down a Honda Motor Company in Japan. Many dynamic analytic papers on Wannacry were published, however, static analytic papers about Wannacry were limited. Our aim is to present readers an systematic knowledge about exploit Eternalblue, from a high– leveled semantic view to the code details. Specifically, the working mechanism of Eternalblue, the reverse engineering analysis of Eternalblue in Wannacry, and the comparison with the Metasploit’s Eternalblue exploit are presented. The key finding of our analysis is that the code remains almost the same when Eternalblue is transplanted into Wannacry, which indicates its potential for signatures and thus detection.
BibTeX
@inproceedings{liu2022working,
  author = {Zian Liu and Chao Chen and Leo Yu Zhang and Shang Gao},
  title = {{Working Mechanism of Eternalblue and Its Application in Ransomworm}},
  booktitle = {CSS},
  year = {2022},
  doi = {10.1007/978-3-031-18067-5\_13},
}

Loading related content...

Figure