Intentions
Recon
nmap_scan.log
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_kernelHTTP (80)

Backend seems to be PHP, probably Laravel.

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

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) seems like the target, because it accepts search array as concatenated string with commas.
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.

/js/admin.js exists

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

If we try steve we get success login.

Admin Panel
steve is admin so we can access /admin

We can edit the files with different kind of effects.

For some reason SSRF works (???)

ImageMagick
ImageMagick: The hidden vulnerability behind your online images > CVE-2022-44268: Arbitrary Remote LeakCVE-2022-44268 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 http -> https://usage.imagemagick.org/files/#read
The image generator supports different modes and one of them is http[s]

Surveillance had (somewhat) the same vulnerability of Exploiting Arbitrary Object Instantiations in PHP without Custom Classes
“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.

Note: Above
<?xmlthere'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