Skip to content

Conversation

@Liran017
Copy link
Contributor

@Liran017 Liran017 commented Oct 1, 2025

When bash.exe or wsl.exe are executed, they both act in the same way:

Query the reg key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\MSI\InstallLocation' for the WSL folder path ('c:\program files\wsl' by default).
Look for wsl.exe inside the path sacrificed in the reg key and open it.

The wsl.exe binary in program files can be replaced or the reg key can be edited to execute a malicious payload instead of the legitimate wsl.exe.

The full breakdown can be found here:
https://cardinalops.com/blog/bash-and-switch-hijacking-via-windows-subsystem-for-linux/

@Liran017 Liran017 requested a review from a team as a code owner October 1, 2025 06:31
Copy link
Member

@wietze wietze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this works on Windows 11 25H2. Nice find!

@wietze wietze merged commit 005c784 into LOLBAS-Project:master Dec 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants