> 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/de/web/race-conditions/race-conditions-that-bypass-limits.md).

# Race Conditions, die Limits umgehen

### Race Conditions bei Limitüberschreitung

Der Kauf-Stream enthält eine **Race Condition** die es Ihnen ermöglicht, einen **unerwarteten Preis** zum Zeitpunkt der Zahlung.

#### Ziel

Kaufen Sie erfolgreich die **Leichte L33t-Lederjacke**.

#### Daten / Voraussetzungen

* Anmeldedaten: `wiener:peter`
* Rabattcode (20 %): `PROMO20`
* Verfügbares Guthaben: **$50**

<figure><img src="/files/ffd220bf8b0bdb82be060c8bd5ad43c0c8322da5" alt=""><figcaption></figcaption></figure>

* Kosten der Jacke: **$1300**

<figure><img src="/files/1f2c54f66fa964b0108d24e4953bbb76748bcd12" alt=""><figcaption></figcaption></figure>

### Verhaltensbeobachtung

1. Fügen Sie die Jacke dem Warenkorb hinzu.
2. Wenden Sie den `PROMO20` Gutschein an.
3. Wenn Sie versuchen, den Gutschein ein zweites Mal anzuwenden, antwortet die Anwendung: **Gutschein bereits angewendet**.

<figure><img src="/files/256171cfa0d4ac1857b6fd6ca2fa7aec7d6ee7a3" alt="" width="563"><figcaption></figcaption></figure>

Die Anfrage zum Anwenden des Gutscheins sieht so aus (formular-URL-kodiert):

```bash
csrf=7QYFGBaACc8P5YOfUHR4S85oo95uA0Vb&coupon=PROMO20
```

### Manuelle Ausnutzung (Burp Repeater)

1. Senden Sie die Anfrage zum Anwenden an **Repeater**.
2. Erstellen Sie eine **Gruppe** in Repeater.

<figure><img src="/files/6d3c39a1f9afd3a2341f23ab51b8ad82bbfb1907" alt="" width="563"><figcaption></figcaption></figure>

* Duplizieren Sie den Anfrage-Tab /\~20 Mal (**Tab duplizieren**).

<figure><img src="/files/bb85fd5b3f69621294026b361692016533c6d6e5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/aa05bb665c5b8f5793a2f941fdb3a65f207a275e" alt=""><figcaption></figcaption></figure>

Anfragen senden **parallel**.

<figure><img src="/files/77098f599b7c59b679b0564be2c6d13997651325" alt=""><figcaption></figcaption></figure>

Das Ergebnis ist, dass die meisten Anfragen **validiert**, und der Gesamtbetrag wird **/\~37**, was Ihnen den Kauf trotz des ursprünglichen Preises (1300 $) und des begrenzten Guthabens ermöglicht.

<figure><img src="/files/bbedacc62462ef24a8a2212d58036882be751dae" alt=""><figcaption></figcaption></figure>

### Automatisierte Ausnutzung (Burp Suite Pro Custom Action)

Das Lab empfiehlt die Verwendung von **Race Conditions auslösen** (Burp Suite Professional) über eine **benutzerdefinierte Aktion**.

#### 1) Skript hinzufügen (Bambda Library)

Gehen Sie zu **Erweiterungen → Bambda library** und fügen Sie hinzu:

* **id**: `eb57d5bd-33e2-4a8c-bf51-bc81bd26613a`
* **Name**: `Race Condition prüfen`
* **Funktion**: `CUSTOM_ACTION`
* **Ort**: `REPEATER`

```javascript
id: eb57d5bd-33e2-4a8c-bf51-bc81bd26613a
name: Race Condition prüfen
function: CUSTOM_ACTION
location: REPEATER
source: |+
  /**
  * Wiederholt die Anfrage 10 Mal, um Race Conditions oder Request Smuggling auszulösen, wobei der Single-Packet-Angriff für HTTP/2 und die Last-Byte-Synchronisation für HTTP/1 verwendet wird
  *
  * @author James Kettle
  **/
  int NUMBER_OF_REQUESTS = 10;
  var reqs = new ArrayList<HttpRequest>();
  for (int i = 0; i < NUMBER_OF_REQUESTS; i++) {
      reqs.add(requestResponse.request());
  }

  var responses = api().http().sendRequests(reqs);
  var codes = responses.stream().map(HttpRequestResponse::response).map(HttpResponse::statusCode).toList();
  logging().logToOutput(codes);
```

<figure><img src="/files/c39a5a4733d42cf0daf63e4c21756187355a3774" alt=""><figcaption></figcaption></figure>

#### 2) Starten aus Repeater

1. In Repeater: **benutzerdefinierte Aktion** → aus den Beispielen hinzufügen.

<figure><img src="/files/79ac8ae81e2bad109589d7a60f112ac601b3a983" alt="" width="548"><figcaption></figcaption></figure>

* Benutzerdefinierte Aktion geladen.

<figure><img src="/files/39171d4f9f89614e424ebb764cebf54fc5d7814a" alt=""><figcaption></figcaption></figure>

Teste mit **30 Anfragen**.

sehen wir **Statuscodes** (für 30 Sendungen) und wir können die Race Condition leichter auslösen

<figure><img src="/files/5f3844156123fefde9330860859e7b840575744c" alt=""><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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/web/race-conditions/race-conditions-that-bypass-limits.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
