Detection rules › Elastic
Suspicious Scheduled Task Creation via Masqueraded XML File
Identifies the creation of a scheduled task using an XML file that does not have a .xml file extension. This behavior is consistent with an adversary attempting to establish persistence in a stealthy manner to evade detection.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Stealth |
Rule body
[rule]
description = """
Identifies the creation of a scheduled task using an XML file that does not have a .xml file extension. This behavior is
consistent with an adversary attempting to establish persistence in a stealthy manner to evade detection.
"""
id = "1efc0496-106b-4c09-b99b-91cdd17ba7b3"
license = "Elastic License v2"
name = "Suspicious Scheduled Task Creation via Masqueraded XML File"
os_list = ["windows"]
reference = ["https://docs.microsoft.com/en-us/windows/win32/taskschd/daily-trigger-example--xml-"]
version = "1.0.34"
query = '''
process where event.action == "start" and
process.pe.original_file_name : "schtasks.exe" and
process.args : ("/create", "-create") and
process.args : ("/xml", "-xml") and
not process.command_line : "*.xml*" and
not process.Ext.token.integrity_level_name == "system" and
not process.parent.executable :
("?:\\ProgramData\\OEM\\UpgradeTool\\CareCenter_*\\BUnzip\\Setup_msi.exe",
"?:\\Program Files\\Axis Communications\\AXIS Camera Station\\SetupActions.exe",
"?:\\Program Files\\Axis Communications\\AXIS Device Manager\\AdmSetupActions.exe",
"?:\\Program Files (x86)\\Zemana\\AntiMalware\\AntiMalware.exe",
"?:\\Program Files\\Dell\\SupportAssist\\pcdrcui.exe",
"?:\\Program Files\\Axis Communications\\AXIS Camera Station\\Installer*\\SetupActions.exe",
"?:\\Program Files (x86)\\Axis Communications\\AXIS Camera Station\\Installer*\\SetupActions.exe",
"?:\\Program Files\\WinCompose\\wincompose.exe") and
not (process.parent.name : "rundll32.exe" and process.parent.args : "?:\\WINDOWS\\Installer\\MSI*.tmp,zzzzInvokeManagedCustomActionOutOfProc")
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.pe.original_file_name : "schtasks.exe" and
process.args : ("/create", "-create") and
process.args : ("/xml", "-xml") and
not process.command_line : "*.xml*" and
not process.Ext.token.integrity_level_name == "system" and
not process.parent.executable :
("?:\\ProgramData\\OEM\\UpgradeTool\\CareCenter_*\\BUnzip\\Setup_msi.exe",
"?:\\Program Files\\Axis Communications\\AXIS Camera Station\\SetupActions.exe",
"?:\\Program Files\\Axis Communications\\AXIS Device Manager\\AdmSetupActions.exe",
"?:\\Program Files (x86)\\Zemana\\AntiMalware\\AntiMalware.exe",
"?:\\Program Files\\Dell\\SupportAssist\\pcdrcui.exe",
"?:\\Program Files\\Axis Communications\\AXIS Camera Station\\Installer*\\SetupActions.exe",
"?:\\Program Files (x86)\\Axis Communications\\AXIS Camera Station\\Installer*\\SetupActions.exe",
"?:\\Program Files\\WinCompose\\wincompose.exe") and
not (process.parent.name : "rundll32.exe" and process.parent.args : "?:\\WINDOWS\\Installer\\MSI*.tmp,zzzzInvokeManagedCustomActionOutOfProc")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | wildcard | ?:\WINDOWS\Installer\MSI*.tmp,zzzzInvokeManagedCustomActionOutOfProc | excludes:process.parent.args field:"process.parent.args" value:"?:\WINDOWS\Installer\MSI*.tmp,zzzzInvokeManagedCustomActionOutOfProc" |
process.parent.name | eq | rundll32.exe | excludes:process.parent.name field:"process.parent.name" value:"rundll32.exe" |
process.Ext.token.integrity_level_name | eq | system | excludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system" |
process.command_line | match | .xml | excludes:process.command_line field:"process.command_line" value:".xml" |
process.parent.executable | wildcard | ?:\ProgramData\OEM\UpgradeTool\CareCenter_*\BUnzip\Setup_msi.exe, ?:\Program Files\Axis Communications\AXIS Camera Station\SetupActions.exe, ?:\Program Files\Axis Communications\AXIS Device Manager\AdmSetupActions.exe, ?:\Program Files (x86)\Zemana\AntiMalware\AntiMalware.exe, ?:\Program Files\Dell\SupportAssist\pcdrcui.exe, ?:\Program Files\Axis Communications\AXIS Camera Station\Installer*\SetupActions.exe, ?:\Program Files (x86)\Axis Communications\AXIS Camera Station\Installer*\SetupActions.exe, ?:\Program Files\WinCompose\wincompose.exe | excludes:process.parent.executable |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"schtasks.exe" |