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

# Eludir el control de acceso basado en el método HTTP

### El control de acceso basado en métodos puede ser eludido

En este laboratorio, los controles de acceso se basan en parte en el método HTTP utilizado. Después de conectarse con *administrator:admin* credenciales, el panel de administración puede observarse libremente.

El objetivo es conectarse con *wiener:peter* credenciales y explotar la implementación incorrecta del control para asignar el rol de administrador.

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

Después de conectarnos como administrador, descubrimos la interfaz para aumentar o disminuir los privilegios de un usuario. / Al interceptar la solicitud enviada durante una modificación:

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

Esta acción requiere privilegios administrativos cuando se envía en **POST**.

Sin embargo, al intentar reproducir esta solicitud con la sesión de wiener, la aplicación devuelve un mensaje de acceso denegado.

<figure><img src="/files/13999ccc7bab0a812a0c00cee5e7c0e62dd5630a" alt=""><figcaption></figcaption></figure>

Sin embargo, si se reemplaza el método POST por **GET**, el control falla:

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

Esta solicitud pasa y devuelve un **200 OK**, lo que permite elevar los privilegios de wiener al rango de administrador.

<figure><img src="/files/d92ea0f621f6f7a374b256a43b91318c147cb028" 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/es/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.
