# vAPI walkthrough

## Introduction
This is a full walkthrough of the Vulnerable Adversely Programmed Interface (vAPI), a deliberately vulnerable web application that you can install locally to practice your API hacking skills. vAPI follows the [OWASP API Security Top 10 2019](https://owasp.org/www-project-api-security/) list of vulnerabilities and gives you one task for each of the 10 listed categories.
## Installing vAPI
To host your vAPI instance, you need a Docker installed host system like Linux or Windows. Remember deliberately vulnerable practice apps should not be installed on an Internet facing (which has a public IP) server, VPS or VM.

In this case, I am using my Windows machine as a host system. Don't worry, for complete the vapi's all challenges windows in enough. I also guide you through the setup in both Windows and Linux.

#### 1. Installing Docker
Install Docker using the official documentation for your operating system:
- For Windows (see instructions [here](https://docs.docker.com/desktop/setup/install/windows-install/)). 
- For Debian Linux (Ex. Kali Linux) (see instructions [here](https://docs.docker.com/engine/install/debian/)), 
- For Ubuntu (see instructions [here](https://docs.docker.com/engine/install/ubuntu/))
#### 2. Setting Up vAPI on Linux
1. **Verify the Docker installation** by checking the version:
```bash
docker --version
```
2. Clone the repository and start vAPI:
```bash
mkdir ~/labs && cd ~/labs
git clone https://github.com/roottusk/vapi.git
cd vapi
sudo docker compose up -d
```
3. **Verify that the containers are running** (from inside `~/labs/vapi`):
```bash
sudo docker compose ps -a
```
4. **Access vAPI:**
- **Local browser:** `http://127.0.0.1:8000/vapi`    
- **From another VM or device on the same network:** `http://<YOUR_LINUX_IP>:8000/vapi` (for example, `http://192.168.1.26:8000/vapi` -- check your machine's IP using `ip a` or `hostname -I`).

5. **Stopping vAPI**

- **Option A:** Pause/Stop containers (Preserves your database and lab progress)
```bash
cd ~/labs/vapi
sudo docker compose stop
```

> _Verification:_ Run `docker compose ps -a` (with `sudo` on Linux). The container status will change from `Up` to `Exited`.

- **Option B**: Stop and remove containers & networks (Resets the lab environment)
```bash
cd ~/labs/vapi
sudo docker compose down
```

> _Note_: Adding `-v` (`docker compose down -v`) will also wipe the database volume completely if you want a clean slate.

6. **Starting vAPI on a Freshly Booted Computer**

By default, vAPI containers do not auto-start when your computer reboots. Follow these steps after turning on your machine:

1. **Ensure the Docker service is running** (in case it is not enabled at boot):

```bash
sudo systemctl start docker
```
2. Navigate to the vAPI directory and start the containers:
```bash
cd ~/labs/vapi
sudo docker compose up -d
```

> If you previously used `docker compose stop`, you can also use `sudo docker compose start`.

3. Verify that the containers are up:
```bash
sudo docker compose ps -a
```
#### 3. Setting Up vAPI on Windows

1. **Verify the Docker installation** in PowerShell or Command Prompt:

```powershell
docker --version   
```

2. **Clone the repository and start vAPI:**

First download Git (if not already installed). from [here](https://git-scm.com/install/windows)

Then navigate to your Docker projects directory (for example, `D:\Docker` or your user folder):

```powershell
mkdir -Force D:\Docker
cd D:\Docker
git clone https://github.com/roottusk/vapi.git
cd vapi
docker compose up -d
```

3. **Verify that the containers are running** (from inside `D:\Docker\vapi`):
```
docker compose ps -a
```
> _Alternatively_, open **Docker Desktop** and select the **Containers** tab on the left sidebar.

4. **Access vAPI:**    
    - **Local browser:** `http://127.0.0.1:8000/vapi`
    - **From another VM or device on the same network:** `http://<YOUR_WINDOWS_IP>:8000/vapi` (for example, `http://192.168.1.26:8000/vapi` — find your IPv4 address by running `ipconfig` in PowerShell/CMD, and ensure Windows Firewall permits inbound connections on port `8000`).

5. **Stopping vAPI**

- **Option A**: Pause/Stop containers (Preserves your database and lab progress)
```powershell
cd D:\Docker\vapi
docker compose stop
```
> _Alternatively_, you can also open **Docker Desktop**, go to the **Containers** tab, find the `vapi` stack, and click the **Stop** button.

- **Option B**: Stop and remove containers & networks (Resets the lab environment)
```powershell
cd D:\Docker\vapi
docker compose down
```
> _Note_: Adding `-v` (`docker compose down -v`) will also wipe the database volume completely if you want a clean slate.

6. **Starting vAPI on a Freshly Booted Computer**
1. **Launch Docker Desktop** from the Start Menu and wait until the bottom-left status indicator turns green (**Engine running**).
2. **Open PowerShell or Command Prompt**, navigate to your `vapi` folder, and start the stack:

```powershell
cd D:\Docker\vapi
docker compose up -d
```
> _Alternatively_, in **Docker Desktop --> Containers**, click the **Play (Start)** button next to the `vapi` stack.

3. Verify that the containers are up:
```powershell
docker compose ps -a
```

> Open **Docker Desktop** and select the **Containers** tab on the left sidebar.  Expand the **`vapi`** group to see all three running containers (`www`, `db`, and `phpmyadmin`) with green status icons. _Verification:_ All three containers show **Running** under the Status column.

## Setting up Postman

Download and install the Postman App from [here](https://www.postman.com/downloads/)

Now start Postman and import the two files which is located:
- In Linux `~/labs/vapi/postman`
- In Windows `D:\Docker\vapi\postman`  
`vAPI.postman_collection.json` is a collection of requests you will use for the different tasks.  
`vAPI_ENV.postman_environment.json` is an environment where you can store your variables.

In Postman, click on **Environments** in the list on the left of the interface and select `vAPI_ENV`.

Now let’s adjust the `host` variable in Postman, to match the IP address of the vapi instance (`localhost:8000`).
## API1 - Broken Object Level Authorization

**Hint** - You can register yourself as a User , Thats it ....or is there something more?

Looking at the Postman collection for API1, we see we have three requests: **Create User**, **Get User** and **Update User**.

![Pasted image 20261008122748](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/c99e719e-c079-43db-8e0f-e22932ea94b3.png align="center")

Let’s first create a new user with the **Create User** request.

![Pasted image 20261008123106](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/51c0c18d-5f5a-4133-8139-14fb995f450c.png align="center")

Now let’s send the **Get User** request. This returns some data on the user we just created. the {{api1_id}} is automatically set to 9 and the {{api1_auth}} is set to `base64(username:password)` in this format.

![Pasted image 20261008123416](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/8ae38649-9f59-4c31-8630-233ac1e5a6f9.png align="center")

We can see that the request is sent to the following endpoint: `/vapi/api1/user/9`

Let’s see what happens if we change this to a different ID value in the URL. Like`/vapi/api1/user/5`, and keep the previous Authorization-Token of ID 9.

![Pasted image 20261008123940](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/969ff7ea-ad29-40ba-9776-7e01043f20fa.png align="center")

Here, we are getting the data of a different user. This is a classic example of a BOLA vuln.\
Now let’s see what happens if we try with an ID value of 1, as we may speculate that the first user to be created may well be the admin user.

![Pasted image 20261008124107](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/910ed1f6-9459-4a9b-b59a-585ce77e16db.png align="center")

Here, we are getting the data of yet another user, along with the flag for this task: **flag{api1_d0cd9be2324cc237235b}**

Not just that, let's now send the **Update User** request for the ID 1 with an updated password like this:

![Pasted image 20261008125247](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/3a47f891-df6e-431c-b716-a23767f98a60.png align="center")

And it updated the password. I can change anything of this user.

## API2 - Broken Authentication

**Hint** - We don't seem to have credentials for this, How do we login? (There's something in the Resources Folder given to you )

For this task, we need to go back to our attacker system and get the file you will find at the following location:\
`~/labs/vapi/Resources/API2_CredentialStuffing/creds.csv`

OK, now in Postman look at the **User Login** query in the **API2** section of the collection. This looks like a standard login query, but we don’t have any credentials we can use.

![Pasted image 20261008134417](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/a9d422ba-16c2-4843-9101-980b6b253db4.png align="center")

Never mind, just type in some random text in both the e-mail and password fields and send a request.

In Postman go to app settings, go to Proxy and turn on the "Use custom proxy configuration". Set the proxy server to `http://127.0.0.1:8080`

Make sure you proxy it into Burp Suite then send it to Intruder.

We see we already have payload positions set for both email and password values. Select a **Pitchfork** attack type then go to the **Payloads** tab.

Load the content of the `creds.csv` file into the payload list for both payload sets.

Uncheck the **URL-encode these characters** box for both positions, then start the attack.

![Pasted image 20261008172543](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/3cbdfab6-37bc-45b5-8ac0-56d2f2b93a3e.png align="center")

Give it a couple of hours (as a reminder, the Intruder module in Burp Suite Community Edition is throttled so it will run pretty slowly on brute force attempt) then sort results by status. Don’t forget to scroll back to the top of the list to get the 200 status results.

![2026-10-06_14-21](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/42f8356c-217e-4dc7-a13d-93d335371566.png align="center")

We see we have three matches.

Now go back to Postman and, still in the API2 section of the collection, try a **User Login** with any valid cred we got before in **Intruder**

![Pasted image 20261008134019](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/c6c2607d-a5b7-4a51-a84a-85eaa471ec4f.png align="center")

In the Response returns a token, it automatically set in {{api2_auth}} variable. Now send the **Get Details** query. You will see it returns details for all registered users of the app.

![Pasted image 20261008134230](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/fc8d2a60-e8d8-48c9-88ad-ae346cadbb93.png align="center")

You will find the flag in the details of the second user:\
**flag{api2_6bf2beda61e2a1ab2d0a}**

The takeaway here is that the app's lack of rate limiting permits credential stuffing, resulting in a Broken User Authentication vulnerability.

## API3 – Excessive data exposure

For this task, you need to go back to your attacker system and get the files you will find at the following locations:  
##### In Linux
`~/labs/vapi/Resources/API3_APK/README.md`  
`~/labs/vapi/Resources/API3_APK/TheCommentApp.apk`
##### In Windows
`D:\Docker\vapi\Resources\API3_APK\README.md`
`D:\Docker\vapi\Resources\API3_APK\TheCommentApp.apk`

It is an Android app that needs an Android device to set up.
For the purpose of this task, I am using Android Studio but you can use the emulator you want.

Make a virtual device from Device manager

I used a `Medium Phone` with `Android 11.0("R") x86_64 API level 30` with `Google Play`.

![2026-11-19_14-16_new](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/4cdbdd0a-b293-443b-ac07-b82fba7012e4.png)

Looking at the Postman collection for API3, we see we have one request: **Create User**

Let’s first create a new user with the **Create User** request.

![Pasted image 20261120123230](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/4771f9fd-7a6e-4368-acd7-373de923969b.png)

Now, for the proxy setting first start Burpsuite, go to Proxy --> Proxy Settings, and then set the `Bind to address` to `All interfaces`.

![2026-11-18_13-31](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/81270384-fc90-486f-9fd2-6d902b38bddd.png)

Then go to mobile settings and then disable the mobile data.Then click on **Wi-Fi**. Make sure **Use Wi-Fi** is on and **AndroidWifi** is indicated as **Connected**., Edit and set the proxy to Manual and give the host machine IP (which you can get by running  `ipconfig` in windows cmd) and the port. Click save and then close the box. You should be good to go.

![2026-11-18_13-36](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/b4816854-3e42-4b84-8b2d-2bfc6f66f780.png)

Then drag **TheCommentApp.apk** to the mobile device you created with the emulator.

You should see the app appear on your device. Now start the app.

### Configuring the Base URL in the vAPI Comment App

Depending on whether you are connecting directly from the Android emulator or intercepting traffic with Burp Suite, you need to set a different Base URL in the **vAPI Comment App**:

| Connection Setup           | Base URL                | How Traffic Resolves                                                               |
| -------------------------- | ----------------------- | ---------------------------------------------------------------------------------- |
| **Without Proxy (Direct)** | `http://10.0.2.2:8000`  | Android Studio's virtual router maps `10.0.2.2` to your host machine's `localhost` |
| **With Burp Suite Proxy**  | `http://127.0.0.1:8000` | Burp runs on your host OS and resolves `127.0.0.1` directly to your local server   |
#### 1. Without a Proxy (`http://10.0.2.2:8000`) 
The Android Studio emulator runs inside its own isolated virtual network. If you configure the app to use `127.0.0.1` without a proxy, it will look for the server inside the emulator itself rather than on your computer.

To solve this, Android Studio provides a special alias ("magic IP"), **`10.0.2.2`**, which is managed by the emulator's network layer and points directly to your host machine's loopback interface (`127.0.0.1`). Using `http://10.0.2.2:8000` allows the app to reach the local vAPI backend running on your host machine.
#### 2. With Burp Suite as a Proxy (`http://127.0.0.1:8000`) 
When you configure the emulator to route traffic through Burp Suite, the HTTP requests are forwarded to Burp running on your host machine - meaning Burp is now responsible for resolving the destination address.

* **Why `10.0.2.2` fails through Burp:** The `10.0.2.2` alias is only understood within the Android emulator's virtual network. Burp Suite and your host OS have no route for `10.0.2.2`, so Burp treats it like an external IP address and tries to send the request out to the internet, where nothing is found. 
* **Why `127.0.0.1` works:** Because Burp Suite is already running on your host machine, setting the Base URL to `http://127.0.0.1:8000` tells Burp to resolve the request locally and forward it straight to your vAPI server listening on port `8000`.

> _Quick Takeaway:_ Use `http://10.0.2.2:8000` when connecting directly from the emulator, and switch to `http://127.0.0.1:8000` whenever Burp Suite is acting as your proxy.

Now enter the URL of your target VAPI instance (http://127.0.0.1:8000/vapi), which is running inside the host machine's docker and click **Save**.

![2026-11-18_13-51](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/d2964dba-e7d5-4d49-9165-7cce4b41782e.png)

Now, in the mobile app, log in using the credentials of the user you just created.

![2026-11-18_13-43_1](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/8a495cfa-7ab9-4c04-9d66-5f3dc9431a4d.png)

This takes you to a screen with a post by another user and a comment.

![2026-11-18_13-52](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/20ae5810-f76a-45da-8291-2a84d247309d.png)

In Burp, you can see the response body displays Personally Identifiable Information (PII) of users who have commented the post, including their username and location (GPS coordinates).

![2026-11-18_13-55](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/d8218b2e-9e9e-47ca-9d3a-d1ca893e0ed9.png)

We also get the flag for this task:  **flag{api3_0bad677bfc504c75ff72}**

## API4 – Lack of resources & rate limiting

**Hint** - We believe OTPs are a great way of authenticating users and secure too if implemented correctly!

In Postman, send a **Mobile Login** query, from the **API4** folder, using the supplied body data.

![Pasted image 20261008201320](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/0c2c1c77-8990-45c8-b37a-5492918da547.png align="center")

This logs us into the user account whose cell phone number we provided. In the response body, we see that a 4 digit code has been sent to that user’s device. Since we don’t have the user’s device, we don’t have the OTP code and will have to find a workaround.

In Postman go to app settings, go to Proxy and turn on the "Use custom proxy configuration". Set proxy server to `http://127.0.0.1:8080`

Start your burpsuite.

In Postman, Send a **Verify OTP** query and proxy it into Burp Suite.

![Pasted image 20261008202203](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/5f36dd49-95e5-4185-8b43-c280b6355095.png align="center")

![Pasted image 20261008202911](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/fbebab23-832f-4593-8b86-7be75e17b455.png align="center")

Here we are getting a **403 Forbidden** response code, as the OTP code we provided is incorrect. This means we need to fuzz. Right-click the request and send it to Intruder.

![Pasted image 20261008203110](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/611e5e38-b25e-45ae-a491-055c089d225e.png align="center")

As you can see, we already have a payload marker positioned on the 4 digit code.\
Make sure a **Sniper** attack is selected then go to the **Payloads** tab. Set the Payloads as shown in the above image.

Then start the attack. Here again, Burp Intruder will take several hours (even days, actually..) to run through all 10.000 combinations before giving us a match: **1872**.

![2026-10-06_23-09](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/93fa0eff-1408-4be4-9f0b-d6c906ba4fdf.png align="center")

Now go back to Postman and send the **Verify OTP** request and test the code we obtained.

![Pasted image 20261008201703](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/56bb6b06-cc66-456a-8639-d2cd68f71b28.png align="center")

We get a key in the response body. The key will be automatically set in "{{api4_key}}" variable.

![Pasted image 20261008203847](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/a766fa28-b0e3-41a6-82f6-f6d4f7fefa46.png align="center")

In the response body, we get details of the user and the flag for this task:\
**flag{api4_ce696239323ea5b2d015}**

The takeaway here is that the app should have some form of rate limiting that would’ve stopped us from sending thousands of requests until we found the OTP code.

## API5 – Broken function level authorization

**Hint** - You can register yourself as a User. Thats it or is there something more? (I heard admin logins often but uses different route)
The explanation given for this task in the vAPI app’s interface is kinda cryptic

First use the **Create User** query in the **API5** folder of the Postman collection to create a new user.

The response body show us the user has been created and given an ID of 2.

![Pasted image 20261008211742](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/bf28692e-3e0d-4c7a-b6d9-30163d600c6c.png)

Now use the **Get User** query to log the new user in. keep the "{{api5_id}}" value 2.

![Pasted image 20261008212249](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/c794e7a7-7773-4c06-b7f8-37431d3ead80.png)

The login operation is successful. You can see that there is a variable at the end of the URL. This contains the ID number of the user.  
Now let’s try to change that value to 1 to log in as the other user on the system (likely an admin).

![Pasted image 20261008212353](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/c8dac320-0254-4a81-a062-d5df01dbc9f6.png)

This doesn’t work and we get a 403 response code. 
Now remember, the task explanation mentioned that admin logins happen, but use a different route. So let’s modify the request’s URL to `/vapi/api5/admin`

![Pasted image 20261008212445](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/e0e887c1-a785-4a47-a0c6-591381438bbf.png)

OK, this doesn’t work either and we get a 500 response code that indicates the endpoint probably doesn’t even exist. So let’s try something else. Rather that request the data of an individual user, let’s try to dump the data of all users. For this we have to send request to `/vapi/api5/users`

![Pasted image 20261008212019](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/8dfa81ef-8db6-4356-9060-55f11b454544.png)

This time, our request is successful and the response body lists the data of all users (two in the present case). This includes the flag for this task:  
**flag{api5_76dd990a97ff1563ae76}**

Now if you think this was way too easy, I did have to try out a number of possible endpoints before hitting the right one.

Here is a list of those I tried unsuccessfully (using Burp Repeater):  
`PUT /vapi/api5/admin > 500 error` 
`PUT /vapi/api5/user > 500 error`   
`POST /vapi/api5/user/admin > 500 error`   
`POST /vapi/admin > 500 error`   
`POST /vapi/user/admin > 500 error`   
`POST /vapi/api5/administrator > 500 error`   
`POST /vapi/api5/user/administrator > 500 error`   
`POST /vapi/api5/admin/register > 500 error`   
`POST /vapi/api5/user/admin/register > 500 error`   
`POST /vapi/api5/user/register/admin > 500 error`   
`POST /vapi/api5/admin/registration > 500 error` 
`POST /vapi/api5/registration > 500 error`

As a closing note, in my opinion the vulnerability featured in this task feels more like a BOLA than a BFLA, as we are just accessing another user’s data, rather than taking action in any way.  
Indeed we are accessing data from a user with a higher privilege level, but we are in no position to escalate our privilege level or modify any object properties.

## API6 – Mass assignment

**Hint** - Welcome to our store, We will give you credits if you behave nicely. Our credit management is super secure

Mass assignment is when the user of an API is able to include more parameters in a request than what the application originally intended.

In Postman, create a new user with the **Create User** request from the **API6** folder in the collection.

![Pasted image 20261024204420](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/4d9e1beb-c6e4-4213-b958-612f7b967d7c.png)

We can see the request is successful. Now use the **Get User** request to get this new user’s data.

![Pasted image 20261024204440](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/5d0adca3-5031-4bb6-bc3f-61e3728ec7fa.png)

Here, we can see that this user has a credit value of zero. We want to change this.

Trying to convert the **Get User** request from a GET to a PUT with a `"credit": "100"` value in the request body will not work.

You need to create a new user and include the `"credit"` parameter in the request body (don’t forget to add a comma at the end of the `"password"` line).

![Pasted image 20261024204321](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/5d8757fb-9de2-4de0-a7b8-3a0a4c2c71a3.png)

Now use the **Get User** request once again to display the data for this new user you just created.

![Pasted image 20261024204338](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/bacdadec-a38a-4c33-825a-2a2053eab250.png)

You can see that the value of the `"credit"` field you included in the previous request has been accepted.  
And you have the flag for this task:  
**flag{api6_afb969db8b6e272694b4}**

## API7 - Security Misconfiguration

**Hint** - Hey, it's an API right? So we ARE expecting Cross-Origin Requests. We just hope it works fine.

So we know we are dealing with a CORS issue in this task. As a reminder, the [OWASP-API-top-10](https://api-security.owasp.org/editions/2019/en/0xa7-security-misconfiguration/)  tells us:  
‘An API is vulnerable to security misconfiguration if a Cross-Origin Resource Sharing (CORS) policy is missing or improperly set’.

So let’s see how we can use that. In Postman, go to the **API7** folder in the collection and create a new user with the **Create User** request.

![Pasted image 20261024230455](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/7ab3de86-08f2-4d02-ab0d-3d62e7ad73b1.png)

The request is accepted and we get confirmation the new user has been created. Now send the **User Login** request to log the user in (no request body needed).

![Pasted image 20261024230513](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/17064035-f07d-423f-9708-3640f635aeaa.png)

Now send the **Get Key** request. We got an `authkey`.

![Pasted image 20261024230534](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/b0245076-8148-4310-a547-fde387bea3c0.png)

If you go to the response Headers you will notice the following response headers:  
`Access-Control-Allow-Origin: *`  
`Access-Control-Allow-Credentials: true`

This reveals the CORS policy for this request is improperly set, meaning that it could be sent from a third party web app to access this resource and retrieve the user’s id, username, password and authkey.

![Pasted image 20261024230606](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/e926e6dc-3da1-4d53-a1bf-4f048ecdb577.png)

To demonstrate it, add a new custom header name `Origin:` and set any arbitrary website like `hacker.com`. Then send the request.

![Pasted image 20261024230711](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/ec510e71-a08a-45a8-a675-12a0bc2679c9.png)

The response is accepted and we get the flag for this task in the response body:  
**flag{api7_e71b65071645e24ed50a}**

## API8 - Injection

**Hint** - I think you won't get credentials for this. You can try to log in, though.

In Postman, start by checking the requests given in the **API8** folder of the collection. Send a **User Login** request with some random credentials. As expected, the login fails.

Let’s see if the `username` or `password` fields are vulnerable to injection. So, I tried some SQL injection payloads with a guessed username, `admin`
Here is a suggested list:  
`'`  
`''`   
`;%00`   
`--`   
`-- -`   
`""`   
`;`   
`' OR '1`   
`' OR 1 -- -`   
`" OR "" = "`   
`" OR 1 = 1 -- -`   
`' OR '' = '`   
`OR 1=1`

Got a success with the `admin' or '1'='1--` payload and got an `authkey`.

![Pasted image 20261024232006](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/a804b9a0-9e43-4afb-9dff-6d35c533ce61.png)

Now send the **Get Secret** request. We got a `secret` flag.

![Pasted image 20261024232025](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/c273008a-b609-46f2-b724-4c1e8e674c9c.png)

Got the flag for this task:  
**flag{api8_509f8e201807860d5c91}**

## API9 - Improper asset management

**Hint** - Hey, Good News!!!!! We just launched our v2 API :)

Now turn to Postman and check out the content of the API9 folder of the collection.

Send a Login request using the supplied credentials

![Pasted image 20261026115024](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/3404b11c-ab39-40e6-8d8c-c20e12f9c890.png)

The login seems unsuccessful as we have an empty response body. Obviously, we don’t have the correct pin value for the `richardbranson` user.

We also notice response headers that indicate that rate limiting is in place. We have a maximum of five login attempts. We have already used up one and we have four left. This means we can’t run a credential stuffing attack as we did for task 4.

![Pasted image 20261026115117](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/b2edbf7c-f89b-4e9d-b1fe-277f258f36d2.png)

Instead, let’s first check if v1 of the API is still accessible. Maybe this previous version doesn’t have rate limiting implemented. Send the request to Repeater. In the URL path, change v2 to v1 and send the query through.

![Pasted image 20261026115244](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/7a52fd91-1ef8-445a-89a3-916d44fcae28.png)

This time, the response headers we spotted in the previous attempt aren’t listed. This suggests no rate limiting is in place. So we can try to brute-force the pin code.

In Postman, go to app settings, go to Proxy and turn on the "Use custom proxy configuration". Set proxy server to `http://127.0.0.1:8080`

Start Burp Suite.

In Postman, send a **Login** request and proxy it into Burp Suite.

![Pasted image 20261026115621](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/12e24cab-7b1c-4ac0-b555-abc3363ae7cb.png)

Right-click the request and send it to Intruder.

![Pasted image 20261026115918](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/4fab1333-cd7b-409d-a55e-6132d3a07861.png)

As you can see, we already have a payload marker positioned on the 4 digit code.  
Make sure a **Sniper** attack is selected, then go to the **Payloads** tab. Set the Payloads as shown in the above image.

Then start the attack. Here again, Burp Intruder will take several hours (even days, actually..) to run through all 10.000 combinations before giving us a match: **1655**

![2026-10-07_13-37](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/ef079fd3-3937-403f-a54e-5618cf793620.png)

Let's test the pin code we obtained.

![Pasted image 20261026120204](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/a3c0adb2-22c6-4951-b33f-b3c6f639d55e.png)

This time, our login attempt is successful and we get the flag for this task:  
**flag{api9_81e306bdd20a7734e244}**

## API10 - Insufficient logging and monitoring

**Hint** - Nothing has been logged or monitored, You caught us :( !

This is going to be a short one. In Postman, go to the **API10** folder in the collection and send a **Get Flag** request.

![Pasted image 20261024232701](https://cdn.hashnode.com/uploads/covers/6a78c9f9b20683bc77684bd3/1f1c3344-929c-4416-bd74-2469cbbf6b34.png)

We get the flag in the response body:  
**flag{api10_5db611f7c1ffd747971f}**

The takeaway here is that without proper logging and monitoring, the API provider has no way to spot ongoing security breaches. They are also in no position to be alerted when a succession of failed logins happens, typically suggesting a brute-force attack.  
And if access keys to an administrative API happen to have been leaked, the API provider can’t check if sensitive data has been accessed between the leak and the moment the keys were changed.
