What You Need Before We Dive In
Before we jump in, make sure you've got the following essentials:
- VirtualBox or VMware: Your trusty sidekicks for virtualization.
- Basic Linux and Virtualization Skills: Not your first rodeo with Linux and virtual machines? Perfect.
Task 1: Spin Up Your Elastic Account
First thing’s first: we need an Elastic account to get our cloud-based SIEM rocking.
- Sign up for a free trial at Elastic Cloud.
- Once you’re in, log in to the Elastic Cloud console at Elastic Cloud.
- Hit “Start your free trial.”
- Next, “Create Deployment,” and pick Elasticsearch as your go-to type.
- Choose your region, deployment size, and then click “Create Deployment.”
- Hang tight while the magic happens.
- When it’s done, hit “Continue.”
Task 2: Get the Agent Rolling
The Elastic Agent is like your SIEM’s personal assistant, collecting logs and feeding them back to your Elastic instance.
- Log into your Elastic SIEM and head over to Add Integrations via the Kibana menu.
- Search for “Elastic Defend” and click to open the page.
- Smash that “Install Elastic Defend” button and follow the prompts to install the agent on your Kali VM.
- Copy the Linux command they give you and paste it into your Kali terminal.
- Wait a few minutes, and you’ll see “Elastic Agent has been successfully installed.” Logs will start flowing soon after.
Task 3: Make Some Noise (Generate Security Events)
Time to create some security events to make sure there are some logs that we can analyze. We’ll use Nmap and hydra to simulate attack.
1. Keep the action going with more scans like:nmap -sS <ip address> nmap -sT <ip address> nmap -p- <ip address>
hydra -l mrkk -p passwords.txt ssh://<ip of the machine> -t 4
These scans will generate security events that your SIEM will pick up, like a boss.
Task 4: Hunt Down Those Events in Elastic SIEM
Now that you've flooded your SIEM with logs, let's find them.
Inside your Elastic deployment, click on the menu icon (three lines) and navigate to “Logs” under Observability.event.action: "hydra"
Hit “Search.” Your results should show up below.Note: If nothing shows up right away, give it a bit of time. The logs are just playing hard to get.
Task 5: Visualize the Chaos
Now, let’s make those logs pretty with some dashboards.
Go back to the Elastic portal, and this time head to “Dashboards” under Analytics.Add a new visualization by selecting “Create Visualization” and choose Area or Line depending on your vibe.
In the Metrics section, set it up so that you’re showing Count for the vertical axis and Timestamp for the horizontal.
Save your masterpiece and admire your work.
Task 6: Set Up Alerts and Never Miss a Thing
Finally, let’s set up alerts so you can get a heads-up whenever something fishy happens.
Go to “Alerts” under Security.Congrats! Now your SIEM will keep a lookout for Nmap scans and let you know when they happen.
Wrapping It Up
And there you have it! You've just built a home lab using Elastic SIEM and Kali Linux. You’ve set up an agent, generated security events, analyzed logs, created dashboards, and set up alerts—all in a day's work. This lab is an awesome sandbox to practice your security chops and get ready for the real world.
Next Steps
- Experiment with different security events and see what you can uncover in Elastic SIEM.
- Test out your alerts by triggering Nmap scans on your Kali VM.
- Dive deeper into Elastic SIEM’s analysis and visualization tools to get a real handle on your security logs.
- Explore integrations with cloud providers like AWS or Azure to take your SIEM skills to the next level.
Thanks for hanging out! I hope this guide helped you level up your security game. This is mr1diot signing off until next time Happy Hacking!