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

Service Modification

This note documents detection patterns related to Service Modification within Windows environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security7040Service start type changedCriticalDetects service mode changes.
Security7045Service installedCriticalOften adjacent when service altered or replaced.
Security4697Service installedHighSecurity log service creation visibility.
Sysmon13Registry value setCriticalService ImagePath, Start, failure action changes.
Security4688Process creationCriticalDetects sc.exe, PowerShell, reg.exe.
Sysmon1Process creationCriticalBest lineage source for modification tooling.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
ImagePath changedService points to attacker payloadCriticalCore abuse primitive.
Start type changed to autoPersistence activationCriticalCommon attacker step.
Failure action alteredPayload on service crashHighAdvanced persistence clue.
Existing service repointedTrusted name, new binaryCriticalStrong stealth tactic.
Temp/AppData binary as service targetStrong anomalyCriticalHigh-confidence signal.
Service restarts after editTrigger observedHighConfirms activation

Common Tools

ToolUsage
sc.exeService config changes
reg.exeDirect registry edits
PowerShellSet-Service / registry writes
services.mscGUI modification

Relevant Artifacts

  • Security Event IDs 7040, 7045, 4697, 4688
  • Sysmon Event IDs 13, 1
  • Registry path:
    • HKLM\SYSTEM\CurrentControlSet\Services\
  • Key values:
    • ImagePath
    • Start
    • FailureActions
  • Prefetch:
    • SC.EXE
    • REG.EXE
  • Amcache / ShimCache

MITRE ATT&CK References

  • T1543.003 Windows Service
  • T1112 Modify Registry

Decision Tree

  1. Which service modified?

    • Existing
    • Newly installed
  2. Which value changed?

    • ImagePath
    • Start
    • FailureActions
  3. Binary trusted?

    • System32
    • Temp
    • AppData
  4. Trigger observed?

    • Restart
    • Boot
    • Manual start
  5. Expand:

    • Adjacent persistence
    • Privilege escalation
    • Parent process
  6. Scope:

    • Single service
    • Multiple services
    • Campaign pattern

Example Detection Templates

KQL

SecurityEvent
| where EventID in (7040,7045,4697)
| project TimeGenerated, Computer, EventID, ServiceName
Sysmon
| where EventID == 13
| where TargetObject has "\\Services\\"
| project TimeGenerated, Computer, TargetObject, Details

EQL

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

Sigma

title: Service Modification Detection
id: 6a4e3c11-service-modification
status: experimental
description: Detects suspicious Windows service modifications
references:
  - https://attack.mitre.org/
author: Vergil
date: 2026-03-07
logsource:
  product: windows
detection:
  selection:
    EventID:
      - 7040
      - 7045
      - 4697
  condition: selection
fields:
  - ServiceName
falsepositives:
  - Legitimate administration
level: high
tags:
  - attack.persistence

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Alert on ImagePath changesCritical service signalCriticalStrong visibility
Baseline service binariesDetect repointsCriticalLow false positives
Registry monitoringWatch Services treeHighEssential context
Restrict service modification rightsReduce abuseHighPrevent persistence
Correlate with restartConfirm activationHighStrong forensic anchor