Vulnhub 483 TRE-1

 

考点:mantisbt、开机启动

靶机链接:https://www.vulnhub.com/entry/tre-1,483/

环境配置

名称 IP
Kali Linux 10.0.2.15
Tre 10.0.2.18

初步打点

端口扫描

$ export rip=10.0.2.18
$ sudo nmap -v -A -p- $rip
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 99:1a:ea:d7:d7:b3:48:80:9f:88:82:2a:14:eb:5f:0e (RSA)
|   256 f4:f6:9c:db:cf:d4:df:6a:91:0a:81:05:de:fa:8d:f8 (ECDSA)
|_  256 ed:b9:a9:d7:2d:00:f8:1b:d3:99:d6:02:e5:ad:17:9f (ED25519)
80/tcp   open  http    Apache httpd 2.4.38 ((Debian))
|_http-title: Tre
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.38 (Debian)
8082/tcp open  http    nginx 1.14.2
|_http-title: Tre
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-server-header: nginx/1.14.2

WEB测试

gobuster

gobuster dir --url http://10.0.2.18 -w /usr/share/wordlists/dirb/big.txt -x .php

80端口测试,nikto发现存在system目录,使用admin admin登录,系统是MantisBT 1

发现存在二级目录mantisbt

2

获得权限

思路一

搜索mantisbt存在漏洞

Mantis Bug Tracker 2.3.0 - Remote Code Execution (Unauthenticated)

修改exp

3

直接写入shell

4

思路二

发现a.txt

5

读取到敏感信息

6

通过adminer.php读取到疑似密码的字符串

7

登录ssh成功

8

提权

思路一

使用CVE-2021-3156提权

$ whereis python
$ python3.7 exploit_nss.py 

思路二

使用tre登录后,查看可随时关机或重启9

发现开机启动的文件可写,写入反弹shell后重启

10