06:00 UTC Charta Aetatis Cyberpunk

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

Build a SOC Lab with Wazuh: Generate + Read Telemetry (Part 3)

Transcript 4726 words · auto-generated captions

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

Welcome to part three of seven of the Waz sock analyst challenge. In today's video, we are going to be generating some activity across our machines and we will go over some of the logs that it produced together. By the end, you will be able to look at a login, an account change, and an SSH session and actually understand what happened. Let's get started. All right. To begin, I do want you to start off with the Windows virtual machine, which in my case, the IP address is 192.168.136.130,

which is what you can see at the top. And I am currently connected via RDP from my host into our Windows virtual machine. So, I'm going to head over to our start menu, type in cmd, and run as

administrator. Click on yes. And we are

going to be running a couple of commands here. The first one is going to be who am I. So this is going to show us the

host name of the computer and also the username which in our case is Bob. I'm going to do IP config /all. This is

going to show us information about our well network adapters. Here we have our Ethernet adapter. This is the IPv4 address. Here's our default gateway and our subnet mask. I'm going to type in net user. This command will display all of the local user accounts on this particular host. We'll do net local group

administrators and this is going to show us who is under the administrators group which in our case we have administrator which is the user account and we also have the user account of Bob. Now, before we run the next command, I do want to show you something. If we head over to the start menu and type in computer management, go

ahead and expand local users and groups. Click into users. And I want you to pay attention to the user guest. Notice how there is a down arrow. This is essentially meaning that the account is disabled. And for proof, we can go into the properties and take a look. By default, the account is disabled. So if somebody were to try and log in as the guest account, they would be denied simply because the account is disabled. I am going to run a command called net user guest forward slashactive

colon. Yes, this is going to essentially enable the guest account. Now if I were to refresh, take a look. The down arrow is no longer there. The next command that I'm going to do is net user guest which is our

user account. And I will say my defer

pass. This is essentially going to change our guest account's password to my defer pass exactly how it's spelled.

I am going to run three more commands. So this one is going to be creating a new user. So I'll type in net user and let's just say student one with the password of well the most secure password and forward slash add.

This will create a new user account called student one. Now let's add that newly created account into the local group of administrators. So I'll type in administrators student one slash add.

And if we were to do net local group administrators, we now see student one right here. Now, the last command that we're going to do is deleting a user account. So, I'll type in net user. And let's delete the account that we just created, which is student one. To do this, I'll simply type in for slashdelete.

And there you go. Now, we no longer have our student one account. Now, by running all of these commands on our Windows virtual machine, these in theory should be tracked in our Wizard dashboard. So, if I go ahead and minimize the RDP and log back into my Wazot dashboard, I should be able to search for those commands. So, let's go into the hamburger icon, click into discover, and let's make sure that we're filtering specifically for our Windows virtual machine. I'll click into the agent name and then let's click on the plus icon for our my defer- windows and let's just

change the time to last 15 minutes. And

from here let's expand the first event from the top and let's scroll down and take a look. Now it is a little bit hard to see. Do bear with me here. So we have the agent name which is my default windows. We have our agent IP address which is 1 192.168136.130.

The subject username and if we scroll down here we do see an event ID of 4726.

So what exactly is 4726? Well, if we open up a new tab and we type in Windows event ID 4726,

we'll see a resource called Ultimate Windows Security. And this, by the way, is something that I use pretty much daily. So, if we go into this resource, we can actually learn a little bit more about this particular event ID. Here specifically, it says a user account was deleted. And what do you know? We actually did delete the account. So, that's why we see this event in our Wiz dashboard. Now, let's go back over to the Wazal and let me walk you through how to actually read this log under the datawin. system message. This is actually the raw log itself. In other words, this is what you'll see under the event viewer. Now, if I scroll down just a bit, it can all fit under this one window. So, that's perfect. And now, let's explain what's happening. So, the first message here is going to be well the description of the event ID, which is a user account was deleted. And again we did identify that through this resource from ultimate windowscurity.com.

This is the event identifier 4726 under the security event log. And this event ID tracks a user account was deleted. So here we do see a subject. This is essentially the source. We have a security identifier aka a security ID.

We have an account name, an account domain and also a loon ID. These are all

under the subject. In other words, again the source. Each account is going to have an associated security ID and it does follow a particular format. So if we search up security ID format and go

into Microsoft learn, if we scroll down here, we can see that there is a SID architecture. And take a look right here. S--r. So the S is indicates the string is a SID. R is the revision level. X is the identifier authority value. And the Y is going to represent a series of sub authority values. We go back over to Waza. So the S is the SID, the revision,

the identifier, and the sub authority values. And if we scroll down here, you will come across well-known SIDs. And I'll let you take a look at this because it is quite important for you to understand whenever you come across identifiers. But you might notice that at the end there are four digits. Sometimes it is three digits but in this case there is four. So it ends in 1001.

This is essentially called a RID, a relative identifier. And if we scroll up just a bit here, you'll notice RID allocation. So each account is going to be given its own RID. And some of the more common rids that you'll see is 500

which is going to indicate administrator. 5001 which is going to indicate guest. There's 502 which is the KRBT TGT account. And there's a lot more down here which again I'll let you read it so you can digest it at your own pace but just something to keep in mind. So this is the subject. So who performed the action in this case Bob performed the action on the computer name of desktop-f. So whatever this is right here towards the target aka the destination where the

SID the security identifier ends in 1002

which resolves to the account name of student one. So if we were to summarize

this, the account of Bob under this computer deleted the account of student one on this computer which had a SID of

1002. Isn't that cool? So that right there is how you read the event ID of 4726. Now what other commands did we run? Well, we created an account, right? So

what if we search up account created

event ID? What is that? That is the event ID of 4720 under the security

event log. Now why am I specifying security event log? That is because event IDs can exist in multiple event logs. 4720 might mean account creation in the security event log, but it might mean something else in another event log. So that's why it's always good to specify that. So now that we know this particular event ID, let's go ahead and start searching for it. And how do we do that? Well, we can simply just type in 4720 and hope for the best. And we do have one hit. But there is a better way. Searching 4720 is kind of like a Hail Mary. So instead, what you want to do is actually look for the specific field where this value may exist. So, for example, let's go ahead and remove this.

Whoops, not youame. There you go. And we'll expand the first event from the top. And from here, we want to look for a field name where our event ID may live. So, if we take a look here, the field name of data.win.system.event

ID where the I and D are capitalized, it has our event ID value, which is 4726.

So wouldn't you say that we can simply well filter for this and change 4726 to

4720? And the answer to that is yes,

that is correct. So that's what we'll do. Now we can do this a couple ways. We can simply click into the filter for value which is the plus magnifying glass. Or we can type it in. So I'll type in data.wind.system.event event id colon 4720

and right here we have one hit. Now what if I were to do id lowercase what do you

think will happen? Well if you said no results then you would be correct because this is case sensitive. This as in field names are case sensitive.

All right let's take a look and see how we can read 4720. So I'll scroll back down, go into the data when system message and take a look. So here our message is a user account was created under the subject which again is our source. So who was responsible for creating the account? In our case it is Bob and Bob has this particular security identifier where the RID ends in 1001 and this was performed on this computer. So, desktop-fp and the new account that was created was named student one. And the student one account has a SID of this right here with the RID ending in 1002. And this

was created again on the same computer. All right. Now, if we go down and take a look at the attributes, we have the account name, which is student 1. We have a primary group ID of 513, an old

UAC value of 0x0, new UAC value of 0x15. Now, you might be

scratching your head, Stephen, what exactly does that mean? And that's a great question. So, what we can do from here is actually Google it. 4720 event

ID. And what we want to look for is the

Microsoft Learn. Now, we can go into the ultimate Windows security and take a look and see what kind of information this provides us. But when in doubt, it's always good to take a look at the actual documentation from Microsoft itself because there might be some additional information from the original source. Now, if we scroll down over to the attributes here and we want to go into the primary group ID because if we

go back over to our wasah, we can see that it has a primary group ID of 513.

So 513 essentially means domain users. For local accounts, this RID means users. So this tells me that the student one account upon creation was placed under the users group. Now if we take a look at the new UAC value. So this right

here. And if we click into the hyperlink, it will actually provide us with codes. And this is kind of getting a little in the weeds, but bear with me. 0x15. So we want to essentially take a look and find what exactly are these options.

So here you can see hex 1 2 4 8 10 20

40. And what we want to do is pretty much select the ones that add up to 15.

In other words, we have a 10 here. So this is going to be a user account. And then there is a four and a one. So the

four is a user password not required. and a one is user account disabled. So if we look at those three options that equals to hex 15 and again we can see

hex 15. Looking at the user account control we have account disabled, password not required and normal account. And that is exactly the same options that we selected, right? User account disabled, password not required and normal user account. Pretty cool, right? And that is pretty much it for the new account created. Let's do two more and then we'll head over to our Linux virtual machine. So a very common one is actually a user account log on and that is the event ID of 4624 under

the security event log and we do not get any results and that again is because it is the last 15 minutes. So what I'll do actually is log

in directly from the console.

So I'll do that and in theory we should generate a 4624 event.

And we do. Perfect. We have eight hits. And just as an FYI, do make sure that we are selected under the Wazah- archives. For alerts, you might be able to see it depending on what alert triggers based off of the event, but just in case, I would recommend using the Wazah archives just to make sure you see all of the events. All right, let's expand this and take a look. Under the Windows system message, we have the description, which is an account was successfully logged on. Taking a look at the account name here, we have wind-g.

Now, you might be wondering where the heck did this come from? Because if you recall, our computer name was desktop-f.

But yeah, if we were to go into our Windows virtual machine, type in system,

click into system information, and take a look. The system name here is desktop-f not the wind dash whatever. The wind dash is actually our old host name for

this computer. And I know again this is going a little bit too much into the weeds, but I did want to show you that under the old name, this is our win-a.

So just something to keep in mind. But that is essentially where this login is sourcing from, we have a loon type, which is a type two. And you might be scratching your head, what is exactly type two? What does that mean? Well, if we go into the Windows security log and type in 4624, search that up. And if we scroll down here, we do see Loon types. So there is

a LO on type of two, which means interactive. And that's correct, right? We actually logged in via VMware in our

console. So that is interactive. We have a loon type 3 4 5 7 8 9 10 and 11. 10 is

usually associated with RDP. So what we just did from our host machine into our Windows virtual machine and loon type three is often associated with SMB related login. Oh, and by the way, RDP login can also trigger a loon type of seven. That's just something to note. But yeah, this is essentially where you can take a look and see where those loons are sourcing from and how. Scrolling down here under the new loon we can see what account was used to log in. Here we can see the identifier the security identifier the account name which is Bob the account domain. So pretty much since it is a local account we see it as the computer account name.

But if it was domain joined in other words under an active directory environment then you will likely see the domain instead. But again because it is a local account you will see the computer name instead. There is a loon ID and a linked loon ID. You can use these field values to search up and follow the chain of events whenever somebody logs in. Now I'm not going to demonstrate that here because again that does get into the weeds a bit. But if you want to learn more about it, I do teach this in the myer forge. So, we do have a course in there called the 90-day sock accelerator program and that goes a lot deeper into the investigation side of things. Scrolling down, we do have the process information. Here we have the process ID and the process name responsible for this loon. The workstation name again wind-27 which is our old name and this is 127.0.0.1 which is localhost. we see a loon process of user 32 and the authentication package of negotiate. So this is essentially how you can read the event ID of 4624 under the Windows security event channel and we are going to be doing one last demo. So the one

that I want to showcase is the user that was added to a local group that is going to be the Windows event ID of 4732.

Now again we get zero results and that is because of the last 15 minutes. So let's do last 24 and we have two hits.

Expanding the first event from the top. Scroll down to the system message. A member was added to a security enabled local group. This one's quite interesting and I'll tell you why in a bit. So we have the subject which is a security identifier, the account name, account domain and the loon ID. Again, you can use the LON ID to track the events from a specific loon. The account name was Bob. And then we have the target member or in this case just member. The security ID is this right

here with the rid of 1002. But here's the interesting part. There's no account name. So if you're not entirely sure like who was targeted, then you would have to use the RID. you would have to use the security identifier plus the RID to identify exactly what account was affected. So that's why it's a really good idea to understand how to read the security identifier because you are going to come across scenarios where there is no account name. It's just a dash. This is the group that they were added to security ID of S1532544

and the group name is administrators. Now let's do an exercise here. If I wanted to find the account name for this particular security ID, I can simply copy it, put it in quotes, and hit enter. Now I'll just expand the first event from the top and take a look. This is the same identifier and this is the target username which is student one. So that is the window side of things and hopefully you have a little bit more confidence in reading some of these event logs because as a sock analyst that is essentially what we do day-to-day. Now let's jump over to the Ubuntu or Linux side of things. So I am

going to remote back in to our Windows computer. And you might be like why? I thought we were going to Linux. But stay with me. We're going to do something interesting. So let's close out our command prompt and I am going to open up PowerShell by holding shift and rightclick. Now from here let's SSH into

the Ubuntu virtual machine. But before I

do that I'm actually going to include a fake user. So it's 192.168136.129.

Type in yes. And let's do some random passwords. I mean, this isn't going to work anyways simply because, well, it's a fake user account. So, we do three passwords and then the SSH session's like, "No more password attempts for you." So, we get kicked out. That's okay. Now that we're done that, let's go and log in with the actual account,

which is my defer. And then I'll log in with the password. And we're in. And you know what? Just for fun, I'll type in IP space a And that essentially is just going to show us information about our network adapters. Now let's go into our result dashboard. I'll change this into the last 15 minutes. Remove this. I am

going to remove the agent name and rerun our query. And we have a total of 95

events. So what I'll do here is just type in fake user because we know that we attempted to log in as the fake user. If we expand the first event from the top, this is essentially our log file. So we can see that there was a connection reset by invalid user of fake user sourcing from the IP address of 192.168.136.130

on this particular port. Now if we scroll down and let's just expand a random one. Take a look at the full log. It's different. This time around it is failed password for invalid user but it is sourcing from the same IP address and it's targeting well our fake user. But what if we type in my defer and accept

it because again my defer was the account that we used to successfully log in. We do have one hit. Expand that.

Scroll down. We can see full log here and accept a password for my defer which is the user account from 1 192.168.136.130

and this is the port number. So anytime you see an accepted password under your SSH logs then you can infer that there was a successful authentication. Now we did also run a command called IPA.

Why don't we search for that? IP space A. And we do have one hit. Now it is a

bit messy here. But if you take a look under the command line, so this right here, you can see IP space a and it's

under the current directory of home my defer via the user my defer. Now before

we close this out, there is something that I want you to note down as it is quite important when it comes to SSH related activity and that is that whenever somebody successfully authenticates via SSH, there's actually a session identifier that tracks that. So for example, if I were to say my defer and session, we have three hits.

Now if we expand the first event from the top and look at the full log, we can see that session 18 of user my defer. So

essentially the SSH session that was established from our Windows computer into the Ubuntu virtual machine is now being tracked under the session ID of 18. Now if we go into the second event, we actually can see under the full log new session 18 of user myver. What does that mean? What does that tell us? Well, in theory, if somebody logs in, establishes a session and starts typing in commands like cat etsy password or

who am I, you name IPA, etc. You should

be able to capture what occurred during the time of login and also when they logged off. So, for example, I'm going to exit this. Now we search up my defer and session and expand the first event from the top here. We can see that it says session closed for user my defer.

But it doesn't necessarily show you the session ID of 18. But there are a couple

of things here. The SSHD process identifier is 6405 and you can actually use that for correlation as well. So here 6405 where

the session was opened. And another thing that you can do is if you click into the event log where the session was closed, you can actually look at the surrounding events by clicking into view surrounding documents. But before we do that, we want to take note of the timestamp. So here it is July 23rd, 2026

at 170028 7:15. So let me copy that just in case I forget it. View surrounding documents. And we want to find the event where the loon session was closed which is right here. So if we expand it, this is the session closed. And if we scroll up just a bit, we should be able to see an event here. Session 18 deactivated successfully. So

now you can find when they logged in and when they logged off. What you can also identify are the activities that occurred during that session. So let me demonstrate that really quickly here. So if I were to just do my def for and 18, this might have some false positives. So I am going to change this to last 30 minutes. And what we want to look for are sysmon related events. So this looks like it. And what we want to look for is the field value of terminal session ID.

Notice how it says 18. So now it's tracking the session identifier. Now that is just a quick investigation tip. And if you're interested in that kind of stuff, I do highly recommend the my forge because that right there is going to level you up so much and it's going to help build out your confidence as well. So, if you want a structured learning path, knowing exactly how to investigate, what kind of questions to ask, and getting feedback on your reports, seriously, there's no better place than to forge. All right, before we end it off, let's do one last thing. And I do want you to follow along. So, type in SSH, type in that user account, and log into the YUbuntu virtual

machine. And we want to type in the following. Who am I? and we wanted cat Etsy pass

WD. So this right here is essentially viewing all of the accounts that are available within the UUbuntu virtual machine. Now another thing that you can do is do a cat slash etsy slashpasswd

and then do a greater than slashtmp/loot.ext.

What this essentially does is that it will read all of the contents within the Etsy password and place it into a file called loot.ext under the /temp directory. So we go into cd/temp

ls-la. We now have a file called loot.ext.

And that's it. By now you should be able to look at similar logs and understand what they are telling you. And here is something that I do want you to keep in mind. The skills that you are learning in this challenge is going to transfer. It does not matter if it's W wasah or some other platform down the line. Reading logs like this is one of the core pieces of the job. In the next video, we are going to take all of the activity that we just generated and turn it into your very first sock dashboard, which also happens to be your first giveaway deliverable. 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
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