PsExec Network Connection
Identifies use of the SysInternals tool PsExec.exe making a network connection. This could be an indication of lateral movement.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/02/18"
3integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
4maturity = "production"
5updated_date = "2026/05/04"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies use of the SysInternals tool PsExec.exe making a network connection. This could be an indication of lateral
11movement.
12"""
13false_positives = [
14 """
15 PsExec is a dual-use tool that can be used for benign or malicious activity. It's important to baseline your
16 environment to determine the amount of noise to expect from this tool.
17 """,
18]
19from = "now-9m"
20index = [
21 "winlogbeat-*",
22 "logs-endpoint.events.process-*",
23 "logs-endpoint.events.network-*",
24 "logs-windows.sysmon_operational-*",
25 "logs-sentinel_one_cloud_funnel.*",
26]
27language = "eql"
28license = "Elastic License v2"
29name = "PsExec Network Connection"
30note = """## Triage and analysis
31
32### Investigating PsExec Network Connection
33
34PsExec is a remote administration tool that enables the execution of commands with both regular and SYSTEM privileges on Windows systems. Microsoft develops it 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.
35
36This rule identifies PsExec execution by looking for the creation of `PsExec.exe`, the default name for the utility, followed by a network connection done by the process.
37
38#### Possible investigation steps
39
40- Check if the usage of this tool complies with the organization's administration policy.
41- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
42- Investigate other alerts associated with the user/host during the past 48 hours.
43- Identify the user account that performed the action and whether it should perform this kind of action.
44- Identify the target computer and its role in the IT environment.
45- Investigate what commands were run, and assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
46
47### False positive analysis
48
49- 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.
50
51### Response and remediation
52
53- Initiate the incident response process based on the outcome of the triage.
54 - Prioritize cases involving critical servers and users.
55- Isolate the involved hosts to prevent further post-compromise behavior.
56- 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.
57- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
58- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
59- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
60- 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).
61"""
62
63setup = """## Setup
64
65This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
66
67Setup instructions: https://ela.st/install-elastic-defend
68
69### Additional data sources
70
71This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
72
73- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
74- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
75- [Sysmon Event ID 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
76"""
77
78risk_score = 21
79rule_id = "55d551c6-333b-4665-ab7e-5d14a59715ce"
80severity = "low"
81tags = [
82 "Domain: Endpoint",
83 "OS: Windows",
84 "Use Case: Threat Detection",
85 "Tactic: Execution",
86 "Tactic: Lateral Movement",
87 "Resources: Investigation Guide",
88 "Data Source: Elastic Defend",
89 "Data Source: Sysmon",
90 "Data Source: SentinelOne",
91]
92type = "eql"
93
94query = '''
95sequence by process.entity_id
96 [process where host.os.type == "windows" and event.type == "start" and
97 (process.name : "PsExec.exe" or ?process.pe.original_file_name : "psexec.c") and
98
99 /* This flag suppresses the display of the license dialog and may
100 indicate that psexec executed for the first time in the machine */
101 process.args : "-accepteula" and
102
103 not process.executable : ("?:\\ProgramData\\Docusnap\\Discovery\\discovery\\plugins\\17\\Bin\\psexec.exe",
104 "?:\\Docusnap 11\\Bin\\psexec.exe",
105 "?:\\Program Files\\Docusnap X\\Bin\\psexec.exe",
106 "?:\\Program Files\\Docusnap X\\Tools\\dsDNS.exe") and
107 not process.parent.executable : "?:\\Program Files (x86)\\Cynet\\Cynet Scanner\\CynetScanner.exe"]
108 [network where host.os.type == "windows"]
109'''
110
111
112[[rule.threat]]
113framework = "MITRE ATT&CK"
114[[rule.threat.technique]]
115id = "T1569"
116name = "System Services"
117reference = "https://attack.mitre.org/techniques/T1569/"
118[[rule.threat.technique.subtechnique]]
119id = "T1569.002"
120name = "Service Execution"
121reference = "https://attack.mitre.org/techniques/T1569/002/"
122
123
124
125[rule.threat.tactic]
126id = "TA0002"
127name = "Execution"
128reference = "https://attack.mitre.org/tactics/TA0002/"
129[[rule.threat]]
130framework = "MITRE ATT&CK"
131[[rule.threat.technique]]
132id = "T1021"
133name = "Remote Services"
134reference = "https://attack.mitre.org/techniques/T1021/"
135[[rule.threat.technique.subtechnique]]
136id = "T1021.002"
137name = "SMB/Windows Admin Shares"
138reference = "https://attack.mitre.org/techniques/T1021/002/"
139
140
141[[rule.threat.technique]]
142id = "T1570"
143name = "Lateral Tool Transfer"
144reference = "https://attack.mitre.org/techniques/T1570/"
145
146
147[rule.threat.tactic]
148id = "TA0008"
149name = "Lateral Movement"
150reference = "https://attack.mitre.org/tactics/TA0008/"
Triage and analysis
Investigating PsExec Network Connection
PsExec is a remote administration tool that enables the execution of commands with both regular and SYSTEM privileges on Windows systems. Microsoft develops it 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 PsExec execution by looking for the creation of PsExec.exe, the default name for the utility, followed by a network connection done by the process.
Possible investigation steps
- Check if the usage of this tool complies with the organization's administration policy.
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- 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
- Incoming Execution via PowerShell Remoting
- Clearing Windows Console History
- Command Execution via SolarWinds Process
- Command Shell Activity Started via RunDLL32
- Disabling Windows Defender Security Settings via PowerShell