Hello, and welcome to Blue Team Village's Project Obsidian Reverse Engineering Malware Station Walkthrough. This is Long Walks on the Beach, analyzing collective PowerShells, and today we're going to be going over some basic PowerShell scripts obtained for us by our forensics team, and going over some tactics and techniques and understanding them, as well as a few basic de-obfuscation techniques. This workshop is geared toward beginners and absolute newbies, so if you're looking for more advanced and in-depth analysis for PowerShell techniques on de-obfuscation, we're looking to release content like that in the future, so keep an eye out for that. So a little bit about myself. My name is Allison, although I go by Scrabble. I'm a fourth-year cybersecurity major at a university over in the Northeast, and my background is mainly in incident response, reverse engineering, and cybersecurity engineering. It's a little bit all over the place, but generally speaking, I like to stay in the Blue Team side of things. This is my second year with Blue Team Village, so last year I was part of the Malware Station as well. I just wasn't leading. This year I'm leading two workshops, which is a really amazing opportunity. 10 out of 10 recommend to join this community. There's really fantastic people in there with such a depth of knowledge, and totally recommend just, you know, even talking to any of the people involved in the stations, because really there's just such an amazing variety of knowledge here. And I guess a little fun fact about myself. I really love black cats. I have one of my own, and contrary to all the stereotypes I thought, like, she's super, super clingy. So that's a little funny. But all right. So going on into the meat of this. So what we're going to be going over today is assuming from an absolute beginner perspective, you've never done malware analysis before, or maybe the most you've ever done is just pop something in the sandbox. So what we're going to do is we're going to start with the basics of setting up a VM, what VMs you want to look for, some recommendations, and then some settings you should be on the lookout for when you're configuring your VMs. Secondly, taking precautions. So going over some things like OPSEC when analyzing malware samples. And then we're going to touch on some basic static analysis. So what is static analysis or the different forms of malware analysis? And then some particulars about PowerShell. And then we're going to be going into our demo one, which is going to be covering kill chain one, kill chain three, which has five PowerShell samples that are all unobfuscated, which may sound easy. But we're taking a pretty non-technical approach in trying to understand that. We're trying to understand what's going on here and some limitations that we may have. And then we're going to be going on to our second demo, which is looking at kill chain one, the two PowerShell scripts that are in there, taking a look at some ways to deobfuscate them, as well as some things to look out for when you're going through your analysis. And then finally, some takeaways from this whole workshop, things to hopefully take in and keep with you as you go on your malware analysis journey. All right. So we're going to start setting things up. And if you have your hands on the samples already, totally get those. But a thing you might have noticed, especially for the kill chain three PowerShell samples, is that they've all been defanged, which is a fancy way of saying they're all text documents now. So if you accidentally double click them, you're not accidentally running a PowerShell script. You're just opening a text editor and seeing, you know, whatever visible code is there. However, that's not to say that you shouldn't work with these in a safe environment because you definitely should. It's good practice, too. Even if you believe something has been defanged, always be cautious with it. Like I say, it only takes one time, and then you learn your lesson the hard way. I had a fellow student when I was learning malware analysis for the first time in college who thought that he was on, you know, his host, his analysis VM, you know, totally safe. Deployed some ransomware for dynamic analysis and then didn't realize he was actually on his host, and he deployed ransomware on his personal computer, which isn't great. So definitely, I would say good practice is double check if you're, you know, in your analysis VM, making sure you're taking all precautions before you start playing around with things. So some recommendations. You're going to want some kind of virtualization software. VirtualBox is free. I personally use VMware because I just have that available to me. But anything that really works for you. Going on to the two things that I would recommend specifically for this workshop but also in general. Some sort of Linux distro, I would recommend Remnix because that becomes preloaded with a bunch of really useful malware analysis tools. So definitely grab that. And then optionally, I will briefly touch on doing some things in Windows. So I'd recommend some form of Windows VM. Flare VM, which is additionally free, comes from Mandiant, is a Windows distro where, like Remnix, it comes preloaded with a bunch of really great tools for malware analysis. And then once you have that all set up, once you have, you know, logged in, get into your virtual machines, what you're going to want to do is that in your network settings, you're going to want to switch from whatever NAT bridge, whatever option you have currently set, to host only. This is to disconnect your VM from the external network and to sort of protect your own host as well. So that, you know, in the case if you're ever running it dynamically, if you're not executing the actual malware, you're protecting yourself. You're protecting yourself. You're protecting the outside world. You're just keeping it contained within that VM in that regard. So moving on to taking some precautions. Some things about OPSEC, especially when it pertains to malware analysis and beginners when you get samples. So I know if you have any experience in working in a SOC before, I did my previous internship. Standard practice is to usually, if you do have a sample or something malicious, you throw it into a sandbox. Typically, this is, at least in the case of my company, a private sandbox that is not public. In that case, that was pretty safe to do because we're not really necessarily alerting people publicly that we're analyzing this. But generally speaking, when you're using public resources, you want to check the hash first. You don't want to submit the actual sample. And so in checking the hash, you're determining one of two things. Is this known or is this unknown? And then basing your next steps off of that. So if it's known, then typically you'll come with, you know, the sandbox analysis. Maybe if it's something that's known, that's really well known. Say, you know, I got a WannaCry sample once. WannaCry is really well known. It's really well documented as to what it does, what steps it takes. So when writing up your final report for that analysis, you'd be like, hey, you know, this is determined to be WannaCry. Obviously, double check, you know, don't just trust the hash. Make sure, make the necessary comparisons to make sure that this has all the, you know, typical IFCs. Make sure that, you know, WannaCry or whatever you have might have. And then say, like, okay, this is it. This is it. And you have all that nice data and open source knowledge to kind of feed off of. But otherwise, if it's something that's not known, you want to start treating it carefully. So I wouldn't recommend to submit it into any sort of public sandbox just because you run the risk of tipping off threat actors. And generally speaking, when it comes to malware analysis, you want to avoid that as much as possible. I would also say to try not to execute it immediately. Just take a look at it. There's a lot of precautions in doing so. You know, do very thorough static analysis beforehand. I'll explain what that is in a bit. Especially if it's on a system with external network communication. Likewise, you know, you're, again, potentially tipping off threat actors and you don't want to run it if you don't know what it's doing or what it will do. And another thing to consider is that it could be potentially unique to your environment. So depending on, you know, if you're doing this in an enterprise environment or something, you get something that's, you know, completely you've never seen this before. You may want to sync up with your cyber. Intelligence team. And try and see if you can get any attribution on this if this is, you know, a result of someone directly targeting you and your company. So going on to static analysis. A little bit about what it is. So there's two forms, two general big forms of analysis when it comes to malware analysis. There's static and then there's dynamic. And so when I was TAing, I usually kind of used this dumb food metaphor. Which is that malware or, you know, a suspicious sample is a tasty dish that may or may not be poisoned. And your job is to determine whether it's been poisoned or whether it's not poisoned. And if it is poisoned, what kind of poison is it? So you have two ways to do this. Statically, which is typically the safest way. So you're just observing the dish, kind of smelling the dish, seeing what you can see. So, you know, you see like a long green thing that looks like a green bean. You're like, okay, that looks like a green bean. Chances are that might be it. This is what I should expect when I'm looking at this or eating this dish. You know. Likewise, dynamically, you'd be doing things like poking the dish, tasting the dish, etc. But you're doing so at a slight risk. So, you know, maybe if you don't take proper precautions by poking the dish, oh, no, you have a rash. Or if you just go ahead and start like eating the dish, you may be going like, oh, god, wait, this is poison. You get poisoned. So that's not to say, though, that dynamic runs a ton of risk. This is with no reward. But it's always a little bit more of a risk. Going on, though, through dynamic analysis, you can learn a lot more than you can through static analysis. So some assumptions you made may be incorrect or some assumptions that you made you may not have the full picture of. There's ways to obfuscate information about the program from static analysis. And so the only way you can really figure it out may be through dynamic analysis. So back to actual programs and malware. Static analysis. Static analysis is usually regarded as the safest form. So it's doing everything except executing the program. So it can be things from, like, what kind of file is this? You know, is this a Word document or Excel document? Or is it, you know, a PowerShell script? Or is it a portable executable, a Windows executable? What is it doing if it's code readable? So, you know, in the case of PowerShell, you know, can we see what it's doing immediately? Do we have to do a little bit more deobfuscation maybe to see what it's doing and so on? Maybe it's calling out to something. You know, whatnot. And then, you know, likewise for portable executables, for example, sometimes if it's obfuscated or unpacked, we can see what kind of functions it's calling and kind of get an idea of what it may be doing. So if it's calling, like, a download data function, then that gives you the idea that, okay, it's making external communication, grabbing something from some kind of remote server potentially. Or if it's doing, you know, get process, create process, okay, it's, you know, doing some process manipulation. This is something I should look out for. And then, you know, going on from that, is it making external communication? So sometimes if it's, you know, obfuscated, you might be able to see some URLs, domains, IP addresses, or even just the function that's typical for network communications. And so specifically into PowerShell static analysis, it's either obfuscated or deobfuscated. It's kind of not as common to see it completely obfuscated. If that's the case, I've found it's usually something that's open source, publicly available. But most of the time, it's going to be obfuscated. And in that case, there's usually some pretty common ways to pretty easily deobfuscate it. But sometimes, you know, malware author may have a few tricks up their sleeve. It may be a little bit more challenging to do some deobfuscation. So it's a mixed bag, as it always is with malware. And so malware authors will often do, you know, fun little tricks. They may want to try and fool you or try to fool, you know, whatever defender that you have on your system. So it can try to hide calls to certain functions, either by kind of making it hard to read. So when you're going through it, you may be looking out for a certain function. They may be hiding it with some shorthand technique. Usually it's something involving base64 encoding. That's pretty common. Some things like string concatenation, where it shortens, you know, if it's calling out to a URL. It'll shorten all the individual components of that string to make it harder for detection and harder for you to potentially read or just grab easily. And another thing to keep in mind is context of it. So sometimes PowerShell scripts, you can just run the script itself. But sometimes it may require flags. And so you want to make sure that you have the full context of the script itself. Otherwise, you're going to be missing some vital information. And this is definitely not going to come up in our next demo. But it might. And so moving on, let's move on to our first demo right now. All righty. So welcome to demo one. So right now we're in my cute little kill chain 3 folder. And all of these PowerShell examples are going to be in this PowerShell malware zipped file. So to unzip it, for reference, I'm just going to do 7ze and then the name of the file. Enter. And then the password is infected. At least it is at the time of this recording. And then that will get you all of your samples out. I like to keep everything clean and organized. So I usually keep the zipped malware in one folder just in case something happens to the samples that have been extracted. But for now, we've got all of our PowerShell samples. And we've got five of them. So what we're going to want to do initially first is to grab the hashes of things and try and see if we can find any similar samples out there. So just going by order, I'm just going to grab Invoke Kerberos. So md5 sum. Invoke Kerberos. Grab that. And then let's grab that. So you may also want to use SHA-256. I'm just using md5 because that's shorter. But opening up VirusTotal. Going over to search. Well, not md5 sum. Let's go actually grab the right one there. There we go. So popping this open. And this has been seen before. So that may, you know, help us in trying to understand what this is. So we see that there is, you know, pretty malicious. Assuming we want to make sure also grabbing this PowerSploit is something we want to look out for. But in VirusTotal, we can get more information. We can get, you know, the various hash sums. We can grab, you know, when it was first seen, when it was last seen, and so on. And some additional PowerShell info. So, you know, functions that are used here. If there's any calls. And so on and so forth. As well as some various names that it may be called in case you're looking for that. Under the community tab, obviously take the information here with a grain of salt. But some sandboxes will kind of paste their analysis of it in here. Other times you may see other users paste what it is. You know, sometimes we'll see funny things like this isn't malicious. And something that's pinging malicious. And well, yeah, take that with a grain of salt sometimes. But we're getting that this is, you know, known malicious. And if we were to grab the hashes of all of these, all of these would come back pinging as malicious. And so let's take a look at this one real quick. Open it up. And we can see immediately that this has no obfuscation on it. In fact, it's pretty well documented for what it is. And, you know, we have the whole author and stuff like that. But one thing I want to point out to you, and it's not in this sample. I think it's in this one. Yes, it is. All right. Is that we see this called a power split function of import scan, invoke port scan. And so largely this is going to be trying to determine what these five things do here. So I'm just going to do a deep dive into port scan and maybe into invoke Kerberos. And try to understand what these two things are doing. And then I'll cheat a little and let you know what the rest of them do. And then we'll try to determine what happened here purely based on these samples. So we have our port scanning one. We'll start off with that since that seems pretty basic. You know, recon activity trying to determine, you know, maybe sockets are open, ports are open, and so on. So we have power split. And so if I were to search power split, we'd probably get this. Power shell mafia power split GitHub. That comes up. It's been archived. We'll just ignore that. But we can see from the documentation that it's a series of power shell modules used for penetration testing. And so, you know, there's a lot of legitimate uses for these. Sadly, in our case, our threat actors have used them for something a little bit nefarious. And from what we can see in this virus total, other threat actors have actually done that previously. But going into a little bit. We can see a lot of them. I think that port scanning is recon, so we're going to go into recon. And we can see this invoke port scan script here. And there we go. That looks pretty familiar, doesn't it? And so if you want to, you know, double, triple check that this is, you know, nothing has been changed from this, you can do a side-by-side comparison. Copy this. Compare it to the script that you found. I'll say this matches one-to-one, I believe. So that's not so much of an issue here. But what we may want to do is we may want to see. Is there any more information that we can glean from this? And, in fact, powersploit has its own talks. So that makes our job pretty easy. I think for whatever reason. Let me try invoke port scan. I know the search utility on this is a little funky. And, yeah, it is. All right. That's fine. But I see the invoke Kerberos one. So we'll just skip ahead to that one and try to understand that real quick. But you can see a summary of it. So it requests service tickets for Kerberosable accounts. And returns extracted ticket hashes. I'll explain what Kerberosting is in a bit if you don't know what that means. But we can see, you know, there's a whole description, how it works. You can see the whole syntax, you know, what several examples each parameter does. It's very like a man page. This is pretty well documented as to what it will do. But you may start to see a problem here. Is that while invoke Kerberos is well documented, we see, you know, oh, yeah, you know, we know what it does. We know all the possible use cases of it. We know that, you know, how it can be used. We don't know how this was used. And that's slightly problematic. Because we were just given these scripts. Nothing else. No logs. No command lines that we're seeing. And so all we have are these scripts to kind of connect the dots. And ideally in some sort of incident, you would be able to link up with your forensics team, your IR team, be like, hey, you guys shot me some, you know, PowerShell scripts. Do you have, you know, the logs for them being run? You know, maybe if there was any flags added. So we can get a better understanding as to what they did. Because right now we just know that they might have done Kerberosting. And that's about it. Or, you know, for port scanning, we know that they might have done port scanning. We don't know what ports were scanned on what, you know, why, what information they might have gleaned from that. And so that's it. That's kind of where we're stuck. And obviously you should be able to get these logs, you know, real life. But sometimes you're not able to. And this is something that can occasionally happen. Is that when I was doing my whole little stint in malware analysis in a SOC, I would get some samples and I would just get the sample. And that's it. Or sometimes I would get a really old sample. You know, it had been submitted months ago and there was backlog. So when I finally got to it, I hit a wall. You know, there was no more logs for me to look at. There was no more, you know, information for me to glean. Maybe the domain that the malware was calling out to was no longer containing what I needed. So I had to look at whatever secondary malware piece there was. And so this can happen from time to time. And then what you're left with when you're writing your report is kind of try and understand what's going on. Give your best shot at it as to what it's doing. But obviously list out the facts first before you get your opinion. And so the facts are that these five things here do the following. Is that port scanning obviously does port scanning using regular sockets kind of like Nmap does. So we have some sort of Nmap-like utility here. Secondly, we have let's go over to PowerView here, which is primarily used for network and error awareness. But it can also be used to do user hunting things like what networks users are logged into or whether the current user is a local admin on host in the domain and so on. Going over to invoke Mimikatz. This loads Mimikatz into memory. So it can be used to dump credentials without permission. And it can also be used for writing to disk. So this looks like there may be some sort of exfiltration component to this. And invoke Kerberost. So a little bit background what Kerberosting is. But what Kerberosting does is that it attempts to crack the password of an active directory service account by requesting a ticket which contains an encrypted password, capturing the ticket granting service, and then attempting to crack the service credential hash to potentially gain that plain text user credential. And then Sharphound acts as a data collector for Bloodhound. Which collects data from the domain controllers and domain joined Windows systems. So if you're starting to sense a theme here, there appears to be some kind of user credential harvesting. And so, you know, if you were to write a report, you know, you'd obviously sum up what all these things do, what they're known to do, possible use cases. And then say, you know, okay, maybe, you know, based on these, you know, all five of these in particular. In context, it appears that if ran, this may, you know, potentially be geared toward user credential harvesting or at least an attempt to. That being said, though, that's pretty guessy because we don't really quite know what's going on here other than the usage of these scripts or the probable usage of these scripts. And so that's kind of not fun to start off with. But it brings up an important skill to have in malware analysis. Which is essentially. A lot of Googling. And a lot of researching. And looking up, you know, in the case of these, these are all open source. So you're going to be looking at that. You're going to be looking, you know, if you don't know what Kerberosting is, you're going to be learning what Kerberosting is. Or, you know, how it might be utilized. And so on. So this is, I would say, a pretty good jumping point for getting into that research mindset. So if you're looking for any sort of homework, I would say look into what are the use cases of invoke Kerberos. You know, how can you use this? You know, maybe. Try it out yourself. Try, you know, some little bit of penetration testing yourself. To kind of understand, you know, how someone might be using this. Obviously do so safely. And don't do it on, you know, hosts that you don't have permission or access, you know, initial permission or access to. But, you know, definitely get a better idea of what's going on here. And that'll, you know, really help you understand why threat actors do things a certain way. So. We're going to move on. Back to the slides real quick. And do a little summary of this demo. All right. So that may have not been, like, the sexiest example of PowerShell scripts. But I wanted to, at least for beginners, give them the understanding that malware analysis can't really happen on its own without the full context of what is going on. So sometimes you may be given a sample. But sometimes that sample may be useless in trying to understand the full context of what is going on. And so I wanted to give you a little bit of an overview of what occurred within that attack. And so in this, while we have the scripts used, we don't have the flags or any other information our attackers used. So all of those PowerShell scripts required certain parameters to be input in order to gain specific information. And we don't know what parameters were used. We don't know what specific information that our attackers wanted. And so we don't have the full context as to what happened. Other than based on what each script does. And so I was guessing that usually with all of these scripts together, this may, you know, point to some credential harvesting activities. Primarily using Kerberosting. So this is kind of what happens sometimes is that it's kind of like a box of chocolates as to what you get. Sometimes you'll get some really fun samples where you can get, you know, map the whole thing out. And be like, oh, yeah, this is, you know, this PowerShell script spawns this executable which does this. And so on and so forth. And you can, you know, get a really nice, cool report and write up out. And sometimes you kind of get like a, well, I mean, this might have happened. This is what I got. Or, you know, here's the limitations of the sample that I have. And so in that case, it's to kind of make sure to note that that may happen sometimes. And doing the best you can with it. And making sure that, you know, in a real incident, keeping communication open so that, you know, if this were a real life thing. And I was just handed those five samples without any context. I would definitely be going to the IR team or the forensics team and being like, hey, logs, please. So going on, we have another thing to look at that may be a little bit more fun. And so this is going into kill chain one now. And there are two samples that we're going to be taking a look at. A few ways to tackle these as well as some considerations when you're choosing how to deobfuscate PowerShell scripts. So on to demo two. Alrighty. So welcome to demo two. We're now in kill chain one. And we're going to be looking at the two samples that we can immediately find. This malicious PowerShell.txt and then this PID malware.txt. So this one will be just as is. I believe you can just grab it as the text document. No need for unzipping. But this malicious PowerShell one is going to be located in the for malware RE team zipped file. So once you've got all those unzipped, we're going to start with this malicious PowerShell one. And so opening up with a text editor, you can see immediately that this is not legible. At least not to us. And you may be wondering, like, okay, oh, God, where do we go from here? And the clue lies in this TACENC flag here, which stands for encoded command. Now, this means that PowerShell will accept base 64 encoded commands and be able to run them. So knowing that that's our first clue here, we can go ahead, grab this real quick. And then what I'm going to do is open up CyberChef. As a note, for whatever reason, when you just download a fresh install of Remnux, CyberChef comes two years out of date. Or that just might be something that happened to me. I don't know. Obviously, you should keep it up to date. But for the purposes of this demonstration, that's not super necessary. But what we're going to want to do is first take out this PowerShell header here. We just want this base 64 encoding. That's going to mess up our conversion when we make it if it's still in there. And so a little bit about CyberChef, if you're not familiar. It's a really useful tool for pretty much a lot of data formatting conversions. As you can see from this list here, I like to say that if there is an input and an output, CyberChef can typically do it or can handle a good chunk of it. A lot of what I use it for are data format conversions. Specifically, in the case of if I need to do several conversions stacked on top of each other, CyberChef is really useful for that. So, for example, this won't work at all for what we're doing. But I can do all of this on top of each other. And if it's for whatever reason a recipe that I use pretty frequently, what I can do is save it and then load it later in the future if I need to use it again. And it's something that I don't want to have to keep remembering how to do. But all we need to do right now is grab this from base 64 recipe or operation and pop it into our recipe here. We can see immediately that this is starting to look like PowerShell. You can see new options. New object. IOS stream. Reader. Weird formatting. But there's some weird periods, spaces, weird capitalizations going on. So what I'm going to do is I'm going to grab the regular expression operation and pop it over here. And without having to put any regex in, this is already kind of fixed itself. Now, from what we can see is that you may be looking at this and seeing, like, oh, god, okay, maybe it's another base 64 string. This is maybe, you know, we have to pop this in here. And I'm going to say that you're kind of there halfway. But to additionally consider this compression, deflate stream, you know, more compression stuff. This is obviously pointing to, well, this is base 64. It's also compressed. So there's two ways to tackle this. One, we can do it purely in CyberChef, which is what I typically like to do as the first stage. And two is to do it in PowerShell, which is really easy. You don't have to really do much other than copy, paste it. And pop it into PowerShell. But there's some additional considerations to be made when you do that technique. First of all, there's a function that you should be on the lookout for. Which is invoke expression. That will, in fact, all of this, run it. And you probably don't want that, especially if you're doing static analysis first. And so what you want to do is trying to find that invoke expression. The problem of it is that there's a lot of ways to hide it. So sometimes it may just be, you know, flat out there invoke expression. Other times it may go by its shorthand, i.e. x. Or in this instance, it's like this. And so you may be wondering what this shell ID thingy here is. And this is an environment variable. So if I were to go over to, say, our cute little PowerShell thing over here. And ignoring VMware real quick. If I type in shell ID. And hit enter. It's going to bring us Microsoft PowerShell. And so going back here, we can see it's grabbing character from the first index. And the 13th index. And concatenating it with the letter x. So popping back over. Character at the first index is i. Character at the, I think, this is the 13th index is e. So putting it all together, that's i.e. x. Which, shorthand again, for invoke expression. So you want to look out for that. So if you were to do this whole little trick. Of copy pasting it into PowerShell. You want to avoid this little fella at the end here. So I'm going to grab that. I'm going to go over here. I'm just going to pop it in. Hit enter. And there we go. There's our next step of the translation there. Conversely, if you want to do this purely in CyberChef. What you do is. Not that. There we go. So what you do is grab all of this. And take out this ending piece here. There we go. And immediately we still have this from day 64 recipe. We can see that this isn't quite working. But we know it's been compressed. And so CyberChef has this operation called RonFlate. Which decompresses data which has been compressed. And what we can do is pop it at the bottom here. And we get the same exact output down below. And so this next step I'm going to additionally do in CyberChef. But I'd also like to note another instance of hiding that IEX. This is in this over here. And so if we grab this verbose preference here. And once again just pop it into PowerShell. Just to see what that is. What that's doing. It comes back as silently continue. And we know from this it's grabbing from the first and the third index. Which once again is I and E. And joining X to it. So we have IEX right there. So being careful with that of course. We want to avoid it. Take that out. So if you're going to do another PowerShell. Pop it into PowerShell once again. You're going to want to delete that. And then put the rest of this in here. But if we're going to just do this in CyberChef. Just to note as to what the next step is. As char tells me that this is converting all these integers to characters. Which tells me that this is char code. So I'm going to just grab these right here. I'm going to delete the input. Pop in there. Obviously delete our current recipe. And what I want to do first is that if you take a look at the from char code operation. You can see that there's a delimiter that's needed. And with our current input here really now. We can see that we're both using spaces and commas. Which probably isn't the best. So what we're going to want to do is there's another formatting operation. Remove white space. We'll just do that. And taking out the from char code. We can see our output has been normalized. So back to from char code. We're going to change our delimiter to comma. You may now be thinking uh oh. That's not right. But you need to remember that. Play around with the bases a little bit. There's different ones. And in this case base 10 works for us. And gets us to our endpoint. And so here if you're just purely looking for IOCs. You can see this download data. This malwarelove.xyz URL. And you may want to just quickly grab that. And you know take it with you. Use it how you may. In general this appears to be creating a user agent. Downloading data from this malwarelove domain. And then loading it into the system. So that's kind of spooky. But for considerations then. You'd want to probably look at making some detections for this domain. Or any attempts to connect to this domain. And so here we are. We're at the end. And some other neat things to note about this too. Is how the strings have been kind of I won't say manipulated. But they've been you know changed up in kind of a way to make it harder to detect. Obviously these have been split apart as far as possible. Same up here with user agent. And you know all of this up here. Has been split apart as to further attempt to obfuscate what's going on over here. And so that's it for this first one. So we're going to. Let's delete this. Because I think we're using CyberChef again. So we're going to go back. And. To our cute little demo space. We're going to the next one. Which is this KC one. You know I'm going to rename that. Because that's getting really difficult to say out loud. I'm just going to call it CoolCat2. Probably keep things named the same way. In this case. I'm just getting tired of trying to figure out what to call it. So CoolCat2 works. We're going to open up. This into our editor. And. It's a little weird so let's wrap it real quick. And we can see that this is a little bit different from our first sample. Popping that open real quick for comparison. While this started with that you know pure base64 encoding at the beginning. This has kind of skipped that step. We're already on to that compression base64 string type business. So I'm just going to grab all of this. And. Again like I said I prefer to do it CyberChef as a first step. Of course you can attempt to do it in PowerShell if you'd like. But it'll become clear why I like to do this in CyberChef pretty quickly. So we're just going to grab all that first. And. What we're going to do is we're going to do the typical formatting that we did for that base64 compression. So base64 and raw in. Spelling that correctly. Run plate. And we get you know you'll be looking down here and you'll be like oh god that doesn't make any sense. Oh no. But then you'll see this little sentence up here which is this program cannot be run in DOS mode. And so if you're in the know. This is an executable. This is a portable executable. A Windows executable. And if you're ever unsure as to what you may be looking at. You know maybe you'll do something correctly or you think you do it correctly. You're like wow this isn't the output I expected at all. You know this should be something else. What you can do is grab that detect file type operation. Pop it at the bottom. And it'll tell you what you're looking at right now. So this is a Windows portable executable. And so we're going to take this dude out real quick. And what we're looking at is pretty much a semi equivalent of if you were to run strings. Strings is a useful tool to look at all the strings within executable. But if you were to run it in the terminal here. You'd get approximately a similar output here. Obviously a little bit different. Maybe a little bit more formatted better. But we can see all of the function calls here. In this kind of text block that the program is making. You know RSA crypto service provider. You know validate search. Decrypt. Things like that. As well as this is really badly formatted. But this. Again malwarelove.xyz. At port 443. URL here. And what appears to be a little bit of HTML. That's kind of neat. So things like that you can see right there. And if you wanted. Probably should. Download this for further analysis. So what you're able to do is you can save this output to file. And what you are doing is that you're downloading the binary itself. So I'm just going to call this. Coolcat2.exe. Save it. Do not run it. And now we have the executable that was hiding in this PowerShell. And if we want to take the next steps. And looking at understanding what it's doing. Then we can do so here. Safely. All right. We're going to cut it right there. Just because this is purely for PowerShell analysis. But I'll be taking a look at this executable in my other workshop. So definitely look out for that. But in the meantime. That pretty much summarizes demo two. All right. So to finish this off. That wasn't too bad actually. And it may have seen that like I was going through it. And I'm like some kind of wizard that knows what I'm doing. But in truth. A lot of it is Googling. And understanding what's. Trying to understand what's going on. And so a lot of that information. You can learn simply by just copy pasting into Google. Something that looks weird. And most of the time. You'll be able to find out. You know. What the next step is. And you'll have an explanation as to why that is. So if you recall. That. You know. Shell ID thing. Or that. Reverse preference thing. Where. There were two techniques to try and get IEX. Into the script. Without. You know. Explicitly saying this is IEX. Those are things I found out from Google. As to. Why that did that. And why people would use that. Those little hidden. Ways and techniques that. Malware authors. Will do. And so. Trying to find. Those weird things. And trying to find. You know. What the next step is. If you're. Stuck. Really. Really helps. In your. You know. Overall. Understanding of it. Because. In malware analysis. You're kind of. In this state. Of always learning. You know. You're learning. New techniques. May not have. You know. Experienced. This. Specific. Method. Of utilizing. You know. XYZ. Thing. And that'll come across. Every single form. Malware can come in. And malware can come. In this state. Not being afraid. To ask for help. Is a really. Good skill set. To have. When you're starting. To breach. Malware analysis. And so. Some big takeaways. Is that. I want. You to have. That sort of. Analysis mindset. Of understanding. That being good. At reversing. Is being good. At always learning. There's always. New malware. Out there. It's always evolving. And so. You're constantly. Having to learn. What the newest. Techniques are. What might be used. What's. You know. Kind of in the past. Maybe coming back again. Things like that. And of course. Staying safe. Keeping yourself safe. Trying not to tip off. Threat actors. And of course. Keeping everyone else. Safe. By not. Accidentally. You know. Releasing malware. Into. The world. Unintentionally. And of course. Information sharing. Is vital. So. You know. Things like. In our first demo. We talked about. People who may have that information. For you. Or may have it. Maybe able to find it for you. Is really vital. In addressing. An incident. Likewise. With malware analysis. In general. It's a really steep step up. To start becoming proficient. And a lot of the information. That helped me. Become more proficient. Or more knowledgeable. In a certain type. Of. You know. Analysis. Or. You know. Tackling a certain problem. Was people who wrote up. What they did. For each thing. And so. As you become more proficient. I would totally recommend. Giving back to the community. When you're able to. And showing. You know. How you analyze it. You know. The tricks that you use. To tackle. You know. Certain problems. Or certain steps. Within. Analysis. That you're facing. And additionally. Google is your best friend. It's not cheating. Google everything. You know. PowerShell. Google each function. Google. What's going on here. You know. Again. If you see something weird. Google that. Find out. Everything you can. About it. Because. That information. Is all free. It's open to you. And it's kind of a waste. If you're not utilizing it. So. Of course. Take advantage. Of all the information. That you have available. To you. It only serves. To help you. And lastly. I'd love to give thanks. To our. Red team. And our forensics team. Over at Blue Team Village. The red team. Is responsible. For creating these kill chains. And the forensics team. Were the folks. Who gave us. Their talks. They're all really amazing. I'd like to. Also. Thank Lask. They. Brought up. A emotet. A powershell payload. Some. Skills. And tactics. That they used. That I used. For this presentation. As well as. Some of their explanations. That I also used. Because that was. A little bit more clear. Than what I had. Initially. And also. Thanks to. Harmjoy. Josen Bialik. And Rich Lundin. For their powersploit scripts. That were used. In Kill Chain 3. 1. 6. These were the guys. That were with me. Last year. On DEFCON 29. For our. Excellent. Macros. And Excel. Workshop. And so. These guys really helped me. In. You know. Getting my. Step up. And generating. Community content. Like this. And you know. Now. Here I am. One year later. Creating my own. Workshop. So. I'd really like. To thank those two. That are amazing. For watching. If you want. To reach out to me. I'm on Twitter. As Ari Scrabble. I'm not super active on Twitter. But you're more than welcome. To DM me. And I'm also on Discord. As Scrabble9731. So. Definitely. Reach out. If you have any questions. And. Have a lovely day.