Detection rules › Elastic

NewCredential Logon by a Suspicious Process

Source
github.com/elastic/protections-artifacts

Identifies NewCredential logon attempt with alternate credentials and by an unusual process. Adversaries may create a new token to escalate privileges and bypass access controls.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

[rule]
description = """
Identifies NewCredential logon attempt with alternate credentials and by an unusual process. Adversaries may create a
new token to escalate privileges and bypass access controls.
"""
id = "2d560886-0d75-4b85-a909-a006063057d3"
license = "Elastic License v2"
name = "NewCredential Logon by a Suspicious Process"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1134/002/"]
version = "1.0.15"

query = '''
authentication where event.action == "log_on" and event.code == "4624" and
 process.Ext.session_info.logon_type == "NewCredentials" and process.executable : "C:\\*" and 
 user.id like ("S-1-5-21*", "S-1-12-*") and (user.effective.id != null and user.effective.id like ("S-1-5-21*", "S-1-12-*")) and
 not (process.code_signature.trusted == true and
      process.code_signature.subject_name in
           ("Veeam Software Group GmbH", "COGNYTE SOFTWARE LTD", "Varonis Systems, Inc.", "Ivanti, Inc.", "Becton, Dickinson and Company",
            "Royal Apps GmbH", "Acronis International GmbH", "Idera, Inc.", "Paessler AG", "Azul Systems, Inc.", "PDQ.com Corporation",
            "AO Kaspersky Lab", "Texod Technologies LLC", "Oracle America, Inc.", "Delinea Inc.", "itelio GmbH", "CyberArk Software Ltd.",
            "PDQ.COM CORPORATION", "baramundi software GmbH", "EASYVISTA SA", "Netwrix Corporation", "baramundi software AG",
            "CHENGDU YIWO Tech Development Co., Ltd.", "EASYVISTA SA", "ZOHO Corporation Private Limited", "Open Text Corporation", "Solarwinds Worldwide, LLC",
            "Texode Technologies LLC", "Genetec Inc.", "Octopus Cloud AG", "DocuWare GmbH", "Bomgar Corporation", "Netwrix Corporation",
            "Cocobolo Software, LLC", "Technosoft Solutions (Aust) Pty Ltd", "Trend Micro, Inc.", "Kaseya Holdings Inc", "ESET, spol. s r.o.")) and
 not process.executable :
            ("C:\\Windows\\System32\\runas.exe",
             "C:\\WINDOWS\\system32\\ShellRunas.exe",
             "C:\\Windows\\SysWOW64\\runas.exe",
             "C:\\Windows\\System32\\svchost.exe",
             "C:\\Windows\\System32\\wsmprovhost.exe",
             "C:\\Windows\\System32\\mmc.exe",
             "C:\\Windows\\System32\\lsass.exe",
             "C:\\Windows\\System32\\CredentialUIBroker.exe",
             "C:\\Windows\\System32\\inetsrv\\w3wp.exe",
             "C:\\Windows\\syswow64\\inetsrv\\w3wp.exe",
             "C:\\Windows\\SysWOW64\\msiexec.exe",
             "C:\\PSC\\Programs\\Projects\\Docket\\DKT.exe",
             "C:\\ManageEngine\\ADSelfService Plus\\bin\\Remcom.exe",
             "C:\\ManageEngine\\*\\bin\\WeakPasswordUsers.exe",
             "C:\\LogOS\\runnt\\custdlls\\pslist.exe",
             "C:\\CCAssistant*\\CCAStart.exe",
             "C:\\Program Files (x86)\\*.exe",
             "C:\\Program Files\\*.exe",
             "C:\\PROGRA~1\\*.exe",
             "C:\\POSTLOAD_2022\\PostLoad_21\\bin\\Debug\\PostLoad_21.exe",
             "C:\\Users\\*\\AppData\\Local\\Apps\\2.0\\*\\merg...app_*\\Client.exe", 
             "C:\\Dev\\V5\\PS\\CS\\Schedule Management\\bin\\Debug\\Schedule Management.exe") and
 not (process.name : ("powershell.exe", "powershell_ise.exe") and
      process.command_line : ("\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -File \"D:\\Scripts\\RestorePerfionVortag.ps1\"",
                              "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -File \"D:\\Scripts\\RestoreBCProd2M102.ps1\"",
                              "*Write-Output SNC_PowerShell_PID*", 
                              "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", 
                              "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -ExecutionPolicy unrestricted -NoExit -Command -", 
                              "\"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\PowerShell_ISE.exe\" ", 
                              "\"powershell.exe\" -NonInteractive -ExecutionPolicy Bypass -File C:\\Scripts\\AzureADSSO\\RolloverAzureADSSO.ps1")) and
 not (process.name : "powershell.exe" and process.parent.executable : "?:\\ServiceNow*\\agent\\jre\\bin\\java.exe") and
 not process.parent.executable : "C:\\Program Files\\Microsoft Visual Studio\\*\\CommonExtensions\\Platform\\Debugger\\VsDebugConsole.exe" and 
 not (process.parent.executable : "C:\\Windows\\system32\\rundll32.exe" and process.executable : "C:\\Users\\*\\AppData\\Local\\Apps\\2.0\\*\\sdaq.*\\SDAQ.exe")
'''

min_endpoint_version = "8.17.0"
optional_actions = []
[[actions]]
action = "kill_process"
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.17.0"

Stages and Predicates

Stage 1: authentication

authentication where event.action == "log_on" and event.code == "4624" and
 process.Ext.session_info.logon_type == "NewCredentials" and process.executable : "C:\\*" and 
 user.id like ("S-1-5-21*", "S-1-12-*") and (user.effective.id != null and user.effective.id like ("S-1-5-21*", "S-1-12-*")) and
 not (process.code_signature.trusted == true and
      process.code_signature.subject_name in
           ("Veeam Software Group GmbH", "COGNYTE SOFTWARE LTD", "Varonis Systems, Inc.", "Ivanti, Inc.", "Becton, Dickinson and Company",
            "Royal Apps GmbH", "Acronis International GmbH", "Idera, Inc.", "Paessler AG", "Azul Systems, Inc.", "PDQ.com Corporation",
            "AO Kaspersky Lab", "Texod Technologies LLC", "Oracle America, Inc.", "Delinea Inc.", "itelio GmbH", "CyberArk Software Ltd.",
            "PDQ.COM CORPORATION", "baramundi software GmbH", "EASYVISTA SA", "Netwrix Corporation", "baramundi software AG",
            "CHENGDU YIWO Tech Development Co., Ltd.", "EASYVISTA SA", "ZOHO Corporation Private Limited", "Open Text Corporation", "Solarwinds Worldwide, LLC",
            "Texode Technologies LLC", "Genetec Inc.", "Octopus Cloud AG", "DocuWare GmbH", "Bomgar Corporation", "Netwrix Corporation",
            "Cocobolo Software, LLC", "Technosoft Solutions (Aust) Pty Ltd", "Trend Micro, Inc.", "Kaseya Holdings Inc", "ESET, spol. s r.o.")) and
 not process.executable :
            ("C:\\Windows\\System32\\runas.exe",
             "C:\\WINDOWS\\system32\\ShellRunas.exe",
             "C:\\Windows\\SysWOW64\\runas.exe",
             "C:\\Windows\\System32\\svchost.exe",
             "C:\\Windows\\System32\\wsmprovhost.exe",
             "C:\\Windows\\System32\\mmc.exe",
             "C:\\Windows\\System32\\lsass.exe",
             "C:\\Windows\\System32\\CredentialUIBroker.exe",
             "C:\\Windows\\System32\\inetsrv\\w3wp.exe",
             "C:\\Windows\\syswow64\\inetsrv\\w3wp.exe",
             "C:\\Windows\\SysWOW64\\msiexec.exe",
             "C:\\PSC\\Programs\\Projects\\Docket\\DKT.exe",
             "C:\\ManageEngine\\ADSelfService Plus\\bin\\Remcom.exe",
             "C:\\ManageEngine\\*\\bin\\WeakPasswordUsers.exe",
             "C:\\LogOS\\runnt\\custdlls\\pslist.exe",
             "C:\\CCAssistant*\\CCAStart.exe",
             "C:\\Program Files (x86)\\*.exe",
             "C:\\Program Files\\*.exe",
             "C:\\PROGRA~1\\*.exe",
             "C:\\POSTLOAD_2022\\PostLoad_21\\bin\\Debug\\PostLoad_21.exe",
             "C:\\Users\\*\\AppData\\Local\\Apps\\2.0\\*\\merg...app_*\\Client.exe", 
             "C:\\Dev\\V5\\PS\\CS\\Schedule Management\\bin\\Debug\\Schedule Management.exe") and
 not (process.name : ("powershell.exe", "powershell_ise.exe") and
      process.command_line : ("\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -File \"D:\\Scripts\\RestorePerfionVortag.ps1\"",
                              "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -File \"D:\\Scripts\\RestoreBCProd2M102.ps1\"",
                              "*Write-Output SNC_PowerShell_PID*", 
                              "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", 
                              "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -ExecutionPolicy unrestricted -NoExit -Command -", 
                              "\"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\PowerShell_ISE.exe\" ", 
                              "\"powershell.exe\" -NonInteractive -ExecutionPolicy Bypass -File C:\\Scripts\\AzureADSSO\\RolloverAzureADSSO.ps1")) and
 not (process.name : "powershell.exe" and process.parent.executable : "?:\\ServiceNow*\\agent\\jre\\bin\\java.exe") and
 not process.parent.executable : "C:\\Program Files\\Microsoft Visual Studio\\*\\CommonExtensions\\Platform\\Debugger\\VsDebugConsole.exe" and 
 not (process.parent.executable : "C:\\Windows\\system32\\rundll32.exe" and process.executable : "C:\\Users\\*\\AppData\\Local\\Apps\\2.0\\*\\sdaq.*\\SDAQ.exe")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinAO Kaspersky Lab, Acronis International GmbH, Azul Systems, Inc., Becton, Dickinson and Company, Bomgar Corporation, CHENGDU YIWO Tech Development Co., Ltd., COGNYTE SOFTWARE LTD, Cocobolo Software, LLC, CyberArk Software Ltd., Delinea Inc., DocuWare GmbH, EASYVISTA SA, ESET, spol. s r.o., Genetec Inc., Idera, Inc., Ivanti, Inc., Kaseya Holdings Inc, Netwrix Corporation, Octopus Cloud AG, Open Text Corporation, Oracle America, Inc., PDQ.COM CORPORATION, PDQ.com Corporation, Paessler AG, Royal Apps GmbH, Solarwinds Worldwide, LLC, Technosoft Solutions (Aust) Pty Ltd, Texod Technologies LLC, Texode Technologies LLC, Trend Micro, Inc., Varonis Systems, Inc., Veeam Software Group GmbH, ZOHO Corporation Private Limited, baramundi software AG, baramundi software GmbH, itelio GmbHexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.command_linewildcard"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -File "D:\Scripts\RestorePerfionVortag.ps1", "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -File "D:\Scripts\RestoreBCProd2M102.ps1", *Write-Output SNC_PowerShell_PID*, C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe, "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy unrestricted -NoExit -Command -, "C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe" , "powershell.exe" -NonInteractive -ExecutionPolicy Bypass -File C:\Scripts\AzureADSSO\RolloverAzureADSSO.ps1excludes:process.command_line
process.nameeqpowershell.exe, powershell_ise.exeexcludes:process.name field:"process.name" value:"powershell.exe" field:"process.name" value:"powershell_ise.exe"
process.executablewildcardC:\Users\*\AppData\Local\Apps\2.0\*\sdaq.*\SDAQ.exeexcludes:process.executable field:"process.executable" value:"C:\Users\*\AppData\Local\Apps\2.0\*\sdaq.*\SDAQ.exe"
process.parent.executableeqC:\Windows\system32\rundll32.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\system32\rundll32.exe"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.parent.executablewildcard?:\ServiceNow*\agent\jre\bin\java.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\ServiceNow*\agent\jre\bin\java.exe"
process.executablewildcardC:\Windows\System32\runas.exe, C:\WINDOWS\system32\ShellRunas.exe, C:\Windows\SysWOW64\runas.exe, C:\Windows\System32\svchost.exe, C:\Windows\System32\wsmprovhost.exe, C:\Windows\System32\mmc.exe, C:\Windows\System32\lsass.exe, C:\Windows\System32\CredentialUIBroker.exe, C:\Windows\System32\inetsrv\w3wp.exe, C:\Windows\syswow64\inetsrv\w3wp.exe, C:\Windows\SysWOW64\msiexec.exe, C:\PSC\Programs\Projects\Docket\DKT.exe, C:\ManageEngine\ADSelfService Plus\bin\Remcom.exe, C:\ManageEngine\*\bin\WeakPasswordUsers.exe, C:\LogOS\runnt\custdlls\pslist.exe, C:\CCAssistant*\CCAStart.exe, C:\Program Files (x86)\*.exe, C:\Program Files\*.exe, C:\PROGRA~1\*.exe, C:\POSTLOAD_2022\PostLoad_21\bin\Debug\PostLoad_21.exe, C:\Users\*\AppData\Local\Apps\2.0\*\merg...app_*\Client.exe, C:\Dev\V5\PS\CS\Schedule Management\bin\Debug\Schedule Management.exeexcludes:process.executable
process.parent.executablewildcardC:\Program Files\Microsoft Visual Studio\*\CommonExtensions\Platform\Debugger\VsDebugConsole.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Microsoft Visual Studio\*\CommonExtensions\Platform\Debugger\VsDebugConsole.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • log_on corpus 8 (elastic 8)
field:"EventType" kind:eq value:"log_on"
event.codeeq
  • 4624 corpus 29 (splunk 13, kusto 11, chronicle 4, elastic 1)
field:"EventID" kind:eq value:"4624"
process.Ext.session_info.logon_typeeq
  • NewCredentials
field:"process.Ext.session_info.logon_type" kind:eq value:"NewCredentials"
process.executablewildcard
  • C:\* corpus 16 (elastic 16)
field:"Image" kind:wildcard value:"C:\*"
user.effective.idis_not_null
  • (no value, null check)
field:"user.effective.id" kind:is_not_null
user.effective.idwildcard
  • S-1-12-* corpus 4 (elastic 4)
  • S-1-5-21* corpus 4 (elastic 4)
field:"user.effective.id" kind:wildcard
user.idwildcard
  • S-1-12-* corpus 46 (elastic 46)
  • S-1-5-21* corpus 47 (elastic 47)
field:"user.id" kind:wildcard