property | value |
tags | lateral-movement,threat-hunting-ideas |
url | |
original_word_count | 1066 |
Article Excerpt
PSExec is a tool designed for system administrators, facilitating remote command execution, and is part of the Sysinternals Suite. However, this tool is frequently exploited for lateral movement by Threat Actors.
Long Summary
This article provides a comprehensive overview of the detection of PSEXEC and similar tools. PSEXEC is a tool designed for system administrators, facilitating remote command execution, and is part of the Sysinternals Suite. However, this tool is frequently exploited for lateral movement by Threat Actors. To detect PSEXEC and similar tools, Windows Security EventID 5140 & 5145, 4697, 7045 or 7036, 4674, 4688/4689, 4104, and auditd/sysmon process execution can be used.
When executing PSEXEC, the field RelativeTargetName contains the strings -stdin, -stdoutor -stderr, and the field RelativeTargetName contains the string psexecsvc. When executing PSEXEC from Impacket psexec.py (uses a version of RemCom), the field RelativeTargetName can contain Remcom_Communication, RemCom_stdin, RemCom_stderr, RemCom_stdout*, and svcctl. The executable dropped in the share admin* and the field RelativeTargetName with a name ending with *.exe or *.dll, and the field AccessMask with the value 0x2.
When executing PSEXEC, the field ImagePath= *PSEXESVC.exe (PSEXESVC.exe is copied to the %SystemRoot% directory by default) and the field ServiceName= PSEXESVC (make sure ServiceName is parsed in EventID 7036, you may see 'PSEXESVC service state has changed' when starting and stopping psexec). The field TargetObject = PSEXESVC can be used to detect an operation attempted on a privileged object. The field TargetFilename can be used to detect file manipulation events. The field ProcessName = PSEXEC (depends on the usage) can be used to detect process execution. Microsoft Defender EventID 1116 & 1117 can be used to detect some of the psexec like tools from metasploit or impacket.
To detect PSEXEC usage on a remote machine, the source IP address, originating user, and source workstation should be correlated and incorporated in the alerts. A strict policy should be implemented regarding the use of PSEXEC to distinguish or detect malicious activities associated
Short Summary
š Detecting PSEXEC and similar tools
šš½ PSExec is a tool designed for system administrators, facilitating remote command execution, and is part of the Sysinternals Suite. However, this tool is frequently exploited for lateral movement by Threat Actors. šš½ Comprehensive overview of the detection of PSEXEC and similar tools. šš½ PSEXEC is a tool for system administrators enabling remote command execution. šš½ PSEXEC is frequently exploited by threat actors for lateral movement. šš½ Detection methods include Windows Security EventIDs and auditd/sysmon process execution. šš½ Specific strings in the field RelativeTargetName indicate PSEXEC execution. šš½ Impacket psexec.py can also be detected through the RelativeTargetName field. šš½ Detecting the executable dropped in the admin$ share using specific field values. šš½ Field values ImagePath and ServiceName can be used to identify PSEXEC execution. šš½ TargetObject and TargetFilename fields can detect privileged object operations and file manipulation. šš½ Microsoft Defender EventIDs offer detection for psexec-like tools from Metasploit or Impacket.
š source link: https://detect.fyi/detecting-psexec-and-similar-tools-c812bf3dca6c
š summarized content: https://hut.threathunterz.com/battlefield-intel/articles-and-reports/detecting-psexec-and-similar-tools
#PSEXEC #Detection #Sysinternals #ThreatActors #Security