Weak Permissions

Here would be an examples of weak permissions abuse

Permissive File System ACLs

Running SharpUp

  • Tool: SharpUp from GhostPack to check for weak ACLs.

PS C:\> .\SharpUp.exe audit
  • Example vulnerable service:

    • Name: SecurityService

    • Path: "C:\Program Files (x86)\PCProtect\SecurityService.exe"

Checking Permissions with icacls

PS C:\> icacls "C:\Program Files (x86)\PCProtect\SecurityService.exe"
  • Output shows Everyone and BUILTIN\Users have Full Control.

Replacing Service Binary with malicious one

C:\> cmd /c copy /Y SecurityService.exe "C:\Program Files (x86)\PCProtect\SecurityService.exe"
C:\> sc start SecurityService
  • Replace with a malicious binary to gain SYSTEM privileges.

Weak Service Permissions

Checking Modifiable Services with SharpUp

  • Example vulnerable service:

    • Name: WindscribeService

    • Path: "C:\Program Files (x86)\Windscribe\WindscribeService.exe"

Checking Permissions with accesschk

  • NT AUTHORITY\Authenticated Users has SERVICE_ALL_ACCESS (full control).

Changing the Service Binary Path

  • Grants user ven17 administrator rights.

Stopping & Starting the Service

  • Executes the new binary path.

Confirming Privilege Escalation

  • Verify if ven17 was added to the Administrators group.

Resetting the Binary Path (Cleanup)

Unquoted Service Path

  • If a service binary path is not enclosed in quotes, Windows may execute unintended binaries.

  • Example vulnerable service:

  • Windows may execute:

    • C:\Program.exe

    • C:\Program Files\System.exe

Finding Unquoted Service Paths

Permissive Registry ACLs

Checking for Weak Service ACLs in the Registry

  • Example vulnerable service: ModelManagerService

  • Allows modification of the ImagePath.

Changing ImagePath with PowerShell

  • Executes Netcat shell upon service start.

Modifiable Registry Autorun Binaries

Checking Startup Programs

  • If the attacker can modify a startup binary, they can execute malicious code on user login.

Last updated