Intentions

Recon

chevron-rightnmap_scan.loghashtag
Open 10.129.229.27:22
Open 10.129.229.27:80
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -sV -sC -Pn" on ip 10.129.229.27

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 47:d2:00:66:27:5e:e6:9c:80:89:03:b5:8f:9e:60:e5 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCbEW8beTNeBRfWCUhSxjST5j/gsczjYvLp9vmAsclM2CG/L0KsthRQMThUc1L+eJC0mVYm46K2qkCVwni2zNHU=
|   256 c8:d0:ac:8d:29:9b:87:40:5f:1b:b0:a4:1d:53:8f:f1 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEdBQnXdYum2v3ky5zsqh2jiTOu8kbWYpKiDFJmRJ97m
80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)
|_http-title: Intentions
|_http-server-header: nginx/1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-favicon: Unknown favicon MD5: D41D8CD98F00B204E9800998ECF8427E
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

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