WSL Pentesting

Last modified: 2023-05-28

Linux Windows

WSL (Windows Subsystem for Linux) is a feature of Windows that allows developers to run a Linux environment without the need for a separate virtual machine or dual booting.

Interesting Files

cat /etc/wsl.conf

Escape WSL to Windows Host Machine

If we’are currently on WSL machine, we can access to the host Windows machine as below.

cd /mnt/c/

If /mnt/c/ is empty, we need to mount the folder by running the following command.

cd /

# -t: Limit the set of filesystem types
# drvfs: A plugin for WSL
# C: : Specify the Windows root
mount -t drvfs C: /mnt/c