Replies: 5 comments 1 reply
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
@Neo23x0 any thoughts? |
Beta Was this translation helpful? Give feedback.
-
Can we get a better understanding of what a "hunting rule" would look like. My understanding is, that hunting is the opposite of a rule (a plan to find malicious events). For me, "hunting" means that an analyst browses or looks through lists of data and tries to find malicious activity based on his knowledge and sense of legitimate activity. He does NOT know what to look for when he starts hunting. If you can define a hunt in a rule and you know that some false positives may appear in the result set, then it's a The So, if there is a type of rule that doesn't match the character of the rules mentioned above, I'd like to look at it and reconsider. |
Beta Was this translation helpful? Give feedback.
-
Hi, I think, level attribute is doing enough for rule's intensity as @Neo23x0 and @frack113 said. So best thing will be:
|
Beta Was this translation helpful? Give feedback.
-
I had a similar idea and want to add my two cents on this topic. Sigma is very flexible and can be used for threat hunting. Although, creating a threat hunting rule will necessitate a different approach. In many cases, the query generated by the rule will serve as the beginning of a threat hunting scenario. The main purpose will be to collect data that is suspicious in nature without having additional context. Populating a threat hunting rule should also have different criteria. Some of these criteria could be: Hypothesis: The rule should have a hypothesis that acts as the starting point and also indicates the purpose of the hunt. I don't believe that low or informational-level detection rules could be classified as threat hunting. This, of course, varies for each rule. Some rules could be good candidates for threat hunting. However, as I explained above, these rules might need more information to include the purpose and explain the expected results based on what we are looking to find. I have created a threat hunting rule that depicts how I envision these rules. The main focus was to make it easy to understand despite the somewhat complex nature of the query. Please take a look at this query and let me know what you think. The results that could come out of this will be suspicious enough to start an investigation but too noisy to create a detection rule. title: Manual execution of scripts that exist inside a compressed file
hypothesis: User double-clicks on a malicious script inside a zip/rar file.
description: "This is a threat-hunting query to collect information related to the interactive execution of a script
from inside a compressed file(zip/rar). Windows will automatically run the script using scripting interpreters such
as wscript and cscript binaries.
From the query below, the child process is the script interpreter that will execute the script. The script extension
is also a set of standard extensions that Windows OS recognizes. Selections 1-3 contain three different
execution scenarios.
1. Compressed file opened using 7zip.
2. Compressed file opened using WinRar.
3. Compressed file opened using native windows File Explorer capabilities.
When the malicious script is double-clicked, it will be extracted to the respected directories as signified by the CommandLine
on each of the three Selections. It will then be executed using the relevant script interpreter."
status: experimental
date: 2023/02/15
author: '@kostastsale'
references:
- https://app.any.run/tasks/25970bb5-f864-4e9e-9e1b-cc8ff9e6386a (Winrar > Wscript executing .wsf)
- https://app.any.run/tasks/fa99cedc-9d2f-4115-a08e-291429ce3692 (Winrar > Wscript executing .wsf)
logsource:
category: process_creation
product: windows
detection:
ChildProcess:
Image|endswith:
- '\wscript.exe'
- '\mshta.exe'
- '\cscript.exe'
- '\powershell.exe'
ScriptExtention:
CommandLine|endswith:
- '.wsf'
- '.hta'
- '.vbs'
- '.js'
- '.jse'
- '.wsh'
- '.vbscript'
- '.ps1'
Selection1:
ParentImage:
- '*\7z*.exe'
CommandLine:
- '*\appdata\local\temp\7z*\*'
Selection2:
ParentImage|endswith:
- '\winrar.exe'
CommandLine:
- '*\appdata\local\temp\rar*\*'
Selection3:
ParentImage|endswith:
- '\explorer.exe'
CommandLine:
- '*\appdata\local\temp\*.rar\*'
- '*\appdata\local\temp\*.zip\*'
condition: ChildProcess and ScriptExtention and (Selection1 OR Selection2 OR Selection3)
falsepositives:
- "During my testing, batch files produced a lot of noise, as many applications appear to bundle them as part of their installation
process. You should baseline your environment and generate a new query excluding the noisy and expected activity. Some false positives may come up depending on your environment. All results should be investigated thoroughly before
filtering out results."
level: medium
tags:
- attack.execution
- attack.T1059
``` |
Beta Was this translation helpful? Give feedback.
-
In sigma, we tend to write rules while avoiding the maximum amount of FP rate but unfortunately sometimes this can be very hard if you don't have enough information about the environment in which this rule would be executed. So an amount of tuning and work needs to be done by the rule used for it to be prod read.
Before this, some of these rules can be classified as hunting rules.
What I'm suggesting is to transfer some of the rules we already have that are more suited for hunting and write more rules like these but in a separate folder called "hunting_rules" or add a new tag that indicates that some rules are more for hunting than direct detection.
People can use/leverage this folder/tag during conversion of the rule and have adapted expectations and start hunting for malicious stuff with an acceptable rate of FP
I know the "status" field aims to achieve a similar effect to separate between prod-ready rules and testing ones. But some rules will always be best for hunting rather than a generic flag/alert approach in a detection pipeline.
Beta Was this translation helpful? Give feedback.
All reactions