PsExec Tool Execution From Suspicious Locations - PipeName
Detects PsExec default pipe creation where the image executed is located in a suspicious location. Which could indicate that the tool is being used in an attack
Sigma rule (View on GitHub)
1title: PsExec Tool Execution From Suspicious Locations - PipeName
2id: 41504465-5e3a-4a5b-a5b4-2a0baadd4463
3related:
4 - id: f3f3a972-f982-40ad-b63c-bca6afdfad7c
5 type: derived
6status: test
7description: Detects PsExec default pipe creation where the image executed is located in a suspicious location. Which could indicate that the tool is being used in an attack
8references:
9 - https://www.jpcert.or.jp/english/pub/sr/ir_research.html
10 - https://jpcertcc.github.io/ToolAnalysisResultSheet
11author: Nasreddine Bencherchali (Nextron Systems)
12date: 2022-08-04
13modified: 2023-09-20
14tags:
15 - attack.execution
16 - attack.t1569.002
17 - attack.s0029
18logsource:
19 category: pipe_created
20 product: windows
21 definition: 'Note that you have to configure logging for Named Pipe Events in Sysmon config (Event ID 17 and Event ID 18). The basic configuration is in popular sysmon configuration (https://github.com/SwiftOnSecurity/sysmon-config), but it is worth verifying. You can also use other repo, e.g. https://github.com/Neo23x0/sysmon-config, https://github.com/olafhartong/sysmon-modular. How to test detection? You can check powershell script from this site https://svch0st.medium.com/guide-to-named-pipes-and-hunting-for-cobalt-strike-pipes-dc46b2c5f575'
22detection:
23 selection:
24 PipeName: '\PSEXESVC'
25 Image|contains: # Add or remove locations depending on how and if you execute Psexec in your env
26 - ':\Users\Public\'
27 - ':\Windows\Temp\'
28 - '\AppData\Local\Temp\'
29 - '\Desktop\'
30 - '\Downloads\'
31 condition: selection
32falsepositives:
33 - Rare legitimate use of psexec from the locations mentioned above. This will require initial tuning based on your environment.
34level: medium
References
Related rules
- CSExec Service File Creation
- HackTool Service Registration or Execution
- PUA - NSudo Execution
- PUA - NirCmd Execution
- PUA - NirCmd Execution As LOCAL SYSTEM