endpoint(opens in a new tab or window)
windows(opens in a new tab or window)
process where host.os.type == "windows" and event.type : "start" and
(
(
(process.executable : "?:\\Windows\\System32\\bash.exe" or ?process.pe.original_file_name == "Bash.exe") and
not process.command_line : ("bash", "bash.exe")
) or
process.executable : "?:\\Users\\*\\AppData\\Local\\Packages\\*\\rootfs\\usr\\bin\\bash" or
(
process.parent.name : "wsl.exe" and process.parent.command_line : "bash*" and not process.name : "wslhost.exe"
) or
(
process.name : "wsl.exe" and process.args : (
"curl", "/etc/shadow", "/etc/passwd", "cat", "--system", "root", "-e", "--exec", "bash", "/mnt/c/*"
) and not process.args : ("wsl-bootstrap", "docker-desktop-data", "*.vscode-server*")
)
) and
not process.parent.executable : ("?:\\Program Files\\Docker\\*.exe", "?:\\Program Files (x86)\\Docker\\*.exe")
Install detection rules in Elastic Security
Detect Suspicious Execution via Windows Subsystem for Linux in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).