# OffSet7: Powershell Defender Disable Scan Feature

> 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:Powershell Defender Disable Scan Feature:selection_cli_cmdlet (match)
All test lines must match (AND).
- when **Command** contains: `Add-MpPreference`, `Set-MpPreference`

### BB:OffSet7:Powershell Defender Disable Scan Feature:selection_cli_option (match)
All test lines must match (AND).
- when **Command** contains: `DisableArchiveScanning`, `DisableRealtimeMonitoring`, `DisableIOAVProtection`, `DisableBehaviorMonitoring`, `DisableBlockAtFirstSeen`, `DisableCatchupFullScan`, `DisableCatchupQuickScan`

### BB:OffSet7:Powershell Defender Disable Scan Feature:selection_cli_value (match)
All test lines must match (AND).
- when **Command** contains: `$true`, ` 1`

### BB:OffSet7:Powershell Defender Disable Scan Feature:selection_encoded_modifier (match)
All test lines must match (AND).
- when **Command** contains: `disablearchivescanning`, `DisableArchiveScanning`, `disablebehaviormonitoring`, `DisableBehaviorMonitoring`, `disableblockatfirstseen`, `DisableBlockAtFirstSeen`, `disablecatchupfullscan`, `DisableCatchupFullScan`, `disablecatchupquickscan`, `DisableCatchupQuickScan`, `disableioavprotection`, `DisableIOAVProtection`, `disablerealtimemonitoring`, `DisableRealtimeMonitoring`

### BB:OffSet7:Powershell Defender Disable Scan Feature:selection_encoded_direct (match)
All test lines must match (AND).
- when **Command** contains: `RABpAHMAYQBiAGwAZQBSAGUAYQBsAHQAaQBtAGUATQBvAG4AaQB0AG8AcgBpAG4AZwAgA`, `QAaQBzAGEAYgBsAGUAUgBlAGEAbAB0AGkAbQBlAE0AbwBuAGkAdABvAHIAaQBuAGcAIA`, `EAGkAcwBhAGIAbABlAFIAZQBhAGwAdABpAG0AZQBNAG8AbgBpAHQAbwByAGkAbgBnACAA`, `RABpAHMAYQBiAGwAZQBJAE8AQQBWAFAAcgBvAHQAZQBjAHQAaQBvA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GkAdABvAHIAaQBuAGcAIA`, `kAGkAcwBhAGIAbABlAGIAZQBoAGEAdgBpAG8AcgBtAG8AbgBpAHQAbwByAGkAbgBnACAA`, `ZABpAHMAYQBiAGwAZQBiAGwAbwBjAGsAYQB0AGYAaQByAHMAdABzAGUAZQBuACAA`, `QAaQBzAGEAYgBsAGUAYgBsAG8AYwBrAGEAdABmAGkAcgBzAHQAcwBlAGUAbgAgA`, `kAGkAcwBhAGIAbABlAGIAbABvAGMAawBhAHQAZgBpAHIAcwB0AHMAZQBlAG4AIA`, `RABpAHMAYQBiAGwAZQBDAGEAdABjAGgAdQBwAEYAdQBsAGwAUwBjAGEAbgA`, `RABpAHMAYQBiAGwAZQBDAGEAdABjAGgAdQBwAFEAdQBpAGMAawBTAGMAYQBuAA`, `RABpAHMAYQBiAGwAZQBBAHIAYwBoAGkAdgBlAFMAYwBhAG4AbgBpAG4AZwA`

## 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: `(ALL of [BB:OffSet7:Powershell Defender Disable Scan Feature:selection_cli_cmdlet, BB:OffSet7:Powershell Defender Disable Scan Feature:selection_cli_option, BB:OffSet7:Powershell Defender Disable Scan Feature:selection_cli_value]) OR (ANY of [BB:OffSet7:Powershell Defender Disable Scan Feature:selection_encoded_modifier, BB:OffSet7:Powershell Defender Disable Scan Feature:selection_encoded_direct])`

## Main rule — option B (AQL filter test)

1. when the event matches this AQL filter query: `devicetype=12 AND (((LOWER(Command) LIKE '%add-mppreference %' OR LOWER(Command) LIKE '%set-mppreference %') AND (LOWER(Command) LIKE '%disablearchivescanning %' OR LOWER(Command) LIKE '%disablerealtimemonitoring %' OR LOWER(Command) LIKE '%disableioavprotection %' OR LOWER(Command) LIKE '%disablebehaviormonitoring %' OR LOWER(Command) LIKE '%disableblockatfirstseen %' OR LOWER(Command) LIKE '%disablecatchupfullscan %' OR LOWER(Command) LIKE '%disablecatchupquickscan %') AND (LOWER(Command) LIKE '%$true%' OR LOWER(Command) LIKE '% 1 %')) OR ((LOWER(Command) LIKE '%zglzywjszwfyy2hpdmvzy2fubmluzy%' OR LOWER(Command) LIKE '%rpc2fibgvhcmnoaxzlc2nhbm5pbmcg%' OR LOWER(Command) LIKE '%kaxnhymxlyxjjagl2zxnjyw5uaw5ni%' OR LOWER(Command) LIKE '%rglzywjszufyy2hpdmvty2fubmluzy%' OR LOWER(Command) LIKE '%rpc2fibgvbcmnoaxzlu2nhbm5pbmcg%' OR LOWER(Command) LIKE '%eaxnhymxlqxjjagl2zvnjyw5uaw5ni%' OR LOWER(Command) LIKE '%zglzywjszwjlagf2aw9ybw9uaxrvcmluzy%' OR LOWER(Command) LIKE '%rpc2fibgvizwhhdmlvcm1vbml0b3jpbmcg%' OR LOWER(Command) LIKE '%kaxnhymxlymvoyxzpb3jtb25pdg9yaw5ni%' OR LOWER(Command) LIKE '%rglzywjszujlagf2aw9ytw9uaxrvcmluzy%' OR LOWER(Command) LIKE '%rpc2fibgvczwhhdmlvck1vbml0b3jpbmcg%' OR LOWER(Command) LIKE '%eaxnhymxlqmvoyxzpb3jnb25pdg9yaw5ni%' OR LOWER(Command) LIKE '%zglzywjszwjsb2nryxrmaxjzdhnlzw4g%' OR LOWER(Command) LIKE '%rpc2fibgvibg9ja2f0zmlyc3rzzwvui%' OR LOWER(Command) LIKE '%kaxnhymxlymxvy2thdgzpcnn0c2vlbi%' OR LOWER(Command) LIKE '%rglzywjszujsb2nrqxrgaxjzdfnlzw4g%' OR LOWER(Command) LIKE '%rpc2fibgvcbg9ja0f0rmlyc3rtzwvui%' OR LOWER(Command) LIKE '%eaxnhymxlqmxvy2tbdezpcnn0u2vlbi%' OR LOWER(Command) LIKE '%zglzywjszwnhdgnodxbmdwxsc2nhbi%' OR LOWER(Command) LIKE '%rpc2fibgvjyxrjahvwznvsbhnjyw4g%' OR LOWER(Command) LIKE '%kaxnhymxly2f0y2h1cgz1bgxzy2fui%' OR LOWER(Command) LIKE '%rglzywjszunhdgnodxbgdwxsu2nhbi%' OR LOWER(Command) LIKE '%rpc2fibgvdyxrjahvwrnvsbfnjyw4g%' OR LOWER(Command) LIKE '%eaxnhymxlq2f0y2h1cez1bgxty2fui%' OR LOWER(Command) LIKE '%zglzywjszwnhdgnodxbxdwlja3njyw4g%' OR LOWER(Command) LIKE '%rpc2fibgvjyxrjahvwcxvpy2tzy2fui%' OR LOWER(Command) LIKE '%kaxnhymxly2f0y2h1chf1awnrc2nhbi%' OR LOWER(Command) LIKE '%rglzywjszunhdgnodxbrdwlja1njyw4g%' OR LOWER(Command) LIKE '%rpc2fibgvdyxrjahvwuxvpy2tty2fui%' OR LOWER(Command) LIKE '%eaxnhymxlq2f0y2h1cff1awnru2nhbi%' OR LOWER(Command) LIKE '%zglzywjszwlvyxzwcm90zwn0aw9ui%' OR LOWER(Command) LIKE '%rpc2fibgvpb2f2chjvdgvjdglvbi%' OR LOWER(Command) LIKE '%kaxnhymxlaw9hdnbyb3rly3rpb24g%' OR LOWER(Command) LIKE '%rglzywjszulpqvzqcm90zwn0aw9ui%' OR LOWER(Command) LIKE '%rpc2fibgvjt0fwuhjvdgvjdglvbi%' OR LOWER(Command) LIKE '%eaxnhymxlsu9bvlbyb3rly3rpb24g%' OR LOWER(Command) LIKE '%zglzywjszxjlywx0aw1lbw9uaxrvcmluzy%' OR LOWER(Command) LIKE '%rpc2fibgvyzwfsdgltzw1vbml0b3jpbmcg%' OR LOWER(Command) LIKE '%kaxnhymxlcmvhbhrpbwvtb25pdg9yaw5ni%' OR LOWER(Command) LIKE '%rglzywjszvjlywx0aw1ltw9uaxrvcmluzy%' OR LOWER(Command) LIKE '%rpc2fibgvszwfsdgltzu1vbml0b3jpbmcg%' OR LOWER(Command) LIKE '%eaxnhymxlumvhbhrpbwvnb25pdg9yaw5ni%') OR (LOWER(Command) LIKE '%rabpahmayqbiagwazqbsaguayqbsahqaaqbtaguatqbvag4aaqb0ag8acgbpag4azwaga%' OR LOWER(Command) LIKE '%qaaqbzageaygbsaguaugblageabab0agkabqblae0abwbuagkadabvahiaaqbuagcaia%' OR LOWER(Command) LIKE '%eagkacwbhagiabablafiazqbhagwadabpag0azqbnag8abgbpahqabwbyagkabgbnacaa%' OR LOWER(Command) LIKE '%rabpahmayqbiagwazqbjae8aqqbwafaacgbvahqazqbjahqaaqbvag4aia%' OR LOWER(Command) LIKE '%qaaqbzageaygbsaguasqbpaeeavgbqahiabwb0aguaywb0agkabwbuacaa%' OR LOWER(Command) LIKE '%eagkacwbhagiabablaekatwbbafyauabyag8adablagmadabpag8abgaga%' OR LOWER(Command) LIKE '%rabpahmayqbiagwazqbcaguaaabhahyaaqbvahiatqbvag4aaqb0ag8acgbpag4azwaga%' OR LOWER(Command) LIKE '%qaaqbzageaygbsaguaqgblaggayqb2agkabwbyae0abwbuagkadabvahiaaqbuagcaia%' OR LOWER(Command) LIKE '%eagkacwbhagiabablaeiazqboageadgbpag8acgbnag8abgbpahqabwbyagkabgbnacaa%' OR LOWER(Command) LIKE '%rabpahmayqbiagwazqbcagwabwbjagsaqqb0aeyaaqbyahmadabtaguazqbuacaa%' OR LOWER(Command) LIKE '%qaaqb`

## Rule response

- Severity 7, 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: Powershell Defender Disable Scan Feature (1ec65a5f-9473-4f12-97da-622044d6df21). Author: Florian Roth (Nextron Systems). Licence: DRL-1.1.
