Splunk hunting queries

The goal is to identify potential issues before they become problems. Incident response is entirely reactive and takes place after potential nefarious activity has already become a problem. Splunk is an excellent tool to aid in threat hunting, focused on proactive interception. Splunk provides access to all data in your environment, from IP addresses, ingress and egress traffic, network artifacts flow, packet captures, DNS activity, zone transfers for DNS, endpoint host artifacts and patternsvulnerability management data and user behavioral analytics.

Time is a very important factor in the threat hunting conversation. One of the greatest features of Splunk is its ability to bring in any sort of data that has a time stamp on it. This kind of efficiency is also a major benefit. Splunk takes data and amalgamates it in one convenient, searchable area.

Instead of logging into ten different tools or devices, you can have it all centralized in Splunk, easily accessible. In the past, I was an analyst at a federal agency, and I noticed a lot of traffic going outward. I looked at the IP address, and it was for a file sharing program for video streaming. It turned out, this was software someone at the company was using that allowed them to stream movies at work, and this particular software is known for exfiltrating data.

For instance, at another organization, I noticed that someone was constantly accessing their device from an external country. I was able to display my findings and got their certificate revoked until they returned back to the U. This all exists in your network, and you can see what happens assuming you have a couple tools, which, everyone should, in the security shop.

This is almost Step 0—you need something to work off of. Aggregation: build dashboards relevant to your security needs as an organization. Time is of the essence. So, being able to aggregate data into dashboards and timed searches, saved searches, and other features Splunk offers makes it an extremely effective tool. You can click a button, log in and see all the failed logins on your system, potentially malicious sites people are going to, potentially malicious emails being received and anything bad happening on your network.

Also note that Splunk is supported by a huge community, and there are always millions of people who have the same issue you might be running into. This way, you can take the hands off the user who would typically have to carry out remediation, and Splunk can start to notify and make adjustments to your environment based on things you learned and tell it to do for future instances, like when other threats that emerge.

Like you would if you were battling Medusa.What a splendid job they have done for the cyber security community by bringing most of the key attack vectors under an organized framework that segregates these attack vectors in various stages of a typical attack.

Moreover, not only they have orchestrated the key attack vectors but the mitigation and detection guidance for each attack vector are also part of this framework. Furthermore, the information about the threat actors, who are seen using these attack vectors in-the-wild, is also associated with every attack vector.

splunk hunting queries

There are many genius people out there in the world to solve such problems and one of them is Olaf Hartong. The following is the screenshot of the overview dashboard of this App. You can find the repo on the git hub here: ThreatHunting.

The same can be found on splunkbase here:. I am writing this blog to explain how to install and make this app up and running as it might get tricky when you actually start using it. If not, nevermind. Sysmon does not log all the events by default hence the configuration file needs to be altered. So, watch out for those misconfigs. Download sysmonconfig-export.

Open up the command prompt as an administrator and go to path where Sysmon is located and fire following command. This will install Sysmon with the specified configuration in the config file. You need to tweak the config file as I mentioned above when required. Then install the above-mentioned pre-requisite apps from the Splunkbase on to the Splunk search head.

It sould look like as following. Click on the install button and it will get installed. Once you are done with that, we need to ingest our Sysmon data if not ingested already. I am using stand alone instance of the Splunk for this demo purpose, however, you may ingest the data the way you are doing it for other similar logsources. The following is the steps to get the Sysmon data in for a standalone instance of Splunk. At the same time, props.

Finally, you have to upload the lookups to the lookup folders in the App. Download the lookups from here and past them under lookups. These are blank lookups, you may need to populate them with actual whitelisting data.

Now, mind you, this will again open the flood gates and your dashboard might get populated with exaggerated numbers. As I said earlier, This App comes with Whitelisting lookups that you may need to update with the whitelist entries — that would help in reducing to the real suspicious events that you want to investigate.

Nonetheless, this exercise will give you a deep insight about how your environment works. With more than twelve years of experience in various areas like Cloud Security, Threat and Incident Management, DevSecOps, Vulnerability Management ,IT Governance and Risk Management, he has been involved in assessment and development of security strategy and road-maps for several organizations.

His area of interest is to research on the cybercrime eco-system and develop actionable and predictive intelligence to protect critical infrastructure. He has been lately involved working on the domains like DevSecOps, Incident Response and cloud security. Open up the command prompt as an administrator and go to path where Sysmon is located and fire following command This will install Sysmon with the specified configuration in the config file.

Happy hunting, fellas!! Share this The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. You might also like.Contributors of all backgrounds and levels of expertise come here to find solutions to their issues, and to help other users in the Splunk community with their own questions.

This quick tutorial will help you get started with key features to help you find the answers you need. You will receive 10 karma points upon successful completion! Karma contest winners announced! We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website.

Learn more including how to update your settings here. Closing this box indicates that you accept our Cookie Policy.

Hunting Your DNS Dragons

Get Started Skip Tutorial. Cancel Update. All Questions Unanswered Questions.

splunk hunting queries

Can I run a query on my results from a previous query? Splunk query to determine how long a Splunk instance was down in past? How to regex multiple events, store it in one variable and display based on User click?

Writing a join query to extract usernames from sessionID splunk-enterprise query queries query-string. List queries along with CPU usage splunk-enterprise cpu queries usage. How can I create a query to find dashboard usage and top used dashboards of all the dashboards in my environment? Query on Data models Splunk Enterprise Security splunk-cloud data-model queries model. How can I find out the average run time of a query?

ATT&CKized Splunk – Threat Hunting with MITRE’s ATT&CK using Splunk

Splunk help - query latest event based on a field and count value based on another field splunk-enterprise queries counts. Join result of two queries with common field? Can anyone suggest how I can create a join query using pattern queries pattern pattern-matching. Query which allows close all notables events considered as FP Splunk Enterprise Security notable-event queries notable.

Query joining 3 sourcetypes splunk-enterprise sourcetypes queries joins. What would cause longer time span queries to auto close after data is migrated to a new host?

Splunk query for sum of fields splunk-enterprise sum queries. Splunk Query help to find time difference splunk-enterprise queries time-difference. Why doesn't my base search query work?Contributors of all backgrounds and levels of expertise come here to find solutions to their issues, and to help other users in the Splunk community with their own questions. This quick tutorial will help you get started with key features to help you find the answers you need.

You will receive 10 karma points upon successful completion! Karma contest winners announced! I am new to splunk and was wondering if anyone has a document they don't mind sharing detailing "example search queries" as a starting point? Answered by hagjos Ghanayemyou can refer to Splunk Search Tutorial with mock data and step by step instruction for creation of Splunk Dashboard.

For various Splunk Commands and Examples, you can refer to Splunk Documentation itself which are listed on the left side.

Attachments: Up to 2 attachments including images can be used with a maximum of Answers Answers and Comments. Calculate percentage 3 Answers. Translate sql to Splunk search language 1 Answer. How to extract fields from json wrapped inside a XML data 1 Answer. Why did forwarding stopped then ended with ApplicationLicense info entry in the logs 2 Answers.

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more including how to update your settings here.

Closing this box indicates that you accept our Cookie Policy. Get Started Skip Tutorial. Welcome to Splunk Answers! Not what you were looking for? Refine your search. Splunk search query examples. Question by Ghanayem Most Recent Activity:. People who like this. Accepted Answer. Jan 12, at AM Jan 12, at AM 6.

Answer by mayurr I'll self promote here. Sorry, not sorry. Another site bbosearch has a few queries as well. Answer by hagjos User badges Check to take badge. Post Your Answer to this Question Before you post your answer, please take a moment to go through our tips on great answers.This blog post is part fifteen of the " Hunting with Splunk: The Basics " series.

Derek Kingour security brother from England, has chosen to write on a subject near and dear to my heart—DNS. Derek deals up some oldies but goodies, shows some awesome visualizations, and then brings some new slaying techniques to the adversary battle.

Threat Hunting with SPLUNK Workshop for WiT 12_17_18

Oh no! Since you've been an avid reader of "Hunting with Splunk: The Basics" series, you all know that good hunting starts with a hypothesis or two. You could hypothesize that the adversary might use DNS to move sensitive files out of your organisation or use it as a side channel for communications with malicious infrastructure. With the right visualizations and search techniques, you may be able to spot clients behaving abnormally when compared either to themselves or their peers!

If you're already sucking DNS data into Splunk, that's awesome! There are many questions you can use to support your hypotheses. For example, if your hosts are compromised they may show changes in DNS behaviour like:.

splunk hunting queries

These are adversary techniques we can craft searches for in Splunk using commands like statstimecharttablestdevavgstreamstats.

In the section below, I will show you some ways to detect weirdness with DNS based on the techniques highlighted above. We begin with a simple search that helps us detect changes over time. The first line returns the result set we are interested in, followed by the timechart command to visualise requests over time in one-hour time slices. Clients with an unnecessary number of events compared with the rest of the organisation may help to identify data transfers using DNS. Both A records and TXT records should be observed carefully as these are common techniques.

Continuing to keep things steady for a start, we again begin with the same dataset and use the timechart command to visualise the record type field over time in one-hour slices. This search could be used in conjunction with the previous search by including a client IP of interest to help follow our hypothesis. Spotting changes in behaviour early is a great way to reduce the impact of a compromised host.

Using Splunk to search historical data helps to identify when a host was initially compromised and where it has been communicating with since. Events that have significant packet size and high volumes may identify signs of exfiltration activity.

The stats command provides a count based on grouping our results by the length of the request which we calculated with the eval statement above and src field.

Sort is applied to see the largest requests first and then output to a table, which is then filtered to show only the first 1, records. We can then use the scatter chart to visualise.Splunk Websites Terms and Conditions of Use. Note that the API is rate limited, and also returns max events to make sure to include extra where clauses to stay below this limit. Splunk AppInspect evaluates Splunk apps against a set of Splunk-defined criteria to assess the validity and security of an app package and components.

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world.

Find an app or add-on for most any data source and user need, or simply create your own with help from our developer portal. Splunk Cookie Policy. We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website.

Learn more including how to update your settings here. Accept Cookie Policy. My Account. Login Signup. Accept License Agreements. This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support.

If you have any questions, complaints or claims with respect to this app, please contact the licensor directly. I have read the terms and conditions of this license and agree to be bound by them. I consent to Splunk sharing my contact information with the publisher of this app so I can receive more information about the app directly from the publisher.

Thank You. To install your download For instructions specific to your download, click the Details tab after closing this window. Splunk AppInspect Passed. Admins: Please read about Splunk Enterprise 8. Overview Details. Why does this add-on exist? There is no need to install this add-on on an indexer too. Paste the client id under username, and the client secret under password.

Give it a name e. How do I configure the Azure side of things?This blog post is part twenty-two of the " Hunting with Splunk: The Basics " series. Finding it can be difficult because adversaries often use legitimate credentials to move around your network.

Derek drops some sweet Splunk knowledge below on how to use Splunk to detect those baddies in your network. If you missed it, then you have work to do my friend! My advice—go grab a coffee and buckle up for two blogs all in one!

Once badness makes an inroad into your network, the adversary has a set of goals—steal credentials, persist, find the good stuff, exfiltrate the good stuff and get paid! To do that, they need to move laterally either by using exploits against other vulnerable hosts, or by using legitimate tools but for malicious purposes. Our hypothesis is that legitimate Windows tools can be used against us for moving laterally within our network.

How might the adversary be hopping from one machine to another without exploiting vulnerabilities? Some long-established tactics are well known; remotely creating WMI processes, scheduling tasks and creating services are often seen. Psexec is a great sysadmin tool that allows administrators to remotely connect to other machines and carry out admin tasks, and it's often found legitimately on networks.

But what if psexec was used to gain a remote shell or execute a PowerShell cradle on the remote machine? Let's look at how we can hunt for this type of activity. When looking for lateral movement, we're identifying processes connecting remotely into a host. Our initial search could use Windows security logs, looking for authentication events over the network from rare or unusual hosts or users.

The EventCode for a successful Windows logon isthe LogonType of 3 is a network connection and privilege escalation events. With our result set, we count the events for each host and display the source IP address, EventCode and user that authenticated.

Finally, we sort them in ascending order to surface rare events. Using this information, we begin to lean in on hosts of interest. In particular, we see that administrator has logged into host Win from IP address This is definitely not an admin or IT support address; this is another client machine on the same subnet.

Interesting and warrants a closer inspection! We can use Splunk to drill directly into these raw logs by clicking on the row and viewing the events. We now see the time the events occurred, two of which happened in fairly close proximity to one another.

We can now modify our search to query all events from that host and narrow the time range to focus on activity occurring around these two events to see what else happened on that host.

At this point, we know the administrator connected remotely and ran psexec, but we have no idea of the context, good or bad!


thoughts on “Splunk hunting queries

Leave a Reply

Your email address will not be published. Required fields are marked *