靶机的IP地址为10.10.11.233,攻击机的IP地址为10.10.16.30
# nmap -sT --min-rate 10000 -p- 10.10.11.233 -oN port.nmap
Starting Nmap 7.94 ( https://nmap.org ) at 2024-02-19 14:50 CST
Warning: 10.10.11.233 giving up on port because retransmission cap hit (10).
Nmap scan report for 10.10.11.233 (10.10.11.233)
Host is up (0.23s latency).
Not shown: 37448 closed tcp ports (conn-refused), 28085 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 102.12 seconds
仅开放了两个端口,分别是22端口ssh和80端口http服务!
# nmap -sT -sC -sV -O -p22,80 10.10.11.233 -oN details.nmap
Starting Nmap 7.94 ( https://nmap.org ) at 2024-02-19 14:52 CST
Nmap scan report for 10.10.11.233 (10.10.11.233)
Host is up (0.27s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 3e:ea:45:4b:c5:d1:6d:6f:e2:d4:d1:3b:0a:3d:a9:4f (ECDSA)
|_ 256 64:cc:75:de:4a:e6:a5:b4:73:eb:3f:1b:cf:b4:e3:94 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to http://analytical.htb/
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Linux 4.15 - 5.8 (96%), Linux 5.3 - 5.4 (95%), Linux 2.6.32 (95%), Linux 5.0 - 5.5 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%), Linux 5.0 (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 24.48 seconds
80端口上是nginx 1.18.0版本起的http服务!操作系统应该是ubuntu系统,看到了web-title是无法重定向,所以修改了一下/etc/hosts文件!最终修改之后,再次进行扫描,发现title变了!
# nmap -sT --script=vuln -p22,80 10.10.11.233 -oN vuls.nmap
Starting Nmap 7.94 ( https://nmap.org ) at 2024-02-19 14:52 CST
Nmap scan report for 10.10.11.233 (10.10.11.233)
Host is up (0.22s latency).
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
|_http-csrf: Couldn't find any CSRF vulnerabilities.
|_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
|_http-dombased-xss: Couldn't find any DOM based XSS.
Nmap done: 1 IP address (1 host up) scanned in 352.75 seconds
默认漏洞脚本可以不用看了,一点价值都没有。
发现右上角存在多个功能点,同时下方存在多个工程师:
这里需要留意,这些工程师的名字可能在后续会用到!
Jonnhy Smith
Alex Kirigo
Daniel Walker
同时点击登录的时候,发现了域名的变化,变为data.analytical.htb,所以重新修改了一下/etc/hosts文件。成功访问到了login界面!
之前在首页下面看到了两个邮箱的信息,尝试登录:
[email protected]
[email protected]
尝试几个弱口令信息,均无果!紧接着利用searchsploit搜索了metabase,也没什么结果!
后续百度查询到Metabase存在漏洞开始尝试:
回显中存在setup-token!利用token尝试后续的利用!github找到一个利用脚本:
执行的命令是反弹shell!本地起监听等待shell的反弹!
拿到初始的立足点!
仅存在唯一的活跃用户metabase!查看当前具有的sudo权限:
没有sudo权限,同时家目录下面也没什么可以利用的东西!
查看了一下/etc/passwd文件,没什么其他的信息;感觉有点不太对的样子!
IP地址不对!查看到环境变量的时候,发现了里面有个密码信息!
而我们当前的用户是metabase!利用ssh连接,怀疑现在的环境是在docker里面!
确实连接上来,再看看当前的用户和IP地址信息!
果然是docker!现在我们已经出来了
还是没有sudo权限!
当前用户的家目录下面找到了flag和一个脚本!交上flag之后,查看exploit脚本内容:
发现了这是提权的脚本,相关漏洞编号为CVE-2023-2640 CVE-2023-3262 执行脚本之后便提权成功了!
最终读取到flag文件!