Detection rules › Elastic

Suspicious Impersonation as Trusted Installer

Source
github.com/elastic/protections-artifacts

Identifies actions performed by a process with an impersonation security token running as the Windows Trusted Installer service. Adversaries may need to impersonate this service to modify certain system protected resources.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies actions performed by a process with an impersonation security token running as the Windows Trusted Installer
service. Adversaries may need to impersonate this service to modify certain system protected resources.
"""
id = "cc35ee3e-d350-4319-b7f3-ea0d991ce4d9"
license = "Elastic License v2"
name = "Suspicious Impersonation as Trusted Installer"
os_list = ["windows"]
reference = ["https://www.tiraniddo.dev/2017/08/the-art-of-becoming-trustedinstaller.html"]
version = "1.0.37"

query = '''
any where process.executable != null and 
 (
  /* file or registry events */
  (Effective_process.name : "TrustedInstaller.exe" and not event.action in ("query", "open") and  
   not (process.executable : "?:\\Windows\\system32\\svchost.exe" and 
        file.path : ("?:\\windows\\system32\\config\\systemprofile\\*",
                     "?:\\ProgramData\\Malwarebytes Endpoint Agent\\Plugins\\EDRPlugin\\Backup\\*.frb")) and
   not (process.executable : "?:\\Program Files\\ProfileUnity\\FlexApp\\ContainerService\\x64\\VirtFsService.exe" and
        process.code_signature.subject_name : "Liquidware Labs, Inc." and process.code_signature.trusted == true) and
   not (process.executable : "?:\\Windows\\System32\\services.exe" and file.path : "?:\\Windows\\INF\\*.PNF") and
   not (process.executable : "?:\\Windows\\System32\\services.exe" and
        registry.path : "HKEY_USERS\\.DEFAULT\\Software\\Classes\\Local Settings\\MuiCache\\*") and
   not (process.executable : "?:\\Windows\\system32\\svchost.exe" and 
        registry.path : 
	        ("HKLM\\SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\*", 
		     "HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\*"))) or

  /* process events */
  (process.Ext.effective_parent.name : "TrustedInstaller.exe" and
   process.parent.name != null and process.hash.sha256 != null and
   not (process.executable :
               ("?:\\Windows\\WinSxS\\*\\TiWorker.exe",
                "\\Device\\HarddiskVolume*\\Windows\\WinSxS\\*\\TiWorker.exe",
                "\\Device\\VhdHardDisk*\\Windows\\WinSxS\\*\\TiWorker.exe",
                "\\\\?\\Volume{*}\\Windows\\WinSxS\\*\\TiWorker.exe") and
         process.parent.executable : 
	            ("?:\\Windows\\System32\\svchost.exe",
	             "\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe",
	             "\\Device\\VhdHardDisk*\\Windows\\System32\\svchost.exe",
	             "\\\\?\\Volume{*}\\Windows\\System32\\svchost.exe")) and

   not (process.executable :
                ("?:\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "C:\\Windows\\SystemTemp\\ScreenConnect\\*\\Temp\\SecurityHealthSetup.exe",
                 "\\Device\\HarddiskVolume*\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "\\Device\\VhdHardDisk*\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "\\\\?\\Volume{*}\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiWorker.exe") and
         process.code_signature.subject_name in ("Microsoft Windows Publisher", "Microsoft Corporation", "Microsoft Windows") and process.code_signature.trusted == true) and
		 
   not (process.executable : 
               ("?:\\Windows\\System32\\WerFault.exe", 
                "\\Device\\HarddiskVolume*\\Windows\\System32\\WerFault.exe", 
                "\\Device\\VhdHardDisk*\\Windows\\System32\\WerFault.exe", 
                "\\\\?\\Volume{*}\\Windows\\System32\\WerFault.exe") and 
        process.parent.executable : 
                ("?:\\Windows\\servicing\\TrustedInstaller.exe", 
                 "\\Device\\HarddiskVolume*\\Windows\\servicing\\TrustedInstaller.exe",  
                 "\\Device\\VhdHardDisk*\\Windows\\servicing\\TrustedInstaller.exe", 
                 "\\\\?\\Volume{*}\\Windows\\servicing\\TrustedInstaller.exe",
                 "?:\\WINDOWS\\System32\\svchost.exe")))
) and 
   not (process.executable : ("?:\\Program Files (x86)\\Panda Security\\*.exe", "?:\\Program Files\\Panda Security\\*.exe") and
        process.code_signature.trusted == true and process.code_signature.subject_name : "Panda Security S.L.") and

   not process.hash.sha256 in
                 ("1e07a7a91451303d5cdac0a1673d581f5f7198fcc08fc79e4332aba6400f55a8",
                  "f14ea2efbbf0298963f8a574d6b139616ce6bb1e8ab97848d73312c4184b3812") and

   not (process.executable : "?:\\Windows\\System32\\services.exe" and
        registry.path : "HKEY_USERS\\.DEFAULT\\Software\\Classes\\Local Settings\\MuiCache\\*") and

   not (process.parent.executable : "?:\\Program Files\\ProfileUnity\\FlexApp\\ContainerService\\x64\\VirtFsService.exe" and
        process.executable : "?:\\Program Files\\ProfileUnity\\FlexApp\\ContainerService\\x64\\Sentinel\\LwIoSentinel.exe") and

   not (process.executable : "?:\\Program Files (x86)\\Kaspersky Lab\\*.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "Kaspersky Lab JSC") and

   not (process.executable : "?:\\Windows\\System32\\btservice.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "BeyondTrust Software, Inc") and

   not (process.executable : "?:\\Program Files\\Common Files\\McAfee\\AVSolution\\mcshield.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "MUSARUBRA US LLC") and

   not (process.executable : ("?:\\Program Files (x86)\\xagt\\xagt.exe", "?:\\Program Files (x86)\\FireEye\\xagt\\xagt.exe") and
        process.code_signature.trusted == true and process.code_signature.subject_name in ("FireEye, Inc.", "FireEye (Musarubra US LLC)")) and

  not (process.executable : "C:\\Program Files (x86)\\Panda Security\\WAC\\PSANHost.exe" and
       process.code_signature.trusted == true and process.code_signature.subject_name == "Panda Security S.L.") and

  not (process.executable : "C:\\Windows\\SoftwareDistribution\\Download\\Install\\SecurityHealthSetup.exe" and
       process.parent.executable : "C:\\Windows\\SoftwareDistribution\\Download\\Install\\SecurityHealthSetup.exe") and

  not (process.executable : "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiFileFetcher.exe" and
       process.parent.executable : "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiWorker.exe" and
       process.code_signature.subject_name == "Microsoft Windows" and process.code_signature.trusted == true) and
	   
  not (process.executable : "C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfswp.exe" and
      process.code_signature.subject_name == "Kaspersky Lab JSC" and process.code_signature.trusted == true) and
  not (process.name : "rundll32.exe" and process.args : "C:\\WINDOWS\\system32\\davclnt.dll,DavSetCookie" and
       process.parent.executable : "C:\\Windows\\System32\\svchost.exe") and
  not (process.pe.original_file_name == "SecurityHealthSetup.exe" and process.code_signature.trusted == true and
      process.code_signature.subject_name == "Microsoft Windows" and process.Ext.effective_parent.executable : "C:\\Windows\\servicing\\TrustedInstaller.exe") and
  not (event.action == "deletion" and process.executable : "C:\\Windows\\System32\\svchost.exe" and file.path : "C:\\Windows\\Logs\\SRP\\SRP.log")
'''

min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[[threat.technique.subtechnique]]
id = "T1134.001"
name = "Token Impersonation/Theft"
reference = "https://attack.mitre.org/techniques/T1134/001/"

[[threat.technique.subtechnique]]
id = "T1134.002"
name = "Create Process with Token"
reference = "https://attack.mitre.org/techniques/T1134/002/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: any

any where process.executable != null and
 (
  (Effective_process.name : "TrustedInstaller.exe" and not event.action in ("query", "open") and
   not (process.executable : "?:\\Windows\\system32\\svchost.exe" and
        file.path : ("?:\\windows\\system32\\config\\systemprofile\\*",
                     "?:\\ProgramData\\Malwarebytes Endpoint Agent\\Plugins\\EDRPlugin\\Backup\\*.frb")) and
   not (process.executable : "?:\\Program Files\\ProfileUnity\\FlexApp\\ContainerService\\x64\\VirtFsService.exe" and
        process.code_signature.subject_name : "Liquidware Labs, Inc." and process.code_signature.trusted == true) and
   not (process.executable : "?:\\Windows\\System32\\services.exe" and file.path : "?:\\Windows\\INF\\*.PNF") and
   not (process.executable : "?:\\Windows\\System32\\services.exe" and
        registry.path : "HKEY_USERS\\.DEFAULT\\Software\\Classes\\Local Settings\\MuiCache\\*") and
   not (process.executable : "?:\\Windows\\system32\\svchost.exe" and
        registry.path :
	        ("HKLM\\SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\*",
		     "HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\*"))) or
  (process.Ext.effective_parent.name : "TrustedInstaller.exe" and
   process.parent.name != null and process.hash.sha256 != null and
   not (process.executable :
               ("?:\\Windows\\WinSxS\\*\\TiWorker.exe",
                "\\Device\\HarddiskVolume*\\Windows\\WinSxS\\*\\TiWorker.exe",
                "\\Device\\VhdHardDisk*\\Windows\\WinSxS\\*\\TiWorker.exe",
                "\\\\?\\Volume{*}\\Windows\\WinSxS\\*\\TiWorker.exe") and
         process.parent.executable :
	            ("?:\\Windows\\System32\\svchost.exe",
	             "\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe",
	             "\\Device\\VhdHardDisk*\\Windows\\System32\\svchost.exe",
	             "\\\\?\\Volume{*}\\Windows\\System32\\svchost.exe")) and
   not (process.executable :
                ("?:\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "C:\\Windows\\SystemTemp\\ScreenConnect\\*\\Temp\\SecurityHealthSetup.exe",
                 "\\Device\\HarddiskVolume*\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "\\Device\\VhdHardDisk*\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "\\\\?\\Volume{*}\\Windows\\SoftwareDistribution\\Download\\Install\\securityhealthsetup.exe",
                 "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiWorker.exe") and
         process.code_signature.subject_name in ("Microsoft Windows Publisher", "Microsoft Corporation", "Microsoft Windows") and process.code_signature.trusted == true) and
   not (process.executable :
               ("?:\\Windows\\System32\\WerFault.exe",
                "\\Device\\HarddiskVolume*\\Windows\\System32\\WerFault.exe",
                "\\Device\\VhdHardDisk*\\Windows\\System32\\WerFault.exe",
                "\\\\?\\Volume{*}\\Windows\\System32\\WerFault.exe") and
        process.parent.executable :
                ("?:\\Windows\\servicing\\TrustedInstaller.exe",
                 "\\Device\\HarddiskVolume*\\Windows\\servicing\\TrustedInstaller.exe",
                 "\\Device\\VhdHardDisk*\\Windows\\servicing\\TrustedInstaller.exe",
                 "\\\\?\\Volume{*}\\Windows\\servicing\\TrustedInstaller.exe",
                 "?:\\WINDOWS\\System32\\svchost.exe")))
) and
   not (process.executable : ("?:\\Program Files (x86)\\Panda Security\\*.exe", "?:\\Program Files\\Panda Security\\*.exe") and
        process.code_signature.trusted == true and process.code_signature.subject_name : "Panda Security S.L.") and
   not process.hash.sha256 in
                 ("1e07a7a91451303d5cdac0a1673d581f5f7198fcc08fc79e4332aba6400f55a8",
                  "f14ea2efbbf0298963f8a574d6b139616ce6bb1e8ab97848d73312c4184b3812") and
   not (process.executable : "?:\\Windows\\System32\\services.exe" and
        registry.path : "HKEY_USERS\\.DEFAULT\\Software\\Classes\\Local Settings\\MuiCache\\*") and
   not (process.parent.executable : "?:\\Program Files\\ProfileUnity\\FlexApp\\ContainerService\\x64\\VirtFsService.exe" and
        process.executable : "?:\\Program Files\\ProfileUnity\\FlexApp\\ContainerService\\x64\\Sentinel\\LwIoSentinel.exe") and
   not (process.executable : "?:\\Program Files (x86)\\Kaspersky Lab\\*.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "Kaspersky Lab JSC") and
   not (process.executable : "?:\\Windows\\System32\\btservice.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "BeyondTrust Software, Inc") and
   not (process.executable : "?:\\Program Files\\Common Files\\McAfee\\AVSolution\\mcshield.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "MUSARUBRA US LLC") and
   not (process.executable : ("?:\\Program Files (x86)\\xagt\\xagt.exe", "?:\\Program Files (x86)\\FireEye\\xagt\\xagt.exe") and
        process.code_signature.trusted == true and process.code_signature.subject_name in ("FireEye, Inc.", "FireEye (Musarubra US LLC)")) and
  not (process.executable : "C:\\Program Files (x86)\\Panda Security\\WAC\\PSANHost.exe" and
       process.code_signature.trusted == true and process.code_signature.subject_name == "Panda Security S.L.") and
  not (process.executable : "C:\\Windows\\SoftwareDistribution\\Download\\Install\\SecurityHealthSetup.exe" and
       process.parent.executable : "C:\\Windows\\SoftwareDistribution\\Download\\Install\\SecurityHealthSetup.exe") and
  not (process.executable : "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiFileFetcher.exe" and
       process.parent.executable : "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiWorker.exe" and
       process.code_signature.subject_name == "Microsoft Windows" and process.code_signature.trusted == true) and
  not (process.executable : "C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfswp.exe" and
      process.code_signature.subject_name == "Kaspersky Lab JSC" and process.code_signature.trusted == true) and
  not (process.name : "rundll32.exe" and process.args : "C:\\WINDOWS\\system32\\davclnt.dll,DavSetCookie" and
       process.parent.executable : "C:\\Windows\\System32\\svchost.exe") and
  not (process.pe.original_file_name == "SecurityHealthSetup.exe" and process.code_signature.trusted == true and
      process.code_signature.subject_name == "Microsoft Windows" and process.Ext.effective_parent.executable : "C:\\Windows\\servicing\\TrustedInstaller.exe") and
  not (event.action == "deletion" and process.executable : "C:\\Windows\\System32\\svchost.exe" and file.path : "C:\\Windows\\Logs\\SRP\\SRP.log")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
event.actioneqdeletionexcludes:event.action field:"event.action" value:"deletion"
file.patheqC:\Windows\Logs\SRP\SRP.logexcludes:file.path field:"file.path" value:"C:\Windows\Logs\SRP\SRP.log"
process.executableeqC:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\svchost.exe"
process.Ext.effective_parent.executableeqC:\Windows\servicing\TrustedInstaller.exeexcludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"C:\Windows\servicing\TrustedInstaller.exe"
process.code_signature.subject_nameeqMicrosoft Windowsexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Windows"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.pe.original_file_nameeqSecurityHealthSetup.exeexcludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"SecurityHealthSetup.exe"
process.argseqC:\WINDOWS\system32\davclnt.dll,DavSetCookieexcludes:process.args field:"process.args" value:"C:\WINDOWS\system32\davclnt.dll,DavSetCookie"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.parent.executableeqC:\Windows\System32\svchost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\svchost.exe"
process.code_signature.subject_nameeqBeyondTrust Software, Incexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"BeyondTrust Software, Inc"
process.executableeq?:\Windows\System32\btservice.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\btservice.exe"
process.code_signature.subject_nameeqKaspersky Lab JSCexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Kaspersky Lab JSC"
process.executableeqC:\Program Files (x86)\Kaspersky Lab\Kaspersky Security for Windows Server\kavfswp.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Security for Windows Server\kavfswp.exe"
process.executablewildcard?:\Program Files (x86)\Kaspersky Lab\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Kaspersky Lab\*.exe"
process.code_signature.subject_nameeqMUSARUBRA US LLCexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"MUSARUBRA US LLC"
process.executableeq?:\Program Files\Common Files\McAfee\AVSolution\mcshield.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Common Files\McAfee\AVSolution\mcshield.exe"
process.executablewildcardC:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_*\TiFileFetcher.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_*\TiFileFetcher.exe"
process.parent.executablewildcardC:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_*\TiWorker.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_*\TiWorker.exe"
process.code_signature.subject_nameeqPanda Security S.L.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Panda Security S.L."
process.executableeqC:\Program Files (x86)\Panda Security\WAC\PSANHost.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\Panda Security\WAC\PSANHost.exe"
process.executablewildcard?:\Program Files (x86)\Panda Security\*.exe, ?:\Program Files\Panda Security\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Panda Security\*.exe" field:"process.executable" value:"?:\Program Files\Panda Security\*.exe"
process.code_signature.subject_nameinFireEye (Musarubra US LLC), FireEye, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"FireEye (Musarubra US LLC)" field:"process.code_signature.subject_name" value:"FireEye, Inc."
process.executableeq?:\Program Files (x86)\xagt\xagt.exe, ?:\Program Files (x86)\FireEye\xagt\xagt.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\xagt\xagt.exe" field:"process.executable" value:"?:\Program Files (x86)\FireEye\xagt\xagt.exe"
process.executableeq?:\Program Files\ProfileUnity\FlexApp\ContainerService\x64\Sentinel\LwIoSentinel.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\ProfileUnity\FlexApp\ContainerService\x64\Sentinel\LwIoSentinel.exe"
process.parent.executableeq?:\Program Files\ProfileUnity\FlexApp\ContainerService\x64\VirtFsService.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\ProfileUnity\FlexApp\ContainerService\x64\VirtFsService.exe"
process.executableeq?:\Windows\System32\services.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\services.exe"
registry.pathstarts_withHKEY_USERS\.DEFAULT\Software\Classes\Local Settings\MuiCache\excludes:registry.path field:"registry.path" value:"HKEY_USERS\.DEFAULT\Software\Classes\Local Settings\MuiCache\"
process.executableeqC:\Windows\SoftwareDistribution\Download\Install\SecurityHealthSetup.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\SoftwareDistribution\Download\Install\SecurityHealthSetup.exe"
process.parent.executableeqC:\Windows\SoftwareDistribution\Download\Install\SecurityHealthSetup.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\SoftwareDistribution\Download\Install\SecurityHealthSetup.exe"
process.hash.sha256in1e07a7a91451303d5cdac0a1673d581f5f7198fcc08fc79e4332aba6400f55a8, f14ea2efbbf0298963f8a574d6b139616ce6bb1e8ab97848d73312c4184b3812excludes:process.hash.sha256 field:"process.hash.sha256" value:"1e07a7a91451303d5cdac0a1673d581f5f7198fcc08fc79e4332aba6400f55a8" field:"process.hash.sha256" value:"f14ea2efbbf0298963f8a574d6b139616ce6bb1e8ab97848d73312c4184b3812"

Indicators

These rows show field, operator, and value matches.