当前位置:   article > 正文

使用docker进行upload-labs靶场的安装搭建_upload搭建

upload搭建

由于我是在kali上搭建,默认没有docker服务,这里就从按照docker开始讲解

一、docker按装

1、Linux内核版本查看

#如果你是kali可直接从第四步开始

#安装docker要求内核版本kerner>=3.10
#为此,先检查当前Linux系统的内核版本

uname -a
  • 1

2、更新apt源满足下载要求

#新重写sources.list中内容,一个个字母删除太久了

cho > /etc/apt/sources.list
  • 1

#进入sources.lis重新编辑apt源

vim /etc/apt/sources.list
  • 1

#直接CV大法写入下面的apt源
#阿里云

deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib 
  • 1
  • 2

3、进行系统或工具的更新

#进行系统或工具的更新(有丢丢就,先上把王者)
#注:当出现正在设定软件包界面时,直接按tab+enter进行确认

apt-get update && apt-get upgrade && apt-get dist-upgrade
  • 1

#礼貌性清除更新缓存

apt-get clean
  • 1

4、采用apt安装Docker

#为什么采用apt安装?因为之后采用apt源安装Docker的其他组件时,新组件与已安装的Docker容器最为匹配。

apt-get install docker docker-compose#或apt-get install docker.io
  • 1
└─# apt-get install docker.io
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  cgroupfs-mount containerd criu libintl-perl libintl-xs-perl libmodule-find-perl libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl needrestart runc tini
Suggested packages:
  containernetworking-plugins docker-doc aufs-tools btrfs-progs debootstrap rinse rootlesskit xfsprogs zfs-fuse | zfsutils-linux
The following NEW packages will be installed:
  cgroupfs-mount containerd criu docker.io libintl-perl libintl-xs-perl libmodule-find-perl libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl needrestart runc tini
0 upgraded, 13 newly installed, 0 to remove and 501 not upgraded.
Need to get 66.7 MB of archives.
After this operation, 269 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://http.kali.org/kali kali-rolling/main amd64 runc amd64 1.1.5+ds1-1+b1 [2,708 kB]
Get:2 http://http.kali.org/kali kali-rolling/main amd64 containerd amd64 1.6.20~ds1-1+b1 [25.9 MB]
Get:3 http://kali.download/kali kali-rolling/main amd64 tini amd64 0.19.0-1 [255 kB]
Get:4 http://http.kali.org/kali kali-rolling/main amd64 docker.io amd64 20.10.24+dfsg1-1+b2 [36.2 MB]
Get:5 http://kali.download/kali kali-rolling/main amd64 cgroupfs-mount all 1.4 [6,276 B]
Get:6 http://kali.download/kali kali-rolling/main amd64 criu amd64 3.17.1-2 [665 kB]
Get:7 http://kali.download/kali kali-rolling/main amd64 libintl-perl all 1.33-1 [720 kB]
Get:8 http://kali.download/kali kali-rolling/main amd64 libintl-xs-perl amd64 1.33-1 [15.6 kB]
Get:9 http://kali.download/kali kali-rolling/main amd64 libmodule-find-perl all 0.16-2 [10.6 kB]
Get:10 http://kali.download/kali kali-rolling/main amd64 libmodule-scandeps-perl all 1.31-2 [41.7 kB]
Get:11 http://http.kali.org/kali kali-rolling/main amd64 libproc-processtable-perl amd64 0.634-1+b2 [43.1 kB]
Get:12 http://kali.download/kali kali-rolling/main amd64 libsort-naturally-perl all 1.03-4 [13.1 kB]
Get:13 http://kali.download/kali kali-rolling/main amd64 needrestart all 3.6-3 [59.3 kB]
Fetched 66.7 MB in 23s (2,840 kB/s)
Selecting previously unselected package runc.
(Reading database ... 408203 files and directories currently installed.)
Preparing to unpack .../00-runc_1.1.5+ds1-1+b1_amd64.deb ...
Unpacking runc (1.1.5+ds1-1+b1) ...
Selecting previously unselected package containerd.
Preparing to unpack .../01-containerd_1.6.20~ds1-1+b1_amd64.deb ...
Unpacking containerd (1.6.20~ds1-1+b1) ...
Selecting previously unselected package tini.
Preparing to unpack .../02-tini_0.19.0-1_amd64.deb ...
Unpacking tini (0.19.0-1) ...
Selecting previously unselected package docker.io.
Preparing to unpack .../03-docker.io_20.10.24+dfsg1-1+b2_amd64.deb ...
Unpacking docker.io (20.10.24+dfsg1-1+b2) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../04-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package criu.
Preparing to unpack .../05-criu_3.17.1-2_amd64.deb ...
Unpacking criu (3.17.1-2) ...
Selecting previously unselected package libintl-perl.
Preparing to unpack .../06-libintl-perl_1.33-1_all.deb ...
Unpacking libintl-perl (1.33-1) ...
Selecting previously unselected package libintl-xs-perl.
Preparing to unpack .../07-libintl-xs-perl_1.33-1_amd64.deb ...
Unpacking libintl-xs-perl (1.33-1) ...
Selecting previously unselected package libmodule-find-perl.
Preparing to unpack .../08-libmodule-find-perl_0.16-2_all.deb ...
Unpacking libmodule-find-perl (0.16-2) ...
Selecting previously unselected package libmodule-scandeps-perl.
Preparing to unpack .../09-libmodule-scandeps-perl_1.31-2_all.deb ...
Unpacking libmodule-scandeps-perl (1.31-2) ...
Selecting previously unselected package libproc-processtable-perl:amd64.
Preparing to unpack .../10-libproc-processtable-perl_0.634-1+b2_amd64.deb ...
Unpacking libproc-processtable-perl:amd64 (0.634-1+b2) ...
Selecting previously unselected package libsort-naturally-perl.
Preparing to unpack .../11-libsort-naturally-perl_1.03-4_all.deb ...
Unpacking libsort-naturally-perl (1.03-4) ...
Selecting previously unselected package needrestart.
Preparing to unpack .../12-needrestart_3.6-3_all.deb ...
Unpacking needrestart (3.6-3) ...
Setting up runc (1.1.5+ds1-1+b1) ...
Setting up libmodule-find-perl (0.16-2) ...
Setting up tini (0.19.0-1) ...
Setting up libproc-processtable-perl:amd64 (0.634-1+b2) ...
Setting up criu (3.17.1-2) ...
Setting up libintl-perl (1.33-1) ...
Setting up cgroupfs-mount (1.4) ...
update-rc.d: We have no instructions for the cgroupfs-mount init script.
update-rc.d: It looks like a non-network service, we enable it.
Setting up containerd (1.6.20~ds1-1+b1) ...
containerd.service is a disabled or a static unit, not starting it.
Setting up libsort-naturally-perl (1.03-4) ...
Setting up libmodule-scandeps-perl (1.31-2) ...
Setting up needrestart (3.6-3) ...
Setting up docker.io (20.10.24+dfsg1-1+b2) ...
Adding group `docker' (GID 142) ...
Done.
update-rc.d: We have no instructions for the docker init script.
update-rc.d: It looks like a non-network service, we enable it.
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Setting up libintl-xs-perl (1.33-1) ...
Processing triggers for libc-bin (2.36-8) ...
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for kali-menu (2023.1.7) ...
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93

5、检验Docker成功安装

#启动docker服务
service docker start
#列出docker现有镜像
docker images

二、upload-labs按装

1、在镜像仓库搜索upload-labs镜像

docker search upload-labs
  • 1
┌──(root㉿kali)-[/home]
└─# docker search upload-labs
NAME                           DESCRIPTION                                     S                                                                                                                              TARS     OFFICIAL   AUTOMATED
c0ny1/upload-labs              upload-labs靶场docker镜像                                                                                                                                                         15
monstertsl/upload-labs         upload-labs靶场镜像,并修复了一些不足!                                                                                                                                                     1
8evan8/upload-labs             修复c0ny1的pass-03,pass-04上传失败                                                                                                                                                   0
fighthawk/upload-labs                                                          0                                                                                                                              
glzjin/upload-labs                                                             0                                                                                                                              
flalucifer/upload-labs                                                         0                                                                                                                              
gfattf1/upload-labs            File upload vulnerability                       0                                                                                                                              
rookle/upload-labs             Based on https://github.com/c0ny1/upload-lab…   0                                                                                                                              
drunkbamboo/upload-labs        upload-labs for test                            0                                                                                                                              
anthem9/upload-labs                                                            0                                                                                                                              
tavenli/upload-labs            靶机 upload-labs                                                                                                                                                                0
tuyiqiang/upload-labs                                                          0                                                                                                                              
tanyiqu/upload-labs                                                            0                                                                                                                              
cuer/upload-labs               upload-labs 文件上传靶场                                                                                                                                                            0
hominsu/upload-labs            upload-labs pre-built docker environments, s…   0                                                                                                                              
dockerpentest/upload-labs-kr   Upload-labs for Korean. Forked from github.c…   0                                                                                                                              
745184472/upload-labs          upload-labs                                     0                                                                                                                              
flalucifer/upload-labs-bases                                                   0                                                                                                                              
1518299439/upload-labs21                                                       0                                                                                                                              
alexanso/upload-labs                                                           0                                                                                                                              
81286980/upload-labs-test                                                      0                                                                                                                              
wxixw/upload-labs                                                              0                                                                                                                              
caketi/upload-labs                                                             0                                                                                                                              
spaceskynet/upload-labs                                                        0                                                                                                                              
howhacker/upload-labs          upload-labs靶场                                                                                                                                                                 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

2、将upload-labs镜像拉取到本地仓库

docker pull cuer/upload-labs
  • 1
┌──(root㉿kali)-[/home]
└─# docker pull cuer/upload-labs
Using default tag: latest
latest: Pulling from cuer/upload-labs
357ea8c3d80b: Pull complete
85537f80f73d: Pull complete
3d821ad560e1: Pull complete
b4ae91aad522: Pull complete
66e1c1a53c95: Pull complete
5d1f306a8912: Pull complete
37733078a51e: Pull complete
c5351b4d6bee: Pull complete
4f946c4dcbe2: Pull complete
0c48c69d4b11: Pull complete
dbc71ed1796a: Pull complete
9c6d026ad711: Pull complete
3fced1e5eb8f: Pull complete
5da193e72f01: Pull complete
20dd3dc6578d: Pull complete
abdcdce38534: Pull complete
d799ab2ed30a: Pull complete
Digest: sha256:f3e6dc9c447064f16336d087768d2ea9c4df7857fde110385133acd8b2b31f83
Status: Downloaded newer image for cuer/upload-labs:latest
docker.io/cuer/upload-labs:latest
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

3、查看本地镜像,如图下载成功

docker images
  • 1
┌──(root㉿kali)-[/home]
└─# docker images
REPOSITORY         TAG       IMAGE ID       CREATED         SIZE
cuer/upload-labs   latest    48886bd0228f   17 months ago   473MB
  • 1
  • 2
  • 3
  • 4

4、运行镜像

docker run -d -p 8081:80 cuer/upload-labs
  • 1
┌──(root㉿kali)-[/home]
└─# docker run -d -p 8081:80 cuer/upload-labs
cd81d812b8da643b865f8509d1a09ded16b4c229918343b48b89e863056d3503
  • 1
  • 2
  • 3

5、浏览器访问查看

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/592612
推荐阅读
相关标签
  

闽ICP备14008679号