How to add Kali Linux to the windows new terminal

Windows new terminal is rocking and switching between the powershell/bash is made easy than ever. Installation of new windows terminal can be done by following their GitHub link: https://github.com/microsoft/terminal . Adding the Kali linux to the wsl is done using windows store. Follow the document to add kali to windows subsystem library: https://www.kali.org/news/kali-linux-in-the-windows-app-store/.

Scenario:

As a penetration tester we always wanted kali linux in windows machine. Always installing kali in the virtualbox is not the optimal solution. If kali is also available in windows store then why anyone should waste time in installing kali in virtual machine. By using this new windows terminal one can add kali to the terminal and can switch between windows powershell and kali terminal like ever before.

  • Step1: Install Windows terminal and Kali wsl using the above links.

  • Step2: Before changing the settings of terminal we need uuid of kali linux instance. Enter the following commands in powershell to get values from registry.

(Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModel\StateRepository\Cache\PackageFamily\Data | findstr.exe "Kali").Substring(0,2).Trim()

powershell2.PNG Take the output of the command and put it the next command. In my case the output is "6f" powershell3.png

Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModel\StateRepository\Cache\PackageFamily\Data | where {$_.Name -match "6f" }
  • Step3: Note down the Publisher value(Without "CN=") from the output of the above command. This is the value we insert for our guid.
  • Step4: Open terminal settings by accessing options in the right pane. powershell1.png
  • Step5: Settings file is opened in your favorite editor and insert the values like below after ubuntu record
        {
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d kali-linux",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{**guid value**}",
            "historySize" : 9001,
            "icon" : "**Your Png logo**",
            "name" : "Kali-Linux",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : false
        }

My settings file for the reference: https://pastebin.com/C08wW1xs

  • Step6: Finally access the kali terminal side by side with windows powershell.

This could help security professionals who are using windows operating system to switch kali with a single tab key.

No Comments Yet