1 00:00:00,000 --> 00:00:05,360 So, now it is 1 o'clock, and with all that setup time, we're good? 2 00:00:05,440 --> 00:00:06,920 Yeah, we're good. 3 00:00:07,100 --> 00:00:08,480 Right, we're good. 4 00:00:08,480 --> 00:00:11,060 So, it's my pleasure. 5 00:00:12,380 --> 00:00:17,620 Jay, you presented... oh, wow, actually in this area, it seemed like yesterday, 2016. 6 00:00:17,960 --> 00:00:21,340 So, without much ado, it's my pleasure to introduce to you, J.D. 7 00:00:21,340 --> 00:00:22,720 Martino Fidelis. 8 00:00:28,680 --> 00:00:29,600 Thank you, guys. 9 00:00:29,600 --> 00:00:30,400 Thank you. 10 00:00:31,560 --> 00:00:42,340 So, we've all kind of been there, most of us who kind of work like either SOC work or malware analysis, or, you know, where you end up writing rules, right? 11 00:00:43,800 --> 00:00:51,400 I'm just going to kind of give you a methodology, or at least my methodology, of how I write rules and how I go about things. 12 00:00:52,060 --> 00:00:53,740 You don't have to adopt it. 13 00:00:53,740 --> 00:00:55,100 I don't care if you do. 14 00:00:57,160 --> 00:01:05,120 But hopefully, it gets better out there, and we can all rise up and start crafting good detections and whatnot. 15 00:01:05,360 --> 00:01:06,620 So, my name is J.D. 16 00:01:06,620 --> 00:01:12,600 Martino, Head of Detections and Countermeasures for the Fidelis Threat Research. 17 00:01:13,180 --> 00:01:15,760 That's just some fancy title my boss gave me. 18 00:01:15,760 --> 00:01:18,100 Really, I'm just like the rule bitch, right? 19 00:01:18,100 --> 00:01:21,920 So, that's pretty much how it goes. 20 00:01:22,980 --> 00:01:25,920 There are some prerequisites to this talk. 21 00:01:26,980 --> 00:01:31,400 I do a lot with regular expressions and with Yara. 22 00:01:31,400 --> 00:01:35,040 So, all my examples are going to kind of center around those two. 23 00:01:35,560 --> 00:01:48,260 If you are unfamiliar with Yara, the talk that Ming just mentioned that I did back in 2016 was to catch an APT, Yara, and I go through more of the syntax and whatnot. 24 00:01:48,260 --> 00:01:52,260 So, if you want to learn that, I definitely suggest going back and watching that. 25 00:01:53,640 --> 00:01:55,920 Regular expressions, I don't know. 26 00:01:55,920 --> 00:01:58,400 I have good days and bad days, either way. 27 00:01:58,400 --> 00:02:02,700 If you're not doing them every day, yeah, either way. 28 00:02:03,280 --> 00:02:16,080 So, when you're writing detections, the real problem is that you and your coworkers, you know, you're kind of building this structure, and it's very complicated, right? 29 00:02:16,080 --> 00:02:23,340 And sometimes, you know, like the guy in the picture, he may be looking down at what his coworker is doing. 30 00:02:23,340 --> 00:02:24,440 He's like, what are you doing? 31 00:02:24,440 --> 00:02:25,680 I'm up here. 32 00:02:25,680 --> 00:02:30,040 Or, hey, let's build this, and it's all disjointed and whatnot. 33 00:02:30,140 --> 00:02:31,940 And there's a lot of complications. 34 00:02:31,940 --> 00:02:34,020 It's never really easy, right? 35 00:02:34,040 --> 00:02:39,420 Because malware will be at all different layers upon the stack. 36 00:02:39,420 --> 00:02:41,980 And the attack surface is at all different layers. 37 00:02:41,980 --> 00:02:52,620 There's not one easy different thing over one protocol or, you know, whether it be the file or the network layer, or even metadata and whatnot. 38 00:02:53,500 --> 00:03:05,480 So, what happens when you two have been working alongside of each other, and all of a sudden, your colleague leaves the company, right? 39 00:03:05,560 --> 00:03:09,400 And everybody, you know, it's like, it's a normal thing. 40 00:03:09,400 --> 00:03:12,400 And it's like, hey, cheers, we're going to throw a party for you. 41 00:03:12,400 --> 00:03:15,340 And he's like, yeah, man, sorry for everything. 42 00:03:15,540 --> 00:03:17,120 We're going to be friends. 43 00:03:17,220 --> 00:03:26,000 And then, like, Monday comes around, and then you look at one of his detections, and you're like, holy... right? 44 00:03:27,040 --> 00:03:30,740 It's like, I kind of equate it to Monopoly, right? 45 00:03:30,740 --> 00:03:31,640 And you get the chance. 46 00:03:31,640 --> 00:03:36,220 Everybody wants to go and collect $200, right? 47 00:03:36,220 --> 00:03:37,700 Everybody wants that. 48 00:03:37,700 --> 00:03:41,120 But it's like, in this case, no, you've got to pay the other players. 49 00:03:41,300 --> 00:03:42,320 You're taking your lumps. 50 00:03:42,320 --> 00:03:43,780 Like I said, I'm the rule bitch, right? 51 00:03:43,780 --> 00:03:45,320 So, I learned this the hard way. 52 00:03:47,260 --> 00:03:52,360 So, that being said, how do we rise up to the occasion, right? 53 00:03:54,900 --> 00:03:56,520 So, I'm going to throw another one. 54 00:03:56,520 --> 00:03:58,040 I probably should have said this earlier. 55 00:03:59,020 --> 00:04:05,540 The other prerequisite for this is a little bit of, you know, set theory and whatnot that most of us probably learned in computer science. 56 00:04:05,540 --> 00:04:08,100 So, yes, I'm going to give you some Venn diagrams. 57 00:04:08,160 --> 00:04:13,520 It was the only way, or the best way, I can kind of convey it to you and whatnot. 58 00:04:14,220 --> 00:04:17,220 And so, you know, you have your universal set. 59 00:04:17,220 --> 00:04:18,100 That's the set of everything. 60 00:04:18,100 --> 00:04:21,040 Everything that's going on, whether it be the network, the endpoint. 61 00:04:21,400 --> 00:04:23,760 And then you have your detection, your target, right? 62 00:04:23,760 --> 00:04:25,360 What are you trying to signature? 63 00:04:25,740 --> 00:04:27,140 I call it a target. 64 00:04:28,160 --> 00:04:34,220 And so, it's, you know, you're trying to pick that needle out of the haystack. 65 00:04:35,280 --> 00:04:42,860 So, when you finally go for it and you write your detection, you end up getting these other set of events. 66 00:04:42,860 --> 00:04:45,300 I really don't have a better name for them. 67 00:04:45,300 --> 00:04:47,420 They're just another set of events. 68 00:04:47,540 --> 00:04:50,880 We all know them as mostly false positives, though, right? 69 00:04:50,940 --> 00:04:53,880 But they're not exactly all the others. 70 00:04:53,880 --> 00:04:58,480 They're just some random others that some of which happen to overlap with our target. 71 00:04:58,480 --> 00:05:00,900 And those are the ones that are the false positives. 72 00:05:02,800 --> 00:05:06,260 And so, you know, you have your red set. 73 00:05:06,260 --> 00:05:08,560 Your red set on the left-hand side is the target. 74 00:05:08,740 --> 00:05:09,600 That's your detection. 75 00:05:09,600 --> 00:05:10,980 The blue set is your other. 76 00:05:15,430 --> 00:05:20,130 It may not always be large, you know, your other, your false positives. 77 00:05:20,130 --> 00:05:21,550 They could be a lot smaller. 78 00:05:22,350 --> 00:05:24,390 And then the purple area is in the middle. 79 00:05:24,390 --> 00:05:25,930 That's what you're trying to eliminate, right? 80 00:05:25,930 --> 00:05:27,890 You're trying to eliminate that purple area. 81 00:05:29,250 --> 00:05:30,790 So how do you do that? 82 00:05:30,790 --> 00:05:32,090 How do you do that? 83 00:05:32,330 --> 00:05:34,270 I call it shrinkage. 84 00:05:37,010 --> 00:05:40,450 So we want to shrink that other event set. 85 00:05:41,270 --> 00:05:47,670 If we could shrink that other event set, we can get the union of the two sets to be smaller, right? 86 00:05:48,610 --> 00:05:56,170 The typical way that people mostly do this is kind of with some sort of and not. 87 00:05:56,170 --> 00:05:58,110 You know, hey, I got this detection. 88 00:05:58,110 --> 00:06:00,810 Oh, and not my domain controller. 89 00:06:00,810 --> 00:06:08,610 Oh, and not this file that passes, you know, from this person to this person every day via cron job or something like that. 90 00:06:08,610 --> 00:06:18,350 And so you have like these kind of one off detections where like, you know, this one set is a subset of your other. 91 00:06:18,430 --> 00:06:22,670 And then you have another and it's a subset of that other. 92 00:06:22,670 --> 00:06:27,530 And you have a third other, which is all still a subset of that other. 93 00:06:29,150 --> 00:06:37,310 And so you end up with these long kind of daisy chains of and not situations where you're just kind of filtering out. 94 00:06:37,770 --> 00:06:45,470 And, you know, those are those are somewhat maintainable, but those aren't really maintainable either. 95 00:06:45,470 --> 00:06:48,530 At least they can get out of hand and whatnot, if not done properly. 96 00:06:51,590 --> 00:06:53,430 So how do you do that? 97 00:06:53,430 --> 00:06:57,570 So how do you how do you shrink, you know, your false positives? 98 00:06:59,790 --> 00:07:02,570 There's like I said, there's the and not method. 99 00:07:02,570 --> 00:07:07,530 But once you do that enough, your other set gets really, really small. 100 00:07:08,210 --> 00:07:14,510 And it just like I said, it gets hard to maintain, but then your target set still stays large. 101 00:07:14,730 --> 00:07:26,670 So is there anything and there's not so much of an overlap, but it's enough that it creates in your workflow where it takes time out of your workflow to be going through some of these false positives. 102 00:07:26,850 --> 00:07:29,730 And you just don't want to be dealing with them anymore. 103 00:07:29,730 --> 00:07:33,370 So we've manipulated the other set, right? 104 00:07:33,370 --> 00:07:37,730 So what about maybe taking a look at the targeting set? 105 00:07:37,770 --> 00:07:48,290 You know, and then so back to shrinkage, we're going to try and shrink that targeted set, your detection. 106 00:07:48,290 --> 00:07:51,290 How do we shrink that profile, right? 107 00:07:51,290 --> 00:07:54,590 That that that attack profile of that detection and whatnot. 108 00:07:54,590 --> 00:07:57,090 And yes, you can do it. 109 00:08:00,520 --> 00:08:09,100 One of the situations that the target set grows over time is because of false negative situations. 110 00:08:09,400 --> 00:08:19,340 You get you find new activity all the time and your target set just you end up taking on more of these sets, your target one. 111 00:08:19,340 --> 00:08:23,140 And now you have another target to some mutual exclusive set that has nothing. 112 00:08:23,140 --> 00:08:26,360 It's involved, but then it's kind of not involved with the other set. 113 00:08:26,360 --> 00:08:28,800 And then you have to merge those two together. 114 00:08:29,720 --> 00:08:33,060 And then, like I said, that's a growing it's literally a growing problem. 115 00:08:33,060 --> 00:08:38,680 You have two sets converging together and it's getting bigger in your other set. 116 00:08:38,680 --> 00:08:44,700 May or may not be getting smaller, but it just doesn't become maintainable. 117 00:08:45,420 --> 00:08:52,160 And what I like to call that is kind of the one rule to rule them all mentality. 118 00:08:52,820 --> 00:09:00,020 Analysts like to write these catch all rules where, you know, the Lord of the Rings effect, I guess. 119 00:09:00,020 --> 00:09:10,080 And so, you know, we write these really large monolithic detections that just like I said, they become unmaintainable. 120 00:09:10,080 --> 00:09:10,780 Right. 121 00:09:11,600 --> 00:09:17,640 And so you got to kind of know when to separate or chain your detections. 122 00:09:17,640 --> 00:09:29,420 And then you also you kind of drop or ignore some of the true positives and maybe even pick them up with another tech detection with either with a lesser confidence detection or with a lesser severity detection. 123 00:09:30,720 --> 00:09:35,660 And so you you can kind of shrink that that target set a little bit. 124 00:09:35,800 --> 00:09:38,140 Just to kind of give you an example. 125 00:09:38,440 --> 00:09:38,980 Right. 126 00:09:38,980 --> 00:09:48,580 So at one point in my career, I inherited this network network Yara rule for ghost rat. 127 00:09:48,920 --> 00:09:56,620 And it was literally it was it was 100 different beacon strings that we were targeting in the one rule. 128 00:09:56,900 --> 00:10:05,300 And you look at the condition at the bottom and then all the number of conditions, all the number of beacon strings that we were we were looking at. 129 00:10:05,300 --> 00:10:18,440 Notice the first for loop goes from A to Z and then there's another the second for loop from A star and then a third for loop B star and a fourth for loop C star. 130 00:10:18,440 --> 00:10:22,580 So we've enumerated the alphabet going on the fourth time. 131 00:10:22,580 --> 00:10:29,260 That's how many times we've enumerated those those those detections and whatnot. 132 00:10:29,260 --> 00:10:33,940 And so what if what if one of them starts going crazy? 133 00:10:33,940 --> 00:10:36,080 How do you how do you adjust this? 134 00:10:36,080 --> 00:10:38,200 How do you adjust something that's so monolithic? 135 00:10:38,200 --> 00:10:45,660 You literally have 100 indicators of compromise in your in your target in your target set. 136 00:10:47,320 --> 00:10:53,100 And we all get we all get defensive about our rules as analysts. 137 00:10:53,340 --> 00:10:55,700 You know, it's our babies. 138 00:10:55,700 --> 00:10:57,620 We curate these and whatnot. 139 00:10:57,620 --> 00:11:01,960 And so there is a kind of a fact that it's like, oh, precious. 140 00:11:01,960 --> 00:11:02,760 Oh, yeah. 141 00:11:02,760 --> 00:11:06,780 And so, like, we don't want nothing to happen to them. 142 00:11:06,780 --> 00:11:11,260 But the life cycle shows that we have to we have to do something about it. 143 00:11:12,560 --> 00:11:16,000 So so let me give you some some clues enough. 144 00:11:16,000 --> 00:11:19,540 I mean, I'll talk a little bit, but I'll give you some more kind of examples. 145 00:11:20,000 --> 00:11:21,180 So how do you do that? 146 00:11:21,180 --> 00:11:22,780 You separate multiple detections. 147 00:11:22,780 --> 00:11:25,780 You take the one take target set the full set. 148 00:11:25,780 --> 00:11:30,900 You separate it from target one and then target two. 149 00:11:30,900 --> 00:11:34,520 And then they have a couple of other sets in between there as well. 150 00:11:35,240 --> 00:11:37,500 And now your sets just got smaller. 151 00:11:37,500 --> 00:11:38,160 Right. 152 00:11:38,160 --> 00:11:43,360 So this one is a lot larger. 153 00:11:43,360 --> 00:11:45,320 And then we've separated it out. 154 00:11:45,420 --> 00:11:48,460 And now we have two smaller sets to kind of deal with. 155 00:11:48,460 --> 00:11:53,520 One set may not be giving you problems, but another set may be giving you problems. 156 00:11:53,520 --> 00:11:56,880 But at least when you do it, you've done your work up front. 157 00:11:56,880 --> 00:12:03,100 You've done all your analysis up front that you don't necessarily have to manage the T1 set. 158 00:12:03,100 --> 00:12:08,420 Or if the T1 set is giving you problems, you don't have to manage the T2 set when you go in and make your changes. 159 00:12:09,000 --> 00:12:14,040 And then to even further slice it, you can make it into even more further slicing. 160 00:12:14,040 --> 00:12:16,400 And then the sets become even smaller. 161 00:12:16,700 --> 00:12:21,320 And then they have a lot less kind of management and whatnot with them. 162 00:12:21,760 --> 00:12:27,080 So just as a kind of warning, I am including some rules. 163 00:12:27,080 --> 00:12:29,740 So I'm going to throw a bunch of walls of text at you. 164 00:12:30,440 --> 00:12:38,720 If you do want to come back and watch the... there's a lot of good tidbits in some of these next few slides. 165 00:12:38,720 --> 00:12:40,300 I suggest coming back. 166 00:12:40,300 --> 00:12:42,000 You're not going to ingest all this stuff. 167 00:12:42,000 --> 00:12:44,620 And especially the syntax that I've got going on with some of these. 168 00:12:44,620 --> 00:12:46,120 You're going to be like, whoa, what's... 169 00:12:46,120 --> 00:12:50,520 So you're going to need to take a second to kind of parse through it and whatnot, though. 170 00:12:50,680 --> 00:12:57,040 But the main things that I want you to kind of focus for the next couple slides are the constructs and the naming and whatnot. 171 00:12:57,040 --> 00:12:59,400 And I'll kind of walk you through the rest and whatnot. 172 00:12:59,400 --> 00:13:07,420 So one thing you can do with Yara, at least, is you can separate by condition. 173 00:13:08,420 --> 00:13:20,320 That ghost rule that I said earlier, notice that... so there was... I at least noticed that there was different lengths of our detection set, our indicators of compromise. 174 00:13:20,360 --> 00:13:27,100 And so I kind of separated them and kind of grouped them by conditions in that case. 175 00:13:27,120 --> 00:13:34,900 So I can group with the condition and it makes it easier to promote maintenance on your rules. 176 00:13:34,900 --> 00:13:40,980 In these three examples, I have... I just have three, actually, but I had like up to 10. 177 00:13:41,140 --> 00:13:44,300 I had up to 10 for all 100 different indicators. 178 00:13:44,300 --> 00:13:47,260 So I had 10 different rules that I was in managing. 179 00:13:47,620 --> 00:13:57,320 But it was a lot easier because if one was false positing, I had a different confidence value when I need to make a change and whatnot about it. 180 00:13:57,320 --> 00:14:05,480 And so rather than... I can then just focus on this one rule and all the other nine rules, I didn't even have to worry about. 181 00:14:05,820 --> 00:14:10,820 So the ghost beacons, I split them up length four, just got like one little indicator. 182 00:14:10,920 --> 00:14:15,800 Length five had 85 different indicators and indicators of compromise. 183 00:14:15,800 --> 00:14:19,840 And then length six had... excuse me, had three of them. 184 00:14:23,900 --> 00:14:29,020 And so how would you... how would you kind of separate just for... because not everybody knows Yara. 185 00:14:29,020 --> 00:14:33,980 So an example, how would you kind of separate that in regular expressions? 186 00:14:34,200 --> 00:14:38,500 I'll let you chew on this regular expression for a second while I take a sip and whatnot. 187 00:14:43,870 --> 00:14:54,730 So this guy's kind of looking for like landing pages to do like man-in-the-middle attacks for PayPal, you know, Yahoo, Hotmail. 188 00:14:55,650 --> 00:15:00,290 They got PowerPoint online, Word online, so like Office 365 and whatnot. 189 00:15:01,310 --> 00:15:05,870 These are all these kind of landing pages that they're trying to man-in-the-middle and get your credentials. 190 00:15:07,370 --> 00:15:13,150 And with the regular expressions, you're just grouping the IOCs with the or clause pretty much. 191 00:15:13,250 --> 00:15:22,910 And so that's how you would do the equivalent of this rule from Yara, similar in a regular expression. 192 00:15:23,190 --> 00:15:27,890 It's a totally different detection, but it's the same idea, same concept and whatnot. 193 00:15:30,940 --> 00:15:47,040 So another thing is that you can separate your indicators by, so I talked about the condition statement in Yara, but you can also separate them towards the indicators of compromise as well, grouping the indicators of compromise. 194 00:15:47,140 --> 00:15:53,520 So what I like to do, so these are four different rules for strings out of an APT3 binary. 195 00:15:53,520 --> 00:16:03,280 Notice the hash is all the same for all four rules, but I have four different rules for strings. 196 00:16:03,800 --> 00:16:07,560 What's the thing that I said earlier, the one rule to rule them all? 197 00:16:07,560 --> 00:16:09,080 That's what most analysts do. 198 00:16:09,100 --> 00:16:23,500 They all want to just jumble them up into one Yara rule and say, hey, give me this and do, you know, gives you some kind of complex expression at the end of the condition and say, hey, this grouping or this grouping or this other grouping or this other grouping. 199 00:16:23,620 --> 00:16:37,940 Well, you can, if you break them out into different rules and then you be very selective with your rule names, excuse me, you can bring a lot of value to your analysis. 200 00:16:37,940 --> 00:16:48,180 When you start separating your detections like this, you start augmenting your analysis and you can say, hey, this, I got this one binary here. 201 00:16:48,180 --> 00:16:53,680 It hit on one of these four string rules for APT3. 202 00:16:53,980 --> 00:17:01,620 Maybe that's not an APT3 binary, but I got this other binary that hit on three of the four. 203 00:17:01,740 --> 00:17:08,160 And so when it hits on three of the four, you're like, OK, it's more than likely APT. 204 00:17:08,160 --> 00:17:11,780 And then, oh, wait, so we didn't have the fifth, the fourth rule. 205 00:17:11,780 --> 00:17:14,460 So maybe there's a shift in your detections. 206 00:17:14,460 --> 00:17:21,940 Maybe you're detecting, you're, you're detecting the shift in, in targeting and whatnot. 207 00:17:21,940 --> 00:17:24,140 And so their binaries are kind of changing. 208 00:17:24,140 --> 00:17:26,400 You know, they may have a different campaign going on. 209 00:17:26,400 --> 00:17:33,380 And so a different person on the team is compiling these or something and or they fix their incorrect spellings and whatnot. 210 00:17:33,540 --> 00:17:41,200 And so, like, if you look at some of these groupings, just I have some regular strings, just unique, very unique strings. 211 00:17:41,200 --> 00:17:44,080 Then I have network GUID strings. 212 00:17:44,640 --> 00:17:54,020 And so and then notice that with the with the first rule there of strings that I say any of them. 213 00:17:54,020 --> 00:17:54,320 Right. 214 00:17:54,320 --> 00:17:57,580 So that's basically the or clause with any of them. 215 00:17:57,580 --> 00:18:03,340 And any one of those strings would are unique enough that they could stand on their own. 216 00:18:03,340 --> 00:18:09,320 You don't need any other supporting strings to kind of make your detection and whatnot. 217 00:18:09,320 --> 00:18:10,740 Now, there's a couple where there's two rules. 218 00:18:10,740 --> 00:18:12,100 There's two rules with any of them. 219 00:18:12,100 --> 00:18:13,980 And there's two rules with all of them. 220 00:18:13,980 --> 00:18:20,440 And so the rules with all of them, where it says all of them in the condition, those are your lesser quality indicators. 221 00:18:20,440 --> 00:18:29,960 You can still group them, but you need the strength of all four indicators of compromise to say to give you that confidence layer layer on your head and whatnot. 222 00:18:30,140 --> 00:18:34,360 And so if you look and then there's a there's output strings, bad grammar. 223 00:18:34,360 --> 00:18:36,340 So I'm even calling out bad grammar. 224 00:18:36,340 --> 00:18:44,200 You know, when people make mistakes in spellings now, granted, there's a lot of code reuse and whatnot. 225 00:18:44,420 --> 00:18:53,640 So when you have all these mistakes like this, especially grammar mistakes, you can generally kind of attributed to one one person or. 226 00:18:53,640 --> 00:19:00,520 But if you start seeing more and more than and there's a lot of different compilations floating around, there's probably some code reuse going on as well. 227 00:19:00,520 --> 00:19:02,760 And that's how you would detect that stuff. 228 00:19:03,720 --> 00:19:06,300 And then you have more output strings. 229 00:19:06,300 --> 00:19:10,060 So the output of this tool was our APT remote command tool. 230 00:19:10,860 --> 00:19:12,920 I can't remember if I wrote these rules. 231 00:19:12,920 --> 00:19:13,960 I probably did. 232 00:19:13,980 --> 00:19:14,500 I don't know. 233 00:19:14,500 --> 00:19:15,340 I didn't put my name. 234 00:19:15,340 --> 00:19:18,100 I guess I should have put my name on it, whether I was the author or not, though. 235 00:19:18,220 --> 00:19:20,380 But it's a good grouping. 236 00:19:20,380 --> 00:19:27,860 It's a good representation of what I'm trying to convey to you guys on splitting up your detections to make them more manageable and whatnot. 237 00:19:30,720 --> 00:19:32,580 So let's see, one more. 238 00:19:33,300 --> 00:19:37,020 Yeah, one more wall of text and then we'll get back to some other stuff. 239 00:19:38,760 --> 00:19:41,520 So we talked about groupings by conditions. 240 00:19:41,640 --> 00:19:50,660 We talked about groupings by indicators of compromise, your string sections, or in with regex, you know, you're using your or statement. 241 00:19:53,320 --> 00:20:01,100 The next one, you still want to try and create multiple detections, but you want to use multiple detection methods. 242 00:20:01,160 --> 00:20:06,380 So I have three rules up here that are all looking for the same technique. 243 00:20:06,380 --> 00:20:10,380 They're looking for a very simple embedded executable. 244 00:20:10,540 --> 00:20:11,720 That's it. 245 00:20:12,580 --> 00:20:20,980 Well, maybe the detections are a little fancy, but nothing fancy about the technique that I'm trying to detect. 246 00:20:21,060 --> 00:20:29,820 And like I said, this is what I said earlier about how when you build enough of these rules, the more rules you have, the more you can augment your analysis. 247 00:20:29,820 --> 00:20:43,600 And so you can save this time up front on by just by running Yara or your regular expressions and let those automated scans do your triage for you. 248 00:20:43,600 --> 00:21:01,340 And so when you can have a large enough rule set to scanning and do triage, and then you can have, without even throwing the binary in a hex editor or IDAPRO or even a text editor or something like that, you can run it against your rule set. 249 00:21:01,820 --> 00:21:06,540 And you can get somewhat of a disposition, whether it be benign. 250 00:21:06,940 --> 00:21:08,500 You still may need to verify it. 251 00:21:08,500 --> 00:21:11,800 If it's benign, you can get some sort of suspect disposition. 252 00:21:11,800 --> 00:21:16,040 It's doing all these techniques, but then there's nothing attributable that's going on. 253 00:21:16,040 --> 00:21:21,540 Or you can get a malicious disposition right off the bat if you have an attributable signature. 254 00:21:21,720 --> 00:21:24,720 And so you can say, hey, this is definitely malicious. 255 00:21:24,720 --> 00:21:26,460 I can attribute it to this group. 256 00:21:27,060 --> 00:21:31,160 How much more do I need to spend on this so I can move on to the next binary? 257 00:21:32,580 --> 00:21:38,040 So, like I said, these are three different rules targeting embedded executables. 258 00:21:38,040 --> 00:21:41,220 One of them looks for more than one DOS stub. 259 00:21:41,220 --> 00:21:51,100 So the DOS, the 16-bit DOS stub that's present in the 32-bit Windows PE header, or just before it, I'm sorry, the MZ header, the 16-bit. 260 00:21:51,800 --> 00:21:54,180 So it looks for multiple DOS stubs. 261 00:21:54,180 --> 00:21:59,420 The other one, it looks for a possible PE structure in which the DOS stub may have been stripped. 262 00:21:59,420 --> 00:22:03,060 And then there's another one that looks for a DOS stub. 263 00:22:03,340 --> 00:22:08,780 It just looks for an additional DOS stub past the initial DOS header. 264 00:22:08,860 --> 00:22:17,160 And so, well, what happens if the outer binary doesn't have a DOS stub and then the embedded binary does? 265 00:22:17,160 --> 00:22:23,400 And so these are three different techniques to kind of catch embedded executables using these rules. 266 00:22:26,240 --> 00:22:31,620 So next I want to talk to you about some detection targeting approaches and whatnot. 267 00:22:31,760 --> 00:22:33,480 But first, let me take a step. 268 00:22:37,980 --> 00:22:39,840 So we're all on the hunt, right? 269 00:22:40,220 --> 00:22:41,560 We're all on the hunt. 270 00:22:43,500 --> 00:22:46,280 What was the Black Hat talk? 271 00:22:47,400 --> 00:22:48,700 2015, big game hunting. 272 00:22:48,700 --> 00:22:52,140 We're all on the hunt for big game, big game malware and whatnot. 273 00:22:53,200 --> 00:22:56,240 The original big game was JAWS, right? 274 00:22:58,980 --> 00:23:04,400 So as, you know, as I go through all my data, I realize some things. 275 00:23:06,920 --> 00:23:11,640 And that I'm hunting, but as a malware analyst, right? 276 00:23:11,800 --> 00:23:14,120 So I'm always on the hunt for that big game. 277 00:23:14,120 --> 00:23:21,480 So I can make an argument of this is bad, you know, and it could be just some random file. 278 00:23:21,480 --> 00:23:25,280 This is bad any day of the week, blah, blah, blah, because of the context you give it to me in. 279 00:23:27,600 --> 00:23:30,400 And I can do that a couple different ways. 280 00:23:30,400 --> 00:23:35,940 I can do that with kind of unique code DNA. 281 00:23:36,220 --> 00:23:43,100 You can either do it with the strings, with the very unique strings, or you can do it with unique byte sequences, right? 282 00:23:43,100 --> 00:23:48,520 So that unique DNA allows you to track the families and go hunt. 283 00:23:50,020 --> 00:24:03,300 But I noticed when hunting that the data that I was looking, or the rules that I was producing, based on the data that I was looking at, I had a bias. 284 00:24:03,500 --> 00:24:07,920 Like I said, I can make an argument for anything to be malicious, right? 285 00:24:08,020 --> 00:24:12,580 And given a limited scope of the view. 286 00:24:12,580 --> 00:24:19,120 And so my, I didn't realize, but my detections also were becoming biased. 287 00:24:21,180 --> 00:24:26,460 And so, you know, we're hunting for that shark, we're hunting for jaws, right? 288 00:24:26,460 --> 00:24:28,680 And we see the fin come out the water. 289 00:24:28,680 --> 00:24:37,420 But then we look under the water, we look and we see the whole scope, and it's just some guy wearing a shark fin, right? 290 00:24:39,240 --> 00:24:40,780 And you're confused. 291 00:24:40,780 --> 00:24:43,180 You're like, wait, I thought this guy was bad. 292 00:24:43,360 --> 00:24:45,200 You know, why is he not bad? 293 00:24:45,200 --> 00:24:48,900 But it's just some guy with a shark fin strapped to his back, right? 294 00:24:48,900 --> 00:24:51,200 Now, once you've seen the whole picture. 295 00:24:51,560 --> 00:24:59,200 And I got that way actually, or at least I noticed that because just enough customers are like, no, this is good. 296 00:24:59,200 --> 00:25:00,460 I'm like, no, this is bad. 297 00:25:00,460 --> 00:25:01,820 And they're like, no, this is good. 298 00:25:01,860 --> 00:25:05,700 And so I would argue with people and whatnot. 299 00:25:05,700 --> 00:25:08,780 And so I noticed the bias in the detections. 300 00:25:08,820 --> 00:25:12,040 And so I noticed that a lot of my detections were as a malware analyst. 301 00:25:12,040 --> 00:25:17,500 And so I got to thinking, well, what would a network admin's detection be like? 302 00:25:17,680 --> 00:25:23,040 You know, how would they write a detection and whatnot? 303 00:25:23,040 --> 00:25:32,040 With malware authors, we're looking in a sea of bad or a sea of... let's see, what's... 304 00:25:32,040 --> 00:25:36,620 Yeah, we're looking from a sea of bad that ignore the good. 305 00:25:36,940 --> 00:25:40,800 And then the network admins are writing their detections. 306 00:25:40,800 --> 00:25:47,680 They're writing detections from a sea of good to detect or highlight the anomalous bad. 307 00:25:47,680 --> 00:25:55,160 So they're almost seeing this kind of inverse view of what we're looking at as a malware author. 308 00:25:59,830 --> 00:26:04,530 So how do you write a malware analyst detection in Regex? 309 00:26:04,530 --> 00:26:12,710 I showed you the one prior with the kind of the DNA, the unique sequences. 310 00:26:12,710 --> 00:26:14,830 But how do you write that in Regex? 311 00:26:15,350 --> 00:26:18,290 So I had a customer that was like, hey, I want to see these. 312 00:26:18,290 --> 00:26:24,310 They had these custom mail headers and they were getting mail from all over the world. 313 00:26:24,630 --> 00:26:27,710 And they were like, look, I know I know this is bad. 314 00:26:27,710 --> 00:26:30,410 It's coming from this country or it's coming from that country. 315 00:26:30,410 --> 00:26:32,310 And how do I detect this stuff? 316 00:26:32,310 --> 00:26:37,350 So I started writing these regular expressions and then it quickly got out of hand for him. 317 00:26:37,350 --> 00:26:41,050 He's like, look now, you know, he's like, you showed me how to do this. 318 00:26:41,050 --> 00:26:48,370 But now, look, we've got 1, 2, 3, 4, 5, 6, 7 different countries and I'm getting new ones popping up every other day or so. 319 00:26:48,510 --> 00:26:53,550 And so we can't really take that approach in our detections. 320 00:26:53,550 --> 00:26:53,790 Right. 321 00:26:53,790 --> 00:26:57,290 Or at least the network admins can't take that approach in our detections. 322 00:26:57,290 --> 00:26:58,690 So I had to kind of think of it. 323 00:26:58,690 --> 00:27:00,570 I had to flip and I had to go inverse. 324 00:27:00,570 --> 00:27:01,970 How would I do this? 325 00:27:01,970 --> 00:27:07,550 And he's like, you know, really, we only do business with these three companies. 326 00:27:07,550 --> 00:27:08,870 I mean, three countries. 327 00:27:08,890 --> 00:27:15,990 And he's like, if you can write me a signature that, you know, if it's not these three countries. 328 00:27:15,990 --> 00:27:20,250 And I know like the DoD, they got Five Eyes and stuff like that. 329 00:27:20,250 --> 00:27:31,030 Like there's smaller companies that, you know, they're only doing they know they don't have an office in Madagascar or something like that or Nigeria. 330 00:27:31,050 --> 00:27:37,110 And I mean, they may have a Nigerian maybe related to a Nigerian prince, but they don't have an office office in Nigeria. 331 00:27:37,110 --> 00:27:37,830 Right. 332 00:27:38,430 --> 00:27:44,530 And so and then they had these other kind of headers that were coming in through through one of their things upstream. 333 00:27:45,190 --> 00:27:47,610 And they were marking all this mail stuff for us. 334 00:27:47,610 --> 00:27:49,090 I'm like, man, this is a gold mine here. 335 00:27:49,090 --> 00:27:49,390 Right. 336 00:27:49,390 --> 00:27:58,970 And he's like, look, I want to find all these different these different detections based on these or the non presence of these strings and whatnot. 337 00:27:58,970 --> 00:28:05,150 So I I kind of took the I went to the red the regular expression route. 338 00:28:06,550 --> 00:28:16,330 And and when I inversed it, I I came up with negative look aheads. 339 00:28:16,350 --> 00:28:16,970 Right. 340 00:28:17,130 --> 00:28:20,610 And so they're a little complex. 341 00:28:20,610 --> 00:28:25,310 Like I said, if you want to read into them, go back to the talk afterwards and kind of see it. 342 00:28:25,310 --> 00:28:31,130 It's all about creating a set and then you have a match to non match on and then another matching set. 343 00:28:31,130 --> 00:28:38,130 It gets a little hairy, but I definitely suggest going on like regex 101 to help you build your regular expressions and whatnot, though. 344 00:28:38,370 --> 00:28:44,270 And I came up with three these three detections for these three different X headers for the situations that he wanted me to do. 345 00:28:44,330 --> 00:28:45,770 And it worked out great. 346 00:28:45,770 --> 00:28:47,450 He's like, man, this is awesome. 347 00:28:47,450 --> 00:28:48,350 I don't have to do it. 348 00:28:48,350 --> 00:28:51,970 I don't have to do any maintenance anymore for these these detections. 349 00:28:52,110 --> 00:28:56,370 And and it did everything that he wanted to accomplish. 350 00:28:58,630 --> 00:29:03,090 So, you know, and that was kind of looking at that that inverse view. 351 00:29:03,090 --> 00:29:03,650 Right. 352 00:29:05,010 --> 00:29:10,150 So we talked about kind of the malware analyst detections. 353 00:29:10,150 --> 00:29:20,110 We talked about the bias that it kind of creates and how a network admin has a different view to it and whatnot. 354 00:29:20,910 --> 00:29:23,910 But how do you get longevity out of your stuff? 355 00:29:24,830 --> 00:29:33,030 And I have a technique that I call, I don't know how else to describe them, just circular detections. 356 00:29:33,030 --> 00:29:35,930 I'll write a couple of rules based on a few things. 357 00:29:35,930 --> 00:29:40,310 And and those two those two target rule sets are mutually exclusive. 358 00:29:40,310 --> 00:29:40,670 Right. 359 00:29:40,670 --> 00:29:41,470 They have nothing. 360 00:29:41,470 --> 00:29:46,930 They share the sample, but they don't share any same indicators of compromise. 361 00:29:46,990 --> 00:29:47,470 Right. 362 00:29:47,470 --> 00:29:52,810 And so so I'll create these these circular detections. 363 00:29:52,810 --> 00:29:57,670 I'll have rule one and it's and it detects a piece of malware. 364 00:29:57,990 --> 00:30:02,830 But then I have another rule that I built off of my original source. 365 00:30:03,450 --> 00:30:06,410 But rule one detected this malware. 366 00:30:06,570 --> 00:30:09,490 But rule two didn't trigger. 367 00:30:10,230 --> 00:30:11,210 Analyze it. 368 00:30:11,210 --> 00:30:12,810 We know it's malware. 369 00:30:13,110 --> 00:30:17,750 But when I analyze it, I get an update to rule two. 370 00:30:19,750 --> 00:30:21,930 So I got that rule. 371 00:30:21,930 --> 00:30:29,370 I got a new indicator of compromise for rule two that I didn't already have from my first original sample. 372 00:30:29,370 --> 00:30:29,710 Right. 373 00:30:29,710 --> 00:30:35,430 And most people who do a lot of virus total or reversing labs hunting do a lot of retro hunts. 374 00:30:35,490 --> 00:30:41,470 You guys are used to this stuff kind of panning out and finding the broader campaign. 375 00:30:42,490 --> 00:30:53,070 This is a kind of common thing, but I want everybody else who's not a malware analyst or not a malware hunter to kind of, you know, learn this stuff. 376 00:30:53,070 --> 00:30:54,850 So that's why I'm telling you about it. 377 00:30:55,070 --> 00:30:57,950 And so how do you do these circular detections? 378 00:30:57,950 --> 00:30:58,550 Right. 379 00:31:01,570 --> 00:31:07,350 So my first round, this is actually a throwback to my old talk. 380 00:31:07,350 --> 00:31:09,170 The payload names. 381 00:31:09,170 --> 00:31:14,530 I found these weird little payload names and these small DLLs that were getting loaded up. 382 00:31:15,150 --> 00:31:17,850 And they kind of had some of these unique names. 383 00:31:17,890 --> 00:31:24,430 Now, it's set up that MSI may not be unique, but it's kind of unique in the context of it's a DLL and it's only 11k, right? 384 00:31:25,510 --> 00:31:29,770 And then I came up with a string deobfuscation routine. 385 00:31:29,770 --> 00:31:51,290 And that routine, so I had the payload name that was embedded into the loader and I had a string deobfuscation routine that was also embedded in the loader, but it deobfuscated the payload, not the strings for the file. 386 00:31:51,290 --> 00:32:00,810 And so I run it, I do a retro hunt, find a bunch of other files, and then I go on to round two. 387 00:32:00,810 --> 00:32:10,170 And I found some new payload names, so my set of indicators of compromise just got larger, right? 388 00:32:10,170 --> 00:32:15,390 And they all stand apart from each other, so they can all be a detection on their own. 389 00:32:16,330 --> 00:32:21,270 But I went from having two payload names to I now have eight payload names. 390 00:32:22,690 --> 00:32:31,970 And then, instead of having just one byte sequence for the payload deobfuscation, I now have three. 391 00:32:31,970 --> 00:32:36,290 I only got two rules up there, plus the previous one. 392 00:32:36,290 --> 00:32:37,910 And so I ended up getting three. 393 00:32:37,910 --> 00:32:46,830 And I keep doing these iterations and I keep finding more rules, I mean, more Intel and I keep finding more malware. 394 00:32:46,830 --> 00:32:57,330 And in the end, I end up with like 27 payload names, some of which may not have even been PlugX for the payload. 395 00:32:57,330 --> 00:33:04,710 So they were using a similar delivery method, or at least I suspect they were using a similar delivery method for a couple different pieces of malware. 396 00:33:04,710 --> 00:33:14,990 And then, for as far as the strings, and then the byte sequences, I came up with 11 different byte sequence rules. 397 00:33:16,490 --> 00:33:31,790 And so I would have a subset at any one time, if a file was scanned, I'd have a subset of maybe 5 out of 10 of these byte sequence rules would trigger on one of those things. 398 00:33:31,790 --> 00:33:36,670 But if it got like 2 out of 10, then maybe I'd take a look at it. 399 00:33:36,770 --> 00:33:45,410 But if I got a high number of matches, detections, then I would just kind of roll with it, right? 400 00:33:45,790 --> 00:33:47,950 And kind of update it as I go along. 401 00:33:49,610 --> 00:33:53,630 So, I'm all about stories. 402 00:33:55,130 --> 00:33:59,830 My next one is a story, because we're all in the trenches, right? 403 00:34:00,470 --> 00:34:04,830 And so I had a buddy of mine, Fish is his name. 404 00:34:05,050 --> 00:34:10,150 And he calls me up one day and he's like, dude, we got hacked by the Russians. 405 00:34:10,210 --> 00:34:11,210 I'm like, what? 406 00:34:12,430 --> 00:34:13,150 Yeah. 407 00:34:14,030 --> 00:34:17,010 And so I'm like, he's like, we got hacked by the Russians. 408 00:34:17,010 --> 00:34:18,050 I'm like, no we didn't, dude. 409 00:34:18,050 --> 00:34:20,650 I'm like, alright, we'll take a look at it, right? 410 00:34:20,990 --> 00:34:23,190 And it's this, this, and this. 411 00:34:23,190 --> 00:34:24,850 And he's all excited. 412 00:34:24,970 --> 00:34:26,950 And it was the day before Thanksgiving, right? 413 00:34:26,950 --> 00:34:28,250 And I'm on vacation. 414 00:34:29,830 --> 00:34:31,510 It's Sunday at four o'clock, right? 415 00:34:31,510 --> 00:34:34,270 It always happens on the weekend, right? 416 00:34:34,270 --> 00:34:37,070 Or it always happens when you're on vacation, right? 417 00:34:37,990 --> 00:34:43,270 And so we called it Operation Turkey Eve, because it was the day before Thanksgiving. 418 00:34:43,490 --> 00:34:45,270 And he's calling me up. 419 00:34:45,270 --> 00:34:47,530 And we're getting on the phone, we're talking back and forth. 420 00:34:47,530 --> 00:34:55,150 And I'm like, walk me down the path that you arrived to, however it is, right? 421 00:34:55,350 --> 00:34:58,310 And so he walks me down this path. 422 00:34:58,310 --> 00:35:01,450 But I'm a guy that, I gotta look at the data, right? 423 00:35:01,450 --> 00:35:05,150 I can't just take somebody else's word off the phone. 424 00:35:06,290 --> 00:35:17,550 And so one of the big things that he pointed me out to was the file in question had a hit in VirusTotal. 425 00:35:17,550 --> 00:35:21,490 And it was tagged by Thor APT scanner. 426 00:35:21,490 --> 00:35:29,010 And it was tagged FancyBear, which is supposedly Russia, right? 427 00:35:29,350 --> 00:35:32,010 Whether it is, whether it isn't, I don't know, but either way. 428 00:35:32,050 --> 00:35:38,730 So that's what he, and we'll just say that it is just for the matter of fact, because he's like, yeah, we got it, we're Russian, blah, blah, blah. 429 00:35:38,790 --> 00:35:40,470 So it says it's tagged by FancyBear. 430 00:35:40,470 --> 00:35:42,970 And it says it's MAL, MAL FancyBear. 431 00:35:43,090 --> 00:35:49,410 And it says CompuTrace agent, or computer, yeah, CompuTrace agent. 432 00:35:49,410 --> 00:35:55,110 And so I'm looking at these files, and they look like malware. 433 00:35:55,110 --> 00:35:57,170 They really look like malware. 434 00:35:57,170 --> 00:36:00,250 The loaders are doing this crazy stuff. 435 00:36:00,250 --> 00:36:03,590 They're using an undocumented API. 436 00:36:03,590 --> 00:36:06,970 It's an arbitrary binary loader. 437 00:36:07,590 --> 00:36:12,870 And it really looked like malware. 438 00:36:12,870 --> 00:36:15,750 Just something that you wouldn't normally do, right? 439 00:36:15,870 --> 00:36:18,450 And so I'm tearing through it, I'm tearing through it. 440 00:36:19,310 --> 00:36:23,750 And for a good like three hours, I'm like, maybe we did get hacked, right? 441 00:36:23,750 --> 00:36:24,890 Maybe we did. 442 00:36:25,010 --> 00:36:28,890 But I was like, I got to see this through the end, right? 443 00:36:29,190 --> 00:36:33,610 And by this time, I think it was like 12 o'clock at night, day before Thanksgiving. 444 00:36:33,750 --> 00:36:35,850 Got to get the family up the next morning, right? 445 00:36:35,850 --> 00:36:37,150 I'm not giving up. 446 00:36:37,550 --> 00:36:47,310 And good thing that the person who wrote the rule, or at least I traced it back to where the source came for the rule. 447 00:36:47,310 --> 00:36:54,070 Good thing, he actually uses a lot of things that I kind of preach, which is a good naming convention. 448 00:36:54,770 --> 00:36:59,770 And also having good complete descriptions and whatnot. 449 00:36:59,770 --> 00:37:03,250 And then also sourcing where your information came from. 450 00:37:03,330 --> 00:37:07,890 So I noticed that this author, I'm not going to say his name, because I actually do respect him a lot. 451 00:37:07,890 --> 00:37:10,350 But we're all human, we all make mistakes. 452 00:37:11,030 --> 00:37:15,370 And it came from a report from Arbor Networks. 453 00:37:15,370 --> 00:37:20,270 And so I was like, let me go back to this report that Arbor has. 454 00:37:20,270 --> 00:37:21,950 And let me read their report. 455 00:37:22,450 --> 00:37:27,390 And I probably read that report like four times. 456 00:37:27,410 --> 00:37:28,830 Really, like four times. 457 00:37:28,830 --> 00:37:30,150 I'm like, what is going on here? 458 00:37:30,150 --> 00:37:31,690 What is going on here? 459 00:37:31,890 --> 00:37:37,210 And at the end of the report, they give a YARA rule. 460 00:37:37,210 --> 00:37:52,650 And I'm looking, and I'm looking, and I'm like, this YARA rule looks similar to the YARA rule that Thor APT scanner used to kind of make this attribution. 461 00:37:52,710 --> 00:37:59,610 And the name of the rule, and hats off to Arbor as well, they're doing good naming conventions. 462 00:37:59,990 --> 00:38:01,850 They're doing descriptions. 463 00:38:01,850 --> 00:38:04,470 Now, they didn't source anything, but that's fine, though. 464 00:38:06,810 --> 00:38:11,770 And the name of the rule just says CompuTrace agent. 465 00:38:11,770 --> 00:38:13,330 And I'm like, well, wait a second. 466 00:38:13,330 --> 00:38:15,890 So I had to kind of dig more and dig more. 467 00:38:15,890 --> 00:38:29,550 And turns out that what was going on was Fancy Bear was taking this CompuTrace agent, and they were patching the beacon, the domain beacon. 468 00:38:29,550 --> 00:38:31,170 That's all they were doing. 469 00:38:31,170 --> 00:38:39,850 And a normal CompuTrace agent, DLL, different from a Fancy Bear was only 28 bytes. 470 00:38:39,970 --> 00:38:42,590 And then it was XORed, so it was obfuscated. 471 00:38:42,590 --> 00:38:48,710 And so since it was obfuscated, you can't pre-predict what those domains are going to be. 472 00:38:48,710 --> 00:38:53,470 So how do you signature the unsignatureable, right? 473 00:38:53,470 --> 00:38:58,130 There is no real code in there that's attributable to Fancy Bear. 474 00:38:58,130 --> 00:39:01,410 So this was a CompuTrace binary. 475 00:39:03,790 --> 00:39:10,650 And so it took me a while to kind of tear it down and to kind of come to this discovery, did a byte-by-byte comparison. 476 00:39:10,650 --> 00:39:13,950 And finally, I was like, no, we didn't get hacked by the Russians. 477 00:39:14,190 --> 00:39:19,570 It's just whoever we have, like one box in the network that has this CompuTrace software running. 478 00:39:19,630 --> 00:39:22,510 Let's go get the IT department, let's clean it up and whatnot. 479 00:39:22,510 --> 00:39:29,410 And so, and to Thor APT Scanner's kind of credit, he... 480 00:39:29,410 --> 00:39:33,330 So this was the day before Thanksgiving, so that's November 2018. 481 00:39:33,690 --> 00:39:39,990 And then on March 2019, he actually renamed the rule. 482 00:39:40,330 --> 00:39:43,190 He changed it instead of MAL for the first three. 483 00:39:43,190 --> 00:39:47,950 He changed it to PUP, which is Potentially Unwanted Program. 484 00:39:48,090 --> 00:39:50,910 Thanks to a colleague of mine, I was like, what is PUP, right? 485 00:39:50,910 --> 00:39:53,990 And even I was like, I'm a seasoned guy. 486 00:39:53,990 --> 00:39:55,190 I was like, what is PUP? 487 00:39:55,190 --> 00:39:59,570 And I was like, what does that make any difference? 488 00:39:59,570 --> 00:40:03,950 Well, it... but he still got the fancy bear attribution in there. 489 00:40:04,030 --> 00:40:11,670 And that rule, once you look at it, it's hitting on all these CompuTrace binaries in VirusTotal. 490 00:40:11,670 --> 00:40:13,810 Maybe it's running in reversing labs as well. 491 00:40:13,810 --> 00:40:22,750 So anybody who goes and looks up a CompuTrace binary in VirusTotal, they're going to get false attribution of fancy bear for this binary. 492 00:40:22,750 --> 00:40:26,990 And then they themselves will be think they got hacked by fancy bear. 493 00:40:26,990 --> 00:40:32,030 And so you see that domino effect of, you know, the just prop... 494 00:40:32,530 --> 00:40:49,910 doing things kind of proper, taking your time, you know, making multiple detections and, you know, doing proper naming conventions and whatnot, and just kind of slowing it up a bit and not having that one rule to kind of rule them all mentality. 495 00:40:50,070 --> 00:40:52,730 And so that's kind of my story. 496 00:40:53,110 --> 00:40:57,990 Does anybody kind of have any questions or anything or what? 497 00:41:22,670 --> 00:41:29,410 I would say, yeah, maybe you can do some automation into it and look at ratios and whatnot. 498 00:41:30,210 --> 00:41:35,090 I kind of, when I do my circular detections, I do a lot of bytecode optimizations. 499 00:41:35,450 --> 00:41:38,950 And I'll look back at the assembly table. 500 00:41:39,030 --> 00:41:42,530 Take a look back at my previous talk and I talked a little bit about it. 501 00:41:42,530 --> 00:41:43,850 But where do you stop? 502 00:41:43,850 --> 00:41:49,130 Yeah, it's most of the time it's kind of by the analyst because most of us, I mean, we're all pretty bad. 503 00:41:49,170 --> 00:41:52,010 We're doing things, we're hand jamming things. 504 00:41:52,270 --> 00:41:59,050 Most of us probably should be, you know, because we all, a lot of the SOC people, they're just getting things on a whim. 505 00:41:59,390 --> 00:42:07,790 And, you know, if they write a script, take an hour out of their time and write a script, they may never use that script again and do any kind of automation with it. 506 00:42:07,790 --> 00:42:11,830 But with the rules that you're doing, you can do some triage up front. 507 00:42:11,830 --> 00:42:13,090 But yeah, where do you kind of stop? 508 00:42:13,090 --> 00:42:14,950 It is kind of up to the analyst. 509 00:42:14,950 --> 00:42:18,590 You just got to find that line within your workflow, I'd say. 510 00:42:18,650 --> 00:42:37,470 If you do have it in a malware shop and you got a big, a much bigger automated workflow, then I'd say, then you got to need to see, you know, give it some thresholds or something like that and say, Hey, you know, I got some malware that in my eyes is pretty rare and whatever the source that may came from. 511 00:42:37,530 --> 00:42:44,630 And let's say if I get a hundred hits on it, I'll, I'll just stop right there, right? 512 00:42:44,630 --> 00:42:52,410 If I get a hundred hits, because probably more than it's a high confidence, very targeted sample. 513 00:42:53,250 --> 00:42:58,770 Why are there going to be a hundred hits out there, you know, or you get a thousand, you can bump that up to a thousand maybe. 514 00:42:58,770 --> 00:43:05,250 And so once you kind of get to that, that level, you can kind of say, okay, yeah, this is a lot of noise. 515 00:43:05,250 --> 00:43:14,810 But then once your rule set gets more mature, you can leverage more of your rule set to kind of give you that other feeling. 516 00:43:14,810 --> 00:43:17,530 So you don't, you're not really always relying on the numbers. 517 00:43:17,530 --> 00:43:18,570 Does that kind of make sense? 518 00:43:19,530 --> 00:43:22,390 So at least in my, that's my point of view. 519 00:43:22,450 --> 00:43:23,430 So, yeah. 520 00:43:24,390 --> 00:43:25,930 Any other questions? 521 00:43:31,660 --> 00:43:33,040 I know it was a lot, guys. 522 00:43:33,040 --> 00:43:36,140 And I thank you and thank you for, for all the people that have stayed. 523 00:43:36,340 --> 00:43:38,480 A lot of technical stuff. 524 00:43:38,480 --> 00:43:39,940 Go back and watch it. 525 00:43:39,980 --> 00:43:42,280 A lot of text on there. 526 00:43:42,480 --> 00:43:44,440 Chew on some of those YARA rules and whatnot. 527 00:43:44,440 --> 00:43:46,340 If you haven't played with it, play with it. 528 00:43:46,340 --> 00:43:47,500 It's a great thing. 529 00:43:47,600 --> 00:43:49,680 Regular expressions too and whatnot. 530 00:43:49,680 --> 00:43:50,860 So, yeah. 531 00:43:51,280 --> 00:43:52,320 Thank you, guys.