T1218.009 Google Chronicle · YARA-L

Detect Regsvcs/Regasm in Google Chronicle

Adversaries may abuse Regsvcs and Regasm to proxy execution of code through trusted Windows utilities. Regsvcs and Regasm are Windows command-line utilities used to register .NET Component Object Model (COM) assemblies. Both are digitally signed by Microsoft. These utilities can bypass application control through use of attributes within the binary to specify code that should run before registration or unregistration: [ComRegisterFunction] or [ComUnregisterFunction] respectively. Critically, the code decorated with these attributes executes even if the process runs with insufficient privileges and fails. Agent Tesla is a notable malware family that uses Regasm.exe for proxy execution.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1218 System Binary Proxy Execution
Sub-technique
T1218.009 Regsvcs/Regasm
Canonical reference
https://attack.mitre.org/techniques/T1218/009/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule regsvcs_regasm_proxy_execution {
  meta:
    author = "Argus Detection Engineering"
    description = "Detects T1218.009 - Regsvcs/Regasm proxy execution abuse. Identifies regsvcs.exe or regasm.exe launched from suspicious parent processes, with suspicious arguments, from non-standard paths, or spawning suspicious child processes."
    mitre_attack_tactic = "Defense Evasion"
    mitre_attack_technique = "T1218.009"
    severity = "HIGH"
    confidence = "HIGH"
    rule_version = "1.0"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    $e.metadata.product_name = "Microsoft-Windows-Sysmon" or $e.metadata.product_name = "Microsoft Defender for Endpoint"
    (
      re.regex($e.target.process.file.full_path, `(?i)(\\regsvcs\.exe|\\regasm\.exe)$`) or
      re.regex($e.principal.process.file.full_path, `(?i)(\\regsvcs\.exe|\\regasm\.exe)$`)
    )
    (
      re.regex($e.target.process.command_line, `(?i)(Temp|AppData|Downloads|Public|Desktop|ProgramData)`) or
      re.regex($e.target.process.command_line, `(?i)(\/u|\/unregister|\/silent|\/s)\b`) or
      re.regex($e.target.process.command_line, `(?i)(http:\/\/|https:\/\/|\\\\\\\\)`) or
      re.regex($e.principal.process.file.full_path, `(?i)(cmd|powershell|wscript|cscript|mshta|winword|excel)\.exe$`) or
      (
        re.regex($e.principal.process.file.full_path, `(?i)(\\regsvcs\.exe|\\regasm\.exe)$`) and
        re.regex($e.target.process.file.full_path, `(?i)(cmd|powershell|wscript|cscript|net|rundll32)\.exe$`)
      )
    )

  condition:
    $e
}
high severity high confidence

Chronicle YARA-L 2.0 rule detecting Regsvcs/Regasm proxy execution. Uses UDM fields to match process launches where regsvcs.exe or regasm.exe is the target or principal process, combined with suspicious indicators: anomalous file paths, unregister/silent flags, remote URIs, suspicious parent processes, or suspicious children spawned by regsvcs/regasm.

Data Sources

Google Chronicle via Sysmon forwarderChronicle via Microsoft Defender for Endpoint integrationChronicle via Windows Event Log ingestion

Required Tables

UDM Events (PROCESS_LAUNCH)

False Positives & Tuning

  • Enterprise endpoint management platforms registering legitimate .NET COM components as part of scheduled software updates from the ProgramData staging path
  • Development or QA environments where PowerShell-based build scripts invoke regasm.exe to register test COM interop assemblies
  • Legitimate uninstallation procedures by helpdesk tools that use regsvcs.exe /u to deregister services before cleanup
Download portable Sigma rule (.yml)

Other platforms for T1218.009


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 1Regasm Execution from Temp Directory

    Expected signal: Sysmon Event ID 1: regasm.exe with /s flag and Temp path. Security Event ID 4688. Sysmon Event ID 7 for the DLL being loaded.

  2. Test 2Regasm with Unregister Flag

    Expected signal: Sysmon Event ID 1: regasm.exe with /u and /s flags, Temp path. Security Event ID 4688. The process will fail if the file does not exist but the process creation event fires.

  3. Test 3Regsvcs Launched from PowerShell

    Expected signal: Sysmon Event ID 1: powershell.exe then regsvcs.exe with ParentImage=powershell.exe. SuspiciousParent and SuspiciousPath both fire. Security Event ID 4688.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections