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 serviceWRITE_DAC- Can modify service DACLWRITE_OWNER- Can take ownershipGENERIC_ALL- Full controlGENERIC_WRITE- Generic write accessSERVICE_ALL_ACCESS- All service rights
Technical Details
- Enumerate all services using
ServiceController - Query service security descriptor via
QueryServiceObjectSecurity - Parse DACL to find ACEs (Access Control Entries)
- Check if current user/groups have dangerous rights
- Report vulnerable services
Example Output
- 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
2
Set Secure Permissions
3
Bulk Remediation
4
Verify Fix
Understanding SDDL
Service permissions are defined using SDDL (Security Descriptor Definition Language):CC- Query ConfigLC- Query StatusSW- Enumerate DependentsRP- Start ServiceWP- Stop ServiceDT- Pause/ContinueLO- InterrogateCR- User-Defined ControlRC- Read Control (read security descriptor)WD- Write DACWO- Write OwnerSD- DeleteDC- Change Config
Detection
Defensive Monitoring
Detection Strategies
- Service Configuration Changes
- Behavioral Detection
- Permission Auditing
- Monitor sc.exe executions
- Alert on service ImagePath modifications
- Track service DACL changes
- Monitor service registry key modifications
Real-World Scenarios
Scenario 1: Misconfigured Custom Service
Scenario 1: Misconfigured Custom Service
Context: IT team created custom service with “Users” group having modify permissions for troubleshooting.Attack Path:
- User identifies modifiable service via SharpUp
- Changes service ImagePath to malicious executable
- Restarts service or waits for automatic restart
- Gains SYSTEM privileges
- Never grant Users modify rights on services
- Use proper service account delegation
- Remove troubleshooting permissions after testing
Scenario 2: Third-Party Software
Scenario 2: Third-Party Software
Context: Third-party application installer set weak service permissions.Impact:
- Any user can reconfigure the service
- Service runs as LocalSystem
- Complete system compromise possible
- Work with vendor to fix installer
- Manually correct service permissions
- Include in hardening baseline
Scenario 3: Service Installed by Non-Admin
Scenario 3: Service Installed by Non-Admin
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
- 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
Related Checks
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