在 Windows 10 的 Linux 子系統(tǒng)(WSL)中運(yùn)行 Kali

Windows Subsystem for Linux (WSL) 出來也有一段時(shí)間了。也有不少朋友通過 Katoolin 來給 Bash on Ubuntu on Windows,添加 Kali 工具,這次來談一談如何用原生的 Kali 替換 Ubuntu,玩轉(zhuǎn) Bash on Kali on Windows.

前提

首先你要有 Windows 10 系統(tǒng),然后可以根據(jù) 微軟的說明啟用并安裝 WSL

使用 WSL-Distribution-Switcher

WSL-Distribution-Switcher 是 RoliSoft 貢獻(xiàn)到 GitHub 上的一個(gè)軟件??梢酝ㄟ^該工具中的 get-prebuilt.pyget-source.py 從 Docker Hub 上下載各個(gè)發(fā)行版的官方鏡像或 tar 包,然后用 install.py 安裝即可。最后,你還可以通過 switch.py 在你下載安裝的 WSL 中進(jìn)行切換。

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

下載 WSL-Distribution-Switcher

解壓后運(yùn)行cmd

進(jìn)入WSL-Distribution-Switcher-master 目錄后運(yùn)行 python get-prebuilt.py kalilinux/kali-linux-docker 下載鏡像

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.

下載完成后運(yùn)行 python install.py rootfs_kalilinux_kali-linux-docker_latest.tar.gz 安裝

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}...

安裝完成


使用 python switch.py ubuntu:trusty 可以切換回系統(tǒng)自帶的 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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容