基本信息
端口扫描
22和80:
1 | nmap -sC -sV -Pn 10.129.226.185 |
80
需要加hosts:
1 | 10.129.226.185 variatype.htb |
字体相关的:
子域名扫描
子域名可以发现一个portal:
1 | ffuf -w ~/Tools/dict/SecLists/Discovery/DNS/subdomains-top1million-5000.txt -u "http://variatype.htb/" -H "Host: FUZZ.variatype.htb" -fs 169 |
portal
添加hosts后访问,需要登录:
目录扫描
目录扫描可以发现portal的git泄漏:
1 | gobuster dir -w ~/Tools/dict/SecLists/Discovery/Web-Content/common.txt -u http://variatype.htb/ |
git dump
常规dump代码:
1 | git-dumper http://portal.variatype.htb/ portal_git |
之后在历史commit里得到一组账号密码:
1 | git log -p |
portal & fonts
得到的账号密码可以登录portal,看起来就是主站那里生成字体会显示在这里:
回到主站发现需要designspace和ttf文件:
另外可以看到说明用到了fonttools库:
1 | Upload your .designspace file and master fonts (.ttf/.otf) to generate a fully compliant variable font. We use the same fonttools engine used by Google Fonts and major foundries. |
fonttools可以搜到存在相关漏洞:
- fontTools is Vulnerable to Arbitrary File Write and XML injection in fontTools.varLib · CVE-2025-66034 · GitHub Advisory Database
https://github.com/advisories/GHSA-768j-98cg-p3fv
但写文件首先需要知道目标路径之类
所以首先先测试字体生成功能:
- RoboFont ● Creating designspace files
https://robofont.com/documentation/tutorials/creating-designspace-files/
生成的designspace文件就是xml格式,ttf也是可以用github repo里代码生成,同时上传designspace和生成的两个ttf文件,上传后portal可以下载:
download LFI
download那里存在过滤,双写即可绕过:
后续就是LFI读文件,得到文件路径:
1 | /etc/nginx/nginx.conf |
CVE-2025-66034 to www-data
得到文件路径后即可利用CVE-2025-66034,打到www-data:
(这里直接用别人的一键脚本)
from:
- HackTheBox Season 10 VariaType 难度:Medium
https://mp.weixin.qq.com/s/xWBctM5MHVeTMLMYF0pahQ
www-data to steve
然后常规翻文件,opt里一个bak文件中得到steve的一个文件:
1 | cat /opt/process_client_submissions.bak |
看起来是定时检查相关目录指定后缀文件,对文件名有校验,然后使用fontforge对文件进行处理
fontforge
检查发现fontforge也存在漏洞:
1 | /usr/local/src/fontforge/build/bin/fontforge -v |
- Fix Splinefont shell invocation by pkvanca · Pull Request #5367 · fontforge/fontforge
https://github.com/fontforge/fontforge/pull/5367
是文件名中的命令注入,按照步骤一步步操作即可:
1 | command base64 |
user flag
steve用户桌面得到user.txt:
提权信息
steve可以sudo运行指定python文件,看内容就是调用setuptools通过url安装package
检查版本发现setuptools存在漏洞:
1 | steve@variatype:~$ pip3 list |
- Path traversal in PackageIndex.download leads to Arbitrary File Write. · Issue #4946 · pypa/setuptools
https://github.com/pypa/setuptools/issues/4946
所以就是通过路径遍历写任意文件,例如ssh authorized_keys
提权 & root flag
写authorized_keys,之后root登录即可:
1 | local |
shadow
1 | root:$y$j9T$U22iZC8ubVYQ.zHw0n1wN.$xTkdl7UZCG8vpE7tECH6aQZeaff07orJSL1G8gzIv9.:20427:0:99999:7::: |
参考资料
- fontTools is Vulnerable to Arbitrary File Write and XML injection in fontTools.varLib · CVE-2025-66034 · GitHub Advisory Database
https://github.com/advisories/GHSA-768j-98cg-p3fv - RoboFont ● Creating designspace files
https://robofont.com/documentation/tutorials/creating-designspace-files/ - HackTheBox Season 10 VariaType 难度:Medium
https://mp.weixin.qq.com/s/xWBctM5MHVeTMLMYF0pahQ - Fix Splinefont shell invocation by pkvanca · Pull Request #5367 · fontforge/fontforge
https://github.com/fontforge/fontforge/pull/5367 - Path traversal in PackageIndex.download leads to Arbitrary File Write. · Issue #4946 · pypa/setuptools
https://github.com/pypa/setuptools/issues/4946