# Service Execution

Jump to: navigation, search
Service Execution
Technique
ID T1035
Tactic Execution
Platform Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP, Windows 7, Windows 8, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012 R2, Windows Vista, Windows 8.1, Windows 10
Permissions Required Administrator, SYSTEM
Data Sources Windows Registry, Process command-line parameters, Process monitoring
Supports Remote Yes

Adversaries may execute a binary, command, or script via a method that interacts with Windows services, such as the Service Control Manager. This can be done by either creating a new service or modifying an existing service. This technique is the execution used in conjunction with New Service and Modify Existing Service during service persistence or privilege escalation.

## Examples

• BBSRAT can start, stop, or delete services.1
• Cobalt Strike can use PsExec to execute a payload on a remote host.2
• Net Crawler uses PsExec to perform remote service manipulation to execute a copy of itself as part of lateral movement.3
• The net start and net stop commands can be used in Net to execute or stop Windows services.4
• Microsoft Sysinternals PsExec is a popular administration tool that can be used to execute binaries on remote systems using a temporary Windows service.5
• Shamoon creates a new service named “ntssrv” to execute the payload.6
• xCmd can be used to execute binaries on remote systems by creating and starting a service.7

## Mitigation

Ensure that permissions disallow services that run at a higher permissions level from being created or interacted with by a user with a lower permission level. Also ensure that high permission level service binaries cannot be replaced or modified by users with a lower permission level.

Identify unnecessary system utilities or potentially malicious software that may be used to interact with Windows services, and audit and/or block them by using whitelisting8 tools, like AppLocker,910 or Software Restriction Policies11 where appropriate.12

## Detection

Changes to service Registry entries and command-line invocation of tools capable of modifying services that do not correlate with known software, patch cycles, etc., may be suspicious. If a service is used only to execute a binary or script and not to persist, then it will likely be changed back to its original form shortly after the service is restarted so the service is not left broken, as is the case with the common administrator tool PsExec.