This rule detects the execution of AutoIt scripts, a lightweight automation tool frequently abused by adversaries to perform initial access, credential dumping, or lateral movement without the need for complex PowerShell or WMI commands. Proactively hunting for this behavior in Azure Sentinel allows the SOC team to identify stealthy script-based intrusions that may bypass standard binary execution detections, particularly in environments where AutoIt is not a standard part of the development or operations toolchain.
rule AutoIt
{
meta:
author = "_pusher_"
date = "2016-07"
description = "www.autoitscript.com/site/autoit/"
strings:
$aa0 = "AutoIt has detected the stack has become corrupt.\n\nStack corruption typically occurs when either the wrong calling convention is used or when the function is called with the wrong number of arguments.\n\nAutoIt supports the __stdcall (WINAPI) and __cdecl calling conventions. The __stdcall (WINAPI) convention is used by default but __cdecl can be used instead. See the DllCall() documentation for details on changing the calling convention." wide ascii nocase
$aa1 = "AutoIt Error" wide ascii nocase
$aa2 = "Missing right bracket ')' in expression." wide ascii nocase
$aa3 = "Missing operator in expression." wide ascii nocase
$aa4 = "Unbalanced brackets in expression." wide ascii nocase
$aa5 = "Error parsing function call." wide ascii nocase
$aa6 = ">>>AUTOIT NO CMDEXECUTE<<<" wide ascii nocase
$aa7 = "#requireadmin" wide ascii nocase
$aa8 = "#OnAutoItStartRegister" wide ascii nocase
$aa9 = "#notrayicon" wide ascii nocase
$aa10 = "Cannot parse #include" wide ascii nocase
condition:
5 of ($aa*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 11 string patterns in its detection logic.
www.autoitscript.com if the source process is a known legacy application executable (e.g., LegacyApp.exe, ERPClient.exe) or if the destination port is 443 and the user agent contains “AutoIt” or “Mozilla” from a non-browser process.CCMExec.exe, IntuneAgent.exe, wuauserv.exe) or if the source IP is within the designated build/imaging subnet.