-
Hello, Thank you for maintaining Sigma :) Our Hayabusa project using Sigma heavily, then we noticed Hayabusa can't detect /rules/windows/powershell/powershell_classic
The reason was that the above rule referred to a field under the A sample event log for <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="PowerShell" />
<EventID Qualifiers="0">400</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>4</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2023-10-09T13:24:55.2952147Z" />
<EventRecordID>1643</EventRecordID>
<Correlation />
<Execution ProcessID="4684" ThreadID="0" />
<Channel>Windows PowerShell</Channel>
<Computer>HOSTA</Computer>
<Security />
</System>
<EventData>
<Data>Available</Data>
<Data>None</Data>
<Data>NewEngineState=Available PreviousEngineState=None SequenceNumber=13 HostName=ConsoleHost HostVersion=5.1.22621.963 HostId=e2a4b19b-92ef-407b-9fe0-b646489b66c5 HostApplication=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-WmiObject Win32_Process | Where-Object { $_.ExecutablePath -eq 'C:\Users\alice\AppData\Local\Programs\Microsoft VS Code\bin\code-tunnel.exe' } | Select @{Name='Id'; Expression={$_.ProcessId}} | Stop-Process -Force EngineVersion=5.1.22621.963 RunspaceId=e1518a29-e3b8-41d3-931a-ff4db039a628 PipelineId= CommandName= CommandType= ScriptName= CommandPath= CommandLine=</Data>
</EventData>
</Event> Then my question is,
I'm sorry if my understanding is insufficient. It would be helpful if you could comment. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @fukusuket The definition section in the logsource explicitly state that events have to be extracted. Example: logsource:
product: windows
category: ps_classic_start
definition: fields have to be extract from event This means that its expected out of the back end (in this case Hayabussa) to parse the event and extract the fields. Or simply map everything that has a logsource We've talked about the Data field issue before in some other discussion (that i can't seem to find now). But there are 18 rules using the Another example would be the scheduled task creation event Anyway the point being that at the end of the day both way of writing are "technically" possible. Here are up and downsides
Personally (my logical side) would opt for specific fields instead of using the Hope this rambling answer your question somehow. I would pass this on to other members to see their current opinion on this matter. Please let me know if you have any further questions |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your kind support :) definition: fields have to be extract from event Sorry, I had overlooked this point. It's already clearly stated. I understand that there are pros and cons to both, and that there are products that support field extraction. then I have one more question. detection:
selection_data:
Data|contains: 'ModuleContents=function Get-VMRemoteFXPhysicalVideoAdapter {'
selection_field:
ModuleContents|startswith: 'function Get-VMRemoteFXPhysicalVideoAdapter {'
condition: selection_data or selection_field The advantage is that it can support more products, and the disadvantage is that detection requires more resources. On the other hand, if the disadvantages seem to outweigh the advantages, I will leave the current rules as they are and consider ways to deal with them on Hayabusa's member. |
Beta Was this translation helpful? Give feedback.
Alright, I think the general consensus is to keep using the original field. So we'll convert the rules to using the
Data
field. If you would like to provide a PR for that or I will do it in the coming days :)Thanks for pointing this out and for the discussion.
I'll mark this as answered.