> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/web/business-logic/flawed-business-rules.md).

# 应用不当的业务规则

应用不当的业务规则，PortSwigger Web Security Academy 实验笔记，包括利用流程、载荷测试、Burp Suite 验证以及修复上下文。

### 业务规则执行缺陷

本实验包含购买流程中的一个逻辑缺陷。/ 目标是利用这个弱点来购买一件 \*\*

提供的标识符：

* **用户**: `wiener`
* **密码**: `peters`

**优惠券系统分析**

登录后，网站会自动提供一张欢迎优惠券：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-560d8f4ff67fbba282e6f2c8b95de3db15f46628%2Fimage%20(230).png?alt=media" alt=""><figcaption></figcaption></figure>

**NEWCUST5** → 减免 5 欧元

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f4d8208cdf1cee3953dbfc6c31da52ef2b3e679f%2Fimage%20(231).png?alt=media" alt=""><figcaption></figcaption></figure>

然后，通过订阅新闻通讯，会获得第二张优惠券：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bf7299d85783ab77fb6912b118e7769b47e31ea2%2Fimage%20(232).png?alt=media" alt=""><figcaption></figcaption></figure>

* **SIGNUP30** → 减免 30 欧元

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6b1a502eeadc109e63117e4e4044b3b7c368f27f%2Fimage%20(233).png?alt=media" alt=""><figcaption></figcaption></figure>

每张优惠券都可单独使用，且单独使用时都能正常工作。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3ec29fa020490c21ca627a6ddab19443942ecdcb%2Fimage%20(234).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**业务逻辑问题**

系统对优惠券的使用验证不足：

* 验证控制只检查\*\*最后使用的优惠券\*\*
* 没有整体验证\*\*来防止重复使用或串联使用同一优惠券

**故障运作方式**

通过交替使用这两张优惠券，可以绕过预期逻辑：

```bash
NEWCUST5
SIGNUP30
NEWCUST5
SIGNUP30
NEWCUST5
SIGNUP30
```

由于审计只比较前一张优惠券，因此每一张新优惠券都会被接受。

**结果**

通过重复这个序列，夹克的总价会逐步降至：

* **总计：0 欧元**

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-40a2f4141be00a536b2d377abade80e75a48d0e0%2Fimage%20(236).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/zh/web/business-logic/flawed-business-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
