由于我是在kali上搭建,默认没有docker服务,这里就从按照docker开始讲解
一、docker按装
1、Linux内核版本查看
#如果你是kali可直接从第四步开始
#安装docker要求内核版本kerner>=3.10
#为此,先检查当前Linux系统的内核版本
uname -a
2、更新apt源满足下载要求
#新重写sources.list中内容,一个个字母删除太久了
cho > /etc/apt/sources.list
#进入sources.lis重新编辑apt源
vim /etc/apt/sources.list
#直接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
3、进行系统或工具的更新
#进行系统或工具的更新(有丢丢就,先上把王者)
#注:当出现正在设定软件包界面时,直接按tab+enter进行确认
apt-get update && apt-get upgrade && apt-get dist-upgrade
#礼貌性清除更新缓存
apt-get clean
4、采用apt安装Docker
#为什么采用apt安装?因为之后采用apt源安装Docker的其他组件时,新组件与已安装的Docker容器最为匹配。
apt-get install docker docker-compose#或apt-get install docker.io
└─# 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) ...
5、检验Docker成功安装
#启动docker服务
service docker start
#列出docker现有镜像
docker images
二、upload-labs按装
1、在镜像仓库搜索upload-labs镜像
docker search upload-labs
┌──(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
2、将upload-labs镜像拉取到本地仓库
docker pull cuer/upload-labs
┌──(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
3、查看本地镜像,如图下载成功
docker images
┌──(root㉿kali)-[/home]
└─# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
cuer/upload-labs latest 48886bd0228f 17 months ago 473MB
4、运行镜像
docker run -d -p 8081:80 cuer/upload-labs
┌──(root㉿kali)-[/home]
└─# docker run -d -p 8081:80 cuer/upload-labs
cd81d812b8da643b865f8509d1a09ded16b4c229918343b48b89e863056d3503