前言
我发现M1芯片想实现虚拟机是真的费劲。我开始找Windows资源(必要时平台会限制),找不到。结果淘宝解君愁。这下好了Parallels的PD启动好像给了window系统。然后我有14天试用,我是可以直接下载虚拟机,但是我过期了我也不知道会是个什么情况。所以我就另辟蹊径,我根据docker官方的kail镜像自己打包个不好嘛。(以及Ubuntu都是一个道理)
更好阅读体验:https://hengy1.top/article/11d32e85.html
为啥不想云容器
首先我的教程已经写的非常详细了,几乎只需要复制运行就好了。然后在2022年了有的地方变了,挺多坑都绕过来了。
如果你实在不想动手想直接白嫖(* ̄︿ ̄),可以到我的仓库看看👉仓库地址
但是我还是建议按照下面花点时间,因为我上传上去的10G不到而我本地有20G+,肯定很多都阉割了
开始慢慢搞得像个系统
先去官网找到官方镜像:发现支持arm,那就好办了。
$ docker pull kalilinux/kali-rolling:latest
$ docker images
$ docker run -id --restart=always --name=kali --cpus=2 -p 2222:22 -p 4888:4500 $(id)
$ docker ps -a
$ docker exec -it kali /bin/bash
$ passwd root
$ cp /etc/apt/sources.list /etc/apt/sources.list.bak && rm /etc/apt/sources.list
$ cd /etc/apt
$ echo 'deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib' >> /etc/apt/sources.list
$ echo 'deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib' >> ./sources.list
$ apt-get update && apt-get upgrade && apt install vim curl git wget
$ echo "deb http://mirrors.ustc.edu.cn/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list
$ echo "deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list
$ echo "deb http://mirrors.ustc.edu.cn/kali-security kali-current/updates main contrib non-free" >> /etc/apt/sources.list
$ echo "deb-src http://mirrors.ustc.edu.cn/kali-security kali-current/updates main contrib non-free" >> /etc/apt/sources.list
开始搞双Python与SSH登陆
$ apt-get -y install net-tools openssh-server python2.7
$ apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev
$ cd ~ && wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz && tar -xf Python-3.9.1.tgz && cd Python-3.9.1
$ ./configure --enable-optimizations
$ make -j 4 && make altinstall
$ python3.9 --version
$ apt install python3-pip
$ wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python2.7 get-pip.py
$ vim ~/.bashrc
$ source ~/.bashrc
$ echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && service ssh restart
SSH上去的效果
把kail核心工具包装上:很大!
$ apt-get update && apt-get upgrade
$ apt-get install kali-linux-everything
保存容器为镜像与文件挂载
$ exit
$ docker stop kali
$ docker commit d46ea163bd90 hengyisky/daily:kail2022
$ docker rm -f kali
$ docker run -id -v /xxx/xxx:/root/vol --restart=always --name=kali --cpus=2 -p 2222:22 -p 4888:4500 63ddce7ec717
$ docker exec -it kali /bin/bash
|