Skip to content

Commit b0f6697

Browse files
authored
Update windows_powershell_script_block_with_malicious_string.yml
1 parent 7381c9d commit b0f6697

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

detections/endpoint/windows_powershell_script_block_with_malicious_string.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ type: TTP
88
description: The following analytic detects the execution of multiple offensive toolkits and commands by leveraging PowerShell Script Block Logging (EventCode=4104). This method captures and logs the full command sent to PowerShell, allowing for the identification of suspicious activities including several well-known tools used for credential theft, lateral movement, and persistence. If confirmed malicious, this could lead to unauthorized access, privilege escalation, and potential compromise of sensitive information within the environment.
99
data_source:
1010
- Powershell Script Block Logging 4104
11-
search: '`powershell` ScriptBlockText EventCode=4104
12-
| stats count min(_time) as firstTime max(_time) as lastTime list(ScriptBlockText) as command Values(OpCode) as reason values(Path) as file_name values(UserID) as user by ActivityID, Computer, EventCode
13-
| eval command = mvjoin(command,"\n"), dest = Computer, signature = EventCode, signature_id = ActivityID
14-
| lookup malicious_powershell_strings command
15-
| where isnotnull(match)
16-
| `security_content_ctime(firstTime)`
17-
| `security_content_ctime(lastTime)`
18-
| `windows_powershell_script_block_with_malicious_string_filter`'
11+
search: |-
12+
`powershell` ScriptBlockText EventCode=4104
13+
| stats count min(_time) as firstTime max(_time) as lastTime list(ScriptBlockText) as command Values(OpCode) as reason values(Path) as file_name values(UserID) as user by ActivityID, Computer, EventCode
14+
| eval command = mvjoin(command,"\n"), dest = Computer, signature = EventCode, signature_id = ActivityID
15+
| lookup malicious_powershell_strings command
16+
| where isnotnull(match)
17+
| `security_content_ctime(firstTime)`
18+
| `security_content_ctime(lastTime)`
19+
| `windows_powershell_script_block_with_malicious_string_filter`
1920
how_to_implement: The following analytic requires PowerShell operational logs to be imported. Modify the powershell macro as needed to match the sourcetype or add index. This analytic is specific to 4104, or PowerShell Script Block Logging.
2021
known_false_positives: Unknown, possible usage by internal red team or powershell commands with overlap.
2122
references:

0 commit comments

Comments
 (0)