Hello, welcome to Blue Team Village. We are so happy to see you tune in. I'm excited and pumped to be part of BTV as this is my first time at BTV. Thanks for all the BTV team for making this happen and providing the feedback on this talk. That said, welcome to my talk. This talk is about hunting adversary schedule. Once an adversary gained a foothold, they typically would like to keep their access. This is called persistence, and for those of you who speak MITRE, it's called TA-003. We will take a look at one such persistence technique or method called schedule task. Schedule task is one of the most observed techniques across three different MITRE tactics, according to Mandy and Trent's 2022 report. Please go check that out. It's a pretty interesting report that you can find. We will focus on this talk. We will focus on this talk. We will focus mostly on this on threat hunting for the stock and how to perform it as well. Those schedule task is one of the 385 sub techniques that mentioned in MITRE. You can follow the process discussed here for any of them. Before we move further, a little bit about myself. My name is Sai Malikay, and I go by CyberHawk2. I'm an avid lover of death. That is detection engineering and threat hunting, not the actual one. Currently, I work as a SOC lead for a company called Sisel. Recently acquired by Forescout. Apart from work, I love to travel, especially road trips. I volunteer for any security conferences and nonprofit organizations focusing on cyber and its journey. So if you have anything, I'd love to be part of it. Last but not least, I'm a student of everything. So if you want to teach me something, I'm all for it. Enough about me. Let's see what we have on the schedule today. We'll go over what schedule task is and its basics. We will see quirks and features of threat hunting, process of data gathering and getting to know it. We'll see detection engineering, not all portions of it, just the basics or how to proceed it with the threat hunting. Finally, we will recap everything together, what we learned together, right? Perfect. A very important note before we dive deep. Deep into the weeds is note taking. I know it sounds boring for some, but if you are anything like me, I don't remember what I did 15 minutes before, you know, when I'm into a case or a of any kind of data. And sometimes you will have this crazy thoughts and ideas on how to progress on another investigation when you're doing an investigation for something else. If you don't jog it down, you lose it. Right. Finally, your notes should be your guide and for others who want to follow or reproduce your steps. So be sure to take notes while we are going at and I'll mention it whenever I whenever possible. Good. Let's get to it. Scheduled task. This is the definition Microsoft gave to schedule task on one of its stocks. It says scheduled task is basically a code unit that runs logic in a background session at a specific time. Right. Basically, you know, you want to do something in the future or just one time. You can use scheduled task to do it, but it's more than that. Scheduled task help operating system programs to run at a defined time. It helps administrators to take action when a certain event happens. It helps update your antivirus software at a defined interval. You get the idea, right? We'll go over some of the main components that make scheduled task a real task. Among them, the first one is triggers. So we will see these components of in terms of what is necessary for us. If you are more interested in it, you can go ahead and look at Microsoft docs. They do a good job in documenting most of their most of their products and services, how they do it. So triggers triggers is one of the component of scheduled task, which starts a scheduled task. It answers when a certain indicator or action. What indicators are met? Like I want to schedule a task or start a task every day at 9 a.m. That's your trigger. Then actions. This is the main thing that we as a threat hunter or your detection engineering folks or forensics is interested in, because it answers when or sorry, it answers what a task is actually doing. For example, a program will execute when the above trigger is met. That program is what? Principles. This answers who is allowed to run the task. The other components are settings, which answers where the task should look. If there is any error, there is a detailed documentation on these components. If you check the Microsoft doc and then we will have other two things called registration and registration information and data answers how to look for data related to scheduled tasks. Like there is a help information for scheduled task or metadata info. You can find all those things in these two components. We will see how they will help us, and we will refer back if necessary. So why are scheduled tasks important, right? After successfully getting their foothold into their desired enterprise. Do you think an adversary will want to lose their access or afford to lose their access? Because they accidentally control seeing their terminal? All right. They want to keep access as long as possible, or they want to keep their access to figure out what to do with it or until they achieve their objectives. So and it is also interesting for especially for scheduled tasks, because it can be used in different stages of attacker lifecycle, like persistence, privilege, escalation and execution. But in this talk, we will only talk about persistence. And who can create scheduled tasks? Administrators or members in the administrative group can create scheduled tasks. And also administrators can create can give certain permissions for users in order for them to view or perform actions on scheduled tasks. Okay. That's all good. Finally, we came here. We come to the topic. We came here for threat hunting. But let's see what it is. Threat hunting is a process. It is the process of being proactive to unveil unknown knowns and unknown unknowns to better our security posture. The main keywords are process, because it is not set and done, but rather a continuous thing. It is proactive, as we are not working for something to happen, but taking charge before it happens. Unknown knowns and unknown unknowns are a topic on its own. But in a nutshell, there are things we don't know and we want to know. We are doing all these things to better our security posture. We said it's a process. But what is it? What is the process? This is the process we are talking about or we are following in this. This is not the only one, but this is the one we are following today. First, we will create our hypothesis. Then we will find what data we need and what artifacts are related to our hypothesis. Then we need to know what we are working with, exactly familiarizing ourselves with the data. From it, we will create queries to search for the data we gathered and familiarized with. Finally, interpreting the results and documenting it all. You can follow this process with detection engineering too, but we will not go there yet. But this is the process that we can follow. But there's a lot to unveil here. Let's break it down by each component. First thing is hypothesis. A possible or one of the definitions I found pretty interesting is this. You can read the hypothesis, but the main things are research interest, most important questions, and decision. Because in order to be proactive, we need to know what our interests are. What questions we need to ask to create a structure to our hunt. And lastly, decision, because we need to know what we will do with it after all this hunting and whatever came out of it. What we will do with it. That's the decision process. In threat hunting, we will typically have broad hypothesis and narrow hypothesis. That's not a law you need to follow, but it gives a kind of structure, a possible structure to your hunts. Broad hypothesis is just an overall statement which can serve us to start a whole lot of hunts. Like, our broad hypothesis could be this. Adversaries use persistence mechanisms to stay connected. As you see, it is broad and can lead to n number of things. You can use this broad hypothesis to schedule multiple hunts. The reason it's broad is it just gives you a glimpse of what you want, but not exactly how you can do it or detailed what information. The narrow hypothesis. For narrow hypothesis is specific, applicable and actionable today. To form the narrow hypothesis, we will answer some questions from one of Pluck's talk on Silver Sparrow in ShellCon 2021. If you didn't check that talk, please go ahead. It has awesome information. Not only just the Silver Sparrow, but the threat hunting process itself. We will answer some of the questions from it, right? The first question is who? Who are we trying to hunt? What we want to hunt? And why we are doing all this? Where answers what data we want to hunt for? When is the timeframe related to the hunts? Every hunt should have a timeframe. So that's the where, when portion of it. And how is, how are we querying the data in our sim or analytical platform? And how we want the platform to present the data to us? So let's fill them up. We want to hunt for adversaries. You can add insider threats to it. If you are, if you want to include that in your hunts. We want to hunt for specifically scheduled tasks. And we would like to check this data for endpoints. Because that's one of the data points you can check for scheduled tasks. We are doing this to unbuild persistence mechanisms achieved by scheduled tasks. And if you fill them, all of them, we can find this. Here we are saying adversaries might create or change scheduled tasks on local or remote endpoints using GUI or command line tools to execute additional or new executables files for maintaining persistence in our environment. And we are doing for as long as the data exists in our analytical platform. And we are using some of the mechanisms like searching, grouping, and stacking. But as you see, this is very specific. We can hunt for this today. And our hypothesis will guide us through what we will search for in our analytical platform. Great. We have our broad and narrow hypothesis. But what we can do with it. Where we will use it. I like this meme a lot. Because most of the threat hunt. Is about pre-hunt preparation. If you remember our threat hunting process. This is our second step. Data gathering and what artifacts are related to what portion of it. If you are performing threat hunts, most of your time will be going at this portion of it. Because this will define what you can do in the next sections. So let's get that data. Here when you say data. It's data coming from our point products. Or different mechanisms where you can gather or achieve the data. In this case, endpoint. For things we don't know, we will Google it. The first thing I Googled is MITRE schedule task. MITRE is our dear friends where they have a beautiful website. Where they document most of the techniques, sub-techniques I spoke about before. So when I Googled this, the first link came out to be MITRE. Attack MITRE enterprise techniques. And then when you go there, check the detections portion of it. Under it, we can find data related to scheduled tasks. So this is specific to techniques. So each technique will have this section. So when you go there, this is important to see how to interpret it. Data source is what data you are collecting or you can search for. And detects is some of the artifacts they have observed. Using first scheduled task which was used in attacks in the past. So we will take a note of all this. So first data is command, file, process, scheduled job. Lack of data is also important to us. We will discuss that in the coming slides. But please take a note of all these data sources. We will check from the bottom. The scheduled job. Scheduled job creation in specific. In that, we will see some of the event IDs. Specifically, event ID 4698. Okay. So we will start with that event ID. Let's check that in Google again. Here I'm saying I want scheduled task event IDs. But I want only from Microsoft sites. That's the site notation. When I do it, the first thing came from Microsoft documentation. And when I went in there, you can search for scheduled task in the left. Because it has all the events necessary. And we will see all these events that are produced by or when action is performed on scheduled task. Here you see 4698S. S is security channel. So one thing is event IDs are specific or unique to a channel but not unique overall. Okay. So let's take a note of all this. Like 4698, 4699, everything. Perfect. And we go back to MITRE again. In the same section, I see another one. Microsoft Windows Task Scheduler operational. This one is related to a specific channel which has all the information related to scheduled tasks. But if you read on it, it says enable the channel. That means in my mind it says it's not enabled by default. So we will check what if it is enabled or not. But we will take a note of that particular channel too. The second thing we will see is the file modifications. Specifically file creation events. In this it says it will be done in the system32 tasks folder. Whichever is not related to a software or path cycle or et cetera. So we will search for it. But unlike before, we will search for sysmon data. Right? Because why not? Because that is being rolled out in current enterprises as a cheap version of EDR. But we will search for sysmon data. When I search for file creation sysmon, I have seen that event ID 11 is related to it. You can see some description related to the event. And also from MITRE and some blogs, we see that they happen in tasks folder and under svchost.exe process specifically. Okay. Sure. We will take a note of it. Again, we go back to MITRE. We can see other things like command execution and process creations. For command executions, there are several types you can do it. Scheduled SES tasks, add.exe, powershell, WMI, and many more. So I will take a note of that too. Because I want to search for this as this is one of the data points that I want to search for. In MITRE, there is an interesting section called procedure examples. This is interesting. Because here is where MITRE documents all the previous attacks that had happened using scheduled tasks or where scheduled task is used in such attacks. Okay. So while searching for one of those blocks, I have seen that there is a new data point. That data point is registry keys. So it says that registry keys are also important. In searching for scheduled tasks, specifically registry events 12, 13, 14, according to Sysmon, and some of the registry like create key, delete key, and search. If you ever performed registry analysis and or checked the registry, it is messy and ugly. But it could be a lot of fun if you are into that sense. I'll show you why. Here. We will just check what we want. I know this is scary. But we will just check only the things that we want for the registry. So if you go to the registry path mentioned above, specifically till the tree portion of it, you can see all the scheduled tasks that are there. Some of the scheduled tasks are under Microsoft, which are operating system specific. And the task which is highlighted here, the daily task, is the name of the sample scheduled task that we created. In this, there are four subkeys. The interesting word subkey is this. These are ID and SD. ID is a gibberic keyword that is unique to our scheduled task. Here, ID is correlated with the daily task name of it. And SD is where our principal or security context under which scheduled task is created. SD is also important because it acts as a bond between what you can see versus what scheduled task is there. And it's used in one of the cases recently with Afnium. Microsoft has a great documentation on it. If you are interested, please check that out. We will see that case if we have some time. So, all right. But if you see all this, we don't see the things that we checked for the components, right? The trigger, action, data components and stuff, we don't see it. For that to see, ID will take a note of the GUID and paste it here. It's just the same path but one above. Instead of trees, we are doing task and the GUID that we have. Here, you see a lot of information and all the information which is familiar to us. We will not discuss the whole things but the basic ones like actions, which is the thing which we should be interested in. What? Which answers what? Like here it is running dnspy.exe from the downloads folder. You can see author information, who created it. You can see date information. Like what date the scheduled task is created. You can see the triggers, the conditions when the scheduled task will be triggered. It's binary. You have to convert it. And dynamic info. If you are into forensics, some of the interesting timestamps are here. But we will not go to it. But this is the registry structure. We will see how it is important to us or why you are searching for your data. All right. You better be taking all those notes which we spoke about. So, this is what I have. For my notes. So, it says I have Windows events, task scheduler, operational channels, file creation events, registry keys, and command line arguments. All those things that we see. Perfect. That's a lot about scheduled tasks and what artifacts. Like I said, most of our time will be in getting those artifacts ready and seeing what artifacts are generated for a specific technique or a tactic. But enough said. Let's see. Let's put that into practice and see how it can give us some information. All right. Here. Let me set this one up. All right. Here we are using Splunk as our SIM. But you can use any SIM. And you can convert the queries which we are using. Here. Using sites like Uncoder.io and stuff. But we will not be doing it. We will be using Splunk. We will explain some of the queries that whenever we are searching for it. Right. So, let's see it. Zoom in. So, the first thing we will do in our threat hunting process or in data gathering process is data sources. If you remember that we did with using MITRE. So, here, I want to do the same. I want to get what data we have. What data sources is available. Let me run it and see what I have. Before that, here, we want to answer the question where in our narrow hypothesis. That we said we want to search for all the data that is available to us. So, that's why I changed the time to all time. I and schedule task are, you know, time frame based. So, you can, sorry, threat hunting can be time frame based. So, you can check for those. Right. The query says that. So, you can see that index, which is the Splunk way of saying data that we ingested from a point product or somewhere else. Then with the help of Splunk command Ddup, which exactly says dduplication. We get unique instances of indexes. And finally, we are saying the give us in a table or follow. So, if you think about this to our narrow hypothesis. This answer, the table answers. like how i want to get the data uh and the index and the hand the time frame answers where the question okay among these the first one is zeek which is network based logs we didn't see anything according to our hypothesis so we'll skip that os query which is important uh it's which is endpoint uh data uh but in our research we didn't come across we can maybe use it in the future uh or we can use it in for this technique in a different way but we will keep that in place uh sysmon uh which is the data source that we are uh we searched for uh if you remember this file creation events and registry events so we will use them uh windlog events uh it's also important we check that that's our first step actually uh to check some of the windows events using microsoft site so let's start with it and we have other things like html and velociraptor and stuff let's start with the windlog beats so if i search for windlog beats the first thing we should do is the second uh once the data gathering has happened the third step in our thing is data familiarization this is important because this is also one which narrates how we will search the data or what fields that we search for data i just threw a term called fields let's see what it is so if you see the left hand the right column they are called fields and the green ones are the values associated with that fields here we have some basic information uh about uh this is a sample log that we just picked out of uh you know seeing all the windows event logs and in that we see some host information we see the agent information like here win log bit how we get the data from the end point we use the log beat in this version of that data element so let's let's make a stream but keep in mind that this event is the and Bくод PhillieceM 진짜 lógica p copper is the data in this scenario event.code this if you remember is equivalent to event id that we are interested in an event provider like i said event ids are specific to a provider and there are a channel they're not specific they are not unique to the whole windows environment so here it says the provider is microsoft windows time service think about it how we can use this one we have host information like ip and mac addresses we have os specific information we have a message field which how it looks for uh how it uh how we if we see this in the windows event logs this is how you see it we have again the other information to it user information also all right perfect so according to our research what we saw is we want specific event ids so let's search for them so here i'm saying i want instead of all in indexes i only want windows event logs and i'm using event.code which you remember is event id and i'm searching for specific event ids but i did not see anything i don't get anything why is that the case so let's see all right let's see why so here i'm using in operator that means you can do uh i want to search something some data in a specific field here i want to search 4698 in event code and the rest of them instead of this you can also use event.code is equal to 4698 um or event.code equal to 4699 you can do this way too but this is a concise way to search for data but we didn't find anything like i mentioned lack of data lack of written off results is also an interesting part in threat hunting and we will see why in our recap okay let's take a note of that we didn't find anything right okay let's search for other data in our little notes that we took in other things we saw that uh we have another channel called microsoft uh task scheduler that we can check event data logs related to. So let's check if it is there that we are collecting them because if you remember Mitre said that, if you enable it, right? So here, what I'm doing is I'm again saying that I want specifically logs from Winlog events and I'm using the operator event or provider that we checked in our example before to getting familiarized with the data in there. I think it's, I believe it's related to prime provider. Here, I'm saying that I want any provider that has a name task in it. The asterisk here, you see, they are related to wildcards. So you can use them to find any keyword you want. And using the ddup, exact ddup command, I'm wanting only unique instances of event provider and I'm asking to give me in the tabler folder. And all this, if you observe, we are using all time. So we are searching for all the data that is there. Perfect. I see one hit, which is better than the last one. So what I will do is I'll take all this and just search for it. So this one here, I'm specifically saying, same Windows event logs, but I want only from this event provider. Let's see how the data goes. Let's unroll all the things. Okay. Here you see similar information, like agent information, event code. Here it says event code is 719, but in event action, it says something like scheduled task operational, log was disabled. And if you also see the number of events that we see, we only have five, which doesn't seem right, right? So that means I cannot use any of the first two data points that, we have searched for, or we took note from MITRE and other things. Okay. Not an issue. Let's go move forward with it. Let's see file creation events. Let's see what we have there. But file creation events, if you remember, we checked for Sysmon events. So let's see what Sysmon looks like. So for that, if you remember, we have different indices, and in that Sysmon is one of them. We will check for Sysmon data. I'll just pause this, just to see what sample looks like. So I will do the same that we did for the Windows event logs. Let's unroll everything and see what data we have so that we can use, we can see if we can use any of these fields in our search creation. So let's see. Here, I'm seeing most of the data that we've seen in a Windows event logs, like the agent version, event, event action event code but event category is kind of interesting because event category says the bulk or the grouping sysmon does for a specific event action like in this case file and event action is specific to this particular category like category here is file and action is file created in the same way you might have actions for other things too in other categories first the next thing is event code which is the sysmon event id that we gathered provider is the same and then file information we have it because this is related to the file category and file creation events we have file information associated with it like file directory name extension path if you think about it this will come handy to us because we are checking for a specific path according to our research and host information we have it as we see before we have what else we have we have this rule name this is interesting we have process information because what process creates that file we have rule name it specifically says technique id technique name which resembles to miter techniques and their names this comes very handy too this is coming from the sysmon config file when you are configuring your sysmon events we will not go into details but from there you can get this okay good so as we are familiarized with our data set we know what category fields we need we need the event category or event action field we need the because we are searching for file creation events we need event code field we need the file path because we are looking for a specific path and also we can use the process information because we are looking also looking for a specific process so that said let's check uh what we have here so let me paste that okay mac this is a mac issue sorry uh yeah let me paste that so here i'm saying that i want things from sysmon only and i want specific to event id 11 which is equivalent to the file creation events that you see before uh i want process executable to be svchost.exe because if you think our notes uh we have seen that uh this one exists from it uh sorry the file creation events happen from svchost.exe and it happens in a specific folder or a path and that's what we are mentioning here uh and i'm using a thing called transaction uh it's a way to group events together and i'm asking splunk to give me in tabular form with each other three snapshots of identity if one goes to itleth and the other goes to sysmon you get 75 results but this is where the true threat hunting begins because one of your uh if in our threat hunting process if you remember after querying is is interpreting the results and filtering them. Interpreting results is difficult. It based on your known normal of the environment. It based on the OS behavior, is based on the process behavior that we are checking. So there are different things that can influence how you interpret your results while performing the threat hunt. For this, we will use a simple methodology. I don't know where I heard this from, but I heard in one of the conferences or talks, but it goes like commonly observed events across multiple endpoints could be common or something really bad is happening. That means if you see something in different endpoints, like this one, Microsoft Office, Office Performance Monitor, you're seeing in most of the endpoints that we have, that means this might be common for a OS behavior or our environment. Or something had already happened and we are in a doodle. But let's go with the first happy thought that it is common in the environment, right? By doing that, we are getting to this monstrous query. Oh, we'll get to this monstrous query. Let me run it and I'll tell you what we are doing here. We are doing the exact same thing. Sysmon, Event ID 11, SVC host. Sysmon, Event ID 11, SVC host. Sysmon, Event ID 11, SVC host. We have that same line task folder. But we are removing or filtering out certain things. So the Printers method will result in performing That filtering happens because of OS behavior, like this one. create explorer shell and elevated task this could happen because of software updates or softwares related to operating system like in this case microsoft something or specific program that we have like here google update so let's say this filtering in our environment cc cleaner is not a genuine process or not an allowed process you can find those things here too so it's a catch-22 threat hunting can be can help you in finding your no normal but also if you know you're no normal then only you can find threat hunting you can get more stuff of your threat hunting so you know you can figure it out how you want to use it or in threat hunting but most of the time if you have a solid no normal then it is easier for you to hunt for different things which are abnormal or unnormal in the in circumstances okay a by filtering it and by the way a good task for you is uh you can check for all these events and think of a ways why we filtered it because the reason we filtered it like we mentioned is operating system and stuff but just uh see what they do so that if you see this anytime in your hunt you can say that huh i know what that is and it's common i can filter it out or i can filter these out and if i don't find anything i can see for edge cases on might be an attacker using or a perpetrator using legitimate functions in order to do it which happens in a lot of ways so anyways after filtering we have one task happening on two endpoints interesting this is not to say suspicious uh yet but it is interesting to see that we have a certain process that is running on uh uh two things so let's search for what it is doing so let's take this and do a blind search for that so we will we will do a blind search on what it is doing in this we are seeing uh some of the things like registry value sets this is interesting because we have seen that uh registry events will be created when a scheduled task is created uh we are seeing most of them are yeah most of them are related to registry uh but easier way instead of going through each log uh easier way to find about what we have is this uh let me put a query so here i'm using the exact command but transactions i'm trying to see what uh hosts are there and grouping things by the host name and i'm saying the event category field which we saw for sysmon uh to see what exact actions or event category and event actions to see what exactly it is doing so here we see file creation events registry uh events uh on both the endpoints this is interesting because we seen the exact same things that we have checked in our artifacts whenever a scheduled task is created this is what will happen okay perfect but anytime you see these interesting things click a note of it and wait until it becomes uh suspicious so here we are doing the exact same thing so as we see there are several ways to create command line arguments for scheduled tasks i'm checking for some of the keywords that can happen while performing schedule tasks like here i'm checking uh for different things but you can you can filter out all this let's see just plain so let's check this oh uh okay this if i type properly it will make sense okay so here we are checking that i want the i want to check for a parent powershell.exe and a child cmd.exe to see some of the key line arguments for scheduled task creations so this one i i found it in different ways i can find it in different ways one is you can see in microsoft documentation uh like you can go to uh microsoft ch tasks uh in here you can check uh what are the commands that you can use using microsoft like change create and stuff uh you can use powershell documentation similarly you can use wmi these are the basic keywords that you are using in order to find a particular scheduled task or what it is what a scheduled task is doing right perfect let's say with our uh previous things if we're using registry and file creations we determined that particular scheduled task daily magnus task is uh there uh is a suspicious one and in order to check what it is doing we saw that uh process creation events in that process creation events we see a command line which matches our uh the command that we are saying here uh c uh slash c start that means when command.exe is used to start uh cleanup.exe and we don't know what cleanup.exe is or we don't know anything about but we just search for the keywords and this is what we found in it and we saw powershell.exe and if you think about it think of a bin general things like temp folder cleanup.exe it is using powershell.exe to spin up command.exe and starting something from a cleanup folder okay let's see what cleanup folder is doing sorry cleanup.exe is doing so for that we will do the basic thing if i type it so cleanup.exe we have 113 events again the best way to do what actions it is performing is using the specific command that we have checked out for so we'll just type the same command after we done that and then we will go back to the on the other side we will type the caseamo fax command which is very important because the folder and then we will just click on the caseamo file and then we will save the script and then we will create the file so in case we don't have a file we will just create the file and we will call it is a defined process determined process access blah blah blah this is a good task now we have searched for the scheduled task which is needed we found something which looks suspicious and we have seen several things that we can do it so take any of your things like network creation events or any network detected events image loaded events here we are checking for so let's go back to the presentation so here i we are just checking for one such events process creation and we have seen this particular thing that we have seen before that something is starting from a temp folder so think of it cleanup.exe starting with cmd.exe using powershell from a temp folder on the host that we have checked a suspicious or an interesting scheduled task is present this starts your hunt again most of the time hunting is chasing that goose but uh with a solid data backing up like if one data says something is suspicious back it up with another data which produces similar artifacts and that's it but there is more than that to threat hunting we only checked one such events so you can go ahead and check what you want to see in the next few days and then you can go ahead and check what else is present in all the data or all the artifacts that we gathered all right let's recap everything with a small template we are using a template for that uh the title of our hunt is hunting for adversary schedule uh we created this on the date we are notifying noting our hypothesis uh this is our uh this is our hypothesis and and uh the narrow hypothesis that we got we are mentioning some of the mitre techniques and tactics we are using simulation techniques like this is very important if you are simulating something to in order to perform threat hunting or detections this is interesting you can note what simulation has performed and then we are using a proposed search query here this query could be anything i just mentioned the last search query but if you can mention all your search queries in it it helps if someone wants to take this template and wants to reproduce these steps it helps them a lot and here i'm noting some of the limitations of my threat hunting like i mentioned if something didn't turn up in threat hunting it's also interesting if you remember in our case we haven't seen any logs related to windows event logs and also task scheduler operational which says it got disabled because there was no space or something so this is important because this helps in getting that visibility of where how and why i'm not getting this particular data if i'm not getting how can i get it and we also observed when using this uh our methodology for command.exe where you where we run through different artifacts only we saw workstation one has cleanup.exe but if you remember our schedule task it is running on two workstations why that's the case these questions helps you answer a lot of other things which direct doesn't always mean that you want to find this grand apt that you're seeing but these are also byproducts of your threat and it helps you achieve that to know unknown unknowns and unknown knowns to help secure it good and the last what did we find we found a particular task called dady magnum tempest it cleanup on a couple of computers and a cleanup.exe is also launched from a you know dady magnum.exe is also running on dady magnum.exe and it also has some interesting artifacts even related to network artifacts perfect like i mentioned uh the detection coverage and visibility uh here through our hands we have mentioned we have noted that event logs are not there uh or at least specific to schedule tasks are not there so we want to see a way we can get that data uh we are uh by the looks of it we have not enabled that operational channel so we want to enable it so that we can get more data and weigh the benefits and risks of enabling it we also seen that workstation one only produced the cleanup.exe process creation we didn't see the works other workstation uh performing it uh so that's our visibility coming to our detection coverage like i said you can stop your hunts uh at the findings and documentation using the template that we have uh we we didn't here but we can also move it a little further we can use uh it for our detection coverage here we are saying that uh we can use our query whichever we used for the threat hunting uh queries like our process creation events uh from uh or we can use our based on our no normal or filtering capabilities we have seen uh we have filtered everything and only one event was left we can use that as our detection query you can use a combination of them right but that is only one portion of what hunt we did there are several other use cases in this schedule that's making unusual communications uh it is downloading power circle cradles and several other things you can either create hunts for each of each and every of these or you can hunt for the behaviors like we we can do uh let's say schedule does how it is you can either create hunts for each of each and every of these or you can hunt for the behaviors like we we can do uh let's say schedule does based on the artifacts that we gathered so you can you can use either one of them right these are all the uh detections that we can create uh if we have gathered all the tasks and if we can do those information and if you see here hidden schedule tasks if you remember uh i i said if if you have some time we will talk about hafnium uh this is what it did it hide hid its scheduled tasks from viewing it it does using that sd key that we spoke about in registry where it automatically removed that uh for using com i guess uh but it removed it and when when you remove that you don't have the connection between what you see versus what is what scheduled task is running so you cannot uh it gives a a nice behavior to evade uh the regular hunts that you have so you can also check for that particular behavior something uh like let's say sd registry subkey is deleted using sysbone or any other etr that you have so these queries that you use are specific to etr uh splunk here but you can convert them into and use it like we said to any others finally that's our talk uh all the references uh i have followed is mentioned here and thank you so much for everyone for being patiently watching this uh we ran through some of the artifacts uh but please go through those artifacts uh one by one you can find your own rhythm in find in searching for those artifacts we will be releasing a blog post which has detailed information on everything so please go ahead and check please join our discord channel if possible so thank you