PSEXEC
EVENT 7045
ADMIN$
PSEXESVC
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting PsExec and Service-Based Remote Execution

PsExec is a legitimate administration tool and a ransomware favourite. The service it installs, the binary it drops and the pipes it opens are all visible if you log them.

Scroll

PsExec copies a service binary to the ADMIN$ share, installs it through the Service Control Manager over RPC and talks to it over named pipes. Every step leaves telemetry on the target, and the same pattern is reused by Impacket, Cobalt Strike’s psexec command, RemCom and PAExec. Detecting the pattern rather than the tool name keeps you ahead of simple renames.

Signals at a Glance

SignalWhereATT&CK
New service whose ImagePath points at an executable in the Windows directory or an ADMIN$ path (Event 7045 / 4697)System and Security logsT1569.002
Executable written over SMB to ADMIN$ by the System processSysmon 11, Event 5145T1021.002
PSEXESVC-* named pipes (stdin, stdout, stderr)Sysmon 17/18, Event 5145T1569.002
Service-launched child such as cmd.exe or powershell.exe under services.exeSysmon 1, Event 4688T1543.003
PsExec EULA value set on the source hostSysmon 13T1569.002

Service Creation and Binary Drop

The most reliable PsExec artifact is the service install. Event ID 7045 (System log, Service Control Manager) and 4697 (Security log) record the service name and ImagePath. The stock tool uses the name PSEXESVC; clones use random names and binaries, so alert on the structure of the install as well as the string:

title: Remote Service Install Resembling PsExec
logsource:
  product: windows
  service: system
detection:
  stock:
    Provider_Name: 'Service Control Manager'
    EventID: 7045
    ServiceName: 'PSEXESVC'
  generic:
    Provider_Name: 'Service Control Manager'
    EventID: 7045
    ImagePath|contains:
      - '\\127.0.0.1\ADMIN$\'
      - '%SystemRoot%\'
      - 'C:\Windows\'
  filter_known_tools:
    ImagePath|contains: '<your approved deployment tool path>'
  condition: stock or (generic and not filter_known_tools)
level: high
# tune/validate: baseline legitimate software installers that register services from C:\Windows.

Correlate the install with the network logon that preceded it. The binary arrives over SMB, so a Security 5145 or Sysmon 11 file-create under the Windows directory should appear within seconds of the 7045:

// Sentinel (KQL) - service install shortly after a network logon from the same source
let installs = SecurityEvent
| where EventID == 4697
| where ServiceFileName has_any ("ADMIN$", "PSEXESVC", "%COMSPEC%", "\\127.0.0.1")
| project InstallTime=TimeGenerated, Computer, ServiceName, ServiceFileName, SubjectUserName, SubjectLogonId;
installs
| join kind=inner (
    SecurityEvent
    | where EventID == 4624 and LogonType == 3
    | project LogonTime=TimeGenerated, Computer, TargetLogonId, SourceIp=IpAddress, TargetUserName
) on Computer, $left.SubjectLogonId == $right.TargetLogonId
| project InstallTime, Computer, ServiceName, ServiceFileName, TargetUserName, SourceIp
// tune/validate: field names vary by connector; confirm 4697 is audited (Security System Extension).

Pipes, Renames and Variants

PsExec opens three named pipes per session, PSEXESVC-<host>-<pid>-stdin, -stdout and -stderr. Sysmon Event IDs 17 and 18 capture them, and Event 5145 on the IPC$ share records the client touching them. Variants change the strings but keep the shape: a service is created remotely, an executable lands in a system path, and a command interpreter runs as its child.

Vetted sources

Start from the SigmaHQ service-install and PsExec rules, Elastic and Splunk ESCU remote-service content, and MITRE CAR analytics for remote execution. Use Atomic Red Team to generate the telemetry and the SwiftOnSecurity or Olaf Hartong Sysmon configuration for pipe and file events. Baseline your own environment first — software deployment and EDR agents also install services remotely.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026