Skip to content
Threat Feed
medium advisory

Detecting Remote Windows Service Installation for Lateral Movement

This rule detects a network logon followed by Windows service creation with the same LogonId on a Windows host, which could indicate lateral movement or persistence by adversaries.

This detection rule identifies a potential lateral movement technique where an attacker establishes a network logon to a Windows system and subsequently installs a service using the same LogonId. This behavior is flagged as suspicious because it deviates from typical administrative practices and can indicate unauthorized access and persistence within the network. The rule is designed to filter out common legitimate services and administrative activities, focusing on anomalies that could signify malicious intent. This detection is crucial for defenders as it can uncover attackers attempting to move laterally and establish persistent access.

Attack Chain

  1. An attacker gains initial access to a network via compromised credentials or exploiting a vulnerability.
  2. The attacker performs network reconnaissance to identify target systems for lateral movement.
  3. Using valid credentials or pass-the-hash techniques, the attacker authenticates to a remote Windows host over the network (e.g., SMB).
  4. The attacker attempts to install a new service on the remote host, potentially using tools like sc.exe or PowerShell.
  5. The service installation event is logged with a specific LogonId that matches the earlier network logon event, indicating a relationship between the two activities.
  6. The newly installed service is configured to execute a malicious payload or establish a reverse shell.
  7. The attacker uses the service to execute commands or deploy further malicious tools on the compromised host.
  8. The attacker achieves persistence and lateral movement within the network, enabling further compromise and data exfiltration.

Impact

A successful attack using this technique can lead to widespread compromise of systems within a network. Attackers can use the newly installed service to execute arbitrary code, install malware, or move laterally to other systems. This can result in data theft, system disruption, or ransomware deployment. The impact can be significant, potentially affecting numerous systems and causing substantial financial and reputational damage.

Recommendation

  • Enable Windows Security Event Logs with necessary auditing policies, specifically Audit Logon and Audit Security System Extension, to capture relevant logon and service installation events.
  • Deploy the provided Sigma rules to your SIEM to detect suspicious remote service installations based on matching LogonIds from network logons.
  • Investigate any alerts generated by the Sigma rules, focusing on unusual service file paths and user accounts.
  • Review the list of excluded service file paths in the Sigma rules and customize them based on your environment’s known legitimate services.
  • Monitor network connections for suspicious SMB activity, particularly connections originating from unusual or untrusted sources.
  • Implement multi-factor authentication (MFA) to reduce the risk of credential theft and unauthorized network access.

Detection coverage 2

Remote Windows Service Installed with Matching LogonId

medium

Detects a network logon followed by Windows service creation with the same LogonId, potentially indicating lateral movement.

sigma tactics: lateral_movement, persistence techniques: T1021.002, T1543.003 sources: process_creation, windows

Suspicious Service Installation from Network Logon

medium

Detects Windows service installations immediately following a network logon event, excluding known legitimate services.

sigma tactics: lateral_movement, persistence techniques: T1543.003 sources: process_creation, windows

Detection queries are kept inside the platform. Get full rules →