HackTheBox — Explore Writeup

This box is a mobile system.

First , We use nmap to detect IP of victim’s machine.

nmap -p- 10.129.228.87

-p- means user all 65565 ports

大概能看到

PORT STATE SERVICE VERSION
2222/tcp open ssh (protocol 2.0)
5555/tcp filtered freeciv
40947/tcp open unknown
42135/tcp open http ES File Explorer Name Response httpd
59777/tcp open http Bukkit JSONAPI httpd for Minecraft game server 3.6.0 or older 2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :

這個真的掃很久….

查了一下ES文件有發現 https://www.cvedetails.com/cve/CVE-2019-6447

ES File Explorer File Manager 應用程序通過 4.1.9.7.4 for Android 允許遠程攻擊者通過本地 Wi-Fi 網絡上的 TCP 端口 59777 請求讀取任意文件或執行應用程序。在 ES 應用程序啟動一次後,此 TCP 端口保持打開狀態,並通過 HTTP 響應未經身份驗證的應用程序/json 數據。

這樣就能去找寫好的payload

來源 https://www.exploit-db.com/exploits/50070

我想說怎麼一直連不上….

結果機器時間到被關了…

只好重開拉

這邊找到幾個圖片位置,每個都看看。

在這邊發現疑似帳號密碼

kristi:Kr1sT!5h@Rp3xPl0r3!

found user.txt

之後要提權,因為不知道Android系統該怎麼處理,查了一下其他Writeup做法,

大概是用adb 跟ssh建立反向tunnel 。

ssh kristi@10.129.229.7 -p 2222 -L 5555:localhost:5555

(前面我重開機器後ip變10.129.229.7)

kali沒有adb

需要另外裝

sudo apt-get install adb

但我發現adb devices 一直缺少localhost

換了port連上 結果還是error

結果是連線被拒 “channel 3: open failed: connect failed: Connection refused”

https://stackoverflow.com/questions/18705453/ssh-l-connection-successful-but-localhost-port-forwarding-not-working-channel

摸了一陣子才想到前面nmap掃5555 …. port還是不能亂改。

成功連上

大概翻了一下還需要sudo su 才能看 /data 位置

找到 root.txt

最後

成功完成這一關

ADB 在前公司待的時候有拿來玩自動化測試,

但我對Android系統不熟悉…. 其他評論都說是很簡單的靶機,

我卻卡了半天,附上破關證明。

本文同步發自 https://sectools.tw/hackthebox-explore-writeup/

--

--

NTUT CSIE | Biomedical Informatics Lab | github.com/stwater20 | sectools.tw

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store