Fileless malware

Fileless malware is a significant and evolving category of malicious software known for its stealthy nature and ability to evade traditional security defenses.

Here is a comprehensive explanation of fileless malware, its mechanism, methods, and implications, drawing on the sources:

What is Fileless Malware?

Fileless malware, also known as non-malware, infects legitimate software, applications, and other protocols existing in the system to perform various malicious activities.

Reasons for Using Fileless Malware

Attackers favor fileless techniques because they offer several advantages in evasion and persistence:

Fileless Techniques Used by Attackers

Attackers utilize various methods to deploy and execute fileless payloads:

Technique Description and Components
Native Applications Attackers exploit pre-installed tools in operating systems like Windows, such as PowerShell and Windows Management Instrumentation (WMI), to run malicious code. WMI is abused for automation, lateral movement, and persistence.
Legitimate Applications Attackers exploit legitimate system packages like Microsoft Word, Javascript, Flash, Adobe PDF Reader, or other documents. Malicious code is run by injecting the payload into the process memory of these applications.
Phishing Emails/Documents Attackers use phishing to embed malicious links or documents. When the victim opens the email or clicks the link, code is injected directly into memory via scripts embedded in documents or vulnerabilities.
Malicious Websites Fileless threats arrive from exploit-hosting websites. Visiting such a site can automatically scan for vulnerabilities and use Windows native tools (like PowerShell) to download and execute the payload directly into memory.
Registry Manipulation Attackers inject and run malicious code directly from the Windows Registry through a legitimate system process to bypass UAC and application whitelisting.
Script-based Injection Malicious scripts (often obfuscated and encoded) are executed in memory, such as through email attachments containing malicious scripts (VBScript, JavaScript, etc.) which launch the payload without writing files to disk.
Memory Code Injection This technique injects malicious code and maintains persistence in the process memory of a running process (a legitimate system process).
Reflective DLL Injection A dynamic link library (DLL) is loaded entirely into the memory space of a running process without writing the DLL to disk.

Classification of Fileless Malware

Fileless malware can be categorized based on its entry point and persistence requirements:

Type Description
Type 1: No File Activity Performed (Hardware) Malware never writes a file to the disk. Examples include malicious code embedded within compromised device's firmware or memory exploits.
Type 2: Indirect File Activity (Execution/Injection) Malware executes on the target machine using system files indirectly. For example, an attacker can trigger a malicious PowerShell command via the WMI repository.
Type 3: Required Files to Operate (Exploit) Malware requires files to operate but does not execute attacks from those files directly. For example, exploiting a document with an embedded macro or file.

Examples and Persistence Techniques

Countermeasures Against Fileless Attacks

To defend against fileless attacks, countermeasures focus on restricting access to the tools and methods attackers abuse: