> 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/access-control/bypassing-access-control-based-on-http-method.md).

# Umgehung der Zugriffskontrolle basierend auf der HTTP-Methode

### Methodenbasierte Zugriffskontrolle kann umgangen werden

In diesem Lab basieren die Zugriffskontrollen teilweise auf der verwendeten HTTP-Methode. Nach dem Verbinden mit *administrator:admin* den Anmeldedaten kann das Administrationspanel frei eingesehen werden.

Das Ziel ist, sich mit *wiener:peter* Anmeldedaten zu verbinden und die fehlerhafte Implementierung der Kontrolle auszunutzen, um die Rolle des Administrators zuzuweisen.

<figure><img src="/files/97a0db5a3f40b9df95413342745509f0f13068ca" alt=""><figcaption></figcaption></figure>

Nach der Anmeldung als Administrator entdecken wir die Schnittstelle, um die Privilegien eines Benutzers zu erhöhen oder zu verringern. / Durch das Abfangen der bei einer Änderung gesendeten Anfrage:

```http
POST /admin-roles
username=carlos&action=upgrade
```

Diese Aktion erfordert administrative Rechte, wenn sie in **POST**.

Wenn man jedoch versucht, diese Anfrage mit der wiener-Sitzung zu reproduzieren, gibt die Anwendung eine Zugriffsverweigerungsmeldung zurück.

<figure><img src="/files/86c96d9cc6f805e93848c10c7fb09646614e6332" alt=""><figcaption></figcaption></figure>

Wenn jedoch die POST-Methode durch **GET**ersetzt wird, versagt die Kontrolle:

```http
GET /admin-roles?username=wiener&action=upgrade
```

Diese Anfrage wird akzeptiert und gibt eine **200 OK**zurück, wodurch es möglich wird, die Privilegien von wiener auf den Rang eines Administrators zu erhöhen.

<figure><img src="/files/82523502d4ade4a33e7d49e1560781c23913044a" 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/access-control/bypassing-access-control-based-on-http-method.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.
