Lab) Splunk Investigation 4 Solution Flashcards
Lab) Splunk Investigation 4 Solution
To get Splunk ready, we’ll open a Terminal using the icon on the bottom toolbar and enter in the following command: sudo systemctl start Splunkd. After a minute we’ll open Firefox and visit 127.0.0.1:8000. Next we’ll click on the ‘Search & Reporting’ app on the left-hand side of the Splunk homepage.
We need to make sure we can see all of the logs as they were generated back in 2020. To do this we’ll click on the timeframe selector on the far right and select OTHER > All time on the right.
Whenever we conduct a search we want to start the query with index=”botsv1” to ensure we are loading the right data.
We’re ready to get started with the lab questions!
Q1
Question 1 - Click on Dashboards and go to Splunk Investigation 4. How many Suricata alerts are there, and how many Fortigate alerts are there?
First we’ll click on Search & Reporting App, then Dashboards at the top of the page. At the top of the Splunk Investigation 4 dashboard we can see two panels being used as counters for both Fortigate alerts and Suricata alerts.
Q2
Question 2 - Edit the dashboard and look at the search query for the Fortigate Alerts counter. What is the full query used to generate this number?
To see the search queries that are powering dashboard panels we first need to Edit the dashboard in the top right corner. Then we can click on the magnifying glass icon of a panel, which is the ‘Edit Search’ option.
Q2 encore
Q3
Question 3 - What is the full query used to generate the Suricata Alerts counter?
We’ll take the same actions as we did for Q2, and click the magnifying glass icon on the Suricata Alerts counter panel to see the search query behind it.
Q4
Question 4 - Click on the Suricata alert titled ‘Information Leak’ to see the associated events. What is the source IP address, and what is the destination IP address?
We can find this alert category on Line 6 of the Suricata Alerts (Categories) table.
Q4 contd
Looking at the 2 events, we can see the dest_ip and src_ip are shown immediately, giving us our answer. The external IP 40.80.148.42 is connecting to our internal system which is hosted internally on 192.168.250.70 on port 80 (HTTP).
Q5
Question 5 - What action did Suricata take after observing these events?
Just looking at the events in the screenshot above, we cannot see any fields that would tell me what actions Suricata took, so we’ll click on ‘Show as raw text’ at the bottom of each event to change the displayed format. We can now see a field called ‘action’!
In this case, both events were allowed by Suricata. If this tool is deployed in Network Intrusion Prevention System mode (NIPS) as opposed to Network Intrusion Detection System (NIDS) then it could take actions to stop malicious connections, such as applying the ‘block’ action to end the connection!
Q6
Question 6 - We know the alert category is ‘Information Leak’, however the specific signature can provide us with more information about this activity. What is the signature shared by both events?
In the below screenshot, we have showed two different ways to view this field within the Suricata logs. This signature is a lot less generic than the category, and can provide context to what is actually happening.
Q7
Question 7 - Based on the logs, combine two fields to understand the full website addresses being accessed by the attacker (Remember, in some logs a “/” character must be escaped by putting a “" in front of it. You should not reference the “")
Looking at the logs we can see two fields that will help us answer this question: hostname and URL. Using these we can see the two targeted full URLs were:
imreallynotbatman. com/phpinfo.php5
imreallynotbatman. com/phpinfo.php
Q8
Question 8 - What HTTP status code is returned to both of these requests, that tells us this attack was not successful?
Looking at the logs we can see a field named ‘status’, where the value is 404 for both event. This tells us that the attacker tried to reach these URLs, but there is nothing there (Error 404, Not Found).
Q9
Question 9 - Return to the Dashboard and click on the Suricata alert titled ‘A Network Trojan was detected’ to load this search. Modify the search query to show count of every signature field within this alert category. How many unique suricata signatures are present?
Looking at the Suricata Security Alerts (Categories) table we can see the category we want on line 3.
We’re being asked to identify how many signatures are found within this category of alerts. To do this we’ll add the following to our search query to get the count of signature values: | stats count by signature. Looking at the Statistics title, we can see there are 12 unique signatures that have been observed within logs for this category.
Q10
Question 10 - Search manually through Suricata logs where the HTTP status code is 200, then perform a count of each signature field to find two signatures that reference a vulnerability CVE identifier. Search this CVE on the National Vulnerability Database.- what is the CVSS Version 3 Score?
Okay - there’s a lot to do in this question, so let’s go step by step. Firstly we’ll build our brand new search query for Suricata logs, specifically alert logs, where the status code is 200. The query will look like this: index=”botsv1” sourcetype=suricata event_type=alert status=200.
Q10 contd
Great, next we need to get the count of values in the signature field. We’ll add the following to our search: | stats count by signature.
Q10 contd
Great, we’ve found the reference to a Common Vulnerability and Exposures identifier, used as an identification method for vulnerabilities. Next we’re asked to find the score of this vulnerability, so we’ll search for it on Google using the search “CVE-2014-6271 national vulnerability database”.