olafhartong / ThreatHunting

A Splunk app mapped to MITRE ATT&CK to guide your threat hunts
MIT License
1.12k stars 177 forks source link

($exclude_technique$) AND ($exclude_host_fqdn$) Need to be removed to work #63

Closed kucster closed 2 years ago

kucster commented 3 years ago

I've been playing with your great app and am stuck as to why to get any query to run I need to remove ($exclude_technique$) AND ($exclude_host_fqdn$). I'm rather new to Splunk but I've tried to review your code and can't quite find the culprit. On my ThreatHunting about page everything shows up as installed. Also when I remove these values everything starts working but I think I will need them as I do need to exclude some items. Thanks for your help Sean

OutpostSecurity commented 3 years ago

Those are tokens set from the dashboard. could you post the search that does not work and then the search that does? might help narrow down how it is working in your environment.

kucster commented 3 years ago

Thank you for your help. It is not so much the search but the issue is the dashboard. I've attached a pic, on the left is the dashboard unmodified and the right is the modified. The modified code is below, I've pretty much just removed the ($exclude_technique$) AND ($exclude_host_fqdn$) references. ThreatHunt-Issue `

-7d@d now mitre_technique_id mitre_technique_id index=threathunting | stats count by mitre_technique_id | sort -count $time_picker.earliest$ $time_picker.latest$ AND mitre_technique_id!=" " None none host_fqdn host_fqdn index=threathunting | stats count by host_fqdn | sort -count $time_picker.earliest$ $time_picker.latest$ AND None none host_fqdn!=" "
Initial Access index=threathunting mitre_category="*Initial_Access*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Execution index=threathunting mitre_category="*Execution*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Persistence index=threathunting mitre_category="*Persistence*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Privilege Escalation index=threathunting mitre_category="*Privilege_Escalation*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Defense Evasion index=threathunting mitre_category="*Defense_Evasion*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Credential Access index=threathunting mitre_category="*Credential_Access*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Discovery index=threathunting mitre_category="*Discovery*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Lateral Movement index=threathunting mitre_category="*Lateral_Movement*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Collection index=threathunting mitre_category="*Collection*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Command & Control index=threathunting mitre_category="*Command_and_Control*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Exfiltration index=threathunting mitre_category="*Exfiltration*" | timechart span=24h count(mitre_category) | appendpipe [stats count | where count=0] $time_picker.earliest$ $time_picker.latest$ 1 Top triggered techniques in the selected timeframe index="threathunting" | stats count by mitre_technique_id, mitre_technique, mitre_category | sort -count $time_picker.earliest$ $time_picker.latest$
Top triggered host_fqdns in the selected timeframe index="threathunting" | stats count by host_fqdn | sort -count $time_picker.earliest$ $time_picker.latest$
Top triggered users by host_fqdns in the selected timeframe index="threathunting" | stats count by user_name, host_fqdn | sort -count $time_picker.earliest$ $time_picker.latest$
Activity by time per day index=threathunting | stats count by _time, mitre_category | timechart span=15m sum(count) by mitre_category useother=false $time_picker.earliest$ $time_picker.latest$

`

OutpostSecurity commented 3 years ago

so I think the input fields are mis-named, The search is expecting exclud_technique and exclude_host_fqdn and I think they are called mitre_technique_id and host_fqdn. Edit the dashboard and then edit those inputs and ensure the Token fields are correct Attached is a screenshot of the exclude host field where the Token field is correctly set. Let me know if those are correct and it is still not working. Edit-ExcludeHost

kucster commented 3 years ago

Thank you for your continued help, I've looked at the values and I think they are correct, see below image

OutpostSecurity commented 3 years ago

Weird ok, not sure where to look, I cannot re-create the issue. If it works to just remove those token references then go for it.

kucster commented 3 years ago

Will do, thank you for trying