← Back to SOC feed Coverage →

HTA Startup Persistence

kql MEDIUM Azure-Sentinel
DeviceFileEvents
huntingmicrosoftofficialpersistence
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-25T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use HTA files to establish persistence by placing them in startup folders, allowing malicious code to execute upon system boot. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect and mitigate potential long-term persistence mechanisms that could evade traditional detection methods.

KQL Query

DeviceFileEvents
| where FolderPath contains @"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\"
| where FileName endswith ".hta"

Analytic Rule Definition

id: 10d275ce-bb52-41b7-b67e-05b974ed1179
name: HTA Startup Persistence
description: |
  Use this query to locate persistence in Startup with HTA files.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceFileEvents
tactics:
- Ransomware
query: |
  DeviceFileEvents
  | where FolderPath contains @"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\"
  | where FileName endswith ".hta"

Required Data Sources

Sentinel TableNotes
DeviceFileEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Ransomware/HTA Startup Persistence.yaml