
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This Dockerfile builds a Debian-based Docker container with Metasploit-Framework installed.
A quick and easy way to deploy Metasploit on any box, including Linux, MacOS or Windows!
!https://raw.githubusercontent.com/phocean/dockerfile-debian-metasploit/master/screenshot.png
MSF is started automatically with:
It also includes:
The image is built every day by Docker Hub, upon the Dockerfile of my github repository.
The image is based on Ubuntu LTS and the nighly builds Metasploit repository.
Also note that the image is signed (trusted content) so that the integrity of each layer in the image is checked.
You can get the image with this simple command:
bashdocker pull phocean/msf
This command will download the image and you should have it available in your local image repository:
bashdocker images
Now, you can enjoy a neat msf prompt with this command:
bashdocker run --rm -i -t -p 9990-9999:9990-9999 -v $HOME/.msf4:/root/.msf4 -v /tmp/msf:/tmp/data --name msf phocean/msf
From there, you can start msfconsole, tmux or any other Metasploit tool (msfvenom, pattern_offset.rb, etc.).
Explanations:
Of course, it is up to you to adjust it to your taste or need.
You can also give it full access to the host network:
Note that this can be risky as all services on your host, including those that listen on localhost, would be reachable from within the container, in case it is compromise.
bashdocker run --rm -it --net=host --hostname msf -v $HOME/.msf4:/root/.msf4 -v /tmp/msf:/tmp/data --name msf phocean/msf
When you need extra terminals besides, use an alias such as:
bashdocker exec -it msf /bin/bash
At any time, you can exit, which only stops (suspend) the container.
Because of the --rm, the container itself is not persistent.
Persistency is however partially made throught the mounting of your local folders (history, scripts). So if you want to restart a session, just re-run the docker.
I find it more convenient, but if, for some reason, you prefer to keep the container, just remove the --rm and then you can restart the stopped container anytime:
bashdocker restart msf docker attach msf # Later: docker rm msf
The image is built daily from Docker Hub, so for example I use a crontab entry to keep it up-to-date:
*/5 * * * * root docker pull phocean/msf
Alternatively, you can keep all your images (not only phocean/msf) with such a command:
/usr/bin/docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -L1 docker pull 2>&1 > /dev/null
Finally, you can choose to build it manually with the steps described below.
If for some reason, including trust, you prefer to build the container, just use this command:
bashdocker build -t phocean/msf .
Alternatively, you can use the provided start.sh script.
Docker will download the Debian image and then execute the installation steps.
Be patient, the process can be quite long the first time.
Note that you may want to:
The configuration of Tmux maps the keyboard as in Screen (CTRL-A). It also makes a few cosmetic changes to the status bar.
Note that you could adjust the init script to automatically launch Tmux with a msf window and a bash one, for instance. I don't make it the default, because I don't want to bother people who don't need/want Tmux.*
Thanks to contributors that helped this project:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务