win10安装
DVWA下载地址https://github.com/digininja/DvWA/archive/master.zip
在phpstudy软件包下的www文件夹中新建一个文件夹名为dvwa,把DVWA-master压缩包解压进去
删除/dvwa/config文件夹下的config.inc.php.dist文件的.dist后缀
打开config.inc.php,修改用户名、密码
phpstudy启动apache和mysql
访问127.0.0.1/dvwa成功
点击第一个Setup DVWA,下拉到最后点击创建数据库
之后跳转登录,用户名admin,密码password
DVWA security调节靶场难度
docker安装
kali里面安装docker一直出问题,果断换centos
docker search dvwa搜索dvwa
docker pull citizenstig/dvwa选择下载量最高的
解决docker pull非常慢:配置加速器
cd /etc/docker
touch daemon.json
"registry-mirrors":[
"https://yxzrazem.mirror/aliyuncs.com",
"https://dockerhub.azk8s.cn",
"https://reg-mirror.qiniu.com",
"https://1rqfztnd.mirror.aliyuncs.com"
]
让配置文件生效systemctl daemon-reload,之后重启docker
docker无法重启 报错Process: 9276 ExecStart=/usr/bin/dockerd -H fd:// --
[root@mmk docker]# systemctl daemon-reload
[root@mmk docker]# systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@mmk docker]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Mon 2022-12-12 21:20:02 CST; 9s ago
Docs: https://docs.docker.com
Process: 9276 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 9276 (code=exited, status=1/FAILURE)
Dec 12 21:20:00 mmk systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 12 21:20:00 mmk systemd[1]: Failed to start Docker Application Container Engine.
Dec 12 21:20:00 mmk systemd[1]: Unit docker.service entered failed state.
Dec 12 21:20:00 mmk systemd[1]: docker.service failed.
Dec 12 21:20:02 mmk systemd[1]: docker.service holdoff time over, scheduling restart.
Dec 12 21:20:02 mmk systemd[1]: Stopped Docker Application Container Engine.
Dec 12 21:20:02 mmk systemd[1]: start request repeated too quickly for docker.service
Dec 12 21:20:02 mmk systemd[1]: Failed to start Docker Application Container Engine.
Dec 12 21:20:02 mmk systemd[1]: Unit docker.service entered failed state.
Dec 12 21:20:02 mmk systemd[1]: docker.service failed.
解决办法:将daemon.json改为daemon.conf即可
启动容器docker run --name dvwa01 -it -p 8888:80 citizenstig/dvwa(名字为dvwa01,容器外8888端口映射到容器内80端口)
docker: Error response from daemon: driver failed programming external connectivity on endpoint dvwa (a32d54064c470ed06281bacc1cea67c8f815506481d4950d0547d51757155fbb): Error starting userland proxy: listen tcp4 0.0.0.0:8888: bind: address already in use.
启动容器失败 报错Error starting userland proxy: listen tcp4 0.0.0.0:8888: bind: address already in use.
lsof -i:8888发现端口被python占用
换端口映射docker run --rm --name dvwa01 -it -p 81:80 citizenstig/dvwa
[root@mmk docker]# docker run --name dvwa01 -d -p 81:80 docker.io/citizenstig/dvwa
docker: Error response from daemon: Conflict. The container name "/dvwa01" is already in use by container "eb06273f1861df4aafee3f61bf27c3970222030715714066c67d17e189c29dc9". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
报错Error response from daemon: Conflict. The container name "/dvwa01" is already in use by container "eb06273f1861df4aafee3f61bf27c3970222030715714066c67d17e189c29dc9".
dvwa01已经存在了,换个名字就行
docker run --name dvwa1 -d -p 81:80 docker.io/citizenstig/dvwa
[root@mmk docker]# docker run --name dvwa1 -d -p 81:80 docker.io/citizenstig/dvwa
909e1a2626412275b8217f0003eb2fab0e5d8444a9d4d93639fa269b6de54f3a
终于成功了,后续的配置是和win10里面同样的流程