type
status
date
slug
summary
tags
category
icon
password
@ZZHow(ZZHow1024)
参考文章:
CSDN 2022kali安装docker教程 [http://t.csdnimg.cn/OudQL]
CSDN 使用docker搭建dvwa环境 [http://t.csdnimg.cn/y6Cs5]
1.切换root用户
su root
2.安装docker
apt-get update
更新本地软件包列表
apt-get upgrade
升级系统中已安装的软件包
curl -fsSL
https://download.docker.com/linux/debian/gpg
| sudo apt-key add -
添加docker官方给出的GPG秘钥
echo 'deb
https://download.docker.com/linux/debian
stretch stable'> /etc/apt/sources.list.d/docker.list
更新源
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
导入证书
apt install docker.io
安装docker
docker -v
确认是否成功安装

3.安装docker-compose
apt install docker-compose
这一步是不需要的,并没有用到docker-compose(感谢“无止境”大佬指正
4.搭建dvwa环境
docker search dvwa
在官方仓库中搜索DVWA
docker pull docker.io/citizenstig/dvwa
下载镜像到本地(星榜第一)//此过程用时较长
docker images
列出本地镜像列表信息

5.启动DVWA靶场
docker run -d -p 9001:80 citizenstig/dvwa
启动,端口号为9001
docker ps
确认是否启动成功

6.在浏览器中登录DVWA靶场
ip addr
查看Kali的IP
- 记录eth0下inet后的IP地址 和 docker0下inet后的IP地址
- 若你想用Kali里的浏览器打开,则输入docker0下inet后的IP地址:9001
- 若你想用实体机里的浏览器打开,则输入eth0下inet后的IP地址:9001
可以这么做,但感觉有点多此一举。都映射了,那直接127.0.0.1:9001即可(感谢“无止境”大佬指正)

- 点击Create / Reset Database,然后稍等片刻

- 默认Username:admin
- 默认Password:password
- 点击Login
成功登录!
