VeriKQL by Kaushik Saha

T1037 Boot or Logon Initialization Scripts

PersistencePrivilege Escalationon attack.mitre.org

ATT&CK Enterprise 20.0 · 20.1 released, update in review

How MITRE detects it

DET0112 Boot or Logon Initialization Scripts Detection Strategy

AN0311 Windows

Monitoring modification and execution of user or system logon scripts such as in registry Run keys or startup folders.

MITRE log sourceIn Microsoft Sentinel
WinEventLog:SecurityEventCode=4688
  • Windows Security Events via AMA → SecurityEvent
    SecurityEvent | where EventID in (4688)
  • Security Events via Legacy Agent → SecurityEvent
    SecurityEvent | where EventID in (4688)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Channel == "Security" | where EventID in (4688)

The same events land in SecurityEvent (Windows Security Events connectors) or WindowsEvent (Windows Event Forwarding); many built-in rules read SecurityEvent only.

WinEventLog:SecurityEventCode=4657
  • Windows Security Events via AMA → SecurityEvent
    SecurityEvent | where EventID in (4657)
  • Security Events via Legacy Agent → SecurityEvent
    SecurityEvent | where EventID in (4657)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Channel == "Security" | where EventID in (4657)

The same events land in SecurityEvent (Windows Security Events connectors) or WindowsEvent (Windows Event Forwarding); many built-in rules read SecurityEvent only.

WinEventLog:TaskSchedulerEventCode=106
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where EventLog in ("Microsoft-Windows-TaskScheduler/Operational") | where EventID in (106)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Channel in ("Microsoft-Windows-TaskScheduler/Operational") | where EventID in (106)

AN0312 Linux

Detection of changes or execution of shell initialization scripts like .bashrc, .profile, or /etc/profile for persistence.

MITRE log sourceIn Microsoft Sentinel
auditd:SYSCALLEXECVENot mapped to Sentinel yet.
auditd:PATHPATHNot mapped to Sentinel yet.
linux:osqueryfile_eventsNot mapped to Sentinel yet.

AN0313 macOS

Monitoring for modification and execution of login hook scripts or LaunchAgents/LaunchDaemons used for persistence.

MITRE log sourceIn Microsoft Sentinel
macos:unifiedloglogNot mapped to Sentinel yet.
fs:fsusagefileNot mapped to Sentinel yet.
macos:osquerylaunchdNot mapped to Sentinel yet.

AN0314 ESXi

Detection of modification to ESXi rc.local.d or rc scripts that are used to execute on boot.

MITRE log sourceIn Microsoft Sentinel
esxi:vmkernelbootNot mapped to Sentinel yet.
esxi:hostdbootNot mapped to Sentinel yet.

AN0315 Network Devices

Detection of changes to device startup-config files that include boot scripts or scheduled execution routines.

MITRE log sourceIn Microsoft Sentinel
networkdevice:syslogconfigNot mapped to Sentinel yet.

Content Hub rules tagged with it (3)

Rules tagged with this technique (or a sub-technique) in their metadata. Whether one fits your connectors is the coverage view (M2).

How the Content Hub rules for T1037 are built: their tables, filters, joins, schedules and windows.

In Sigma rules

4 SigmaHQ community rules name it or one of its sub-techniques in their tags.

Community rules, not Microsoft's, and not checked by VeriKQL (Sigma is not KQL). From SigmaHQ/sigma at f083329, under the Detection Rule License (DRL) 1.1; each rule is credited to its author.

Mitigations

Sub-techniques

MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.