nitesh@gupta
Proving Grounds Linux

SPX

Full walkthrough — enumeration, foothold and privilege escalation.

Nmap output

Nmap scan report for 192.168.239.108
Host is up (0.060s latency).
Not shown: 65533 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 b9:bc:8f:01:3f:85:5d:f9:5c:d9:fb:b6:15:a0:1e:74 (ECDSA)
|_  256 53:d9:7f:3d:22:8a:fd:57:98:fe:6b:1a:4c:ac:79:67 (ED25519)
80/tcp open  http    Apache httpd 2.4.52 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Tiny File Manager
|_http-server-header: Apache/2.4.52 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

We have Tiny File Manager running on port 80

SPX walkthrough, Got root, screenshot 1
SPX, step 1

After bruteforcing we got phpinfo.php

SPX walkthrough, Got root, screenshot 2
SPX, step 2

We see in phpinfo SPX is enabled

SPX walkthrough, Got root, screenshot 3
SPX, step 3

SPX version 0.4.15 is vulnerable to Path traversal. Using https://github.com/BubblyCola/CVE_2024_42007 this exploit and replaced the SPX_KEY

SPX walkthrough, Got root, screenshot 4
SPX, step 4

Ran the exploit & got the file

SPX walkthrough, Got root, screenshot 5
SPX, step 5

However after trying for other paths it shows that target is not vulnerable

SPX walkthrough, Got root, screenshot 6
SPX, step 6

However when I tried manually it worked

SPX walkthrough, Got root, screenshot 7
SPX, step 7

We read the index.php and got admin pasword hash for tiny file manager

SPX walkthrough, Got root, screenshot 8
SPX, step 8

Cracked the password for admin

SPX walkthrough, Got root, screenshot 9
SPX, step 9

Used password to login

SPX walkthrough, Got root, screenshot 10
SPX, step 10

Got access

SPX walkthrough, Got root, screenshot 11
SPX, step 11

Uploaded shell.php

SPX walkthrough, Got root, screenshot 12
SPX, step 12

Got command execution

SPX walkthrough, Got root, screenshot 13
SPX, step 13

Got reverse shell using busybox nc

SPX walkthrough, Got root, screenshot 14
SPX, step 14

Used lowprofile creds to switch to profiler user

SPX walkthrough, Got root, screenshot 15
SPX, step 15

Got local.txt (b9686350fa46c2c2033ad6ba49eb5e68)

SPX walkthrough, Got root, screenshot 16
SPX, step 16

We have sudo access to make

SPX walkthrough, Got root, screenshot 17
SPX, step 17

Modified Makefile inside php-spx to add profilers user to sudoers

SPX walkthrough, Got root, screenshot 18
SPX, step 18

Ran the command and got all sudo access

SPX walkthrough, Got root, screenshot 19
SPX, step 19

Got root

SPX walkthrough, Got root, screenshot 20
SPX, step 20

Got proof.txt (10e7797ce21695ee07d4a2f05dc4015c)

SPX walkthrough, Got root, screenshot 21
SPX, step 21

More walkthroughs