Hello, everyone. I am glad to be part of DEF CON again this year, Blue Team Village. Thank you very much for the opportunity and a special thanks to all of you for making time to attend this session. Hunt a beast in the shadow. Before we dive into the main topic, let me quickly tell you who is this guy speaking. I am Maysam Eslahi, a cybersecurity practitioner and consultant. At the moment, I'm acting as a senior director with EGS, EC Council Global Services, for both reactive and proactive cybersecurity. I'm also a mentor with Blue Team Village and one of the contributors for MITRE DEFEND projects. In my free time, I do some research and I do some practical experiments and sharing my finding on the form of the write-up in my blog at cybermaysammedium.com. Or the shorter version in the daily basis at LinkedIn and Twitter. I would be more than happy to connect to you and more than happy to have you in my professional network. So here is the agenda for today. We are going to have a brief discussion about reactive cybersecurity, a little bit of the challenges and why we need proactive cybersecurity in parallel. We continue with explanation of a file-less threat that we are going to hunt in this trilogy with three different methods. System-like. Drive analysis, memory forensics, and network packet investigations. Hunt before getting hunted. Reactive cybersecurity. In this case, we spend heavily on the technology. We deploy them in the multi-layer approach. We assume protection and we keep monitoring. In case cybersecurity happens, which must probably happen, we trigger the incident response and following by a digital forensic investigation. Nothing wrong with this approach. Actually, the reactive cybersecurity is an integral part of our strategy. But according to the IBM, only 80% of the cyber threat and attacks can be successfully detected by automated cybersecurity solutions, SOC Tier 1 and Tier 2. The remaining are those sophisticated attacks that can avoid the standard detections, bypass our cybersecurity solution, and remain undetected in our environment up to 200%. At the same time, it doesn't imply violence against realxx. Mireka ошибed us. Nej & I need to add in quick credits. Enjoy the second part of this555 chapter. Thank you for able to share this wonderful image of the Lambdaference. I hope you enjoyed it. We shall discuss this in the free chat. Bye to you later. Bye! operates in the memory and never touch the hard disk, but they are rare and very difficult to implement it. In general, a file-less thread either need a file to operate or indirectly use a file on the hard disk partially in their life cycle. Then why we call it file-less thread? Because the malicious part of the activity is only conducted in the memory. The malicious part are memory-based and not file-based. That's why we call them file-less thread. So and that's why they can bypass our automated cyber security. So having a reactive cyber security in our organization is a must, but it would be great idea if in parallel we can add on a proactive approach. In proactive cyber security, unlike the reactive, we assume a breach. We assume that despite the fact that we expect to spend a lot of time, energy and money on our technology to fine-tuning our process, educate our staff, a cyber security can occur. Yes. As explained by the Swiss cheese model, a tiny crack like misconfiguration, like human error, like a scope X and blind spot in every layer, in each layer of our cyber security model could give a way to a cyber attacker to walk into our environment and conquer our cyber, our digital wonderland. That's why no harm to assume a breach, keep hunting, fix, improve and prevent the things where it's possible. So the proactive cyber security help us to identify the unknowns and issues, discovering a new attack service, of course, effective risk management and rapid response to the threats. Most importantly, minimizing cyber dual time. The earlier we detect the issue, the faster and the better we may able to respond. And during this process, of course, we can enhance our capability and the maturity level, reduce the risk and damage. In overall is a main advantage of the proactive cyber security. There are a lot of proactive cyber security practices, like security effort for stop coverage, cyber drill to fine tune other processes. And one of the most fantastic results will rarely appear, technical ones is threat hunting threat hunting is a human-driven practice to iteratively look for any type of any sign of malicious activity in our environment in the past and presence so internet hunting we have two type in general on a structure and a structure one in this presentation we are focusing on the structure threat hunting which is work around the educated guess or a hypothesis the i hope the ipo the hypothesis is the initial idea that tells us what we should look for and how to look for and a set of steps that threat hunter can follow to detect a potential cyber attack the hypothesis can be formed around an entity for example the high value assets or high risk users normally and mainly we focus on the assets only but we should keep in mind that behind every asset we should focus on the assets only and we should keep in mind that behind every asset there is a human who interact with that assets on that assets and control and have access to data on that assets that's why it's very important in our hypothesis to consider the high value assets and high risk users it could be intel intel driven for example a new news about some attacks happen on the particular sector and if by chance we are in the same sector the chance that we will be the next target is there so we can trigger a hunt on that direction so uh in this presentation we are focusing on the ttp driven which is based on the attack techniques that used by the attack vectors in order to educate our guests and form the hypotheses we need a trend hunt loop which is the entire life cycle of a threat hunting start with the initial observation to formulate a hypothesis to formulate the hypothesis we can get the aid of the cyber threat intelligence the other services outcomes for example if the red team or blue team practices conducted on our environment and they find some issue and and vulnerabilities we could assume that any of those issues and vulnerabilities may be used by the attackers already and they are in our environment then we know what we are looking for so in this presentation we focus on the knowledge base we will talk about it shortly once we formulate our hypotheses we should analyze the requirement including the source of the data the tools we need and the technique we need to collect the data and analyze the data then we continue with the investigate and hunt during the investigate and hunt we may pivot to the other source of the data we may actually use a chain of hypotheses from hypotheses one we may move to the another educated guesses and hypotheses so when we come to the finding we should definitely record them and validate them three conditions may happen either in this case we should trigger the incident response and digital forensics we conduct the compromise assessment for the rest of assets in our network of course the enrichment and the automation and most importantly develop a new detection content with the future we don't want to manually hunt every and each time for the similar cases like things should be automated once they are known so a finding could be rejected or inconclusive in it doesn't mean that we should have peace of mind maybe these hypotheses reject we need another advanced hypothesis to look for another source of data and so on in in case of the inconclusive it's maybe because we have the immature hypotheses that we need to work around that or we use the wrong data source and in appropriate tools regardless of which loop we are using we should always repeat a review in order to find the right data source and appropriate tools regardless of which loop we are using we should always repeat a review in in order to find the right data source and appropriate tools regardless of which loop we are using we should always repeat a review in and update everything so let's use this threat hunt loop to hunt a fileless threat an excellent fileless script written by daniel lori that enable us to demonstrate some kind of fileless threat activities and how to hunt them if you are keen to know more about it and having a view of a step-by-step implementation you can follow his youtube channel the script is also available in his github page you can easily download them execute them in your test environment to sharpen your skills so the life cycle of this attack start with a fake update script which is somehow gets into the victim machine how it has happened this is not the case to discuss here because we assume a breach we assume an attacker use many techniques like social engineering on a specific or a special specific vulnerability to drop that file in a victim machine and convince user to click on it once the user execute the script it pretends that there is some update related activities ongoing but in fact it connects to the server which has a secondary malicious script download them and execute them directly into the memory without touching the hard disk and then give us a reverse tcp shell and remote access let's have a quick view so here i set up a http simple http server in the kali and then i run my nc listener on port 443 i execute the update script as you can see it shows that some update is going on but in fact it's downloading the other scripts run them and execute them in the memory and give us a remote access so i run this in the three different scenarios for the windows live analysis i use a windows 11 as a as a victim machine and i am going to use this internal and built-in command to hunt for windows for memory forensic i use a windows 10 why not 11 this is what we will discuss at the end of this and the end of this presentation i use the i will use the volatility framework and bulk extractor and strings uh to hunt in the memory for network packet investigation again i use the windows 11 and i'm going to use wireshark t-shark tcpdom and t-shark extractor kindly note that i'm not using any tools these are simply the tools that i feel comfortable with and of course a lot of them are free and open source so to generate the hypotheses we are using a three different knowledge bases by the mitre mitre attack mitre defend and cyber analytics repository let the hunt begins system live analysis is a hunt that we can't really run refuse and it simply refers to the technique in which a hunter collect the data from a running system that may provide us a better understanding of the outgoing events compared to the dead forensic or forensic image analysis there are a lot of data wide variety of information to be collected from system information and configuration user group and privileges install application and running services process dll handles network and internet related data and of course files and scripts because of the time limit we are not going to cover all of them here but i have a advanced ongoing series on system live forensics in my blog cyber mesa medium.com feel free to refer to that to having more advanced write-ups about the system live analysis so in this presentation we are only going to focus on the three uh source of the data which is process and handles network connections files and scripts so I'm going to start with the three simple steps that works for me in the most of the cases for initial educated guess and hypotheses, which is collecting the running processes list, the process that's running at that particular time in our live system, active network connection, especially the TCP and established one, and the process to port mapping to identify which process is behind that particular network connection. So, in order to get a list of the processes, there are a lot of tools like the normal task manager or a task list, which is the built-in command of the Windows. However, I prefer to using the PS list from the Microsoft Sys internal because it gives us the hierarchy of the processes. Using the switch T with the PS list help us to have the process lineage analysis or processes. Three analysis, which is suggested by the different knowledge base. Actually, we try to understand who is the parent of each process, who are the siblings and gather the information on how a process initiated that may help us to determine whether the process is malicious or normal one. So running the PS list on the victim machine, they show us the two instances of the PowerShell, which is already alarming. So running the PS list on the victim machine, they show us the two instances of the PowerShell, which is already alarming. Do it manually. And if we produce this on a machine execute it with the under theaison the as a parent. This is known as the against the third party network Workers to set up a shutout and a authoritarian practice. I'm obviously not in it with the C Sh mir. by the command it, which requires TP. Any of the examples That are in the case of what's called a.. PowerShell in a symbol or walks around a western area has awest sun crappy. But the reason that you use this, for example, there's ailty on that I have created with a nt-n family. so this kind of example has a benefit. execute the PowerShell, which in that case, the parent should be Explorer. As we can see here, the parent here is a CMD, means it's not interactively executed by a user. The good things about MITRE Analytics is that for most of the detection case, they provide us the generic SODO code that we can easily understand how to implement the detection rule for our automation, cyber security, and solutions. So another detection case that related to the process and the process list is a common Windows process names that misused by the attacker or used by the attackers to hide their malicious activities. So the attacker use a standard name to hide their malicious activity. So as a first detection hunt and detection, let's check whether this process are fake or the real and standard Windows processes. So again, the MITRE ATT&CK knowledge base give us some, the list of the detection methods on how to check whether these files, these processes are a standard. So they suggest two, if the file with no names, but in unusual location are suspected, or the file hashes that do not match what they're supposed to be. So they suggest two, if the file with no names, but in unusual location are supposed to be. Actually, for this case, out of this long list, I'm using one of them, which is the match legitimate name or location. So a simple WMIC process helped me to get the process ID plus the executable path. And in order to have a narrowed down domain, I just limited the finding only to those four processes. So as we can see here, it seems they are legitimated because they are executing from the standard Windows system, 32 folder. So let's switch to the hash values. Get file hash function of the PowerShell help us to generate the hash value of those four processes. So these hash values can be correlated via our knowledge base, our internal resources, community, or simply submit to the publicly available resources like VirusTotal. In this case, I submit the con host hash value to the VirusTotal. Which confirmed to be a legitimated con host. So still no peace of mind. Even though these processes are legitimated and standard, there is still a chance that they are misused by the attacker. That's why we go to the another useful detection case by MITRE DEFEND, which is a file access pattern analysis. They provide a very handy example for us, how to detect a vipers and the ransomwares in case the process has access to the multiple file types, access to the many files, which is located in the multiple locations and directories. It could be an indicator of vipers or ransomwares. Another handy tools of the sys internal which is handle help us to have to gain the information about the what are the file and resources that access by the particular process. So I'm using the normal one first without any switch. And it shows that it has some access to the file which is located in the Windows cybermason download. Obviously because as we remember, our dropper executed from the same exact path. So I continue with the having switch a with the handle because it gives us more comprehensive information like the port, registry keys, threads and all the process accessed by a particular process, which is in this case, these four instances. And surprisingly, I have seen a lot of indicators. Definitely, all of them has access to the cybermason and downloads. So we can see a PowerShell has a handle, which technically means access to the Crypt32DLL, which basically used by the processes in case they want to use some encryption and decryption functionalities. We can see some sort of the information related to the network configuration and TCPIP outcome control policies testing protocols and else. This item is actually better provide some indicates that somehow this power shelf has to do doing something related to the network in generic all of them are alarming let's continue with the another useful one which is a command and scriptings so miter attack knowledge base suggests that we should monitor a command line argument for for a script executed by the any per any process those command may give us some information about what is going on when what each process try to do so a simple wmic process get help us enable us to get a process ID name and the command line and again limited to only those four so the command executed by the cmd is interesting because it shows a batch file with the dot cmd file in the extension is executed from a download folder download folder alone is the alarming indicator because it shows that something may download by the user in the download folder and execute it accordingly so there are another interesting finding that I try to match them with the miter knowledge basis as much as possible for example a cyber analytics again says that unusually long command line strings normally is indicator of the malware activity however they didn't define the long how long it should be but in this case as you can see we have a very long one that indicate the use of the download string the function of the power shell that used to directly download and execute the scripts into the memory without touching a file and in this case as you can see the win security update is a script that downloaded by using the same technique and function after the PowerShell so another thing is a hide artifacts normally attackers try to hide their activity yes and in this case you can see the use of the nop and window style hidden to hide the windows related to the script running on the victim machine and so let's focus on the download file because this file downloaded and directly run in the memory the first thing we try to understand about this file and the cmd the script with the cmd extension is what is this file and who owns it this is what we call it a file and resource ownership so we can easily navigate to the download folder and use a dir with a queue switch to shows the username behind that file here we can see the update script is still there and is owned by the user called cyber Mason if it's possible go and check the content of the file in this case you can see the command line which is executed and we observe it in the findings here it shows again the download of the win security update so what is this win security update doing if there is a possibility we could you refer to the same URL or IP and download the script in the isolated system for further analysis but it's not made possible all the time and if it's possible it may alert the attacker because if we are downloading from another location we technically tell the attacker hey buddy we are downloading your script and we are going to analyze it so in this case we are getting the win security update and we check the content and we can see uh encoded uh the de the n the information, no makes sense why the PowerShell has had access to the Crypt32 DLL because it's using some sort of the decode and encode the data. So it is the simple base 64. We technically can use the echo and decode extension in the Kali Linux to decode the data, which indicate another attempt to download the secondary scripts. So having the view of the R1 shows that a Suqet TCP IP client used to establish a TCP connection to a potentially attacker machine via the port 443, which is a reverse shell. So when we talk about a reverse shell, it means a network activity is there. So the PowerShell is a network activity, which is a network activity, which is a network activity MITRE ATT&CK T1049 suggests that attackers normally, upon the initial access to the victim machine, try to discover the network connection to evaluate the possibility of finding another vulnerable system or the connectivity. Let's think, if the attacker can use this technique for the bad intentions, we as hunters can use it for good. So, we can have the list of network connections to see what is going on. A simple net state dash ANO helps us to have the list of all the network connections, especially the established TCP1. As we can see here, the network connection is still there, which is established by the process ID 9392 to the attacker machine. So, this is where we need a simple process to port. For mapping, I'm using a task list and find the name behind the process ID 9392, which is PowerShell. Technically means, we have a script which runs the PowerShell, and that PowerShell gives a reverse TCP shell to the attacker. So, confirmed case, this is the time that we can start generating the IOC and update our automated tools. As it's well said by my friend Josh, Threat Hunting does not use the IOC. It is a good thing. It makes them. Now, we know the rules. Let's use a free tool. One of my favorite tools, a process explorer, which can be used to have all these wonder analyses together. So, just please keep in mind that we should not install anything on the victim machine and avoid copy or installing anything as much as possible. Technically, we should have external storage. Copy the file on that. Attach it to the... The live system and then execute the applications and other scripts from the external storage. So, upon the execution of the process explorers, we can immediately see a very nice view of the process hierarchy. That shows, again, our CMD and the PowerShell. If you just move your cursor slowly to each process, you can see the commands that the command line executed by that particular process. However, if we right-click on it... If we right-click on each process and go to the properties, we have tabs with many fantastic information. For example, the image tab gives us the build time, the path, the command line executed, and the current directory. And most interestingly, the TCP IP tab shows us the connections established by that process. So, as you can see, the system live analysis gives us a very good point of view about what is happening in the system. However, the system live analysis gives us a very good point of view about what is happening in the system. However, the system live analysis gives us a very good point of view about what is happening in the system. However, there are a lot of challenges that we will discuss about it in the last slides in detail. Just to name a few, when we deal with the Windows live analysis or system live analysis, there is always a chance to have unintentional changes, which is really risky if we change the digital forensic artifact or we change even the system state. That's why I know we are going to focus on the memory forensic, which more or less gives us a good point of view about what is happening in the system. That's why I know we are going to focus on the memory forensic, which more or less gives us a good point of view about what is happening in the system. It does not give us the same information, but in a very safe way. We are in the second part of our threat hunt trilogy, which is memory forensics. Let's dive into the past. The first step in the threat hunting we are memory forensics is to create a forensic image of a memory or simply a bit by bit copy of the memory of a machine under investigation. instead of talking about the tools let's talk about a few rules as we discussed earlier we should not copy or install anything on the victim machine because forensically we should avoid any intentional and unintentional changes that may happen to the system estate or the digital artifact during a threat hunt root cause analysis threat detection and digital forensics we need to have a forensically clean external storage which we copy all the necessary files and application on it attach it to the victim machine execute the file from there and save the result into the external storage as well so I created a forensic image of the memory of the infected system and copy it to my investigation system which is a version of Kali Linux utilized with the latest version of the the volatility which is volatility framework 3 at this particular moment so we can easily refer to the help of the volatility framework to get a list of all the current available plugins to retrieve the information from the memory taken from the Windows operating system they make look a little bit limited at the moment because the window the volatility framework is still new and it takes a little bit time for the community to improve it and make it more mature and develop more um profiles and plugins uh so let's continue with the first step in detection which is similar to the what we did for the system live analysis process lineage analysis so the volatility command Windows PS3 give us opportunity to have a list of the processes along with their parents and siblings as we expected we can see two instances of the PowerShell which is run under cmd if you may notice the process IDs here are different from what we observed during the system live analysis is simply because I run these two practices in the two different different testbed in two different uh time two different time slot so again the PowerShell is not interactively executed by a user instead is run under a cmd process let's have a view of the handles to see each of these processes access to any file registry key or any other process process so in this case I am I used the volatility the Windows handle and I limited the finding to only those three suspicious processes which is the two instances of the PowerShell and the cmd and I use a grab to only look for anything match with the file key and process so as we can see here we can have the access to the file by the cmd process which is indicated to the user cyber may some download again access to a file in the download folder is so suspicious and we can see here the handle created from the cmd to handle another process which is 9460 we referring here is the instance of the PowerShell getting the handle for these two PowerShell again indicate the access to the creep 32 DLL which is used for the decoding encoding and encryption and some Network and TCP IP related settings and information which indicates that this PowerShell doing something via Network so the command line scripting is pretty straightforward to extract from the memory image we have a built-in plugin called cmd line again we can limited only to those uh three suspicious processes and we can clearly see the process ID here followed by the command executed by that particular process here we can see again the cmd executed as update underscore script batch file with the cmd extension and one of the instances of the PowerShell use the download string to download a secondary and potentially malicious script from the this particular IP via the port 8000 and download strings give opportunity to this PowerShell to download directly to the memory and execute it from their video touching the hard disk so at the moment we are using the volatility but beside I would like to introduce another two handy techniques one is one of my favorite tools which is bulk extractor is an open source tool that can scan any hard disk image and memory image and extract a wide variety of the data you can easily refer to the official GitHub page to check what are those data which is available to extract here I just run it against our memory for memory image and extracted various data so because we are aware of this suspicious IP I use a simple grab to look for any things matched with this IP amongst all the data which is a tribe by extractor and we can see here another three IP which is add another three scripts downloaded and access from the same IP so apart from the bulk extractor we can use a built-in command strings so we can use the cat to open the memory file and then use the string to look for any strings in the memory image that match to our IP again again here we can see the indicator of the download of the three additional scripts so we are not going to repeat the same process as we did it just for the system drive analysis if it's possible we download all these scripts into the isolated machine for the further investigations so if you remember we discussed two challenges they are may not available at this point of the time and even if they are available downloading them may alert the attacker another real challenges in the memory forensic because this memory image taken in the past so means at the moment that we are analyzing those links may not accessible anymore or may not even available but again threat hunting is all about evaluating and exploring the different opportunities if it's uh possible we download all the script in the isolated environment see the content for further investigations just to recall the r1 the said the win security update is the one who have who has two different base 64 encoded strings when we decoded it is a relief that they are it's downloading another two file a1 and r1 and the r1 is the one who make a reverse TCP connection so when the reverse TCP connection is there the last step would be checking the established network connections which is can be done by the net estate plugin of the volatility framework tree the good things about this plugin is that we no need to do the process to port mapping individually because once we can obtain the data it shows the owner of each established connection in this case we can see an active TCP connection to the suspicious IP which is made by PowerShell instance so now we can confirm that our script download another additional script execute them from the memory and give the reverse shell access to the potential attacker in the network packet investigation we may deal with the huge volume of data that's why I call it hunt in the ocean so both miter defend and miter attack give us a list of the techniques to look for the suspicious and malicious activities in the net for traffic by analyzing the network connection connection creation content and flow but in general all of the techniques talk about how we should look for the uncommon unknown and abnormal and untrusted IPs port and communications so in this section I'm using the wire shark to open and pick up file which is capture traffic traffic from the host which is infected by the fileless thread so in the statistics we can have a conversation and we can have a list of the endpoints technically the wire shark statistics give us a good idea about what is happening in the network in term of the protocol hierarchy which will recover shortly the packet lens or endpoint and conversation simply the endpoint list list all the endpoints and IP addresses which shows some sort of activities on the time that we collect the data while the conversation specifically showed the list of the packets send and receive between two different endpoints so there are a few challenges we are dealing with this kind of the data if we don't have a baseline for the standard and normal things in other environment it could be difficult to define the uncommon to define the unknowns and to define the untrusted sometimes even if we have the baseline we may deal with a large volume of the data which high diversity dynamic nature and complexity which make a life a little bit hard for a threat Hunter and the poor data management analysis could lead our threat hunt to a failure so that's why apart from the data collection a proper data classification filtering and unwanted data reduction plays an important role for example here I just use a very simple data filtering to filter on the traffic to or from a victim machine which is in this case is 192 168 182 140 so this simple data filtering effectively reduce 20 percent of unwanted data when we're talking about a huge volume of the data 20 percent could be a time saver and even a lifesaver so the mitre defend network traffic Community deviation suggests that once we collect a data of the network and the packets we should look for any deviation from what it's supposed to be a routine of other Network again if we don't have the baseline we cannot do anything so in this example I try to just understand who is who I use a very simple command of the TCP dump to extract all the IP addresses exist on that packet capture file and then I I write a very simple script to run the who is for the public ips so technically we can have the list of the ips exist on that pickup file plus the name of the organization so in this example all look normal but we should keep in my night drones are good because a legitimate service may be abused by the attacker to conduct the malicious activities is always good to validate the finding based on the hyper reputation system known iocs and threat Intel feeds or a few extra um factors that we are going to explain no top protocol uh simply means that uh the highest the top protocol that is in the conversation on the network top host means all the host that shows more activity at accordingly the top conversations is or is a pair of the host that talk to each other um more compared to the others the two interesting things are top listeners and top talkers top listeners are those who receive data more than what they send and top talkers are those who send more data compared to what they receive so let's have a quick example about these terms uh I limited our finding our packets only for the IP address related to the victim machine so going to the statistics and endpoint tab IP version 4 sorted by the bytes we can have all the list of the top host which shows more activity on the time that we capture the traffic so as we can see there is a one private IP which is belong to same network of our victim machine and it appears in the top host list going to the statistics and conversation and repeat the same sorted by the bytes and surprisingly we have the same IP appear in the top conversations means it shows one of the highest activity in the network and it has one of the highest rate of conversation with our victim so I I use a TCP dump again to extract the list of the top talkers in our networks and our suspected IP it appears there again so means this is it was one of the top talkers we talk more with the endpoints in the system but we may need more details to validate the finding because the devil is in the details so even though this IP is among the top talkers when we dig more and go for further investigation specifically for the conversation between this IP and other victim we notice that this IP receive more data than sending so it received more data than sending data to the victim machine so the mitre ds0029 network traffic as a as a source of as a data source suggest to monitor network data for uncommon data flows for example a client sending significantly more data than it received from the server which is this case let's focus on that particular conversation and extract the protocols that mainly use in this conversation so uh so the filter we I the the traffic is already filtered based on the victim IP and the suspect IP so again from the statistics menu we can go to the protocol hierarchy and based on what we can observe here the TCP involved we have some HTTP traffic and we have some uh data so again mitre ds0029 suggests to focus on the application layer protocols because the web protocols are widely used by the cyber attackers to hide their activity amongst the normal web traffic so in the left side I added one more filter as HTTP to not only limited the finding to this conversation but only give us the HTTP related traffic because we have seen the HTTP traffic exists in the in the protocol hierarchy so interestingly we can see a get method used to download a few files so again we can focus on these files which is downloaded via the HTTP get right click on any of them and follow the stream either the TCP or HTTP may give us opportunity to see the content in this case we are using the follow HTTP stream to see the content of the win security update which I believe this is familiar to you and ring a bell for you because this is the same encoded database 64. um so when we can see a few files involved in the traffic is immediately trigger a file carving detection method by the mitre defense which says we should identify an extracting file from network application protocol so in this filter only focus on the file and the hosts for that particular conversation here i demonstrate a tcp thumb example that help us to extract all the host field from the request header for entire ip and entire conversation within a packet capture file let's get back to the file carving if we want to extract those files from the network traffic packet capture we have a few options i just listed two one is a built-in option of the wireshack export object that we can select the conversation and go to the file menu and select export object we can see the list of the extracted objects from that conversation and we can select and save them all another interesting tools is a t-shark extractor again the open source tools you know that i'm a big fan of the open source and the free tools so if we run the t-shark extractor against our pickup file it automatically extracts all the potential file exists in that conversation however they are saved based on the stream number a simple t-shark command help us to find the tcp stream index for the http get methods for example here i have the stream index of 22 for the win security update 23 for the a1 and 24 for the r1 let's take a look on the r1 which is the which has the tcp stream index of the 24 so i refer to the finding of the t-shark extractor and open the http stream 24 and if you remember the content from the previous investigations we can have the evidence of establishing reverse tcp via the port 443 which is according to the another mitre knowledge base information is a commonly used port by attacker to hide their activities so let's narrow down our information this time to the http to the tcp port 443 for the same conversation we can see a few a few first row are the typical standard three had the three-way tcp handshake we can see some evidence of the push acknowledge acknowledge will indicate some data the transfer so based on the mitre again the network traffic we should analyze the network traffic content when it's not encrypted or the encryption is a way that we can decrypt it or is plain text in our case so it's a way that we can decrypt it or is plain text in our case so right click on any of these data and follow the tcp stream show us the command executed by the advisory and extracted again by the follow tcp stream so we can see a few commands executed which indicate of the system information discovery normally the attackers do the system information discovery up in the initial access to get a better understanding of the current state of the machine if there is a any chance for privilege escalation identify another vulnerable connection and resource in the network for the lateral uh movement system live analysis give us a better understanding of ongoing events because we are doing the threat hunting while the system is still running uh in some cases where making the forensic uh images are difficult or challenging like when we are dealing with a huge volume of the uh storage or Sometimes, based on the SLA, when we are renting the services from the vendors, we may not even have an opportunity to touch their storages. The system-led analysis could be a good option. Another example is where some sophisticated attacks may not leave any traces on the hard disk. The system-led analysis, again, could be a big help. However, there are a few risks associated with this technique. For example, the risk of unintentional changes is always there because we are dealing interactively with the running system. And if, by chance, the attack is still ongoing at the same time with the threat-hunting activities, we may have a conflict and we may alert the attacker. And the main important one, the procedure may not be repeatable because the state of the system keeps changing. Memory forensics give us a good insight about running system activity and one point. And we may have access to the system-volatile data without risk of evidence changes, which is very important. Because here we don't touch the live system and we are conducting the threat hunt on the forensic image of memory. It may also give us a more opportunity for threat analysis because we may have access to the data which only exists on the memory. Talking about the challenges, apart from the forensic imaging challenges that we may always face, the main challenge is the limitation of the current available framework and tools. Talking about the open source, we have a very limited number of the tools like volatility, and they may not fully compatible all the time with the latest version of the operating system. These tools are community-based. We may need to be a little bit patient and wait for the community and for the developers to come up with more plugins that enable us to retrieve the data accurately from the latest version of the operating system. Network packet investigation gives us a visibility to the network activities. Not only tell us about what is happening on our network from the security point of view, but issues in the network infrastructure as well. And we may not require the local access to the endpoints if we are not directly collecting the packets from the host, which gives us an opportunity to expand the scale of the investigation, investigation rapidly. However, there are a few serious challenges with the network packet investigation. Apart from the limited data that we have about the host level and local user activities, the encrypted data analysis challenges, the main challenge is about how we strategize the network packet collection. It must be placed before an incident happens. In the system live analysis and memory forensic, we may still have a chance to get back to the traces and collect the data that belongs to the past and remain on the hardest during the live analysis and resides in the memory. But in the network packet collection, some things happen ongoing and gone and the data will be erased forever. So if we miss a chance to collect the data, we have no visibility to what has happened in that particular time. Another challenge is the data volume capturing and storing. That's why capturing the network packets is not applicable most of the time as a full-time strategy for the security solutions. If we run about one hour of the network capture for the small to medium size of the network, we may deal with a really huge volume of data. So I'm not going to white list any of these techniques. All of them, each of them have their own advantage and disadvantage. If well is possible, they actually work better together. So I would like to say a special thanks to my team for all the brainstorming and the support, especially Joko Tan, the man, the Ming, the mountain, and my other lovely team members that known as a team born ready. Feel free to connect to me via the LinkedIn or Twitter if you have any additional clarification or question about this presentation, or if you are willing to have a productive conversation about any cybersecurity-related topic. This talk ends here, but threat hunting is a never-ending battle. Explore your scopics and unknowns, be proactive, dive into the bits and hunt the bits, especially those who hide in shadows. Hope you all enjoyed this session. Thank you. Thank you.