Suspicious Process Execution via Renamed PsExec Executable

Identifies suspicious psexec activity which is executing from the psexec service that has been renamed, possibly to evade detection.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/08/14"
  3integration = ["endpoint", "windows", "m365_defender"]
  4maturity = "production"
  5updated_date = "2024/10/15"
  6min_stack_version = "8.14.0"
  7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies suspicious psexec activity which is executing from the psexec service that has been renamed, possibly to
 13evade detection.
 14"""
 15from = "now-9m"
 16index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*", "endgame-*", "logs-m365_defender.event-*"]
 17language = "eql"
 18license = "Elastic License v2"
 19name = "Suspicious Process Execution via Renamed PsExec Executable"
 20note = """## Triage and analysis
 21
 22### Investigating Suspicious Process Execution via Renamed PsExec Executable
 23
 24PsExec is a remote administration tool that enables the execution of commands with both regular and SYSTEM privileges on Windows systems. It operates by executing a service component `Psexecsvc` on a remote system, which then runs a specified process and returns the results to the local system. Microsoft develops PsExec as part of the Sysinternals Suite. Although commonly used by administrators, PsExec is frequently used by attackers to enable lateral movement and execute commands as SYSTEM to disable defenses and bypass security protections.
 25
 26This rule identifies instances where the PsExec service component is executed using a custom name. This behavior can indicate an attempt to bypass security controls or detections that look for the default PsExec service component name.
 27
 28#### Possible investigation steps
 29
 30- Check if the usage of this tool complies with the organization's administration policy.
 31- Investigate other alerts associated with the user/host during the past 48 hours.
 32- Identify the user account that performed the action and whether it should perform this kind of action.
 33- Identify the target computer and its role in the IT environment.
 34- Investigate what commands were run, and assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
 35
 36### False positive analysis
 37
 38- This mechanism can be used legitimately. As long as the analyst did not identify suspicious activity related to the user or involved hosts, and the tool is allowed by the organization's policy, such alerts can be dismissed.
 39
 40### Response and remediation
 41
 42- Initiate the incident response process based on the outcome of the triage.
 43  - Prioritize cases involving critical servers and users.
 44- Isolate the involved hosts to prevent further post-compromise behavior.
 45- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
 46- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 47- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 48- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
 49- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 50"""
 51risk_score = 47
 52rule_id = "e2f9fdf5-8076-45ad-9427-41e0e03dc9c2"
 53severity = "medium"
 54tags = [
 55    "Domain: Endpoint",
 56    "OS: Windows",
 57    "Use Case: Threat Detection",
 58    "Tactic: Execution",
 59    "Tactic: Defense Evasion",
 60    "Data Source: Elastic Endgame",
 61    "Resources: Investigation Guide",
 62    "Data Source: Elastic Defend",
 63    "Data Source: Sysmon",
 64    "Data Source: Microsoft Defender for Endpoint",
 65]
 66timestamp_override = "event.ingested"
 67type = "eql"
 68
 69query = '''
 70process where host.os.type == "windows" and event.type == "start" and
 71  process.pe.original_file_name : "psexesvc.exe" and not process.name : "PSEXESVC.exe"
 72'''
 73
 74
 75[[rule.threat]]
 76framework = "MITRE ATT&CK"
 77[[rule.threat.technique]]
 78id = "T1569"
 79name = "System Services"
 80reference = "https://attack.mitre.org/techniques/T1569/"
 81[[rule.threat.technique.subtechnique]]
 82id = "T1569.002"
 83name = "Service Execution"
 84reference = "https://attack.mitre.org/techniques/T1569/002/"
 85
 86
 87
 88[rule.threat.tactic]
 89id = "TA0002"
 90name = "Execution"
 91reference = "https://attack.mitre.org/tactics/TA0002/"
 92[[rule.threat]]
 93framework = "MITRE ATT&CK"
 94[[rule.threat.technique]]
 95id = "T1036"
 96name = "Masquerading"
 97reference = "https://attack.mitre.org/techniques/T1036/"
 98[[rule.threat.technique.subtechnique]]
 99id = "T1036.003"
100name = "Rename System Utilities"
101reference = "https://attack.mitre.org/techniques/T1036/003/"
102
103
104
105[rule.threat.tactic]
106id = "TA0005"
107name = "Defense Evasion"
108reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Suspicious Process Execution via Renamed PsExec Executable

PsExec is a remote administration tool that enables the execution of commands with both regular and SYSTEM privileges on Windows systems. It operates by executing a service component Psexecsvc on a remote system, which then runs a specified process and returns the results to the local system. Microsoft develops PsExec as part of the Sysinternals Suite. Although commonly used by administrators, PsExec is frequently used by attackers to enable lateral movement and execute commands as SYSTEM to disable defenses and bypass security protections.

This rule identifies instances where the PsExec service component is executed using a custom name. This behavior can indicate an attempt to bypass security controls or detections that look for the default PsExec service component name.

Possible investigation steps

  • Check if the usage of this tool complies with the organization's administration policy.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Identify the target computer and its role in the IT environment.
  • Investigate what commands were run, and assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.

False positive analysis

  • This mechanism can be used legitimately. As long as the analyst did not identify suspicious activity related to the user or involved hosts, and the tool is allowed by the organization's policy, such alerts can be dismissed.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
    • Prioritize cases involving critical servers and users.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Related rules

to-top