@@ -205,6 +205,7 @@ def on_complete(self):
205
205
206
206
return False
207
207
208
+
208
209
class AddWindowsDefenderExclusions (Signature ):
209
210
name = "add_windows_defender_exclusions"
210
211
description = "Attempts to add Windows Defender Exclusions for specific file types by extension"
@@ -213,8 +214,9 @@ class AddWindowsDefenderExclusions(Signature):
213
214
authors = ["@para0x0dise" ]
214
215
minimum = "1.2"
215
216
ttps = ["T1562.001" ]
216
- references = ["https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/windows/defense_evasion_windows_defender_exclusions_by_extension.toml" ,
217
- ]
217
+ references = [
218
+ "https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/windows/defense_evasion_windows_defender_exclusions_by_extension.toml" ,
219
+ ]
218
220
evented = True
219
221
220
222
filter_apinames = set (["RegSetValueExA" , "RegSetValueExW" , "NtSetValueKey" ])
@@ -228,14 +230,32 @@ def on_call(self, call, process):
228
230
regKeyPath = self .get_argument (call , "FullName" ).lower ()
229
231
valueName = self .get_argument (call , "ValueName" )
230
232
buf = self .get_argument (call , "Buffer" )
231
- if buf == '0' and ("software\\ policies\\ microsoft\\ windows defender\\ exclusions\\ extensions\\ " in regKeyPath and
232
- any (extension in valueName for extension in ("exe" , "pif" , "scr" , "js" , "vbs" ,
233
- "wsh" , "hta" , "cpl" , "jse" , "vbe" ,
234
- "bat" , "cmd" , "dll" , "ps1" ))):
233
+ if buf == "0" and (
234
+ "software\\ policies\\ microsoft\\ windows defender\\ exclusions\\ extensions\\ " in regKeyPath
235
+ and any (
236
+ extension in valueName
237
+ for extension in (
238
+ "exe" ,
239
+ "pif" ,
240
+ "scr" ,
241
+ "js" ,
242
+ "vbs" ,
243
+ "wsh" ,
244
+ "hta" ,
245
+ "cpl" ,
246
+ "jse" ,
247
+ "vbe" ,
248
+ "bat" ,
249
+ "cmd" ,
250
+ "dll" ,
251
+ "ps1" ,
252
+ )
253
+ )
254
+ ):
235
255
self .data .append ({"regkey" : regKeyPath })
236
256
self .detected = True
237
257
238
258
def on_complete (self ):
239
259
if self .detected :
240
260
return True
241
- return False
261
+ return False
0 commit comments