# OffSet7: New Kernel Driver Via SC.EXE

> Design for the QRadar Rule Wizard. Not an importable rule and not tested in QRadar.

- Rule type: Event rule (Local), create disabled
- 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).
- when **Process Path / Process Name** ends with: `\sc.exe`
- when **Command** contains: `create`, `config`
- when **Command** contains: `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.
- when **Command** contains: `create netprotection_network_filter`, `type= kernel start=`, `binPath= System32\drivers\netprotection_network_filter`, `DisplayName= netprotection_network_filter`, `group= PNP_TDI tag= yes`
- when **Command** contains: `create avelam binpath=C:\Windows\system32\drivers\avelam.sys`, `type=kernel start=boot error=critical group=Early-Launch`

## Main rule — option A (building blocks)

1. 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`
2. 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)

1. 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.

Source rule: New Kernel Driver Via SC.EXE (431a1fdb-4799-4f3b-91c3-a683b003fc49). Author: Nasreddine Bencherchali (Nextron Systems). Licence: DRL-1.1.
