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"]
  4maturity = "production"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/03/28"
  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-*"]
 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"
 53setup = """## Setup
 54
 55If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 56events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 57Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 58`event.ingested` to @timestamp.
 59For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 60"""
 61severity = "medium"
 62tags = ["Domain: Endpoint",
 63        "OS: Windows",
 64        "Use Case: Threat Detection",
 65        "Tactic: Execution", 
 66        "Tactic: Defense Evasion",
 67        "Data Source: Elastic Endgame",
 68        "Resources: Investigation Guide",
 69        "Data Source: Elastic Defend",
 70        "Data Source: Sysmon"
 71        ]
 72timestamp_override = "event.ingested"
 73type = "eql"
 74
 75query = '''
 76process where host.os.type == "windows" and event.type == "start" and
 77  process.pe.original_file_name : "psexesvc.exe" and not process.name : "PSEXESVC.exe"
 78'''
 79
 80[[rule.threat]]
 81framework = "MITRE ATT&CK"
 82
 83[[rule.threat.technique]]
 84id = "T1569"
 85name = "System Services"
 86reference = "https://attack.mitre.org/techniques/T1569/"
 87
 88[[rule.threat.technique.subtechnique]]
 89id = "T1569.002"
 90name = "Service Execution"
 91reference = "https://attack.mitre.org/techniques/T1569/002/"
 92
 93[rule.threat.tactic]
 94id = "TA0002"
 95name = "Execution"
 96reference = "https://attack.mitre.org/tactics/TA0002/"
 97
 98[[rule.threat]]
 99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1036"
102name = "Masquerading"
103reference = "https://attack.mitre.org/techniques/T1036/"
104[[rule.threat.technique.subtechnique]]
105id = "T1036.003"
106name = "Rename System Utilities"
107reference = "https://attack.mitre.org/techniques/T1036/003/"
108
109
110
111[rule.threat.tactic]
112id = "TA0005"
113name = "Defense Evasion"
114reference = "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