HackTheBox - Medium - Linux - Noter

Noter

Noter 是一种中型 Linux 机器,其特点是利用了 Python Flask 应用程序,该应用程序使用易受远程代码执行影响的“节点”模块。由于“MySQL”守护进程以用户“root”身份运行,因此可以通过利用“MySQL”的用户定义函数来利用它来获得RCE并将我们的权限升级到“root”。


外部信息收集

端口扫描

循例nmap

HackTheBox - Medium - Linux - Noter_第1张图片

Web枚举

HackTheBox - Medium - Linux - Noter_第2张图片

注册个账号直接登进去

逛一圈没有常见的漏洞点

HackTheBox - Medium - Linux - Noter_第3张图片

base64解码

HackTheBox - Medium - Linux - Noter_第4张图片

flask-unsgin直接爆破

HackTheBox - Medium - Linux - Noter_第5张图片

生成用户

for name in `cat /usr/share/wordlists/SecLists/Usernames/Names/names.txt`;do flask-unsign --sign --cookie "{'logged_in': True, 'username': '$name'}" --secret 'secret123' | grep -iE 'ey.*' -o >> ./res.txt;done

ffuf

HackTheBox - Medium - Linux - Noter_第6张图片

有料

HackTheBox - Medium - Linux - Noter_第7张图片

note 1

HackTheBox - Medium - Linux - Noter_第8张图片

使用这组凭据我们可以登录ftp

HackTheBox - Medium - Linux - Noter_第9张图片

有个pdf直接下下来

file

前面还有个ftp_admin

ftp_admin:ftp_admin@Noter!

HackTheBox - Medium - Linux - Noter_第10张图片

在其中一个zip的app.py发现一组mysql凭据

HackTheBox - Medium - Linux - Noter_第11张图片

md-to-pdf

HackTheBox - Medium - Linux - Noter_第12张图片

packafe-lock.json中找到版本号

HackTheBox - Medium - Linux - Noter_第13张图片

HackTheBox - Medium - Linux - Noter_第14张图片

poc:

https://github.com/simonhaenisch/md-to-pdf/issues/99

可以RCE

file

常规reverse shell

file

HackTheBox - Medium - Linux - Noter_第15张图片

本地权限提升

前面给了mysql的凭据,而且mysql还是root运行的

udf,传过去编译

HackTheBox - Medium - Linux - Noter_第16张图片

plugin_dir

HackTheBox - Medium - Linux - Noter_第17张图片

照着exp加载udf就ok

HackTheBox - Medium - Linux - Noter_第18张图片

suid bash

HackTheBox - Medium - Linux - Noter_第19张图片

它来了

HackTheBox - Medium - Linux - Noter_第20张图片

你可能感兴趣的:(HackTheBox,HackTheBox,Linux渗透测试,网络安全,配置错误)