Detection rule
New Kernel Driver Via SC.EXE
Overview
Detects creation of a new service (kernel driver) with the type "kernel"
- Rule id
431a1fdb-4799-4f3b-91c3-a683b003fc49- ATT&CK techniques
- T1543.003 Create or Modify System Process: Windows Service
- Severity
- Medium
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- The Gentlemen, qilin, Akira, safepay, majinahanashi
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
1 of 1 positive test events matched; 2 of 2 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 431a1fdb-4799-4f3b-91c3-a683b003fc49
title: New Kernel Driver Via SC.EXE
id: 431a1fdb-4799-4f3b-91c3-a683b003fc49
status: test
description: Detects creation of a new service (kernel driver) with the type "kernel"
references:
- https://www.levelblue.com/blogs/spiderlabs-blog/yours-truly-signed-av-driver-weaponizing-an-antivirus-driver/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-07-14
modified: 2025-10-07
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1543.003
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\sc.exe'
CommandLine|contains:
- 'create'
- 'config'
CommandLine|contains|all:
- 'binPath'
- 'type'
- 'kernel'
filter_optional_avira_driver:
- CommandLine|contains|all:
- 'create netprotection_network_filter'
- 'type= kernel start= '
- 'binPath= System32\drivers\netprotection_network_filter'
- 'DisplayName= netprotection_network_filter'
- 'group= PNP_TDI tag= yes'
- CommandLine|contains|all:
- 'create avelam binpath=C:\Windows\system32\drivers\avelam.sys'
- 'type=kernel start=boot error=critical group=Early-Launch'
condition: selection and not 1 of filter_optional_*
falsepositives:
- Rare legitimate installation of kernel drivers via sc.exe
level: mediumQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND ((LOWER("Process Path") LIKE '%\sc.exe' OR LOWER("Process Name") LIKE '%\sc.exe') AND (LOWER(Command) LIKE '%create%' OR LOWER(Command) LIKE '%config%') AND (LOWER(Command) LIKE '%binpath%' AND LOWER(Command) LIKE '%type%' AND LOWER(Command) LIKE '%kernel%')) AND (NOT(((LOWER(Command) LIKE '%create netprotection_network_filter%' AND LOWER(Command) LIKE '%type= kernel start= %' AND LOWER(Command) LIKE '%binpath= system32\drivers\netprotection_network_filter%' AND LOWER(Command) LIKE '%displayname= netprotection_network_filter%' AND LOWER(Command) LIKE '%group= pnp_tdi tag= yes%') OR (LOWER(Command) LIKE '%create avelam binpath=c:\windows\system32\drivers\avelam.sys%' AND LOWER(Command) LIKE '%type=kernel start=boot error=critical group=early-launch%'))))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: New Kernel Driver Via SC.EXE- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:New Kernel Driver Via SC EXE:selection(match)All test lines must match (AND).Process Path / Process Nameends with:\sc.exeCommandcontains:create,configCommandcontains:binPath,type,kernel
BB:OffSet7:New Kernel Driver Via SC EXE:filter_optional_avira_driver(exclusion)Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.Commandcontains:create netprotection_network_filter,type= kernel start=,binPath= System32\drivers\netprotection_network_filter,DisplayName= netprotection_network_filter,group= PNP_TDI tag= yesCommandcontains:create avelam binpath=C:\Windows\system32\drivers\avelam.sys,type=kernel start=boot error=critical group=Early-Launch
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
BB:OffSet7:New Kernel Driver Via SC EXE:selection AND NOT (ANY of [BB:OffSet7:New Kernel Driver Via SC EXE:filter_optional_avira_driver])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND ((LOWER("Process Path") LIKE '%\sc.exe' OR LOWER("Process Name") LIKE '%\sc.exe') AND (LOWER(Command) LIKE '%create%' OR LOWER(Command) LIKE '%config%') AND (LOWER(Command) LIKE '%binpath%' AND LOWER(Command) LIKE '%type%' AND LOWER(Command) LIKE '%kernel%')) AND (NOT(((LOWER(Command) LIKE '%create netprotection_network_filter%' AND LOWER(Command) LIKE '%type= kernel start= %' AND LOWER(Command) LIKE '%binpath= system32\drivers\netprotection_network_filter%' AND LOWER(Command) LIKE '%displayname= netprotection_network_filter%' AND LOWER(Command) LIKE '%group= pnp_tdi tag= yes%') OR (LOWER(Command) LIKE '%create avelam binpath=c:\windows\system32\drivers\avelam.sys%' AND LOWER(Command) LIKE '%type=kernel start=boot error=critical group=early-launch%'))))
Rule response
- Severity 5, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
Image="*\\sc.exe" (CommandLine IN ("*create*", "*config*")) CommandLine="*binPath*" CommandLine="*type*" CommandLine="*kernel*" NOT ((CommandLine="*create netprotection_network_filter*" CommandLine="*type= kernel start= *" CommandLine="*binPath= System32\\drivers\\netprotection_network_filter*" CommandLine="*DisplayName= netprotection_network_filter*" CommandLine="*group= PNP_TDI tag= yes*") OR (CommandLine="*create avelam binpath=C:\\Windows\\system32\\drivers\\avelam.sys*" CommandLine="*type=kernel start=boot error=critical group=Early-Launch*"))Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[New Kernel Driver Via SC.EXE]
description = Detects creation of a new service (kernel driver) with the type "kernel"
search = Image="*\\sc.exe" (CommandLine IN ("*create*", "*config*")) CommandLine="*binPath*" CommandLine="*type*" CommandLine="*kernel*" NOT ((CommandLine="*create netprotection_network_filter*" CommandLine="*type= kernel start= *" CommandLine="*binPath= System32\\drivers\\netprotection_network_filter*" CommandLine="*DisplayName= netprotection_network_filter*" CommandLine="*group= PNP_TDI tag= yes*") OR (CommandLine="*create avelam binpath=C:\\Windows\\system32\\drivers\\avelam.sys*" CommandLine="*type=kernel start=boot error=critical group=Early-Launch*"))Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where (TargetProcessName endswith "\\sc.exe" and (TargetProcessCommandLine contains "create" or TargetProcessCommandLine contains "config") and (TargetProcessCommandLine contains "binPath" and TargetProcessCommandLine contains "type" and TargetProcessCommandLine contains "kernel")) and (not(((TargetProcessCommandLine contains "create netprotection_network_filter" and TargetProcessCommandLine contains "type= kernel start= " and TargetProcessCommandLine contains "binPath= System32\\drivers\\netprotection_network_filter" and TargetProcessCommandLine contains "DisplayName= netprotection_network_filter" and TargetProcessCommandLine contains "group= PNP_TDI tag= yes") or (TargetProcessCommandLine contains "create avelam binpath=C:\\Windows\\system32\\drivers\\avelam.sys" and TargetProcessCommandLine contains "type=kernel start=boot error=critical group=Early-Launch"))))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where (FolderPath endswith "\\sc.exe" and (ProcessCommandLine contains "create" or ProcessCommandLine contains "config") and (ProcessCommandLine contains "binPath" and ProcessCommandLine contains "type" and ProcessCommandLine contains "kernel")) and (not(((ProcessCommandLine contains "create netprotection_network_filter" and ProcessCommandLine contains "type= kernel start= " and ProcessCommandLine contains "binPath= System32\\drivers\\netprotection_network_filter" and ProcessCommandLine contains "DisplayName= netprotection_network_filter" and ProcessCommandLine contains "group= PNP_TDI tag= yes") or (ProcessCommandLine contains "create avelam binpath=C:\\Windows\\system32\\drivers\\avelam.sys" and ProcessCommandLine contains "type=kernel start=boot error=critical group=Early-Launch"))))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
(process.executable:*\\sc.exe AND (process.command_line:(*create* OR *config*)) AND (process.command_line:*binPath* AND process.command_line:*type* AND process.command_line:*kernel*)) AND (NOT ((process.command_line:*create\ netprotection_network_filter* AND process.command_line:*type\=\ kernel\ start\=\ * AND process.command_line:*binPath\=\ System32\\drivers\\netprotection_network_filter* AND process.command_line:*DisplayName\=\ netprotection_network_filter* AND process.command_line:*group\=\ PNP_TDI\ tag\=\ yes*) OR (process.command_line:*create\ avelam\ binpath\=C\:\\Windows\\system32\\drivers\\avelam.sys* AND process.command_line:*type\=kernel\ start\=boot\ error\=critical\ group\=Early\-Launch*)))Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where (process.executable:"*\\sc.exe" and (process.command_line like~ ("*create*", "*config*")) and (process.command_line:"*binPath*" and process.command_line:"*type*" and process.command_line:"*kernel*")) and (not ((process.command_line:"*create netprotection_network_filter*" and process.command_line:"*type= kernel start= *" and process.command_line:"*binPath= System32\\drivers\\netprotection_network_filter*" and process.command_line:"*DisplayName= netprotection_network_filter*" and process.command_line:"*group= PNP_TDI tag= yes*") or (process.command_line:"*create avelam binpath=C:\\Windows\\system32\\drivers\\avelam.sys*" and process.command_line:"*type=kernel start=boot error=critical group=Early-Launch*")))Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where ends_with(process.executable, "\\sc.exe") and (process.command_line like "*create*" or process.command_line like "*config*") and process.command_line like "*binPath*" and process.command_line like "*type*" and process.command_line like "*kernel*" and not (process.command_line like "*create netprotection_network_filter*" and process.command_line like "*type= kernel start= *" and process.command_line like "*binPath= System32\\\\drivers\\\\netprotection_network_filter*" and process.command_line like "*DisplayName= netprotection_network_filter*" and process.command_line like "*group= PNP_TDI tag= yes*" or process.command_line like "*create avelam binpath=C:\\\\Windows\\\\system32\\\\drivers\\\\avelam.sys*" and process.command_line like "*type=kernel start=boot error=critical group=Early-Launch*")Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImage
False positives
- Rare legitimate installation of kernel drivers via sc.exe
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
Author and attribution
- Author
- Nasreddine Bencherchali (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_sc_new_kernel_driver.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2