-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Rule: Potential File Override/Append Via SET Command
#4969
Add Rule: Potential File Override/Append Via SET Command
#4969
Conversation
Detects the execution of the bcp utility with 'queryout' or 'out' options in Windows Security Event Log (Event ID 4688). This rule is useful for identifying potential misuse of data copy between an SQL instance to a file
Detects the use of the SET command with the /p flag combined with the >> redirection operator, which can indicate an attempt to create or modify files maliciously.
Hey @Mahir-Ali-khan thanks for the contribution. The PR contains an already submitted rule in #4968 so please remove that. Also can you fill out the template of the PR by providing a description and an example log of what you're trying to detect. Finally give the sigma conventions a read to ease the review process. |
…command-abuse.yml modify as per conventions
@Mahir-Ali-khan did you try the command? As it is written and provided from the blog both Sysmon and 4688 will not catch the redirect but instead will only have something like this So i wonder how did your test went? did your rule work? |
…n_BCP_utility.yml
Hello @nasbench , I didn't test this out , this technique was found to be successfully executed in this sophos https://news.sophos.com/en-us/2024/08/07/sophos-mdr-hunt-tracks-mimic-ransomware-campaign-against-organizations-in-india/ . |
I'm not talking about the technique, i'm talking about your rule. If you didn't test this out how would you know that you are detecting the technique itself? As I mentioned the rule you submitted wouldn't work as the |
Hello @nasbench Thanks for the feedback, I have tested this query over EDR. well you was right ">>" this is not getting captured. But this can be monitor by "SET" and "/p" command. Below query is working just right on SentinelOne (src.process.name='cmd.exe' OR 'powershell.exe' OR 'powershell_ise.exe') AND (tgt.process.cmdline contains 'set' and tgt.process.cmdline contains '/p') kindly suggest if any improvements needed. |
I made the necessary updates to the rule. Without the usage of ">>" this can only be a "low" as the "/p=" flag is heavily used in prompting for user info or simply showcasing messages. As the ">>" cannot be caught by Sysmon/Security logs we have to make do with that. I added the ">>" case to the selection, just in case the attacker wrapped everything in a "/c". Thanks for the contribution @Mahir-Ali-khan |
Potential File Override/Append Via SET Command
Thanks @nasbench for the update |
Summary of the Pull Request
The Attacker can use the SET variable to append or create a new file
The set /p command is used to set the value of an environment variable based on user input. However, in this case, the = sign after /p directly assigns the provided string to the file without waiting for user input. The string "4D5A90..." is hexadecimal data.
Changelog
new: Potential File Override/Append Via SET Command
Example Log Event
Fixed Issues
N/A
SigmaHQ Rule Creation Conventions