Skip to main content

Overview

The Modifiable Services check identifies Windows services where the service’s DACL (Discretionary Access Control List) allows the current user to modify service configuration. This is different from modifiable service binaries or registry keys - this check examines the service object’s permissions directly.
This is one of the most direct privilege escalation paths. If you can modify a service that runs as SYSTEM, you can execute arbitrary code with SYSTEM privileges.

How It Works

SharpUp queries each service’s security descriptor and checks for dangerous permissions: Checked Permissions:
  • SERVICE_CHANGE_CONFIG - Can reconfigure service
  • WRITE_DAC - Can modify service DACL
  • WRITE_OWNER - Can take ownership
  • GENERIC_ALL - Full control
  • GENERIC_WRITE - Generic write access
  • SERVICE_ALL_ACCESS - All service rights

Technical Details

  1. Enumerate all services using ServiceController
  2. Query service security descriptor via QueryServiceObjectSecurity
  3. Parse DACL to find ACEs (Access Control Entries)
  4. Check if current user/groups have dangerous rights
  5. Report vulnerable services

Example Output

Interpretation:
  • You have permissions to reconfigure these services
  • VulnSvc is running and will restart automatically
  • You can change the executable path to your malicious binary

Exploitation

Method 1: Change Service Binary Path

Method 2: Add User to Administrators

Method 3: Service with Dependencies

Method 4: Reverse Shell

Remediation

1

Identify Vulnerable Services

Example output:
2

Set Secure Permissions

3

Bulk Remediation

4

Verify Fix

Understanding SDDL

Service permissions are defined using SDDL (Security Descriptor Definition Language):
Access Rights:
  • CC - Query Config
  • LC - Query Status
  • SW - Enumerate Dependents
  • RP - Start Service
  • WP - Stop Service
  • DT - Pause/Continue
  • LO - Interrogate
  • CR - User-Defined Control
  • RC - Read Control (read security descriptor)
  • WD - Write DAC
  • WO - Write Owner
  • SD - Delete
  • DC - Change Config

Detection

Defensive Monitoring

Detection Strategies

  • Monitor sc.exe executions
  • Alert on service ImagePath modifications
  • Track service DACL changes
  • Monitor service registry key modifications

Real-World Scenarios

Context: IT team created custom service with “Users” group having modify permissions for troubleshooting.Attack Path:
  1. User identifies modifiable service via SharpUp
  2. Changes service ImagePath to malicious executable
  3. Restarts service or waits for automatic restart
  4. Gains SYSTEM privileges
Prevention:
  • Never grant Users modify rights on services
  • Use proper service account delegation
  • Remove troubleshooting permissions after testing
Context: Third-party application installer set weak service permissions.Impact:
  • Any user can reconfigure the service
  • Service runs as LocalSystem
  • Complete system compromise possible
Solution:
  • Work with vendor to fix installer
  • Manually correct service permissions
  • Include in hardening baseline
Context: User installed application that creates service (via exploit or misconfiguration).Risk:
  • Creator has full control over service
  • Can leverage for privilege escalation
  • May affect other users
Fix:
  • Remove unauthorized services
  • Restrict service installation to administrators
  • Monitor service creation events

Prevention Best Practices

Least Privilege

Only SYSTEM and Administrators should have modify rights on services.

Regular Audits

Periodically scan and fix service permissions across all systems.

Group Policy

Use GPO to enforce service security configurations.

Monitoring

Enable audit policies and monitor service changes in real-time.

Service Hardening Script

Modifiable Service Binaries

Service executables with weak file permissions

Modifiable Service Registry Keys

Service registry keys with weak permissions

Unquoted Service Path

Services with exploitable unquoted paths

Remediation Guide

Comprehensive remediation guidance

References

Microsoft Docs

Service Security and Access Rights

MITRE ATT&CK

T1543.003 - Create or Modify System Process: Windows Service