└─# nmap -sS -sV -A -Pn 10.10.11.221 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-17 21:25 CST Nmap scan report for 10.10.11.221 Host is up (0.35s latency). Not shown: 998 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 3e:ea:45:4b:c5:d1:6d:6f:e2:d4:d1:3b:0a:3d:a9:4f (ECDSA) |_ 256 64:cc:75:de:4a:e6:a5:b4:73:eb:3f:1b:cf:b4:e3:94 (ED25519) 80/tcp open http nginx |_http-title: Did not follow redirect to http://2million.htb/ No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ). TCP/IP fingerprint: OS:SCAN(V=7.94SVN%E=4%D=3/17%OT=22%CT=1%CU=38870%PV=Y%DS=3%DC=T%G=Y%TM=67D8 OS:22FA%P=x86_64-pc-linux-gnu)SEQ(SP=107%GCD=1%ISR=10D%TI=Z%CI=Z%TS=A)SEQ(S OS:P=107%GCD=1%ISR=10D%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=107%GCD=2%ISR=10D%TI=Z%CI OS:=Z%II=I%TS=A)OPS(O1=M53AST11NW7%O2=M53AST11NW7%O3=M53ANNT11NW7%O4=M53AST OS:11NW7%O5=M53AST11NW7%O6=M53AST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5= OS:FE88%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M53ANNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T OS:=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R OS:%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T= OS:40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0 OS:%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=7F7%RUD=G)IE OS:(R=Y%DFI=N%T=40%CD=S)
Network Distance: 3 hops Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 8080/tcp) HOP RTT ADDRESS 1 0.28 ms 172.30.144.1 2 442.86 ms 10.10.16.1 3 442.97 ms 10.10.11.221
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 59.39 seconds
1 2
How many TCP ports areopen? :2
Task 2
f12 查看源码,找到了 inviteapi.min.js
1 2
What is the name ofthe JavaScript file loaded bythe /invite page that has todowith invite codes? :inviteapi.min.js
What JavaScript function onthe invite page returns thefirst hint about how toget an invite code? Don't include () inthe answer. :makeInviteCode
Task 4
POST 请求
1 2
└─# curl -X POST http://2million.htb/api/v1/invite/generate {"0":200,"success":1,"data":{"code":"NTZRSlMtNDJLSjYtSTZXSTYtR1U5Mkc=","format":"encoded"}}
然后 base 64 解码
1
56QJS-42KJ6-I6WI6-GU92G
1 2
The endpoint in makeInviteCode returnsencrypted data. That message provides another endpoint to query. That endpoint returns a code value that is encoded with what very common binary totextencodingformat. What is the nameof that encoding? :base64
Task 5
注册登录账号然后进去到 ACCESS 抓包
路径 /api/v1/user/vpn/generate
1 2
What is the path to the endpoint the page uses when a user clicks on "Connection Pack"? :/api/v1/user/vpn/generate
Task 6
访问接口 /api/v1 返回了很多其他接口
访问 /api/v1/admin/settings/update 接口返回了错误信息,加上 Content-type:application/json,用 PUT 方式请求
What fileis commonly used in PHP applications to store environment variable values? :env
Submit User Flag
ssh 直接登录拿到 userflag
1 2
Submit the flag located in the admin user's home directory. :efdaf723f682ab1f854c2c76e7909794
Task 11
登录提示有 email
查找有 email 的信息
1
find / -name "mail" 2>/dev/null
1 2
What is the email address ofthe sender ofthe email sent to admin? :ch4p@2million.htb
Task 12
查看 admin 内容
1 2 3 4 5 6 7 8 9 10 11 12 13
From: ch4p <ch4p@2million.htb> To: admin <admin@2million.htb> Cc: g0blin <g0blin@2million.htb> Subject: Urgent: Patch System OS Date: Tue, 1 June 2023 10:45:22 -0700 Message-ID: <9876543210@2million.htb> X-Mailer: ThunderMail Pro 5.2
Hey admin,
I'm know you're working as fast as you can to do the DB migration. While we're partially down, can you also upgrade the OS on our web host? There have been a few serious Linux kernel CVEs already this year. That one in OverlayFS / FUSE looks nasty. We can't get popped by that.
HTB Godfather
可以看到其中有一个 OverlayFS 搜 CVE,关于 Linux kernel CVE ,Linux 内核
1 2
What is the2023 CVE ID fora vulnerability in that allows an attacker to move filesinthe Overlay filesystemwhile maintaining metadata like the owner and SetUID bits? :CVE-2023-0386
Submit Root Flag
开两个终端,把 CVE 传到靶机上,编译之后(编译会报错,但是不影响)在第一个终端输入
1
./fuse ./ovlcap/lower ./gc
第二个终端输入
1
./exp
拿到 root 权限
1 2
Submit the flag located in root's home directory. :3a62869985c7bf6157abcb2661ce6983