Static and Dynamic Analysis of Wannacry Ransomware: July 2018
Static and Dynamic Analysis of Wannacry Ransomware: July 2018
Static and Dynamic Analysis of Wannacry Ransomware: July 2018
net/publication/332144343
CITATIONS READS
8 4,692
4 authors, including:
Some of the authors of this publication are also working on these related projects:
Adversarial Attacks Against Machine Learning-Based Spam Detection Models in Online Social Networks (OSNs) and Countermeasures View project
All content following this page was uploaded by Vassilios Vassilakis on 02 April 2019.
Abstract—Nowadays ransomware presents a huge and the designing and developing effective ransomware detection and
fastest growing problem for all types of users from small mitigation mechanisms.
households to large corporations and government bodies. Modern
day ransomware families implement sophisticated encryption and The rest of paper is organized as follows. In Section II, we
propagation schemes, thus limiting chances to recover the data present the relevant background information on ransomware
almost to zero. In order to design and develop appropriate in general and on WannaCry in particular. In Sections III, IV,
detection and mitigation mechanisms it is important to perform and V, we present the main findings from our conducted static
ransomware analysis and indemnify its features. In this work, we and dynamic analysis of WannaCry, including its inherent
present our ransomware analysis results focusing on the infamous network indicators. Finally, Section VI draws the conclusions
WannaCry ransomware. In particular, the presented research
and discusses potential future directions.
examines the WannaCry behaviour during its execution in a
purpose-built virtual lab environment. We perform static and
dynamic analysis using a wide range of malware analysis tools. II. BACKGROUND
The obtained results can be used for developing appropriate
detection and mitigation mechanisms for WannaCry or other A. The Basics of Ransomware
ransomware families that exhibit similar behaviour.
Ransomware presents a type of malicious software that
Keywords—Malware analysis, ransomware, WannaCry prevents or limits users from accessing their system, either
by locking the screen or by encrypting files, until a ransom is
paid [3]. Typically, two types of ransomware are distinguished:
I. I NTRODUCTION lockers and cryptors [2]. Lockers present a less sophisticated
type of ransomware which simply locks the device’s user
Currently ransomware threat is considered as the main interface, preventing from logging in and accessing programs
moneymaking scheme for cyber criminals and the key threat and data. In most cases it leaves the user with very few
to the Internet users [1], [2]. Starting from relatively simple capabilities such as allowing the victim just to communicate
fake antivirus applications in 2008, ransomware has evolved with the attacker and pay the ransom. Lockers usually can be
during the time and emerged into sophisticated forms such as removed cleanly, as they leave the underlying system and files
crypto type ransomware. The apotheosis of this evolution is untouched. This makes lockers less effective at extracting ran-
the occurrence of a new type of ransomware which combines som payments compared with their more destructive relatives
the usage of exploits with worm-like spreading mechanisms - cryptors.
to propagate itself in both internal and external networks.
Moreover, the emergence of new types of ransomware, such On the other hand, cryptors represent an advanced type of
as WannaCry, showed that ransomware keeps evolving and ransomware which aims at encrypting specific files of the in-
cyber criminals are upgrading the ransomware code with more fected system. Cryptors use a variety of different cryptographic
sophisticated features, such as worm propagation components algorithms, including both symmetric and public-key based.
and public-key encryption mechanisms. Therefore, from the Cryptors that rely on public-key encryption are particularly
research perspective, the design of new countermeasures apart difficult to mitigate, since the encryption keys are stored
from traditional security approaches, is considered as important in a remote command and control (C&C) server. Cryptors
and trending task in this field. Such designs, however, require a typically include a time limit for ransom to be paid and provide
comprehensive analysis of ransomware features and behaviour users with a special website to purchase cryptocurrency (e.g.,
which typically involve a wide range malware analysis tools. Bitcoins) and step-by-step instructions on how to pay the
ransom. The lifecycle of modern day ransomware typically
In this work, we have performed a comprehensive analysis consists of the following steps [4]: distribution, infection, com-
of the infamous WannaCry ransomware. We present both static munications, file search, file encryption, and ransom demand.
and dynamic analysis results. The presented techniques are
applicable also in the cases of other ransomware families with B. The Basics of WannaCry
characteristics similar to WannaCry, such as worm-spreading
mechanisms and public-key based encryption. In particular, the WannaCry ransomware (also known as Wana Decrypt0r,
presented research examines the WannaCry behaviour during WCry, WannaCry, WannaCrypt, and WanaCrypt0r) was ob-
its execution in a safe purpose-built virtual lab environment at served during a massive attack across multiple countries on
the University of York. The obtained results can be used for 12 May 2017 [5]. According to the multiple reports from
security vendors, in total 300 000 systems in over 150 countries
TABLE I. WANNAC RY COMPONENTS .
had been severely damaged. The attack affected a wide range
of sectors, including healthcare, government, telecommunica- Worm Component
MD5 db349b97c37d22f5ea1d1841e3c89eb4
tions, and gas/oil production. SHA1 e889544aff85ffaf8b0d0da705105dee7c97fe26
SHA256 24d004a104d4d54034dbcffc2a4b19a11f39008a575aa
A difficulty of protecting against WannaCry lies in its 614ea04703480b1022c
ability to spread itself to other systems by using a worm File Type PE32 executable (GUI) Intel 80386, for MSWindows
component. This feature makes the attacks more effective and Encryption Component
requires defense mechanisms that can react quickly and in real MD5 84c82835a5d21bbcf75a61706d8ab549
SHA1 5ff465afaabcbf0150d1a3ab2c2e74f3a4426467
time. Furthermore, WannaCry has an encryption component SHA256 ed01ebfbc9eb5bbea545af4d01bf5f107166184048043
that is based on public-key cryptography. 9c6e5babe8e080e41aa
File Type PE32 executable (GUI) Intel 80386, for MSWindows
During the infection phase, WannaCry uses the EternalBlue
and DoublePulsar exploits, that were allegedly leaked in April
2017 by a group called The Shadow Brokers. EternalBlue
exploits the server message block (SMB) vulnerability that TABLE II. DLL S INVOKED BY WANNAC RY WORM COMPONENT.
was patched by Microsoft on March 14, 2017 and has been
Library Imports Description
described in the security bulletin MS17-010 [6]. This vulner- ws2 32.dll 3 Windows Socket 2.0 32-bit
ability allows the adversaries to execute remote code on the iphlpapi.dll 2 IP Helper API
infected machines by sending specially crafted messages to wininet.dll 3 Internet Extensions for Win32
kernel32.dll 32 Windows NT BASE API Client
an SMBv1 server, connecting to TCP ports 139 and 445 of advapi32.dll 11 Advanced Windows 32 Base API
unpatched Windows systems. In particular, this vulnerability msvcp60.dll 2 Windows NT C++ Runtime Library
affects all unpatched Windows versions starting from Windows msvcrt.dll 28 Windows NT CRT
XP to Windows 8.1, except for Windows 10.
DoublePulsar is a persistent backdoor that can be used
to access and execute code on previously compromised sys- TABLE III. DLL S INVOKED BY WANNAC RY ENCRYPTION
tems, thus allowing the attackers to install additional malware COMPONENT.
on the system. During the distribution process, WannaCry’s Library Imports Description
worm component uses the EternalBlue for the initial infection kernel32.dll 54 Windows NT BASE API Client
through the SMB vulnerability by actively probing appropriate advapi32.dll 10 Advanced Windows 32 Base API
user32.dll 1 Multi-UserWindows USER API Client
TCP ports and if successful, tries to implant the DoublePulsar msvcrt.dll 49 Windows NT CRT
backdoor on the infected systems.
Fig. 4. Password for a ZIP archive in the encryption component. Fig. 6. WannaCry external network traffic attempting the SMB exploit.
TABLE VII. E XTERNAL IP ADDRESSES GENERATED BY WANNAC RY.
R EFERENCES
IP address : port
109.140.223.210 : 445 [1] D. O’Brien, “Ransomware 2017”, Internet Security Threat Report,
206.242.244.156 : 445 Symantec, July 2017.
52.213.90.240 : 445 [2] K. Savage, P. Coogan, and H. Lau, “The Evolution of Ransomware”,
202.76.26.154 : 445 Security Response, Symantec, June 2015.
205.215.5.24 : 445
80.133.73.130 : 445 [3] C. Everett, “Ransomware: To pay or not to pay?,” Computer Fraud &
198.73.58.205 : 445 Security, vol. 4, pp. 8-12, April 2016.
40.188.28.244 : 445 [4] McAfee Labs, “Understanding ransomware and strategies to defeat it,”
184.55.110.103 : 445 White Paper, 2016.
[5] Symantec, “What you need to know about the WannaCry ransomware,”
Threat Intelligence, October 2017.
[6] Microsoft Security Bulletin MS17-010 - Critical, March 14, 2017.
C&C servers by parsing the contents of c.wnry, which specifies [7] REMnux: A Linux Toolkit for Reverse-Engineering and Analyzing
the configuration data, including the following .onion addresses Malware, https://remnux.org, accessed June 12, 2018.
to connect and the zipped Tor browser installation file: [8] ViRus Share malware repository, https://virusshare.com, accessed June
12, 2018.
gx7ekbenv2riucmf.onion [9] Pestudio, Malware Assessment Tool, https://www.winitor.com, accessed
June 12, 2018.
57g7spgrzlojinas.onion [10] IDA Pro, https://www.hex-rays.com/products/ida, accessed June 12,
xxlvbrloxvriy2c5.onion 2018.
76jdd2ir2embyv47.onion [11] Tor Project, https://www.torproject.org, accessed June 12, 2018.
[12] WinHex: Computer Forensics and Data Recovery Software,
cwwnhwhlz52maqm7.onion https://www.x-ways.net/winhex, accessed June 12, 2018.
https : //dist.torporject.org/torbrowser/6.5.1/tor [13] B. Nunes, M. Mendonca, X. N. Nguyen, K. Obraczka, and T. Turletti,
− win32 − 0.2.9.10.zip “A survey of software-defined networking: Past, present, future of
programmable networks,” IEEE Communications Surveys & Tutorials,
vol. 16, no. 3, pp. 1617-1634, Feb. 2014.
During its communication with Tor addresses, WannaCry [14] V. G. Vassilakis, I. D. Moscholios, B. A. Alzahrani, and M. D.
establishes a secure HTTPS channel to port 443, and uses Logothetis, “A software-defined architecture for next-generation cellular
common Tor ports, 9001 and 9050, for network traffic and networks,” Proc. IEEE International Conference on Communications
(ICC), Kuala Lumpur, Malaysia, May 2016.
directory information.
[15] C. Yoon, T. Park, S. Lee, H. Kang, S. Shin, and Z. Zhang, “Enabling
security functions with SDN: A feasibility study,” Computer Networks,
vol. 85, pp. 1935, July 2015.
[16] J. M. Ceron, C. B. Margi, and L. Z. Granville, “MARS: An SDN-based
VI. C ONCLUSION AND F UTURE W ORK malware analysis solution,” Proc. IEEE Symposium on Computers and
Communication (ISCC), Messina, Italy, August 2016.
We have performed static and dynamic analysis of Wan- [17] V. G. Vassilakis, I. D. Moscholios, B. A. Alzahrani, and M. D. Lo-
naCry ransomware. Both worm and encryption components of gothetis, “On the security of software-defined next-generation cellular
WannaCry have been examined using a wide range of reverse networks,” Proc. IEICE Information and Communication Technology
engineering and malware analysis tools. Our static analysis Forum (ICTF), Patras, Greece, July 2016.
has revealed important information regarding the DLLs and [18] K. Cabaj and W. Mazurczyk, “Using software-defined networking for
the main Windows functions used by WannaCry, as well as ransomware mitigation: The case of CryptoWall,” IEEE Network, vol.
30, no. 6, pp. 14-20, Dec. 2016
about additional tools, such as the decryption component. Our
[19] K. Cabaj, M. Gregorczyk, and W. Mazurczyk, “Software-defined
dynamic analysis has revealed important characteristics and networking-based crypto ransomware detection using HTTP traffic
behaviours of WannaCry during its execution. In particular, characteristics,” Computer & Electrical Engineering, vol. 66, pp. 353-
we identified Tor addresses used for C&C, observed TCP and 386, Feb. 2018.
DNS connections, and SMB probes, as well as actions related
to WannaCry persistence and obfuscation.