Service Exploitation Techniques
Service Exploitation Techniques
Unquoted service paths represent classic Windows misconfigurations enabling privilege escalation. When service executables contain spaces without proper quoting, Windows searches multiple locations for executables. If writable directories exist along search paths, placing malicious executables achieves code execution with service privileges. Identify vulnerable services using WMIC queries, then exploit through careful executable placement.
Weak service permissions allow modification of service properties or executables. Services with FILE_ALL_ACCESS or FILE_WRITE permissions on executables enable direct replacement with malicious versions. Service configuration permissions (SERVICE_CHANGE_CONFIG) allow modifying binary paths to attacker-controlled executables. Tools like accesschk.exe or PowerShell scripts identify weak permissions systematically.
DLL hijacking exploits Windows library loading order to execute malicious code. When applications load DLLs without absolute paths, Windows searches predefined directories. Placing malicious DLLs in searched directories before legitimate versions achieves code execution. Service DLL hijacking proves particularly powerful as services often run with SYSTEM privileges. Process Monitor helps identify DLL loading patterns for targeted applications.
Insecure service configurations extend beyond file permissions to include credentials and dependencies. Services configured with weak passwords enable direct authentication as service accounts. Service dependencies might include attacker-controlled services, enabling privilege escalation through service start order manipulation. Registry analysis reveals service configurations beyond standard enumeration tool output.