docker之vulhub靶场环境搭建(Linux)

首先安装pip:

curl -s https://bootstrap.pypa.io/get-pip.py | python3

再安装docker:

curl -s https://get.docker.com/ | sh

然后验证docker是否安装成功:

docker version

安装docker-compose:

pip install docker-compose

验证docker-compose是否安装成功:

docker-compose version

需要从GitHub上把项目pull下来:

sudo apt install pip


git clone https://github.com/vulhub/vulhub

部署系统环境:

docker-compose build

docker-compose up -d

这里可以看到部署的image

docker ps -a 

看是否报错:

如果报错就执行下面的命令:

sudo gpasswd -a root用户名 docker

下面是具体过程

┌──(root㉿kali)-[~]
└─# cd vulhub                     
                                                                                               
┌──(root㉿kali)-[~/vulhub]
└─# ls
activemq               docker         glassfish    libssh      phpunit          struts2
appweb                 drupal         goahead      LICENSE     postgres         supervisor
aria2                  ecshop         gogs         log4j       python           thinkphp
base                   elasticsearch  hadoop       magento     rails            tomcat
bash                   electron       httpd        mini_httpd  README.md        uwsgi
cgi                    fastjson       imagemagick  mysql       README.zh-cn.md  weblogic
coldfusion             ffmpeg         jackson      nexus       redis            webmin
confluence             flask          java         nginx       rsync            wordpress
contributors.md        fpm            jboss        node        ruby             zabbix
contributors.zh-cn.md  ghostscript    jenkins      openssh     samba
couchdb                git            jira         openssl     scrapy
discuz                 gitea          jmeter       php         solr
django                 gitlab         joomla       phpmailer   spark
dns                    gitlist        jupyter      phpmyadmin  spring
                                                                                               
┌──(root㉿kali)-[~/vulhub]
└─# cd jboss 
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss]
└─# ls
CVE-2017-12149  CVE-2017-7504  JMXInvokerServlet-deserialization
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss]
└─# cd CVE-2017-7504
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-7504]
└─# docker-compose build
jboss uses an image, skipping
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-7504]
└─# docker-compose up -d
Creating network "cve-2017-7504_default" with the default driver
Pulling jboss (vulhub/jboss:as-4.0.5)...
as-4.0.5: Pulling from vulhub/jboss
db0035920883: Pull complete
a9ebd83b4a47: Pull complete
02ef9e65a664: Pull complete
b2786dccb0cc: Pull complete
1b809e89f352: Pull complete
bf313a79ccc8: Pull complete
523524c34911: Pull complete
a0cca67aa589: Pull complete
612b2bde4172: Pull complete
Digest: sha256:5a0daba1fe6d01d622058a0e4d0918f42ba9630a1effb46789aeea7ffd3361c2
Status: Downloaded newer image for vulhub/jboss:as-4.0.5
Creating cve-2017-7504_jboss_1 ... done
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-7504]
└─# 
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-7504]
└─# cd ..           
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss]
└─# ls
CVE-2017-12149  CVE-2017-7504  JMXInvokerServlet-deserialization
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss]
└─# cd ..
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss]
└─# cd CVE-2017-12149
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-12149]
└─# docker-compose up -d

Creating network "cve-2017-12149_default" with the default driver
Pulling jboss (vulhub/jboss:as-6.1.0)...
as-6.1.0: Pulling from vulhub/jboss
db0035920883: Already exists
a9ebd83b4a47: Already exists
02ef9e65a664: Already exists
b2786dccb0cc: Already exists
1b809e89f352: Already exists
bf313a79ccc8: Already exists
22a04cfb637c: Pulling fs layer
bee28824e06f: Pulling fs layer
65564adda0bf: Pulling fs layer
86a86fa13070: Waiting
a4a756fea7e3: Waiting
b63c4887dea1: Waiting
a6203e06012a: Waiting
fd0068653bc0: Waiting
ERROR: error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/54/5495c1f64144a047e2b0a09043bd3979cc9d0b21c8914b81fe77bfd026ef8ac2/data?verify=1651835425-UpldNFdTg1htiAHfTppCHPJ3eEE%3D: dial tcp [2606:4700::6812:7b19]:443: connect: network is unreachable
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-12149]
└─# docker-compose build

jboss uses an image, skipping
                                                                                               
┌──(root㉿kali)-[~/vulhub/jboss/CVE-2017-12149]
└─# docker-compose up -d
Pulling jboss (vulhub/jboss:as-6.1.0)...
as-6.1.0: Pulling from vulhub/jboss
db0035920883: Already exists
a9ebd83b4a47: Already exists
02ef9e65a664: Already exists
b2786dccb0cc: Already exists
1b809e89f352: Already exists
bf313a79ccc8: Already exists
22a04cfb637c: Pull complete
bee28824e06f: Pull complete
65564adda0bf: Pull complete
86a86fa13070: Pull complete
a4a756fea7e3: Pull complete
b63c4887dea1: Pull complete
a6203e06012a: Pull complete
fd0068653bc0: Pull complete
Digest: sha256:1b91acd3e71e966f8bbeae7134dd1e2e183f4973955ae66defbc0abe8e572fec
Status: Downloaded newer image for vulhub/jboss:as-6.1.0
Creating cve-2017-12149_jboss_1 ... 
Creating cve-2017-12149_jboss_1 ... error

ERROR: for cve-2017-12149_jboss_1  Cannot start service jboss: driver failed programming external connectivity on endpoint cve-2017-12149_jboss_1 (df2cb6cf0da8f843dff7c4bd510efe4cbb70789f9ec316d4943634d05c7231b1): Bind for 0.0.0.0:8080 failed: port is already allocated

ERROR: for jboss  Cannot start service jboss: driver failed programming external connectivity on endpoint cve-2017-12149_jboss_1 (df2cb6cf0da8f843dff7c4bd510efe4cbb70789f9ec316d4943634d05c7231b1): Bind for 0.0.0.0:8080 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值