T1036.005 — Match Legitimate Resource Name or Location

Tactic: Stealth · Platforms: Containers, ESXi, Linux, macOS, Windows

Adversaries may match or approximate the name or location of legitimate files, Registry keys, or other resources when naming/placing them. This is done for the sake of evading defenses and observation. This may be done by placing an executable in a commonly trusted directory (ex: under System32)…

Sub-technique of Masquerading (T1036).

Sigma detection rules (5)

T1036.005 Masquerading: Match Legitimate Resource Name or Location

title: "T1036.005 Masquerading: Match Legitimate Resource Name or Location"
id: af455bd6-1341-45ea-aa73-b9d2a28597f9
description: 'Detection Strategy for Masquerading via Legitimate Resource Name or Location. (Retargeted from the original process_creation label to file_event — this is the telemetry source that actually captures this technique''s behavior; see logsource below.) Tune using: trusted_directory_list, process_baseline_age.'
references:
  - https://attack.mitre.org/techniques/T1036/005
author: Shahrukh Khan
date: 2026-05-25
license: MIT
tags:
  - attack.stealth
  - attack.t1036.005

logsource:
  category: file_event
  product: windows
  service: sysmon

detection:
  selection:
    TargetFilename|endswith:
      - '\svchost.exe'
      - '\lsass.exe'
      - '\csrss.exe'

  filter_correct_path:
    TargetFilename|startswith:
      - 'C:\Windows\System32\'
      - 'C:\Windows\SysWOW64\'

  condition: selection and not filter_correct_path

falsepositives:
  - Rare — legitimate software should never write files matching these exact critical system-process names outside their expected system directories.

level: high

T1036.005 Masquerading: Match Legitimate Resource Name or Location

title: "T1036.005 Masquerading: Match Legitimate Resource Name or Location"
id: e9c33141-701d-4926-9bdf-5ed70ef44fbf
description: 'Detection Strategy for Masquerading via Legitimate Resource Name or Location. The original rule matched execve of genuine binaries at their own real canonical paths, making it tautological (it fired on all normal execution of systemd/sshd/bash). Fixed to require a trusted process name (comm) that does NOT correspond to that name''s known canonical exe path, which is the actual masquerading signature (e.g. malware naming its process "kworker" to blend in with kernel worker threads while its real executable lives outside kernel-thread territory). Tune using: monitored_paths, hash_validation_window.'
references:
  - https://attack.mitre.org/techniques/T1036/005
author: Shahrukh Khan
date: 2026-04-19
license: MIT
tags:
  - attack.stealth
  - attack.t1036.005

logsource:
  category: process_creation
  product: linux

detection:
  selection_trusted_name:
    type: SYSCALL
    syscall: execve
    comm:
      - 'systemd'
      - 'sshd'
      - 'bash'
      - 'kworker'
      - 'init'
    exe|exists: true
  filter_canonical_path:
    exe:
      - '/usr/bin/systemd'
      - '/usr/lib/systemd/systemd'
      - '/usr/sbin/sshd'
      - '/usr/bin/bash'
      - '/bin/bash'

  condition: selection_trusted_name and not filter_canonical_path

falsepositives:
  - Distributions that install these binaries under additional legitimate canonical paths (e.g. a distro-specific symlink location) must have those paths added to filter_canonical_path or this will over-fire; hash-based validation that the exe at a path is genuinely the legitimate binary is still not possible from auditd alone.

level: high

T1036.005 Masquerading: Match Legitimate Resource Name or Location

title: "T1036.005 Masquerading: Match Legitimate Resource Name or Location"
id: b8c95db7-224b-4181-9aef-14d28cb129dd
description: 'Detection Strategy for Masquerading via Legitimate Resource Name or Location. (Retargeted to the process_creation macOS unified-log telemetry that actually captures this techniques behavior; see logsource below.) Tune using: expected_bundle_names, signed_by_apple_check.'
references:
  - https://attack.mitre.org/techniques/T1036/005
author: Shahrukh Khan
date: 2026-05-13
license: MIT
tags:
  - attack.stealth
  - attack.t1036.005

logsource:
  category: process_creation
  product: macos

detection:
  selection:
    Image|re: '.*/(launchd|syslogd|mdworker|kernel_task)
    
  


  filter_expected:
    Image|startswith:
      - '/sbin/'
      - '/usr/sbin/'
      - '/System/Library/'
  condition: selection and not filter_expected

falsepositives:
  - None expected for genuinely renamed system-process binaries; misconfigured custom daemons using reserved names could rarely trigger this.

level: high

T1036.005 Masquerading: Match Legitimate Resource Name or Location

title: "T1036.005 Masquerading: Match Legitimate Resource Name or Location"
id: 21405684-72df-4d5f-b050-e477d2d903b0
description: 'Detection Strategy for Masquerading via Legitimate Resource Name or Location. (Data Component: Image Metadata; baseline tier: fallback.) Tune using: trusted_namespace_list, image_baseline_hashes.'
references:
  - https://attack.mitre.org/techniques/T1036/005
author: Shahrukh Khan
date: 2026-04-06
license: MIT
tags:
  - attack.stealth
  - attack.t1036.005

logsource:
  product: kubernetes
  service: apiserver

detection:
  selection:
    verb: 'create'
    objectRef.resource: 'pods'
    objectRef.namespace|contains: 'kube-system'
  filter_trusted_image:
    requestObject.spec.containers|contains: 'registry.k8s.io/'

  condition: selection and not filter_trusted_image

falsepositives:
  - System add-ons deployed from an internal mirror of the official registry that is not yet on the trusted list.

level: high

T1036.005 Masquerading: Match Legitimate Resource Name or Location

title: "T1036.005 Masquerading: Match Legitimate Resource Name or Location"
id: fc727f2a-7692-4ec6-bb27-f1f7e9148f14
description: 'Detection Strategy for Masquerading via Legitimate Resource Name or Location. (Retargeted to the process_creation ESXi telemetry that actually captures this techniques behavior; see logsource below.) Tune using: esxi_baseline_file_list, service_creation_alert_threshold.'
references:
  - https://attack.mitre.org/techniques/T1036/005
author: Shahrukh Khan
date: 2026-02-26
license: MIT
tags:
  - attack.stealth
  - attack.t1036.005

logsource:
  category: process_creation
  product: esxi
  service: shell

detection:
  selection:
    CommandLine|contains:
      - '/bin/hostd'
      - '/bin/vpxa'
  selection_path:
    CommandLine|contains: '/tmp/'

  condition: selection and selection_path

falsepositives:
  - None expected since legitimate hostd or vpxa binaries never execute from /tmp, though confidence is limited because shell.log only captures interactively invoked commands, not all process starts on the host.

level: high

Related sub-techniques

Explore