Muddy Water Apt Macro
Muddy Water Apt Macro
net/publication/334816612
CITATIONS READS
0 970
2 authors:
Some of the authors of this publication are also working on these related projects:
SİBER GÜVENLİK KAVRAMININ GELİŞİMİ VE TÜRKİYE ÖZELİNDE BİR DEĞERLENDİRME View project
THE RANSOMWARE DETECTION AND PREVENTION TOOL DESIGN BY USING SIGNATURE AND ANOMALY BASED DETECTION METHODS View project
All content following this page was uploaded by Mevlut Serkan Tok on 01 August 2019.
1 2
Mevlut Serkan TOK , Baris CELİKTAS *
1
Cyber Security Department, Institute of Computer Engineering, TOBB ETU, Ankara, Turkey
2
Cyber Security Engineering and Cryptography, Institute of Informatics, ITU, Istanbul, Turkey
[email protected], [email protected]
(Geliş/Received:14.01.2019; Kabul/Accepted:25.07.2019)
DOI: 10.17671/gazibtd.512800
Abstract— Macros are consisted of instructions and commands mainly used to automate tasks, embed functionality and
provide customization of Microsoft Office documents. However, they have been exploited by malicious hackers by
creating malware since they were introduced. Recently, Advanced Persistent Threat (APT) Groups have generally used
macros as attack vectors as well. Since 2017, Middle Eastern countries’ governmental institutions, and strategically
important oil, telecommunication and energy companies have been targeted by the APT Group probably affiliated with
Iran, and the group is named as MuddyWater by analysts due to the techniques they utilized to cover their tracks. The
group has generally conducted attacks via macro malware. In this work, we aimed to raise awareness regarding
MuddyWater APT Group and provide a detailed methodology for analyzing macro malware. The attributions, strategy,
attack vectors, and the infection chain of MuddyWater APT Group have been explained. In addition, a malicious
document, targeting Turkey and Qatar, detected first on 27 November 2018 have been analyzed, findings and proposals
have been presented for cybersecurity professionals.
Keywords— Macro Malware, MuddyWater, Advanced Persistent Threat, Malware Analysis, Digital Forensics
Anahtar Kelimeler— Makro Zararlı Yazılımı, MuddyWater, İleri Düzey Kalıcı Tehdit, Zararlı Yazılım Analizi, Adli
Bilişim
254 BİLİŞİM TEKNOLOJİLERİ DERGİSİ, CİLT: 12, SAYI: 3, TEMMUZ 2019
The basic contributions of this work to the literature are as 2.4. Targets
follows. We will present a review of MuddyWater APT
Group’s activities. We will also provide a detailed
Attacks in 2017 targeted Georgia, India, Iraq, Israel,
methodology in terms of macro malware analysis by
Pakistan, Saudi Arabia, Turkey, United Arab Emirates,
means of analyzing a sample malicious document step by
and the USA. In 2018, Turkey, Pakistan, and Tajikistan
step.
were mainly targeted [12]. Government institutions,
telecommunication and oil companies, energy companies
The rest of the work is as follows. Section II defines and were targeted [8] but no clear information was obtained
provides an overview of MuddyWater APT Group during the research to find out which institutions and
activities. Section III presents the analysis of the companies were hit.
malicious document that has been recently taken. Section
IV is about the limitations and Section V concludes with 2.5. Attack Vectors
future directions and recommendations.
MuddyWater has generally used malicious Word
2. MUDDYWATER APT GROUP documents and spear phishing emails to infect their
targets, as Duqu and Red October APT groups did before
MuddyWater APT Group was an active threat actor in [14]. MuddyWater attacks are characterized using a
2017. The group targeted victims in the Middle East slowly evolving PowerShell-based first stage backdoor
within memory vectors leveraging on PowerShell. In “POWERSTATS” [15]. The attack has continued with
attacks, the creation of new binaries was not required, only incremental changes in the tools and techniques
BİLİŞİM TEKNOLOJİLERİ DERGİSİ, CİLT: 12, SAYI: 3, TEMMUZ 2019 255
used. The delivery methods of malicious scripts are 2.6. Infection Chain
various such as downloading from a remote exploited site
or embedding to macro codes [10]. Documents used have been blurred to victims, and
victims have been enforced to enable macros to make
The group has used the decoy documents to impersonate documents readable. After enabling macros, malicious
government organizations as shown in Figure 1. Each of codes, mostly based on visual basic, have been executed,
documents is written in the language of the targeted and infection mechanism has been triggered [12].
country. Most of the documents have also included
government emblems and legitimate signatures [16]. In many cases, after triggering, a TCP connection has
Thus, original documents obtained before may have been been established to a remote server and malicious
used during attacks. PowerShell files have been downloaded to the victim’s
computer for post-exploiting [18]. Malicious codes for
post-exploiting have hardly ever been embedded to
macros [19].
2.7. Infrastructure
cc019683021a4ff05e84
03.03.2018 IL-1801.doc
860b62676dc1
güvenlikyönergesi ff46053ad16728062c6e
05.03.2018
.doc 7235bc7e8deb
Türkiye f84914c30ae4e6b9b1f2
05.03.2018 Cumhuriyeti 3d5c01e001ed
Kimlik Kartı.doc
Invest in b8939fa58fad8aa1ec27
05.03.2018
Turkey…doc 1f6dae0b7255
Uyuşturucu f2b5373f32a4b9b3d347
04.05.2018
kaçakçılığı.doc 01ff973ba69c
f00fd318bf58586c29ab Figure 4. The Screenshot before Enabling Macros
15.05.2018 Gizli koşullar.doc
970132d1fd2a
3c2a0d6d0ecf06f1be9a
15.05.2018 yönerge.doc
d411d06f7ba8
aa564e207926d06b8a59
15.05.2018 Early election.doc
ba50ca2c543d
eb69fb45feb97af81c2f3
21.05.2018 önemli rapor.doc
06564acc2da
Şikayetler ve 5a42a712e3b3cfa1db32
10.07.2018
eleştiriler.doc d9e3d832f8f1
0bf52163f51e0fd59bc0
16.07.2018 Onemli Rapor.doc
676126ecaffe
The first submission date of the sample malicious 3.2. Malware Analyzing Methodology Design
document on VirusTotal is 27 November 2018. The first
public report was published on 29 November 2018 [20]. In order to improve efficiency, live forensic analysis
Original name of the document is “ستمارة.doc” but we methods were employed [22]. All tests were conducted on
named it as “form.doc” to ease coding (MD5 or SHA a Microsoft Office 2017 installed on Windows 7 for the
hash digests didn’t be changed after renaming). x64-based virtual machine. Local IP address was set as
192.168.1.24. Audit object access was enabled in group
According to analysts, the attack, targeted Turkey and policy, and necessary audit permission was given to user
Qatar, had common characteristics of advance persistent account in order to get healthy security logs. Snapshots
threats. No malicious binary was written on disc and the were taken to provide secure baselines for repeated
attack was conducted with legal applications [21]. analysis. No commercial tool except Microsoft Office
2017 and VMware Workstation Professional was used
during analysis to provide researchers insights regarding
The document was consisted of a submission form to
open-source tools.
attend “The Second Conference of the Association of
Parliamentarians for Al Quds” which indeed took place in
Istanbul on 14-15 December 2018. The document forces A holistic approach was implemented to conduct a
the reader to enable macros (see Figure 4), so did detailed analysis but only processes verified are explained
previous MuddyWater documents. The document [23], [24], [25]. The order of analyzing steps is given
includes emblems of legal organizations as shown in below.
Figure 5, the contact phone numbers and emails are also
legitimate, which was confirmed by checking i. The metadata was obtained with ExifTool.
Parliamentarians for Al-Quds organization’s website. ii. The malicious macro code was extracted with
OfficeMalScanner.
We have strongly emphasized that there is no clear iii. The malicious macro code was de-obfuscated with
evidence to affiliate the document with MuddyWater a PowerShell script created.
despite there are many similarities. But there is no doubt iv. The malicious document was executed, and
that the methodology used to analyze the document will macros were enabled.
be a major contribution to further studies regarding macro v. The network activity of processes was detected by
malware analyzing. Sysinternals TCPView. Packet traffic was captured with
Wireshark, and then packets were analyzed.
vi. Process tree and mutexes were obtained with
Sysinternals procexp.
BİLİŞİM TEKNOLOJİLERİ DERGİSİ, CİLT: 12, SAYI: 3, TEMMUZ 2019 257
File Create Date 2018:11:21 15:18:00 Deflate and Base64 encoding were detected and to decode
File Modify Date 2018:11:22 12:25:00 “BcExEkAwEAXQq+hQSHotCg2FgjbWYolNJv6M63uv
Last Printed 2018:10:19 17:14:00 75asGPirxvViQjYwzMxr44UVpWnDpz64bUISPYr8BG
Code Page Windows Arabic Jt7SOUwht2bA7OeNE7klGGdVEsvZQkIi9/” expression,
Last Modified By Mohamed Bennabszllah a script was created. After decoding of obfuscated
Author Parliament Quds expression, downloading string from a remote server code
File Type DOC was found out as shown in Figure 9.
Software Microsoft Office Word
powershell -noexit -nologo -noprofile First packets captured on Wireshark were DNS queries as
-noninteractive -executionpolicy bypass expected (see Figure 13). The HTTP GET request was
-windowstyle hidden sent to the website from the victim and then downloading
the malicious script (cscript) process was started as shown
-NoExit: Don’t exit after running startup commands. in Figure 14.
-NoLogo: Hide the copyright banner at startup.
-NoProfile: Don’t load the PowerShell profile.
-NonInteractive: Don't present an interactive prompt to
the user.
-ExecutionPolicy Bypass: Bypass the policies.
-WindowStyle Hidden: Hide the session’s window.
Figure 10. The Script Detected on the Malicious Website 3.5.2. Registry Comparison: Before and After Enabling
Macros
3.5. Analysis after Enabling Macros
There were eight keys added to the registry after enabling
The pre-enabling macro analysis was completed, IOCs of macro and “rYF1pgeADA” named schedule task
detected were noted down. Registry hive was saved with record was detected as shown in Figure 15. Creating a
Regshot. Process Explorer was initiated. TCPview and scheduled task is a well-known persistency mechanism in
Wireshark were activated. Then macros were enabled on terms of malware writing. Thus, this IOC was noted down
Microsoft Word, the document became readable as and “analyzing scheduled tasks” step was added to the
expected. analysis plan.
3.6.2. Stealing Cookies, Sessions, and Logins Figure 23. The Script for Creating the Scheduled Task
260 BİLİŞİM TEKNOLOJİLERİ DERGİSİ, CİLT: 12, SAYI: 3, TEMMUZ 2019
After double-clicking on the document, PID 2720 In order to enable the persistence, cscript created a
WINWORD.exe was activated. Upon enabling macros, scheduled task named “rYF1pgeADA”. Daily on 8:24
child process PID 1188 cmd.exe was activated and it pm, rYF1pgeADA.xml file (includes malicious scripts
started PID 688 child process powershell.exe with same as cscript as shown in Figure 25) was executed by
parameters (see Figure 24). This process established the regsrv.32 (see Figure 26). This method is called
connection to 18.221.254.112 IP address and downloaded squiblydoo attack and was used in campaigns targeting
and executed malicious “cscript” and by doing so, this governments before [28].
process read cookies, loaded Task Scheduler COM API,
and dropped SQLite.dlls created .xml and .log files as
shown in Table 3.
6. CONCLUSION
to survive and cause further damage to the cyber Science and Mathematics, 1(2), 2008.
ecosystem.
[7] C. Beek et al., McAfee Labs Threats Report, Santa Clara, CA,
2018
In addition, CERTs have been generally avoided reporting
detected threats to the public or share with each other. But [8] Internet: A dive into MuddyWater APT targeting Middle-East,
a strong coordination and experience exchange between https://reaqta.com/2017/11/muddywater-apt-targeting-middle-
CERT teams are also seen as mandatory to prevent the east/, 15.12.2019
attack regardless of which institution is attacked. We [9] Internet: Elaborate scripting-fu used in espionage attack against
predict that published attack reports will not damage Saudi Arabia Government entity, https://
repetition but rather it will enhance the efforts of securing blog.malwarebytes.com/threat-analysis/2017/09/ elaborate-
the perimeter against APT groups. scripting-fu-used-in-espionage-attack-against-saudi-arabia-
government_entity/, 29.12.2019
Updated antivirus firewalls, and other endpoint security [10] Internet: T. Lancaster, Muddying the Water: Targeted Attacks in
solutions are well-known measures against attacks. But as the Middle East, https://unit42. paloaltonetworks.com/unit42-
explained, there are some methods to bypass group policy muddying-the-water-targeted-attacks-in-the-middle-east/,
and security measures, thus, this practice cannot be 10.12.2018
satisfactory. In addition, users access their business
emails while they are out of office. Hence, hardening [11] Internet: MuddyWater, https://attack.mitre.org/groups /G0069/,
institutional networks won’t be adequate, either. All users 05.12.2018
must be informed about macro malware and APT groups’ [12] Internet: J. Horejsi, Campaign Possibly Connected to
strategies. MuddyWater Surfaces in the Middle East and Central Asia,
https://blog.trendmicro.com/trendlabs-security-
In summary, this study suggests a better perspective to the intelligence/campaign-possibly-connected-muddywater-surfaces-
users, software developers, and security administrators middle-east-central-asia/, 26.12.2018
about macro malware and the key features of the [13] F. Li, A. Lai, D. Ddl, “Evidence of Advanced Persistent Threat: A
MuddyWater. We believe that several people involved in case study of malware for political espionage”, 2011 6th
the software development business will be able to design International Conference on Malicious and Unwanted
APT based Attack Detection and Prevention Tool by Software, Fajardo, 102-109, 18-19 October, 2011.
examining the content of our study. We also think that our
study will be a guide for future academic studies [14] N. Virvilis, D. Gritzalis, T. Apostolopoulos, “Trusted Computing
especially on macro malware. vs. Advanced Persistent Threats: Can a Defender Win This
Game?”, 2013 IEEE 10th International Conference on
Ubiquitous Intelligence and Computing and 2013 IEEE 10th
7. ACKNOWLEDGEMENTS
International Conference on Autonomic and Trusted
Computing, Vietri sul Mere, 396-403, 18-21 December, 2013.
We would like to thank to Prof. Dr. Ali Aydın Selçuk for
his guidance, feedback and valuable support; to Dr. [15] Internet: MuddyWater: Hackers Target Middle East Nations,
Süleyman ÖZKAYA for providing insights and malicious https://securereading.com/muddywater-hackers-target-middle-
document samples. east-nations/, 06.01.2019
[6] E. Daoud, I. Jebril, “Computer virus strategies and detection [21] Trapmine, Threat Report: Parliament Quds Turkiye ve Katari
methods”, International Journal of Open Problems in Computer Hedefleyen Siber Espiyonaj Faaliyeti, 2018
BİLİŞİM TEKNOLOJİLERİ DERGİSİ, CİLT: 12, SAYI: 3, TEMMUZ 2019 263
[22] L. Zhang, D. Zhang, L. Wang, “Live digital forensics in a virtual and Networks (DSN), 490-501, Luxembourg City, 25-28 June,
machine”, 2010 International Conference on Computer 2018.
Application and System Modeling (ICCASM 2010), 4, 328-
[27] Internet: C. Elisan, Why Malware Installers Use Tmp Files and
332, Taiyuan, 22-24 October, 2010.
The Temp Folder When Infecting Windows,
[23] B. Celiktas, M.S. Tok, N. Unlu, “Man In the Middle (MITM) https://www.rsa.com/en-us/blog/2017-04/why-malware-installers-
Attack Detection Tool Design”, International Journal Of use-tmp-files-and-the-temp-folder, 27.12.2018
Engineering Sciences & Research Technology, 7(8), 90-100,
[28] Internet: R. Nolen et al., Threat Advisory: “Squiblydoo”
2018.
Continues Trend of Attackers Using Native OS Tools to “Live off
[24] B. Celiktas, N. Unlu, E. Karacuha, “An Anti-Ransomware Tool the Land”, https://www. carbonblack.com/2016/04/28/ threat-
Design by Using Behavioral and Static Analysis Methods”, advisory-squiblydoo-continues-trend-of-attackers-using-native-
International Journal of Scientific Research in Computer Science os-tools-to-live-off-the-land/, 17.12.2018
and Engineering, 6(2), 1-9, 2018.
[29] Internet: AppLocker Bypass Techniques, https://
[25] B. Celiktas, “The Ransomware Detection and Prevention Tool evi1cg.me/archives/AppLocker_Bypass_Techniques.html,
Design by Using Signature and Anomaly Based Detection 26.12.2018
Methods”, M.Sc. Thesis, Istanbul Techical University,
[30] Internet: TR-14-001 (E-Posta Üzerinden Yayılan Tehdit “CVE-
Informatics Institute, May, 2018.
2012-0158”), https://www.usom.gov.tr/ tehdit/8.html, 21.12.2018
[26] S. Kim, S. Hong, J. Oh, H. Lee, "Obfuscated VBA Macro
[31] A. Şirikçi, N. Cantürk, “Adli Bilişim İncelemelerinde Birebir
Detection Using Machine Learning”, 2018 48th Annual
Kopya Alınmasının (İmaj Almak) Önemi”, Bilişim Teknolojileri
IEEE/IFIP International Conference on Dependable Systems
Dergisi, 5(3), 29-34, 2012.