Scheduled Tasks AT Command Enabled

Identifies attempts to enable the Windows scheduled tasks AT command via the registry. Attackers may use this method to move laterally or persist locally. The AT command has been deprecated since Windows 8 and Windows Server 2012, but still exists for backwards compatibility.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/11/23"
  3integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
  4maturity = "production"
  5updated_date = "2025/01/15"
  6min_stack_version = "8.14.0"
  7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies attempts to enable the Windows scheduled tasks AT command via the registry. Attackers may use this method to
 13move laterally or persist locally. The AT command has been deprecated since Windows 8 and Windows Server 2012, but still
 14exists for backwards compatibility.
 15"""
 16from = "now-9m"
 17index = ["winlogbeat-*", "logs-endpoint.events.registry-*", "logs-windows.sysmon_operational-*", "endgame-*", "logs-m365_defender.event-*", "logs-sentinel_one_cloud_funnel.*"]
 18language = "eql"
 19license = "Elastic License v2"
 20name = "Scheduled Tasks AT Command Enabled"
 21references = ["https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-scheduledjob"]
 22risk_score = 47
 23rule_id = "9aa0e1f6-52ce-42e1-abb3-09657cee2698"
 24severity = "medium"
 25tags = [
 26    "Domain: Endpoint",
 27    "OS: Windows",
 28    "Use Case: Threat Detection",
 29    "Tactic: Defense Evasion",
 30    "Tactic: Execution",
 31    "Data Source: Elastic Endgame",
 32    "Data Source: Elastic Defend",
 33    "Data Source: Sysmon",
 34    "Data Source: Microsoft Defender for Endpoint",
 35    "Data Source: SentinelOne",
 36    "Resources: Investigation Guide",
 37]
 38timestamp_override = "event.ingested"
 39type = "eql"
 40
 41query = '''
 42registry where host.os.type == "windows" and event.type == "change" and
 43  registry.path : (
 44    "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\Configuration\\EnableAt",
 45    "\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\Configuration\\EnableAt",
 46    "MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\Configuration\\EnableAt"
 47  ) and registry.data.strings : ("1", "0x00000001")
 48'''
 49note = """## Triage and analysis
 50
 51> **Disclaimer**:
 52> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
 53
 54### Investigating Scheduled Tasks AT Command Enabled
 55
 56The AT command, a legacy Windows utility, schedules tasks for execution, often used for automation. Despite its deprecation post-Windows 8, it remains for compatibility, posing a security risk. Attackers exploit it to maintain persistence or move laterally. The detection rule monitors registry changes enabling this command, flagging potential misuse by checking specific registry paths and values indicative of enabling the AT command.
 57
 58### Possible investigation steps
 59
 60- Review the registry event logs to confirm the change in the registry path "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\Configuration\\EnableAt" and verify if the value was set to "1" or "0x00000001".
 61- Identify the user account and process responsible for the registry change by examining the event logs for associated user and process information.
 62- Check for any scheduled tasks created or modified around the time of the registry change to determine if the AT command was used to schedule any tasks.
 63- Investigate the system for any signs of lateral movement or persistence mechanisms that may have been established using the AT command.
 64- Correlate the event with other security alerts or logs from data sources like Elastic Endgame, Elastic Defend, Sysmon, Microsoft Defender for Endpoint, or SentinelOne to gather additional context and assess the scope of potential malicious activity.
 65
 66### False positive analysis
 67
 68- System administrators or IT management tools may enable the AT command for legacy support or compatibility testing. Verify if the change aligns with scheduled maintenance or updates.
 69- Some enterprise environments might have legacy applications that rely on the AT command for task scheduling. Confirm with application owners if such dependencies exist and document them.
 70- Security software or monitoring tools might trigger registry changes as part of their normal operation. Cross-reference with logs from these tools to ensure the change is benign.
 71- If a specific user or system frequently triggers this alert without malicious intent, consider creating an exception for that user or system in your monitoring solution to reduce noise.
 72- Regularly review and update the list of exceptions to ensure they remain relevant and do not inadvertently allow malicious activity.
 73
 74### Response and remediation
 75
 76- Immediately isolate the affected system from the network to prevent further lateral movement or persistence by the attacker.
 77- Review the registry changes identified in the alert to confirm unauthorized enabling of the AT command. Revert the registry setting to its secure state by setting the value to "0" or "0x00000000".
 78- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious software or scripts.
 79- Investigate user accounts and permissions on the affected system to ensure no unauthorized accounts or privilege escalations have occurred. Reset passwords for any compromised accounts.
 80- Monitor network traffic and logs for any signs of data exfiltration or communication with known malicious IP addresses or domains.
 81- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
 82- Implement enhanced monitoring and alerting for similar registry changes across the network to detect and respond to future attempts promptly."""
 83
 84
 85[[rule.threat]]
 86framework = "MITRE ATT&CK"
 87[[rule.threat.technique]]
 88id = "T1562"
 89name = "Impair Defenses"
 90reference = "https://attack.mitre.org/techniques/T1562/"
 91[[rule.threat.technique.subtechnique]]
 92id = "T1562.001"
 93name = "Disable or Modify Tools"
 94reference = "https://attack.mitre.org/techniques/T1562/001/"
 95
 96
 97
 98[rule.threat.tactic]
 99id = "TA0005"
100name = "Defense Evasion"
101reference = "https://attack.mitre.org/tactics/TA0005/"
102[[rule.threat]]
103framework = "MITRE ATT&CK"
104[[rule.threat.technique]]
105id = "T1053"
106name = "Scheduled Task/Job"
107reference = "https://attack.mitre.org/techniques/T1053/"
108[[rule.threat.technique.subtechnique]]
109id = "T1053.002"
110name = "At"
111reference = "https://attack.mitre.org/techniques/T1053/002/"
112
113
114
115[rule.threat.tactic]
116id = "TA0002"
117name = "Execution"
118reference = "https://attack.mitre.org/tactics/TA0002/"

Triage and analysis

Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

Investigating Scheduled Tasks AT Command Enabled

The AT command, a legacy Windows utility, schedules tasks for execution, often used for automation. Despite its deprecation post-Windows 8, it remains for compatibility, posing a security risk. Attackers exploit it to maintain persistence or move laterally. The detection rule monitors registry changes enabling this command, flagging potential misuse by checking specific registry paths and values indicative of enabling the AT command.

Possible investigation steps

  • Review the registry event logs to confirm the change in the registry path "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Configuration\EnableAt" and verify if the value was set to "1" or "0x00000001".
  • Identify the user account and process responsible for the registry change by examining the event logs for associated user and process information.
  • Check for any scheduled tasks created or modified around the time of the registry change to determine if the AT command was used to schedule any tasks.
  • Investigate the system for any signs of lateral movement or persistence mechanisms that may have been established using the AT command.
  • Correlate the event with other security alerts or logs from data sources like Elastic Endgame, Elastic Defend, Sysmon, Microsoft Defender for Endpoint, or SentinelOne to gather additional context and assess the scope of potential malicious activity.

False positive analysis

  • System administrators or IT management tools may enable the AT command for legacy support or compatibility testing. Verify if the change aligns with scheduled maintenance or updates.
  • Some enterprise environments might have legacy applications that rely on the AT command for task scheduling. Confirm with application owners if such dependencies exist and document them.
  • Security software or monitoring tools might trigger registry changes as part of their normal operation. Cross-reference with logs from these tools to ensure the change is benign.
  • If a specific user or system frequently triggers this alert without malicious intent, consider creating an exception for that user or system in your monitoring solution to reduce noise.
  • Regularly review and update the list of exceptions to ensure they remain relevant and do not inadvertently allow malicious activity.

Response and remediation

  • Immediately isolate the affected system from the network to prevent further lateral movement or persistence by the attacker.
  • Review the registry changes identified in the alert to confirm unauthorized enabling of the AT command. Revert the registry setting to its secure state by setting the value to "0" or "0x00000000".
  • Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious software or scripts.
  • Investigate user accounts and permissions on the affected system to ensure no unauthorized accounts or privilege escalations have occurred. Reset passwords for any compromised accounts.
  • Monitor network traffic and logs for any signs of data exfiltration or communication with known malicious IP addresses or domains.
  • Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
  • Implement enhanced monitoring and alerting for similar registry changes across the network to detect and respond to future attempts promptly.

References

Related rules

to-top