Create or Modify System Process
Adversaries may create or modify system-level processes to repeatedly execute malicious payloads as part of persistence. When operating systems boot up, they can start processes that perform background system functions. On Windows and Linux, these system processes are referred to as services. On macOS, launchd processes known as Launch Daemon and Launch Agent are run to finish system initialization and load user specific parameters. Adversaries may install new services, daemons, or agents that can be configured to execute at startup or a repeatable interval in order to establish persistence. Similarly, adversaries may modify existing services, daemons, or agents to achieve the same effect. Services, daemons, or agents may be created with administrator privileges but executed under root/SYSTEM privileges. Adversaries may leverage this functionality to create or modify system processes in order to escalate privileges.
What is T1543 Create or Modify System Process?
Create or Modify System Process (T1543) maps to the Persistence and Privilege Escalation tactics — the adversary is trying to maintain their foothold in MITRE ATT&CK.
This page provides production-ready detection logic for Create or Modify System Process, covering the data sources and telemetry it touches: Process: Process Creation, Windows Registry: Registry Key Modification, Command: Command Execution, Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Persistence Privilege Escalation
- Technique
- T1543 Create or Modify System Process
- Canonical reference
- https://attack.mitre.org/techniques/T1543/
let SuspiciousServicePaths = dynamic([
"\\Temp\\", "\\AppData\\", "\\Downloads\\", "\\Public\\",
"\\Users\\Public\\", "%TEMP%", "%APPDATA%", "%PUBLIC%"
]);
let KnownLOLBins = dynamic([
"powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe",
"mshta.exe", "regsvr32.exe", "rundll32.exe", "certutil.exe",
"bitsadmin.exe", "wmic.exe", "msbuild.exe"
]);
// Branch 1: New service installation via sc.exe or PowerShell New-Service
let NewServiceCreation = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "sc.exe" and ProcessCommandLine has_any ("create", "config")
or (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has_any ("New-Service", "Set-Service", "sc.exe create"))
| extend DetectionType = "NewServiceCreation"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Branch 2: Service binary in suspicious path (registry write to Services key)
let SuspiciousServiceBinary = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services"
| where RegistryValueName =~ "ImagePath"
| where RegistryValueData has_any (SuspiciousServicePaths)
or RegistryValueData has_any (KnownLOLBins)
| extend DetectionType = "SuspiciousServiceBinaryPath"
| project Timestamp, DeviceName, InitiatingProcessAccountName, RegistryKey,
RegistryValueName, RegistryValueData, InitiatingProcessFileName,
InitiatingProcessCommandLine, DetectionType;
// Branch 3: Service installed by unusual parent (Office apps, script interpreters)
let UnusualParentService = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "sc.exe" and ProcessCommandLine has "create"
| where InitiatingProcessFileName in~ (
"winword.exe", "excel.exe", "powerpnt.exe", "outlook.exe",
"wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe"
)
| extend DetectionType = "ServiceCreatedByOfficeOrScript"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Branch 4: New service type 0x10 (WIN32_OWN_PROCESS) with autostart via reg
let AutostartServiceReg = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services"
| where RegistryValueName =~ "Start" and RegistryValueData in ("2", "0") // Auto or Boot
| where InitiatingProcessFileName !in~ (
"services.exe", "svchost.exe", "msiexec.exe", "TrustedInstaller.exe",
"WmiPrvSE.exe", "MsMpEng.exe"
)
| extend DetectionType = "AutostartServiceRegistered"
| project Timestamp, DeviceName, InitiatingProcessAccountName, RegistryKey,
RegistryValueName, RegistryValueData, InitiatingProcessFileName,
InitiatingProcessCommandLine, DetectionType;
union NewServiceCreation, UnusualParentService
| sort by Timestamp desc Detects creation or modification of Windows services using multiple detection branches: (1) sc.exe or PowerShell New-Service invocations, (2) suspicious ImagePath registry values pointing to writable user directories or LOLBins, (3) service creation initiated by Office applications or script interpreters, and (4) autostart service registry modifications by unexpected processes. Uses DeviceProcessEvents and DeviceRegistryEvents tables from Microsoft Defender for Endpoint.
Data Sources
Required Tables
False Positives
- Legitimate software installers (MSI packages, vendor setup.exe) that register services during installation — typically identified by msiexec.exe or setup.exe as parent process
- IT management tools such as SCCM, Ansible, or Puppet that create or modify services as part of configuration management workflows
- Security products (EDR agents, AV engines, backup software) that install kernel-level or user-mode services during deployment or updates
- Software developers testing or deploying Windows services locally, particularly from development directories that may match suspicious path patterns
- System administrators manually configuring services via sc.exe or PowerShell during maintenance windows — correlate with change management tickets
Sigma rule & cross-platform mapping
The detection logic for Create or Modify System Process (T1543) 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:
Platform-specific guides for T1543
References (8)
- https://attack.mitre.org/techniques/T1543/
- https://technet.microsoft.com/en-us/library/cc772408.aspx
- https://learn.microsoft.com/en-us/windows/win32/services/service-control-manager
- https://learn.microsoft.com/en-us/sysinternals/downloads/autoruns
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1543.003/T1543.003.md
- https://www.mandiant.com/resources/blog/iocs-yellow-liderc-imaploader
- https://www.cisa.gov/sites/default/files/2024-04/aa24-109a-stopransomware-akira_0.pdf
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/registry/registry_set
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.
- Test 1Create Malicious Windows Service via sc.exe
Expected signal: Security Event ID 4697 and System Event ID 7045: New service 'ArgusTestSvc' installed with ServiceFileName containing cmd.exe. Sysmon Event ID 1: sc.exe process creation with CommandLine containing 'create ArgusTestSvc'. Sysmon Event ID 13: Registry value set at HKLM\SYSTEM\CurrentControlSet\Services\ArgusTestSvc\ImagePath.
- Test 2Create Persistent Service via PowerShell New-Service
Expected signal: Sysmon Event ID 1: powershell.exe process creation with CommandLine containing 'New-Service'. Security Event ID 4697 and System Event ID 7045: service 'ArgusTestPSSvc' installed with ServiceFileName = powershell.exe. Sysmon Event ID 13: registry modification at HKLM\SYSTEM\CurrentControlSet\Services\ArgusTestPSSvc\.
- Test 3Service Installed in User-Writable Path
Expected signal: Sysmon Event ID 11: file created at %TEMP%\svchost32.exe (copy of cmd.exe). Sysmon Event ID 1: sc.exe execution with TEMP path in command line. Security Event ID 4697 / System Event ID 7045: new service with ServiceFileName in user Temp directory. Sysmon Event ID 13: ImagePath registry value containing \Temp\ path.
- Test 4Modify Existing Service Binary Path (Service Hijacking)
Expected signal: Sysmon Event ID 1: sc.exe with 'config' and 'binPath' in command line targeting 'wuauserv'. Sysmon Event ID 13: registry value modification at HKLM\SYSTEM\CurrentControlSet\Services\wuauserv\ImagePath. Security Event ID 4697 may fire depending on Windows version and audit policy. Note: this test modifies a real service — run only in isolated test environments.
Response Playbook
Triage
- Identify the service name and binary path — examine the sc.exe command line, Event ID 4697/7045 ServiceFileName field, or the ImagePath registry value under HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>
- Check the binary location: is it in a system directory (C:\Windows\System32, C:\Program Files) or a user-writable location (Temp, AppData, Downloads, Public)? User-writable paths are high-confidence malicious indicators
- Identify the creating process and its parent — who invoked sc.exe or the service creation API? Was it an Office application, script interpreter, or an unrecognized process? Compare against known software installers and IT management tools
- Check the service start type: is it set to Automatic (2) or Boot (0)? Auto-start combined with a suspicious binary path is a critical indicator; Manual-start services are lower priority
- Examine the service's Run As account — is it running as LocalSystem (NT AUTHORITY\SYSTEM), LocalService, NetworkService, or a specific user account? SYSTEM privileges from a user-installed service are suspicious
- Look up the service binary hash against threat intelligence — calculate the SHA256 of the binary at the ImagePath and check VirusTotal or your internal hash reputation database
- Check the timestamp: was the service created during business hours, off-hours, or during a known maintenance window? Correlate with change management records
- Review process lineage for the creator — trace back through parent/grandparent processes to find the ultimate origin (e.g., browser download, email attachment, lateral movement from another host)
Containment
- If the service binary is in a user-writable path and verified malicious: immediately stop the service (sc stop <ServiceName>), disable it (sc config <ServiceName> start= disabled), and isolate the endpoint via EDR isolation or network VLAN change
- If a service account was created or modified as part of this technique: disable the service account in Active Directory, revoke all active sessions and Kerberos tickets (klist purge on affected hosts), and reset the account password
- If the service binary downloaded from an external URL: block the source domain/IP at firewall, proxy, and DNS levels to prevent reinfection and identify other hosts that contacted the same URL
- If lateral movement is suspected: identify other hosts running the same service binary (via hash matching in EDR), isolate all affected endpoints before the threat can propagate further
- Delete the malicious service binary from disk after taking a forensic copy for analysis — preserve hash, timestamps, and a full memory dump if the service is still running
- Remove the service registry keys: HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName> — verify removal and check for persistence in HKLM\SYSTEM\ControlSet001\Services\ and ControlSet002\Services\ as well
Evidence Collection
- Windows Security Event Log: Event ID 4697 (A service was installed in the system) — contains ServiceName, ServiceFileName, ServiceType, ServiceStartType, ServiceAccount
- Windows System Event Log: Event ID 7045 (New Service Installed) — contains ServiceName, ServiceFileName, ServiceType, ServiceStartType, ServiceAccount, logged by the Service Control Manager
- Sysmon Event ID 1: Process Creation for sc.exe, powershell.exe invoking New-Service, or the service binary itself launching — captures full command line and parent process
- Sysmon Event IDs 12/13/14: Registry key creation, value set, and key rename events targeting HKLM\SYSTEM\CurrentControlSet\Services\ — captures direct registry manipulation by service installation tools
- Registry export: HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName> — full service configuration including ImagePath, DisplayName, ObjectName (Run As account), Start, Type
- File system artifacts: Binary at the ImagePath location — collect full copy, SHA256 hash, PE metadata (compilation timestamp, imports, exports, signed/unsigned status)
- File system: C:\Windows\Prefetch\<SERVICENAME>.EXE-*.pf — execution timestamps and loaded DLLs
- Memory dump: If service is running, capture a full process memory dump using ProcDump or Task Manager before stopping the service — may reveal in-memory payloads injected into the service process
Escalation Criteria
- ! Service binary located in a user-writable directory (Temp, AppData, Downloads) rather than standard program directories — this is a near-certain indicator of malicious installation
- ! Service binary is a known LOLBin (powershell.exe, cmd.exe, rundll32.exe, regsvr32.exe) — legitimate services do not use these as their primary executable
- ! Service created by or from a document application (Word, Excel, Outlook) or browser — indicates exploitation of a document-based initial access vector
- ! Service binary is unsigned or signed with an untrusted/self-signed certificate — legitimate enterprise software is consistently code-signed by recognized vendors
- ! Service account is a newly created domain account with elevated privileges, or the service runs as SYSTEM with no corresponding vendor documentation
- ! Evidence of the same service binary hash observed on multiple endpoints within a short time window — indicates automated lateral movement or worm-like propagation
- ! Service binary makes outbound network connections to external IPs or domains after starting — indicates active C2 communication from the newly installed service
Investigation Guide
Forensic Artifacts
- >
Registry: HKLM\SYSTEM\CurrentControlSet\Services\ — complete service configuration; compare against known-good baseline to identify new or modified services - >
Registry: HKLM\SYSTEM\ControlSet001\Services\ and ControlSet002\Services\ — shadow copies of service configuration; malware may create entries in alternate ControlSets - >
Event Log: System — Event ID 7045 (Service Control Manager) for new service installations; Event ID 7034/7035/7036 for service state changes - >
Event Log: Security — Event ID 4697 for service installation; Event ID 4674 for privilege use during service creation - >
File System: Service binary at ImagePath location — full PE with compilation timestamp, import table, digital signature - >
File System: C:\Windows\System32\drivers\etc\ — check for unauthorized driver files if service is a kernel driver (Type=1) - >
File System: C:\Windows\Prefetch\ — prefetch files for the service executable contain first/last execution timestamps and loaded modules - >
WMI: Win32_Service class — query all installed services with StartMode, PathName, State, StartName for anomaly detection - >
Amcache.hve: Records first execution of service binaries with hash, compilation time, and file metadata even after binary deletion
Tuning Guidance
Begin by building a baseline of legitimate services in your environment using Win32_Service WMI queries or DeviceRegistryEvents over a 30-day historical window. Create an allowlist of known-good service names, binary paths, and creating processes (msiexec.exe, specific vendor installers). The most effective tuning strategy is to exclude services whose binary path begins with C:\Program Files, C:\Program Files (x86), or C:\Windows — these account for the vast majority of legitimate software. Alert only on services with binaries in user-writable paths or using LOLBins as executables. For sc.exe detections, exclude invocations from known IT management tools by filtering on the initiating process path (e.g., C:\Program Files\Microsoft Configuration Manager\). Security Event IDs 4697 and 7045 are the most reliable source with lowest false positive rate — prioritize these over registry-based detection. Increase confidence thresholds by requiring at least two of: suspicious binary path, LOLBin executable, unusual parent process, or off-hours creation time. Sysmon-based registry event monitoring (EventCode 12/13) is noisier during software installation periods; consider suppressing during known maintenance windows identified via CMDB integration.
Hunting Queries
Hunt for service ImagePath registry modifications by unexpected processes, particularly those writing binaries in user-writable directories or registering LOLBins as service executables. Excludes known legitimate service managers. High LOLBinCount or UserPathCount strongly indicates malicious service installation.
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where RegistryKey has "CurrentControlSet\\Services"
| where RegistryValueName =~ "ImagePath"
| where InitiatingProcessFileName !in~ (
"services.exe", "svchost.exe", "msiexec.exe", "TrustedInstaller.exe",
"WmiPrvSE.exe", "MsMpEng.exe", "SYSTEM"
)
| extend IsUserPath = RegistryValueData has_any (
"\\Users\\", "\\Temp\\", "\\AppData\\", "\\Downloads\\", "\\Public\\"
)
| extend IsLOLBin = RegistryValueData has_any (
"powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe",
"mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe"
)
| summarize ServiceCount=count(),
Services=make_set(RegistryKey),
Binaries=make_set(RegistryValueData),
UserPathCount=countif(IsUserPath),
LOLBinCount=countif(IsLOLBin)
by DeviceName, InitiatingProcessFileName, InitiatingProcessAccountName
| where UserPathCount > 0 or LOLBinCount > 0 or ServiceCount > 3
| sort by LOLBinCount desc, UserPathCount desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode IN (12, 13)
TargetObject="*CurrentControlSet\\Services*" ValueName="ImagePath"
NOT (Image="*\\services.exe" OR Image="*\\msiexec.exe" OR Image="*\\TrustedInstaller.exe" OR Image="*\\svchost.exe")
| eval IsUserPath=if(match(Details, "(?i)(\\\\users\\\\|\\\\temp\\\\|\\\\appdata\\\\|\\\\downloads\\\\|\\\\public\\\\)"), 1, 0)
| eval IsLOLBin=if(match(Details, "(?i)(powershell\.exe|cmd\.exe|wscript\.exe|cscript\.exe|mshta\.exe|rundll32\.exe|regsvr32\.exe|certutil\.exe)"), 1, 0)
| stats count as Changes, values(TargetObject) as Services, values(Details) as Binaries,
sum(IsUserPath) as UserPathCount, sum(IsLOLBin) as LOLBinCount
by host, Image, User
| where UserPathCount > 0 OR LOLBinCount > 0 OR Changes > 3
| sort - LOLBinCount, - UserPathCount Hunt for high-frequency sc.exe service creation or configuration activity — more than 5 sc.exe commands in a single hour on one host. This pattern indicates automated service installation by malware or a deployment tool modifying multiple services rapidly, which differs from normal one-off administrative service creation.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "sc.exe"
| where ProcessCommandLine has_any ("create", "config", "failure", "binpath")
| summarize Count=count(),
Commands=make_set(ProcessCommandLine),
Parents=make_set(InitiatingProcessFileName),
Accounts=make_set(AccountName)
by DeviceName, bin(Timestamp, 1h)
| where Count > 5
| sort by Count desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
Image="*\\sc.exe" (CommandLine="*create*" OR CommandLine="*config*" OR CommandLine="*binpath*")
| bin _time span=1h
| stats count as Count, values(CommandLine) as Commands, values(ParentImage) as Parents, values(User) as Accounts
by host, _time
| where Count > 5
| sort - Count Hunt for newly registered services where the service binary was not observed being created on disk in the same time window — this can indicate the binary was dropped via a mechanism not captured by file events (e.g., direct disk writes, extracted from an archive, or copied from a remote share) or that the service references a binary path that doesn't exist yet (staging for future execution).
// Find services whose binary does not exist on disk or is newly created
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where RegistryKey has "CurrentControlSet\\Services"
| where RegistryValueName =~ "ImagePath"
| extend CleanPath = replace_string(RegistryValueData, "\"", "")
| extend CleanPath = replace_string(CleanPath, "\\??\\", "")
| join kind=leftanti (
DeviceFileEvents
| where Timestamp > ago(7d)
| where ActionType in ("FileCreated", "FileModified")
| project DeviceName, FolderPath, FileName,
FullPath = strcat(FolderPath, "\\", FileName)
) on DeviceName, $left.CleanPath == $right.FullPath
| project Timestamp, DeviceName, RegistryKey, RegistryValueData,
InitiatingProcessFileName, InitiatingProcessAccountName index=wineventlog sourcetype="WinEventLog:Security" EventCode IN (4697, 7045)
| eval ServiceBinary=coalesce(ServiceFileName, param3)
| eval ServiceBinary=replace(ServiceBinary, "^\"", "")
| eval ServiceBinary=replace(ServiceBinary, "\"$", "")
| join type=left ServiceBinary [ search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
| eval FullPath=strcat(TargetDirectory, "\\", TargetFilename)
| stats count by FullPath
| rename FullPath as ServiceBinary ]
| where isnull(count)
| table _time, host, ServiceName, ServiceBinary, ServiceAccount, ServiceStartType
| sort - _time Atomic Red Team Tests
Creates a new Windows service using sc.exe with cmd.exe as the service binary — a LOLBin pattern commonly used by malware including Akira ransomware and various APT groups. The service is configured for auto-start, simulating persistence establishment. The service binary path points to cmd.exe with a benign command to avoid actual execution harm.
Command
sc.exe create ArgusTestSvc binPath= "cmd.exe /c echo T1543 test > %TEMP%\argus_t1543.txt" start= auto DisplayName= "Argus Test Service" Cleanup
sc.exe stop ArgusTestSvc 2>nul; sc.exe delete ArgusTestSvc 2>nul; del %TEMP%\argus_t1543.txt 2>nul Expected Telemetry
Security Event ID 4697 and System Event ID 7045: New service 'ArgusTestSvc' installed with ServiceFileName containing cmd.exe. Sysmon Event ID 1: sc.exe process creation with CommandLine containing 'create ArgusTestSvc'. Sysmon Event ID 13: Registry value set at HKLM\SYSTEM\CurrentControlSet\Services\ArgusTestSvc\ImagePath.
Expected Detection
KQL Branch 1 fires on sc.exe with 'create' in command line. SPL DetectionBranch='sc_exe_service_create'. LOLBinService=1 (cmd.exe as binary). RiskScore elevated due to LOLBin usage.
Uses PowerShell's New-Service cmdlet to register a new Windows service, an alternative to sc.exe used by PowerShell-based post-exploitation frameworks. Sets start type to Automatic for persistence. The binary path uses PowerShell itself as the service executable — a pattern seen in real-world malware.
Command
powershell.exe -Command "New-Service -Name 'ArgusTestPSSvc' -BinaryPathName 'powershell.exe -NoProfile -WindowStyle Hidden -Command Write-Output T1543' -StartupType Automatic -DisplayName 'Argus Test PS Service'" Cleanup
powershell.exe -Command "Stop-Service ArgusTestPSSvc -ErrorAction SilentlyContinue; (Get-WmiObject Win32_Service -Filter \"Name='ArgusTestPSSvc'\").Delete()" Expected Telemetry
Sysmon Event ID 1: powershell.exe process creation with CommandLine containing 'New-Service'. Security Event ID 4697 and System Event ID 7045: service 'ArgusTestPSSvc' installed with ServiceFileName = powershell.exe. Sysmon Event ID 13: registry modification at HKLM\SYSTEM\CurrentControlSet\Services\ArgusTestPSSvc\.
Expected Detection
KQL Branch 1 fires on PowerShell with 'New-Service' in command line. SPL DetectionBranch='powershell_new_service'. LOLBinService=1 (powershell.exe as binary). Both KQL and SPL register high-risk indicators.
Registers a service with its binary in the user's TEMP directory — a strong indicator of malicious service installation since legitimate software virtually never places service binaries in Temp. Simulates the pattern used by IMAPLoader and similar malware that drop payloads in user directories before registering as services.
Command
copy C:\Windows\System32\cmd.exe %TEMP%\svchost32.exe && sc.exe create ArgusTempSvc binPath= "%TEMP%\svchost32.exe /c echo persistence" start= auto Cleanup
sc.exe stop ArgusTempSvc 2>nul; sc.exe delete ArgusTempSvc 2>nul; del %TEMP%\svchost32.exe 2>nul Expected Telemetry
Sysmon Event ID 11: file created at %TEMP%\svchost32.exe (copy of cmd.exe). Sysmon Event ID 1: sc.exe execution with TEMP path in command line. Security Event ID 4697 / System Event ID 7045: new service with ServiceFileName in user Temp directory. Sysmon Event ID 13: ImagePath registry value containing \Temp\ path.
Expected Detection
KQL SuspiciousServiceBinary fires on ImagePath registry value containing \Temp\. KQL Branch 1 fires on sc.exe create. SPL SuspiciousPath=1, RiskScore elevated. High-confidence alert due to user-writable binary path.
Modifies an existing non-critical service's ImagePath to point to a different executable — simulating service binary hijacking where attackers replace or redirect legitimate service executables. Uses the Windows built-in 'browser' service (or an equivalent placeholder) as the target. This technique is used by threat actors to blend in with existing service names while executing malicious code.
Command
sc.exe config wuauserv binPath= "cmd.exe /c echo hijacked > %TEMP%\hijack_test.txt" Cleanup
sc.exe config wuauserv binPath= "C:\Windows\System32\svchost.exe -k netsvcs -p"; del %TEMP%\hijack_test.txt 2>nul Expected Telemetry
Sysmon Event ID 1: sc.exe with 'config' and 'binPath' in command line targeting 'wuauserv'. Sysmon Event ID 13: registry value modification at HKLM\SYSTEM\CurrentControlSet\Services\wuauserv\ImagePath. Security Event ID 4697 may fire depending on Windows version and audit policy. Note: this test modifies a real service — run only in isolated test environments.
Expected Detection
KQL Branch 1 fires on sc.exe with 'config' in command line. KQL SuspiciousServiceBinary fires on ImagePath registry modification with cmd.exe and TEMP path. SPL DetectionBranch='sc_exe_service_create' (covers both create and config). LOLBinService=1, SuspiciousPath=1, RiskScore=2.