Kali下安装Docker+DVWA

2018-10-31  本文已影响0人  开口海螺

最近小伙伴们都在研究DVWA,为了方便快速搭建DVWA靶场,把整个流程记录下来,方便使用。

版本:Kali 4.17.0

1. 安装Docker

添加Docker的阿里源,找到/etc/apt/source.list文件在底部添加如下源:

deb http://mirrors.aliyun.com/docker-ce/linux/debian wheezy stable

Kaili 4.17.0 的debian版本是wheezy,其他版本修改版本名称即可

进入终端Terminal,下载组件,添加Docker官方的GPG Key,:

# apt update
# apt install apt-transport-https ca-certificates curl python-software-properties
# curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
# apt-key fingerprint 0EBFCD88

接下来使用apt工具安装Docker即可,顺便测试一下:

# apt install docker-ce
# systemctl start docker
# docker run hello-world

看到如下界面就代表Docker安装成功

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

2. 安装DVWA

为了方便实用,已经把最新的DVWADocker镜像放到了阿里云仓库上,只需要使用如下命令下载即可:

# docker pull registry.cn-beijing.aliyuncs.com/upgradeb/dvwa

Docker的镜像创建一个新容器:

# docker run -dit -p 80:80 --name dvwa registry.cn-beijing.aliyuncs.com/upgradeb/dvwa

-p 第一个80是对外访问接口,可以自己修改为其他的端口,比如:8080
-p 第二个80是容器内的端口请不要改动
--name dvwa 名字可以自己定义

接下来打开浏览器输入:127.0.0.1或者本机的其他IP地址,即可浏览访问

图片.png

用户名:admin
密码:password

开始挖洞吧~~~

最后

停止运行:

# docker stop dvwa

再次启动:

# docker start dvwa

删除当前的容器:

# docker rm dvwa
上一篇下一篇

猜你喜欢

热点阅读