This rule detects the execution of legacy 32-bit assembly compilers like MASM or TASM, which adversaries may use to compile custom shellcode or low-level payloads that bypass standard language-based detections. Proactively hunting for these rare compiler invocations in Azure Sentinel helps identify stealthy post-exploitation activities where attackers attempt to minimize their footprint by avoiding common scripting or interpreted languages.
rule masm32_tasm32
{
meta:
author = "PEiD"
description = "MASM32 / TASM32"
group = "20"
function = "0"
strings:
$a0 = { 6A ?? E8 ?? ?? ?? ?? A3 }
condition:
$a0
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
.asm driver using ml.exe (MASM) or tasm.exe (TASM) to apply a hotfix for a specific firmware bug.
ml.exe or tasm.exe when the parent process is a known vendor support tool (e.g., vendor_support_tool.exe) or when the working directory contains specific vendor-specific artifacts (e.g., driver_hotfix_v2.1\)..asm files for SIMD optimizations, invoking ml.exe via a wrapper script.
ml.exe when the parent process is a build agent (e.g., jenkins-agent.exe, azure-devops-agent.exe) and the command line arguments include standard build flags (e.g., /c, /coff) or reference paths within the src\lib\asm\ directory structure.tasm.exe to reassemble a small utility module during a scheduled maintenance window to update a hardcoded configuration string.
tasm.exe when the parent process is the specific legacy application executable (e.g., legacy_inv_mgmt.exe) and the execution occurs during the defined maintenance window (e.g., Sunday 02:0