D3adshot's Blog

Documenting my journey through CCNA, TryHackMe, CCNP Security, and OSCP

Room: Agent T (Challenge)
Difficulty: Easy
Focus: PHP 8.1.0-dev RCE, Enumeration, Privilege Escalation
Date: 20 May 2025


First Things First

Recon & Enumeration

Ran a full Nmap scan on the target:

Open ports discovered:

Visiting the website revealed a basic Agent Portal (Dashboard) login page.

I ran a directory brute-force using Gobuster and found /info.php, which revealed the PHP version running: PHP 8.1.0-dev.


Exploitation

PHP 8.1.0-dev has a known backdoor from March 2021 allowing code execution via the User-Agent header.

I downloaded the exploit from Exploit-DB (ID 49933):

Then cloned the exploit repository:

Started a Netcat listener on a separate terminal:

⚠️ STOP!

Did you start the Netcat listener on port 4444?
If not, do that before running the exploit!

Run the Python exploit (make sure you have Python 3 installed):

IP Reference:

This gave me a reverse shell as www-data on my listener.


Privilege Escalation

Looked for the flag (on the listening terminal):

find / -name flag.txt 2>/dev/null

Found it at:

Read the flag:

🔥 Paste the flag in the challenge answer. 🔥


Tools Used


Lessons Learned


Learn. Hack. Repeat.