1 00:00:00,000 --> 00:00:01,400 Welcome to Don't Cry Wolf. 2 00:00:01,400 --> 00:00:02,280 I'm Jimmy Wiley. 3 00:00:02,280 --> 00:00:03,940 I'm a malware analyst at Dragos. 4 00:00:04,100 --> 00:00:04,760 I'm Sam. 5 00:00:04,760 --> 00:00:07,800 I'm a half and half vulnerability researcher and malware analyst at Dragos. 6 00:00:07,800 --> 00:00:13,740 And we're here to talk to you about how we hunt for and assess threats to ICS capabilities in VirusTotal. 7 00:00:15,060 --> 00:00:18,460 So it's 2021 and a customer is asking me for an assist. 8 00:00:18,460 --> 00:00:23,700 They sent me a zip file with some stuff to look at, validate some results that another team had done. 9 00:00:24,380 --> 00:00:25,500 Take a look. 10 00:00:25,500 --> 00:00:26,980 It's fairly straightforward. 11 00:00:26,980 --> 00:00:31,200 Identify the thing as Cobalt Strike Beacon for delivering Conti ransomware. 12 00:00:31,240 --> 00:00:32,960 The customer is satisfied. 13 00:00:32,960 --> 00:00:34,140 I didn't really think any more of it. 14 00:00:34,140 --> 00:00:40,920 At that time, ransomware had really started to grow in the industrial space and this kind of stuff was getting more and more common. 15 00:00:41,500 --> 00:00:49,020 A few months later, in 2021, a BioISAC partner releases a report on a new APT called Tardigrade. 16 00:00:49,180 --> 00:01:06,660 They claim that Tardigrade is targeting biomanufacturing and pharmaceutical companies, and they're doing it with a quote, extremely sophisticated malware that's a metamorphic version of SmokeLoader, and potentially the first identified malware with this level of sophistication targeting a biomanufacturing facility. 17 00:01:06,760 --> 00:01:08,660 The release makes freaking headlines, right? 18 00:01:08,660 --> 00:01:09,800 This is 2021. 19 00:01:10,280 --> 00:01:12,500 COVID vaccine supply chains are at the top of mind. 20 00:01:12,500 --> 00:01:16,300 The whole country is sensitive to pharmaceutical-related news. 21 00:01:16,300 --> 00:01:26,520 You know, Wired reports devious Tardigrade malware hits biomanufacturing, and they call it a shockingly sophisticated strain, and they make some claims about it being able to operate autonomously. 22 00:01:27,600 --> 00:01:30,280 Now, of course, our customers get really concerned. 23 00:01:30,540 --> 00:01:32,120 They start messaging us. 24 00:01:32,200 --> 00:01:40,820 So we pull the report, and it's the same hash that I had analyzed a few months previously, the thing that I had identified as Cobalt Strike Beacon for delivering Conti ransomware. 25 00:01:41,000 --> 00:01:48,740 Bleeping Computer publishes an article on this stuff, and they cite the late Vitaly Kremes, and he comes to the same conclusion that we had. 26 00:01:48,740 --> 00:01:55,580 He's like, this just looks like, so clearly there'd been some kind of mix-up. 27 00:01:55,580 --> 00:01:58,300 Conti ransomware is not a new APT. 28 00:01:59,120 --> 00:02:03,540 But because everybody had gotten riled up, we have to address our customer concerns. 29 00:02:03,540 --> 00:02:10,840 So we published an internal report, and the whole report was just us being like, hey, like, just keep doing what you're doing to prevent ransomware, right? 30 00:02:10,840 --> 00:02:12,260 There's, you know, nothing to see here. 31 00:02:12,260 --> 00:02:13,180 Don't worry about this. 32 00:02:13,180 --> 00:02:15,560 Just, you know, operate as normal. 33 00:02:16,200 --> 00:02:21,740 And so, you know, this event really stuck with our team in 2021, and me personally. 34 00:02:21,740 --> 00:02:24,860 This, like, misidentification caused a lot of trouble. 35 00:02:24,860 --> 00:02:33,380 Some poor analyst was probably sitting at their desk having to answer their manager's questions about what they were doing to defend their network from Tardigrade. 36 00:02:33,520 --> 00:02:35,680 And, you know, I'm not here to drag those analysts. 37 00:02:35,680 --> 00:02:36,400 Mistakes happen. 38 00:02:36,400 --> 00:02:37,540 That's not really the point here. 39 00:02:37,540 --> 00:02:40,680 I'm just advocating for some care and analytical rigor, right? 40 00:02:40,680 --> 00:02:51,800 When we talk about these threats to the public as experts, people are listening, and we don't really ever want to be the reason that gets the media or, more importantly, the community worked up over some shit that they shouldn't be. 41 00:02:52,080 --> 00:02:59,580 So, you know, for this reason, we're very careful with our assessments of ICS threats, especially when we're hunting for ICS malware. 42 00:02:59,580 --> 00:03:04,740 And to help, we created a process and definition for identifying ICS malware that we apply in our hunting. 43 00:03:04,800 --> 00:03:06,420 This is a really quick summary. 44 00:03:06,520 --> 00:03:12,920 There's, like, a white paper and other talks on this, but we're going to use some of these terms throughout the talk, and I just want to make sure that everyone's familiar. 45 00:03:12,920 --> 00:03:16,760 So for us to consider something ICS malware, it has to have three properties. 46 00:03:16,760 --> 00:03:22,140 It needs to be, has to have ICS capable, malicious intent, and adverse effects. 47 00:03:22,140 --> 00:03:27,620 So when we talk about ICS capable, what we mean is that the code can do ICS or OT actions. 48 00:03:27,620 --> 00:03:35,280 These are things like speaking OT protocols, uploading download ladder logic, code made for interacting with runtimes, or maybe the engineering software. 49 00:03:35,480 --> 00:03:39,780 Next, the sample has to be designed with malicious intent. 50 00:03:39,780 --> 00:03:46,840 And what that means is that we can find evidence that the software was intentionally designed to cause harm to OT environments. 51 00:03:46,880 --> 00:03:52,760 This property is basically the difference between something that is malware and something that looks like malware but is designed for red teamers. 52 00:03:53,280 --> 00:03:58,700 And lastly, the sample has the ability for ‑‑ has to have the ability for adverse effects on OT environments. 53 00:03:58,700 --> 00:04:08,640 Now, what this means is that this software can actually cause harm against an OT environment, meaning we can find some negative effect and we can verify that the software works to achieve it. 54 00:04:08,640 --> 00:04:19,280 So these are going to be things like stealing sensitive process information, enabling unauthorized access, downloading arbitrary logic or executable code to the PLC. 55 00:04:19,280 --> 00:04:24,960 These kinds of things are going to vary from site to site, device and industry, so there's no go‑to hard list or anything. 56 00:04:25,960 --> 00:04:26,760 And that's it. 57 00:04:26,760 --> 00:04:33,140 We used three criteria, ICS capability, malicious intent, and the ability for adverse effects on OT environments. 58 00:04:33,140 --> 00:04:36,180 If we have enough evidence of all three, we consider it ICS malware. 59 00:04:36,180 --> 00:04:44,720 If not, if it's less than that, it's probably just something else, like IT malware, research, it could be a broken tool or something that's in development. 60 00:04:44,740 --> 00:04:50,620 And with these criteria, we sort of assess the things that we find when we're looking through VirusTotal. 61 00:04:50,780 --> 00:04:57,240 So part of our jobs at Dragos is to be constantly monitoring and hunting for what we call emerging threats. 62 00:04:57,240 --> 00:05:05,160 These might be threats that lurk in our existing data sources, like VirusTotal, but are not discoverable based off of known bad indicators of compromise. 63 00:05:05,280 --> 00:05:09,920 And there's actually a history of ICS malware, or ICS‑related malware, ending up on VT. 64 00:05:09,920 --> 00:05:13,260 So Frosty Goop, Trisys, and Cosmic Energy were all found there. 65 00:05:13,280 --> 00:05:25,540 So whether it's because the defender or an incident responder uploads the capability as part of their investigation, or whether the threat actor actually is uploading it themselves to test the detection rate, these samples continue to end up on VT. 66 00:05:25,540 --> 00:05:29,320 And that leads us to our emerging threats hunting hypothesis. 67 00:05:29,800 --> 00:05:35,620 And that is, there exists undiscovered ICS malware or ICS‑related malware in VT. 68 00:05:35,780 --> 00:05:49,640 Of course, the ultimate goal here is to find novel ICS malware or capabilities before their use out in the wild, which is a very short and challenging window of opportunity, but we'll actually have an example of this later on in the presentation, not with something ICS specific, 69 00:05:49,640 --> 00:05:51,360 but something a bit more generic. 70 00:05:52,060 --> 00:05:59,380 Now, there's a lot of ways to hunt in VT for ICS malware, but I've found that keeping it simple often yields the best results. 71 00:05:59,380 --> 00:06:06,640 This mostly means using good old‑fashioned strings, and the obvious method here is to grab ICS‑related strings, right? 72 00:06:06,640 --> 00:06:12,760 Whether it be protocol names, vendor names, makes and models of PLCs, those are all good places to start. 73 00:06:13,000 --> 00:06:21,660 Additionally, from samples like Pipe Dream and Frosty Goop, we've learned that threat actors are using open source libraries to build tools like Frosty Goop. 74 00:06:21,740 --> 00:06:26,460 Why build your own OPC UA protocol stack if there's one on GitHub? 75 00:06:26,460 --> 00:06:27,480 Same with Frosty Goop. 76 00:06:27,480 --> 00:06:30,980 Why build a whole Modbus TCP stack when you don't need to? 77 00:06:30,980 --> 00:06:32,520 There's plenty available. 78 00:06:32,540 --> 00:06:41,600 So narrowing down on ICS‑related strings from open source libraries is a really good way to dial in on that ICS‑capable component. 79 00:06:42,260 --> 00:06:48,420 We've also seen ICS malware utilize popular programming languages like Python, Go, and .NET. 80 00:06:48,420 --> 00:07:02,040 Of course, we've seen binaries written in C and C++, but focusing first on languages that make triaging efficient is a lot easier, and hence why we focused on Python and .NET first. 81 00:07:02,040 --> 00:07:09,880 You can be looking at the original source code within minutes, and that makes static analysis much, much easier than something like C or C++. 82 00:07:10,540 --> 00:07:22,780 And finally, we look for malicious strings or CVE identifiers or even more generic stuff like words like exploit or attack that has often led to some interesting samples. 83 00:07:22,780 --> 00:07:32,440 So that's a very quick and high‑level word on how we do our hunting and the strategies we take to narrow in on that potentially ICS malicious component. 84 00:07:32,540 --> 00:07:37,140 Now let's look at some of the more interesting samples we've come across during our hunting. 85 00:07:37,140 --> 00:07:46,360 These could be standalone tools that demonstrate some sort of ‑‑ some of the challenging assessments we've had to make with limited visibility, primarily just being the capability itself. 86 00:07:46,360 --> 00:07:49,000 So we'll start with a tool called IoT exploit. 87 00:07:50,240 --> 00:08:00,440 So Trisis was Python malware with ICS‑related strings, and so learning from that, we want to hunt for ICS ‑‑ or Python malware with ICS‑related strings. 88 00:08:00,440 --> 00:08:07,860 So we stumbled upon this massive zip file, about half a gigabyte in size, containing a bunch of Nuica‑generated Cython binaries. 89 00:08:07,860 --> 00:08:15,520 These are Python to C transpiled code, so it's an absolute mess to disassemble or decompile and statically analyze. 90 00:08:15,520 --> 00:08:20,680 And the file names and the file paths, the modules, are obfuscated as well. 91 00:08:21,820 --> 00:08:23,360 Thankfully, we got a bit lucky. 92 00:08:23,360 --> 00:08:29,160 So the author had incorporated a bunch of doc strings into their code in basically every place they could. 93 00:08:29,180 --> 00:08:31,040 And so here's actually a screenshot of one of them. 94 00:08:31,040 --> 00:08:36,040 You can see it defines the class and the functions that it takes or that it has. 95 00:08:36,040 --> 00:08:43,860 And it turns out, by doing a simple little Python trick, you can actually pull out these doc strings from the Nuica‑generated Cython binaries. 96 00:08:44,220 --> 00:08:46,100 And that makes analysis a ton easier. 97 00:08:46,100 --> 00:08:48,920 This is equivalent to running help on a Python module. 98 00:08:48,980 --> 00:08:58,360 So we're able to learn a ton from basic static analysis of strings as well as some of the more unique byte strings that were actually contained in the ICS‑related exploits. 99 00:08:59,220 --> 00:08:59,800 All right. 100 00:08:59,800 --> 00:09:02,020 So here are the highlights from the analysis, right? 101 00:09:02,020 --> 00:09:05,620 One, you all might have noticed in the last screenshot, there's a bunch of Chinese strings. 102 00:09:05,620 --> 00:09:06,940 We translated all of them. 103 00:09:06,940 --> 00:09:14,180 One of them was identification, and that translated to IoT device vulnerability scanning, verification, and exploitation toolkit. 104 00:09:14,180 --> 00:09:19,460 The tool has over 1,000 exploits targeting IP cameras, routers, and industrial devices. 105 00:09:19,460 --> 00:09:32,180 In the ICS category, IoT exploit has roughly 175 tools for publicly disclosed vulnerabilities from common OT manufacturing products like Siemens SIMATIC and Rockwell Automation Micrologics. 106 00:09:32,300 --> 00:09:39,800 And it provides at least partial support for 19 industrial protocols, things like Ethernet IP, FINS, and Modbus TCP. 107 00:09:40,180 --> 00:09:47,100 Now, when we assess this tool against our criteria, the ICS capable and adverse effects properties are straightforward. 108 00:09:47,100 --> 00:09:58,980 We consider it ICS capable for all the protocols it speaks, even though it's partial support, it works to deliver the exploits, and the adverse effects protocol is derived ‑‑ sorry, the adverse effects property is derived from the effects of the exploits, 109 00:09:58,980 --> 00:10:03,660 so they can do things like denial of service or enable and authorize access and these types of things. 110 00:10:03,660 --> 00:10:08,220 When we were trying to assess the sort of malicious intent behind the tool, this is where things got a little bit more challenging. 111 00:10:08,860 --> 00:10:09,980 This is another screenshot. 112 00:10:09,980 --> 00:10:22,300 The tool includes a JSON file with detailed vulnerability information like CVSS strings and public advisory information, and this sort of thing seemed more applicable to mitigating vulnerabilities than an offensive operation. 113 00:10:22,980 --> 00:10:26,900 And it just generally features a lot of what we call dual use dilemmas. 114 00:10:26,900 --> 00:10:32,240 These are features for which both offensive and defensive use cases can be found. 115 00:10:32,240 --> 00:10:34,640 The big one here just being the exploits and vuln scanners, right? 116 00:10:34,640 --> 00:10:38,360 That could be used for an unauthorized intrusion or it could be used for a red team. 117 00:10:38,440 --> 00:10:40,580 Another example, it can detect malware, right? 118 00:10:40,580 --> 00:10:46,080 Classically defensive, but also adversaries may want to detect if the box they're on has been compromised already. 119 00:10:46,340 --> 00:10:58,960 We found persona information and we were able to find the related organization, but after investigating that organization, we realized that it does both offensive and defensive research, so the tool could just as easily support either. 120 00:10:58,960 --> 00:11:01,160 So the persona information was a bust. 121 00:11:01,160 --> 00:11:03,260 The binary analysis was inconclusive. 122 00:11:03,260 --> 00:11:05,800 The OT exploits were for publicly disclosed vulns. 123 00:11:05,800 --> 00:11:11,000 There were no evidence of zero days and we had no evidence of the tool's use or any other intelligence on it. 124 00:11:11,000 --> 00:11:13,940 To us, that's just not enough evidence for malicious intent. 125 00:11:14,660 --> 00:11:21,480 Yeah, so we concluded that this is probably not ICS malware and more likely to be an ICS red teaming tool. 126 00:11:21,600 --> 00:11:30,060 Still, even a non-malicious tool can be used for malicious purposes, so we reported on this internally, we got detections out to customers, et cetera. 127 00:11:30,800 --> 00:11:35,300 The lesson here when we're dealing with samples like this is to stick to the facts, right? 128 00:11:35,300 --> 00:11:38,480 It's really easy to jump to conclusions in a case like this. 129 00:11:38,480 --> 00:11:43,700 Oh my gosh, it's from an adversarial nation, it can exploit ICS, it must be bad. 130 00:11:43,760 --> 00:11:50,620 But we have to remember that other countries want to protect and defend their infrastructure as well, so they'll develop tools including red teaming tools to do it. 131 00:11:50,840 --> 00:12:03,180 Of course, with new information, assessments can change, but staying unbiased while looking for evidence of malicious intent prevents worst-case scenarios from from tainting our analysis and helps us reach a sensible conclusion. 132 00:12:04,160 --> 00:12:06,980 So next we're going to talk about a tool called Kertler SCADA. 133 00:12:07,100 --> 00:12:09,240 This tool was found with a simple query. 134 00:12:09,240 --> 00:12:12,800 We were looking for Python scripts with SCADA in the name submitted from Iran, right? 135 00:12:12,800 --> 00:12:13,460 Even before the U.S. 136 00:12:13,460 --> 00:12:17,000 decided to bomb Iran, that area was all kinds of geopolitical tension. 137 00:12:17,200 --> 00:12:23,220 At this point we were seeing a lot of the hacktivist groups like Cyber Avengers express increasing interest in attacking OT systems. 138 00:12:23,680 --> 00:12:32,060 Now, Kertler SCADA is a compiled Python binary and decompiling compiled Python is usually pretty straightforward with tools like PyCDC or Uncompile 6. 139 00:12:32,160 --> 00:12:36,200 And to start the decompilation, you need to know which version of Python that you're dealing with. 140 00:12:36,280 --> 00:12:41,920 Usually you can just do a simple string rep for this, but in this case the Python version was too new for Uncompile 6. 141 00:12:41,920 --> 00:12:43,800 You can see here this is like Python 3.12. 142 00:12:43,800 --> 00:12:46,740 Basically anything before Python 3.10 is fine. 143 00:12:46,740 --> 00:12:48,640 Anything after that, you're going to have some trouble. 144 00:12:48,900 --> 00:12:58,680 But luckily there's this new like AI-based transformer tool called Pylingual and that supports 3.10 and later and we were able to use that to get a good decompilation of the tool and basically read the code. 145 00:12:58,940 --> 00:13:05,620 So after reading through some of the decompilation, we realized this tool is basically a glorified VNC client. 146 00:13:05,620 --> 00:13:21,160 That is, Kertler SCADA would accept a list of IP addresses that had to be generated by the operator, probably using Shodan, then iterate over each IP address, brute forcing the VNC server's authentication mechanism with a small list of hard-coded credentials. 147 00:13:21,160 --> 00:13:27,100 If it successfully connected, it would then capture a screenshot of the compromised server just basically proving access. 148 00:13:27,720 --> 00:13:32,160 So now by pivoting off of the tool's name, we were able to discover a telegram channel. 149 00:13:32,160 --> 00:13:42,060 This is where an actor was boasting pro-Iranian and anti-Western ideology, selling the tool to the roughly 3,500 followers, even offering discounts for those targeting the West. 150 00:13:42,180 --> 00:13:51,940 So Kertler Cyber Lab, the telegram channel, had about 7,000 subscribers at the beginning of July, but then was just so just a few weeks ago was banned by telegram. 151 00:13:51,940 --> 00:13:57,280 But backup channels exist where they're still operating, although with a lot less of a reach. 152 00:13:58,340 --> 00:14:03,560 So now using the tool, the actor actually compromised dozens of HMIs. 153 00:14:03,560 --> 00:14:10,740 They posted a video of them, mass scanning and mass exploiting them, and of course posted screenshots as well. 154 00:14:10,740 --> 00:14:19,260 Here you can see two screenshots, and if you look closely, you can see a couple images that have been added to the HMI screen of Elliot from Mr. 155 00:14:19,260 --> 00:14:24,020 Robot throwing his hands in the air after a big successful hack, I would assume. 156 00:14:24,020 --> 00:14:27,520 So they actually went and took steps to modify the HMI screen. 157 00:14:28,740 --> 00:14:32,780 So this tool isn't complicated and it lacks any real ICS capability, right? 158 00:14:32,780 --> 00:14:40,000 It's just a VNC client, so we weren't considering it ICS malware, but the fact was the campaign was targeting ICS organizations and HMIs, and that's a serious problem. 159 00:14:40,000 --> 00:14:43,240 So we contacted CISA and worked with them to notify the victims. 160 00:14:43,560 --> 00:14:48,940 The main takeaway here is that ICS targeting malware doesn't need to be sophisticated to be effective. 161 00:14:48,940 --> 00:14:53,660 I don't think y'all can actually read the caption here, but this is just a video of opening a master lock with a hammer. 162 00:14:53,660 --> 00:14:57,180 So if you just take a crowbar and a hammer and hit the lock, it opens up. 163 00:14:58,000 --> 00:15:07,520 So anyway, so curler SCADA is just an instance of hacktivists using low-hanging fruit techniques against poorly secured internet exposed HMIs. 164 00:15:07,520 --> 00:15:14,060 And the good news here is that since these techniques are basic, the defenses don't have to be complicated, like just use a better password and you'd be fine. 165 00:15:15,420 --> 00:15:16,000 Okay. 166 00:15:16,000 --> 00:15:24,040 So hopefully you can read this, but this is from the vendor of one of the compromised HMIs targeted by curler SCADA, and I'm actually going to read a couple sentences here from it. 167 00:15:24,040 --> 00:15:27,080 So VNC can have several layers of security. 168 00:15:27,080 --> 00:15:30,540 The VNC client must give a password before connecting. 169 00:15:30,540 --> 00:15:32,800 Blacklist may exempt certain machines from connecting. 170 00:15:32,820 --> 00:15:35,380 Nonstandard port numbers may be used, et cetera. 171 00:15:35,660 --> 00:15:40,300 We have currently chosen not to implement these means in order to avoid too much complexity. 172 00:15:41,300 --> 00:15:44,360 They're saying we know what we should be doing and we aren't, right? 173 00:15:44,360 --> 00:15:48,460 Of course they got compromised and state of security, I guess, huh? 174 00:15:48,960 --> 00:15:53,480 So while curler SCADA was a cool win, most samples aren't usually as clear cut. 175 00:15:53,480 --> 00:15:58,260 So let's look at a similarly named tool, the fake rapid SCADA masquerade. 176 00:15:58,260 --> 00:16:07,800 So we found this while searching virus total for files that contained any CVE tag that had five or more detections and had SCADA somewhere found in the metadata. 177 00:16:08,840 --> 00:16:13,740 Now, rapid SCADA is a legit open source industrial software for building SCADA systems. 178 00:16:13,740 --> 00:16:18,200 As the sample's name suggests, it pretends to be an update for rapid SCADA. 179 00:16:18,220 --> 00:16:22,580 The sample is actually a zip file that masquerades as an executable. 180 00:16:23,300 --> 00:16:32,880 And inside the zip file, there's a fake read me batch file, which abuses CVE 2023 38831, which is a WinRAR arbitrary code execution vulnerability. 181 00:16:33,380 --> 00:16:35,780 This vuln has many public proof of concepts. 182 00:16:35,780 --> 00:16:38,560 It has been exploited in the wild by different threat groups. 183 00:16:38,700 --> 00:16:45,740 But the file that we had didn't align and the DTPs that we were seeing didn't quite align with the behavior from those groups. 184 00:16:46,280 --> 00:16:48,820 So here's how the exploit chain works. 185 00:16:48,820 --> 00:16:50,900 A user is sent a zip file via an email. 186 00:16:50,920 --> 00:16:56,960 The user opens up the zip file with WinRAR, and more importantly, they preview the zip file in WinRAR. 187 00:16:56,960 --> 00:17:01,600 And when they preview the readme.txt, it's a sort of malformed PNG that kicks off the exploit. 188 00:17:01,600 --> 00:17:04,040 This is going to cause a batch file to execute. 189 00:17:04,220 --> 00:17:13,320 This batch file will then modify the shell open command registry keys associated for various browsers, along with the HTTP and HTTPS protocols. 190 00:17:13,320 --> 00:17:22,080 The effect here is that when the user tries to open up an HTML file or a URL, it's going to cause this encoded firmware.exe binary to execute. 191 00:17:22,080 --> 00:17:38,860 Now, once that thing launches, one of the first things it does is it kills a task called SCADA underscore manager.exe, and then it moves on to searching the desktop directory for PDFs, XLS files, DocXs, and files with power plant SCADA or firewall in the name. 192 00:17:38,920 --> 00:17:43,200 It then sends these files to a custom C2 server that's hard-coded in the binary. 193 00:17:43,920 --> 00:17:53,280 Now, most of the evidence pointed at this binary being a custom, although weirdly specific, information stealer, since it's just looking at the desktop directory. 194 00:17:54,100 --> 00:18:03,200 You know, they use an exploit, there's obfuscated scripts and binaries, they're stealing potentially sensitive documents, and it had a very clear ICS angle with this masquerade as rapid SCADA. 195 00:18:03,260 --> 00:18:12,740 While we didn't think this was ICS malware, again, because there was no real ICS capability here, we thought that maybe we had another curler SCADA type situation where the thing was targeting ICS organizations. 196 00:18:13,320 --> 00:18:14,320 And then we found this. 197 00:18:14,320 --> 00:18:22,360 The C2 server had a shared SSL certificate with a domain operated by hackrocks.com, which is a CTF and security training website. 198 00:18:23,160 --> 00:18:25,540 So there goes our malware theory, right? 199 00:18:25,540 --> 00:18:31,520 Not only did it lack ICS capability, but this evidence meant that really malicious intent isn't there either. 200 00:18:31,520 --> 00:18:42,400 So we contacted hackrocks, tried to determine if it was one of their exercises, and after multiple attempts of emailing them back and forth, we just gave up because they fully stopped responding to us. 201 00:18:42,440 --> 00:18:50,360 So while it could have been a stolen certificate, it seems a lot more likely and plausible that this is a custom challenge designed by hackrocks. 202 00:18:51,780 --> 00:18:57,560 Frustratingly, sometimes one piece of high confidence evidence nullifies eight pieces of evidence to the contrary. 203 00:18:57,560 --> 00:18:59,060 But that's our job, right? 204 00:18:59,060 --> 00:19:05,860 We're just here to follow the evidence and accept the reality given by the facts, even if the result's a bit unsatisfying. 205 00:19:06,900 --> 00:19:10,380 All right, so next we're going to talk about some .NET Modbus samples that we found. 206 00:19:10,380 --> 00:19:16,740 So we were searching, using YAR, we were searching for .NET executables that statically linked to open source Modbus libraries. 207 00:19:16,740 --> 00:19:20,240 And we found a whole cluster of samples, and they all share similar patterns. 208 00:19:20,240 --> 00:19:26,320 They're all .NET, they all download and execute a second stage, and they contain the EZ Modbus library. 209 00:19:26,480 --> 00:19:33,340 Now what was weird about this is that most of the samples don't use the EZ Modbus library, meaning it's imported, but the code never calls into it. 210 00:19:33,360 --> 00:19:34,620 Except for one sample. 211 00:19:34,620 --> 00:19:38,700 One sample actually uses a couple functions from the library, and that's what we're going to talk about. 212 00:19:39,080 --> 00:19:41,260 All right, so I'm going to walk through some of the code here. 213 00:19:41,260 --> 00:19:45,460 A lot of it was obfuscated, but the symbols have been renamed and such. 214 00:19:46,140 --> 00:19:48,940 I've done most of the renaming, so hopefully it's something sensible. 215 00:19:48,940 --> 00:19:51,860 But we start by importing the EZ Modbus library. 216 00:19:52,040 --> 00:20:02,400 We then connect to that LDUG host name over port 502 with a Modbus client connection, then separately create an instance of a strange class that I'm going to refer to as the Z class. 217 00:20:03,060 --> 00:20:10,940 So next we're going to download, deobfuscate, and execute a binary it fetches from Discord's content distribution network. 218 00:20:10,940 --> 00:20:13,360 So let's zoom in on that function . 219 00:20:13,760 --> 00:20:14,880 Here we are. 220 00:20:14,940 --> 00:20:27,180 So this code issues an HTTP GET request to Discord CDN, then does a base64 decode , and finally it does a swap character algorithm to get the plain text and well-formed binary. 221 00:20:27,600 --> 00:20:31,560 When that binary is executed, it returns an IP address. 222 00:20:32,560 --> 00:20:37,680 The sample connects to that IP address using Modbus and then just doesn't do anything. 223 00:20:38,620 --> 00:20:48,720 Unfortunately, at the time of researching this, the second stage payload, which was being hosted on Discord, was no longer available, nor was it captured by VirusTotal, so we lost visibility into that capability. 224 00:20:48,720 --> 00:20:50,080 We don't know where it was connecting to. 225 00:20:50,080 --> 00:20:52,800 We don't know what other functionality it had in it. 226 00:20:55,120 --> 00:21:05,740 So we don't have any evidence of victims or targeting, so with just the binary behavioral alone, we can't really say for sure if this sample has any malicious intent aside from it just being weird. 227 00:21:05,840 --> 00:21:17,000 Further, since it doesn't actually issue any Modbus commands, right, if you notice the very first time it initiates a Modbus connection, there's no control commands after that, and the second time it just connects again to an IP address and issues no control commands. 228 00:21:17,000 --> 00:21:21,500 We can't actually assess any kind of adverse effects here because we don't know what it's trying to do. 229 00:21:21,500 --> 00:21:25,740 So in our assessment, it's not ICS malware in its current state. 230 00:21:25,740 --> 00:21:26,920 It might be eventually. 231 00:21:26,920 --> 00:21:28,340 It could be in development malware. 232 00:21:28,340 --> 00:21:30,600 It could just be a toy, research project, whatever. 233 00:21:30,780 --> 00:21:35,600 The point here really is that you have to remember that malware analysis is an intelligence discipline. 234 00:21:35,600 --> 00:21:43,740 In this case, the capability alone was not enough to make a decision, and we need more context around how it's used, by who, or for what before we can say anything else. 235 00:21:43,800 --> 00:21:51,540 Sometimes we just don't have enough high-confidence information or find too many reasonable alternative explanations to prevent any kind of high-confidence assessment. 236 00:21:51,760 --> 00:21:59,360 So, you know, sure, it might look like a duck, walk like a duck, quack like a duck, but if it's like a duck robot store down the street, you have to consider whether or not you have a duck robot. 237 00:22:01,000 --> 00:22:01,560 Okay. 238 00:22:01,560 --> 00:22:05,540 So we've covered four samples all related to ICS in some way today. 239 00:22:05,540 --> 00:22:07,360 The first was IoT exploit tool. 240 00:22:07,360 --> 00:22:13,620 That looked real nasty right off the bat, but after further investigation, more than likely just an ICS red teaming tool. 241 00:22:13,620 --> 00:22:21,400 Then Curtler SCADA, claimed to be some sort of OT malware, but kind of a glorified VNC client, not that impressive technically. 242 00:22:22,060 --> 00:22:31,300 There was the rapid SCADA masquerade, which used an exploit that has been seen exploited out in the wild by various threat groups, and it appeared to steal ICS-related files. 243 00:22:31,600 --> 00:22:33,700 Turned out to be probably a CTF. 244 00:22:33,900 --> 00:22:39,040 And then finally, there were the dot net Modbus cluster of samples, which were malware lookalikes, right? 245 00:22:39,040 --> 00:22:47,380 It was a downloader capability that executed a second stage, made two Modbus connections, but then issued no control commands for whatever reason. 246 00:22:47,420 --> 00:22:50,560 These examples, they remind us of two things. 247 00:22:50,960 --> 00:22:59,220 The first is that simple queries, like the ones we've demonstrated or shown in this presentation, they take a lot less time to make and yield really interesting results. 248 00:22:59,240 --> 00:23:10,280 Something as simple as a Python artifact plus some ICS-related keywords can give you plenty to look at and to hunt in, like the Curtler SCADA tool that was found legitimately targeting HMIs. 249 00:23:10,780 --> 00:23:18,720 And the last point here is that without a careful evidence-driven process, any of these four samples could have easily turned into a tardigrade-type situation, right? 250 00:23:18,720 --> 00:23:36,220 Claiming that some sample is ICS malware when it isn't, or over-hyping some sample as more dangerous than it is, stirring up headlines, causing headaches for ICS defenders, having to answer to their managers, or just do a bunch of extra work that isn't necessary for a threat that probably isn't a problem or threat to their network. 251 00:23:36,340 --> 00:23:44,360 So, you know, by taking care in our investigations, we retain the trust of the community so that when the real bad shit comes through, people actually listen to us. 252 00:23:45,840 --> 00:23:47,460 Anyway, so thanks for coming to our talk. 253 00:23:47,460 --> 00:23:48,460 We appreciate it. 254 00:23:48,460 --> 00:23:49,320 These are our dogs. 255 00:23:49,320 --> 00:23:50,300 They help us out.