Jasper Alblas
Jasper Alblas
Mastering Data & Cybersec
Welcome to this walkthrough of the Investigating with ELK 101 Room on TryHackMe. ELK stands for Elasticsearch, Logstash, and Kibana, a powerful trio of open-source tools used for search, logging, and data visualization. Elasticsearch handles fast search and analytics, Logstash processes and ingests data, and Kibana offers an intuitive dashboard for visualizing results. Together, they provide a scalable and flexible solution for managing large volumes of data in real-time.

Room URL:
https://tryhackme.com/room/investigatingwithelk101
I am making these walkthroughs to keep myself motivated to learn cyber security, and ensure that I remember the knowledge gained by these challenges on HTB and THM. Join me on learning cyber security. I will try and explain concepts as I go, to differentiate myself from other walkthroughs.
In this room, we will learn how the Elastic Stack (ELK) can be used for log analysis and investigations. Although ELK is not a traditional SIEM, many SOC teams use it like one because of its data searching and visualizing capability. We will explore how the components of ELK and learn how log analysis can be performed through it. We will also explore creating visualizations and dashboards in ELK.
Learning Objectives
This room has the following learning objectives:
Answer: No answer needed
The Elastic Stack (also known as ELK Stack) is a collection of open-source components that work together to help users gather, search, analyze, and visualize data in real-time from various sources and formats. Here’s a brief overview of the components:
Logstash processes and normalizes the data. So this is a no.
Answer: nay
Eliasticstash stores JSON-formated documents. So nay! No other data formats are supported.
Answer: nay
ABefore proceeding with the following tasks, start the attached virtual machine by clicking the Start Machine in the THM room.
The machine may take 3-5 minutes to start. After the machine starts, the ELK Instance can be accessed at http://MACHINE_IP if you are connected with the TryHackMe VPN. If you are not, you can open AttackBox and access the ELK instance by copying and pasting the MACHINE_IP into its web browser.
Use the following credentials for the ELK instance.
Username: Analyst
Password: analyst123
When you open the ELK instance through this task, each upcoming task will guide you through the features in detail and ask you some questions. These questions can be comfortably answered if you follow along with the tasks.
Answer: No answer needed
The Discover tab is where SOC analysts spend most of their investigation time. It allows searching, filtering, and analyzing raw log data.
vpn_connections).Use the Time Filter in the top right corner to adjust the time filter from the 31st of December 2021 to 2nd February 2022. Press refresh. You should see 2,861 hits left after filtering.

Answer: 2861
Look at the Fields Pane. Here you should be able to find the Source_Ip field.

Select it, and you should be able to see the top 5 values. The first one has the highest number of connections.
Answer: 238.163.231.224
The process here is similar. Find username in the fields pane, select it and find the top value:

Answer: james
Select all columns using the “toggle column in table” button.

Answer: No answer needed
Select the UserName field in the Fields Pane. Find Emanda and select the little + icon right beside it. This filter aways all other documents that do not originate from Emanda.

Now, select the SourceIP field (it should be under Selected fields).

As before, simply look at the top value – 107.14.1.247 in this case.
Answer: 107.14.1.247
Remove the filtering on Emanda. On the timeline, select the bar containing the 11th of January:

Now the data gets filtered on this specific date. Now you can just select the Source_ip field once more in the fields pane and see the top 5 values:

The IP is 172.201.60.191.
Answer: 172.201.60.191.
Remove the timeline filter (you should be able to press back on your browser). Now select the SourceIP field, find the 238.163.231.224 value, and press the + icon beside it. Now select the Source_State field and find New York State. Instead of pressing the + icon to filter ON the value, we press the – to remove all documents which have New York State as field value.
Now simply find the total documents left:

48 connections are left!
Answer: 48
Kibana Query Language (KQL) is a powerful tool for searching logs and documents in Elasticsearch. It supports both free text and field-based search, making it flexible for different use cases.
security) returns documents containing that term, regardless of the field.United won’t match United States.United* to match partial terms.KQL supports:
OR — e.g., "United States" OR "England"AND — e.g., "United States" AND "Virginia"NOT — e.g., "United States" AND NOT ("Florida")Target specific fields with the format FIELD : VALUE:
Source_ip : 238.163.231.224 AND UserName : SulemanTo dive deeper into KQL, check the official Elastic guide.
If you are familiar with SQL and logic statements, this one should be easy. Read the theory in the room and the query should be easy to construct:
Source_Country : "United States" and (UserName : "James" or UserName : "Albert" )Answer: 161
The first part is easy, but the date filtering took me some googling to find out. Of course you can also use the filter function instead of using KQL. But if you want to learn something new the syntax is as follows:
UserName: "Johny Brown" and @timestamp > "2022-01-01T00:00:00.000Z"Answer: 1
The Visualization tab in Kibana helps transform your log data into clear, visual insights using tables, pie charts, bar charts, and more.
Source_Country vs Source_IP).Source_Country field.Click on the UserName field and press Visualize:

This requires some playing around. I also dragged the action field (which includes the failed action!) into the graph, and changed it’s type table. Make sure username is on the Rows part and action on the Columns. Now we can sort on failed:

Simon has the highest number of failed connections. Well, actually he is the only one with failed connections.
Answer: Simon
This is a confusing one! I again added action on the horizontal axis, but this time broke it down by @timestamp. On the vertical axis I used the count() function.

Now looking at the dates all the failed connections are on the left bar (green), but this correlates to the december date. So I am not sure why 274 is the answer, as I had thought that it should be the blue bar (which is 0 in the above screenshot above “failed”. But anyway, 274 seems to be the answer.
Answer: 274
Dashboards in Kibana offer clear visibility into log data and can be tailored for specific needs—like monitoring VPN activity.
This approach lets you combine insights from various sources into a single, easy-to-read view.
I will leave this one to you 🙂
Answer: No answer needed
In this room, we briefly explored ELK components and then focused more on the Kibana interface and its features. While exploring Kibana Interface, we learned:
Answer: No answer needed

Congratulations on completing Investigating with ELK 101. I hope you can see why Kibana and Elasticsearch of the Elastic stack is such a powerful and popular piece of software. It really makes investinging logs quicker and more fun!
Come back soon for more walkthroughs of rooms on TryHackMe and HackTheBox, and other Cybersecurity discussions.
Find my other walkthroughs here.
You are welcome to comment on this post, or share my post with friends.I would be even more grateful if you support me by buying me a cup of coffee:

I learned a lot through HackTheBox’s Academy. If you want to sign up, you can get extra cubes, and support me in the process, if you use the following link: