在 Windows 10 的 Linux 子系統(WSL)中運行 Kali

Windows Subsystem for Linux (WSL) 出來也有一段時間了。也有很多朋友經過 Katoolin 來給 Bash on Ubuntu on Windows,添加 Kali 工具,此次來談一談如何用原生的 Kali 替換 Ubuntu,玩轉 Bash on Kali on Windows.python

前提

首先你要有 Windows 10 系統,而後能夠根據 微軟的說明啓用並安裝 WSLlinux

使用 WSL-Distribution-Switcher

WSL-Distribution-Switcher 是 RoliSoft 貢獻到 GitHub 上的一個軟件。能夠經過該工具中的 get-prebuilt.pyget-source.py 從 Docker Hub 上下載各個發行版的官方鏡像或 tar 包,而後用 install.py 安裝便可。最後,你還能夠經過 switch.py 在你下載安裝的 WSL 中進行切換。git

WSL-Distribution-Switcher 須要 Python 3 支持,請下載安裝 https://www.python.org/downlo...github

下載 WSL-Distribution-Switcherdocker

解壓後運行cmdshell

進入WSL-Distribution-Switcher-master 目錄後運行 python get-prebuilt.py kalilinux/kali-linux-docker 下載鏡像ubuntu

c:\WSL-Distribution-Switcher-master\python get-prebuilt.py kalilinux/kali-linux-docker
[*] Requesting authorization token...
[*] Fetching manifest info for kalilinux/kali-linux-docker:latest...
[*] Downloading layer sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4...
[*] Downloading layer sha256:c8f41032911eaa696afa9ed9170e3db47150b3d637fa066aed13c98bee92d289...
[*] Downloading layer sha256:cb8b228855a6efcbc1d3e941ce073e4b33c682d6badad3d8d6df8f2edb1e6994...
[*] Downloading layer sha256:261c33ef5c8393779480a6a139d0e36aeb75177bbafeeaae56c0c7d0d8f6a866...
[*] Downloading layer sha256:c680ef1373dafaff04de30921f1f481909a0766f9632f89a1c72f4210716c8e8...
[*] Downloading layer sha256:dae364b40b0da2a96af468842688c9da33b63df8ad7b6a1aa2897c4b1aa17006...
[*] Downloading layer sha256:96dd93da002c6c03c7f03deb5da58330b46a09b7c2938cde3566345581598cf3...
[*] Downloading layer sha256:6e61dde25369335dcf17965aa372c086db53c8021e885df0e09f9c4536d3231e...
[*] Downloading layer sha256:45f74187929d366242688b3d32ccb5e86c205214071b99e94c0214e7ff2bc836...
[*] Downloading layer sha256:e5b4b71338633a415ad948734490e368e69605ba508a5fa8ad64775433798fb2...
[*] Downloading layer sha256:3f96326089c0580ebbcbb68d2f49dce1d7b6fe5cd79d211e4c887b0c9cdbeb02...
[*] Downloading layer sha256:d4ecedcfaa73285da5657fd51173fa9955468bf693332c03dce58ded73615c62...
[*] Downloading layer sha256:340395ad18dbbbd79d902342eef997fbd3ecb6679ad5005e5e714e8b0bc11e77...
[*] Downloading layer sha256:b2860afd831e842446489d37f8933c71dbd4f5d5f4b13d35185c4341fcca9a84...
[*] Rootfs archive for kalilinux/kali-linux-docker:latest saved to rootfs_kalilinux_kali-linux-docker_latest.tar.gz.

下載完成後運行 python install.py rootfs_kalilinux_kali-linux-docker_latest.tar.gz 安裝bash

c:\WSL-Distribution-Switcher-master>python install.py rootfs_kalilinux_kali-linux-docker_latest.tar.gz
[*] Probing the Linux subsystem...
[*] Default user is root at /root.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root...
[*] Beginning extraction...
[*] Backing up current rootfs to rootfs_ubuntu_trusty...
[*] Switching to new rootfs...
[*] Writing entries of root to /etc/{passwd,shadow,group,gshadow}...

安裝完成
ide

使用 python switch.py ubuntu:trusty 能夠切換回系統自帶的 ubuntu工具

c:\WSL-Distribution-Switcher-master> python switch.py ubuntu:trusty
[*] Probing the Linux subsystem...
[*] Moving current rootfs to rootfs_kalilinux_kali-linux-docker_latest...
[*] Moving desired rootfs_ubuntu_trusty to rootfs...

c:\WSL-Distribution-Switcher-master> bash
1 package can be updated.
1 update is a security update.
root@DESKTOP-40AEC1B:/mnt/c/WSL-Distribution-Switcher-master# cat /etc/issue
Ubuntu 14.04.5 LTS \n \l
相關文章
相關標籤/搜索