15.Weak-permissions

whoami command to check current user information

whoami /user

List members of the administrators group

net localgroup administrators

Display the privileges of the current user

whoami /priv

Query registry to check if UAC is enabled

REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA
REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v ConsentPromptBehaviorAdmin

Get the OS version using PowerShell

[environment]::OSVersion.Version
cmd /c echo %PATH%

List tasks and filter for rundll32 processes

# Useful to identify suspicious rundll32 usage
tasklist /svc | findstr "rundll32"

Kill a process by specifying its PID

Generate a reverse TCP shell DLL using msfvenom

Start a Python HTTP server to host the DLL payload

Download the DLL file from the attacker's server using curl

Set up Netcat listener to capture the reverse shell

Execute the DLL payload using rundll32

Open advanced system properties dialog

Confirm the current user after potential privilege escalation

1. Permissive File System ACLs (SecurityService)

2. Weak Service Permissions (WindscribeService)

3. Unquoted Service Paths (SystemExplorerHelpService)

4. Permissive Registry ACLs (ModelManagerService)

5. Modifiable Registry Autorun Binary

Key Concepts:

  • Weak Windows Permissions: Misconfigurations allow privilege escalation.

  • Service Focus: Services run as SYSTEM, key targets.

Approach, Commands, Tools, and Techniques:

  1. Detect: SharpUp, accesschk, icacls, wmic, PowerShell (autorun).

  2. Exploit: copy, sc config/start/stop, net localgroup, PowerShell (registry).

  3. Verify: net localgroup, sc query.

Commands:

  • SharpUp, accesschk, icacls, sc, net localgroup, copy, wmic, PowerShell (Set-ItemProperty, Get-CimInstance).

Last updated