linuxExfiltrated

Privilege Escalation via Image Upload — DJVU RCE (CVE-2021-22204)

Summary

  • Discovered Subrion CMS hosted on port 80.

  • Used a public RCE exploit to execute remote commands.

  • Gained a stable reverse shell using a URL-encoded one-liner.

  • Escalated privileges by crafting a malicious .djvu image and uploading it, leading to remote code execution as root.

🧵 Let's Unpack


Enumeration

sudo nmap -sV -sC -p- -Pn 192.168.229.163 --open

Open Ports:

  • 22/tcp → OpenSSH 8.2p1

  • 80/tcp → Apache/2.4.41 (Ubuntu)

    • Detected Subrion CMS

    • robots.txt reveals interesting disallowed directories: /backup/, /cron/, /front/, /install/, /panel/, /tmp/, /updates/


Initial Foothold

🔍 Target: Subrion CMS

⚙️ Reverse Shell Execution

✅ Shell received as web user.


Privilege Escalation

🔧 Exploit: Malicious .djvu (CVE-2021-22204)

🧬 Steps

  1. Install prerequisites

  2. Prepare reverse shell script (shell.sh):

  3. Craft payload using djvumake:

  4. Upload exploit.jpg via vulnerable image parser

✅ Received root shell after execution.

Last updated