> ## 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 Ninja Skills writeup (zh-TW)
- URL: https://taiwanding.com/tryhackme-ninja-skills-writeup-zh-tw/
- Published: 2025-10-20T07:32:20.000Z
- Updated: 2026-07-15T02:50:02.000Z
- Author: Kevin Chen
- Tags: tryhackme, CTF

## 題目資訊

- **平台**: TryHackMe
- **房間名稱**: Ninja Skills
- **難度**: Easy
- **目標**: 高效查找並分析 12 個指定檔案
- **連結**: [https://tryhackme.com/room/ninjaskills](https://tryhackme.com/room/ninjaskills?ref=taiwanding.com)

## 練習目標

需要找到並分析以下檔案：

- 8V2L, bny0, c4ZX, D8B3, FHl1, oiMO, PFbD, rmfX, SRSq, uqyw, v2Vb, X1Uy

### Step 1: 初始探索

登入系統

```bash
ssh new-user@<TARGET_IP>
# 密碼: new-user

```

檢查當前目錄

```bash
[new-user@ip-10-201-107-70 ~]$ ls -al /home/
total 36
drwxr-xr-x  5 root       root        4096 Oct 23  2019 .
dr-xr-xr-x 25 root       root        4096 Oct 20 07:07 ..
drwx------  3 ec2-user   ec2-user    4096 Oct 23  2019 ec2-user
drwx------  2 newer-user newer-user  4096 Oct 23  2019 newer-user
drwx------  3 new-user   new-user    4096 Oct 23  2019 new-user
-rw-rw-r--  1 new-user   best-group 13545 Oct 23  2019 v2Vb

```

**第一個發現**：`v2Vb` 在 `/home/` 目錄下！

### Step 2: 系統性搜索檔案

順序 1: 按群組搜索

```bash
find / -group best-group 2>/dev/null

```

**結果**：

```
/mnt/D8B3
/home/v2Vb

```

順序 2: 按擁有者搜索

```bash
find / -user new-user 2>/dev/null

```

**結果**：

```
/mnt/D8B3
/mnt/c4ZX
/var/FHl1
/opt/PFbD
/opt/oiMO
/media/rmfX
/etc/8V2L
/etc/ssh/SRSq
/var/log/uqyw
/home/v2Vb

```

順序 3: 按檔名搜索

```bash
find / -name "X1Uy" 2>/dev/null

```

**結果**：

```
/X1Uy

```

### Step 3: 完整檔案清單

| 檔案名  | 位置            | 擁有者        | 群組         |
| ---- | ------------- | ---------- | ---------- |
| 8V2L | /etc/8V2L     | new-user   | new-user   |
| bny0 | ❌ 未找到         | \-         | \-         |
| c4ZX | /mnt/c4ZX     | new-user   | new-user   |
| D8B3 | /mnt/D8B3     | new-user   | best-group |
| FHl1 | /var/FHl1     | new-user   | new-user   |
| oiMO | /opt/oiMO     | new-user   | new-user   |
| PFbD | /opt/PFbD     | new-user   | new-user   |
| rmfX | /media/rmfX   | new-user   | new-user   |
| SRSq | /etc/ssh/SRSq | new-user   | new-user   |
| uqyw | /var/log/uqyw | new-user   | new-user   |
| v2Vb | /home/v2Vb    | new-user   | best-group |
| X1Uy | /X1Uy         | newer-user | new-user   |

### Step 4: 批量分析檔案屬性

一鍵分析腳本

```bash
for file in /etc/8V2L /mnt/c4ZX /mnt/D8B3 /var/FHl1 /opt/oiMO /opt/PFbD /media/rmfX /etc/ssh/SRSq /var/log/uqyw /home/v2Vb /X1Uy; do
    echo "=== $file ==="
    ls -l $file
    wc -l $file 2>/dev/null
    sha1sum $file 2>/dev/null
    file $file
    echo ""
done

```

關鍵發現摘要

```
/etc/8V2L: -rwxrwxr-x (可執行), 209 行, SHA1: 0323e62f...
/mnt/c4ZX: -rw-rw-r--, 209 行, SHA1: 9d54da75... ✓
/opt/oiMO: 包含 IP: 1.1.1.1 ✓
/X1Uy: Owner UID: 502 ✓

```

### Step 5: 回答題目問題

Q1: 哪些檔案屬於 best-group？

```bash
find / -group best-group 2>/dev/null

```

**答案**: `D8B3 v2Vb`

Q2: 哪個檔案包含 IP 地址？

```bash
grep -H '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' /etc/8V2L /mnt/c4ZX /mnt/D8B3 /var/FHl1 /opt/oiMO /opt/PFbD /media/rmfX /etc/ssh/SRSq /var/log/uqyw /home/v2Vb /X1Uy

```

**結果**：

```
/opt/oiMO:wNXbEERat4wE0w/O9Mn1.1.1.1VeiSLv47L4B2Mxy3M0XbCYVf9TSJeg905weaIk

```

**答案**: `oiMO`

Q3: 哪個檔案的 SHA1 hash 為 9d54da7584015647ba052173b84d45e8007eba94？

```bash
sha1sum /etc/8V2L /mnt/c4ZX /mnt/D8B3 /var/FHl1 /opt/oiMO /opt/PFbD /media/rmfX /etc/ssh/SRSq /var/log/uqyw /home/v2Vb /X1Uy 2>/dev/null

```

**答案**: `c4ZX`

![](https://taiwanding.com/content/images/2025/10/image-6.png)

Q4: 哪個檔案包含 230 行？

由於找到的 11 個檔案都是 209 行，通過排除法得知：

**答案**: `bny0`

Q5: 哪個檔案的 owner ID 為 502？

```bash
ls -n /etc/8V2L /mnt/c4ZX /mnt/D8B3 /var/FHl1 /opt/oiMO /opt/PFbD /media/rmfX /etc/ssh/SRSq /var/log/uqyw /home/v2Vb /X1Uy

```

**結果**：

```
-rw-rw-r-- 1 502 501 13545 Oct 23  2019 /X1Uy

```

**答案**: `X1Uy`

![](https://taiwanding.com/content/images/2025/10/image-7.png)

Q6: 哪個檔案所有人都可以執行？

從權限分析：

```
-rwxrwxr-x 1 501 501 13545 Oct 23  2019 /etc/8V2L

```

最後三位 `r-x` 表示 others 擁有執行權限。

**答案**: `8V2L`

## 技術要點總結

### 1\. Find 命令的高效使用

```bash
# 按檔名搜索
find / -name "filename" 2>/dev/null

# 按擁有者搜索
find / -user username 2>/dev/null

# 按群組搜索
find / -group groupname 2>/dev/null

# 組合搜索多個檔案
find / -type f \( -name "file1" -o -name "file2" \) 2>/dev/null

```

### 2\. 批量分析檔案屬性

```bash
# 查看詳細權限和數字 UID/GID
ls -ln filename

# 計算行數
wc -l filename

# 計算 SHA1 雜湊值
sha1sum filename

# 檢查檔案類型
file filename

```

### 3\. 內容搜索技巧

```bash
# 搜索 IP 地址
grep -H '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' files

# 在多個檔案中搜索
grep -r "pattern" /path/

```

### 4\. Linux 權限理解

- `rwxrwxrwx` \= Owner / Group / Others
- 第三組權限（others）有 `x` \= 所有人可執行
- `ls -n` 顯示數字 UID/GID 而非名稱

## 經驗分享

這個靶機作者在打的時候挺可愛的，一直在/files這個路徑等檔案，還以為靶機壞掉了，重開了一次，結果後來就 `cd home`，才發現第一個檔案v2Vb，後來才用上述方法一個一個找出來\~