Windows Subsystem for Linux Enabled via Dism Utility
Adversaries may enable and use Windows Subsystem for Linux (WSL) using the Microsoft Dism utility to evade detection on Windows systems by running Linux applications and tools.
Attackers may enable the Windows Subsystem for Linux (WSL) to run Linux applications and tools directly on Windows, potentially bypassing security controls and hindering detection. This involves using the Dism.exe utility to enable the “Microsoft-Windows-Subsystem-Linux” feature. By leveraging WSL, adversaries can execute malicious code, access Windows resources, and perform various malicious activities while blending in with legitimate system processes. The use of WSL provides an environment where traditional Windows-based security solutions may have limited visibility, thus offering a way to evade detection. This activity has been observed as a post-exploitation technique, used after initial access to a compromised system.
Attack Chain
- An attacker gains initial access to a Windows system through methods such as phishing, exploiting vulnerabilities, or using compromised credentials.
- The attacker executes Dism.exe (Deployment Image Servicing and Management tool).
- Dism.exe is invoked with the command-line argument to enable the “Microsoft-Windows-Subsystem-Linux” feature.
- The system processes the Dism.exe command and enables WSL.
- The attacker installs a Linux distribution (e.g., Ubuntu, Kali) within the WSL environment.
- The attacker uses the WSL environment to execute Linux-based tools and scripts for reconnaissance, lateral movement, or data exfiltration.
- The attacker leverages the WSL environment to interact with Windows resources or execute Windows commands.
- The attacker achieves their objective, such as stealing sensitive data or establishing persistence on the compromised system.
Impact
Successful enablement of WSL can lead to a compromised Windows system being used as a platform for Linux-based attacks. This can result in data theft, system compromise, and further propagation of malicious activity within the network. The use of WSL can make it difficult to detect malicious activity since it allows attackers to blend Linux-based attacks with normal Windows operations. The lack of visibility into the WSL environment by traditional Windows security tools can lead to prolonged periods of undetected malicious activity.
Recommendation
- Monitor process creation events for the execution of
Dism.exewith command-line arguments that includeMicrosoft-Windows-Subsystem-Linuxto detect WSL enablement attempts (see Sigma ruleDetect WSL Enablement via Dism). - Enable Sysmon process creation logging to capture detailed command-line information for processes, which is crucial for detecting this activity (Sysmon Event ID 1).
- Implement the provided Sigma rule to detect suspicious usage of the DISM utility to enable WSL. Tune the rule based on your environment to minimize false positives.
- Investigate any alerts generated by the Sigma rule
Detect WSL Enablement via Dismto determine the legitimacy of the activity. - Monitor network connections originating from WSL processes for suspicious outbound traffic.
- Consider blocking the execution of Dism.exe if WSL is not a sanctioned tool in your environment.
Detection coverage 2
Detect WSL Enablement via Dism
mediumDetects attempts to enable Windows Subsystem for Linux (WSL) using the Dism.exe utility.
Detect Dism.exe Usage for Feature Enablement
lowDetects Dism.exe being used to enable Windows features, which could be abused to enable WSL.
Detection queries are kept inside the platform. Get full rules →