Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / WINDOWS / SERVICES

Service Attacks

This note documents detection patterns related to Service Attacks / Privilege Escalation via Services within Windows environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4697Service installedCriticalNative audit for new service creation.
System7045Service installedCriticalHighest-value Windows service creation event.
Security4688Process creationCriticalDetects sc.exe, net start, PowerShell service abuse, binary replacement.
Sysmon1Process creationCriticalBest execution source for service manipulation commands.
Sysmon11File createCriticalService binary replacement or malicious payload drop.
Sysmon13Registry value setCriticalService registry path changes under Services key.
Sysmon12Registry object create/deleteHighDetects service key creation or deletion.
Security4670Permissions changedHighACL abuse on service binary or service registry key.
System7036Service state changedHighDetect start / stop used to trigger payload.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Unquoted service pathSpaces in service path without quotesCriticalClassic privilege escalation primitive.
Writable service binary pathUser can replace SYSTEM binaryCriticalStrong escalation vector.
Service starts shellservices.exe -> cmd.exe / powershell.exeCriticalVery strong malicious signal.
Service binary changed shortly before restartFile replacement timelineCriticalCommon privesc chain.
Registry ImagePath modifiedService redirected to attacker payloadCriticalDirect abuse indicator.
Service account changedPrivileged service context alteredHighPersistence or escalation.
Rare service name appearsRandom or deceptive namingHighCommon attacker behavior.

Common Tools

ToolUsage
sc.exeCreate / modify / start service
PowerShellNew-Service / Set-Service abuse
accesschk.exeFind weak service ACLs
icacls.exeModify service binary permissions
reg.exeModify service ImagePath
net.exeStart / stop service
PsExecService-based remote execution
custom payloadSYSTEM execution via service

Relevant Artifacts

  • System Event ID 7045
  • Security Event ID 4697
  • Security Event ID 4688
  • Sysmon Event IDs 1, 11, 12, 13
  • System Event ID 7036
  • Registry: HKLM\SYSTEM\CurrentControlSet\Services\
  • Prefetch: SC.EXE, NET.EXE
  • Amcache for service payload
  • ShimCache for binary execution
  • MFT / USN Journal for binary replacement
  • EDR process tree from services.exe

MITRE ATT&CK References

  • T1543.003 Windows Service
  • T1574 Unquoted Path / Execution Flow Hijack
  • T1222 File and Directory Permissions Modification
  • T1548 Abuse Elevation Control Mechanism

Decision Tree

  1. Was new service created?

    • Check 7045 / 4697
    • Review service name
  2. Was existing service modified?

    • Registry path
    • ACL changes
  3. Was binary replaced?

    • File timestamps
    • Hash drift
  4. Did service spawn suspicious child?

    • cmd.exe
    • powershell.exe
    • rundll32.exe
  5. Expand:

    • User context
    • Adjacent persistence
    • Lateral movement
  6. Scope:

    • Single host
    • Shared service abuse
    • Enterprise deployment

Example Detection Templates

KQL

Event
| where EventID in (7045,4697)
| project TimeGenerated, Computer, EventID, ServiceName, ImagePath
Sysmon
| where EventID == 1
| where CommandLine has_any ("sc.exe","New-Service","Set-Service")
| project TimeGenerated, Computer, User, CommandLine

EQL

process where process.name == "sc.exe"
sequence by host.name with maxspan=5m
  [ process where process.name == "sc.exe" ]
  [ registry where registry.path like "*\\Services\\*" ]

Sigma

title: Service Attack Or Privilege Escalation
id: e2f4a990-service-privesc
status: experimental
description: Detects suspicious service creation or modification linked to privilege escalation
references:
  - https://attack.mitre.org/
author: Vergil
date: 2026-03-07
logsource:
  product: windows
detection:
  selection:
    EventID:
      - 7045
      - 4697
  condition: selection
fields:
  - ServiceName
  - ImagePath
falsepositives:
  - Legitimate software installs
level: high
tags:
  - attack.persistence
  - attack.privilege_escalation

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Service ACL reviewRemove weak permissionsCriticalCore prevention
Quote service pathsFix unquoted pathsCriticalRemoves classic abuse
Protect service binariesRestrict write accessCriticalPrevent replacement
Sysmon registry visibilityEnable service key monitoringHighDetect changes early
Service baselineTrack legitimate servicesHighDetect drift