-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #4969 from @Mahir-Ali-khan - Add `Potential File Override/Ap…
…pend Via SET Command` new: Potential File Override/Append Via SET Command --------- Co-authored-by: nasbench <8741929+nasbench@users.noreply.github.com>
- Loading branch information
1 parent
b1a2d41
commit 17d1977
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
rules-threat-hunting/windows/process_creation/proc_creation_win_cmd_set_prompt_abuse.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
title: Potential File Override/Append Via SET Command | ||
id: 65e4c134-ee52-4099-9e35-5e17a4b45c62 | ||
status: experimental | ||
description: | | ||
Detects the use of the "SET" internal command of Cmd.EXE with the /p flag followed directly by an "=" sign. | ||
Attackers used this technique along with an append redirection operator ">>" in order to update the content of a file indirectly. | ||
Ex: cmd /c >> example.txt set /p="test data". This will append "test data" to contents of "example.txt". | ||
The typical use case of the "set /p=" command is to prompt the user for input. | ||
references: | ||
- https://news.sophos.com/en-us/2024/08/07/sophos-mdr-hunt-tracks-mimic-ransomware-campaign-against-organizations-in-india/ | ||
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1 | ||
- https://ss64.com/nt/set.html | ||
author: Nasreddine Bencherchali (Nextron Systems), MahirAli Khan (in/mahiralikhan) | ||
date: 2024-08-22 | ||
tags: | ||
- attack.execution | ||
- attack.defense-evasion | ||
- detection.threat-hunting | ||
logsource: | ||
category: process_creation | ||
product: windows | ||
detection: | ||
selection_img: | ||
- Image|endswith: '\cmd.exe' | ||
- OriginalFileName: 'Cmd.Exe' | ||
selection_cli: | ||
CommandLine|contains: | ||
- '/c set /p=' | ||
- '"set /p=' | ||
- '>>*set /p=' # To catch edge cases where the attacker passes it via a "cmd /c" | ||
condition: all of selection_* | ||
falsepositives: | ||
- Legitimate use of the SET with the "/p" flag for user prompting. command in administrative scripts or user-generated scripts. | ||
level: low |