# 【juice-shop】★★ Empty User Registration：注册一个“隐形人”

# 【juice-shop】★★ Empty User Registration：注册一个“隐形人”

如何创建一个“不存在”的用户？当前端的必填项校验很严格时，直接去跟后端的 API 聊聊是个好主意。

-----

## 0x00 前置要求 (Prerequisites)

- [ ] **推荐关卡**：建议先完成 `Repetitive Registration`（非强制，但有助于理解注册逻辑）。
- [ ] **核心武器**：启动 **Burp Suite**。

-----

## 0x01 任务简报

<blockquote style="border-left: 5px solid #6f42c1; background-color: #f5f3ff; padding: 20px; margin: 1.5rem 0; color: #5521b5; line-height: 1.8; border-radius: 0 5px 5px 0;">
<div style="font-weight: bold; font-size: 1.1rem; margin-bottom: 10px; display: flex; align-items: center;">
<span style="margin-right: 8px;">💡</span> 核心线索 (Hints)
</div>

1.  考虑<strong>拦截请求</strong>并修改内容。<br>
    <em>（底层逻辑：前端表单的必填项限制防君子不防黑客，我们需要绕过前端，直接向 API 喂“空数据”。）</em>
    </blockquote>

<blockquote style="border-left: 5px solid #0366d6; background-color: #f1f8ff; padding: 20px; margin: 1.5rem 0; color: #0550ae; line-height: 1.8; border-radius: 0 5px 5px 0;">
<div style="font-weight: bold; font-size: 1.1rem; margin-bottom: 10px; display: flex; align-items: center;">
<span style="margin-right: 8px;">🎓</span> 实战动作 (Action)
</div>
• <strong>抓包</strong>：打开 Burp 进行监听，使用 Burp 浏览器访问网页。<br>
• <strong>注册</strong>：正常填写表单，抓取合法的注册请求包。<br>
• <strong>篡改</strong>：将包发送到重放器 (Repeater)，清空关键字段的值，强行发包。
</blockquote>

-----

## 0x02 实战：复现漏洞

**1. 制造合法请求**
打开用户注册界面，先随便输入一些合法数据进行一次正常注册。
*这里邮箱填了 `2@2.com`，用户名和密码都是 5 个 1（随便写就行）。*

![](../../../../../../public/p/juice-shop-empty-user-registration注册一个隐形人/assets/Pastedimage20260330214907.png)

![](../../../../../../public/p/juice-shop-empty-user-registration注册一个隐形人/assets/Pastedimage20260330215016.png)

**2. 拦截与重放 (Repeater)**
完成注册之后，在 Burp 中找到刚才的注册用户包和对应的 API。
**动作**：将这个请求包直接发送到 **重放器 (Repeater)**。

![](../../../../../../public/p/juice-shop-empty-user-registration注册一个隐形人/assets/Pastedimage20260330215214.png)

**3. 篡改与触发陷阱**
在 Repeater 中定位到提交的 JSON 数据部分：
* 将 `email` 和 `password` 改为 **空字符** `""`。
* 顺手把前端用来多余校验的 `passwordRepeat` 给删了。

点击 `Send` 发送请求。后端 API 没有进行二次校验，直接入库，**成功注册！**

![](../../../../../../public/p/juice-shop-empty-user-registration注册一个隐形人/assets/Pastedimage20260330215417.png)

-----

### 💡 极简总结 (Scan-Friendly)
* **目标**：注册接口 API。
* **手段**：Burp 拦截，字段留空 `""`。
* **漏洞本质**：后端过度信任前端，缺乏**数据完整性校验**。

