{'fraction_non_alphanumeric': 0.03828171828171828, 'fraction_numerical': 0.014945054945054945, 'mean_word_length': 5.2502497502497505, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Dangerous Combo: Fileless Malware and Cryptojacking

Fileless malware and cryptojacking attacks have appeared independently as the new alarming threats in 2017. After 2020, fileless attacks have been devastating for victim organizations with low-observable characteristics. Also, the amount of unauthorized cryptocurrency mining has increased after 2019. Adversaries have started to merge these two different cyberattacks to gain more invisibility and profit under"Fileless Cryptojacking."This paper aims to provide a literature review in academic papers and industry reports for this new threat. Additionally, we present a new threat hunting-oriented DFIR approach with the best practices derived from field experience as well as the literature. Last, this paper reviews the fundamentals of the fileless threat that can also help ransomware researchers examine similar patterns.


I. INTRODUCTION
With the highly skilled attackers [1], and zero-day vulnerabilities, the number and complexity of sophisticated cyberattacks are increasing [2]. Ransomware [3] and unauthorized cryptomining [4] are the most common threats in the wild [5]. Recently, ransomware and cryptojacking incidents have been observed under an emerging threat: "Fileless malware" that is ten times more successful than the other file-based attacks [6].
The main efficiency of this technique is to run malicious scripts on memory (RAM) injecting adversary codes to legit processes in order to bypass sophisticated but traditional signature-based and behavior-based anti-malware detection systems [7]. The scripts leave no trace on the disk [6] as an anti-forensics technique [8] while providing full control to remote Command and Control (C2) servers [9]. Furthermore, even if the original malicious scripts are identified and removed, they remain operational in victim endpoints.
A remarkable feature of fileless threats is to become stealthy, which means it uses legitimate built-in tools that cannot be blocked, such as PowerShell, WMI (Windows Management Instrumentation) subscriptions, and Microsoft Office Macros [10]. It is also called a living-off-the-land attack that attackers do not need to install any other tools during this attack. Moreover, less forensics evidence and exploitation of known tools like PsExec.exe or Adfind.exe [11] make detections harder and investigations challenging [12].
In 2017, 77% of detected attacks were coming from more sophisticated fileless attack techniques [13], [14]. In 2019, Trend Micro reported that they blocked more than 1.4 million fileless events [15]. In 2020, fileless malware detections increased nearly 900% because most of the threat actors have discovered its effectiveness compared with the traditional ways [16], [17].
Notably, the open-source attack frameworks, such as Pow-erShell Empire, PowerSploit, play a significant role [18] in the complex fileless malware attacks [19]. These frameworks are distributed as open-source tools to create and simulate the attack phases for nefarious purposes as well as penetration testing. The open-source tools also provide abilities on elevating privileges or spreading laterally across victim networks. Some of these penetration test tools (Red Team tools) are Mimikatz, Cobalt Strike, Metasploit [20]. Especially, Cobalt Strike and Metasploit were the fileless malware threat sources for a quarter of all malware servers in 2020 [21], [22]. There was a 161 percent increase happened in 2020 in the usage of CobaltStrike Framework [23]. In the first half-year of 2021, most attacks have been observed with the Cobalt Strike attack tool [24].
In the use of fileless malware, the threat actors, specifically APT groups, try to steal data, disrupt operations, destroy infrastructures, or use the computer resources as seen in the cryptojacking incidents [25]. Unlike most traditional methods, threat actors are slow in fileless attacks, specifically during lateral movements on networks to avoid the detection methods [26]. Therefore, attacks can take days, weeks, or sometimes months that cause a persistent data breach or resource usage as experienced in cryptojacking.
Cryptojacking is the unauthorized use of a computing device to mine cryptocurrency [27], [28], [25]. In a cryptojacking attack, a victim may suffer from the lack of computer performance, hardware (CPU, GPU, and battery) declining, and high electricity bills.
There are three types of cryptojacking attacks. 1) In-browser Cryptojacking: runs with cryptojacking websites that contain hidden mining scripts [29]. 2) In-host Cryptojacking: runs on operating systems and disks (ROM) as malicious programs [29]. 3) In-memory only Cryptojacking: that runs on memory (RAM) only with malicious scripts [30]. Although in-browser cryptojacking attacks declined after Coinhive (in-browser crypto-mining service) shutdown in March 2019, in-memory cryptojacking is one of the most prevalent threats in the wild [5]. It was observed 25% more cryptocurrency mining malware in 2020 over 2019 levels [31]. With the rise of fileless malware and cryptojacking incidents, today, cybercriminals have merged these attacks into a dangerous combo: fileless cryptojacking malware [32]. Even though fileless malware and cryptojacking attacks have started independently and both attack types gained popularity in 2017, as shown in Fig. 1, cryptojacking incidents were observed with fileless malware attacks after 2019 [32].
In this paper, we attempt to provide an understanding of the emerging fileless cryptojacking. The second goal is to fill a gap in the literature that there is no sufficient research on this new problem. Finally, we present a novel threat hunting-oriented DFIR approach with the best practices derived from academic research and field experience. To the best of our knowledge, this paper is one of the first comprehensive research attempts on "fileless cryptojacking."

II. FILELESS MALWARE WORKFLOW
Malware analysis relies on the analysis of executable binaries, but in fileless malware, there is no actual executable stored on a disk to inspect [7]. It stays and operates in the Random Access Memory (RAM) and removes the footprints to increase the difficulty of removal [6]. It is also called nonmalware, Advanced Volatile Attack (AVT) [33], or Living-offthe-Land (LotL) attack as threat actors use legitimate tools, processes, benign software utilities, and libraries during an attack [8]. These are built-in native and highly reliable Windows applications such as Windows Management Instrumentation (WMI) subscriptions, PowerShell, Microsoft Office Macros [10]. Thus, it is stealthy, and it is almost impossible to block legitimate built-in tools. In other words, the operating system attacks itself.
However, fileless malware is a broad term, and some attacks can combine file-based attacks with fileless malware. Also, some phases of the attack chain can be fileless while others can store files on a disk [34]. Moreover, in a ransomware incident, the attack was completed by writing the files into the disk. However, the delivery, execution, and propagation phases are still fileless [8].
Based on this concept, fileless malware threats can be classified into two types: • Type I: Fully Fileless Malware: It runs no file on disk, but all activities are observed on memory. Threat actors can send malicious network packets to install backdoors that reside in the only kernel memory. [34]. • Type II: Fileless Malware with Indirect File Activity: It does not directly write files on disk, but threat actors can install a PowerShell command within the WMI repository by configuring a WMI filter for persistency. Even though the malicious WMI object theoretically exists on a disk, it does not touch the file system on the disk. Therefore, it is considered a fileless attack because, according to Microsoft [34], "the WMI object is a multi-purpose data container that can not be detected and removed".
Below, the workflow of fileless threat is explained.
A. Delivery On the other hand, zero-days such as Log4j or SolarWinds Serv-U [40] vulnerabilities are exploited to execute remote codes in fileless attacks. Even though patches have been released, some may miss the updates, or the updates may not work at first. Successful exploitation would give attackers the ability to gain privileges, view, and change data [12]. Recent exploitations have been observed with the Cobalt Strike framework with created effective backdoors and scheduled tasks [40], [41].
Unhardened attack surfaces such as public-facing RDP, FTP, SSH, MS-SQL ports can also be exposed to attacks that can lead unauthorized accesses to deploy fileless malware [20].
Last, a malicious website or a legitimate compromised website can contain some form of malicious code such as JavaScript [8], iFrames, and cross-site scripting. Especially since browsers run scripts automatically, the attack does not require any user interaction aside from them just visiting the site. This specific mode of infection makes detection very difficult. A malicious script from a malicious website can run an encoded PowerShell script to conduct fileless malware by loading executables and libraries into a legitimate Windows process [42]. For instance, Saad et al. [8] demonstrated how to develop fileless malware (JSless) for web applications using Javascript features with HTML5. Five well-known antimalware systems could not detect it [8].

B. Deployment
In this phase, the deployment vector may be a file such as executables, DLLs, LNK files, and scheduled tasks [34]. However, the payload is always fileless on memory. The Base64 encoded PowerShell commands or VBScript (with Wscript) [8] play a significant role in injecting legitimate processes on Windows or autostart services inside autorun registry keys as WMI event subscriptions [34]. A legitimate process can get the endpoint connected to a C2 server under an outgoing traffic [33]. Attackers can also exploit sysadmin tools to deploy fileless malware such as PSEXEC, MSHTA, BITSAdmin, CertUtil, and Msiexec. This can also be a second step after a script-based deployment. Fileless trojans can distribute and reinject themselves into other processes [43].

C. Persistent Mechanism
Even if malicious scripts are identified and removed, or the endpoint is rebooted, a persistent mechanism can keep malware operational. This gives attackers time to escalate privileges and move laterally on networks. Specifically, Pow-erShell, WMI Subscriptions, Scheduled Tasks, and Registry Hive are used to create a persistent mechanism [44], [33]. When fileless malware is deployed, a legitimate Windows process can write an executable (mostly base64-encoded) code into the registry [13] to run an encoded command to execute the payload during reboot. Common persistence frameworks are Armitage, Empire, and Aggressor Scripts. Those scripts help attackers exploit the Windows Task Scheduler [37]. For example, a registry key including a PowerShell command may control a malicious scheduled task [44].
In some attacks, a registry keyname is used to forward the process to another keyname that associates with the first keyname as the "TreatAs" feature to execute the payload. The "TreatAs" is actually a registry key that allows one CLSID (Class ID) to be spoofed by another CLSID. In this way, a COM object can be redirected to another COM object. This technique is also called COM (The Microsoft Component Object Model) Hijacking. COM is a system in Windows to provide interaction between software components through the operating system. COM hijacking is used for persistency and evasion by inserting executable malicious code in place of legitimate software through the Windows Registry under normal system operation [45].
Additionally, the WMI event filter can execute a malicious command after an uptime period [7], [13]. For example, Empire [46], an open-source PowerShell post-exploitation framework, has a feature to create a permanent WMI event subscription [47].

D. Privilege escalation
As threat actors are able to gain higher-level administrator privileges, they can move in the network and execute remote commands successfully. Bypassing User Account Control (UAC) is one of the common methods [48], [49]. In order to gain local admin or domain admin privileges, they can hijack legitimate Microsoft programs and processes that have an inherently auto-elevate feature which means unprivileged users can access and run these processes with elevated privileges.
The other common technique is "dumping credentials" [50]. In Windows, the Security Accounts Manager (SAM) database stores credentials with the "lsass.exe" process. SAM hive contains credentials of logged-in or created domain users and admins. Note that threat actors target admin credentials or special users such as help desk employees who have more privileges than regular users. After dumping credentials and obtaining password hashes, attackers can use the "Pass the Hash" technique [51] for authentication without a password. In the "Pass the Ticket" method, adversaries hijack an active directory domain controller and generate a new Kerberos golden ticket. The golden ticket can impersonate any accounts on the domain, which gives an indefinite privilege. Additionally, some open source tools such as Mimikatz can export cached plaintext passwords or authentication certifications from memory. Besides that, if attackers fail to get the passwords using these techniques above, they can use keyloggers on the compromised endpoint to obtain the passwords.

E. Lateral Movement
Lateral movement techniques can help threat actors to reach other endpoints, especially domain controllers and databases [12]. This provides an advantage in detection to the attackers because they can hide themselves in the other endpoints [52]. Therefore, data exfiltration, ransomware, or cryptojacking can happen later, even after the first detection and incident response.
Common lateral movement activities start with reconnaissance in a victim environment. Legitimate network mapping tools can come with fileless malware such as adfind.exe that is commonly used to map the network of victim environment in fileless attacks [53], specifically in Cobalt Strike attacks [54]. It is observed that threat actors export usernames, endpoint names, subnets, as seen in the sample commands below that were run under a batch file [53]: adfind.exe -f (objectcategory=person)> ad\_users.txt adfind.exe -f (objectcategory=computer)> ad\_comps.txt adfind.exe -f (objectCategory-subnet)> subnets.txt After mapping a network and determining the valuable assets, attackers can laterally move on the network using the credentials obtained in the privilege escalation phase [52]. Besides, attackers can also exploit the very well-known EternalBlue SMB vulnerability, which allows computers with Windows operating system to propagate information to other systems on the same network [55].

F. Command and Control (C2 Server Connection)
After all phases above, attackers can control some or all endpoints using C2s for remote command execution. Some adversaries may use remote desktop applications with direct GUI control in a victim network. Attackers can stay in a victim network to conduct ransomware or cryptojacking, sometimes for weeks.
There are three types of cryptojacking attacks: in-browser Cryptojacking, in-host Cryptojacking, and in-memory Fileless Cryptojacking.
A. In-browser Cryptojacking: In this technique, cryptojackers embed their malicious codes into a web page to perform mining. It is also called driveby cryptojacking that can affect even mobile devices with trojans hidden in downloaded apps [56]. Moreover, attackers can attempt to inject those scripts with an obfuscated shape into a compromised website that is actually known as a trusted source [57]. Since Cryptojacking can become profitable when a user remains on a website longer than 5.53 minutes [58], the mining scripts are primarily observed in free movie or gaming websites. Furthermore, with the WebSocket, WebAssembly [59], and WebWorker technology, the connection can be more robust to increase the mining ability [25].
Coinhive was a company that provided a script code to enable website owners to mine the Monero cryptocurrency [60] after 2017. It was widely exploited and injected into websites within a few months [61]. 81% of cryptojacking websites use scripts provided by Coinhive between 2017 and 2019 [62]. Symantec reported that Coinhive's script "statdynamic.com/lib/crypta.js" was even found in the Microsoft Store [63]. On March 8, 2019, Coinhive stopped its service, and unauthorized in-browser cryptojacking activities decreased significantly with 99% percent in the first quarter of 2020 [25]. However, Symantec reported that in-browser cryptojacking increased by 163% after the second quarter of 2020 [64].

B. In-host Cryptojacking:
Cryptojacking can run as a traditional malware in a victim endpoint. For example, an attachment of a phishing email can infect a computer by loading crypto mining code directly into the disk [65].

C. In-memory Fileless Cryptojacking:
The memory-based cryptojacking runs on the fileless threat techniques such as all-memory-only exploiting the WMI or PowerShell tools for execution [66]. It also uses registryresides persistent techniques. It is more dangerous than inbrowser and in-host cryptojacking attacks because its evasion and persistent techniques are more sophisticated [66]. Since fileless threats can allow attackers to have command and control abilities with backdoors [67], a fileless cryptojacking can be converted to a ransomware attack. This threat is examined in Section IV.

IV. NEW TREND: FILELESS CRYPTOJACKING MALWARE
As shown in Fig. 3, similar to the fileless ransomware attacks [67], cryptojackers use open-source attack frameworks (Phase 1) to deliver malicious scripts using phishing emails or vulnerability exploitations (Phase 2) and leverage open source security tools such as Mimikatz and exploit legitimate tools like PowerShell, WMI subscriptions, Microsoft Macros to execute the payload on memory (Phase 3) and create scheduled tasks for persistent mechanism (Phase 4) with continues download processes of malicious scripts [68]. Attackers want a malicious connection to remain to spread throughout the network by escalating privileges (Phase 5) and exploiting the common vulnerabilities such as the use of EternalBlue SMB vulnerability [55] or RDP brute-forcing (Phase 6). This provides the cryptojackers large pools of CPU resources (Phase 7) in victim enterprises for efficient cryptocurrency mining slaves (Phase 8) [68] to gain illicit profit with cryptocurrencies (Phase 9).
A fileless cryptojacking attack can be started with phishing emails, zero-day vulnerability exploitations, hidden scripts of malicious websites [69]. PowerShell commands connecting malicious payload sources are observed as seen in a sample command below: PowerShell.exe -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString(<URL>)" Cryptojackers exploit Powershell to execute malicious commands remotely straight in memory to bypass antivirus systems. Also, they can encode these commands using Base64 which is a binary-to-text encoding technique in a sequence of 8-bit bytes such as the sample command below [70].

powershell.exe -nop -exec bypass -Enc <Base-64 encoded script>
After infections, the endpoints send reports of the status of the connection and mining activity to the Command & Control servers (C2) of attackers. Attackers can also run remote commands for other purposes such as data exfiltration or ransomware. This is another dangerous face of the fileless cryptojacking compared with traditional cryptojacking techniques. Lateral movement routines are observed for spreading in victim networks [71]. As a fileless threat pattern, fileless cryptojacking also uses scheduled tasks or registry keys such as "Run" or "RunOnce" for malware propagation. Also, cryptojackers can store PowerShell commands under scheduled tasks and registry keys. System information is important to run cryptojacking scripts. Thus the commands can collect computer names, GUIDs, MAC addresses, OS, and timestamp information. In the final stage, victim endpoints become slaves of mining deployers or mining pools for the illicit gains of cryptojackers.
It creates a WMI event filter to deploy the persistent mechanism and install a a WMI class named "Power-Shell_Command" [78]. The malicious WMI class stores Base64 encoded commands as seen below [78]: -NoP -NonI -EP ByPass -W Hidden -E <Base64 encoded script> Furthermore, it disables other crytojacking activities like PCASTLE in victim endpoints to use resources at a maximum level [78].
3) Lemon Duck: It first appeared in 2019 with an effective lateral moving capability in victim networks exploiting EternalBlue SMB vulnerability [79]. Lemon Duck can infect Linux operating systems and IoT devices as well [80]. It also uses Mimikatz to dump credentials, adfind.exe to scan active directory, and attempts many other techniques such as task scheduling, registry exploitation, WMI subscriptions for persistent mechanism [81].
Below, there is a sample Lemon Duck powershell command that also has a 'bpu' function.

V. DIGITAL FORENSICS AND INCIDENT RESPONSE (DFIR) ON FILELESS CRYPTOJACKING MALWARE
As fileless threats are increasing, in-host detections are getting important that DFIR interventions are considered with threat intelligence and hunting in today's world. Detecting and blocking C2 connections require strong behavior monitoring capabilities or continuous threat intelligence feed to conduct effective threat hunting, especially in big organizations.
As displayed in Table I, we propose a new DFIR approach combining threat intelligence and hunting steps to recategorize the actions in a specific way for fileless cryptojacking. It can also be applied to fileless ransomware threats accordance with the techniques that proposed in the literature [88], [6], [89], [90], [13], [44], [66].
As a traditional expectation in an intrusion, an incident responder's goal is to identify C2 connections, explore the scope of the attack, and find the entry point (patient zero) at first. However, the action can be more proactive by taking the response back to threat hunting and threat intelligence steps. Specifically, threat hunting on the initial access is crucial. Besides, threat hunting on the publicly available servers is another important point because exploited zero-day vulnerabilities such as Log4J (CVE-2021-44228) can allow adversaries to run their scripts for cryptojaking or ransomware. Moreover, the attackers can directly access the internal network if a vulnerable endpoint is not in the DMZ (Demilitarized Zone). This can cause an easier lateral movement inside of the victim organization network.
Threat hunting against fileless threats should cover common exploited legitimate tools such as adfind.exe, psexec.exe, nmap, certutil, bitsadmin, or base64-encoded/decoded Power-Shell commands. As an example, these parts of the commands below are commonly used in fileless malware attacks under Cobalt Strike attack framework [90], [91]: powershell.exe -nop -w hidden -encodedcommand JABz... powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).DownloadString(<C2>))" It is very useful to merge threat hunting and DFIR with threat intelligence. Especially, Twitter is appearing as a more dynamic and prompt interactive platform for it [88]. Especially individual threat hunters feed the threat intelligence research with invaluable information. Our new "Threat Huntingoriented DFIR approach" is a cycle that it has been created to meet new (IR) Incident Response needs from a digital forensics perspective as shown in Table I.

VI. CONCLUSION
In this paper, we first conducted a comprehensive literature review of academic articles and industry reports on the new "Fileless Cryptojacking" threat. Our results show that all inmemory fileless Cryptojacking is not as investigated as inbrowser or in-host cryptojacking. This article attempts to provide a deep understanding of this problem. Also, we review the fundamentals of the fileless threat that can help ransomware researchers because ransomware and cryptojacking are the most common threats in the wild and have similar patterns (Tactics, Techniques, and Procedures -TTPs). As a fileless threat routine, all in-memory cryptojacking and ransomware attacks reside only in memory (RAM) and run malicious scripts under legitimate processes in the Windows operating system by creating persistent mechanisms and performing lateral movements with PowerShell commands, WMI objects, scheduler tasks, and registry key. In this context, this paper presents a new threat hunting-oriented DFIR approach with detailed phases. These can also help cybersecurity professionals who conduct digital forensics and incident response against fileless threats.