VillainBnB

Description

VillainBnB

This is a website where Villains can get short-term rentals for their nefarious deeds. There's a flag here somewhere though, can you get it from the database?

https://uscybercombine-s4-villainbnb.chals.io/arrow-up-right

VillainBnB.ziparrow-up-right

Solution

App:

VillainBnB

Creds: test02:test02

VillainBnB-1

We get new options: Create Listing and Your Listings

Create let's us add new listing and Your Listing shows items created by us.

We are given source so let's look into the code. There's 2 part of app, API and frontend itself.

API is accessible to only localhost

Create handler function:

validate_image_url function:

Lucky for us the request is made by server, which means we can sneak an internal url and see response. Application is kind enough to show us request response in the flash cards. Unfortunately the flash uses Javascript and it doesn't play well in Burpsuite without valid session (just a bit of pain).

The flag is placed inside database, but no way to access it.

Most routes in application use prepared statements, but for some reason we have /api/users endpoint which does the raw request and introduces SQLi

Make SQLi injection request:

VillainBnB-2

Request > Right Click > Request In Browser > In Original Session

VillainBnB-3

Get the flag:

VillainBnB-4
circle-check

Last updated