T1059.010 Elastic Security · Elastic

Detect AutoHotKey & AutoIT in Elastic Security

Adversaries may execute commands and perform malicious tasks using AutoIT and AutoHotKey automation scripts. AutoIT and AutoHotkey (AHK) are scripting languages that enable users to automate Windows tasks such as clicking buttons, entering text, and managing programs. Adversaries may use AHK (.ahk) and AutoIT (.au3) scripts to execute malicious code, deploy keyloggers, and deliver phishing payloads. These scripts can be compiled into self-contained executables. Threat actors including DarkGate, Lumma Stealer, APT39, and XLoader have leveraged AutoIT and AutoHotKey for malware delivery and execution.

MITRE ATT&CK

Tactic
Execution
Technique
T1059 Command and Scripting Interpreter
Sub-technique
T1059.010 AutoHotKey & AutoIT
Canonical reference
https://attack.mitre.org/techniques/T1059/010/

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by host.name with maxspan=5m
  [process where event.type == "start" and (
    process.name in~ ("AutoIt3.exe", "AutoHotkey.exe", "AutoHotkeyU64.exe", "AutoHotkeyU32.exe") or
    process.args : ("*.au3", "*.ahk") or
    process.command_line : ("*AutoIt*", "*AutoHotkey*", "*.au3*", "*.ahk*")
  )
  | eval is_autoit = process.name == "AutoIt3.exe" or process.command_line like "*.au3*"
  | eval is_ahk = process.name like "*AutoHotkey*" or process.command_line like "*.ahk*"
  | eval script_from_temp = process.command_line like "*\\Temp\\*" or process.command_line like "*AppData*" or process.command_line like "*%TEMP%*"
  | eval network_activity = process.command_line like "*URLDownloadToFile*" or process.command_line like "*_WinHttpSimpleRequest*" or process.command_line like "*Inet*"
  | eval key_logging = process.command_line like "*Hotkey,*" or process.command_line like "*SetKeyDelay,*" or process.command_line like "*SendInput,*"
  | eval dll_call = process.command_line like "*DllCall(*"
  ]
high severity high confidence

Detects execution of AutoIT (AutoIt3.exe) and AutoHotKey (AutoHotkey.exe) scripting engines along with suspicious command-line patterns indicating malicious use such as script execution from temp directories, network download functions, keylogging functions, and DLL calls. Covers MITRE ATT&CK T1059.010 as used by DarkGate, Lumma Stealer, APT39, and XLoader.

Data Sources

Elastic Endpoint SecurityWindows Event Logs via WinlogbeatSysmon via Winlogbeat

Required Tables

logs-endpoint.events.process-*winlogbeat-*

False Positives & Tuning

  • Legitimate IT automation scripts using AutoHotKey for keyboard remapping, window management, or productivity automation deployed by the IT department
  • AutoIT-based software installers or legitimate application automation tools used by helpdesk or operations teams
  • Software testing frameworks and QA automation pipelines that use AutoIT or AutoHotKey for GUI testing of Windows applications
Download portable Sigma rule (.yml)

Other platforms for T1059.010


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1AutoHotKey Script Execution

    Expected signal: Sysmon Event ID 1: Process Create for AutoHotkey.exe with .ahk file in CommandLine. Sysmon Event ID 11: File Create for the .ahk script in Temp directory.

  2. Test 2AutoIT Script Execution

    Expected signal: Sysmon Event ID 1: Process Create for AutoIt3.exe with .au3 file in CommandLine. Sysmon Event ID 11: File Create for the .au3 script in Temp directory.

  3. Test 3AutoIT Compiled Executable Detection

    Expected signal: Sysmon Event ID 1: PowerShell process creation. The script scans for compiled AutoIT executables by checking PE metadata.

Unlock Pro Content

Get the full detection package for T1059.010 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections