06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Defence & Detection · MyDFIR · · 21:45 runtime

Build a SOC Lab with Wazuh: Deploy the Server (Part 1)

In the wiki WazuhVMware WorkstationWindows 10 Also namedOracle VirtualBox, Proxmox, ESXi, VMware Fusion
Transcript 3336 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

Welcome to part one of seven of the Wazuh SOC Analyst Challenge. In this one, we are going to be deploying our Wazuh server from the ground up, and by the end of the video, you will have a running Wazuh instance with your dashboard up and running and archives enabled, ready to start connecting machines. Now, if you have not watched the intro and the Wazuh 101 yet, I would recommend you go back and catch those first. The intro is going to cover the challenge and the giveaway, and the 101 is going to teach you what Wazuh actually is. So, this will all make sense. All right, let's get right into it. To get started, we want to first install VMware Workstation, as that is the hypervisor that we are going to be using. Now, of course, you can obviously use something like VirtualBox or something else like Proxmox or even ESXi, but in this instance, I am going to be using VMware Workstation. So, head over to broadcom.com and then click into the support portal. From here, you want to click into register if you do not have an account already. Now, there is something to note, do make sure that you are not connected with a VPN because if you are, then you are going to have some difficulties registering for an account.

Now, once you've logged into your account, you want to head over to software, which is located on the left-hand side, and then you want to select VMware Cloud Foundation. From here, go and select my downloads, and then you should see free software downloads available here. So, let's go ahead and click into this hyperlink. And then all we need to do is just scroll down until we can find VMware Workstation Pro. Now, if you are on an ARM Mac, then you can select VMware Fusion instead, but that is out of scope for this challenge. Upon clicking into the VMware Workstation Pro, just make sure that you select the proper operating system. In this case, I am going to select the VMware Workstation Pro 26 H1 for Windows. Go

ahead and click into the release, and let's make sure that we accept the terms and conditions. Now, if you highlight over it, you might notice that you're unable to check it. That is because we do need to select and click into the terms and conditions. By clicking into it, it will open up a new tab, so we can just select the previous one, and now we can check it. From here, we can click on this cloud icon to download, and it'll ask you to fill out some additional information. All right, once you've filled out the information, go ahead and select the cloud again, and now we can save it to our desktop or whichever directory you want.

Now, depending on the browser that you're using, you might get an unverified download blocked. So, go ahead and select the right arrow, so this right here, and then click into download unverified file. Now, as a sanity check, we can also verify the MD5

just to make sure that nothing was changed during the download. Taking a look here, the MD5 begins with 83F and

ends in 0AF. Now, what we can do with that information is head over to our desktop, and we can find the installer right here. I can hold shift, right click, open up PowerShell window, and then do a get-filehash -algorithm, type in MD5, and then point it over to our installer. Taking a look, our hash begins with 83F and ends in 0AF. So,

this completely matches. That means we're good to go. Go ahead and close that out, and let's install VMware Workstation. All right, after a couple minutes, it has completed. So, let's go ahead and open up our VMware Workstation, and just to confirm, it is Workstation Pro 26 H1.

Now, there are a couple of things that we need to do in order for us to get Wazuh up and running. The first is to download a Ubuntu server ISO image.

To do that, we'll head over to our web browser. And then let's search up Ubuntu.

I'll click into the products, and then I am going to select Ubuntu server. And then go ahead and select download Ubuntu server. And as we can see right here, the current version as of recording is Ubuntu 26.04. Now, depending on when you're watching this, this version might work with Wazuh. But, just in case, I am actually

going to download an older version, specifically Ubuntu 24.04.

To do this, I'll click into the checkout our alternative downloads. So, click into that. And then from here, you want to select past releases. And we want to find the Ubuntu 24.04.

So, let's go ahead and click into that. And we are looking for the server install image. Go ahead and select that, and there you go. Click into save, and I am going to leave the links in the free community. So, if you plan on doing the giveaway, or maybe you just want the resources, make sure you check out the free community, and then you can grab it from there. While this waits, because yeah, it's going to take me about 2 minutes, but download speeds may vary. While we wait for it to download, let's search up for another ISO image, specifically Windows 10. Now, you could go with Windows 11, because it is newer and more recent, but I find with newer operating systems, it can just be a little bit more finicky.

So, instead, I'm just going to look for a Windows 10 ISO. Click into that, and this is the microsoft.com, by the way. You don't want to go go some other random sketchy site and then we want to select create Windows 10 installation media. Go ahead and save that. And take a look. It says unverified download blocked. Let's go ahead and download it. And that's good. Perfect. Click on yes. Let's go ahead and accept this. And while this is getting ready, just in case, if you wanted the Windows 11 ISO, you simply type in Windows 11 ISO and you click into the same microsoft.com page and you pretty much do the same process, but in this case they actually have an ISO that you can simply install from here. Whereas for Windows 10, it requires us to create an

installation media. And that is what we're doing right here. So, when you get to this page, if you're following along by creating a Windows 10 ISO, you'll see upgrade this PC now or create installation media. I am going to select the create installation media and I'll use the recommended options and we want to select ISO file. Just like all of the files, I am going to be placing it under my desktop. Cool. While this is getting a few things ready, our Ubuntu image is now successfully downloaded. So, I'm going to minimize the web browser and let's open up our VMware Workstation Pro. Click into create a new virtual machine.

And I am going to select custom. Click on next. For the hardware compatibility, I am going to select the Workstation 25 H2 or later. Click into next. And then we want to select the installer disk image file, the ISO file. Click

into browse, head over to our desktop and then let's double click our Ubuntu 24.04 image. Click into next and let's name this as Wazuh server. For the processors, I'll leave it as two. For the memory, I am going to put this up to eight gigs. So, right here. 8192 megs, aka eight

gigs. I am going to keep this as NAT, aka the network address translation, and I'll leave this as is. Next. Next. For

the disk space, let's do 100 gigs. Next and next. Just

to make sure that we're good to go, we have 800 gigs of disk space, the is

eight gigs, the network adapter is set to NAT, and we have two CPU cores. That

looks pretty good to me, so let's click into finish. And there you go. All right, let's quickly go through this installer here. Click on done, done, done, continue. For the name, let's just say my DFI R. The server name is going to be Wazza. Username is my differ. Choose a password. Let's just do my differ again. And continue. I am going to install OpenSSH server, so do make sure to select that if you want to follow along, and I will explain why in a bit. Click on done, and now we wait. So, the reason why I chose to install the OpenSSH server is so that I can SSH from my host

machine into my virtual machine. Because in my opinion, working inside the virtual machine via VMware is kind of difficult. So, I would much rather SSH directly from my host into the virtual machine. And that again is why I installed OpenSSH server. All right, eventually you will see the reboot now, and once you see that, go ahead and reboot it. Upon selecting reboot now, you are going to come across this message saying failed unmounting CD-ROM. Don't worry about it, simply press enter, and you're good to go. Now, what you can do is also select VM at the top, go into settings, and then under the CD, you could simply disconnect it at power on, and then you shouldn't see that message anymore. All right, let's go ahead and log in.

And I want you to take note of the IPv4 address located at the top right corner. Now, yours is going to be different than mine. Mine is currently 192.168.136.128.

The reason why we want this IP address, and actually, let's go ahead and open up a notepad just to keep note of it. 192.168. 136. 128. Perfect. Go ahead and copy that, and I am going to open up PowerShell. And now, I'll type in SSH my DFIR at, and then let's paste in that

IP address. Go ahead and hit enter, and then type in yes, and now let's type in our password. So, what we just did was SSH from our host into our virtual machine, as you can see right here. It says, "What's up?" Now, this method is something that I typically much rather compared to something like working directly in VMware. But, you are absolutely free to do whatever you like. But, from this point onward, I am going to be using SSH from my host machine. All right, so now that we're in here, the first thing I'm going to do is type in sudo apt-get

update, and sudo apt-get upgrade -y. Type in my

password, and off we go. Essentially, I am updating and upgrading all of the repositories within this virtual machine. All right, once that is done, let's go into our web browser, open up a new tab, and then head over to wazuh.com. Then let's select install Wazuh. Scroll down and you want to select quick start. From here we'll scroll down and we want to copy this command right here. Now do keep in mind as a recording we are using a version 4.14. Open up our PowerShell session. Clear out the screen and let's paste that in. Perfect. After a couple minutes we now see this screen which will contain your username which is admin and also your password. Now from here of course best practice is to change your password and also put it in a password manager.

However, because this is just a challenge/project, I am going to be doing something very terrible. I do not recommend this in production, but I'm just simply going to add in admin and the password under our notepad here. So let's go ahead and test it. I am going to copy the IP address, open up the web browser, and I am going to paste in our IP address colon 443. An

alternative way that we can do this is instead of specifying the port, we could also say https colon slash slash.

Go ahead and hit advanced and proceed. Type in our username and our password. Now again, yours is going to be different than mine. So do make sure that you copy yours and log in. Awesome.

And here is our dashboard. Now there are a couple of extra things that we need to do before we end off the video and that is to enable archives. So to do this, let's head back over to our Wazuh SSH session and I'll clear out the screen. Now you might be like, "Woah, Steven, I forgot to completely take the username and password. I did not note it down. Where do I find it? Well, if you type in ls, we will see that there is a wazuh-install-files.tar. And what we want to do from here is just essentially untar it. So, we can type in tar {dash} xf and then point it over to the wazuh-install-files.tar file and hit enter.

Now, you might get Wait a second. Permission denied. Well, no worries. Hit the up arrow key and then let's type in sudo and hit enter. Now, if we type in ls, we should see a directory called wazuh-install-files. Let's change into that directory. And oh, permission denied. What do we do? Well, let's type in sudo, su for switch user and the minus sign or the

dash. And by doing so, we automatically change into the root account. Now, let's change into our home directory of my defer or whichever user account that you created and then head over to the wazuh-install-files directory. From here, we will type in ls and we can find a file called wazuh-passwords.

Hm. Let's go ahead and open that up by typing in cat wazuh-passwords

and here we go. These are all of the credentials related to our wazuh instance. And if we wanted to find our admin account, that is right here. Just to make sure the password here starts with xou or I should say x0u and that is correct.

Cool. And this also does contain your wazuh API user, by the way, which is something that you can use to perform some automation down the road. So, that's how you can retrieve your username and password if you forgot to copy it. All right, so let's go ahead and exit this. And now we are dropped back into the regular user. So now let's go ahead and enable archives and by the way, what archives does for us is essentially allowing Wazuh to monitor and capture

pretty much all the telemetry that we throw at it. For example, if we head over to the dashboard and then we'll click into explorer, go into discover. Take a look. It is currently under the Wazuh dash alerts index. And by default,

Wazuh is going to capture telemetry or events that are related or responsible for generating these alerts. But if I were to look for something like successful logons that generated no alerts, we won't be able to see that in Wazuh. Unless, of course, we enable something like archives, which is exactly what we're going to be doing. So heading back over to our SSH session, we want to configure something called the ossec.conf file. And to find that file, it is actually located under the var directory ossec. Now you might notice that we get a permission denied and that is because, well, we do need to use the root account to modify the configuration. So let's go back into sudo su dash and we'll do ls

dash la var ossec. And there you go. We can see that it is currently under the root account and also the Wazuh account. From here let's go ahead and change into that directory and we want to go into etc. Type in ls and then we should see the file called ossec.conf. So I'm going to clear out the screen and I'll type in nano ossec.conf. And of course, you can use whichever text editor you want, but nano should do the job. From here, take a look under the OS _config. You might notice that a log all and log all_json is set to no, and that is the default configuration. So, let's go ahead and change no to yes.

And I'll do the same for the JSON, and we should be pretty good for now. Let's go ahead and save it up by holding control X, Y to save, and enter. Now, as

a very important note, anytime you make

configurations under the OS _config file, you must restart the manager. For

example, I'll type in systemctl restart wazuh

and I'll hit tab twice to show you the available options. So, we have the wazuh-dashboard service, the indexer, the indexer-performance, and the manager. The manager is what we want to restart every time we make a configuration under the OS _config file. So, I'll type in wazuh-manager, again, hit tab for auto-completion, and enter. Once that is done, the next thing we want to do is modify the filebeat configuration. So, I'll clear up the screen. We want to change into the

Type in ls -la, and we should see a file

called filebeat.yml, aka YAML. So, I'll type in nano filebeat.yml.

And then, we want to scroll all the way down until we see this right here.

So, under archives, it says enabled false. We want this to be

true. Go ahead and hold Ctrl X, Y to save, and enter. Clear the screen, and let's restart our Filebeat service. So, I'll type in systemctl restart Filebeat. Perfect. Now that that's good, let's head back over to our Wazuh dashboard, and we want to select the hamburger icon, scroll down into dashboard management, and we want to select dashboard management. On the left-hand side, you will see index patterns. So, let's go ahead and click into that. And currently, we do not see an index pattern for Wazuh dash archives. So, we do have to create it.

Let's go ahead and search up the index pattern name, which is going to be wazuh-archives. And if you did everything correctly, you should see a wazuh-archives-4.x.

Go ahead and select next step. For the time field, I'm simply going to select the timestamp at the bottom. And create index pattern. Cool. And just like that, we created a new index pattern. What we can do from here is click into the hamburger icon, go into discover, and if we were to select the drop down, we should now see the wazuh-archives, and we do have some events. 110. Now, of course, your events may differ, but at least we do see some events. Before we end it off, one last thing, head over to your VMware Workstation, click into your Wazuh server, and right click it, go into snapshot, and take snapshot. I'll name

this as Wazuh configured, and take the snapshot. By taking a snapshot, if we were to mess up down the road, we can always revert back to a known good state. Awesome. By now, you should have your Wazuh server deployed, your dashboard reachable, and archives turned on so that we are now capturing everything and not just alerts. In the next video, we are going to spin up our Windows and Ubuntu machines and get agents connected so Wazuh actually has something to watch. I'll see you in part two. That is it for the video and I hope that you found that informative. If you did, let me know by hitting that like button and subscribe if you want to. Remember to stay curious and do things differently.

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 538 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks