Windows File Event: Possible Modification of wsl.exe from Installed Location

Alerts on attempts to modify wsl.exe in installed WSL/WindowsApps locations, indicating potential binary replacement for proxy execution.

FreeReviewedSigma · Medium · v1
Product
windows
Category
file_event
Author
Liran Ravich, Swachchhanda Shrawan Poudel (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2026-05-05
Updated
2026-10-03
title: "Windows File Event: Possible Modification of wsl.exe from Installed Location"
id: 4fb0a153-5d74-4bbf-b483-f349059bbf30
status: experimental
description: This rule flags file events where wsl.exe is targeted for modification from typical installed paths under Program Files and WindowsApps. Replacing the legitimate wsl.exe binary with a malicious one can lead to proxy execution when a user runs WSL, supporting stealth and defense evasion. It relies on Windows file event telemetry capturing the target filename and associated modifying process image, with exclusions for msiexec and svchost to reduce benign installer/service activity.
references:
  - https://cardinalops.com/blog/bash-and-switch-hijacking-via-windows-subsystem-for-linux/
  - https://blog.qualys.com/vulnerabilities-threat-research/2022/04/20/implications-of-windows-subsystem-for-linux-for-adversaries-defenders-part-2
  - https://www.bleepingcomputer.com/news/security/new-malware-uses-windows-subsystem-for-linux-for-stealthy-attacks/
  - https://thehackernews.com/2021/09/new-malware-targets-windows-subsystem.html
  - https://learn.microsoft.com/en-us/windows/wsl/
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/file/file_event/file_event_win_wsl_binary_modification.yml
author: Liran Ravich, Swachchhanda Shrawan Poudel (Nextron Systems), Huntrule Team
date: 2026-05-05
tags:
  - attack.stealth
  - attack.t1036.005
  - attack.t1218
logsource:
  category: file_event
  product: windows
detection:
  selection_wsl_exe:
    TargetFilename|endswith: \wsl.exe
  selection_wsl_folder:
    - TargetFilename|contains:
        - :\Program files\wsl\
        - :\Program files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_
    - TargetFilename|contains|all:
        - :\Users\
        - \AppData\Local\Microsoft\WindowsApps\
  filter_main_msiexec:
    Image:
      - C:\Windows\System32\msiexec.exe
      - C:\Windows\SysWOW64\msiexec.exe
  filter_main_svchost:
    Image: C:\Windows\System32\svchost.exe
    TargetFilename|contains: \WindowsApps\
  condition: all of selection_* and not 1 of filter_main_*
falsepositives:
  - Unlikely
level: medium
regression_tests_path: regression_data/rules/windows/file/file_event/file_event_win_wsl_binary_modification/info.yml
license: DRL-1.1
related:
  - id: 2f400434-01e1-416b-b52c-bb5bfbb9eb78
    type: derived