THREAT-Impact-SecurityAgentServiceTermination

Service Stop — Security Agent Service Termination — EDR/AV/Backup-Agent Kill Chain Prelude to Destructive Payload

Impact Last updated:

Before deploying ransomware, wipers, or other destructive payloads, adversaries routinely stop or disable the security and backup agents that would otherwise detect or recover from the attack. On Windows this is done with sc.exe stop/config/delete, net stop, taskkill /f, PowerShell Stop-Service/Set-Service/Disable-Service, or WMIC service calls against EDR/AV processes (CrowdStrike Falcon, SentinelOne, Microsoft Defender, Sophos, Carbon Black, Trend Micro, McAfee/Trellix, Symantec, Cortex XDR, Cylance, Malwarebytes) and backup agents (Veeam, Acronis, Commvault, Rubrik, Druva, Cohesity). A stealthier variant bypasses sc.exe entirely and calls the Service Control Manager RPC interface (svcctl, over the \PIPE\svcctl named pipe) directly via OpenSCManagerW/ControlService Win32 API calls from a custom loader, which never shows the service name on a command line and evades command-line-only detection logic. On Linux the equivalent is systemctl stop/disable/mask/kill, service <name> stop, or a direct kill -9/pkill/killall against EDR and monitoring daemons (auditd, falcon-sensor, wazuh-agent, ossec-hids, falco, osqueryd, sophos-spl, cbagentd) and backup daemons (veeamservice, cvd, bpcd, rbs). Because this activity is almost always the immediate precursor to file encryption, mass deletion, or a wiper payload rather than an end in itself, a single stop event on one host is common IT operations noise, but two or more distinct security/backup agents stopped on the same host within a short window is a high-confidence signal that a destructive payload is about to detonate and should trigger immediate isolation ahead of encryption completing.

What is THREAT-Impact-SecurityAgentServiceTermination Security Agent Service Termination — EDR/AV/Backup-Agent Kill Chain Prelude to Destructive Payload?

Security Agent Service Termination — EDR/AV/Backup-Agent Kill Chain Prelude to Destructive Payload (THREAT-Impact-SecurityAgentServiceTermination) is a sub-technique of Service Stop (T1489) in the MITRE ATT&CK framework. It maps to the Impact tactic — the adversary is trying to manipulate, interrupt, or destroy your systems and data.

This page provides production-ready detection logic for Security Agent Service Termination — EDR/AV/Backup-Agent Kill Chain Prelude to Destructive Payload, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, Microsoft Defender for Endpoint (Windows and Linux). The queries below are rated critical severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Impact
Microsoft Sentinel / Defender
kusto
// THREAT-Impact-SecurityAgentServiceTermination (T1489 Service Stop, Windows + Linux)
let Lookback = 2h;
let BurstWindow = 10m;
let SecurityAgentNames = dynamic([
  "CSFalconService", "CSAgent", "CrowdStrike", "falcon-sensor",
  "SentinelAgent", "SentinelOne", "SentinelCtl", "sentinelone",
  "WinDefend", "MsMpSvc", "MsSense", "Sense", "WdNisSvc", "SecurityHealthService",
  "SAVService", "SepMasterService", "Symantec", "ccSvcHst",
  "McShield", "McTaskManager", "MfeEERM", "mfemms", "mfevtp",
  "TmCCSF", "TmListen", "tmccsf",
  "CylanceSvc", "CbDefense", "CarbonBlack", "cbdaemon", "cbagentd",
  "SophosMCS", "SophosEndpointDefense", "sophos-spl",
  "cyserver", "CyveraService", "CortexXDR",
  "MBAMService", "Malwarebytes",
  "wazuh-agent", "ossec-hids", "auditd", "falco", "osqueryd"
]);
let BackupAgentNames = dynamic([
  "VeeamBackupSvc", "VeeamTransportSvc", "veeamservice",
  "AcronisAgent", "acronis_agent",
  "BackupExecAgentAccelerator", "BackupExecJobEngine",
  "CommvaultService", "cvd",
  "RubrikBackupService", "rbs",
  "DruvaAgent", "cohesity", "bpcd"
]);
let WinStopTools = dynamic(["sc.exe", "net.exe", "net1.exe", "taskkill.exe", "powershell.exe", "pwsh.exe", "wmic.exe"]);
let LinuxStopTools = dynamic(["systemctl", "service", "kill", "pkill", "killall"]);
DeviceProcessEvents
| where Timestamp > ago(Lookback)
| where FileName in~ (WinStopTools) or FileName in~ (LinuxStopTools)
| where ProcessCommandLine has_any (SecurityAgentNames) or ProcessCommandLine has_any (BackupAgentNames)
| where (FileName in~ ("sc.exe") and ProcessCommandLine has_any ("stop", "config", "delete"))
    or (FileName in~ ("net.exe", "net1.exe") and ProcessCommandLine has "stop")
    or (FileName in~ ("taskkill.exe") and ProcessCommandLine has_any ("/f", "/im"))
    or (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has_any ("Stop-Service", "Set-Service", "Disable-Service"))
    or (FileName in~ ("wmic.exe") and ProcessCommandLine has_any ("stopservice", "changestartmode"))
    or (FileName in~ ("systemctl") and ProcessCommandLine has_any ("stop", "disable", "kill", "mask"))
    or (FileName in~ ("service") and ProcessCommandLine has "stop")
    or (FileName in~ ("kill", "pkill", "killall") and ProcessCommandLine has_any ("-9", "-sigkill", "-SIGKILL"))
| extend Platform = iff(FileName in~ (WinStopTools), "Windows", "Linux")
| extend StopMethod = case(
    FileName in~ ("sc.exe") and ProcessCommandLine has "stop", "sc stop",
    FileName in~ ("sc.exe") and ProcessCommandLine has "config", "sc disable",
    FileName in~ ("sc.exe") and ProcessCommandLine has "delete", "sc delete",
    FileName in~ ("net.exe", "net1.exe"), "net stop",
    FileName in~ ("taskkill.exe"), "taskkill",
    FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has "Stop-Service", "PS Stop-Service",
    FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has "Set-Service", "PS Set-Service",
    FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has "Disable-Service", "PS Disable-Service",
    FileName in~ ("wmic.exe"), "WMIC service",
    FileName in~ ("systemctl"), "systemctl stop/disable/kill",
    FileName in~ ("service"), "service stop",
    FileName in~ ("kill", "pkill", "killall"), "SIGKILL daemon",
    "other"
  )
| extend TargetsSecurityAgent = ProcessCommandLine has_any (SecurityAgentNames)
| extend TargetsBackupAgent = ProcessCommandLine has_any (BackupAgentNames)
| summarize Events = make_list(pack("Timestamp", Timestamp, "FileName", FileName, "ProcessCommandLine", ProcessCommandLine,
      "StopMethod", StopMethod, "TargetsSecurityAgent", TargetsSecurityAgent, "TargetsBackupAgent", TargetsBackupAgent)),
      DistinctAgentsStopped = dcount(ProcessCommandLine), FirstSeen = min(Timestamp), LastSeen = max(Timestamp)
      by DeviceName, Platform, AccountName, AccountDomain, bin(Timestamp, BurstWindow)
| extend IsBurst = DistinctAgentsStopped >= 2
| mv-expand Events
| extend Timestamp = todatetime(Events.Timestamp), FileName = tostring(Events.FileName),
         ProcessCommandLine = tostring(Events.ProcessCommandLine), StopMethod = tostring(Events.StopMethod),
         TargetsSecurityAgent = tobool(Events.TargetsSecurityAgent), TargetsBackupAgent = tobool(Events.TargetsBackupAgent)
| project Timestamp, DeviceName, Platform, AccountName, AccountDomain, FileName, ProcessCommandLine,
         StopMethod, TargetsSecurityAgent, TargetsBackupAgent, DistinctAgentsStopped, IsBurst
| sort by IsBurst desc, Timestamp desc

Detects EDR/AV agent and backup-agent service termination on both Windows (DeviceProcessEvents covering sc.exe, net.exe/net1.exe, taskkill.exe, powershell.exe/pwsh.exe, wmic.exe) and Linux (systemctl, service, kill, pkill, killall) hosts reporting through Microsoft Defender for Endpoint. Groups events into 10-minute buckets per device and flags IsBurst = true when two or more distinct security/backup agent stop commands fire on the same host within the window — the strongest indicator that this is a deliberate pre-encryption defense-stripping sequence rather than a single routine service restart.

critical severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint (Windows and Linux)

Required Tables

DeviceProcessEvents

False Positives

  • IT automation platforms (SCCM, Ansible, Chef, Puppet, Intune) stopping and restarting the EDR/AV agent as part of a scheduled sensor upgrade or reinstall
  • Security vendor self-update/upgrade routines that briefly stop and restart their own service (e.g. CrowdStrike Falcon sensor upgrade, Defender platform update)
  • Backup software maintenance windows where the backup agent service is intentionally cycled during patching
  • Linux configuration management (systemd unit reloads via systemctl daemon-reload/restart) that transiently reports as a stop-then-start pair
  • Decommissioning workflows where an approved change ticket removes a security or backup agent ahead of host retirement

Sigma rule & cross-platform mapping

The detection logic for Security Agent Service Termination — EDR/AV/Backup-Agent Kill Chain Prelude to Destructive Payload (THREAT-Impact-SecurityAgentServiceTermination) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulated EDR/AV Service Stop via sc.exe (Windows, Lab Only)

    Expected signal: Sysmon/DeviceProcessEvents record sc.exe launched with CommandLine containing 'stop TestSentinelAgent' followed by 'config TestSentinelAgent start= disabled'; System log Event ID 7036 (stopped) and 7040 (start type changed) for the target service.

  2. Test 2Simulated Multi-Agent Stop Burst via PowerShell (Windows, Lab Only)

    Expected signal: Two Sysmon Event ID 1 process creation events for powershell.exe with CommandLine containing 'Stop-Service' and the respective decoy service names, seconds apart on the same host.

  3. Test 3Simulated Linux Security Daemon Stop via systemctl (Lab Only)

    Expected signal: auditd exec record and/or Sysmon-for-Linux Event ID 1 for systemctl with CommandLine containing 'stop test-wazuh-agent' and 'mask test-wazuh-agent'; systemd journal entry confirming the unit transitioned to inactive/masked.

  4. Test 4Simulated Direct SIGKILL of Linux Security Daemon (Lab Only)

    Expected signal: auditd exec record for pkill with CommandLine containing '-9' and the decoy process name; kernel log entry for the SIGKILL delivery and process exit.


Response Playbook

Triage

  1. Identify every distinct security or backup agent stopped on the host and the exact timestamps — two or more distinct agents stopped within a 10-minute window is the primary escalation trigger for this detection
  2. Check whether the stop command originated from an approved change ticket, patch cycle, or known agent-upgrade process (compare InitiatingProcessParentFileName/InitiatingProcessCommandLine against your RMM/SCCM/Ansible service accounts)
  3. Immediately check the host for signs that a destructive payload has already begun executing — mass file rename/creation with new extensions, ransom note files, or unusual disk I/O — since agent termination is almost always the last step before detonation, not the goal itself
  4. Determine the account and logon session used to run the stop command (interactive console, RDP, PsExec/WMI remote execution, or a scheduled task) to establish whether this is attacker-controlled or legitimate remote administration
  5. Check other hosts for the same stop pattern in the same time window — mass EDR/AV termination is frequently scripted and pushed to many hosts near-simultaneously via GPO, PsExec, or a C2 implant's lateral movement module
  6. If the SCM RPC (svcctl named pipe) hunting signal fired instead of a CLI tool, treat it as higher confidence than a CLI-based stop — direct Win32 API service control is specifically used to evade command-line-based detections and is rarely legitimate

Containment

  1. Isolate the affected host from the network immediately if a burst (2+ distinct agents stopped) is confirmed and not tied to a known change window — do not wait for encryption/wiper indicators to appear before acting
  2. Re-enable and restart the stopped security agent(s) from an out-of-band management console (not from the potentially compromised host itself) and verify the agent reports healthy telemetry again
  3. Disable or rotate the credentials/account used to execute the stop commands, and revoke any active remote-execution sessions (PsExec, WMI, WinRM, SSH) associated with that account
  4. If multiple hosts show the same pattern in the same window, treat it as an active mass-deployment event and isolate the full affected host set, not just the first one identified
  5. Preserve the current disk state (snapshot or forensic image) on the affected host before any remediation or reboot, in case a destructive payload has already begun writing to disk

Evidence Collection

  1. Full process command-line history (DeviceProcessEvents / Sysmon Event ID 1) for the affected host across the incident window, including parent process chains back to the initial access vector
  2. EDR/AV agent status and uptime history from the vendor console showing exactly when telemetry stopped and, if applicable, resumed
  3. Any Sysmon Event ID 17/18 (PipeCreated/PipeConnected) records referencing \svcctl to confirm or rule out raw SCM API abuse rather than CLI-based stops
  4. Authentication logs (4624/4625/4648) and remote-execution artifacts (PsExec service creation events, WMI activity, WinRM session logs) covering the account that issued the stop commands
  5. A timeline of any subsequent file system activity (mass rename, mass delete, new file extensions) to confirm whether a destructive payload executed after the agent was disabled

Escalation Criteria

  • ! Two or more distinct security or backup agents stopped on the same host within a 10-minute window with no matching change ticket
  • ! The same stop pattern observed across more than one host within the same operational window, indicating a scripted mass-deployment rather than an isolated action
  • ! Any evidence of file encryption, mass deletion, or a ransom note appearing on the host after the agent stop, confirming the destructive payload has begun
  • ! A confirmed SCM RPC (svcctl pipe) based stop from a process with no legitimate administrative purpose, indicating deliberate evasion of command-line detection
  • ! Stop activity correlated with credentials or source hosts already flagged in a prior or concurrent incident involving initial access or lateral movement

Investigation Guide

Forensic Artifacts

  • > DeviceProcessEvents / Sysmon Event ID 1: full command line and parent process chain for the stop command
  • > Windows Event ID 7036 (Service Control Manager — service entered stopped state) and 7040 (start type changed) from the System log, which record independently of the tool used to issue the stop
  • > Sysmon Event ID 17/18 (PipeCreated/PipeConnected) referencing \svcctl, present when a process communicates with the Service Control Manager via RPC directly rather than through sc.exe
  • > Linux systemd journal (journalctl -u <unit>) and auditd exec records for systemctl/service/kill/pkill invocations, including the calling UID and TTY/session
  • > EDR/AV vendor console agent health and tamper-event history, which often independently logs an unexpected stop or tamper attempt even if local host logs are cleared
  • > PsExec/WMI/WinRM remote-execution artifacts if the stop command was issued remotely rather than from an interactive console session

Tuning Guidance

Build an allowlist of the service accounts and RMM/patch-management tools (SCCM, Intune, Ansible, Chef, Puppet) that are authorized to stop and restart EDR/AV or backup agents during maintenance windows, and exclude their known process lineage before alerting — this single step removes the majority of noise since legitimate agent upgrades are the most common false positive. Treat the IsBurst / DistinctAgentsStopped >= 2 condition as the primary alerting threshold; a single agent stop alone is too common to page on directly but should still be logged for correlation. Weight the SCM RPC (svcctl pipe) hunting signal higher than any CLI-based match when it fires, since legitimate administration overwhelmingly uses sc.exe, PowerShell, or the Services console rather than raw API calls — a match there with no corresponding CLI evidence is a strong indicator of deliberate detection evasion. For Linux, exclude systemd unit restart cycles (a stop immediately followed by a start of the same unit within seconds) which typically indicate a config reload rather than an attack, and focus on stop/disable/mask/kill actions with no corresponding restart.


Hunting Queries

Baseline hunt for processes accessing the Service Control Manager's RPC interface via the \svcctl named pipe without going through sc.exe, PowerShell, or the Services MMC snap-in. This catches EDR-killer tooling that calls OpenSCManagerW/ControlService directly to stop protected security services without ever putting the target service name on a command line, which defeats CLI-only detection logic. Requires Sysmon configured to log Event ID 17/18 (pipe events), which many default Sysmon configs exclude for noise reasons — verify coverage before relying on this hunt.

Hunting — KQL
kql
// Hunt: SCM RPC (svcctl named pipe) access from a process other than services.exe or known admin tools — indicates raw Win32 API service control bypassing sc.exe
Event
| where TimeGenerated > ago(14d)
| where Source == "Microsoft-Windows-Sysmon"
| where EventID in (17, 18)
| where EventData has "svcctl"
| extend ImagePath = tostring(extract(@'<Data Name="Image">([^<]+)</Data>', 1, EventData))
| where ImagePath !has "services.exe" and ImagePath !has "mmc.exe" and ImagePath !has "sc.exe" and ImagePath !has "WmiPrvSE.exe"
| summarize Occurrences = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by Computer, ImagePath
| order by Occurrences desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" (EventCode=17 OR EventCode=18) PipeName="*svcctl*"
| where NOT match(Image, "(?i)(services\.exe|mmc\.exe|sc\.exe|wmiprvse\.exe)")
| stats count as Occurrences, earliest(_time) as FirstSeen, latest(_time) as LastSeen by host, Image
| sort - Occurrences

Wider 30-day, 24-hour-window hunt (versus the primary detection's tight 10-minute burst) to catch slower, more deliberate agent-termination campaigns where an operator disables protections over hours rather than in a single automated script, which the tight burst window would miss.

Hunting — KQL
kql
// Hunt: hosts with 2+ distinct security/backup agents stopped within any 24h window over the last 30 days (wider net than the primary 10-minute burst detection)
DeviceProcessEvents
| where Timestamp > ago(30d)
| where FileName in~ ("sc.exe", "net.exe", "net1.exe", "taskkill.exe", "powershell.exe", "pwsh.exe", "wmic.exe", "systemctl", "service", "kill", "pkill", "killall")
| where ProcessCommandLine has_any ("CSFalconService", "SentinelAgent", "WinDefend", "MsSense", "SAVService", "McShield", "TmCCSF", "CylanceSvc", "CarbonBlack", "SophosMCS", "wazuh-agent", "auditd", "VeeamBackupSvc", "AcronisAgent", "CommvaultService")
| summarize DistinctAgents = dcount(ProcessCommandLine), FirstSeen = min(Timestamp), LastSeen = max(Timestamp) by DeviceName
| where DistinctAgents >= 2
| order by DistinctAgents desc
Hunting — SPL
spl
index=wineventlog OR index=linux sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  (CommandLine="*CSFalconService*" OR CommandLine="*SentinelAgent*" OR CommandLine="*WinDefend*" OR CommandLine="*MsSense*" OR CommandLine="*SAVService*" OR CommandLine="*McShield*" OR CommandLine="*TmCCSF*" OR CommandLine="*CylanceSvc*" OR CommandLine="*CarbonBlack*" OR CommandLine="*SophosMCS*" OR CommandLine="*wazuh-agent*" OR CommandLine="*auditd*" OR CommandLine="*VeeamBackupSvc*" OR CommandLine="*AcronisAgent*" OR CommandLine="*CommvaultService*")
| stats dc(CommandLine) as DistinctAgents, earliest(_time) as FirstSeen, latest(_time) as LastSeen by host
| where DistinctAgents >= 2
| sort - DistinctAgents

Atomic Red Team Tests

Test 1 Simulated EDR/AV Service Stop via sc.exe (Windows, Lab Only)
windows

Stops and disables a decoy service named to mimic a security agent, replicating the sc.exe stop/config sequence used to disable EDR/AV before a destructive payload runs. Use a disposable test service, never a production security agent.

Command

powershell
sc.exe stop TestSentinelAgent && sc.exe config TestSentinelAgent start= disabled

Cleanup

powershell
sc.exe config TestSentinelAgent start= auto && sc.exe start TestSentinelAgent

Expected Telemetry

Sysmon/DeviceProcessEvents record sc.exe launched with CommandLine containing 'stop TestSentinelAgent' followed by 'config TestSentinelAgent start= disabled'; System log Event ID 7036 (stopped) and 7040 (start type changed) for the target service.

Expected Detection

KQL/SPL detection matches StopMethod='sc stop' and 'sc disable' with TargetsSecurityAgent=true if the decoy service name is added to the SecurityAgentNames list for the test, or fires generically as a CLI-based stop otherwise.

Test 2 Simulated Multi-Agent Stop Burst via PowerShell (Windows, Lab Only)
windows

Stops two decoy services in rapid succession using PowerShell Stop-Service, replicating the burst pattern (2+ distinct agents stopped within a short window) that the primary detection escalates on.

Command

powershell
Stop-Service -Name TestSentinelAgent -Force; Stop-Service -Name TestVeeamBackupSvc -Force

Cleanup

powershell
Start-Service -Name TestSentinelAgent; Start-Service -Name TestVeeamBackupSvc

Expected Telemetry

Two Sysmon Event ID 1 process creation events for powershell.exe with CommandLine containing 'Stop-Service' and the respective decoy service names, seconds apart on the same host.

Expected Detection

KQL/SPL burst logic sets IsBurst=YES/true (DistinctAgentsStopped >= 2 within the 10-minute bucket) since both a security-agent and a backup-agent decoy were stopped in the same window.

Test 3 Simulated Linux Security Daemon Stop via systemctl (Lab Only)
linux

Stops and masks a decoy systemd unit named to mimic an EDR daemon, replicating the systemctl stop/mask sequence attackers use on Linux to permanently disable monitoring before a wiper or ransomware payload runs.

Command

bash
sudo systemctl stop test-wazuh-agent && sudo systemctl mask test-wazuh-agent

Cleanup

bash
sudo systemctl unmask test-wazuh-agent && sudo systemctl start test-wazuh-agent

Expected Telemetry

auditd exec record and/or Sysmon-for-Linux Event ID 1 for systemctl with CommandLine containing 'stop test-wazuh-agent' and 'mask test-wazuh-agent'; systemd journal entry confirming the unit transitioned to inactive/masked.

Expected Detection

KQL/SPL detection matches StopMethod='systemctl stop/disable/kill' with Platform='Linux' and TargetsSecurityAgent=true if the decoy unit name is added to the SecurityAgentNames list for the test.

Test 4 Simulated Direct SIGKILL of Linux Security Daemon (Lab Only)
linux

Sends SIGKILL directly to a decoy daemon process, replicating the kill -9/pkill fallback attackers use when a daemon is protected against a graceful systemctl stop or when speed matters more than a clean shutdown.

Command

bash
pkill -9 -f test-falcon-sensor-decoy

Cleanup

bash
nohup /usr/local/bin/test-falcon-sensor-decoy >/dev/null 2>&1 &

Expected Telemetry

auditd exec record for pkill with CommandLine containing '-9' and the decoy process name; kernel log entry for the SIGKILL delivery and process exit.

Expected Detection

KQL/SPL detection matches StopMethod='SIGKILL daemon' with Platform='Linux'; escalates to IsBurst if combined with a second decoy agent stop within the same 10-minute window.

Related Detections

Tactic Hub