Intentions

Recon

nmap_scan.log

HTTP (80)

Writeup.png

Backend seems to be PHP, probably Laravel.

Writeup-1.png

News is empty, Gallery/Your Feed shows just images and profile let's us update Favorite Genres

Writeup-2.png

SQLi

SQLMap came empty handed 🤔

The genres doesn't allow any spaces, and we could probably deduct that there's a function being used here. Reason for failure might be syntax related.

FIND_IN_SET(str, strlist)arrow-up-right seems like the target, because it accepts search array as concatenated string with commas.

https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MySQL%20Injection.md#extract-database-with-information_schemaarrow-up-right

Select has 5 columns

Get databases

Get tables from current database

Get columns from users

We have 2 potential users: steve and greg. Passwords dont seem to be crackable :/

API

In the gallary the Vue has few routes hardcoded as part of it's compiled source. Feroxbuster didn't find any Javascript about admin, but that could be bad request.

Writeup-3.png

/js/admin.js exists

Writeup-4.png

Sources shows JS formatter nicely, we can copy, save and grep for common pattern.

When we do normal user login we are making call to v1 API, changing it to v2 says we need to provide hash

Writeup-5.png

If we try steve we get success login.

Writeup-6.png

Admin Panel

steve is admin so we can access /admin

Writeup-7.png

We can edit the files with different kind of effects.

Writeup-8.png

For some reason SSRF works (???)

Writeup-9.png

ImageMagick

ImageMagick: The hidden vulnerability behind your online images > CVE-2022-44268: Arbitrary Remote Leakarrow-up-rightCVE-2022-44268arrow-up-right PoC

The CVE didn't work, but it led me to the correct version of ImageMagick used on the server.

Going back to the odd URL quirk -> PHP ImageMagick get image from httparrow-up-right -> https://usage.imagemagick.org/files/#readarrow-up-right

The image generator supports different modes and one of them is http[s]

Writeup-10.png

Surveillance had (somewhat) the same vulnerability of Exploiting Arbitrary Object Instantiations in PHP without Custom Classesarrow-up-right

“https://” goes to PHP, but “https:/” goes to curl

Abusing RCE #2: VID Scheme we can get webshell on the server. The path is disclosed from web application when editing the images and we can use that in msl payload. I used the PoC straight from blog without too much edit.

Writeup-11.png

Note: Above <?xml there's a space in the blob payload so mind that, burp will highlight good payload.

Reverse Shell (www-data)

Get environment file for application

Get users

SSH

User.txt

Privilege Escalation

The application finds hashes inside the given files and we can read root's ssh key by bruteforcing it

Root.txt

Last updated