# API Testing

Las APIs son el nuevo vector #1.

## 1. Reconocimiento de Endpoints

Si no tienes documentación (Swagger/OpenAPI), búscala.

* Buscar `swagger.json`, `/docs`, `/api-docs`.
* Fuzzing de rutas: `kiterunner` o `ffuf`.

## 2. BOLA (Broken Object Level Authorization)

Es el IDOR de las APIs.

* Si `GET /api/v1/shops/1/financial_info` funciona...
* Prueba `GET /api/v1/shops/2/financial_info`.

## 3. Mass Assignment

Puedes modificar campos que no deberías.

* Al registrarte:

  ```json
  POST /register
  {
    "user": "test",
    "password": "123",
    "is_admin": true  <-- Añadir esto
  }
  ```

## 4. GraphQL Injection

Las inyecciones ocurren en los argumentos de la query.

* **Introspection**: Preguntar al servidor qué queries soporta.

  ```graphql
  { __schema { types { name } } }
  ```
* **Batching**: Enviar 1000 queries en una sola petición (DoS o Brute Force).


---

# Agent Instructions: 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:

```
GET https://jotatito05.gitbook.io/la-bitacora-de-jotatito05/04.-web-attacks-owasp/api-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
