1 00:00:00,000 --> 00:00:08,040 Hi, everyone. Thank you very much for coming. So this is worms that fight back. Nematodes is 2 00:00:08,040 --> 00:00:12,780 an antidote for IOT malware. So worth pointing out that what I'm going to talk to you about 3 00:00:12,780 --> 00:00:18,460 today is presented for educational purposes only. Also worth pointing out that this isn't a 4 00:00:18,460 --> 00:00:23,520 brand-new concept. This is building on work that's been done previously as you guys will see 5 00:00:23,520 --> 00:00:29,040 by the references and the kind of case studies that I'm going to talk about. So my name is 6 00:00:29,040 --> 00:00:34,740 Matt Wixey. I lead research for PWC UK cyber security business unit. I also work on its 7 00:00:34,740 --> 00:00:41,940 ethical hacking team. I'm a part-time PhD student at UCL. And my previous role was working in 8 00:00:41,940 --> 00:00:51,000 law enforcement in the UK leading a technical R&D team. So I want to talk about nematodes or 9 00:00:51,000 --> 00:00:55,940 anti-worms because I think it's a really interesting and really underexplored concept. So 10 00:00:55,940 --> 00:00:59,020 it's kind of been talked about a little bit before. And I'm going to talk a little bit about 11 00:00:59,640 --> 00:01:04,740 what a nematode is. And it actually goes back right back to the 1970s when malware kind of 12 00:01:04,740 --> 00:01:11,200 first started to be experimented with and played with. I have a kind of general interest in 13 00:01:11,960 --> 00:01:18,280 repurposing bad stuff for good purposes. And as far as I know, this kind of concept hasn't 14 00:01:18,280 --> 00:01:25,500 really been applied to IOT in any kind of security research sense anyway. So I'm going to cover 15 00:01:25,500 --> 00:01:29,020 what a nematode is, what an anti-worm is. I'm going to go through a little bit about the 16 00:01:29,040 --> 00:01:35,440 history of nematodes in the wild. I'm going to cover why those attempts didn't really kind of 17 00:01:35,440 --> 00:01:43,940 take off. And kind of previous attempts to produce nematode frameworks as a kind of commercial 18 00:01:43,940 --> 00:01:48,740 offering or service offering. I'm then going to talk about something called neo-toads, which is 19 00:01:48,740 --> 00:01:55,000 a term I've come up with just to describe new kinds of worms using new replication vectors. And 20 00:01:55,000 --> 00:01:59,020 whether that makes it worth reopening the debate and whether anti-worms are something that's 21 00:01:59,040 --> 00:02:03,340 something that could be used. I've got some demos for you as well. So I'm going to demo some 22 00:02:03,340 --> 00:02:07,080 nematodes that I've developed. I'm then going to talk about something called the antidote 23 00:02:07,080 --> 00:02:11,540 framework, which is something experimental that we're working on at PwC. And then finally I'm 24 00:02:11,540 --> 00:02:20,820 going to wrap up. So what is a nematode? So in biology, a nematode is kind of a generic term for 25 00:02:20,820 --> 00:02:25,520 a worm or a kind of parasite that attacks other parasites. That's kind of how it's commonly 26 00:02:25,980 --> 00:02:29,020 understood. In security, it's an anti-worm that attacks other parasites. So it's kind of a 27 00:02:31,860 --> 00:02:39,040 tool which exploits the same vulnerabilities that malicious worms exploit. It replicates in 28 00:02:39,040 --> 00:02:44,960 the same ways that malicious worms do. But it's designed to disinfect systems, patch systems, 29 00:02:45,300 --> 00:02:50,720 kick malicious worms off of infected hosts. And there are three different kinds based on the 30 00:02:50,720 --> 00:02:58,940 case studies that are out there. There are true nematodes. So these are designed to exploit 31 00:02:59,040 --> 00:03:03,540 systems which have certain vulnerabilities and then automatically like download and install a 32 00:03:03,540 --> 00:03:09,640 patch and kick malicious worms off of that host. There are malicious nematodes. So these are 33 00:03:09,640 --> 00:03:16,820 nematodes which are in themselves malicious but are trying to kick other malicious worms off of 34 00:03:16,820 --> 00:03:21,540 an infected host to kind of boost their own infection rate, to kind of kill off the competition 35 00:03:21,540 --> 00:03:27,260 if you like. And then finally there are moral nematodes. And I use the word moral in inverted 36 00:03:27,260 --> 00:03:29,020 comments. So these are nematodes that are used to kill off the competition if you like. And then 37 00:03:29,040 --> 00:03:34,340 there are nematodes which in the eyes of the author or the developer perform some kind of 38 00:03:34,340 --> 00:03:39,760 beneficial action. They don't necessarily exploit a specific vulnerability, but they do something 39 00:03:39,760 --> 00:03:49,160 that the author believes is morally good. So if we walk through the history of nematodes, the 40 00:03:49,160 --> 00:03:55,620 first known one, and it's kind of apocryphal, is creeper versus reaper. Has anyone heard of the 41 00:03:55,620 --> 00:03:58,460 creeper virus? A couple of people? 42 00:03:59,040 --> 00:04:08,520 So creeper was an experiment basically. It infected 10X operating systems and it was arguably the 43 00:04:08,520 --> 00:04:14,060 first kind of self-replicating, spreading piece of malware. It didn't really do anything. It 44 00:04:14,060 --> 00:04:19,320 transferred itself over to different systems rather than replicating. And it just printed out a 45 00:04:19,320 --> 00:04:25,180 bit of text on the terminal that you can see there. I'm the creeper. Catch me if you can. And 46 00:04:25,180 --> 00:04:31,860 reaper, the rumor has it anyway, is a tool that was developed to try and catch up with the creeper 47 00:04:31,860 --> 00:04:41,720 virus and then kind of kick it off the system. Anyone heard of animal and the pervade routine? A 48 00:04:41,720 --> 00:04:49,060 couple of people. So animal was a game developed by a guy called John Walker in 1975. It was like a 49 00:04:49,060 --> 00:04:53,060 kind of guessing game. So it would ask you to think of an animal and it would try and guess what 50 00:04:53,060 --> 00:04:59,620 it was. And pervade was a subroutine in animal that was designed to spread the game. So it would 51 00:04:59,620 --> 00:05:05,440 copy over to shared disks and shared drives so that it would kind of spread as far as possible. 52 00:05:06,660 --> 00:05:13,960 And hunter, again, apocryphal, was a tool that allegedly was designed to track down copies of 53 00:05:13,960 --> 00:05:22,320 animal and delete them from systems. There's brain. So you'll be familiar with brain, I would 54 00:05:22,320 --> 00:05:29,980 imagine. So brain, pretty old virus, infected the boot sector of floppy disks, renamed it. And you 55 00:05:29,980 --> 00:05:34,800 can see from this screenshot that the authors ensured that their name and address and telephone 56 00:05:34,800 --> 00:05:39,600 number were actually included in this. So there's a kind of couple of interpretations of that. 57 00:05:39,920 --> 00:05:45,460 One is that it's just kind of a more innocent time in writing viruses and malware and that kind of 58 00:05:45,460 --> 00:05:51,220 thing. The other, arguably, is that the brain virus was developed as a kind of warning to software 59 00:05:51,220 --> 00:05:57,240 pirates. And the names and addresses and telephone number in there were added so that if people 60 00:05:57,240 --> 00:06:01,680 were infected, they would have some kind of recourse and they could get themselves patched. The 61 00:06:01,680 --> 00:06:09,460 Denzuko virus was a nematode that deliberately targeted brain-infected disks. So it would just 62 00:06:09,460 --> 00:06:17,140 replace what was on the boot sector and retitle it. Then there's Co, named after the chemical 63 00:06:17,140 --> 00:06:20,580 formula for potassium hydroxide. So Co is a chemical formula for potassium hydroxide. So Co, 64 00:06:21,220 --> 00:06:27,120 would encrypt your disk but it would, beforehand, ask for permission and would ask you to 65 00:06:27,120 --> 00:06:32,260 supply the password. So kind of a very benign form of ransomware, if you like. So this is a good 66 00:06:32,260 --> 00:06:37,780 example of a kind of moral nematode. The reason it was doing this was to try and protect your 67 00:06:37,780 --> 00:06:44,600 system from being attacked and having your data stolen. On a kind of similar note, this 68 00:06:44,600 --> 00:06:51,200 Cruncher from 93, so Cruncher would compress files on your system. So you could essentially, there 69 00:06:51,220 --> 00:07:00,320 ostensibly to save you space. Who's heard of MaxVision or MaxButler? Yeah, quite a few 70 00:07:00,320 --> 00:07:08,300 people. So MaxVision, MaxButler was a penetration tester and security researcher. He ran a 71 00:07:08,300 --> 00:07:13,200 website called whitehats.com. He also ran something called Arachnids, which was a kind of 72 00:07:13,200 --> 00:07:20,460 database of attack signatures. And in 1998, a group called ADM released a worm that 73 00:07:20,460 --> 00:07:27,800 exploited a vulnerability in DNS bind software. And MaxVision, whilst on the one hand kind of 74 00:07:27,800 --> 00:07:32,620 writing public blog articles about that worm, on the other hand developed a nematode that he 75 00:07:32,620 --> 00:07:38,400 released into the wild. So that nematode would exploit the bind vulnerability. It would then 76 00:07:38,400 --> 00:07:43,180 attempt to download and install a patch for it. And I believe it would try and kick off the 77 00:07:43,180 --> 00:07:50,340 malicious worm if it was on the system as well. Unfortunately, Max left a back door on the 78 00:07:50,340 --> 00:07:54,100 systems that were patched by that nematode so that he could access them whenever he wanted. 79 00:07:54,960 --> 00:08:00,160 And his nematode caused a lot of disruption in military networks that his nematode ended up 80 00:08:00,160 --> 00:08:05,980 infecting. If you haven't heard of him before and you're interested, Kevin Poulsen wrote a great 81 00:08:05,980 --> 00:08:11,420 book on him and his story called Kingpin, which describes how he went from kind of a white hat 82 00:08:11,420 --> 00:08:16,900 researcher to running a massive carding forum. So it's worth a read if you can get a hold of a 83 00:08:16,900 --> 00:08:20,320 copy. Polypedo. So Polypedo is the name of a web browser that has been running for a long time. It's 84 00:08:20,340 --> 00:08:26,140 a really interesting one. So this is a good example of a moral nematode. It's pretty basic. So 85 00:08:26,140 --> 00:08:33,460 it was from 2001. It was written in VBS. And what Polypedo did was it would scan your hard drive 86 00:08:34,060 --> 00:08:38,560 for images. And it would look at the file names of all those images. And it would compare those 87 00:08:38,560 --> 00:08:43,620 file names using regular expressions to a hard coded list of file names which were associated 88 00:08:43,620 --> 00:08:48,960 with child abuse. And if it found any of those images on your hard drive, it would send an e-mail 89 00:08:48,960 --> 00:08:50,320 to various law enforcement agencies. And it would send an e-mail to various law enforcement 90 00:08:50,340 --> 00:08:57,380 agencies and charities and other organizations attaching the images and kind of reporting it. So 91 00:08:58,020 --> 00:09:02,500 raising all sorts of really interesting legal and ethical questions about whether or not that's 92 00:09:02,500 --> 00:09:10,320 justified. Blaster versus Welchia. So talking about kind of more recent ones here. So the 93 00:09:10,320 --> 00:09:18,920 blaster worm obviously infected, exploited a vulnerability in DECOM RPC. Welchia was released 94 00:09:18,920 --> 00:09:20,320 about a week later. And it was released about a week later. And it was released about a week 95 00:09:20,340 --> 00:09:27,220 ago. And it was almost 1 year old. It was released on March 8th 20 or 21 and 2 weeks later. So 96 00:09:27,220 --> 00:09:31,120 we're slowly developing into, looking at like a 2012 version of it. It was released about 10 years 97 00:09:31,120 --> 00:09:35,660 ago. On May 1st 2021, we were glad that it pressed releasing and columству certainly 98 00:09:35,660 --> 00:09:37,500 really directly into the game. We'd hit the big numbers. But we do, I give you a few Yorkum 99 00:09:37,500 --> 00:09:50,320 s.coupl p ηnext page you'll find the introduction to it so you know it's written back and forth a 100 00:09:50,340 --> 00:09:55,540 they're kind of like connected short stories written by hackers about hacking. Some of the 101 00:09:55,540 --> 00:09:59,820 technology they speak about, a little bit dated now, but they're really good stories. And 102 00:09:59,820 --> 00:10:05,920 this particular one, the worm turns from 2003, describes a situation very similar to the 103 00:10:05,920 --> 00:10:20,320 blaster and Welch case study. So definitely worth a read if you can get hold of that. And 104 00:10:20,320 --> 00:10:25,440 all of which were at one point trying to kick each other off of infected hosts. And the authors 105 00:10:25,440 --> 00:10:30,880 were kind of trading insults in the source code of various versions of these worms as well. So 106 00:10:30,880 --> 00:10:40,060 good examples of malicious nematodes. And then even more recently, Mirai versus Hajime. So 107 00:10:40,060 --> 00:10:49,020 you'll be familiar with Mirai. Hajime was or is an IOT nematode that exploits some of the same 108 00:10:49,020 --> 00:10:50,300 vulnerabilities that Mirai does. So it's an IOT nematode that exploits some of the same 109 00:10:50,300 --> 00:10:53,040 vulnerabilities that Mirai does in terms of default passwords and things like that. 110 00:10:54,620 --> 00:11:01,940 Includes this message on infected hosts to let people know that it's infected it. And then I 111 00:11:01,940 --> 00:11:05,940 think most interestingly, the one that kind of I find most interesting is this one. So this 112 00:11:05,940 --> 00:11:14,480 is Brickabot versus Mirai, Reaper and various others. So in December last year, there was a 113 00:11:15,260 --> 00:11:20,280 post on Pacebin and Ghostbin and a few other places by someone calling themselves the 114 00:11:20,280 --> 00:11:28,920 Janitor. And they claimed to be the author of the Brickabot worm. So Brickabot would permanently 115 00:11:28,920 --> 00:11:33,540 disable machines infected by corrupting the firmware or overwriting the firmware with a bad 116 00:11:33,540 --> 00:11:40,740 image. And Janitor claims that they did that in order to prevent those devices subsequently 117 00:11:40,740 --> 00:11:50,100 being misused by Mirai and Reaper and participating in DDoS attacks. So that, again, raises all 118 00:11:50,100 --> 00:11:54,140 sorts of really interesting legal and ethical questions about whether it's preferable for 119 00:11:54,140 --> 00:12:00,040 devices to be bricked or preferable to let them remain vulnerable and then have them be used in 120 00:12:00,040 --> 00:12:04,680 massive DDoS attacks which end up potentially taking out parts of Internet infrastructure. 121 00:12:09,840 --> 00:12:15,540 So the kind of heyday of worms, I guess, was probably the mid-2000s. You obviously had 122 00:12:15,540 --> 00:12:20,080 Configure a few years later, which is, you know, probably the biggest one. And then, of course, 123 00:12:20,100 --> 00:12:26,560 the last one, but in recent times, traditional kind of network worms have decreased quite a lot. 124 00:12:26,760 --> 00:12:31,020 So you still get the occasional one. WannaCry is a good example. But generally things like exploit 125 00:12:31,020 --> 00:12:36,560 mitigations and better antivirus and security solutions, better patching management and 126 00:12:36,560 --> 00:12:42,320 incident response, generally just better security has meant that those kind of big network based 127 00:12:42,320 --> 00:12:49,660 traditional worms have fallen off to a great extent. So there were some previous attempts to try and 128 00:12:49,660 --> 00:12:54,060 formalize a kind of nematode framework and make it something that could be used by the security 129 00:12:54,060 --> 00:12:58,180 community and something that could be used by organizations to try and protect themselves from 130 00:12:58,880 --> 00:13:06,600 worms. So the first one that I'm aware of is a guy called Dr. Cyrus Pakari who gave a talk at 131 00:13:06,600 --> 00:13:15,480 DEFCON 9 back in 2001. And he was coming from the perspective of immunology and virology and 132 00:13:15,480 --> 00:13:19,640 applying that to computer security. So his concept was that it would be better for the 133 00:13:19,660 --> 00:13:24,940 community and it might be possible to create a kind of attenuated or weakened virus, release that 134 00:13:24,940 --> 00:13:30,960 in the wild in order to boost the immunity of antivirus systems and security solutions. So an 135 00:13:30,960 --> 00:13:36,880 interesting concept. It pretty much remained a concept. It was just a kind of thought experiment 136 00:13:36,880 --> 00:13:48,040 really. Then Dave Artel from ImmunitySec presented a talk in 2005 where he proposed a framework 137 00:13:48,040 --> 00:13:49,380 which would automatically 138 00:13:49,660 --> 00:13:56,100 generate nematodes based on exploits. So the idea was that you would feed in a recent exploit 139 00:13:56,100 --> 00:14:00,460 into his framework and it would then generate a nematode automatically which you could then 140 00:14:00,460 --> 00:14:05,880 deploy. Unfortunately, I've only been able to find the slides of that talk. I haven't been 141 00:14:05,880 --> 00:14:11,820 able to find any source code or demos. If anyone knows of where I can find any, that would be 142 00:14:11,820 --> 00:14:18,680 great. And then around the same kind of time, HP started something called active countermeasures. 143 00:14:19,660 --> 00:14:25,400 Which there's not a lot of detail available about it, but it was essentially using exploits to protect 144 00:14:25,400 --> 00:14:31,980 systems. And then in a similar vein, Fujitsu was approached, maybe contracted by the Japanese 145 00:14:31,980 --> 00:14:42,700 government in 2012, to do a similar kind of thing. So all of those proposed frameworks suggested a 146 00:14:42,700 --> 00:14:49,640 number of benefits. So to using nematodes on a corporate system. So as well as being able to kind of rapidly assess the 147 00:14:49,660 --> 00:14:54,100 an entire network for vulnerabilities and if they'd already been affected by worms to 148 00:14:54,100 --> 00:14:59,760 disinfect them and patch them. Some people also suggested that nematodes could be used for 149 00:14:59,760 --> 00:15:04,700 things like distributed searching, for self-discovering networks, so discovering things 150 00:15:04,700 --> 00:15:09,900 like shadow IT or hosts which weren't kind of 100% up. And even potentially vulnerability 151 00:15:09,900 --> 00:15:17,740 scanning. So consistent vulnerability scanning where every host is a scanner. The counter 152 00:15:17,740 --> 00:15:23,860 arguments for that are many, really. So firstly, there's legality. So just releasing a nematode 153 00:15:23,860 --> 00:15:28,820 into the wild in the majority of countries is going to be illegal because you're still 154 00:15:28,820 --> 00:15:34,560 accessing and modifying someone else's system without authorization. There's also an ethics 155 00:15:34,560 --> 00:15:38,940 question to it as well, whether it's right to do that, whether it's right for someone to kind of 156 00:15:39,440 --> 00:15:45,420 take on that role of deciding that they're going to sort out your security for you. There's 157 00:15:45,420 --> 00:15:47,720 also a trust model. So evidence from the, you know, the, you know, the, you know, the 158 00:15:47,740 --> 00:15:54,100 max vision case study where despite developing a kind of beneficial nematode, he also put a back 159 00:15:54,100 --> 00:16:00,100 door in it as well. So what makes us able to trust nematode developers any more than a worm 160 00:16:00,100 --> 00:16:06,820 developer? Obvious issues with denial of service and bandwidth as well. So because nematodes 161 00:16:06,820 --> 00:16:11,760 will be, like worms, consistently scanning for new hosts to attack and will be replicating. 162 00:16:12,060 --> 00:16:17,720 That can potentially cause issues with that as well. Hard to talk about the 163 00:16:17,740 --> 00:16:23,460 target and control. So even if you are only launching a nematode on an internal network, 164 00:16:24,100 --> 00:16:29,780 maybe a fairly small network, if that somehow gets onto a removable device and that's then 165 00:16:29,780 --> 00:16:34,860 plugged into another machine, then that can spread that way potentially. And lastly, just 166 00:16:34,860 --> 00:16:40,180 that worms are difficult to do. Difficult to do well anyway. So it's hard to write an effective 167 00:16:40,180 --> 00:16:44,620 and efficient worm which isn't going to crash the host that it infects. It's not going to generate 168 00:16:45,080 --> 00:16:46,400 too much network traffic. 169 00:16:49,200 --> 00:16:54,980 So of those frameworks, none of them really went anywhere. None of them really addressed that fear 170 00:16:54,980 --> 00:17:01,260 factor. And combined with the demise of those traditional big network worms, it pretty much meant 171 00:17:01,260 --> 00:17:10,300 that the concept died a death really. Now, nematodes are kind of new generations of worms, 172 00:17:10,480 --> 00:17:17,540 possibly could make it worthwhile reopening this debate. So if you look at some recent 173 00:17:17,740 --> 00:17:24,020 and not so recent vulnerabilities and exploits, so taking this from the left, you have the 174 00:17:24,020 --> 00:17:28,960 Philips Hue light bulb. So a Black Hat talk a couple of years ago described creating a worm 175 00:17:28,960 --> 00:17:33,960 using the Philips Hue light bulb which could spread across an entire city. You've then got 176 00:17:33,960 --> 00:17:41,560 Broad Pwn looking at vulnerabilities in Broadcom Wi-Fi chipsets. Going back a few years, malware 177 00:17:41,560 --> 00:17:47,640 in RFID tags and readers that could spread from the tag to the reader and then from the reader to 178 00:17:47,740 --> 00:17:53,300 every tag that touched the reader. So the proof of concept for that one was SQL injection, fairly 179 00:17:53,300 --> 00:18:00,620 easy to do. Blue born, vulnerabilities in implementations of Bluetooth. The Arduino YUN, so 180 00:18:00,620 --> 00:18:05,700 that was a paper from a couple of years ago about a wormable vulnerability in that particular 181 00:18:06,240 --> 00:18:13,180 Arduino board. And then at the bottom, various IoT devices. Now, these specific devices aren't 182 00:18:13,180 --> 00:18:17,720 necessarily vulnerable to attacks. It's just a kind of illustration of the types of devices that 183 00:18:17,740 --> 00:18:22,260 are used in the device. So particularly interesting there, you've got an IP camera. And I'll talk 184 00:18:22,260 --> 00:18:32,100 about that a bit later on. So given that there are potentially a new generation of worms on the 185 00:18:32,100 --> 00:18:37,180 horizon that use different methods for propagation where traditional vulnerability management 186 00:18:37,180 --> 00:18:42,860 doesn't necessarily apply, and applying patches can be very difficult. You might be talking about 187 00:18:42,860 --> 00:18:47,720 having to have physical access to the device, getting firmware updates over the air, and then 188 00:18:48,360 --> 00:18:54,660 potentially time consuming to do that as well if you have a big network of IoT devices. Many 189 00:18:54,660 --> 00:18:59,100 exploit mitigation mechanisms might not be possible depending on what kind of system it is. 190 00:18:59,560 --> 00:19:05,780 You've also got a proliferation now of IoT devices in corporate environments. So there was a 191 00:19:05,780 --> 00:19:12,360 good talk yesterday about smart speakers by Stephen Hill about how many organizations now just 192 00:19:12,360 --> 00:19:17,700 have Sonos speakers in their office. And also, as well, if you work in security, if you work in 193 00:19:17,700 --> 00:19:22,060 security, and you want to demonstrate to a client or you want to demonstrate to supervisors or 194 00:19:22,060 --> 00:19:27,860 whatever, how damaging worms can be, nematodes are a really good way to do that, potentially. 195 00:19:30,200 --> 00:19:36,780 Okay. So I'm going to run through some demos. So the first one is an example of a true nematode. 196 00:19:37,160 --> 00:19:43,940 So this is a fairly recent exploit. It was March this year. It's a command injection vulnerability 197 00:19:43,940 --> 00:19:47,680 in a web application called clip bucket. So I wrote this. It's a fairly recent exploit. It's a 198 00:19:47,680 --> 00:19:54,180 worm in Python. That worm exploits the vulnerability. It downloads and runs a copy of 199 00:19:54,180 --> 00:19:59,160 itself. It puts a web shell on the infected machine just to demonstrate that it can. And 200 00:19:59,160 --> 00:20:05,560 then it starts to scan for new targets. The nematode obviously exploits the same 201 00:20:05,560 --> 00:20:11,100 vulnerability. It searches for both the malicious worm and for the PHP back door. Deletes 202 00:20:11,100 --> 00:20:17,520 both of them. It takes the PHP file that contains the vulnerability and renames it. And 203 00:20:17,520 --> 00:20:22,580 then creates a new version of that PHP file which just warns the user that they have a 204 00:20:22,580 --> 00:20:32,320 vulnerability and they need to update. And then it will scan and replicate. So I have four 205 00:20:32,840 --> 00:20:47,500 virtual machines here that all have Clipbucket running as a web application. And then 206 00:20:49,860 --> 00:20:52,700 it's running the web application. And this is just to kind of show at the moment that there's 207 00:20:52,700 --> 00:21:04,980 nothing on the system. This is kind of a fresh install of that web app. I'll skip forward a 208 00:21:04,980 --> 00:21:17,500 little bit. Okay. So this is the malicious worm being run. So it's running in just a small 209 00:21:17,520 --> 00:21:24,040 subnet. Finds four vulnerable web applications. Exploits them. Reports back to a dashboard. 210 00:21:33,640 --> 00:21:38,580 So it just tells us that they've been infected. If you then look at the individual machines, 211 00:21:39,060 --> 00:21:43,280 that's the malicious worm that's now been replicated. And you can see there's a shell.PHP 212 00:21:43,280 --> 00:21:47,500 file on there as well. So the shell.PHP is running. And then it's running the web application. And 213 00:21:47,500 --> 00:22:02,480 the shell.PHP is just a one line PHP back door that's been put on there. So it's just 214 00:22:02,480 --> 00:22:06,940 demonstrating that this has happened on all four of the machines. This is the back door. That's 215 00:22:06,940 --> 00:22:13,460 what it looks like. It's a very simple example. And then just to demonstrate that that does work. 216 00:22:24,840 --> 00:22:29,540 So you can execute commands with the web shell which is great. So all those machines have now 217 00:22:29,540 --> 00:22:36,020 been infected. And then this is running the nematode. So this is doing exactly the same 218 00:22:36,020 --> 00:22:41,620 thing. It's based on the malicious worm. Checking the same subnet. Again reporting back to the 219 00:22:41,620 --> 00:22:47,480 dashboard. And it should tell us that they've all been now disinfected. So this is just a little 220 00:22:52,980 --> 00:22:56,400 And then if we have a look at the individual machines, you can see it's renamed the 221 00:22:56,400 --> 00:23:04,080 vulnerable file, which is file underscore uploader.PHP. It's put a back dot BAK file, 222 00:23:04,520 --> 00:23:09,360 renamed it to that. And this is the new version of file underscore uploader.PHP, which just 223 00:23:09,360 --> 00:23:12,540 tells the user that they need to update and it gives them a vulnerability reference. 224 00:23:18,640 --> 00:23:24,800 The nematode also removes the shell.PHP, so it moves the back door so that can't now be 225 00:23:24,800 --> 00:23:37,080 used. And it's done that for all four machines. So in terms of practically applying that, 226 00:23:37,140 --> 00:23:42,520 how you would do that, one option could be that you have a feed, an external machine, 227 00:23:42,540 --> 00:23:47,440 vulnerability feed, something like exploit DB, something like that, and you assess for new 228 00:23:47,440 --> 00:23:52,280 vulnerabilities whether or not they are wormable. And if they are, or you start to hear that a 229 00:23:52,280 --> 00:23:57,760 worm exists in the wild, exploiting that vulnerability, then you can launch a nematode on 230 00:23:57,760 --> 00:24:02,800 your network that checks for it, that removes malicious worms if they're found, and tries to 231 00:24:02,800 --> 00:24:07,120 perform some kind of patch. So you would do this, you could either do this with an official patch 232 00:24:07,120 --> 00:24:14,980 if one has been released, or you can do a kind of temporary workaround. Okay. Second demo is an 233 00:24:14,980 --> 00:24:23,580 IOT nematode. So this is an IP camera manufactured under various brand names. There are two 234 00:24:23,580 --> 00:24:28,720 vulnerabilities in it, which can be chained together to make it wormable. So the first is a 235 00:24:28,720 --> 00:24:33,260 pre-authentication credential disclosure. So you get the username and password to access the 236 00:24:33,260 --> 00:24:37,100 camera. And then the second is authenticated command injection. So the first is a 237 00:24:37,100 --> 00:24:40,480 pre-authentication credential disclosure. So the vendors of this camera have tried to address 238 00:24:40,480 --> 00:24:45,060 these and some other vulnerabilities. So it used to be that you could just telnet into these 239 00:24:45,060 --> 00:24:50,800 cameras with no username, no password, and get a root prompt. They've now disabled telnet by 240 00:24:50,800 --> 00:24:56,120 default, so you don't have telnet access. Users are encouraged to change that default username and 241 00:24:56,120 --> 00:25:04,180 password. It also randomizes the HTTP port for the web server of the camera, which is a kind of, I 242 00:25:04,180 --> 00:25:07,080 guess, security through obscurity, more than anything else. So it's a very, very, very 243 00:25:07,080 --> 00:25:13,060 important thing. But the underlying vulnerabilities are still there. So the worm can retrieve 244 00:25:13,060 --> 00:25:19,220 credentials from the web server, use those to execute commands as an authenticated user. You can 245 00:25:19,220 --> 00:25:27,300 then just re-enable telnet and still get a root prompt. So I was feeling pretty masochistic, I 246 00:25:27,300 --> 00:25:33,060 guess, so I tried to write this worm in bash. Turns out bash wasn't installed on the camera after 247 00:25:33,060 --> 00:25:37,060 many hours, so it turned out to be an SH worm instead. So I tried to write this worm in bash. So 248 00:25:37,080 --> 00:25:42,540 what the worm does, it retrieves a .ini file which contains credentials, extracts them, uses 249 00:25:42,540 --> 00:25:51,020 those for command injection, and then replicates. So the demo didn't take hours to show you. I've 250 00:25:51,020 --> 00:25:57,920 put the cameras on sequential IP addresses with a static HTTP port. To show, so what the worm 251 00:25:57,920 --> 00:26:02,900 will do is it will enable telnet again with a root prompt. It will also spin the camera around, 252 00:26:03,000 --> 00:26:07,060 so there's a kind of visual indication that it's been infected. And then the number of times it's 253 00:26:07,080 --> 00:26:11,040 been infected, the telnetode will run and it will stop the camera from spinning and then disable 254 00:26:11,040 --> 00:26:21,840 telnet again. So at the moment, you can see that you can't telnet into any of these cameras. 255 00:26:31,320 --> 00:26:37,060 So I'm now running the malicious worm, which is going to infect these three cameras here. And 256 00:26:37,080 --> 00:26:41,540 you can see it starts some spinning. You can see on the screen that you've got user name and 257 00:26:41,540 --> 00:26:53,900 password as well and that we're replicating onto the web server. Okay. And then you can see there 258 00:26:54,340 --> 00:27:06,720 that we can now telnet in and get a root prompt on those cameras. Oops. Sorry. So you can see 259 00:27:14,020 --> 00:27:19,780 it's going to stop those cameras from spinning. It's then going to clear up the malicious worm 260 00:27:20,580 --> 00:27:28,580 and it is also going to disable telnet access. So I will now not be able to telnet into these 261 00:27:28,580 --> 00:27:37,060 cameras anymore. And then the next thing I'm going to do is I'm going to go back to the 262 00:27:37,080 --> 00:27:44,120 last demo is the one that I think is the most interesting. So I wanted to try and create, just 263 00:27:44,120 --> 00:27:50,640 for purely educational experimental purposes, an improved version of that poly pedo worm. So 264 00:27:50,640 --> 00:27:54,620 definitely not advocating that anyone do this in the wild or actually put this stuff out there. 265 00:27:55,560 --> 00:28:00,340 But I thought there were kind of several problems with poly pedo that could be improved on. So it 266 00:28:00,340 --> 00:28:05,960 wasn't efficient. It spread by mailing lists. And it determined what was suspicious content by 267 00:28:05,960 --> 00:28:07,060 the file name of the image. So I'm going to go back to the last demo and I'm going to go back to the 268 00:28:07,080 --> 00:28:13,240 image. Which isn't particularly robust. So when you're talking about kind of comparing images, 269 00:28:13,400 --> 00:28:19,120 obviously cryptographic hashes are the most common way to do that. So something like MD5, for 270 00:28:19,120 --> 00:28:25,600 instance, there are kind of flaws associated with using that. Probably the biggest flaw is that 271 00:28:25,600 --> 00:28:29,500 if very, very slight edits are made to images, it results in a completely different cryptographic 272 00:28:29,500 --> 00:28:34,560 hash. So the solution is something called perceptual hashing. Has anyone heard of perceptual 273 00:28:34,560 --> 00:28:37,060 hashing before? Yeah, a couple of people. So the solution is something called perceptual hashing. 274 00:28:37,080 --> 00:28:44,500 So perceptual hashing is a measure of the similarity of two images. You can, there are various 275 00:28:44,500 --> 00:28:49,440 ways to do it. Reverse image searching would tend to use some kind of perceptual hashing 276 00:28:49,440 --> 00:28:55,700 algorithm. Mine is nowhere near as complicated as that. But it is fairly robust in the demos that 277 00:28:55,700 --> 00:29:02,060 I'm going to show you. So essentially what it does is, and it's based on some previous work in 278 00:29:02,060 --> 00:29:07,060 this area, is it will break an image down into eight by eight pixels. And then it will go back to the 279 00:29:07,080 --> 00:29:12,040 top. It will then retrieve the pixel values, calculate an average pixel value. And then for 280 00:29:12,040 --> 00:29:17,100 every pixel, if the pixel is above the average, it will assign a one to a string. If it's below, 281 00:29:17,240 --> 00:29:22,440 it will assign a zero. So you end up with a 64-bit string of ones and zeroes, which is a 282 00:29:22,440 --> 00:29:30,240 representation of how each pixel differs from the average, whether it's higher or lower. So you 283 00:29:30,240 --> 00:29:36,300 can then just compare that string. So just do simple string matching. And for what is like a 284 00:29:36,300 --> 00:29:37,060 really primitive way of doing this, you can just do a simple string matching. And for what is like a 285 00:29:37,080 --> 00:29:45,780 really primitive way of doing this, you can just do a simple string matching. And for what is like a 286 00:29:45,780 --> 00:29:48,300 really primitive way of doing this, you can just do a simple string matching. And for what is like a 287 00:29:48,300 --> 00:29:49,480 really primitive way of doing this, you can just do a simple string matching. And for what is like a 288 00:29:49,480 --> 00:29:51,420 really primitive way of doing this, you can just do a simple string matching. And for what is like a 289 00:29:51,420 --> 00:29:53,880 really primitive way of doing this, you can just do a simple string matching. And for what is like a 290 00:29:53,880 --> 00:29:55,720 really primitive way of doing this, you can just do a simple string matching. And for what is like a 291 00:29:55,720 --> 00:29:57,500 really primitive way of doing this, you can just do a simple string matching. And for what is like a 292 00:29:57,500 --> 00:30:01,360 really primitive way of doing this, you can just do a simple string matching. And for what is like a 293 00:30:01,880 --> 00:30:06,140 really primitive way of doing this, you can just do a simple string matching. And for what is like a 294 00:30:06,140 --> 00:30:13,440 above 90% it will send an e-mail and attach those images. Replication is over USB so it will 295 00:30:13,440 --> 00:30:19,060 check for attached removable media and it uses a technique that's been seen in the wild before 296 00:30:19,060 --> 00:30:24,800 for I think it was KJ Worm, NJ Rat, that kind of family. So it will replicate itself as a hidden 297 00:30:24,800 --> 00:30:29,920 file, create a visible shortcut with a notepad icon and then the target of that shortcut is a 298 00:30:29,920 --> 00:30:36,200 hidden file. So the examples that I'm going to use for this demo are this one, so you have an 299 00:30:36,200 --> 00:30:41,540 image of a plane that's just been resized, that's been cut down. You have an image where there's 300 00:30:41,540 --> 00:30:48,340 been a very slight modification. And then you have two stills from the same video at different 301 00:30:48,340 --> 00:30:59,900 points. So obviously visually similar but different images. Okay. So this is the input of 302 00:30:59,920 --> 00:31:04,860 the box that notification is going to come into. It's empty at the moment. There's a USB drive 303 00:31:04,860 --> 00:31:13,800 attached to this laptop that is also empty at the moment. So this is the folder of original images 304 00:31:13,800 --> 00:31:29,900 and the corresponding perceptual hash values. And then this is the folder of the images that 305 00:31:29,920 --> 00:31:42,640 the nematode is going to check for suspicious images. So when the nematode is run, you'll be 306 00:31:42,640 --> 00:31:47,460 able to see that it starts to find some matches. It indicates what might be a match, says 307 00:31:47,460 --> 00:31:54,800 it's sending us an e-mail and at the end it replicates itself. So the plane which was the 308 00:31:54,800 --> 00:31:59,900 resized was a 95% possible match. The slight modification 98%. The one that's going to be the 309 00:31:59,900 --> 00:32:05,840 percent. And the video still is 93 percent. So we go and check the inbox now. We can see 310 00:32:05,840 --> 00:32:11,680 that it sent us an e-mail. It said I've infected this machine. I found this image which 311 00:32:11,680 --> 00:32:17,440 matches this reference image. Here's the similarity score. Let me know if I've got it 312 00:32:17,440 --> 00:32:37,860 right. And it's done that for all three of those results. And then the nematode is also 313 00:32:37,860 --> 00:32:47,420 replicated over to the USB drive. So if we have a look at that. And then we can see that 314 00:32:49,820 --> 00:32:54,180 there's a shortcut file in there which just says my notes and the target for that is a hidden 315 00:32:54,180 --> 00:33:03,820 XE which is the nematode which is also on there. So if we refresh the file listing for the 316 00:33:03,820 --> 00:33:12,440 drive, you can then see the hidden executable. So there are some refinements that could in 317 00:33:12,440 --> 00:33:16,300 theory be made to that to kind of make it a bit more robust. So you could have like a depth 318 00:33:16,300 --> 00:33:17,420 count of infections. You could make it a bit more robust. So you could make it a bit more 319 00:33:17,420 --> 00:33:21,080 complex. You could also have other replications so you can only infect so many machines after 320 00:33:21,080 --> 00:33:28,080 initial infection. You can also have alternative replication methods as well. Okay. So the 321 00:33:28,080 --> 00:33:32,980 last thing I wanted to talk to you about was antidote. So antidote is something that we're 322 00:33:32,980 --> 00:33:39,500 working on at PwC. We're in the very, very early stages of doing it. The goal, the kind of, 323 00:33:39,520 --> 00:33:47,400 the idea is to create a modular free open source framework for people to develop and use IOT and 324 00:33:47,400 --> 00:33:54,880 nematodes, nematodes in general but with a focus on IoT on their own networks. So the dream is to 325 00:33:54,880 --> 00:34:01,680 have this as a kind of nematode version of Metasploit. So you can overcome a lot of those 326 00:34:02,230 --> 00:34:09,760 early criticisms of nematodes and nematode frameworks by customizing the exact payloads that 327 00:34:09,760 --> 00:34:14,600 are used, deciding whether or not you want it to replicate and how much, whether you want a delay 328 00:34:14,600 --> 00:34:20,320 between scans and exploitation, whether you want a host to reboot once they've been fixed and 329 00:34:20,320 --> 00:34:27,800 scanned and whether you want patches to be applied. So it is very much in the early stages. I'll 330 00:34:27,800 --> 00:34:32,100 just show you kind of a video so you've got an idea of what it might look like. So this is a kind 331 00:34:32,100 --> 00:34:37,560 of proof of concept. But it would be great to get your thoughts on this and your feedback and if 332 00:34:37,560 --> 00:34:41,820 you want to get involved in the development or you've got any thoughts, it would be great to 333 00:34:41,820 --> 00:34:44,580 hear from you. I'll put my contact details up at the end of the presentation. So if you want to 334 00:34:44,580 --> 00:34:49,560 get involved, I'll put my contact details up at the end of the talk. So this is kind of a just a 335 00:34:49,560 --> 00:34:56,580 demo version that just shows the kind of features that it might have. So it's kind of a console 336 00:34:56,580 --> 00:35:01,020 based framework. You can load in various modules according to whether they're web apps or 337 00:35:01,020 --> 00:35:06,100 whether they're IP cameras or whatever it is and obviously there would be more kind of IOT devices 338 00:35:06,660 --> 00:35:13,740 in those categories. You can then load a module in. You can see some info about it. So whether or 339 00:35:13,740 --> 00:35:14,560 not it supports the network, whether it supports the network, whether it supports the network, 340 00:35:14,580 --> 00:35:19,920 whether it supports things like disinfection, patching, replication, what data was released, 341 00:35:20,080 --> 00:35:26,480 obviously what version of software it affects and targets. And then in order to do some kind of 342 00:35:26,480 --> 00:35:32,520 damage control so it doesn't leak out into the wild, you can set a starting IP address, an end 343 00:35:32,520 --> 00:35:38,300 IP address, how many IP addresses each worm should scan, whether or not you want to use 344 00:35:38,300 --> 00:35:44,040 disinfection, patching, replication. You can have a time delay in between exploitation attack 345 00:35:44,040 --> 00:35:48,480 attack attempts so that, you know, you can kind of avoid bandwidth and denial of service 346 00:35:48,480 --> 00:35:55,020 problems. You can have a kill switch as well. And you can finally have the nematode, if you 347 00:35:55,020 --> 00:36:00,980 want, delete itself after it's done its job. And then it will support log files as well, so 348 00:36:00,980 --> 00:36:13,320 writing logs of what it's done. So if you do want to get involved in that, let me know. Just 349 00:36:13,320 --> 00:36:17,000 to say again, we are at the very early stages, but it would be great to have this as a kind of 350 00:36:17,000 --> 00:36:21,720 community project. We want as many people to get involved as we can. My Twitter handle is 351 00:36:21,720 --> 00:36:28,560 there. So to sum up, nematodes are a novel idea. I think they still are a really novel idea. 352 00:36:29,160 --> 00:36:33,400 Ultimately not successful when they were kind of first discussed and first deployed. And 353 00:36:33,400 --> 00:36:37,920 because of that demise of the big traditional network worms, they weren't really applicable. 354 00:36:38,920 --> 00:36:43,300 But I think with the onset of worms that use, you know, you know, you know, you know, you 355 00:36:43,300 --> 00:36:47,400 know, different methods to propagate, replicate, and exploit, there's potentially an 356 00:36:47,400 --> 00:36:54,000 argument to say that nematodes could be useful in the future. There are obviously still 357 00:36:54,000 --> 00:36:59,640 concerns that would affect it. But I think that it's potentially an area of promise. 358 00:37:00,520 --> 00:37:05,100 Antidote is our very kind of experimental approach to doing that. And if nothing else, 359 00:37:05,120 --> 00:37:10,360 hopefully it will stimulate some debate and get people talking. So there's lots of 360 00:37:10,360 --> 00:37:13,280 references here if you want some reading. And if you have any questions, please let me know. 361 00:37:13,300 --> 00:37:18,940 About the case studies that I talked about. Various other bits and pieces. Twitter handles 362 00:37:18,940 --> 00:37:23,580 there again. Email address if you want to email me. But yeah, that's it. Thank you very much.