T1059.010
AutoHotKey & AutoIT
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.
Microsoft Sentinel / Defender
kusto
let AutoITPatterns = dynamic([
"AutoIt3.exe", "AutoIt", ".au3",
"#include <Inet.au3>", "#include <File.au3>",
"ShellExecute(", "RunWait(", "Run(",
"FileInstall(", "DllCall(", "_WinHttpSimpleRequest",
"ProcessClose(", "RegWrite(", "RegRead(",
"@ScriptDir", "@TempDir", "@AppDataDir"
]);
let AHKPatterns = dynamic([
"AutoHotkey.exe", "AutoHotkey", ".ahk",
"Send,", "SendInput,", "SendRaw,",
"RunWait,", "Run,", "WinActivate,",
"FileAppend,", "URLDownloadToFile,",
"DllCall(", "RegWrite,", "RegRead,",
"Hotkey,", "SetKeyDelay,"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("AutoIt3.exe", "AutoHotkey.exe", "AutoHotkeyU64.exe", "AutoHotkeyU32.exe")
or ProcessCommandLine has_any (AutoITPatterns)
or ProcessCommandLine has_any (AHKPatterns)
| extend IsAutoIT = FileName =~ "AutoIt3.exe" or ProcessCommandLine has ".au3"
| extend IsAHK = FileName has "AutoHotkey" or ProcessCommandLine has ".ahk"
| extend ScriptFromTemp = ProcessCommandLine has_any ("\\Temp\\", "\\tmp\\", "%TEMP%", "AppData")
| extend NetworkActivity = ProcessCommandLine has_any ("URLDownloadToFile", "_WinHttpSimpleRequest", "Inet")
| extend KeyLogging = ProcessCommandLine has_any ("Hotkey,", "SetKeyDelay,", "Send,", "SendInput,")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
IsAutoIT, IsAHK, ScriptFromTemp, NetworkActivity, KeyLogging
| sort by Timestamp desc medium severity
medium confidence
Data Sources
Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint
Required Tables
DeviceProcessEvents
False Positives
- IT departments using AutoIT for legitimate desktop automation and software deployment scripts
- AutoHotKey users with custom keyboard shortcuts and text expansion macros
- Software testing teams using AutoIT for GUI test automation
Last updated: 2026-04-16 Research depth: deep
References (5)
- https://attack.mitre.org/techniques/T1059/010/
- https://www.splunk.com/en_us/blog/security/enter-the-gates-an-analysis-of-the-darkgate-autoit-loader.html
- https://www.autoitscript.com/autoit3/docs/intro/running.htm
- https://www.autohotkey.com/docs/v1/Program.htm
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1059.010/T1059.010.md
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